Skill Tracer
Skills › Archify › archify › L4LY553T.js

L4LY553T.js

3 lines · archify/explainer/vendor/pele/chunks/L4LY553T.js at a406594

1import{a as F}from"./RVARI57O.js";import{c as Ne}from"./DKTLEL5E.js";import{a as Zt,d as at,e as qt,g as Ie}from"./GUJTEFZK.js";import{a as Ce,b as te,c as f,d as st,m as ee,n as $e,o as ne}from"./IZOKQ2GT.js";import{a as Se,c as Jt,g as Le}from"./XTDUIGUI.js";var $t=class{type="xychart";title;accTitle;accDescr;orientation;xAxis={type:"band",title:"",categories:[]};yAxis={type:"linear",title:"",min:1/0,max:-1/0};hasSetXAxis=!1;hasSetYAxis=!1;plots=[];setOrientation(e){this.orientation=e==="horizontal"?"horizontal":"vertical"}setXAxisTitle(e){this.xAxis.title=e.text.trim()}setXAxisRangeData(e,i){this.xAxis={type:"linear",title:this.xAxis.title,min:e,max:i},this.hasSetXAxis=!0}setXAxisBand(e){this.xAxis={type:"band",title:this.xAxis.title,categories:e.map(i=>i.text.trim())},this.hasSetXAxis=!0}setYAxisTitle(e){this.yAxis.title=e.text.trim()}setYAxisRangeData(e,i){this.yAxis={type:"linear",title:this.yAxis.title,min:e,max:i},this.hasSetYAxis=!0}plotData(e){if(e.length===0)return[];this.hasSetXAxis||this.setXAxisRangeData(1,e.length);let i=this.xAxis;if(i.type==="band"&&e.length>i.categories.length&&(e=e.slice(0,i.categories.length)),!this.hasSetYAxis){let{min:h,max:a}=this.yAxis;for(let l of e)l<h&&(h=l),l>a&&(a=l);this.yAxis={type:"linear",title:this.yAxis.title,min:h,max:a}}if(i.type==="band")return i.categories.map((h,a)=>[h,e[a]]);if(e.length===1)return[[`${i.min}`,e[0]]];let c=(i.max-i.min)/(e.length-1);return e.map((h,a)=>[`${i.min+a*c}`,h])}addPlot(e,i,c){let h={type:e,title:i.text.trim(),data:this.plotData(c.map(a=>a.value))};e==="line"&&c.some(a=>a.label.trim()!=="")&&(h.pointLabels=c.map(a=>a.label.trim())),this.plots.push(h)}setLineData(e,i){this.addPlot("line",e,i)}setBarData(e,i){this.addPlot("bar",e,i)}setDiagramTitle(e){this.title=e}setAccTitle(e){this.accTitle=e.replace(/^\s+/g,"")}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
2`)}};var ie=["$end","INVALID","NEWLINE","title","acc_title","acc_title_value","acc_descr","acc_descr_value","acc_descr_multiline_value","XYCHART","CHART_ORIENTATION","X_AXIS","Y_AXIS","ARROW_DELIMITER","LINE","BAR","NUMBER_WITH_DECIMAL","SQUARE_BRACES_START","SQUARE_BRACES_END","STR","ALPHA","COLON","PLUS","COMMA","EQUALS","MULT","BRKT","UNDERSCORE","DOT","AMP","MINUS","NUM","SEMI","EOF"];var De=[33,33,33,33,33,19,5,7,8],ke="`)"+" ".repeat(36)+'{ this.pushstate(md_string); }\n<md_string>(?:(?!`").)+'+" ".repeat(18)+"{ return md_str; }\n<md_string>(?:`",ae=new Uint8Array(128);for(let[n,e]of[[":",21],["+",22],[",",23],["=",24],["*",25],["#",26],["_",27],[".",28],["&",29],["-",30],[";",32]])ae[n.charCodeAt(0)]=e;function we(n){let e=n.length,i=[],c=[],h=[],a=[],l=0,t=0,u=(r,A,x)=>{i.push(r),c.push(n.slice(A,x)),h.push(A),t=x},y=r=>{a.push(l),l=r},_=()=>{a.length>0&&(l=a.pop())},C=r=>{let A=n.indexOf(`
3`,r);return A===-1?e:A},o=r=>{for(;r<e&&Zt(n.charCodeAt(r));)r++;return r},M=r=>{for(;at(n.charCodeAt(r));)r++;return r},m=r=>F(n,t,r)&&!Ie(n.charCodeAt(t+r.length));for(;t<e;){let r=n.charCodeAt(t);if(l===5){if(r===34)t++,_();else{let x=n.indexOf('"',t);u(19,t,x===-1?e:x)}continue}if(l===6||l===7){u(De[l],t,C(t)),_();continue}if(l===8){if(r===125)t++,_();else{let x=n.indexOf("}",t);u(8,t,x===-1?e:x)}continue}let A=n.charCodeAt(t+1);if(r===37&&A===37){t=C(t+2);continue}if(r!==125&&A===37&&n.charCodeAt(t+2)===37){t=C(t+3);continue}if(r===10||r===13){if((l===1||l===3)&&(r===10||A===10)){u(2,t,r===10?t+1:t+2),_();continue}let x=t+1;for(let S=n.charCodeAt(x);S===10||S===13;S=n.charCodeAt(++x));u(2,t,x);continue}switch(r|32){case 116:if(m("title")){u(3,t,t+5);continue}break;case 97:if(F(n,t,"acc")){let x=F(n,t+3,"descr");if(x||F(n,t+3,"title")){let S=o(t+8),E=n.charCodeAt(S);if(E===58){u(x?6:4,t,o(S+1)),y(x?7:6);continue}if(E===123&&x){t=o(S+1),y(8);continue}}}break;case 120:if(m("xychart-beta")){u(9,t,t+12);continue}if(m("xychart")){u(9,t,t+7);continue}if(m("x-axis")){u(11,t,t+6),y(1);continue}break;case 121:if(m("y-axis")){u(12,t,t+6),y(1);continue}break;case 118:if(F(n,t,"vertical")){u(10,t,t+8);continue}break;case 104:if(F(n,t,"horizontal")){u(10,t,t+10);continue}break;case 108:if(m("line")){u(14,t,t+4),y(3);continue}break;case 98:if(m("bar")){u(15,t,t+3),y(3);continue}break}if(r===91){l===1?y(2):l===3&&y(4),u(17,t,t+1);continue}if(r===93){(l===4||l===2)&&_(),u(18,t,t+1);continue}if(l===1&&r===45&&A===45&&n.charCodeAt(t+2)===62){u(13,t,t+3);continue}if(l===1||l===4){let x=r===43||r===45?t+1:t,S=n.charCodeAt(x),E=-1;if(at(S)?(E=M(x+1),n.charCodeAt(E)===46&&at(n.charCodeAt(E+1))&&(E=M(E+2))):S===46&&at(n.charCodeAt(x+1))&&(E=M(x+2)),E!==-1){u(16,t,E);continue}}if(r===96&&F(n,t,ke)){t+=ke.length,_();continue}if(r===34){t++,y(5);continue}if(qt(r)){let x=t+1;for(;qt(n.charCodeAt(x));)x++;u(20,t,x);continue}if(at(r)){u(31,t,M(t+1));continue}if(Zt(r)){t=o(t+1);continue}if(r<128&&ae[r]!==0){u(ae[r],t,t+1);continue}break}return t<e?(i.push(1),c.push(""),h.push(t),{types:i,texts:c,starts:h}):(i.push(De[l]),c.push(""),h.push(e),i.push(0),c.push(""),h.push(e),{types:i,texts:c,starts:h})}function ve(...n){let e=new Uint8Array(34);for(let i of n)e[i]=1;return e}var Oe=ve(29,31,20,22,24,25,28,26,30,27),Xe=ve(2,32,33);function Ue(n,e){let{types:i,texts:c,starts:h}=we(n),a=0,l=o=>{let M=i[a];throw M===1?Jt("xychart",n,h[a],"",!0):Jt("xychart",n,h[a],`Expecting ${o}, got '${ie[M]}'`)},t=o=>(i[a]!==o&&l(`'${ie[o]}'`),c[a++]),u=o=>o===19||Oe[o]===1,y=()=>{u(i[a])||l("'STR', 'ALPHA', 'NUM'");let o=c[a++];if(i[a-1]!==19)for(;Oe[i[a]]===1;)o+=c[a++];return{text:o,type:"text"}},_=()=>{let o=Number(t(16));return t(13),[o,Number(t(16))]},C=()=>{let o=[];for(t(17);;){let M=Number(t(16));if(o.push({value:M,label:i[a]===19?c[a++]:""}),i[a]!==23)break;a++}return t(18),o};for(;;)if(Xe[i[a]]===1)a++;else{if(i[a]!==9)break;i[++a]===10&&e.setOrientation(c[a++])}for(;i[a]!==0;){let o=i[a++];switch(o){case 3:e.setDiagramTitle(y().text.trim());break;case 11:case 12:{let M=u(i[a])?y():void 0;if(o===11&&i[a]===17){let m=[];do a++,m.push(y());while(i[a]===23);t(18),e.setXAxisBand(m)}else if(i[a]===16||M===void 0){let[m,r]=_();o===11?e.setXAxisRangeData(m,r):e.setYAxisRangeData(m,r)}o===11?e.setXAxisTitle(M??{type:"text",text:""}):e.setYAxisTitle(M??{type:"text",text:""});break}case 14:case 15:{let M=i[a]===17?{text:"",type:"text"}:y(),m=C();o===14?e.setLineData(M,m):e.setBarData(M,m);break}case 4:e.setAccTitle(t(5).trim());break;case 6:e.setAccDescription(t(7).trim());break;case 8:e.setAccDescription(c[a-1].trim());break;default:a--,l("'title', 'X_AXIS', 'Y_AXIS', 'LINE', 'BAR', 'acc_title', 'acc_descr', 'acc_descr_multiline_value'")}for(;Xe[i[a]]===1;)a++}}function se(n,e){let i=n/Math.max(e,1),c=Math.floor(Math.log10(i)),h=i/10**c,a=h>=7.07?10:h>=3.16?5:h>=1.41?2:1;return c<0?-(10**-c)/a:a*10**c}function xt(n,e){return n>0?e/n:e*-n}function ot(n,e){return n>0?e*n:e/-n}function oe(n,e,i){let c=Math.round(xt(i,n));ot(i,c)<n&&c++;let h=Math.round(xt(i,e));ot(i,h)>e&&h--;let a=[];for(let l=c;l<=h&&a.length<100;l++)a.push(ot(i,l));return a}var Te=4,rt=12,Be=26,Pe=24,He=1e300;function re(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)?n:{}}function O(n,e,i=!0){let c=n[e];return typeof c=="boolean"?c:i}function We(n,e){return typeof n=="number"&&n>0?Math.round(Math.min(Math.max(n,100),4e3)):e}function K(n){return typeof n=="number"&&isFinite(n)?Math.min(Math.max(n,-He),He):void 0}function Je(n){let e=0;for(let i of n)e=Math.max(e,i.label.width);return e}function Nt(n,e,i,c){let h=n.lines.length===1?n.lines[0]:void 0;return h&&h.length===1&&h[0].icon===void 0&&h[0].style===0?`<text x="${f(e)}" y="${f(i+n.size*.35)}" text-anchor="${c}">${Ce(h[0].text)}</text>`:st(n,e+(c==="start"?n.width/2:c==="end"?-n.width/2:0),i,"")}function Ye(n,e,i){if(n.plots.length===0)throw new Se("No Plot to render, please provide a plot with some data","semantic",{type:"xychart"});let c=re(e.xyChart),h=i.fontSize??16,a=Math.round(h*.875),l=Math.round(h*.75),t=i.measurer??Le(i.fontFamily),u=i.padding??8,y=We(c.width,700),_=Ne(i,y,240),C=Math.round(We(c.height,500)*Math.max(.6,_/y)),o=(n.orientation??c.chartOrientation)==="horizontal",M=O(c,"showDataLabel",!1),m=n.xAxis,r=n.plots,A=(s,d,p)=>ne(s,!1,t,d,p),x=A("0",a,4e3).height,S=A("0",l,4e3).height,E=ne(O(c,"showTitle")?n.title:void 0,!1,t,h,_-2*u,1),ze=E.height>0?E.height+12:0,pt=[],Dt=0;O(c,"showLegend")&&r.forEach((s,d)=>{if(s.title==="")return;let p=A(s.title,a,_*.3);pt.push({index:d,label:p}),Dt=Math.max(Dt,p.width+rt+8)});let kt=pt.length>0?Dt+Pe:0,j=r.filter(s=>s.type==="bar").length,b=n.yAxis.min,g=n.yAxis.max,ce=n.hasSetYAxis&&isFinite(b)&&isFinite(g)&&b!==g;if(ce)b=K(b),g=K(g);else{b=1/0,g=-1/0;for(let s of r)for(let[,d]of s.data){let p=K(d);p!==void 0&&(p<b&&(b=p),p>g&&(g=p))}b>g&&(b=g=0),j>0&&(b=Math.min(b,0),g=Math.max(g,0)),b===g&&(b===0?g=1:(b-=Math.abs(b)/2,g+=Math.abs(g)/2))}let le=(s,d)=>{let p=se(Math.abs(g-b),Math.max(2,Math.min(10,Math.floor(s/d))));return ce||(b=ot(p,Math.floor(xt(p,b)+1e-9)),g=ot(p,Math.ceil(xt(p,g)-1e-9))),oe(Math.min(b,g),Math.max(b,g),p).map(R=>({at:(R-b)/(g-b),label:A(String(R),a,4e3)}))},ct=1;if(m.type==="band")ct=Math.max(m.categories.length,1);else for(let s of r)ct=Math.max(ct,s.data.length);let et=1/ct,bt=m.type==="band"||j>0?et/2:0,T=K(m.type==="linear"?m.min:void 0),nt=K(m.type==="linear"?m.max:void 0),he=T!==void 0&&nt!==void 0&&T!==nt,fe=(s,d)=>m.type==="band"?(s+.5)*et:bt+(d>1?s/(d-1):he?0:.5)*(1-2*bt),wt=re(c.xAxis),de=re(c.yAxis),At=o?wt:de,gt=o?de:wt,lt=A(O(At,"showTitle")?o?m.title:n.yAxis.title:void 0,a,C*.8),_t=A(O(gt,"showTitle")?o?n.yAxis.title:m.title:void 0,a,_*.8),Mt=O(At,"showTick")?Te:0,yt=O(gt,"showTick")?Te:0,Ot=O(At,"showLabel"),Xt=O(gt,"showLabel"),Qe=o?_*.3:Math.max(48,(_-2*u-64-kt)*et-8),vt=m.type==="band"&&O(wt,"showLabel")?m.categories.map(s=>A(s,a,Qe)):[],Ut=0,Et=0;for(let s of vt)Ut=Math.max(Ut,s.width),Et=Math.max(Et,s.height);let ue=s=>{let d=[];if(m.type==="band"){let p=vt.length===0?8:o?Et:Ut+12,R=Math.max(1,Math.ceil(p/(s*et)));for(let N=0;N<m.categories.length;N+=R)d.push({at:(N+.5)*et,label:vt[N]??A(void 0,a,0)})}else if(he){let p=se(Math.abs(nt-T),Math.max(2,Math.min(10,Math.floor(s/(o?32:80)))));for(let R of oe(Math.min(T,nt),Math.max(T,nt),p))d.push({at:bt+(R-T)/(nt-T)*(1-2*bt),label:A(String(R),a,4e3)})}else T!==void 0&&d.push({at:.5,label:A(String(T),a,4e3)});return d},ht=0,Rt=0;for(let s of r){for(let d of s.pointLabels??[])ht=Math.max(ht,t.width(d,l,0));if(M&&o&&s.type==="bar")for(let[,d]of s.data)Rt=Math.max(Rt,t.width(String(K(d)??""),l,0))}let me=Xt?o||m.type!=="band"?x:Et:0,Fe=yt+(me>0?me+4:0)+(_t.height>0?_t.height+4:0),Ke=o?0:ht>0||M?S+4:Ot?x/2:0,W=u+ze+Ke,X=Math.max(1,C-u-Fe-W),V=W+X,Tt=o?ue(X):le(X,56),xe=Ot?Je(Tt):0,$=u+(lt.height>0?lt.height+6:0)+(xe>0?xe+6:0)+Mt,je=Math.max(ht>0?ht+12:0,Rt>0?Rt+8:0),Bt=o?Math.min(_*.25,je):0,I=Math.max(1,_-u-$-kt-Bt),Pt=o?le(I,80):ue(I);if(Xt&&kt+Bt===0){let s=0;for(let d of Pt)s=Math.max(s,d.at*I+d.label.width/2-I);I=Math.max(1,I-s)}let St=$+I,G=(s,d)=>o?$+d*I:$+s*I,J=(s,d)=>o?W+s*X:V-d*X,Ht=s=>(s-b)/(g-b),pe=s=>Math.min(Math.max(s,0),1),be=s=>o?`M${f(G(0,s))},${f(W)}V${f(V)}`:`M${f($)},${f(J(0,s))}H${f(St)}`,Wt="";for(let s of o?Pt:Tt)Wt+=be(s.at);let Z="",It="";O(At,"showAxisLine")&&(Z+=`M${f($)},${f(W)}V${f(V)}`),O(gt,"showAxisLine")&&(Z+=`M${f($)},${f(V)}H${f(St)}`);for(let s of Tt){let d=o?W+s.at*X:V-s.at*X;Mt&&(Z+=`M${f($)},${f(d)}h${-Mt}`),Ot&&(It+=Nt(s.label,$-Mt-6,d,"end"))}for(let s of Pt){let d=$+s.at*I;yt&&(Z+=`M${f(d)},${f(V)}v${yt}`),Xt&&(It+=Nt(s.label,d,V+yt+4+s.label.height/2,"middle"))}let Yt=(o?X:I)*et,ft=Yt*.7/Math.max(j,1),zt=j>1?Math.min(2,ft*.2):0,it=pe(Ht(0));j>0&&it>0&&it<1&&(Z+=be(it));let Ae="",ge="",Qt="",Ft="",Ve=0;r.forEach((s,d)=>{let p=ee(d),R=s.title?` data-id="${te(s.title)}"`:"",N=m.type==="band"?Math.min(s.data.length,ct):s.data.length;if(s.type==="bar"){let Y=(Ve++-(j-1)/2)*ft-(ft-zt)/2,mt="";for(let D=0;D<N;D++){let k=K(s.data[D][1]);if(k===void 0)continue;let v=fe(D,N),q=pe(Ht(k)),tt=Math.min(it,q),P=Math.max(it,q),L=o?G(v,tt):G(v,0)+Y,w=o?J(v,0)+Y:J(v,P),H=o?(P-tt)*I:ft-zt,U=o?ft-zt:(P-tt)*X;if(mt+=`<rect x="${f(L)}" y="${f(w)}" width="${f(H)}" height="${f(U)}"/>`,!M)continue;let z=String(k),Ct=t.width(z,l,0),Q=q>=it?1:-1,ye=L+H/2,Ee=w+U/2,Re="middle";if(o){if(U<l)continue;ye=(Q>0?L+H:L)+Q*6,Re=Q>0?"start":"end"}else{if(Ct+2>Yt/j)continue;Ee=(Q>0?w:w+U)-Q*(S/2+2)}Qt+=`<text x="${f(ye)}" y="${f(Ee+l*.35)}" text-anchor="${Re}">${z}</text>`}Ae+=`<g class="pele-series pele-bars"${R} fill="${p}">${mt}</g>`;return}let dt="",Me="",Gt=!1,ut=0,B=NaN;for(let Y=0;Y<N;Y++){let mt=K(s.data[Y][1]);if(mt===void 0){B=NaN;continue}let D=fe(Y,N),k=Ht(mt),v=k>=0&&k<=1;if(B!==B)v&&(dt+=`M${f(G(D,k))},${f(J(D,k))}`),Gt=v;else{let L=k-B,w=0,H=1;if(L!==0){let U=-B/L,z=(1-B)/L;w=Math.max(w,Math.min(U,z)),H=Math.min(H,Math.max(U,z))}else v||(w=2);if(w<=H){let U=ut+(D-ut)*w,z=B+L*w,Ct=ut+(D-ut)*H,Q=B+L*H;(!Gt||w>0)&&(dt+=`M${f(G(U,z))},${f(J(U,z))}`),dt+=`L${f(G(Ct,Q))},${f(J(Ct,Q))}`}Gt=v}if(ut=D,B=k,!v)continue;let q=G(D,k),tt=J(D,k);Yt>=12&&(Me+=`<circle cx="${f(q)}" cy="${f(tt)}" r="3"/>`);let P=A(s.pointLabels?.[Y],l,4e3);if(P.height>0){let L=P.width/2;Ft+=o?Nt(P,q+10,tt,"start"):Nt(P,Math.max(Math.min(q,St-L),$+L),tt-6-P.height/2,"middle")}}ge+=`<g class="pele-series pele-line"${R} fill="${p}">`+(dt?`<path d="${dt}" fill="none" stroke="${p}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>`:"")+Me+"</g>"});let Lt="";lt.height>0&&(Lt+=`<g transform="translate(${f(u+lt.height/2)},${f(W+X/2)}) rotate(-90)">${st(lt,0,0,"")}</g>`),Lt+=st(_t,$+I/2,C-u-_t.height/2,"");let Kt="",_e=0;for(let s of pt)_e+=Math.max(Be,s.label.height+6);let jt=W+Math.max(0,(X-_e)/2),Vt=St+Bt+Pe;for(let{index:s,label:d}of pt){let p=Math.max(Be,d.height+6);if(jt+p>C)break;let R=jt+p/2,N=ee(s);Kt+=`<g class="pele-legend-item" data-id="${te(r[s].title)}">`+(r[s].type==="bar"?`<rect x="${f(Vt)}" y="${f(R-rt/2)}" width="${rt}" height="${rt}" rx="2" fill="${N}"/>`:`<path d="M${f(Vt)},${f(R)}h${rt}" stroke="${N}" stroke-width="2" stroke-linecap="round"/>`)+st(d,Vt+rt+8+d.width/2,R,"")+"</g>",jt+=p}let Ge=st(E,_/2,u+E.height/2,' class="pele-title" font-weight="var(--_tw)"')+(Wt?`<path class="pele-grid" d="${Wt}" stroke="var(--_a)"/>`:"")+`<g class="pele-plot">${Ae}${ge}</g>`+(Z?`<path class="pele-axis" d="${Z}" fill="none" stroke="var(--_b)"/>`:"")+(It?`<g class="pele-axis-labels" font-size="${a}" fill="var(--_m)">${It}</g>`:"")+(Lt?`<g class="pele-axis-titles" font-size="${a}">${Lt}</g>`:"")+(Qt?`<g class="pele-data-labels" font-size="${l}">${Qt}</g>`:"")+(Ft?`<g class="pele-point-labels" font-size="${l}">${Ft}</g>`:"")+(Kt?`<g class="pele-legend" font-size="${a}">${Kt}</g>`:"");return{svg:$e("xychart",_,C,h,i,n,Ge),width:_,height:C,links:[]}}var Rn={type:"xychart",section:"xyChart",parse(n,e,i){let c=new $t;return c.title=i,Ue(n,c),c},render:Ye};export{Rn as a};