ztd-charts-cli 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/api.d.ts +11 -1
- package/dist/api.js +5 -1
- package/dist/{chunk-4WXNLD5P.js → chunk-FB5WHEJX.js} +38 -15
- package/dist/cli.js +5 -4
- package/dist/client/NOTICE.md +39 -0
- package/dist/client/area.js +10 -10
- package/dist/client/bar.js +10 -10
- package/dist/client/barRace.js +28 -0
- package/dist/client/beeswarm.js +10 -10
- package/dist/client/box.js +10 -10
- package/dist/client/bubble.js +10 -10
- package/dist/client/bullet.js +9 -9
- package/dist/client/bump.js +10 -10
- package/dist/client/calendar.js +9 -9
- package/dist/client/candlestick.js +9 -9
- package/dist/client/chord.js +10 -10
- package/dist/client/choropleth.js +28 -0
- package/dist/client/donut.js +10 -10
- package/dist/client/dumbbell.js +9 -9
- package/dist/client/flowMap.js +28 -0
- package/dist/client/funnel.js +10 -10
- package/dist/client/gauge.js +10 -10
- package/dist/client/geo-kr-sido.js +1 -0
- package/dist/client/geo-us-states.js +1 -0
- package/dist/client/geo-world.js +1 -0
- package/dist/client/heatmap.js +9 -9
- package/dist/client/histogram.js +6 -6
- package/dist/client/line.js +10 -10
- package/dist/client/lollipop.js +10 -10
- package/dist/client/marimekko.js +6 -6
- package/dist/client/network.js +28 -0
- package/dist/client/parallel.js +9 -9
- package/dist/client/pareto.js +10 -10
- package/dist/client/pie.js +10 -10
- package/dist/client/radar.js +10 -10
- package/dist/client/radialBar.js +10 -10
- package/dist/client/ridgeline.js +10 -10
- package/dist/client/sankey.js +10 -10
- package/dist/client/scatter.js +10 -10
- package/dist/client/segmented.js +9 -9
- package/dist/client/skyline.js +10 -10
- package/dist/client/slope.js +10 -10
- package/dist/client/sparkline.js +10 -10
- package/dist/client/stream.js +10 -10
- package/dist/client/sunburst.js +9 -9
- package/dist/client/symbolMap.js +28 -0
- package/dist/client/tileMap.js +10 -10
- package/dist/client/timeline.js +28 -0
- package/dist/client/tree.js +28 -0
- package/dist/client/treemap.js +9 -9
- package/dist/client/waffle.js +9 -9
- package/dist/client/waterfall.js +10 -10
- package/package.json +2 -2
package/dist/client/waffle.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(()=>{var
|
|
1
|
+
(()=>{var da=Object.create;var er=Object.defineProperty;var fa=Object.getOwnPropertyDescriptor;var ha=Object.getOwnPropertyNames;var ga=Object.getPrototypeOf,pa=Object.prototype.hasOwnProperty;var an=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var ba=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ha(t))!pa.call(e,o)&&o!==n&&er(e,o,{get:()=>t[o],enumerable:!(r=fa(t,o))||r.enumerable});return e};var C=(e,t,n)=>(n=e!=null?da(ga(e)):{},ba(t||!e||!e.__esModule?er(n,"default",{value:e,enumerable:!0}):n,e));var U=an((Bs,tr)=>{tr.exports=globalThis.__ztdReact.react});var rr=an((Hs,nr)=>{nr.exports=globalThis.__ztdReact["react-dom/client"]});var z=an((tl,Rr)=>{Rr.exports=globalThis.__ztdReact["react/jsx-runtime"]});var Yn=C(U(),1),ia=C(rr(),1);var kt=C(U(),1);var It=C(U(),1);var or=C(U(),1),qe=(0,or.createContext)(void 0);var lr=C(U(),1);var ya=["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"],ar='"Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif',ir='"Roboto Mono", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace',Ee={name:"dark",bg:"#14171B",panel:"#14171B",ink:"#F1F3F5",muted:"#A3ABB5",dim:"#5B636D",accent:"#D6FD70",accentText:"#D6FD70",onAccent:"#14171B",onInk:"#14171B",line:"#2A2F36",line2:"#22272D",neutral:"#3A414A",neutralStrong:"#5F6772",onNeutralStrong:"#F1F3F5",neutralSoft:"#262B31",lift:"#1D2126",tint:"rgba(214, 253, 112, 0.14)",fontFamily:ar,monoFamily:ir,radius:18,radiusCode:14,radiusMark:4},sn={name:"light",bg:"#FFFFFF",panel:"#FFFFFF",ink:"#14171B",muted:"#5D6570",dim:"#B3B9C2",accent:"#0B8FD8",accentText:"#006DA8",onAccent:"#14171B",onInk:"#FFFFFF",line:"#E6E9ED",line2:"#F0F2F5",neutral:"#D5DAE0",neutralStrong:"#9AA3AE",onNeutralStrong:"#14171B",neutralSoft:"#EEF1F4",lift:"#F4F6F8",tint:"rgba(11, 143, 216, 0.12)",fontFamily:ar,monoFamily:ir,radius:18,radiusCode:14,radiusMark:4},ln={dark:Ee,light:sn};function Ct(e){return`--ztd-${e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}`}function cn(e){let t={};for(let n of ya){let r=e[n];typeof r=="string"&&(t[Ct(n)]=r)}return e.fontFamily&&(t["--ztd-font"]=e.fontFamily),e.monoFamily&&(t["--ztd-mono"]=e.monoFamily),e.radius!==void 0&&(t["--ztd-radius"]=`${e.radius}px`),e.radiusCode!==void 0&&(t["--ztd-radius-code"]=`${e.radiusCode}px`),e.radiusMark!==void 0&&(t["--ztd-radius-mark"]=`${e.radiusMark}px`),t}function un(e,t){if(!t)return e;let n={...e};for(let r of Object.keys(t)){let o=t[r];o!==void 0&&(n[r]=o)}return n}var xa=`
|
|
2
2
|
.ztd-root{position:relative;-webkit-tap-highlight-color:transparent}
|
|
3
3
|
.ztd-root:focus{outline:none}
|
|
4
|
-
.ztd-root:focus-visible{outline:2px solid var(--ztd-accent,${
|
|
4
|
+
.ztd-root:focus-visible{outline:2px solid var(--ztd-accent,${Ee.accent});outline-offset:3px;border-radius:6px}
|
|
5
5
|
.ztd-svg{display:block;overflow:visible;user-select:none;-webkit-user-select:none}
|
|
6
6
|
.ztd-mark{transition:opacity .18s ease,fill .18s ease,stroke .18s ease,stroke-width .18s ease}
|
|
7
7
|
.ztd-tip{animation:ztd-fade .14s ease-out;transition:left .2s cubic-bezier(.22,1,.36,1),top .2s cubic-bezier(.22,1,.36,1)}
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
.ztd-still .ztd-tip,.ztd-still .ztd-guide{transition:none;animation:none}
|
|
10
10
|
.ztd-btn{appearance:none;font:inherit;cursor:pointer;transition:background .14s,color .14s,border-color .14s}
|
|
11
11
|
.ztd-btn:focus{outline:none}
|
|
12
|
-
.ztd-btn:focus-visible{outline:2px solid var(--ztd-accent,${
|
|
12
|
+
.ztd-btn:focus-visible{outline:2px solid var(--ztd-accent,${Ee.accent});outline-offset:2px}
|
|
13
13
|
.ztd-card{transition:border-color .16s ease}
|
|
14
|
-
.ztd-card:hover{border-color:var(--ztd-dim,${
|
|
14
|
+
.ztd-card:hover{border-color:var(--ztd-dim,${Ee.dim})}
|
|
15
15
|
@media (prefers-reduced-motion: reduce){.ztd-mark,.ztd-tip,.ztd-guide,.ztd-btn,.ztd-card{transition:none;animation:none}}
|
|
16
16
|
@keyframes ztd-pop{from{opacity:0;transform:scale(.45)}to{opacity:1;transform:none}}
|
|
17
17
|
@keyframes ztd-fade{from{opacity:0}to{opacity:1}}
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
@keyframes ztd-pulse{0%,100%{opacity:.55}50%{opacity:1}}
|
|
20
20
|
.ztd-skeleton{animation:ztd-pulse 1.4s ease-in-out infinite}
|
|
21
21
|
@media (prefers-reduced-motion: reduce){.ztd-skeleton{animation:none}}
|
|
22
|
-
`;function Ze(e,t,n,r,o){if(e)return t?{opacity:0}:{animation:`ztd-${n} ${Math.round(o)}ms cubic-bezier(.22,.9,.3,1) ${Math.round(r)}ms backwards`}}function Qe(e,t){let[n]=(0,wn.useState)(!e.motion.enabled);return e.motion.enabled&&e.hydrated&&(!n||t.waiting||t.generation>0)}var kn=!1;function He(){if(kn||typeof document>"u"||(kn=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=vo,document.head.appendChild(e)}var et=A(j(),1),ae=typeof window<"u"&&typeof document<"u",ue=ae?et.useLayoutEffect:et.useEffect;function tt(){return typeof performance<"u"?performance.now():Date.now()}function V(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function Se(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var vn={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},$n={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var $o=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],Co={basic:{bg:"line2",fg:"ink"},intermediate:{bg:"tint",fg:"accentText"},advanced:{bg:"ink",fg:"onInk"}};function Mo(e,t){let n=t.trim().toLowerCase();return e.find(r=>r.id===n||r.en.toLowerCase()===n||r.ko===t.trim())}function To(e){return Mo($o,e)}function Cn(e,t){let n=To(e);return{text:n?n[t]:e,...Co[n?.id??"basic"]}}var Mn={white:"#ffffff",black:"#000000",transparent:"#00000000"};function Ae(e){if(!e)return null;let t=e.trim(),n=/^var\(\s*--[\w-]+\s*,\s*(.+)\)$/i.exec(t);if(n&&(t=n[1].trim()),Mn[t.toLowerCase()]&&(t=Mn[t.toLowerCase()]),t.startsWith("#")){let o=t.slice(1);if((o.length===3||o.length===4)&&(o=o.split("").map(i=>i+i).join("")),o.length!==6&&o.length!==8||/[^\da-f]/i.test(o))return null;let a=parseInt(o,16);return o.length===6?[a>>16&255,a>>8&255,a&255,1]:[parseInt(o.slice(0,2),16),parseInt(o.slice(2,4),16),parseInt(o.slice(4,6),16),parseInt(o.slice(6,8),16)/255]}let r=/^rgba?\(([^)]+)\)$/i.exec(t);if(r){let o=r[1].split(/[\s,/]+/).filter(Boolean);if(o.length<3)return null;let a=o.slice(0,3).map(s=>s.endsWith("%")?parseFloat(s)/100*255:parseFloat(s)),i=o[3]!==void 0?o[3].endsWith("%")?parseFloat(o[3])/100:parseFloat(o[3]):1;return a.some(s=>Number.isNaN(s))?null:[a[0],a[1],a[2],Number.isNaN(i)?1:i]}return null}function An(e){let t=n=>Math.round(Math.max(0,Math.min(255,n))).toString(16).padStart(2,"0");return`#${t(e[0])}${t(e[1])}${t(e[2])}${e[3]<1?t(e[3]*255):""}`.toUpperCase()}function Dt(e,t){let n=e[3];return[e[0]*n+t[0]*(1-n),e[1]*n+t[1]*(1-n),e[2]*n+t[2]*(1-n),1]}function Fe(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Tn(e){return .2126*Fe(e[0])+.7152*Fe(e[1])+.0722*Fe(e[2])}function Lt(e,t,n){let r=typeof e=="string"?Ae(e):e,o=typeof t=="string"?Ae(t):t;if(!r||!o)return 0;let a=n?typeof n=="string"?Ae(n):n:null;o[3]<1&&a&&(o=Dt(o,a));let i=r[3]<1?Dt(r,o):r,s=Tn(i),c=Tn(o);return(Math.max(s,c)+.05)/(Math.min(s,c)+.05)}function So(e){return[Fe(e[0]),Fe(e[1]),Fe(e[2])]}function Pt(e){let t=e<=.0031308?12.92*e:1.055*Math.pow(e,.4166666666666667)-.055;return Math.max(0,Math.min(255,t*255))}function Sn(e){let[t,n,r]=So(e),o=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*r),a=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*r),i=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*r);return[.2104542553*o+.793617785*a-.0040720468*i,1.9779984951*o-2.428592205*a+.4505937099*i,.0259040371*o+.7827717662*a-.808675766*i]}function Ao([e,t,n],r){let o=(e+.3963377774*t+.2158037573*n)**3,a=(e-.1055613458*t-.0638541728*n)**3,i=(e-.0894841775*t-1.291485548*n)**3;return[Pt(4.0767416621*o-3.3077115913*a+.2309699292*i),Pt(-1.2684380046*o+2.6097574011*a-.3413193965*i),Pt(-.0041960863*o-.7034186147*a+1.707614701*i),r]}function nt(e,t,n){let r=Ae(e),o=Ae(t);if(!r||!o)return e;let a=Sn(r),i=Sn(o),s=Math.max(0,Math.min(1,n));return An(Ao([a[0]*s+i[0]*(1-s),a[1]*s+i[1]*(1-s),a[2]*s+i[2]*(1-s)],r[3]*s+o[3]*(1-s)))}function Et(e,t,n){let r=t[0],o=-1;for(let a of t){let i=Lt(a,e,n);i>o&&(o=i,r=a)}return r}function X(e,t){let n=e.theme;switch(t){case"accent":return{role:t,fill:e.paint("accent"),text:e.paint("onAccent"),raw:n.accent};case"ink":return{role:t,fill:e.paint("ink"),text:e.paint("onInk"),raw:n.ink};case"strong":return{role:t,fill:e.paint("neutralStrong"),text:e.paint("onNeutralStrong"),raw:n.neutralStrong};case"soft":return{role:t,fill:e.paint("neutralSoft"),text:e.paint("ink"),raw:n.neutralSoft};default:return{role:"neutral",fill:e.paint("neutral"),text:e.paint("ink"),raw:n.neutral}}}function Fo(e,t){let n=Et(t,[e.theme.ink,e.theme.onAccent,e.theme.onNeutralStrong]);return Lt(n,t)>=4.5?n===e.theme.ink?e.paint("ink"):n===e.theme.onAccent?e.paint("onAccent"):e.paint("onNeutralStrong"):Et(t,["#FFFFFF","#000000"])}function rt(e,t){let n=nt(e.theme.neutralStrong,e.theme.neutral,t);return{role:"mix",fill:e.mix("neutralStrong","neutral",t),text:Fo(e,n),raw:n}}function ne(e,t,n){let r=new Array(t),o=[];for(let i=0;i<t;i++)n.has(i)?r[i]=X(e,"accent"):o.push(i);let a=o.length;return o.forEach((i,s)=>{if(a===1)r[i]=X(e,"neutral");else if(s===0)r[i]=X(e,"ink");else if(s===a-1)r[i]=X(e,"neutral");else if(a===3)r[i]=X(e,"strong");else{let c=(s-1)/Math.max(1,a-2);r[i]=c<=.001?X(e,"strong"):rt(e,1-c)}}),r}var _t="mix:";function je(e){return e({theme:At,cssVars:!1,paint:n=>n,color:n=>n??"neutral",raw:n=>n??"neutral",mix:(n,r,o)=>`${_t}${o}`}).map(n=>n.fill)}function Fn(e,t){return t?.startsWith(_t)?e.mix("neutralStrong","neutral",Number(t.slice(_t.length))):e.color(t)}function Nn(e,t,n){return ne(e,t+1,n).slice(0,t)}function Rn(e,t,n,r="neutral"){let o=X(e,"accent"),a=X(e,r);return Array.from({length:t},(i,s)=>n.has(s)?o:a)}function Pn(e,t,n){let r=new Array(t),o=[];for(let i=0;i<t;i++)n.has(i)?r[i]=X(e,"accent"):o.push(i);let a=o.length;return o.forEach((i,s)=>{a===1?r[i]=X(e,"neutral"):s===0?r[i]=X(e,"strong"):s===a-1?r[i]=X(e,"neutral"):r[i]=rt(e,1-s/(a-1))}),r}var ie=A(j(),1);var at=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),J="en-US",Dn=new Map;function It(e,t){let n=t.maximumFractionDigits!==void 0||t.style==="currency"?t:{...t,maximumFractionDigits:Math.max(1,t.minimumFractionDigits??0)},r=e+JSON.stringify(n),o=Dn.get(r);return o||(o=new Intl.NumberFormat(e,n),Dn.set(r,o)),o}function Ot(e){return/^[-\u2212]/.test(e)&&!/[1-9]/.test(e)?e.slice(1):e}function Ne(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=J,...r}=t;return Ot(It(n,r).format(e))}var Bt=e=>e!==0&&Math.abs(e)<.05,zt=(e,t,n="")=>`${Ne(e,{locale:t,maximumSignificantDigits:2,maximumFractionDigits:20})}${n}`;function ot(e,t={}){if(!Number.isFinite(e))return"-";if(Bt(e)&&t.maximumFractionDigits===void 0)return zt(e,t.locale??J,"%");let n=Math.abs(e);return`${Ne(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function In(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=J,...r}=t;if(V(n)==="ko"){let o=Math.abs(e),a=[[1e12,"조"],[1e8,"억"],[1e4,"만"],[1,""]],i=a.findIndex(([s])=>o>=s);for(i<0&&(i=a.length-1);;){let[s,c]=a[i],l=o/s,m=Math.max(r.minimumFractionDigits??0,r.maximumFractionDigits??(s===1||l<100?1:0)),u=Math.round(l*10**m)/10**m;if(i>0&&u>=a[i-1][0]/s){i--;continue}return(e<0&&u!==0?"-":"")+Ne(u,{locale:n,...r,maximumFractionDigits:m})+c}}return Ot(It(n,{notation:"compact",...r}).format(e))}var No=(e,t=V(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function $e(e,t=J,n){if(typeof e=="function")return e;let r=(o,a="",i="")=>{let s=It(t,o);return c=>Number.isFinite(c)?`${i}${Ot(s.format(c))}${a}`:"-"};if(e&&typeof e=="object"){let{suffix:o="",prefix:a="",...i}=e;return r(i,o,a)}switch(e??n){case"integer":return r({maximumFractionDigits:0});case"decimal":return r({minimumFractionDigits:1,maximumFractionDigits:2});case"percent":return o=>ot(o,{locale:t});case"ratio":return o=>ot(o*100,{locale:t});case"compact":return o=>In(o,{locale:t});case"currency":return r(No(t));default:{let o=r({maximumFractionDigits:1});return a=>Bt(a)?zt(a,t):o(a)}}}function On(e,t=J,n=0){return e!==void 0?$e(e,t):n>=1e5?r=>Bt(r)?zt(r,t):In(r,{locale:t}):r=>Ne(r,{locale:t})}function Ro(e,t,n=1){let r=new Date(+e,+t-1,+n);return r.getMonth()===+t-1&&r.getDate()===+n?r:null}var Ht=e=>Number.isInteger(e)&&e>=1e3&&e<=9999,Po=/^\d{4}-\d{1,2}(-\d{1,2})?([T ][\d:.]+(Z|[+-]\d{2}:?\d{2})?)?$/,Do=["january","february","march","april","may","june","july","august","september","october","november","december"],Ln=e=>{let t=e.toLowerCase();return t.length<3?0:Do.findIndex(n=>n.startsWith(t))+1},En=e=>+e+(+e<30?2e3:1900);function Bn(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var Lo=[/^(\d{4})-(\d{1,2})(?:-(\d{1,2}))?$/,/^(\d{4})[./]\s*(\d{1,2})[./]\s*(\d{1,2})\.?$/,/^(19\d\d|20\d\d|2100)(\d\d)(\d\d)$/,/^(\d{4})년\s*(\d{1,2})월(?:\s*(\d{1,2})일)?$/],zn=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,Hn=/\{([^{}]+)\}/g;function it(e,t){let n;for(let r of Lo)if(n=r.exec(e))return[+n[1],+n[2],+(n[3]??1),n[3]?1:2];if(/^\d{4}-\d/.test(e))return null;if(n=/^(\d{2})\.\s*(\d{1,2})\.\s*(\d{1,2})\.?$/.exec(e))return t?[En(n[3]),+n[2],+n[1],1]:[En(n[1]),+n[2],+n[3],1];if(n=/^(?:(\d{4})\s*-?\s*Q([1-4])|Q([1-4])\s*-?\s*(\d{4})|(\d{4})년\s*([1-4])분기)$/i.exec(e))return[+(n[1]??n[4]??n[5]),+(n[2]??n[3]??n[6])*3-2,1,3];if(n=zn.exec(e)){let r=+n[1],o=+n[3],a=r>12||o<=12&&t===!0;return[+n[4],a?o:r,a?r:o,1]}if(n=/^(\d{1,2})[\s-]+([a-z]{3,9})\.?[\s-]+(\d{4})$/i.exec(e)){let r=Ln(n[2]);return r?[+n[3],r,+n[1],1]:null}if(n=/^([a-z]{3,9})\.?\s+(?:(\d{1,2}),?\s+)?(\d{4})$/i.exec(e)){let r=Ln(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}var jn=e=>Po.test(e)||it(e)!==null;function Vn(e){let t;for(let n of e){let r=typeof n=="string"?zn.exec(n.trim()):null;if(r){if(+r[1]>12)return!0;+r[3]>12&&(t=!1)}}return t}function st(e,t){if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e=="number"){if(!Number.isFinite(e))return null;if(Number.isInteger(e)){if(Ht(e))return new Date(e,0,1);if(e>=19000101&&e<=21001231)return st(`${e}`)}return new Date(Math.abs(e)>=1e9&&Math.abs(e)<1e10?e*1e3:e)}if(typeof e=="string"&&e.trim()){let n=e.trim(),r=it(n,t);if(r)return Ro(r[0],r[1],r[2]);if(/^\d{4}$/.test(n))return new Date(Number(n),0,1);if(!/\d{4}/.test(n))return null;let o=new Date(n);return Number.isNaN(o.getTime())?null:o}return null}var _n=new Map;function Ve(e,t={month:"short",day:"numeric"}){let n=st(e);if(!n)return"-";let{locale:r=J,...o}=t,a=r+JSON.stringify(o),i=_n.get(a);return i||(i=new Intl.DateTimeFormat(r,o),_n.set(a,i)),i.format(n)}var jt=A(_(),1),lt=(0,ie.createContext)({theme:ye,cssVars:!0});function Eo(e,t=ye){return e?typeof e=="string"?Ft[e]??t:Rt(t,e):t}function ct(e){let t=(0,ie.useContext)(lt),n=e.base?Ft[e.base]:t.theme,r=(0,ie.useMemo)(()=>Eo(e.theme,n),[e.theme,n]),o=e.cssVars??t.cssVars,a=e.locale??t.locale,i=(0,ie.useMemo)(()=>({theme:r,cssVars:o,locale:a}),[r,o,a]),s=(0,ie.useMemo)(()=>Nt(r),[r]),c=e.paint?{background:r.bg,color:r.ink,fontFamily:r.fontFamily,...s,...e.style}:{display:"contents",...s,...e.style};return(0,jt.jsx)(lt.Provider,{value:i,children:(0,jt.jsx)("div",{className:e.className,"data-ztd-theme":r.name,lang:e.locale,style:c,children:e.children})})}var _o=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function Gn(e){return _o.has(e)}function Io(e,t){let n=r=>t?`var(${Je(r)}, ${e[r]})`:e[r];return{theme:e,cssVars:t,paint:n,color:(r,o="neutral")=>r?Gn(r)?n(r):r:n(o),raw:(r,o="neutral")=>r?Gn(r)?e[r]:r:e[o],mix:(r,o,a)=>{let i=Math.round(Math.max(0,Math.min(1,a))*1e3)/10;return t?`color-mix(in oklab, ${n(r)} ${i}%, ${n(o)})`:nt(e[r],e[o],a)}}}function se(e){let t=(0,ie.useContext)(lt);return(0,ie.useMemo)(()=>{let n=Rt(t.theme,e);return Io(n,t.cssVars)},[t.theme,t.cssVars,e])}function Q(e){let t=(0,ie.useContext)(lt);return e??t.locale??J}function Kn(e){return e?Nt(e):{}}var ut=A(j(),1),Vt=(0,ut.createContext)(void 0);function Un(e){let t=(0,ut.useContext)(Vt);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var T=A(_(),1),Oo={legend:"Legend",replay:"Replay animation",replayTitle:"Replay",sample:"Sample data",loadError:"Couldn't load data",retry:"Try again",loading:"Loading",empty:"No data to show",source:"Source",shown:(e,t)=>`${e} of ${t} series shown`},Bo={en:Oo,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var zo={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},Wt=e=>Bo[V(Q(e))];function Gt(e){let t=se(e.theme),n=Wt(e.locale),[r,o]=(0,mt.useState)(!1),a=e.size??11.5,i=e.onToggle,s=new Set(i?e.hidden:void 0),c=e.items.filter(m=>!s.has(m.label)).length,l=(0,T.jsx)("ul",{"aria-label":n.legend,style:{display:"flex",flexWrap:"wrap",justifyContent:e.align==="start"?"flex-start":"flex-end",gap:"4px 12px",margin:0,padding:0,listStyle:"none"},children:e.items.map((m,u)=>{let d=!s.has(m.label),h=d&&c===1,f=(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Ho,{p:t,item:m,off:!d}),(0,T.jsx)("span",{style:d?void 0:{textDecoration:"line-through"},children:m.label})]});return(0,T.jsx)("li",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:a,color:t.paint("muted"),lineHeight:1.3},children:i?(0,T.jsx)("button",{type:"button",className:"ztd-btn","aria-pressed":d,"aria-disabled":h||void 0,onClick:()=>{h||(i(m.label),o(!0))},style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:24,minWidth:24,padding:"0 2px",margin:0,border:0,borderRadius:4,background:"transparent",color:"inherit",fontSize:"inherit",lineHeight:"inherit",cursor:h?"default":void 0},children:f}):f},u)})});return i?(0,T.jsxs)(T.Fragment,{children:[l,(0,T.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:zo,children:r?n.shown(c,e.items.length):""})]}):l}function Ho({p:e,item:t,off:n}){let r=Fn(e,t.color),o=t.shape??"square";return o==="line"||o==="dash"?(0,T.jsxs)("svg",{width:14,height:8,"aria-hidden":"true",style:{flex:"none",opacity:n?.35:void 0},children:[(0,T.jsx)("line",{x1:1,x2:13,y1:4,y2:4,stroke:r,strokeWidth:2,strokeDasharray:o==="dash"?"3 2":void 0,strokeLinecap:"round"}),o==="line"?(0,T.jsx)("circle",{cx:7,cy:4,r:2.2,fill:r}):null]}):(0,T.jsx)("span",{"aria-hidden":"true",style:{width:9,height:9,flex:"none",borderRadius:o==="circle"?9:2.5,background:r,boxShadow:t.color==="neutral"||t.color==="neutralSoft"||!t.color?`inset 0 0 0 1px ${e.paint("line2")}`:void 0,opacity:n?.35:void 0}})}function jo(e){let t=se(e.theme),n=Cn(e.level,V(Q(e.locale)));return(0,T.jsx)("span",{style:{background:t.paint(n.bg),color:t.paint(n.fg),borderRadius:8,padding:"3px 9px",fontSize:12.5,fontWeight:700,lineHeight:"18px",whiteSpace:"nowrap",flex:"none"},children:n.text})}function Vo(e,t,n){if(typeof e!="string"||!t)return e;let r=e.indexOf(t);return r<0?e:(0,T.jsxs)(T.Fragment,{children:[e.slice(0,r),(0,T.jsx)("span",{style:{color:n},children:t}),e.slice(r+t.length)]})}function Xn(e){let t=se(e.theme),n=Wt(e.locale),[r,o]=(0,mt.useState)(0);ue(()=>He(),[]);let a=()=>{o(d=>d+1),e.onReplay?.()},i=Array.isArray(e.legend)?(0,T.jsx)(Gt,{items:e.legend,theme:e.theme,locale:e.locale}):e.legend,s=e.as??"h3",c=e.number===void 0?null:typeof e.number=="number"?String(e.number).padStart(2,"0"):e.number,l=e.replay||e.onReplay,m=e.source!==void 0||e.note!==void 0?(0,T.jsxs)("p",{style:{margin:0,fontSize:12,color:t.paint("muted"),lineHeight:1.4},children:[e.source!==void 0?`${n.source}: `:null,e.source,e.source!==void 0&&e.note!==void 0?" · ":null,e.note]}):null,u=e.takeaway!==void 0||e.level||e.sample?(0,T.jsxs)("footer",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:2},children:[(0,T.jsx)("span",{style:{fontSize:17,fontWeight:800,color:t.paint("ink"),letterSpacing:-.3,lineHeight:1.3,minWidth:0},children:e.takeaway}),(0,T.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,flex:"none"},children:[e.sample?(0,T.jsx)("span",{style:{fontSize:11.5,color:t.paint("muted"),whiteSpace:"nowrap"},children:typeof e.sample=="string"?e.sample:n.sample}):null,e.level?(0,T.jsx)(jo,{level:e.level,theme:e.theme,locale:e.locale}):null]})]}):null;return(0,T.jsxs)("section",{id:e.id,className:`ztd-card${e.className?` ${e.className}`:""}`,style:{background:t.paint("panel"),color:t.paint("ink"),border:`1px solid ${t.paint("line")}`,borderRadius:`var(--ztd-radius, ${t.theme.radius}px)`,padding:"20px 20px 16px",display:"flex",flexDirection:"column",gap:12,minWidth:0,boxSizing:"border-box",fontFamily:t.cssVars?`var(--ztd-font, ${t.theme.fontFamily})`:t.theme.fontFamily,wordBreak:"keep-all",textWrap:"balance",...e.style},children:[(0,T.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[(0,T.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[c?(0,T.jsx)("span",{style:{fontFamily:t.cssVars?`var(--ztd-mono, ${t.theme.monoFamily})`:t.theme.monoFamily,fontSize:17,fontWeight:700,color:t.paint("accentText"),letterSpacing:-.2,flex:"none"},children:c}):null,(0,T.jsx)(s,{style:{margin:0,fontSize:22,fontWeight:800,color:t.paint("ink"),letterSpacing:-.5,lineHeight:1.25,minWidth:0,flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:Vo(e.title,e.accent,t.paint("accentText"))}),e.actions,l?(0,T.jsx)("button",{type:"button",className:"ztd-btn",onClick:a,"aria-label":e.replayLabel??n.replay,title:e.replayLabel??n.replayTitle,style:{background:"transparent",color:t.paint("muted"),border:`1px solid ${t.paint("line2")}`,borderRadius:14,width:28,height:28,display:"inline-grid",placeItems:"center",padding:0,flex:"none"},children:(0,T.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,T.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,T.jsx)("path",{d:"M3 3v6h6"})]})}):null]}),e.subtitle!==void 0||i?(0,T.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px 12px",flexWrap:"wrap",minHeight:18},children:[e.subtitle!==void 0?(0,T.jsx)("span",{style:{fontSize:12.5,color:t.paint("muted"),lineHeight:1.4},children:e.subtitle}):(0,T.jsx)("span",{}),i]}):null]}),(0,T.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:0,minWidth:0},children:(0,T.jsx)(Vt.Provider,{value:r,children:(0,T.jsx)(Te.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),m?(0,T.jsxs)(T.Fragment,{children:[m,u]}):u]})}function Kt(e){let t=se(e.theme),n=Wt(e.locale),r=e.height??220;if(ue(()=>He(),[]),e.error){let o=typeof e.error=="string"?e.error:e.error.message;return(0,T.jsx)("div",{role:"alert",style:{height:r,display:"grid",placeItems:"center",textAlign:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,T.jsxs)("div",{style:{display:"grid",gap:8,justifyItems:"center",padding:16},children:[(0,T.jsx)("span",{style:{fontSize:14,fontWeight:700,color:t.paint("ink")},children:n.loadError}),(0,T.jsx)("span",{style:{fontSize:12,color:t.paint("muted"),maxWidth:280,wordBreak:"break-word"},children:o}),e.onRetry?(0,T.jsx)("button",{type:"button",className:"ztd-btn",onClick:e.onRetry,style:{marginTop:4,background:t.paint("ink"),color:t.paint("onInk"),border:"none",borderRadius:14,padding:"5px 14px",fontSize:12.5,fontWeight:700},children:n.retry}):null]})})}return e.loading?(0,T.jsx)("div",{role:"status","aria-busy":"true","aria-label":n.loading,style:{height:r,display:"flex",alignItems:"flex-end",gap:8,padding:"12px 4px"},children:[.55,.8,.4,.95,.65,.75,.5].map((o,a)=>(0,T.jsx)("span",{className:"ztd-skeleton",style:{flex:1,height:`${o*100}%`,background:t.paint("lift"),borderRadius:6,animationDelay:`${a*90}ms`}},a))}):e.empty?(0,T.jsx)("div",{style:{height:r,display:"grid",placeItems:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,T.jsx)("span",{style:{fontSize:13,color:t.paint("muted")},children:e.emptyText??n.empty})}):(0,T.jsx)(T.Fragment,{children:e.children})}var Ie=A(j(),1);var ee=A(j(),1);var z=A(_(),1),dt=60;var ft={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function Yn(e){let{c:t,events:n}=e,r=(0,ee.useId)().replace(/:/g,""),o=`${r}t`,a=`${r}d`;t.events.current=n,ue(()=>{He()},[]);let i=n.length,s=!e.noNav&&i>0,c=(0,ee.useContext)(Te),l=e.ariaLabel??c??e.kind,m=(0,ee.useMemo)(()=>s?`${n.length}${n.slice(0,dt).map(p=>`${p.label}${p.series??""}${p.formatted??p.value??""}`).join("")}`:"",[n,s]),u=(0,ee.useMemo)(()=>(0,z.jsx)(Wo,{label:l,events:n,t:t.t}),[l,m,t.t]),d=(0,ee.useRef)(null);(0,ee.useEffect)(()=>{let p=()=>{d.current=null};return window.addEventListener("scroll",p,{capture:!0,passive:!0}),window.addEventListener("resize",p,{passive:!0}),()=>{window.removeEventListener("scroll",p,{capture:!0}),window.removeEventListener("resize",p)}},[]),(0,ee.useEffect)(()=>{d.current=null},[t.width,t.height]);let h=p=>{if(p.target!==p.currentTarget)return;if(e.onKey?.(p)){p.preventDefault();return}let C=t.active,R;switch(p.key){case"ArrowRight":case"ArrowDown":R=C===null?0:(C+1)%i;break;case"ArrowLeft":case"ArrowUp":R=C===null?i-1:(C-1+i)%i;break;case"Home":R=0;break;case"End":R=i-1;break;case"Escape":if(C===null)return;R=null;break;case"Enter":case" ":C!==null&&(p.preventDefault(),t.click(C));return;default:return}p.preventDefault(),t.setActive(R,"keyboard")},{via:f,node:g,setActive:k}=t;(0,ee.useEffect)(()=>{if(f!=="touch"||!g)return;let p=C=>{g.contains(C.target)||k(null)};return document.addEventListener("pointerdown",p),()=>document.removeEventListener("pointerdown",p)},[f,g,k]);let x=t.active!==null?n[t.active]:null,$=t.showTooltip&&e.renderTip!==!1&&!t.pending&&t.via!=="sync"?e.tip:null,M=$&&!t.responsive&&t.node&&t.width&&t.node.getBoundingClientRect().width/t.width||1,v=typeof e.renderTip=="function"&&x?e.renderTip(x):null,b=e.announce??(t.via==="keyboard"&&x?`${x.label}${x.series?` ${x.series}`:""}: ${x.formatted??x.value??""} (${(t.active??0)+1}/${i})`:""),N;if($){let p=$.x*M,C=t.width*M,R=`clamp(${(4-p).toFixed(1)}px, -50%, calc(${(C-p-4).toFixed(1)}px - 100%))`,I=$.y<64;N={position:"absolute",left:p,top:$.y*M,transform:`translate(${R}, ${I?"16px":"calc(-100% - 14px)"})`,background:t.p.paint("panel"),color:t.p.paint("ink"),border:`1px solid ${t.p.paint("line")}`,borderRadius:12,padding:"8px 11px",pointerEvents:"none",whiteSpace:"nowrap",fontSize:12,lineHeight:"18px",zIndex:5,boxShadow:"0 10px 28px -8px rgba(0,0,0,0.28), 0 2px 6px rgba(0,0,0,0.08)",fontVariantNumeric:"tabular-nums",minWidth:112,maxWidth:Math.max(160,t.width*M-8)}}let D=p=>{d.current=null,p.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},P=p=>p?C=>{let R=d.current??(d.current=C.currentTarget.getBoundingClientRect());R.width&&p((C.clientX-R.left)/R.width*t.width,(C.clientY-R.top)/R.height*t.height,C)}:void 0,E=P(e.onPointerMove),L=P(e.onPointerDown),F=E||L?p=>{p.pointerType==="touch"&&E?.(p),L?.(p)}:void 0,S=P(e.onPointerUp),w=Kn(e.theme);return(0,z.jsxs)("div",{ref:t.ref,className:`ztd-root${t.reduced?" ztd-still":""}${e.className?` ${e.className}`:""}`,role:"group","aria-roledescription":t.t.chart,"aria-label":l,"aria-describedby":a,tabIndex:s?0:void 0,onKeyDown:s?h:void 0,onBlur:p=>{t.via==="keyboard"&&!p.currentTarget.contains(p.relatedTarget)&&t.setActive(null)},onPointerLeave:D,style:{width:"100%",maxWidth:t.measured?void 0:"100%",fontFamily:t.p.cssVars?`var(--ztd-font, ${t.p.theme.fontFamily})`:t.p.theme.fontFamily,color:t.p.paint("ink"),...w,...e.style},children:[t.pending?null:e.underlay,(0,z.jsxs)("svg",{className:"ztd-svg",role:"img","aria-labelledby":`${o} ${a}`,viewBox:`0 0 ${Math.max(1,Math.round(t.width*10)/10)} ${Math.max(1,Math.round(t.height*10)/10)}`,width:"100%",preserveAspectRatio:"xMidYMid meet",onPointerMove:E,onPointerDown:F,onPointerUp:S,onPointerCancel:S,style:{fontFamily:"inherit",touchAction:"pan-y",position:e.underlay?"relative":void 0},children:[(0,z.jsx)("title",{id:o,children:l}),(0,z.jsx)("desc",{id:a,children:i||t.description!==void 0?e.description:e.emptyText??t.t.empty}),e.defs&&!t.pending?(0,z.jsx)("defs",{children:e.defs}):null,t.pending?null:e.children]}),t.pending?null:e.overlay,$?(0,z.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:N,children:v??(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)("div",{style:{fontWeight:600,fontSize:11.5,color:t.p.paint("muted"),marginBottom:$.rows.length?4:0,overflow:"hidden",textOverflow:"ellipsis"},children:$.title}),$.rows.map((p,C)=>(0,z.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,justifyContent:"space-between"},children:[(0,z.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:7,color:t.p.paint(p.strong?"ink":"muted")},children:[p.color?(0,z.jsx)("span",{style:{width:8,height:8,borderRadius:999,background:p.color,display:"inline-block",boxShadow:"inset 0 0 0 1px rgba(127,127,127,0.3)"}}):null,p.label]}),(0,z.jsx)("span",{style:{fontWeight:p.strong===!1?500:700},children:p.value})]},C))]})}):null,(0,z.jsx)("span",{className:"ztd-sr",style:ft,"aria-live":"polite","aria-atomic":"true",children:b}),s&&!t.pending?u:null]})}function Wo({label:e,events:t,t:n}){return(0,z.jsx)("div",{className:"ztd-sr",style:ft,children:(0,z.jsxs)("table",{children:[(0,z.jsx)("caption",{children:n.table(e)}),(0,z.jsxs)("tbody",{children:[t.slice(0,dt).map((r,o)=>(0,z.jsxs)("tr",{children:[(0,z.jsx)("th",{scope:"row",children:r.series?`${r.label} · ${r.series}`:r.label}),(0,z.jsx)("td",{children:r.formatted??r.value??""})]},o)),t.length>dt?(0,z.jsx)("tr",{children:(0,z.jsx)("td",{colSpan:2,children:n.more(t.length-dt)})}):null]})]})})}function ht(e){let t=e.baseline??"central";return(0,z.jsx)("text",{x:Math.round(e.x*10)/10,y:Math.round(e.y*10)/10,dy:t==="central"?"0.35em":t==="hanging"?"0.75em":void 0,fontSize:e.size??11,fill:e.fill??"currentColor",textAnchor:e.anchor??"start",fontWeight:e.weight??400,opacity:e.opacity===void 0||e.opacity>=1?void 0:Math.max(0,e.opacity),className:e.className,letterSpacing:e.letterSpacing,style:{pointerEvents:"none",fontVariantNumeric:"tabular-nums"},children:e.children})}var y=(e,t,n,r,o={})=>({name:e,type:t,required:n,description:r,...o}),le=y("label","string",!0,"Item name field"),Y=y("value","number",!0,"Value field"),Go=[le,Y],Ko=[le,Y],Uo=[y("label","string",!0,"Stage name"),y("value","number",!0,"Users at the stage")],Xo=[le,Y],Yo=[y("label","string",!0,"Leaf (lowest level) name"),Y,y("group","string",!1,"Parent group field")],qo=[y("label","string",!0,"Leaf name"),Y,y("group","string",!1,"Parent group field")],Jo=[le,y("value","number",!0,"Change (total rows may omit it)"),y("type","string",!1,'"total" makes a total bar')],Zo=[le,Y],Qo=[y("x","string",!0,"Column field"),y("series","string",!0,"Stacked series field"),Y],ea=[y("x","string",!0,"Column field"),y("y","string",!0,"Row field"),Y],ta=[y("axis","string",!0,"Metric (axis) field"),y("value","number",!0,"Value field",{multi:!0}),y("series","string",!1,"Series field")],na=[y("x","number",!0,"x value"),y("y","number",!0,"y value"),y("size","number",!1,"Circle size"),y("label","string",!1,"Name")],Jn=y("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),ra=[y("x","any",!0,"x field (date, number or category)"),y("y","number",!0,"y field. An array for wide tables",{multi:!0}),y("series","string",!1,"Series field (long tables)"),y("lower","number",!1,"Lower bound of the range band. In wide tables an array in the order of y",{multi:!0}),Jn],oa=[y("x","any",!0,"x field"),y("y","number",!0,"y field. An array for wide tables",{multi:!0}),y("series","string",!1,"Series field"),y("lower","number",!1,'Lower bound of the range band, with stack "none" only. In wide tables an array in the order of y',{multi:!0}),Jn],aa=[y("x","any",!0,"x field"),y("y","number",!0,"y field",{multi:!0}),y("series","string",!1,"Series field")],ia=[y("x","string",!0,"Category field"),y("y","number",!0,"Value field. An array for wide tables",{multi:!0}),y("series","string",!1,"Series field"),y("line","number",!1,"Lines over vertical bars on the same axis, such as a target or last year. An array for several. Bars stay gray unless highlight is set, and with series the line averages rows of the same x",{multi:!0})],sa=[le,Y],la=[y("value","number",!0,"Value field",{prop:"valueKey"}),y("target","number",!1,"Target field",{prop:"targetKey"})],ca=[le,y("value","number",!0,"Actual value field"),y("target","number",!1,"Target field")],ua=[y("x","any",!1,"x field"),y("y","number",!0,"y field")],ma=[le,y("x","string",!1,"Period field (long tables)"),y("value","number",!1,"Value field (long tables)")],da=[le,y("start","number",!0,"Before value"),y("end","number",!0,"After value")],fa=[le,Y],ha=[y("value","number",!0,"Value field"),y("group","string",!1,"Group (row) field"),y("label","string",!1,"Dot name")],ga=[y("group","string",!0,"Group field"),y("value","number",!0,"Value field")],pa=[y("source","string",!0,"Source node"),y("target","string",!0,"Target node"),Y],ba=[y("source","string",!0,"Sending group"),y("target","string",!0,"Receiving group"),Y],ya=[y("date","date",!0,"Date field"),Y],xa=[y("x","any",!0,"Period field"),y("series","string",!0,"Item field"),y("rank","number",!1,"Rank field (1 is first)"),y("value","number",!1,"Value field (instead of rank, largest is first)")],ka=[y("group","string",!0,"Group field"),y("value","number",!0,"Value field")],wa=[y("label","string",!1,"Row name field")],va=[y("x","date",!0,"Date (period) field"),y("open","number",!0,"Open price field"),y("high","number",!0,"High price field"),y("low","number",!0,"Low price field"),y("close","number",!0,"Close price field"),y("volume","number",!1,"Volume field")],$a=[le,Y],Ca=[y("x","any",!0,"Period field (date or category)"),y("y","number",!0,"Back row fields stacked into each block. An array for wide tables",{multi:!0}),y("series","string",!1,"Series field (long tables, back row only)"),y("front","number",!1,"Front row fields: a smaller outcome in the same unit as y (wide tables only)",{multi:!0})],Ma=[y("value","number",!1,"Sample value field (raw rows)"),y("group","string",!1,"Group field. Up to 2 groups overlap"),y("x0","number",!1,"Bin start (pre-binned rows)"),y("x1","number",!1,"Bin end (pre-binned rows)"),y("count","number",!1,"Samples in the bin (pre-binned rows)")],Ta=[y("region","string",!0,"Region name or code, matched to a tile of options.map"),Y],Sa=[y("x","number",!0,"x value"),y("y","number",!0,"y value"),y("series","string",!1,"Series field (one color per series)"),y("label","string",!1,"Name")],qn={pie:Go,donut:Ko,funnel:Uo,waffle:Xo,treemap:Yo,sunburst:qo,waterfall:Jo,pareto:Zo,marimekko:Qo,heatmap:ea,radar:ta,bubble:na,line:ra,area:oa,stream:aa,bar:ia,radialBar:sa,gauge:la,bullet:ca,sparkline:ua,slope:ma,dumbbell:da,lollipop:fa,beeswarm:ha,ridgeline:ga,sankey:pa,chord:ba,calendar:ya,bump:xa,box:ka,parallel:wa,candlestick:va,segmented:$a,skyline:Ca,histogram:Ma,scatter:Sa,tileMap:Ta},Re={pie:{component:"PieChart",name:"Pie chart",nameKo:"파이 차트"},donut:{component:"DonutChart",name:"Donut chart",nameKo:"도넛 차트"},funnel:{component:"FunnelChart",name:"Funnel chart",nameKo:"퍼널 차트"},waffle:{component:"WaffleChart",name:"Waffle chart",nameKo:"와플 차트"},treemap:{component:"Treemap",name:"Treemap",nameKo:"트리맵"},sunburst:{component:"SunburstChart",name:"Sunburst",nameKo:"선버스트"},waterfall:{component:"WaterfallChart",name:"Waterfall chart",nameKo:"폭포 차트"},pareto:{component:"ParetoChart",name:"Pareto chart",nameKo:"파레토 차트"},marimekko:{component:"MarimekkoChart",name:"Marimekko chart",nameKo:"마리메코 차트"},heatmap:{component:"Heatmap",name:"Heatmap",nameKo:"히트맵"},radar:{component:"RadarChart",name:"Radar chart",nameKo:"레이더 차트"},bubble:{component:"BubbleChart",name:"Bubble chart",nameKo:"버블 차트"},line:{component:"LineChart",name:"Line chart",nameKo:"라인 차트"},area:{component:"AreaChart",name:"Area chart",nameKo:"영역 차트"},stream:{component:"StreamGraph",name:"Streamgraph",nameKo:"스트림그래프"},bar:{component:"BarChart",name:"Bar chart",nameKo:"막대 차트"},radialBar:{component:"RadialBarChart",name:"Radial bar chart",nameKo:"방사형 막대"},gauge:{component:"GaugeChart",name:"Gauge",nameKo:"게이지"},bullet:{component:"BulletChart",name:"Bullet chart",nameKo:"불릿 차트"},sparkline:{component:"Sparkline",name:"Sparkline",nameKo:"스파크라인"},slope:{component:"SlopeChart",name:"Slope chart",nameKo:"슬로프 차트"},dumbbell:{component:"DumbbellChart",name:"Dumbbell chart",nameKo:"덤벨 차트"},lollipop:{component:"LollipopChart",name:"Lollipop chart",nameKo:"롤리팝 차트"},beeswarm:{component:"BeeswarmChart",name:"Beeswarm",nameKo:"비스웜"},ridgeline:{component:"RidgelineChart",name:"Ridgeline",nameKo:"릿지라인"},sankey:{component:"SankeyChart",name:"Sankey diagram",nameKo:"생키 다이어그램"},chord:{component:"ChordChart",name:"Chord diagram",nameKo:"코드 다이어그램"},calendar:{component:"CalendarHeatmap",name:"Calendar heatmap",nameKo:"캘린더 히트맵"},bump:{component:"BumpChart",name:"Bump chart",nameKo:"범프 차트"},box:{component:"BoxPlot",name:"Box / violin plot",nameKo:"박스 플롯"},parallel:{component:"ParallelCoordinates",name:"Parallel coordinates",nameKo:"평행 좌표"},candlestick:{component:"CandlestickChart",name:"Candlestick chart",nameKo:"캔들스틱"},segmented:{component:"SegmentedBar",name:"Segmented bar",nameKo:"비율 막대"},skyline:{component:"SkylineChart",name:"Skyline",nameKo:"스카이라인"},histogram:{component:"HistogramChart",name:"Histogram",nameKo:"히스토그램"},scatter:{component:"ScatterChart",name:"Scatter plot",nameKo:"산점도"},tileMap:{component:"TileMap",name:"Tile grid map",nameKo:"타일 격자 지도"}};function Zn(e,t){return t==="ko"?e.nameKo:e.name}function Qn(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var er=["line","area","bar","scatter"],tr=24,Ut=["line","area","bar","scatter"];function Xt(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"&&n.layout!=="diverging"?[].concat(t.line??[]).map(String):[]}function nr(e,t,n){return Ut.includes(e)&&!Xt(e,t,n).length}function rr(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var Aa={doughnut:"donut",column:"bar",stackedBar:"bar",groupedBar:"bar",stacked:"area",streamgraph:"stream",radial:"radialBar",radialbar:"radialBar",progress:"gauge",progressRing:"gauge",kpi:"gauge",violin:"box",boxplot:"box",calendarHeatmap:"calendar","parallel-coordinates":"parallel",parallelCoordinates:"parallel",mekko:"marimekko",spider:"radar",ohlc:"candlestick",candle:"candlestick",stock:"candlestick",segment:"segmented",segmentedBar:"segmented",proportionBar:"segmented",stackedBar100:"segmented",hist:"histogram",tilemap:"tileMap",tileGrid:"tileMap",cartogram:"tileMap"};function gt(e){let t=qn[e]?e:Aa[e]??Object.keys(Re).find(n=>n.toLowerCase()===e.toLowerCase()||Re[n].component.toLowerCase()===e.toLowerCase());if(!(!t||!Re[t]))return{type:t,component:Re[t].component,name:Re[t].name,nameKo:Re[t].nameKo,encoding:qn[t]}}function or(e){let t=new Set,n=a=>{Array.isArray(a)?a.forEach(n):typeof a=="string"&&a&&t.add(a)},r=e.encoding??{};for(let a of gt(e.type)?.encoding.map(i=>i.name)??Object.keys(r))n(r[a]);let o=e.options??{};for(let a of["dimensions","start","end","ranges"])n(o[a]);return[...t]}function ar(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function Fa(e,t){if(e==null||typeof e!="object")return;let n=e;if(ar(n,t))return n[t];if(t.includes(".")){let r=n;for(let o of t.split(".")){if(r===null||typeof r!="object"||!ar(r,o))return;r=r[o]}return r}}function he(e){if(typeof e=="number")return Number.isFinite(e)?e:NaN;if(typeof e=="bigint")return Number(e);if(typeof e=="string"){let t=e.trim(),n=/^\(.*\)$/.test(t),r=t.replace(/[()\s%₩$€£¥원명건개회]/g,"").replace(/^\+/,"");if(!r||r.includes(",")&&!/^-?\d{1,3}(,\d{3})*(\.\d+)?$/.test(r))return NaN;let o=Number(r.replace(/,/g,""));return Number.isFinite(o)?n?-o:o:NaN}return e instanceof Date?e.getTime():typeof e=="boolean"?e?1:0:NaN}function Pe(e,t){if(typeof e=="function")return e;let n=e??t;return r=>Fa(r,n)}function De(e,t){let n=Pe(e,t);return(r,o)=>he(n(r,o))}function xe(e,t){let n=Pe(e,t);return(r,o)=>{let a=n(r,o);return a==null?"":a instanceof Date?new Date(a.getTime()-a.getTimezoneOffset()*6e4).toISOString().slice(0,10):String(a)}}function Le(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}function Na(e){let t=[],n=!1;for(let c=0;c<e.length&&c<4e3;c++){let l=e[c];if(l==='"')n=!n;else if(!n&&(l===`
|
|
23
|
-
`||l==="\r"))break;t.push(n?"":l)}let r=t.join(""),o=c=>r.split(c).length-1,
|
|
22
|
+
`;function ct(e,t,n,r,o){if(e)return t?{opacity:0}:{animation:`ztd-${n} ${Math.round(o)}ms cubic-bezier(.22,.9,.3,1) ${Math.round(r)}ms backwards`}}function ut(e,t){let[n]=(0,lr.useState)(!e.motion.enabled);return e.motion.enabled&&e.hydrated&&(!n||t.waiting||t.generation>0)}var sr=!1;function mt(){if(sr||typeof document>"u"||(sr=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=xa,document.head.appendChild(e)}var St=C(U(),1),ve=typeof window<"u"&&typeof document<"u",Ae=ve?St.useLayoutEffect:St.useEffect;function At(){return typeof performance<"u"?performance.now():Date.now()}function q(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function Je(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var cr={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},ur={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var ka=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],wa={basic:{bg:"line2",fg:"ink"},intermediate:{bg:"tint",fg:"accentText"},advanced:{bg:"ink",fg:"onInk"}};function va(e,t){let n=t.trim().toLowerCase();return e.find(r=>r.id===n||r.en.toLowerCase()===n||r.ko===t.trim())}function $a(e){return va(ka,e)}function mr(e,t){let n=$a(e);return{text:n?n[t]:e,...wa[n?.id??"basic"]}}var dr={white:"#ffffff",black:"#000000",transparent:"#00000000"};function Ze(e){if(!e)return null;let t=e.trim(),n=/^var\(\s*--[\w-]+\s*,\s*(.+)\)$/i.exec(t);if(n&&(t=n[1].trim()),dr[t.toLowerCase()]&&(t=dr[t.toLowerCase()]),t.startsWith("#")){let o=t.slice(1);if((o.length===3||o.length===4)&&(o=o.split("").map(a=>a+a).join("")),o.length!==6&&o.length!==8||/[^\da-f]/i.test(o))return null;let i=parseInt(o,16);return o.length===6?[i>>16&255,i>>8&255,i&255,1]:[parseInt(o.slice(0,2),16),parseInt(o.slice(2,4),16),parseInt(o.slice(4,6),16),parseInt(o.slice(6,8),16)/255]}let r=/^rgba?\(([^)]+)\)$/i.exec(t);if(r){let o=r[1].split(/[\s,/]+/).filter(Boolean);if(o.length<3)return null;let i=o.slice(0,3).map(s=>s.endsWith("%")?parseFloat(s)/100*255:parseFloat(s)),a=o[3]!==void 0?o[3].endsWith("%")?parseFloat(o[3])/100:parseFloat(o[3]):1;return i.some(s=>Number.isNaN(s))?null:[i[0],i[1],i[2],Number.isNaN(a)?1:a]}return null}function gr(e){let t=n=>Math.round(Math.max(0,Math.min(255,n))).toString(16).padStart(2,"0");return`#${t(e[0])}${t(e[1])}${t(e[2])}${e[3]<1?t(e[3]*255):""}`.toUpperCase()}function dn(e,t){let n=e[3];return[e[0]*n+t[0]*(1-n),e[1]*n+t[1]*(1-n),e[2]*n+t[2]*(1-n),1]}function Qe(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function fr(e){return .2126*Qe(e[0])+.7152*Qe(e[1])+.0722*Qe(e[2])}function fn(e,t,n){let r=typeof e=="string"?Ze(e):e,o=typeof t=="string"?Ze(t):t;if(!r||!o)return 0;let i=n?typeof n=="string"?Ze(n):n:null;o[3]<1&&i&&(o=dn(o,i));let a=r[3]<1?dn(r,o):r,s=fr(a),c=fr(o);return(Math.max(s,c)+.05)/(Math.min(s,c)+.05)}function Ma(e){return[Qe(e[0]),Qe(e[1]),Qe(e[2])]}function mn(e){let t=e<=.0031308?12.92*e:1.055*Math.pow(e,.4166666666666667)-.055;return Math.max(0,Math.min(255,t*255))}function hr(e){let[t,n,r]=Ma(e),o=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*r),i=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*r),a=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*r);return[.2104542553*o+.793617785*i-.0040720468*a,1.9779984951*o-2.428592205*i+.4505937099*a,.0259040371*o+.7827717662*i-.808675766*a]}function Ta([e,t,n],r){let o=(e+.3963377774*t+.2158037573*n)**3,i=(e-.1055613458*t-.0638541728*n)**3,a=(e-.0894841775*t-1.291485548*n)**3;return[mn(4.0767416621*o-3.3077115913*i+.2309699292*a),mn(-1.2684380046*o+2.6097574011*i-.3413193965*a),mn(-.0041960863*o-.7034186147*i+1.707614701*a),r]}function Nt(e,t,n){let r=Ze(e),o=Ze(t);if(!r||!o)return e;let i=hr(r),a=hr(o),s=Math.max(0,Math.min(1,n));return gr(Ta([i[0]*s+a[0]*(1-s),i[1]*s+a[1]*(1-s),i[2]*s+a[2]*(1-s)],r[3]*s+o[3]*(1-s)))}function hn(e,t,n){let r=t[0],o=-1;for(let i of t){let a=fn(i,e,n);a>o&&(o=a,r=i)}return r}function ne(e,t){let n=e.theme;switch(t){case"accent":return{role:t,fill:e.paint("accent"),text:e.paint("onAccent"),raw:n.accent};case"ink":return{role:t,fill:e.paint("ink"),text:e.paint("onInk"),raw:n.ink};case"strong":return{role:t,fill:e.paint("neutralStrong"),text:e.paint("onNeutralStrong"),raw:n.neutralStrong};case"soft":return{role:t,fill:e.paint("neutralSoft"),text:e.paint("ink"),raw:n.neutralSoft};default:return{role:"neutral",fill:e.paint("neutral"),text:e.paint("ink"),raw:n.neutral}}}function Ca(e,t){let n=hn(t,[e.theme.ink,e.theme.onAccent,e.theme.onNeutralStrong]);return fn(n,t)>=4.5?n===e.theme.ink?e.paint("ink"):n===e.theme.onAccent?e.paint("onAccent"):e.paint("onNeutralStrong"):hn(t,["#FFFFFF","#000000"])}function Rt(e,t){let n=Nt(e.theme.neutralStrong,e.theme.neutral,t);return{role:"mix",fill:e.mix("neutralStrong","neutral",t),text:Ca(e,n),raw:n}}function ce(e,t,n){let r=new Array(t),o=[];for(let a=0;a<t;a++)n.has(a)?r[a]=ne(e,"accent"):o.push(a);let i=o.length;return o.forEach((a,s)=>{if(i===1)r[a]=ne(e,"neutral");else if(s===0)r[a]=ne(e,"ink");else if(s===i-1)r[a]=ne(e,"neutral");else if(i===3)r[a]=ne(e,"strong");else{let c=(s-1)/Math.max(1,i-2);r[a]=c<=.001?ne(e,"strong"):Rt(e,1-c)}}),r}var gn="mix:";function Oe(e){return e({theme:sn,cssVars:!1,paint:n=>n,color:n=>n??"neutral",raw:n=>n??"neutral",mix:(n,r,o)=>`${gn}${o}`}).map(n=>n.fill)}function pr(e,t){return t?.startsWith(gn)?e.mix("neutralStrong","neutral",Number(t.slice(gn.length))):e.color(t)}function dt(e,t,n){return ce(e,t+1,n).slice(0,t)}function br(e,t,n,r="neutral"){let o=ne(e,"accent"),i=ne(e,r);return Array.from({length:t},(a,s)=>n.has(s)?o:i)}function yr(e,t,n){let r=new Array(t),o=[];for(let a=0;a<t;a++)n.has(a)?r[a]=ne(e,"accent"):o.push(a);let i=o.length;return o.forEach((a,s)=>{i===1?r[a]=ne(e,"neutral"):s===0?r[a]=ne(e,"strong"):s===i-1?r[a]=ne(e,"neutral"):r[a]=Rt(e,1-s/(i-1))}),r}var $e=C(U(),1);var _t=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),ue="en-US",xr=new Map;function pn(e,t){let n=t.maximumFractionDigits!==void 0||t.style==="currency"?t:{...t,maximumFractionDigits:Math.max(1,t.minimumFractionDigits??0)},r=e+JSON.stringify(n),o=xr.get(r);return o||(o=new Intl.NumberFormat(e,n),xr.set(r,o)),o}function bn(e){return/^[-\u2212]/.test(e)&&!/[1-9]/.test(e)?e.slice(1):e}function et(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=ue,...r}=t;return bn(pn(n,r).format(e))}var yn=e=>e!==0&&Math.abs(e)<.05,xn=(e,t,n="")=>`${et(e,{locale:t,maximumSignificantDigits:2,maximumFractionDigits:20})}${n}`;function Ft(e,t={}){if(!Number.isFinite(e))return"-";if(yn(e)&&t.maximumFractionDigits===void 0)return xn(e,t.locale??ue,"%");let n=Math.abs(e);return`${et(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function $r(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=ue,...r}=t;if(q(n)==="ko"){let o=Math.abs(e),i=[[1e12,"조"],[1e8,"억"],[1e4,"만"],[1,""]],a=i.findIndex(([s])=>o>=s);for(a<0&&(a=i.length-1);;){let[s,c]=i[a],l=o/s,m=Math.max(r.minimumFractionDigits??0,r.maximumFractionDigits??(s===1||l<100?1:0)),u=Math.round(l*10**m)/10**m;if(a>0&&u>=i[a-1][0]/s){a--;continue}return(e<0&&u!==0?"-":"")+et(u,{locale:n,...r,maximumFractionDigits:m})+c}}return bn(pn(n,{notation:"compact",...r}).format(e))}var Sa=(e,t=q(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function We(e,t=ue,n){if(typeof e=="function")return e;let r=(o,i="",a="")=>{let s=pn(t,o);return c=>Number.isFinite(c)?`${a}${bn(s.format(c))}${i}`:"-"};if(e&&typeof e=="object"){let{suffix:o="",prefix:i="",...a}=e;return r(a,o,i)}switch(e??n){case"integer":return r({maximumFractionDigits:0});case"decimal":return r({minimumFractionDigits:1,maximumFractionDigits:2});case"percent":return o=>Ft(o,{locale:t});case"ratio":return o=>Ft(o*100,{locale:t});case"compact":return o=>$r(o,{locale:t});case"currency":return r(Sa(t));default:{let o=r({maximumFractionDigits:1});return i=>yn(i)?xn(i,t):o(i)}}}function Mr(e,t=ue,n=0){return e!==void 0?We(e,t):n>=1e5?r=>yn(r)?xn(r,t):$r(r,{locale:t}):r=>et(r,{locale:t})}function Aa(e,t,n=1){let r=new Date(+e,+t-1,+n);return r.getMonth()===+t-1&&r.getDate()===+n?r:null}var kn=e=>Number.isInteger(e)&&e>=1e3&&e<=9999,Na=/^\d{4}-\d{1,2}(-\d{1,2})?([T ][\d:.]+(Z|[+-]\d{2}:?\d{2})?)?$/,Ra=["january","february","march","april","may","june","july","august","september","october","november","december"],kr=e=>{let t=e.toLowerCase();return t.length<3?0:Ra.findIndex(n=>n.startsWith(t))+1},wr=e=>+e+(+e<30?2e3:1900);function Tr(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var Fa=[/^(\d{4})-(\d{1,2})(?:-(\d{1,2}))?$/,/^(\d{4})[./]\s*(\d{1,2})[./]\s*(\d{1,2})\.?$/,/^(19\d\d|20\d\d|2100)(\d\d)(\d\d)$/,/^(\d{4})년\s*(\d{1,2})월(?:\s*(\d{1,2})일)?$/],Cr=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,Sr=/\{([^{}]+)\}/g;function Pt(e,t){let n;for(let r of Fa)if(n=r.exec(e))return[+n[1],+n[2],+(n[3]??1),n[3]?1:2];if(/^\d{4}-\d/.test(e))return null;if(n=/^(\d{2})\.\s*(\d{1,2})\.\s*(\d{1,2})\.?$/.exec(e))return t?[wr(n[3]),+n[2],+n[1],1]:[wr(n[1]),+n[2],+n[3],1];if(n=/^(?:(\d{4})\s*-?\s*Q([1-4])|Q([1-4])\s*-?\s*(\d{4})|(\d{4})년\s*([1-4])분기)$/i.exec(e))return[+(n[1]??n[4]??n[5]),+(n[2]??n[3]??n[6])*3-2,1,3];if(n=Cr.exec(e)){let r=+n[1],o=+n[3],i=r>12||o<=12&&t===!0;return[+n[4],i?o:r,i?r:o,1]}if(n=/^(\d{1,2})[\s-]+([a-z]{3,9})\.?[\s-]+(\d{4})$/i.exec(e)){let r=kr(n[2]);return r?[+n[3],r,+n[1],1]:null}if(n=/^([a-z]{3,9})\.?\s+(?:(\d{1,2}),?\s+)?(\d{4})$/i.exec(e)){let r=kr(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}var Ar=e=>Na.test(e)||Pt(e)!==null;function Nr(e){let t;for(let n of e){let r=typeof n=="string"?Cr.exec(n.trim()):null;if(r){if(+r[1]>12)return!0;+r[3]>12&&(t=!1)}}return t}function Dt(e,t){if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e=="number"){if(!Number.isFinite(e))return null;if(Number.isInteger(e)){if(kn(e))return new Date(e,0,1);if(e>=19000101&&e<=21001231)return Dt(`${e}`)}return new Date(Math.abs(e)>=1e9&&Math.abs(e)<1e10?e*1e3:e)}if(typeof e=="string"&&e.trim()){let n=e.trim(),r=Pt(n,t);if(r)return Aa(r[0],r[1],r[2]);if(/^\d{4}$/.test(n))return new Date(Number(n),0,1);if(!/\d{4}/.test(n))return null;let o=new Date(n);return Number.isNaN(o.getTime())?null:o}return null}var vr=new Map;function ft(e,t={month:"short",day:"numeric"}){let n=Dt(e);if(!n)return"-";let{locale:r=ue,...o}=t,i=r+JSON.stringify(o),a=vr.get(i);return a||(a=new Intl.DateTimeFormat(r,o),vr.set(i,a)),a.format(n)}var wn=C(z(),1),Lt=(0,$e.createContext)({theme:Ee,cssVars:!0});function _a(e,t=Ee){return e?typeof e=="string"?ln[e]??t:un(t,e):t}function Et(e){let t=(0,$e.useContext)(Lt),n=e.base?ln[e.base]:t.theme,r=(0,$e.useMemo)(()=>_a(e.theme,n),[e.theme,n]),o=e.cssVars??t.cssVars,i=e.locale??t.locale,a=(0,$e.useMemo)(()=>({theme:r,cssVars:o,locale:i}),[r,o,i]),s=(0,$e.useMemo)(()=>cn(r),[r]),c=e.paint?{background:r.bg,color:r.ink,fontFamily:r.fontFamily,...s,...e.style}:{display:"contents",...s,...e.style};return(0,wn.jsx)(Lt.Provider,{value:a,children:(0,wn.jsx)("div",{className:e.className,"data-ztd-theme":r.name,lang:e.locale,style:c,children:e.children})})}var Pa=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function Fr(e){return Pa.has(e)}function Da(e,t){let n=r=>t?`var(${Ct(r)}, ${e[r]})`:e[r];return{theme:e,cssVars:t,paint:n,color:(r,o="neutral")=>r?Fr(r)?n(r):r:n(o),raw:(r,o="neutral")=>r?Fr(r)?e[r]:r:e[o],mix:(r,o,i)=>{let a=Math.round(Math.max(0,Math.min(1,i))*1e3)/10;return t?`color-mix(in oklab, ${n(r)} ${a}%, ${n(o)})`:Nt(e[r],e[o],i)}}}function Me(e){let t=(0,$e.useContext)(Lt);return(0,$e.useMemo)(()=>{let n=un(t.theme,e);return Da(n,t.cssVars)},[t.theme,t.cssVars,e])}function de(e){let t=(0,$e.useContext)(Lt);return e??t.locale??ue}function _r(e){return e?cn(e):{}}var Ot=C(U(),1),vn=(0,Ot.createContext)(void 0);function Pr(e){let t=(0,Ot.useContext)(vn);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var S=C(z(),1),La={legend:"Legend",replay:"Replay animation",replayTitle:"Replay",sample:"Sample data",loadError:"Couldn't load data",retry:"Try again",loading:"Loading",empty:"No data to show",source:"Source",shown:(e,t)=>`${e} of ${t} series shown`},Ea={en:La,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var Oa={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},$n=e=>Ea[q(de(e))];function Mn(e){let t=Me(e.theme),n=$n(e.locale),[r,o]=(0,It.useState)(!1),i=e.size??11.5,a=e.onToggle,s=new Set(a?e.hidden:void 0),c=e.items.filter(m=>!s.has(m.label)).length,l=(0,S.jsx)("ul",{"aria-label":n.legend,style:{display:"flex",flexWrap:"wrap",justifyContent:e.align==="start"?"flex-start":"flex-end",gap:"4px 12px",margin:0,padding:0,listStyle:"none"},children:e.items.map((m,u)=>{let d=!s.has(m.label),h=d&&c===1,f=(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Ia,{p:t,item:m,off:!d}),(0,S.jsx)("span",{style:d?void 0:{textDecoration:"line-through"},children:m.label})]});return(0,S.jsx)("li",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:i,color:t.paint("muted"),lineHeight:1.3},children:a?(0,S.jsx)("button",{type:"button",className:"ztd-btn","aria-pressed":d,"aria-disabled":h||void 0,onClick:()=>{h||(a(m.label),o(!0))},style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:24,minWidth:24,padding:"0 2px",margin:0,border:0,borderRadius:4,background:"transparent",color:"inherit",fontSize:"inherit",lineHeight:"inherit",cursor:h?"default":void 0},children:f}):f},u)})});return a?(0,S.jsxs)(S.Fragment,{children:[l,(0,S.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:Oa,children:r?n.shown(c,e.items.length):""})]}):l}function Ia({p:e,item:t,off:n}){let r=pr(e,t.color),o=t.shape??"square";return o==="line"||o==="dash"?(0,S.jsxs)("svg",{width:14,height:8,"aria-hidden":"true",style:{flex:"none",opacity:n?.35:void 0},children:[(0,S.jsx)("line",{x1:1,x2:13,y1:4,y2:4,stroke:r,strokeWidth:2,strokeDasharray:o==="dash"?"3 2":void 0,strokeLinecap:"round"}),o==="line"?(0,S.jsx)("circle",{cx:7,cy:4,r:2.2,fill:r}):null]}):(0,S.jsx)("span",{"aria-hidden":"true",style:{width:9,height:9,flex:"none",borderRadius:o==="circle"?9:2.5,background:r,boxShadow:t.color==="neutral"||t.color==="neutralSoft"||!t.color?`inset 0 0 0 1px ${e.paint("line2")}`:void 0,opacity:n?.35:void 0}})}function za(e){let t=Me(e.theme),n=mr(e.level,q(de(e.locale)));return(0,S.jsx)("span",{style:{background:t.paint(n.bg),color:t.paint(n.fg),borderRadius:8,padding:"3px 9px",fontSize:12.5,fontWeight:700,lineHeight:"18px",whiteSpace:"nowrap",flex:"none"},children:n.text})}function Ba(e,t,n){if(typeof e!="string"||!t)return e;let r=e.indexOf(t);return r<0?e:(0,S.jsxs)(S.Fragment,{children:[e.slice(0,r),(0,S.jsx)("span",{style:{color:n},children:t}),e.slice(r+t.length)]})}function Dr(e){let t=Me(e.theme),n=$n(e.locale),[r,o]=(0,It.useState)(0);Ae(()=>mt(),[]);let i=()=>{o(d=>d+1),e.onReplay?.()},a=Array.isArray(e.legend)?(0,S.jsx)(Mn,{items:e.legend,theme:e.theme,locale:e.locale}):e.legend,s=e.as??"h3",c=e.number===void 0?null:typeof e.number=="number"?String(e.number).padStart(2,"0"):e.number,l=e.replay||e.onReplay,m=e.source!==void 0||e.note!==void 0?(0,S.jsxs)("p",{style:{margin:0,fontSize:12,color:t.paint("muted"),lineHeight:1.4},children:[e.source!==void 0?`${n.source}: `:null,e.source,e.source!==void 0&&e.note!==void 0?" · ":null,e.note]}):null,u=e.takeaway!==void 0||e.level||e.sample?(0,S.jsxs)("footer",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:2},children:[(0,S.jsx)("span",{style:{fontSize:17,fontWeight:800,color:t.paint("ink"),letterSpacing:-.3,lineHeight:1.3,minWidth:0},children:e.takeaway}),(0,S.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,flex:"none"},children:[e.sample?(0,S.jsx)("span",{style:{fontSize:11.5,color:t.paint("muted"),whiteSpace:"nowrap"},children:typeof e.sample=="string"?e.sample:n.sample}):null,e.level?(0,S.jsx)(za,{level:e.level,theme:e.theme,locale:e.locale}):null]})]}):null;return(0,S.jsxs)("section",{id:e.id,className:`ztd-card${e.className?` ${e.className}`:""}`,style:{background:t.paint("panel"),color:t.paint("ink"),border:`1px solid ${t.paint("line")}`,borderRadius:`var(--ztd-radius, ${t.theme.radius}px)`,padding:"20px 20px 16px",display:"flex",flexDirection:"column",gap:12,minWidth:0,boxSizing:"border-box",fontFamily:t.cssVars?`var(--ztd-font, ${t.theme.fontFamily})`:t.theme.fontFamily,wordBreak:"keep-all",textWrap:"balance",...e.style},children:[(0,S.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[(0,S.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[c?(0,S.jsx)("span",{style:{fontFamily:t.cssVars?`var(--ztd-mono, ${t.theme.monoFamily})`:t.theme.monoFamily,fontSize:17,fontWeight:700,color:t.paint("accentText"),letterSpacing:-.2,flex:"none"},children:c}):null,(0,S.jsx)(s,{style:{margin:0,fontSize:22,fontWeight:800,color:t.paint("ink"),letterSpacing:-.5,lineHeight:1.25,minWidth:0,flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:Ba(e.title,e.accent,t.paint("accentText"))}),e.actions,l?(0,S.jsx)("button",{type:"button",className:"ztd-btn",onClick:i,"aria-label":e.replayLabel??n.replay,title:e.replayLabel??n.replayTitle,style:{background:"transparent",color:t.paint("muted"),border:`1px solid ${t.paint("line2")}`,borderRadius:14,width:28,height:28,display:"inline-grid",placeItems:"center",padding:0,flex:"none"},children:(0,S.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,S.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,S.jsx)("path",{d:"M3 3v6h6"})]})}):null]}),e.subtitle!==void 0||a?(0,S.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px 12px",flexWrap:"wrap",minHeight:18},children:[e.subtitle!==void 0?(0,S.jsx)("span",{style:{fontSize:12.5,color:t.paint("muted"),lineHeight:1.4},children:e.subtitle}):(0,S.jsx)("span",{}),a]}):null]}),(0,S.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:0,minWidth:0},children:(0,S.jsx)(vn.Provider,{value:r,children:(0,S.jsx)(qe.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),m?(0,S.jsxs)(S.Fragment,{children:[m,u]}):u]})}function Tn(e){let t=Me(e.theme),n=$n(e.locale),r=e.height??220;if(Ae(()=>mt(),[]),e.error){let o=typeof e.error=="string"?e.error:e.error.message;return(0,S.jsx)("div",{role:"alert",style:{height:r,display:"grid",placeItems:"center",textAlign:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,S.jsxs)("div",{style:{display:"grid",gap:8,justifyItems:"center",padding:16},children:[(0,S.jsx)("span",{style:{fontSize:14,fontWeight:700,color:t.paint("ink")},children:n.loadError}),(0,S.jsx)("span",{style:{fontSize:12,color:t.paint("muted"),maxWidth:280,wordBreak:"break-word"},children:o}),e.onRetry?(0,S.jsx)("button",{type:"button",className:"ztd-btn",onClick:e.onRetry,style:{marginTop:4,background:t.paint("ink"),color:t.paint("onInk"),border:"none",borderRadius:14,padding:"5px 14px",fontSize:12.5,fontWeight:700},children:n.retry}):null]})})}return e.loading?(0,S.jsx)("div",{role:"status","aria-busy":"true","aria-label":n.loading,style:{height:r,display:"flex",alignItems:"flex-end",gap:8,padding:"12px 4px"},children:[.55,.8,.4,.95,.65,.75,.5].map((o,i)=>(0,S.jsx)("span",{className:"ztd-skeleton",style:{flex:1,height:`${o*100}%`,background:t.paint("lift"),borderRadius:6,animationDelay:`${i*90}ms`}},i))}):e.empty?(0,S.jsx)("div",{style:{height:r,display:"grid",placeItems:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,S.jsx)("span",{style:{fontSize:13,color:t.paint("muted")},children:e.emptyText??n.empty})}):(0,S.jsx)(S.Fragment,{children:e.children})}var at=C(U(),1);var fe=C(U(),1);var G=C(z(),1),zt=60;var Bt={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function Cn(e){let{c:t,events:n}=e,r=(0,fe.useId)().replace(/:/g,""),o=`${r}t`,i=`${r}d`;t.events.current=n,Ae(()=>{mt()},[]);let a=n.length,s=!e.noNav&&a>0,c=(0,fe.useContext)(qe),l=e.ariaLabel??c??e.kind,m=(0,fe.useMemo)(()=>s?`${n.length}${n.slice(0,zt).map(y=>`${y.label}${y.series??""}${y.formatted??y.value??""}`).join("")}`:"",[n,s]),u=(0,fe.useMemo)(()=>(0,G.jsx)(Ha,{label:l,events:n,t:t.t}),[l,m,t.t]),d=(0,fe.useRef)(null);(0,fe.useEffect)(()=>{let y=()=>{d.current=null};return window.addEventListener("scroll",y,{capture:!0,passive:!0}),window.addEventListener("resize",y,{passive:!0}),()=>{window.removeEventListener("scroll",y,{capture:!0}),window.removeEventListener("resize",y)}},[]),(0,fe.useEffect)(()=>{d.current=null},[t.width,t.height]);let h=y=>{if(y.target!==y.currentTarget)return;if(e.onKey?.(y)){y.preventDefault();return}let M=t.active,D;switch(y.key){case"ArrowRight":case"ArrowDown":D=M===null?0:(M+1)%a;break;case"ArrowLeft":case"ArrowUp":D=M===null?a-1:(M-1+a)%a;break;case"Home":D=0;break;case"End":D=a-1;break;case"Escape":if(M===null)return;D=null;break;case"Enter":case" ":M!==null&&(y.preventDefault(),t.click(M));return;default:return}y.preventDefault(),t.setActive(D,"keyboard")},{via:f,node:g,setActive:w}=t;(0,fe.useEffect)(()=>{if(f!=="touch"||!g)return;let y=M=>{g.contains(M.target)||w(null)};return document.addEventListener("pointerdown",y),()=>document.removeEventListener("pointerdown",y)},[f,g,w]);let x=t.active!==null?n[t.active]:null,k=t.showTooltip&&e.renderTip!==!1&&!t.pending&&t.via!=="sync"?e.tip:null,$=k&&!t.responsive&&t.node&&t.width&&t.node.getBoundingClientRect().width/t.width||1,R=typeof e.renderTip=="function"&&x?e.renderTip(x):null,b=e.announce??(t.via==="keyboard"&&x?`${x.label}${x.series?` ${x.series}`:""}: ${x.formatted??x.value??""} (${(t.active??0)+1}/${a})`:""),A;if(k){let y=k.x*$,M=t.width*$,D=`clamp(${(4-y).toFixed(1)}px, -50%, calc(${(M-y-4).toFixed(1)}px - 100%))`,O=k.y<64;A={position:"absolute",left:y,top:k.y*$,transform:`translate(${D}, ${O?"16px":"calc(-100% - 14px)"})`,background:t.p.paint("panel"),color:t.p.paint("ink"),border:`1px solid ${t.p.paint("line")}`,borderRadius:12,padding:"8px 11px",pointerEvents:"none",whiteSpace:"nowrap",fontSize:12,lineHeight:"18px",zIndex:5,boxShadow:"0 10px 28px -8px rgba(0,0,0,0.28), 0 2px 6px rgba(0,0,0,0.08)",fontVariantNumeric:"tabular-nums",minWidth:112,maxWidth:Math.max(160,t.width*$-8)}}let E=y=>{d.current=null,y.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},_=y=>y?M=>{let D=d.current??(d.current=M.currentTarget.getBoundingClientRect());D.width&&y((M.clientX-D.left)/D.width*t.width,(M.clientY-D.top)/D.height*t.height,M)}:void 0,P=_(e.onPointerMove),L=_(e.onPointerDown),F=P||L?y=>{y.pointerType==="touch"&&P?.(y),L?.(y)}:void 0,T=_(e.onPointerUp),v=_r(e.theme);return(0,G.jsxs)("div",{ref:t.ref,className:`ztd-root${t.reduced?" ztd-still":""}${e.className?` ${e.className}`:""}`,role:"group","aria-roledescription":t.t.chart,"aria-label":l,"aria-describedby":i,tabIndex:s?0:void 0,onKeyDown:s?h:void 0,onBlur:y=>{t.via==="keyboard"&&!y.currentTarget.contains(y.relatedTarget)&&t.setActive(null)},onPointerLeave:E,style:{width:"100%",maxWidth:t.measured?void 0:"100%",fontFamily:t.p.cssVars?`var(--ztd-font, ${t.p.theme.fontFamily})`:t.p.theme.fontFamily,color:t.p.paint("ink"),...v,...e.style},children:[t.pending?null:e.underlay,(0,G.jsxs)("svg",{className:"ztd-svg",role:"img","aria-labelledby":`${o} ${i}`,viewBox:`0 0 ${Math.max(1,Math.round(t.width*10)/10)} ${Math.max(1,Math.round(t.height*10)/10)}`,width:"100%",preserveAspectRatio:"xMidYMid meet",onPointerMove:P,onPointerDown:F,onPointerUp:T,onPointerCancel:T,style:{fontFamily:"inherit",touchAction:"pan-y",position:e.underlay?"relative":void 0},children:[(0,G.jsx)("title",{id:o,children:l}),(0,G.jsx)("desc",{id:i,children:a||t.description!==void 0?e.description:e.emptyText??t.t.empty}),e.defs&&!t.pending?(0,G.jsx)("defs",{children:e.defs}):null,t.pending?null:e.children]}),t.pending?null:e.overlay,k?(0,G.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:A,children:R??(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)("div",{style:{fontWeight:600,fontSize:11.5,color:t.p.paint("muted"),marginBottom:k.rows.length?4:0,overflow:"hidden",textOverflow:"ellipsis"},children:k.title}),k.rows.map((y,M)=>(0,G.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,justifyContent:"space-between"},children:[(0,G.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:7,color:t.p.paint(y.strong?"ink":"muted")},children:[y.color?(0,G.jsx)("span",{style:{width:8,height:8,borderRadius:999,background:y.color,display:"inline-block",boxShadow:"inset 0 0 0 1px rgba(127,127,127,0.3)"}}):null,y.label]}),(0,G.jsx)("span",{style:{fontWeight:y.strong===!1?500:700},children:y.value})]},M))]})}):null,(0,G.jsx)("span",{className:"ztd-sr",style:Bt,"aria-live":"polite","aria-atomic":"true",children:b}),s&&!t.pending?u:null]})}function Ha({label:e,events:t,t:n}){return(0,G.jsx)("div",{className:"ztd-sr",style:Bt,children:(0,G.jsxs)("table",{children:[(0,G.jsx)("caption",{children:n.table(e)}),(0,G.jsxs)("tbody",{children:[t.slice(0,zt).map((r,o)=>(0,G.jsxs)("tr",{children:[(0,G.jsx)("th",{scope:"row",children:r.series?`${r.label} · ${r.series}`:r.label}),(0,G.jsx)("td",{children:r.formatted??r.value??""})]},o)),t.length>zt?(0,G.jsx)("tr",{children:(0,G.jsx)("td",{colSpan:2,children:n.more(t.length-zt)})}):null]})]})})}function _e(e){let t=e.baseline??"central";return(0,G.jsx)("text",{x:Math.round(e.x*10)/10,y:Math.round(e.y*10)/10,dy:t==="central"?"0.35em":t==="hanging"?"0.75em":void 0,fontSize:e.size??11,fill:e.fill??"currentColor",textAnchor:e.anchor??"start",fontWeight:e.weight??400,opacity:e.opacity===void 0||e.opacity>=1?void 0:Math.max(0,e.opacity),className:e.className,letterSpacing:e.letterSpacing,style:{pointerEvents:"none",fontVariantNumeric:"tabular-nums"},children:e.children})}var p=(e,t,n,r,o={})=>({name:e,type:t,required:n,description:r,...o}),pe=p("label","string",!0,"Item name field"),ae=p("value","number",!0,"Value field"),ja=[pe,ae],Ga=[pe,ae],Wa=[p("label","string",!0,"Stage name"),p("value","number",!0,"Users at the stage")],Va=[pe,ae],Ka=[p("label","string",!0,"Leaf (lowest level) name"),ae,p("group","string",!1,"Parent group field")],Ua=[p("label","string",!0,"Leaf name"),ae,p("group","string",!1,"Parent group field")],Xa=[pe,p("value","number",!0,"Change (total rows may omit it)"),p("type","string",!1,'"total" makes a total bar')],Ya=[pe,ae],qa=[p("x","string",!0,"Column field"),p("series","string",!0,"Stacked series field"),ae],Ja=[p("x","string",!0,"Column field"),p("y","string",!0,"Row field"),ae],Za=[p("axis","string",!0,"Metric (axis) field"),p("value","number",!0,"Value field",{multi:!0}),p("series","string",!1,"Series field")],Qa=[p("x","number",!0,"x value"),p("y","number",!0,"y value"),p("size","number",!1,"Circle size"),p("label","string",!1,"Name")],Er=p("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),ei=[p("x","any",!0,"x field (date, number or category)"),p("y","number",!0,"y field. An array for wide tables",{multi:!0}),p("series","string",!1,"Series field (long tables)"),p("lower","number",!1,"Lower bound of the range band. In wide tables an array in the order of y",{multi:!0}),Er],ti=[p("x","any",!0,"x field"),p("y","number",!0,"y field. An array for wide tables",{multi:!0}),p("series","string",!1,"Series field"),p("lower","number",!1,'Lower bound of the range band, with stack "none" only. In wide tables an array in the order of y',{multi:!0}),Er],ni=[p("x","any",!0,"x field"),p("y","number",!0,"y field",{multi:!0}),p("series","string",!1,"Series field")],ri=[p("x","string",!0,"Category field"),p("y","number",!0,"Value field. An array for wide tables",{multi:!0}),p("series","string",!1,"Series field"),p("line","number",!1,"Lines over vertical bars on the same axis, such as a target or last year. An array for several. Bars stay gray unless highlight is set, and with series the line averages rows of the same x",{multi:!0})],oi=[pe,ae],ai=[p("value","number",!0,"Value field",{prop:"valueKey"}),p("target","number",!1,"Target field",{prop:"targetKey"})],ii=[pe,p("value","number",!0,"Actual value field"),p("target","number",!1,"Target field")],si=[p("x","any",!1,"x field"),p("y","number",!0,"y field")],li=[pe,p("x","string",!1,"Period field (long tables)"),p("value","number",!1,"Value field (long tables)")],ci=[pe,p("start","number",!0,"Before value"),p("end","number",!0,"After value")],ui=[pe,ae],mi=[p("value","number",!0,"Value field"),p("group","string",!1,"Group (row) field"),p("label","string",!1,"Dot name")],di=[p("group","string",!0,"Group field"),p("value","number",!0,"Value field")],fi=[p("source","string",!0,"Source node"),p("target","string",!0,"Target node"),ae],hi=[p("source","string",!0,"Sending group"),p("target","string",!0,"Receiving group"),ae],gi=[p("date","date",!0,"Date field"),ae],pi=[p("x","any",!0,"Period field"),p("series","string",!0,"Item field"),p("rank","number",!1,"Rank field (1 is first)"),p("value","number",!1,"Value field (instead of rank, largest is first)")],bi=[p("group","string",!0,"Group field"),p("value","number",!0,"Value field")],yi=[p("label","string",!1,"Row name field")],xi=[p("x","date",!0,"Date (period) field"),p("open","number",!0,"Open price field"),p("high","number",!0,"High price field"),p("low","number",!0,"Low price field"),p("close","number",!0,"Close price field"),p("volume","number",!1,"Volume field")],ki=[pe,ae],wi=[p("x","any",!0,"Period field (date or category)"),p("y","number",!0,"Back row fields stacked into each block. An array for wide tables",{multi:!0}),p("series","string",!1,"Series field (long tables, back row only)"),p("front","number",!1,"Front row fields: a smaller outcome in the same unit as y (wide tables only)",{multi:!0})],vi=[p("value","number",!1,"Sample value field (raw rows)"),p("group","string",!1,"Group field. Up to 2 groups overlap"),p("x0","number",!1,"Bin start (pre-binned rows)"),p("x1","number",!1,"Bin end (pre-binned rows)"),p("count","number",!1,"Samples in the bin (pre-binned rows)")],$i=[p("region","string",!0,"Region name or code, matched to a tile of options.map"),ae],Mi=[pe,ae,p("frame","any",!0,"Time step field: a year, a date or any ordered key. Numbers and dates play in order, other text in the order it first appears. An item with no value in a step leaves the bars for that step")],Ti=[p("source","string",!0,"Source node"),p("target","string",!0,"Target node"),p("value","number",!1,"Link weight. Without it every row counts 1")],Ci=[p("label","string",!0,"Row name. Items with the same name share a row"),p("start","any",!0,"Start: a number (minutes, seconds, any unit) or a date or date-time"),p("end","any",!0,"End, same kind as start. Equal to start draws a point event; empty means still open"),p("group","string",!1,"Group field (one color per group, and the legend)"),p("status","string",!1,"State of the item, written inside the bar and in the tooltip. Without group it also colors the bars and makes the legend, so a row of consecutive states reads as a status strip")],Si=[p("label","string",!0,"Node name field"),p("value","number",!1,"Value field. Sizes the dots; values add up from the leaves"),p("group","string",!1,"Parent group field (flat rows, as in the treemap)"),p("id","string",!1,"Row id for id/parent rows. Defaults to the label"),p("parent","string",!1,"Parent id field. Each row is one node, and rows with an empty parent hang under the root")],Ai=[p("region","string",!0,"Region name or code, matched to a region of options.map"),ae],Ni=[p("lon","number",!1,"Longitude (degrees)"),p("lat","number",!1,"Latitude (degrees)"),p("size","number",!1,"Value (circle area). Without it all circles match"),p("label","string",!1,"Place name"),p("region","string",!1,"Region of options.map, for rows without lon and lat"),p("group","string",!1,"Group field (one color per group)")],Ri=[p("source","string",!0,"Start: a name in options.places or a region"),p("target","string",!0,"End"),p("value","number",!1,"Amount. Without it each row counts 1")],Fi=[p("x","number",!0,"x value"),p("y","number",!0,"y value"),p("series","string",!1,"Series field (one color per series)"),p("label","string",!1,"Name")],Lr={pie:ja,donut:Ga,funnel:Wa,waffle:Va,treemap:Ka,sunburst:Ua,waterfall:Xa,pareto:Ya,marimekko:qa,heatmap:Ja,radar:Za,bubble:Qa,line:ei,area:ti,stream:ni,bar:ri,radialBar:oi,gauge:ai,bullet:ii,sparkline:si,slope:li,dumbbell:ci,lollipop:ui,beeswarm:mi,ridgeline:di,sankey:fi,chord:hi,calendar:gi,bump:pi,box:bi,parallel:yi,candlestick:xi,segmented:ki,skyline:wi,histogram:vi,scatter:Fi,tileMap:$i,barRace:Mi,network:Ti,timeline:Ci,tree:Si,choropleth:Ai,symbolMap:Ni,flowMap:Ri},tt={pie:{component:"PieChart",name:"Pie chart",nameKo:"파이 차트"},donut:{component:"DonutChart",name:"Donut chart",nameKo:"도넛 차트"},funnel:{component:"FunnelChart",name:"Funnel chart",nameKo:"퍼널 차트"},waffle:{component:"WaffleChart",name:"Waffle chart",nameKo:"와플 차트"},treemap:{component:"Treemap",name:"Treemap",nameKo:"트리맵"},sunburst:{component:"SunburstChart",name:"Sunburst",nameKo:"선버스트"},waterfall:{component:"WaterfallChart",name:"Waterfall chart",nameKo:"폭포 차트"},pareto:{component:"ParetoChart",name:"Pareto chart",nameKo:"파레토 차트"},marimekko:{component:"MarimekkoChart",name:"Marimekko chart",nameKo:"마리메코 차트"},heatmap:{component:"Heatmap",name:"Heatmap",nameKo:"히트맵"},radar:{component:"RadarChart",name:"Radar chart",nameKo:"레이더 차트"},bubble:{component:"BubbleChart",name:"Bubble chart",nameKo:"버블 차트"},line:{component:"LineChart",name:"Line chart",nameKo:"라인 차트"},area:{component:"AreaChart",name:"Area chart",nameKo:"영역 차트"},stream:{component:"StreamGraph",name:"Streamgraph",nameKo:"스트림그래프"},bar:{component:"BarChart",name:"Bar chart",nameKo:"막대 차트"},radialBar:{component:"RadialBarChart",name:"Radial bar chart",nameKo:"방사형 막대"},gauge:{component:"GaugeChart",name:"Gauge",nameKo:"게이지"},bullet:{component:"BulletChart",name:"Bullet chart",nameKo:"불릿 차트"},sparkline:{component:"Sparkline",name:"Sparkline",nameKo:"스파크라인"},slope:{component:"SlopeChart",name:"Slope chart",nameKo:"슬로프 차트"},dumbbell:{component:"DumbbellChart",name:"Dumbbell chart",nameKo:"덤벨 차트"},lollipop:{component:"LollipopChart",name:"Lollipop chart",nameKo:"롤리팝 차트"},beeswarm:{component:"BeeswarmChart",name:"Beeswarm",nameKo:"비스웜"},ridgeline:{component:"RidgelineChart",name:"Ridgeline",nameKo:"릿지라인"},sankey:{component:"SankeyChart",name:"Sankey diagram",nameKo:"생키 다이어그램"},chord:{component:"ChordChart",name:"Chord diagram",nameKo:"코드 다이어그램"},calendar:{component:"CalendarHeatmap",name:"Calendar heatmap",nameKo:"캘린더 히트맵"},bump:{component:"BumpChart",name:"Bump chart",nameKo:"범프 차트"},box:{component:"BoxPlot",name:"Box / violin plot",nameKo:"박스 플롯"},parallel:{component:"ParallelCoordinates",name:"Parallel coordinates",nameKo:"평행 좌표"},candlestick:{component:"CandlestickChart",name:"Candlestick chart",nameKo:"캔들스틱"},segmented:{component:"SegmentedBar",name:"Segmented bar",nameKo:"비율 막대"},skyline:{component:"SkylineChart",name:"Skyline",nameKo:"스카이라인"},histogram:{component:"HistogramChart",name:"Histogram",nameKo:"히스토그램"},scatter:{component:"ScatterChart",name:"Scatter plot",nameKo:"산점도"},tileMap:{component:"TileMap",name:"Tile grid map",nameKo:"타일 격자 지도"},barRace:{component:"BarRace",name:"Bar race",nameKo:"막대 레이스"},network:{component:"NetworkChart",name:"Network",nameKo:"네트워크"},timeline:{component:"Timeline",name:"Timeline",nameKo:"타임라인"},tree:{component:"Tree",name:"Tree",nameKo:"트리"},choropleth:{component:"Choropleth",name:"Choropleth map",nameKo:"단계구분도"},symbolMap:{component:"SymbolMap",name:"Symbol map",nameKo:"기호 지도"},flowMap:{component:"FlowMap",name:"Flow map",nameKo:"흐름 지도"}};function Or(e,t){return t==="ko"?e.nameKo:e.name}function Ir(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var zr=["line","area","bar","scatter"],Br=24,Sn=["line","area","bar","scatter","timeline"];function An(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"&&n.layout!=="diverging"?[].concat(t.line??[]).map(String):[]}function Hr(e,t,n){return Sn.includes(e)&&!An(e,t,n).length&&!(e==="scatter"&&Ht(n))}function Ht(e){return!!e&&typeof e=="object"&&e.bin==="hex"}function jr(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var _i={doughnut:"donut",column:"bar",stackedBar:"bar",groupedBar:"bar",stacked:"area",streamgraph:"stream",radial:"radialBar",radialbar:"radialBar",progress:"gauge",progressRing:"gauge",kpi:"gauge",violin:"box",boxplot:"box",calendarHeatmap:"calendar","parallel-coordinates":"parallel",parallelCoordinates:"parallel",mekko:"marimekko",spider:"radar",ohlc:"candlestick",candle:"candlestick",stock:"candlestick",segment:"segmented",segmentedBar:"segmented",proportionBar:"segmented",stackedBar100:"segmented",hist:"histogram",tilemap:"tileMap",tileGrid:"tileMap",cartogram:"tileMap",barChartRace:"barRace",racingBar:"barRace",racingBars:"barRace",raceBar:"barRace",arcDiagram:"network",graph:"network",nodeLink:"network",gantt:"timeline",ganttChart:"timeline",schedule:"timeline",dendrogram:"tree",orgChart:"tree",treeChart:"tree",choroplethMap:"choropleth",filledMap:"choropleth",map:"choropleth",bubbleMap:"symbolMap",proportionalSymbolMap:"symbolMap",pointMap:"symbolMap",originDestination:"flowMap",odMap:"flowMap"};function jt(e){let t=Lr[e]?e:_i[e]??Object.keys(tt).find(n=>n.toLowerCase()===e.toLowerCase()||tt[n].component.toLowerCase()===e.toLowerCase());if(!(!t||!tt[t]))return{type:t,component:tt[t].component,name:tt[t].name,nameKo:tt[t].nameKo,encoding:Lr[t]}}function Gr(e){let t=new Set,n=i=>{Array.isArray(i)?i.forEach(n):typeof i=="string"&&i&&t.add(i)},r=e.encoding??{};for(let i of jt(e.type)?.encoding.map(a=>a.name)??Object.keys(r))n(r[i]);let o=e.options??{};for(let i of["dimensions","start","end","ranges"])n(o[i]);return[...t]}function Wr(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function Pi(e,t){if(e==null||typeof e!="object")return;let n=e;if(Wr(n,t))return n[t];if(t.includes(".")){let r=n;for(let o of t.split(".")){if(r===null||typeof r!="object"||!Wr(r,o))return;r=r[o]}return r}}function Ne(e){if(typeof e=="number")return Number.isFinite(e)?e:NaN;if(typeof e=="bigint")return Number(e);if(typeof e=="string"){let t=e.trim(),n=/^\(.*\)$/.test(t),r=t.replace(/[()\s%₩$€£¥원명건개회]/g,"").replace(/^\+/,"");if(!r||r.includes(",")&&!/^-?\d{1,3}(,\d{3})*(\.\d+)?$/.test(r))return NaN;let o=Number(r.replace(/,/g,""));return Number.isFinite(o)?n?-o:o:NaN}return e instanceof Date?e.getTime():typeof e=="boolean"?e?1:0:NaN}function Ve(e,t){if(typeof e=="function")return e;let n=e??t;return r=>Pi(r,n)}function Ke(e,t){let n=Ve(e,t);return(r,o)=>Ne(n(r,o))}function be(e,t){let n=Ve(e,t);return(r,o)=>{let i=n(r,o);return i==null?"":i instanceof Date?new Date(i.getTime()-i.getTimezoneOffset()*6e4).toISOString().slice(0,10):String(i)}}function Te(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}function Di(e){let t=[],n=!1;for(let c=0;c<e.length&&c<4e3;c++){let l=e[c];if(l==='"')n=!n;else if(!n&&(l===`
|
|
23
|
+
`||l==="\r"))break;t.push(n?"":l)}let r=t.join(""),o=c=>r.split(c).length-1,i=[","," ",";","|"],a=",",s=0;for(let c of i){let l=o(c);l>s&&(s=l,a=c)}return a}var Li=/^[-+(]?[₩$€£¥]?\s?\d[\d,]*(\.\d+)?([eE][-+]?\d+)?\)?\s?(%|원|명|건|개|회)?$/;function Vr(e){let t=e.trim();if(t==="")return null;if(/^-?0\d/.test(t))return t;if(Li.test(t)||/^[-+]?\.\d+$/.test(t)){let n=Ne(t);if(Number.isFinite(n))return n}return t}function Ue(e,t={}){let{typed:n=!0,header:r=!0}=t,o=e.replace(/^\uFEFF/,"");if(!o.trim())return[];let i=t.delimiter??Di(o),a=[],s=[],c="",l=!1;for(let f=0;f<o.length;f++){let g=o[f];l?g==='"'?o[f+1]==='"'?(c+='"',f++):l=!1:c+=g:g==='"'&&!c.trim()?(l=!0,c=""):g===i?(s.push(c),c=""):g===`
|
|
24
24
|
`||g==="\r"?(g==="\r"&&o[f+1]===`
|
|
25
|
-
`&&f++,s.push(c),i.push(s),s=[],c=""):c+=g}(c!==""||s.length)&&(s.push(c),i.push(s));let m=i.filter(f=>!(f.length===1&&f[0].trim()===""));if(!m.length)return[];let u=f=>n?ir(f):f;if(!r)return m.map(f=>Object.fromEntries(f.map((g,k)=>[String(k),u(g)])));let d=[],h=new Set;return m[0].forEach((f,g)=>{let k=f.trim()||`col${g+1}`,x=k;for(let $=2;h.has(x);$++)x=`${k}_${$}`;h.add(x),d.push(x)}),m.slice(1).map(f=>Object.fromEntries(d.map((g,k)=>[g,u(f[k]??"")])))}function Yt(e,t,n={}){if(!e.length)return[];let{typed:r=!0}=n,o=(t??e[0]).map((i,s)=>String(i??"").trim()||`col${s+1}`);return(t?e:e.slice(1)).map(i=>Object.fromEntries(o.map((s,c)=>[s,r&&typeof i[c]=="string"?ir(i[c]):i[c]??null])))}function Pa(e,t={}){let{labelKey:n="label",valueKey:r="value"}=t,o=Object.values(e);if(o.length&&o.every(a=>Array.isArray(a))){let a=Object.keys(e),i=Math.max(...o.map(s=>s.length));return Array.from({length:i},(s,c)=>Object.fromEntries(a.map(l=>[l,e[l][c]??null])))}return Object.entries(e).map(([a,i])=>({[n]:a,[r]:i}))}function sr(e,t){let n=e;for(let r of t.split(".").filter(Boolean)){if(n===null||typeof n!="object")return;n=n[r]}return n}function ke(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return ke(JSON.parse(t))}catch{}return Ce(t)}if(Array.isArray(e))return e.length?Array.isArray(e[0])?Yt(e):typeof e[0]=="number"?e.map((t,n)=>({label:String(n+1),value:t})):e.filter(t=>t&&typeof t=="object"):[];if(typeof e=="object"){let t=e;return Array.isArray(t.data)?ke(t.data):Array.isArray(t.rows)&&Array.isArray(t.columns)?Yt(t.rows,t.columns.map(n=>typeof n=="object"&&n&&"name"in n?String(n.name):String(n))):Array.isArray(t.rows)&&Array.isArray(t.fields)||Array.isArray(t.rows)?ke(t.rows):Array.isArray(t.values)?Yt(t.values):Array.isArray(t.items)?ke(t.items):Array.isArray(t.results)?ke(t.results):Pa(t)}return[]}function pt(e){if(!Array.isArray(e))try{return JSON.stringify(e??null)??""}catch{return String(e)}let t=e.length,n=a=>{try{return JSON.stringify(a)}catch{return String(a)}};if(t<=300)return n(e);let r=Math.ceil(t/60),o=[];for(let a=0;a<t;a+=r)o.push(e[a]);return o.push(e[t-1]),`${t}:${n(o)}`}function qt(e,t="zero"){let n=e.length,r=n?e[0].length:0,o=e.map(()=>new Array(r).fill(0)),a=e.map(()=>new Array(r).fill(0)),i=(c,l)=>{let m=e[c][l];return Number.isFinite(m)&&m>0?m:0},s=new Array(r).fill(0);if(t==="wiggle"&&n>0&&r>1){let c=0;for(let l=1;l<r;l++){let m=0,u=0;for(let d=0;d<n;d++){let h=i(d,l),f=h-i(d,l-1),g=0;for(let k=0;k<d;k++)g+=i(k,l)-i(k,l-1);m+=h,u+=(f/2+g)*h}m&&(c-=u/m),s[l]=c}}for(let c=0;c<r;c++){if(t==="zero"){let u=0,d=0;for(let h=0;h<n;h++){let f=e[h][c],g=Number.isFinite(f)?f:0;g>=0?(o[h][c]=u,u+=g,a[h][c]=u):(o[h][c]=d,d+=g,a[h][c]=d)}continue}let l=0;for(let u=0;u<n;u++)l+=i(u,c);let m=t==="silhouette"?-l/2:s[c];for(let u=0;u<n;u++){let d=i(u,c);t==="expand"&&(d=l?d/l*100:0),o[u][c]=m,m+=d,a[u][c]=m}}if(t==="wiggle"&&r){let c=1/0,l=-1/0;for(let u=0;u<r;u++)c=Math.min(c,o[0]?.[u]??0),l=Math.max(l,a[n-1]?.[u]??0);let m=0;for(let u=0;u<r;u++)m+=((o[0]?.[u]??0)+(a[n-1]?.[u]??0))/2;m/=r;for(let u=0;u<n;u++)for(let d=0;d<r;d++)o[u][d]-=m,a[u][d]-=m}return{y0:o,y1:a}}function lr(e,t,n=-1){if(!t.some(r=>r>=0))return-1;for(let r=e-1;r>=0;r--)if(r!==n&&!t.includes(r))return r;return-1}function cr(e){let t=e.length,n=e.map(l=>{let m=0,u=-1/0;return l.forEach((d,h)=>{d>u&&(u=d,m=h)}),m}),r=e.map(l=>l.reduce((m,u)=>m+(Number.isFinite(u)?u:0),0)),o=Array.from({length:t},(l,m)=>m).sort((l,m)=>n[l]-n[m]),a=[],i=[],s=0,c=0;for(let l of o)s<c?(a.push(l),s+=r[l]):(i.push(l),c+=r[l]);return[...i.reverse(),...a]}var Da=Math.PI*2;function Me(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function ur(e){let t=-1,n=-1/0;return e.forEach((r,o)=>{r>n&&(n=r,t=o)}),t}function dr(e){return e>=44032&&e<=55203||e>=4352&&e<=4607||e>=12592&&e<=12687||e>=19968&&e<=40959}function mr(e){return e>=44032&&e<=55203?.87:e>=4352&&e<=4607||e>=12592&&e<=12687?.8:e>=19968&&e<=40959?.94:e>=48&&e<=57?.585:e===32||e===44||e===46||e===58||e===59||e===39?.26:e===37?.84:e===8722?.73:e===45?.42:e===43||e===61?.6:e===40||e===41||e===91||e===93?.34:e===47?.38:e===8361||e===36?.62:e===8230?.82:e>=65&&e<=90?e===73?.28:e===77||e===87?.86:.66:e>=97&&e<=122?e===105||e===108||e===106?.24:e===109||e===119?.84:e===102||e===116||e===114?.36:.55:.6}var bt=new Map;function ce(e,t,n=400){let r=String(e),o=`${r}|${n>=600?1:0}`,a=bt.get(o);if(a===void 0){let i=0,s=0;for(let c=0;c<r.length;c++){let l=r.charCodeAt(c);dr(l)?i+=mr(l):s+=mr(l)}a=i+s*(n>=600?1.07:1),bt.size>5e3&&bt.clear(),bt.set(o,a)}return a*t}function yt(e,t,n,r=400){if(e=e.trim(),ce(e,n,r)<=t)return e;let o="…",a=0,i=e.length;for(;a<i;){let c=a+i+1>>1;ce(e.slice(0,c)+o,n,r)<=t?a=c:i=c-1}a>0&&(e.charCodeAt(a-1)&64512)===55296&&a--;let s=e.slice(0,a).trimEnd();return s.length<(dr(s.charCodeAt(0))?2:3)?"":s+o}var hr=A(_(),1),La=e=>Array.isArray(e)&&e.length===2;function fr(e){let t=[];for(let n of e??[])n.type==="line"&&typeof n.y=="number"?t.push(n.y):n.type==="band"&&La(n.y)&&t.push(Number(n.y[0]),Number(n.y[1]));return t.filter(Number.isFinite)}var pr=A(_(),1),Jt=10.5;function Ea(e,t,n){let r=e.map(t);if(new Set(r).size===r.length)return r;let o=1/0;for(let i=1;i<e.length;i++)o=Math.min(o,Math.abs(e[i]-e[i-1]));let a=o>0&&Number.isFinite(o)?Math.min(20,Math.max(2,Math.ceil(-Math.log10(o)-1e-9))):2;return e.map(i=>Ne(i,{locale:n,maximumFractionDigits:a}))}function gr(e,t,n){let r=18;for(let o of Ea(e,t,n))r=Math.max(r,ce(o,Jt));return Math.ceil(r+8)}function Zt(e,t){if(!(e>0)||!Number.isFinite(e))return 1;let n=e/Math.max(1,t),r=Math.pow(10,Math.floor(Math.log10(n))),o=n/r;return(o>=7.071?10:o>=3.162?5:o>=1.414?2:1)*r}function Ee(e,t,n=4,r={}){let o=e,a=t;if(!Number.isFinite(o)||!Number.isFinite(a))return[0,1];if(r.zero!==!1&&(o>0&&(o=0),a<0&&(a=0)),o===a)return o===0?[0,1]:o>0?[0,o*1.2]:[o*1.2,0];let i=a-o,s=r.pad??.07,c=Zt(i,n),l=[o,a];for(let m=0;m<4;m++){let u=Math.ceil(a/c-1e-9)*c,d=Math.floor(o/c+1e-9)*c;l=[o===0?0:o-d<=c*.3?d:o-i*s,a===0?0:u-a<=c*.3?u:a+i*s];let h=Zt(l[1]-l[0],n);if(h===c)break;c=h}return l}function br(e,t,n=4){let r=Math.min(e,t),o=Math.max(e,t),a=Zt(o-r,n),i=[],s=Math.ceil(r/a-1e-9)*a;for(let c=s,l=0;c<=o+a*1e-9&&l<200;c+=a,l++)i.push(Number((Math.round(c/a)*a).toPrecision(12)));return i}function Qt(e,t){let[n,r]=e,[o,a]=t,i=r===n?0:(a-o)/(r-n),s=(c=>o+(c-n)*i);return s.domain=e,s.range=t,s.invert=c=>i===0?n:n+(c-o)/i,s.ticks=(c=4)=>br(n,r,c),s}function en(e,t,n=4){if(!(e>0)||!(t>0)||!Number.isFinite(e)||!Number.isFinite(t))return[1,10];let r=Math.log10(e),o=Math.log10(t);if(r===o)return[10**(r-.5),10**(r+.5)];let[a,i]=Ee(r,o,Math.max(n,Math.ceil(o-r)),{zero:!1});return[10**a,10**i]}function _a(e,t,n){let r=Math.log10(e),o=Math.log10(t),a=n/Math.max(1e-9,o-r),i=(l,m=1)=>{let u=[];for(let d=Math.floor(r);d<=Math.ceil(o);d++)if(!(d%m))for(let h of l){let f=Number((h*10**d).toPrecision(12));f>=e*(1-1e-9)&&f<=t*(1+1e-9)&&u.push(f)}return u},s=a>=110?i([1,2,5]):i([1],Math.max(1,Math.ceil(24/a)));if(s.length>=2)return s;let c=i([1,2,3,4,5,6,7,8,9]);return c.length>=2?c:br(e,t,3)}function yr(e,t){let n=Qt([Math.log10(e[0]),Math.log10(e[1])],t),r=(o=>o>0?n(Math.log10(o)):Number.NaN);return r.domain=e,r.range=t,r.invert=o=>10**n.invert(o),r.ticks=()=>_a(e[0],e[1],Math.abs(t[1]-t[0])),r}function We(e){let t=1/0,n=-1/0;for(let r of e)Number.isFinite(r)&&(r<t&&(t=r),r>n&&(n=r));return t===1/0?[0,1]:[t,n]}var Ia=864e5;function xr(e,t,n,r=J){let o=t-e;if(!(o>0))return[{t:e,label:Ve(e,{locale:r,month:"short",day:"numeric"})}];let a=o/Ia,i=[],s=new Date(e),c=new Date(e).getFullYear()===new Date(t).getFullYear(),l=(m,u,d,h=!1)=>{let f=new Date(m),g=-1,k=0;for(;f.getTime()<=t&&k++<500;){if(f.getTime()>=e){let x=f.getFullYear(),$=h&&!c&&x!==g;i.push({t:f.getTime(),label:Ve(f,{locale:r,...d,...$?{year:"numeric"}:{}})}),g=x}u(f)}};if(a<=1.5){let m=Math.max(1,Math.ceil(o/36e5/Math.max(1,n))),u=[1,2,3,4,6,12].find(h=>h>=m)??12,d=new Date(s);d.setMinutes(0,0,0),l(d,h=>h.setHours(h.getHours()+u),{hour:"numeric"})}else if(a<=n*1.2){let m=new Date(s.getFullYear(),s.getMonth(),s.getDate());l(m,u=>u.setDate(u.getDate()+1),{month:"numeric",day:"numeric"})}else if(a<=n*7*1.2){let m=new Date(s.getFullYear(),s.getMonth(),s.getDate());m.setDate(m.getDate()+(8-m.getDay())%7),l(m,u=>u.setDate(u.getDate()+7),{month:"numeric",day:"numeric"})}else{let m=a/30.44,u=Math.max(1,Math.ceil(m/Math.max(1,n))),d=[1,2,3,6,12,24,60].find(h=>h>=u)??120;if(d>=12){let h=new Date(s.getFullYear()+(s.getMonth()>0||s.getDate()>1?1:0),0,1);l(h,f=>f.setFullYear(f.getFullYear()+d/12),{year:"numeric"})}else{let h=new Date(s.getFullYear(),s.getMonth()+(s.getDate()>1?1:0),1),f=h.getMonth()%d;f&&h.setMonth(h.getMonth()+(d-f)),l(h,g=>g.setMonth(g.getMonth()+d),{month:"short"},!0)}}return i}function kr(e,t){let n=new Array(e),r=new Uint8Array(e),o=a=>{if(typeof a!="string"||a.length===0||a.length>9)return-1;let i=Number(a);return Number.isInteger(i)&&i>=0&&i<e&&String(i)===a?i:-1};return new Proxy(n,{get(a,i,s){let c=o(i);return c>=0?(r[c]||(a[c]=t(c),r[c]=1),a[c]):Reflect.get(a,i,s)},has(a,i){return o(i)>=0||Reflect.has(a,i)}})}var Oa=(e,t,n)=>e==="date"?st(t,n)?.getTime()??NaN:he(t);function Ba(e){let t=e.filter(n=>n!=null&&n!=="");return t.length?t.every(n=>n instanceof Date)||t.every(n=>typeof n=="string"&&jn(n.trim()))?"date":t.every(n=>typeof n=="number"||typeof n=="string"&&/^-?\d+(\.\d+)?$/.test(n.trim()))?"number":"band":"band"}function Ge(e,t,n,r,o={}){let a=Pe(t,"x"),i=Array.isArray(n),s=i?n:null,c=i?null:Pe(n,"y"),l=!i&&r!==void 0?Pe(r,"series"):null,m=e.map((w,p)=>a(w,p)),u=o.xType??Ba(m),d=o.locale??J,h,f,g;if(u==="band"){let w=m.map(C=>String(C??""));h=Le(w);let p=new Map(h.map((C,R)=>[C,R]));f=h.map((C,R)=>R),g=Int32Array.from(w,C=>p.get(C)??-1)}else{let w=u==="date"?o.dayFirst??Vn(m):void 0,p=m.map(I=>Oa(u,I,w)),C=Array.from(new Set(p.filter(I=>Number.isFinite(I)))).sort((I,K)=>I-K),R=new Map(C.map((I,K)=>[I,K]));f=C,h=C.map(String),g=Int32Array.from(p,I=>R.get(I)??-1)}let k=o.dateFormat,x=w=>typeof w=="string"?it(w.trim())?.[3]:void 0,$=u==="date"&&m.length<5e3?x(m[0]):void 0,M=($===2||$===3)&&m.every(w=>x(w)===$),v=M&&$===3;if(u==="date"&&!k){let w=f.length>1?f[f.length-1]-f[0]:0;k=M&&$===2||w>864e5*120?{month:"short"}:w<864e5*2?{month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit"}:{month:"numeric",day:"numeric"},w>864e5*800&&(k={year:"numeric",month:"short"})}let b;if(u==="band")b=h;else if(v&&!o.dateFormat){let w=V(d)==="ko";b=f.map(p=>{let C=new Date(p),R=Math.floor(C.getMonth()/3)+1;return w?`${C.getFullYear()}년 ${R}분기`:`Q${R} ${C.getFullYear()}`})}else{let w=f.every(Ht),p=u==="date"?new Intl.DateTimeFormat(d,k):new Intl.NumberFormat(d,w?{useGrouping:!1}:{maximumFractionDigits:6});b=f.length>1e3?kr(f.length,C=>p.format(f[C])):f.map(C=>p.format(C))}let N=s?[...s]:l?Le(e.map((w,p)=>String(l(w,p)??""))):[""],D=new Map(N.map((w,p)=>[w,p])),P=N.map(()=>new Array(h.length).fill(NaN)),E=N.map(()=>new Array(h.length).fill(null)),L=o.aggregate??"sum",F=L==="mean"?N.map(()=>new Uint32Array(h.length)):null,S=(w,p,C,R)=>{let I=P[w][p];L==="last"?P[w][p]=C:L==="count"?P[w][p]=(Number.isFinite(I)?I:0)+1:L==="mean"?Number.isFinite(C)&&(P[w][p]=(Number.isFinite(I)?I:0)+C,F[w][p]++):P[w][p]=Number.isFinite(I)?I+(Number.isFinite(C)?C:0):C,E[w][p]=R};for(let w=0;w<e.length;w++){let p=g[w];if(p<0)continue;let C=e[w];if(s)for(let R=0;R<s.length;R++)S(R,p,he(C[s[R]]),C);else{let R=l?D.get(String(l(C,w)??""))??0:0;S(R,p,he(c(C,w)),C)}}if(F)for(let w=0;w<P.length;w++)for(let p=0;p<h.length;p++)F[w][p]>1&&(P[w][p]/=F[w][p]);return{type:u,keys:h,xnum:f,labels:b,series:N,values:P,rows:E}}var za=140,Ue=12,wr=14,tn=20,vr=12.5;function Ha(e,t,n=tr){let r=xe(t,t),o=new Map;e.forEach((i,s)=>{let c=r(i,s),l=o.get(c);l?l.push(i):o.set(c,[i])});let a=[...o.keys()].slice(0,n);return{values:a,groups:a.map(i=>o.get(i)),dropped:Math.max(0,o.size-n)}}function ja(e,t,n){if(t<1)return 1;let r=Math.max(1,Math.floor((e+Ue)/(za+Ue))),o=Math.max(1,Math.min(r,Number.isInteger(n)&&n>=1?n:r,t));return Math.ceil(t/Math.ceil(t/o))}function Va(e,t,n){let r=Math.max(40,Math.floor((e-(t-1)*Ue)/t));return{pw:r,ph:typeof n=="number"&&Number.isFinite(n)&&n>0?n:Math.max(120,Math.min(180,Math.round(r*.62)))}}var Ke=e=>e.filter(Number.isFinite);function xt(e,t){let n=[];for(let r of Array.isArray(t)?t:t===void 0?[]:[t]){let o=De(r,String(r));e.forEach((a,i)=>n.push(o(a,i)))}return Ke(n)}function $r(e,t,n,r,o,a){return Ge(t,n.x,r,o,{xType:e==="bar"?"band":n.xType,aggregate:a,dayFirst:n.dayFirst})}function Wa(e,t,n,r,o,a){let i=Math.max(2,Math.round(a/70)),s=r.yScale==="log"&&(e==="line"||e==="scatter"),c=r.yDomain,l=c&&(!s||c[0]>0&&c[1]>0)?c:void 0;if(e==="scatter"){let b=t.flat(),N=r.refLines??{},[D,P]=We([...xt(b,r.x??"x"),...Ke([Number(N.x)])]),[E,L]=We([...xt(b,r.y??"y"),...Ke([Number(N.y)])].filter(S=>!s||S>0)),F=r.zero??!1;return{y:l??(s?en(E,L,i):Ee(E,L,i,{zero:F,pad:.08})),x:r.xDomain??Ee(D,P,Math.max(2,Math.round(o/110)),{zero:F,pad:.06}),sameKeys:!0}}let m=e==="bar",u=m&&r.orientation==="horizontal",d=n[0]?.keys.join(""),h=n.every(b=>b.keys.join("")===d),f=n.length>0&&n.every(b=>b.type!=="band"&&b.type===n[0].type),g=r.xDomain??(!m&&f?We(n.flatMap(b=>Ke(b.xnum))):void 0),k=m?r.layout??"grouped":e==="area"?r.stack??"auto":"none";if(k==="percent")return{x:g,sameKeys:h};if(l)return{y:l,x:g,sameKeys:h};let x=[];t.forEach((b,N)=>{let D=n[N];if(k==="stacked"||k==="auto"&&D.series.length>1){let E=qt(D.values,"zero");E.y0.forEach(L=>x.push(...L)),E.y1.forEach(L=>x.push(...L))}else D.values.forEach(E=>x.push(...E));m&&!u&&r.line!==void 0&&$r(e,b,r,[].concat(r.line),void 0,r.series===void 0?r.aggregate:"mean").values.forEach(E=>x.push(...E)),m||x.push(...xt(b,r.lower),...xt(b,r.upper))}),m&&x.push(0),u||x.push(...fr(r.annotations));for(let b of r.referenceLines??[])x.push(b.y);r.signColors&&x.push(Number(r.baseline??0));let[$,M]=We(Ke(x).filter(b=>!s||b>0));return{y:s?en($,M,i):m?Ee($,M,u?Math.max(2,Math.round(o/120)):i):Ee($,M,i,{zero:r.zero??e==="area"}),x:g,sameKeys:h}}function Ga(e,t,n,r,o,a,i,s){if(e!=="line"&&e!=="area"||!o.x||!o.y)return;let c=Ge(t.flat(),r.x,r.y,void 0,{xType:r.xType,locale:s,dayFirst:r.dayFirst}),l=(r.yScale==="log"&&e==="line"?yr:Qt)(o.y,[i-22,10]).ticks(Math.max(2,Math.round(i/70))),m=gr(l,On(r.format,s,Math.max(Math.abs(o.y[0]),Math.abs(o.y[1]))),s),u=n.flatMap(b=>b.series),d=r.endLabels??n.some(b=>b.series.length>1),h=m+6,f=a-(d?Math.min(a*.28,Math.max(...u.map(b=>ce(b,11,700)),20)+14):10),g=c.keys.length,[k,x]=o.x[1]===o.x[0]?[o.x[0],o.x[0]+1]:o.x,$=c.type==="number"?g>12:g>xr(k,x,Math.max(2,Math.floor((f-h)/64)),s).length;if(c.type==="band"||!g||$)return;let M=b=>h+(c.xnum[b]-k)/(x-k)*(f-h),v=b=>ce(c.labels[b],Jt);for(let b=1;;b++){let N=Array.from({length:Math.ceil(g/b)},(D,P)=>P*b);if(b>=g||N.every((D,P)=>!P||M(D)-M(N[P-1])>=(v(D)+v(N[P-1]))/2+8))return N.map(D=>({value:c.xnum[D],label:c.labels[D]}))}}function Ka(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,"0")}function Ua(e,t,n,r){let o=[n.x,n.y,n.series].map(a=>JSON.stringify(a??null)).join("|");return`ztd-facet-${Ka(`${e}|${t}|${o}|${pt(r)}`)}`}function Xa(e,t){return typeof e=="string"?t.includes(e):Array.isArray(e)&&e.length>0&&e.every(n=>typeof n=="string"&&t.includes(n))}var Ya={en:{intro:(e,t)=>`${Se(e,"panel")} by ${t}.`,endHigh:(e,t)=>` ${e} ends highest at ${t}.`,falling:e=>` Lower at the end than at the start: ${e}.`,noneFalling:" None is lower at the end than at the start.",total:(e,t)=>` ${e} has the largest total at ${t}.`,points:(e,t)=>` ${e} has the most points (${t}).`,dropped:(e,t)=>` Only the first ${e} of ${t} values are shown.`,more:", …",blank:"(blank)"},ko:{intro:(e,t)=>`${t}별 패널 ${e}개.`,endHigh:(e,t)=>` 마지막 값이 가장 큰 곳: ${e}(${t}).`,falling:e=>` 처음보다 끝이 낮은 곳: ${e}.`,noneFalling:" 처음보다 끝이 낮은 곳은 없어요.",total:(e,t)=>` 합계가 가장 큰 곳: ${e}(${t}).`,points:(e,t)=>` 점이 가장 많은 곳: ${e}(${t}개).`,dropped:(e,t)=>` ${t}개 중 앞의 ${e}개만 보여요.`,more:" 등",blank:"(빈 값)"}};function Cr(e){let{type:t,chartProps:n}=e,{values:r,groups:o,dropped:a}=Ha(e.data,e.by),i=r.length,s=typeof e.width=="number"&&Number.isFinite(e.width)&&e.width>0?e.width:480,c=ja(s,i,e.columns),{pw:l,ph:m}=Va(s,c,e.height),u=e.scale!=="free",d=t==="scatter"?[]:o.map(F=>$r(t,F,n,n.y,n.series,n.aggregate)),h=u?Wa(t,o,d,n,l,m):{sameKeys:!1},f=u?Ga(t,o,d,n,h,l,m,e.locale):void 0,g=t==="bar"&&n.orientation==="horizontal",k=u&&(!g||h.sameKeys),x=u&&(g||h.x!==void 0||h.sameKeys),$=new Set(Xa(e.highlight,r)?[e.highlight].flat():[]),M=$.size>0,v=t==="bar"&&!Array.isArray(n.y)&&n.series===void 0||t==="scatter"&&n.series===void 0,b=e.syncId??Ua(t,e.by,n,e.data),N=at($e(n.format,e.locale),n.unit),D=Ya[e.lang],P=[],E=r.map(F=>F===""?D.blank:F);return{panels:r.map((F,S)=>{let w=o[S],p=E[S],C=S%c,R;if(t!=="scatter"){let K=d[S],ve=oe=>K.values.reduce((fe,ze)=>fe+(Number.isFinite(ze[oe])?ze[oe]:0),0),B=K.keys.map((oe,fe)=>fe).filter(oe=>K.values.some(fe=>Number.isFinite(fe[oe]))),q=B[B.length-1];P.push({first:B.length?ve(B[0]):NaN,last:B.length?ve(q):NaN,total:B.reduce((oe,fe)=>oe+ve(fe),0)}),t!=="bar"&&K.series.length===1&&q!==void 0&&(R=N(K.values[0][q]))}else P.push({first:NaN,last:NaN,total:w.length});let I={data:w,width:l,height:m,ariaLabel:e.title?`${e.title}, ${p}`:p,syncId:b,highlight:M?$.has(F)?v?()=>!0:void 0:"none":e.highlight,showYAxis:!k||C===0,showXAxis:!x||S+c>=i};return h.y&&(I.yDomain=h.y),h.x&&(I.xDomain=h.x),f&&(I.xTicks=f),{value:F,label:p,props:I,last:R,isPicked:$.has(F)}}),cols:c,pw:l,ph:m,isPanelPick:M,description:qa(t,e.by,E,P,a,N,D)}}function qa(e,t,n,r,o,a,i){let s=i.intro(n.length,t),c=l=>ur(r.map(m=>m[l]));if(e==="line"||e==="area"){let l=c("last");l>=0&&(s+=i.endHigh(n[l],a(r[l].last)));let m=n.filter((u,d)=>r[d].last<r[d].first);s+=m.length?i.falling(`${m.slice(0,5).join(", ")}${m.length>5?i.more:""}`):i.noneFalling}else{let l=c("total");l>=0&&(s+=e==="bar"?i.total(n[l],a(r[l].total)):i.points(n[l],r[l].total))}return o&&(s+=i.dropped(n.length,n.length+o)),s}var te=A(j(),1);function Ja(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function Za(e,t){let n=e.rootBounds?.height??window.innerHeight;return e.isIntersecting&&(e.intersectionRatio>=t||e.intersectionRect.height>=n*.5)}function Sr(e,t=!0){let[n,r]=(0,te.useState)({visible:!t,near:!t});return(0,te.useEffect)(()=>{if(!t){r({visible:!0,near:!0});return}if(!e)return;if(typeof IntersectionObserver>"u"){r({visible:!0,near:!0});return}let o=new IntersectionObserver(i=>{let s=Za(i[i.length-1],.25);r(c=>c.visible===s?c:{...c,visible:s,near:c.near||s})},{threshold:Ja(.25),rootMargin:"0px 0px -8% 0px"}),a=new IntersectionObserver(i=>{let s=i[i.length-1];r(c=>c.near===s.isIntersecting?c:{...c,near:s.isIntersecting})},{threshold:0,rootMargin:"240px 0px 240px 0px"});return o.observe(e),a.observe(e),()=>{o.disconnect(),a.disconnect()}},[e,t]),n}function Mr(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function kt(e){let[t,n]=(0,te.useState)(null),[r,o]=(0,te.useState)(e??null),a=(0,te.useCallback)(i=>{n(i),i&&e===void 0&&o(Mr(i))},[e]);return ue(()=>{if(e!==void 0){o(e);return}if(!t)return;let i=l=>o(m=>m!==null&&Math.abs(m-l)<.5?m:l),s=()=>i(Mr(t));if(typeof ResizeObserver>"u")return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s);let c=new ResizeObserver(l=>{let m=l[l.length-1]?.contentRect;m?i(m.width>0?Math.round(m.width*10)/10:0):s()});return c.observe(t),()=>c.disconnect()},[t,e]),[t,a,r]}var Qa=()=>()=>{};function _e(){return(0,te.useSyncExternalStore)(Qa,()=>!0,()=>!1)}var Tr="(prefers-reduced-motion: reduce)";function wt(e="auto"){let[t,n]=(0,te.useState)(()=>ae&&typeof window.matchMedia=="function"?window.matchMedia(Tr).matches:!1);return(0,te.useEffect)(()=>{if(e!=="auto"||!ae||typeof window.matchMedia!="function")return;let r=window.matchMedia(Tr),o=()=>n(r.matches);return o(),r.addEventListener?.("change",o),()=>r.removeEventListener?.("change",o)},[e]),e===!0?!0:e===!1?!1:t}var me=A(_(),1),ei=60,ti=420;function Ar(e){let t=se(),n=e.chartProps??{},[,r,o]=kt(e.width),a=e.width??(o||480),i=Q(e.locale??n.locale),s=V(i),c=(0,Ie.useContext)(Te),l=e.title??c,m=(0,Ie.useMemo)(()=>Cr({type:e.type,data:e.data,by:e.by,columns:e.columns,scale:e.scale,chartProps:n,highlight:e.highlight,syncId:e.syncId,width:a,height:e.height,title:l,locale:i,lang:s}),[e.type,e.data,e.by,e.columns,e.scale,JSON.stringify(n,(k,x)=>typeof x=="function"?String(x):x),e.highlight,e.syncId,a,e.height,l,i,s]),u=`${(0,Ie.useId)().replace(/:/g,"")}fd`,d=wt(n.reducedMotion??"auto"),h=_e(),f=Qe({motion:{enabled:n.animate!==!1&&!d&&ae},hydrated:h},{waiting:!1,generation:0}),g=e.chart;return(0,me.jsxs)("div",{ref:r,role:"group","aria-label":l,"aria-describedby":u,className:e.className,style:{position:"relative",width:"100%",...e.style},children:[(0,me.jsx)("p",{id:u,style:ft,children:e.description??m.description}),(0,me.jsx)("div",{style:{display:"grid",gridTemplateColumns:`repeat(${m.cols}, minmax(0, 1fr))`,columnGap:Ue,rowGap:wr},children:m.panels.map((k,x)=>{let $=t.paint(k.isPicked?"accentText":m.isPanelPick?"muted":"ink");return(0,me.jsxs)("div",{"data-facet":k.value,style:{minWidth:0,...Ze(f,!1,"fade",x*ei,ti)},children:[(0,me.jsxs)("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,height:tn,fontSize:vr,fontWeight:700,lineHeight:`${tn}px`,color:$},children:[(0,me.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:k.label}),k.last!==void 0?(0,me.jsx)("span",{style:{flex:"none",fontVariantNumeric:"tabular-nums"},children:k.last}):null]}),(0,me.jsx)(g,{...n,...k.props})]},k.value)})})]})}function de(e,t,n,r,o="max"){let a=new Set,i=n.length,s=l=>{if(i&&l!=="none"){if(l==="first")a.add(0);else if(l==="last")a.add(i-1);else if(l==="max"||l==="min"){let m=-1,u=l==="max"?-1/0:1/0;r.forEach((d,h)=>{Number.isFinite(d)&&(l==="max"?d>u:d<u)&&(u=d,m=h)}),m>=0&&a.add(m)}}};if(e==null)return s(o),a;if(typeof e=="function")return t.forEach((l,m)=>{m<i&&l!==null&&l!==void 0&&e(l,m)&&a.add(m)}),a;let c=Array.isArray(e)?e:[e];for(let l of c)typeof l=="number"?l>=0&&l<i&&a.add(l):l==="max"||l==="min"||l==="first"||l==="last"||l==="none"?s(l):n.forEach((m,u)=>{m===l&&a.add(u)});return a}var re=A(j(),1);async function ni(e,t="auto",n="",r){let o=e.headers.get("content-type")??"",a=await e.text();if(t==="text")return a;if(o.includes("text/html")||/^\s*<(!doctype html|html[\s>])/i.test(a))throw new Error(V(r)==="ko"?`데이터 대신 HTML 페이지를 받았어요. 주소를 확인해 주세요${n?`: ${n}`:"."}`:`Got an HTML page instead of data${n?` (${n})`:""}. Check the URL.`);if(t==="csv")return Ce(a);if(t==="json"||o.includes("json"))return JSON.parse(a);if(o.includes("csv")||/[./]csv(\?|#|$)|output=csv|format=csv|tqx=out:csv/i.test(n))return Ce(a);let i=a.trim();return i.startsWith("{")||i.startsWith("[")?JSON.parse(i):Ce(a)}async function ri(e,t={}){let n=t.signal??new AbortController().signal,r;if(typeof e=="function")r=await e(n);else{let o=e instanceof Request?e.url:String(e),a=await fetch(e instanceof Request?e.clone():o,{...t.init,signal:n});if(!a.ok)throw new Error(`HTTP ${a.status}${a.statusText?` ${a.statusText}`:""}`);r=await ni(a,t.parse,o,t.locale)}return t.select&&(r=sr(r,t.select)),t.transform?t.transform(r):ke(r)}function Fr(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:o=!0}=t,[a,i]=(0,re.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,c]=(0,re.useState)(0),l=Q(t.locale),m=(0,re.useRef)(t);m.current={...t,locale:l};let u=(0,re.useRef)(e);u.current=e;let d=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",h=t.deps??[],f=JSON.stringify(h.map(x=>typeof x=="object"?JSON.stringify(x):String(x))),g=(0,re.useRef)(!1);(0,re.useEffect)(()=>{let x=u.current;if(!x||!r){i(v=>v.status==="loading"?{...v,status:"idle"}:v);return}let $=new AbortController,M=!0;return g.current=!0,i(v=>({...v,data:o?v.data:[],status:"loading",error:null})),ri(x,{...m.current,signal:$.signal}).then(v=>{M&&i({data:v,status:"success",error:null,updatedAt:Date.now()})}).catch(v=>{!M||$.signal.aborted||i(b=>({...b,status:"error",error:v instanceof Error?v:new Error(String(v))}))}).finally(()=>{M&&(g.current=!1)}),()=>{M=!1,g.current=!1,$.abort()}},[d,r,s,f,o]),(0,re.useEffect)(()=>{if(!n||!r)return;let x=setInterval(()=>{g.current||c($=>$+1)},n);return()=>clearInterval(x)},[n,r]);let k=(0,re.useCallback)(()=>c(x=>x+1),[]);return{data:a.data,status:a.status,loading:a.status==="loading",error:a.error,empty:a.status==="success"&&a.data.length===0,updatedAt:a.updatedAt,reload:k}}var rn=A(_(),1),oi=["csv","svg","png"],ai=/^[=+\-@\t\r\n=+-@]/,ii=/var\(|color-mix\(/;function Nr(e){if(typeof e=="number")return Number.isFinite(e)?String(e):"";if(e==null||e instanceof Date&&Number.isNaN(e.getTime()))return"";let t=e instanceof Date?Bn(e.getTime()):String(e);return`"${(ai.test(t)&&!Number.isFinite(he(t))?`'${t}`:t).replace(/"/g,'""')}"`}function si(e){return[...new Set(e.slice(0,200).flatMap(t=>t&&typeof t=="object"?Object.keys(t):[]))]}function li(e,t){return`\uFEFF${[t.map(Nr),...e.map(r=>t.map(o=>Nr(r[o])))].map(r=>r.join(",")).join(`\r
|
|
25
|
+
`&&f++,s.push(c),a.push(s),s=[],c=""):c+=g}(c!==""||s.length)&&(s.push(c),a.push(s));let m=a.filter(f=>!(f.length===1&&f[0].trim()===""));if(!m.length)return[];let u=f=>n?Vr(f):f;if(!r)return m.map(f=>Object.fromEntries(f.map((g,w)=>[String(w),u(g)])));let d=[],h=new Set;return m[0].forEach((f,g)=>{let w=f.trim()||`col${g+1}`,x=w;for(let k=2;h.has(x);k++)x=`${w}_${k}`;h.add(x),d.push(x)}),m.slice(1).map(f=>Object.fromEntries(d.map((g,w)=>[g,u(f[w]??"")])))}function Nn(e,t,n={}){if(!e.length)return[];let{typed:r=!0}=n,o=(t??e[0]).map((a,s)=>String(a??"").trim()||`col${s+1}`);return(t?e:e.slice(1)).map(a=>Object.fromEntries(o.map((s,c)=>[s,r&&typeof a[c]=="string"?Vr(a[c]):a[c]??null])))}function Ei(e,t={}){let{labelKey:n="label",valueKey:r="value"}=t,o=Object.values(e);if(o.length&&o.every(i=>Array.isArray(i))){let i=Object.keys(e),a=Math.max(...o.map(s=>s.length));return Array.from({length:a},(s,c)=>Object.fromEntries(i.map(l=>[l,e[l][c]??null])))}return Object.entries(e).map(([i,a])=>({[n]:i,[r]:a}))}function Kr(e,t){let n=e;for(let r of t.split(".").filter(Boolean)){if(n===null||typeof n!="object")return;n=n[r]}return n}function Ie(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return Ie(JSON.parse(t))}catch{}return Ue(t)}if(Array.isArray(e))return e.length?Array.isArray(e[0])?Nn(e):typeof e[0]=="number"?e.map((t,n)=>({label:String(n+1),value:t})):e.filter(t=>t&&typeof t=="object"):[];if(typeof e=="object"){let t=e;return Array.isArray(t.data)?Ie(t.data):Array.isArray(t.rows)&&Array.isArray(t.columns)?Nn(t.rows,t.columns.map(n=>typeof n=="object"&&n&&"name"in n?String(n.name):String(n))):Array.isArray(t.rows)&&Array.isArray(t.fields)||Array.isArray(t.rows)?Ie(t.rows):Array.isArray(t.values)?Nn(t.values):Array.isArray(t.items)?Ie(t.items):Array.isArray(t.results)?Ie(t.results):Ei(t)}return[]}function Gt(e){if(!Array.isArray(e))try{return JSON.stringify(e??null)??""}catch{return String(e)}let t=e.length,n=i=>{try{return JSON.stringify(i)}catch{return String(i)}};if(t<=300)return n(e);let r=Math.ceil(t/60),o=[];for(let i=0;i<t;i+=r)o.push(e[i]);return o.push(e[t-1]),`${t}:${n(o)}`}function Rn(e,t="zero"){let n=e.length,r=n?e[0].length:0,o=e.map(()=>new Array(r).fill(0)),i=e.map(()=>new Array(r).fill(0)),a=(c,l)=>{let m=e[c][l];return Number.isFinite(m)&&m>0?m:0},s=new Array(r).fill(0);if(t==="wiggle"&&n>0&&r>1){let c=0;for(let l=1;l<r;l++){let m=0,u=0;for(let d=0;d<n;d++){let h=a(d,l),f=h-a(d,l-1),g=0;for(let w=0;w<d;w++)g+=a(w,l)-a(w,l-1);m+=h,u+=(f/2+g)*h}m&&(c-=u/m),s[l]=c}}for(let c=0;c<r;c++){if(t==="zero"){let u=0,d=0;for(let h=0;h<n;h++){let f=e[h][c],g=Number.isFinite(f)?f:0;g>=0?(o[h][c]=u,u+=g,i[h][c]=u):(o[h][c]=d,d+=g,i[h][c]=d)}continue}let l=0;for(let u=0;u<n;u++)l+=a(u,c);let m=t==="silhouette"?-l/2:s[c];for(let u=0;u<n;u++){let d=a(u,c);t==="expand"&&(d=l?d/l*100:0),o[u][c]=m,m+=d,i[u][c]=m}}if(t==="wiggle"&&r){let c=1/0,l=-1/0;for(let u=0;u<r;u++)c=Math.min(c,o[0]?.[u]??0),l=Math.max(l,i[n-1]?.[u]??0);let m=0;for(let u=0;u<r;u++)m+=((o[0]?.[u]??0)+(i[n-1]?.[u]??0))/2;m/=r;for(let u=0;u<n;u++)for(let d=0;d<r;d++)o[u][d]-=m,i[u][d]-=m}return{y0:o,y1:i}}function Ur(e,t,n=-1){if(!t.some(r=>r>=0))return-1;for(let r=e-1;r>=0;r--)if(r!==n&&!t.includes(r))return r;return-1}function Xr(e){let t=e.length,n=e.map(l=>{let m=0,u=-1/0;return l.forEach((d,h)=>{d>u&&(u=d,m=h)}),m}),r=e.map(l=>l.reduce((m,u)=>m+(Number.isFinite(u)?u:0),0)),o=Array.from({length:t},(l,m)=>m).sort((l,m)=>n[l]-n[m]),i=[],a=[],s=0,c=0;for(let l of o)s<c?(i.push(l),s+=r[l]):(a.push(l),c+=r[l]);return[...a.reverse(),...i]}var Oi=Math.PI*2;function Re(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function nt(e,t,n,r){return[e+n*Math.sin(r),t-n*Math.cos(r)]}function Yr(e){let t=-1,n=-1/0;return e.forEach((r,o)=>{r>n&&(n=r,t=o)}),t}function Jr(e){return e>=44032&&e<=55203||e>=4352&&e<=4607||e>=12592&&e<=12687||e>=19968&&e<=40959}function qr(e){return e>=44032&&e<=55203?.87:e>=4352&&e<=4607||e>=12592&&e<=12687?.8:e>=19968&&e<=40959?.94:e>=48&&e<=57?.585:e===32||e===44||e===46||e===58||e===59||e===39?.26:e===37?.84:e===8722?.73:e===45?.42:e===43||e===61?.6:e===40||e===41||e===91||e===93?.34:e===47?.38:e===8361||e===36?.62:e===8230?.82:e>=65&&e<=90?e===73?.28:e===77||e===87?.86:.66:e>=97&&e<=122?e===105||e===108||e===106?.24:e===109||e===119?.84:e===102||e===116||e===114?.36:.55:.6}var Wt=new Map;function ee(e,t,n=400){let r=String(e),o=`${r}|${n>=600?1:0}`,i=Wt.get(o);if(i===void 0){let a=0,s=0;for(let c=0;c<r.length;c++){let l=r.charCodeAt(c);Jr(l)?a+=qr(l):s+=qr(l)}i=a+s*(n>=600?1.07:1),Wt.size>5e3&&Wt.clear(),Wt.set(o,i)}return i*t}function Xe(e,t,n,r=400){if(e=e.trim(),ee(e,n,r)<=t)return e;let o="…",i=0,a=e.length;for(;i<a;){let c=i+a+1>>1;ee(e.slice(0,c)+o,n,r)<=t?i=c:a=c-1}i>0&&(e.charCodeAt(i-1)&64512)===55296&&i--;let s=e.slice(0,i).trimEnd();return s.length<(Jr(s.charCodeAt(0))?2:3)?"":s+o}function Zr(e,t,n,r,o=400){return Xe(e,n-ee(` ${t}`,r,o),r,o)}function Qr(e,t,n=0){return e.x<t.x+t.w+n&&t.x<e.x+e.w+n&&e.y<t.y+t.h+n&&t.y<e.y+e.h+n}function eo(e,t,n,r,o="start",i=400){let a=ee(e,r,i);return{x:o==="start"?t:o==="middle"?t-a/2:t-a,y:n-r*.6,w:a,h:r*1.2}}var no=C(z(),1),Ii=e=>Array.isArray(e)&&e.length===2;function to(e){let t=[];for(let n of e??[])n.type==="line"&&typeof n.y=="number"?t.push(n.y):n.type==="band"&&Ii(n.y)&&t.push(Number(n.y[0]),Number(n.y[1]));return t.filter(Number.isFinite)}var oo=C(z(),1),Fn=10.5;function zi(e,t,n){let r=e.map(t);if(new Set(r).size===r.length)return r;let o=1/0;for(let a=1;a<e.length;a++)o=Math.min(o,Math.abs(e[a]-e[a-1]));let i=o>0&&Number.isFinite(o)?Math.min(20,Math.max(2,Math.ceil(-Math.log10(o)-1e-9))):2;return e.map(a=>et(a,{locale:n,maximumFractionDigits:i}))}function ro(e,t,n){let r=18;for(let o of zi(e,t,n))r=Math.max(r,ee(o,Fn));return Math.ceil(r+8)}function _n(e,t){if(!(e>0)||!Number.isFinite(e))return 1;let n=e/Math.max(1,t),r=Math.pow(10,Math.floor(Math.log10(n))),o=n/r;return(o>=7.071?10:o>=3.162?5:o>=1.414?2:1)*r}function rt(e,t,n=4,r={}){let o=e,i=t;if(!Number.isFinite(o)||!Number.isFinite(i))return[0,1];if(r.zero!==!1&&(o>0&&(o=0),i<0&&(i=0)),o===i)return o===0?[0,1]:o>0?[0,o*1.2]:[o*1.2,0];let a=i-o,s=r.pad??.07,c=_n(a,n),l=[o,i];for(let m=0;m<4;m++){let u=Math.ceil(i/c-1e-9)*c,d=Math.floor(o/c+1e-9)*c;l=[o===0?0:o-d<=c*.3?d:o-a*s,i===0?0:u-i<=c*.3?u:i+a*s];let h=_n(l[1]-l[0],n);if(h===c)break;c=h}return l}function ao(e,t,n=4){let r=Math.min(e,t),o=Math.max(e,t),i=_n(o-r,n),a=[],s=Math.ceil(r/i-1e-9)*i;for(let c=s,l=0;c<=o+i*1e-9&&l<200;c+=i,l++)a.push(Number((Math.round(c/i)*i).toPrecision(12)));return a}function Pn(e,t){let[n,r]=e,[o,i]=t,a=r===n?0:(i-o)/(r-n),s=(c=>o+(c-n)*a);return s.domain=e,s.range=t,s.invert=c=>a===0?n:n+(c-o)/a,s.ticks=(c=4)=>ao(n,r,c),s}function Dn(e,t,n=4){if(!(e>0)||!(t>0)||!Number.isFinite(e)||!Number.isFinite(t))return[1,10];let r=Math.log10(e),o=Math.log10(t);if(r===o)return[10**(r-.5),10**(r+.5)];let[i,a]=rt(r,o,Math.max(n,Math.ceil(o-r)),{zero:!1});return[10**i,10**a]}function Bi(e,t,n){let r=Math.log10(e),o=Math.log10(t),i=n/Math.max(1e-9,o-r),a=(l,m=1)=>{let u=[];for(let d=Math.floor(r);d<=Math.ceil(o);d++)if(!(d%m))for(let h of l){let f=Number((h*10**d).toPrecision(12));f>=e*(1-1e-9)&&f<=t*(1+1e-9)&&u.push(f)}return u},s=i>=110?a([1,2,5]):a([1],Math.max(1,Math.ceil(24/i)));if(s.length>=2)return s;let c=a([1,2,3,4,5,6,7,8,9]);return c.length>=2?c:ao(e,t,3)}function io(e,t){let n=Pn([Math.log10(e[0]),Math.log10(e[1])],t),r=(o=>o>0?n(Math.log10(o)):Number.NaN);return r.domain=e,r.range=t,r.invert=o=>10**n.invert(o),r.ticks=()=>Bi(e[0],e[1],Math.abs(t[1]-t[0])),r}function ht(e){let t=1/0,n=-1/0;for(let r of e)Number.isFinite(r)&&(r<t&&(t=r),r>n&&(n=r));return t===1/0?[0,1]:[t,n]}var Hi=864e5;function so(e,t,n,r=ue){let o=t-e;if(!(o>0))return[{t:e,label:ft(e,{locale:r,month:"short",day:"numeric"})}];let i=o/Hi,a=[],s=new Date(e),c=new Date(e).getFullYear()===new Date(t).getFullYear(),l=(m,u,d,h=!1)=>{let f=new Date(m),g=-1,w=0;for(;f.getTime()<=t&&w++<500;){if(f.getTime()>=e){let x=f.getFullYear(),k=h&&!c&&x!==g;a.push({t:f.getTime(),label:ft(f,{locale:r,...d,...k?{year:"numeric"}:{}})}),g=x}u(f)}};if(i<=1.5){let m=Math.max(1,Math.ceil(o/36e5/Math.max(1,n))),u=[1,2,3,4,6,12].find(h=>h>=m)??12,d=new Date(s);d.setMinutes(0,0,0),l(d,h=>h.setHours(h.getHours()+u),{hour:"numeric"})}else if(i<=n*1.2){let m=new Date(s.getFullYear(),s.getMonth(),s.getDate());l(m,u=>u.setDate(u.getDate()+1),{month:"numeric",day:"numeric"})}else if(i<=n*7*1.2){let m=new Date(s.getFullYear(),s.getMonth(),s.getDate());m.setDate(m.getDate()+(8-m.getDay())%7),l(m,u=>u.setDate(u.getDate()+7),{month:"numeric",day:"numeric"})}else{let m=i/30.44,u=Math.max(1,Math.ceil(m/Math.max(1,n))),d=[1,2,3,6,12,24,60].find(h=>h>=u)??120;if(d>=12){let h=new Date(s.getFullYear()+(s.getMonth()>0||s.getDate()>1?1:0),0,1);l(h,f=>f.setFullYear(f.getFullYear()+d/12),{year:"numeric"})}else{let h=new Date(s.getFullYear(),s.getMonth()+(s.getDate()>1?1:0),1),f=h.getMonth()%d;f&&h.setMonth(h.getMonth()+(d-f)),l(h,g=>g.setMonth(g.getMonth()+d),{month:"short"},!0)}}return a}function lo(e,t){let n=new Array(e),r=new Uint8Array(e),o=i=>{if(typeof i!="string"||i.length===0||i.length>9)return-1;let a=Number(i);return Number.isInteger(a)&&a>=0&&a<e&&String(a)===i?a:-1};return new Proxy(n,{get(i,a,s){let c=o(a);return c>=0?(r[c]||(i[c]=t(c),r[c]=1),i[c]):Reflect.get(i,a,s)},has(i,a){return o(a)>=0||Reflect.has(i,a)}})}var ji=(e,t,n)=>e==="date"?Dt(t,n)?.getTime()??NaN:Ne(t);function Gi(e){let t=e.filter(n=>n!=null&&n!=="");return t.length?t.every(n=>n instanceof Date)||t.every(n=>typeof n=="string"&&Ar(n.trim()))?"date":t.every(n=>typeof n=="number"||typeof n=="string"&&/^-?\d+(\.\d+)?$/.test(n.trim()))?"number":"band":"band"}function gt(e,t,n,r,o={}){let i=Ve(t,"x"),a=Array.isArray(n),s=a?n:null,c=a?null:Ve(n,"y"),l=!a&&r!==void 0?Ve(r,"series"):null,m=e.map((v,y)=>i(v,y)),u=o.xType??Gi(m),d=o.locale??ue,h,f,g;if(u==="band"){let v=m.map(M=>String(M??""));h=Te(v);let y=new Map(h.map((M,D)=>[M,D]));f=h.map((M,D)=>D),g=Int32Array.from(v,M=>y.get(M)??-1)}else{let v=u==="date"?o.dayFirst??Nr(m):void 0,y=m.map(O=>ji(u,O,v)),M=Array.from(new Set(y.filter(O=>Number.isFinite(O)))).sort((O,W)=>O-W),D=new Map(M.map((O,W)=>[O,W]));f=M,h=M.map(String),g=Int32Array.from(y,O=>D.get(O)??-1)}let w=o.dateFormat,x=v=>typeof v=="string"?Pt(v.trim())?.[3]:void 0,k=u==="date"&&m.length<5e3?x(m[0]):void 0,$=(k===2||k===3)&&m.every(v=>x(v)===k),R=$&&k===3;if(u==="date"&&!w){let v=f.length>1?f[f.length-1]-f[0]:0;w=$&&k===2||v>864e5*120?{month:"short"}:v<864e5*2?{month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit"}:{month:"numeric",day:"numeric"},v>864e5*800&&(w={year:"numeric",month:"short"})}let b;if(u==="band")b=h;else if(R&&!o.dateFormat){let v=q(d)==="ko";b=f.map(y=>{let M=new Date(y),D=Math.floor(M.getMonth()/3)+1;return v?`${M.getFullYear()}년 ${D}분기`:`Q${D} ${M.getFullYear()}`})}else{let v=f.every(kn),y=u==="date"?new Intl.DateTimeFormat(d,w):new Intl.NumberFormat(d,v?{useGrouping:!1}:{maximumFractionDigits:6});b=f.length>1e3?lo(f.length,M=>y.format(f[M])):f.map(M=>y.format(M))}let A=s?[...s]:l?Te(e.map((v,y)=>String(l(v,y)??""))):[""],E=new Map(A.map((v,y)=>[v,y])),_=A.map(()=>new Array(h.length).fill(NaN)),P=A.map(()=>new Array(h.length).fill(null)),L=o.aggregate??"sum",F=L==="mean"?A.map(()=>new Uint32Array(h.length)):null,T=(v,y,M,D)=>{let O=_[v][y];L==="last"?_[v][y]=M:L==="count"?_[v][y]=(Number.isFinite(O)?O:0)+1:L==="mean"?Number.isFinite(M)&&(_[v][y]=(Number.isFinite(O)?O:0)+M,F[v][y]++):_[v][y]=Number.isFinite(O)?O+(Number.isFinite(M)?M:0):M,P[v][y]=D};for(let v=0;v<e.length;v++){let y=g[v];if(y<0)continue;let M=e[v];if(s)for(let D=0;D<s.length;D++)T(D,y,Ne(M[s[D]]),M);else{let D=l?E.get(String(l(M,v)??""))??0:0;T(D,y,Ne(c(M,v)),M)}}if(F)for(let v=0;v<_.length;v++)for(let y=0;y<h.length;y++)F[v][y]>1&&(_[v][y]/=F[v][y]);return{type:u,keys:h,xnum:f,labels:b,series:A,values:_,rows:P}}var Wi=140,bt=12,co=14,Ln=20,uo=12.5;function Vi(e,t,n=Br){let r=be(t,t),o=new Map;e.forEach((a,s)=>{let c=r(a,s),l=o.get(c);l?l.push(a):o.set(c,[a])});let i=[...o.keys()].slice(0,n);return{values:i,groups:i.map(a=>o.get(a)),dropped:Math.max(0,o.size-n)}}function Ki(e,t,n){if(t<1)return 1;let r=Math.max(1,Math.floor((e+bt)/(Wi+bt))),o=Math.max(1,Math.min(r,Number.isInteger(n)&&n>=1?n:r,t));return Math.ceil(t/Math.ceil(t/o))}function Ui(e,t,n){let r=Math.max(40,Math.floor((e-(t-1)*bt)/t));return{pw:r,ph:typeof n=="number"&&Number.isFinite(n)&&n>0?n:Math.max(120,Math.min(180,Math.round(r*.62)))}}var pt=e=>e.filter(Number.isFinite);function Vt(e,t){let n=[];for(let r of Array.isArray(t)?t:t===void 0?[]:[t]){let o=Ke(r,String(r));e.forEach((i,a)=>n.push(o(i,a)))}return pt(n)}function mo(e,t,n,r,o,i){return gt(t,n.x,r,o,{xType:e==="bar"?"band":n.xType,aggregate:i,dayFirst:n.dayFirst})}function Xi(e,t,n,r,o,i){let a=Math.max(2,Math.round(i/70)),s=r.yScale==="log"&&(e==="line"||e==="scatter"),c=r.yDomain,l=c&&(!s||c[0]>0&&c[1]>0)?c:void 0;if(e==="scatter"){let b=t.flat(),A=r.refLines??{},[E,_]=ht([...Vt(b,r.x??"x"),...pt([Number(A.x)])]),[P,L]=ht([...Vt(b,r.y??"y"),...pt([Number(A.y)])].filter(T=>!s||T>0)),F=r.zero??!1;return{y:l??(s?Dn(P,L,a):rt(P,L,a,{zero:F,pad:.08})),x:r.xDomain??rt(E,_,Math.max(2,Math.round(o/110)),{zero:F,pad:.06}),sameKeys:!0}}let m=e==="bar",u=m&&r.orientation==="horizontal",d=n[0]?.keys.join(""),h=n.every(b=>b.keys.join("")===d),f=n.length>0&&n.every(b=>b.type!=="band"&&b.type===n[0].type),g=r.xDomain??(!m&&f?ht(n.flatMap(b=>pt(b.xnum))):void 0),w=m?r.layout??"grouped":e==="area"?r.stack??"auto":"none";if(w==="percent")return{x:g,sameKeys:h};if(l)return{y:l,x:g,sameKeys:h};let x=[];t.forEach((b,A)=>{let E=n[A];if(w==="stacked"||w==="auto"&&E.series.length>1){let P=Rn(E.values,"zero");P.y0.forEach(L=>x.push(...L)),P.y1.forEach(L=>x.push(...L))}else E.values.forEach(P=>x.push(...P));m&&!u&&r.line!==void 0&&mo(e,b,r,[].concat(r.line),void 0,r.series===void 0?r.aggregate:"mean").values.forEach(P=>x.push(...P)),m||x.push(...Vt(b,r.lower),...Vt(b,r.upper))}),m&&x.push(0),u||x.push(...to(r.annotations));for(let b of r.referenceLines??[])x.push(b.y);r.signColors&&x.push(Number(r.baseline??0));let[k,$]=ht(pt(x).filter(b=>!s||b>0));return{y:s?Dn(k,$,a):m?rt(k,$,u?Math.max(2,Math.round(o/120)):a):rt(k,$,a,{zero:r.zero??e==="area"}),x:g,sameKeys:h}}function Yi(e,t,n,r,o,i,a,s){if(e!=="line"&&e!=="area"||!o.x||!o.y)return;let c=gt(t.flat(),r.x,r.y,void 0,{xType:r.xType,locale:s,dayFirst:r.dayFirst}),l=(r.yScale==="log"&&e==="line"?io:Pn)(o.y,[a-22,10]).ticks(Math.max(2,Math.round(a/70))),m=ro(l,Mr(r.format,s,Math.max(Math.abs(o.y[0]),Math.abs(o.y[1]))),s),u=n.flatMap(b=>b.series),d=r.endLabels??n.some(b=>b.series.length>1),h=m+6,f=i-(d?Math.min(i*.28,Math.max(...u.map(b=>ee(b,11,700)),20)+14):10),g=c.keys.length,[w,x]=o.x[1]===o.x[0]?[o.x[0],o.x[0]+1]:o.x,k=c.type==="number"?g>12:g>so(w,x,Math.max(2,Math.floor((f-h)/64)),s).length;if(c.type==="band"||!g||k)return;let $=b=>h+(c.xnum[b]-w)/(x-w)*(f-h),R=b=>ee(c.labels[b],Fn);for(let b=1;;b++){let A=Array.from({length:Math.ceil(g/b)},(E,_)=>_*b);if(b>=g||A.every((E,_)=>!_||$(E)-$(A[_-1])>=(R(E)+R(A[_-1]))/2+8))return A.map(E=>({value:c.xnum[E],label:c.labels[E]}))}}function qi(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,"0")}function Ji(e,t,n,r){let o=[n.x,n.y,n.series].map(i=>JSON.stringify(i??null)).join("|");return`ztd-facet-${qi(`${e}|${t}|${o}|${Gt(r)}`)}`}function Zi(e,t){return typeof e=="string"?t.includes(e):Array.isArray(e)&&e.length>0&&e.every(n=>typeof n=="string"&&t.includes(n))}var Qi={en:{intro:(e,t)=>`${Je(e,"panel")} by ${t}.`,endHigh:(e,t)=>` ${e} ends highest at ${t}.`,falling:e=>` Lower at the end than at the start: ${e}.`,noneFalling:" None is lower at the end than at the start.",total:(e,t)=>` ${e} has the largest total at ${t}.`,points:(e,t)=>` ${e} has the most points (${t}).`,dropped:(e,t)=>` Only the first ${e} of ${t} values are shown.`,more:", …",blank:"(blank)"},ko:{intro:(e,t)=>`${t}별 패널 ${e}개.`,endHigh:(e,t)=>` 마지막 값이 가장 큰 곳: ${e}(${t}).`,falling:e=>` 처음보다 끝이 낮은 곳: ${e}.`,noneFalling:" 처음보다 끝이 낮은 곳은 없어요.",total:(e,t)=>` 합계가 가장 큰 곳: ${e}(${t}).`,points:(e,t)=>` 점이 가장 많은 곳: ${e}(${t}개).`,dropped:(e,t)=>` ${t}개 중 앞의 ${e}개만 보여요.`,more:" 등",blank:"(빈 값)"}},En=18;function fo(e){let{type:t,chartProps:n}=e,{values:r,groups:o,dropped:i}=Vi(e.data,e.by),a=r.length,s=typeof e.width=="number"&&Number.isFinite(e.width)&&e.width>0?e.width:480,c=Ki(s,a,e.columns),{pw:l,ph:m}=Ui(s,c,e.height),u=e.scale!=="free",d=t==="scatter"?[]:o.map(F=>mo(t,F,n,n.y,n.series,n.aggregate)),h=u?Xi(t,o,d,n,l,m):{sameKeys:!1},f=u?Yi(t,o,d,n,h,l,m,e.locale):void 0,g=t==="bar"&&n.orientation==="horizontal",w=u&&(!g||h.sameKeys),x=u&&(g||h.x!==void 0||h.sameKeys),k=new Set(Zi(e.highlight,r)?[e.highlight].flat():[]),$=k.size>0,R=t==="bar"&&!Array.isArray(n.y)&&n.series===void 0||t==="scatter"&&n.series===void 0,b=e.syncId??Ji(t,e.by,n,e.data),A=_t(We(n.format,e.locale),n.unit),E=Qi[e.lang],_=[],P=r.map(F=>F===""?E.blank:F);return{panels:r.map((F,T)=>{let v=o[T],y=P[T],M=T%c,D;if(t!=="scatter"){let W=d[T],Se=se=>W.values.reduce((Z,Be)=>Z+(Number.isFinite(Be[se])?Be[se]:0),0),B=W.keys.map((se,Z)=>Z).filter(se=>W.values.some(Z=>Number.isFinite(Z[se]))),ie=B[B.length-1];_.push({first:B.length?Se(B[0]):NaN,last:B.length?Se(ie):NaN,total:B.reduce((se,Z)=>se+Se(Z),0)}),t!=="bar"&&W.series.length===1&&ie!==void 0&&(D=A(W.values[0][ie]))}else _.push({first:NaN,last:NaN,total:v.length});let O={data:v,width:l,height:m,ariaLabel:e.title?`${e.title}, ${y}`:y,syncId:b,highlight:$?k.has(F)?R?()=>!0:void 0:"none":e.highlight,showYAxis:!w||M===0,showXAxis:!x||T+c>=a};return h.y&&(O.yDomain=h.y),h.x&&(O.xDomain=h.x),f&&(O.xTicks=f),{value:F,label:y,props:O,last:D,isPicked:k.has(F)}}),cols:c,pw:l,ph:m,isPanelPick:$,description:es(t,e.by,P,_,i,A,E)}}function es(e,t,n,r,o,i,a){let s=a.intro(n.length,t),c=l=>Yr(r.map(m=>m[l]));if(e==="line"||e==="area"){let l=c("last");l>=0&&(s+=a.endHigh(n[l],i(r[l].last)));let m=n.filter((u,d)=>r[d].last<r[d].first);s+=m.length?a.falling(`${m.slice(0,5).join(", ")}${m.length>5?a.more:""}`):a.noneFalling}else{let l=c("total");l>=0&&(s+=e==="bar"?a.total(n[l],i(r[l].total)):a.points(n[l],r[l].total))}return o&&(s+=a.dropped(n.length,n.length+o)),s}var he=C(U(),1);function ts(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function ns(e,t,n=1/0){let r=e.rootBounds?.height??window.innerHeight;return e.isIntersecting&&(e.intersectionRatio>=t||e.intersectionRect.height>=Math.min(r*.5,n))}var Kt={threshold:.25,enoughPx:96,rootMargin:"0px"};function po(e,t=!0){let[n,r]=(0,he.useState)({visible:!t,near:!t});return(0,he.useEffect)(()=>{if(!t){r({visible:!0,near:!0});return}if(!e)return;if(typeof IntersectionObserver>"u"){r({visible:!0,near:!0});return}let o=new IntersectionObserver(a=>{let s=ns(a[a.length-1],Kt.threshold,Kt.enoughPx);r(c=>c.visible===s?c:{...c,visible:s,near:c.near||s})},{threshold:ts(Kt.threshold),rootMargin:Kt.rootMargin}),i=new IntersectionObserver(a=>{let s=a[a.length-1];r(c=>c.near===s.isIntersecting?c:{...c,near:s.isIntersecting})},{threshold:0,rootMargin:"240px 0px 240px 0px"});return o.observe(e),i.observe(e),()=>{o.disconnect(),i.disconnect()}},[e,t]),n}function ho(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function Ut(e){let[t,n]=(0,he.useState)(null),[r,o]=(0,he.useState)(e??null),i=(0,he.useCallback)(a=>{n(a),a&&e===void 0&&o(ho(a))},[e]);return Ae(()=>{if(e!==void 0){o(e);return}if(!t)return;let a=l=>o(m=>m!==null&&Math.abs(m-l)<.5?m:l),s=()=>a(ho(t));if(typeof ResizeObserver>"u")return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s);let c=new ResizeObserver(l=>{let m=l[l.length-1]?.contentRect;m?a(m.width>0?Math.round(m.width*10)/10:0):s()});return c.observe(t),()=>c.disconnect()},[t,e]),[t,i,r]}var rs=()=>()=>{};function ot(){return(0,he.useSyncExternalStore)(rs,()=>!0,()=>!1)}var go="(prefers-reduced-motion: reduce)";function Xt(e="auto"){let[t,n]=(0,he.useState)(()=>ve&&typeof window.matchMedia=="function"?window.matchMedia(go).matches:!1);return(0,he.useEffect)(()=>{if(e!=="auto"||!ve||typeof window.matchMedia!="function")return;let r=window.matchMedia(go),o=()=>n(r.matches);return o(),r.addEventListener?.("change",o),()=>r.removeEventListener?.("change",o)},[e]),e===!0?!0:e===!1?!1:t}var Ce=C(z(),1),os=60,as=420;function bo(e){let t=Me(),n=e.chartProps??{},[,r,o]=Ut(e.width),i=e.width??(o||480),a=de(e.locale??n.locale),s=q(a),c=(0,at.useContext)(qe),l=e.title??c,m=e.chart.facetPlan,u=(0,at.useMemo)(()=>{let x=fo({type:e.type,data:e.data,by:e.by,columns:e.columns,scale:e.scale,chartProps:n,highlight:e.highlight,syncId:e.syncId,width:i,height:e.height,title:l,locale:a,lang:s});return m?m(x,n,a):x},[e.type,e.data,e.by,e.columns,e.scale,JSON.stringify(n,(x,k)=>typeof k=="function"?String(k):k),e.highlight,e.syncId,i,e.height,l,a,s,m]),d=`${(0,at.useId)().replace(/:/g,"")}fd`,h=Xt(n.reducedMotion??"auto"),f=ot(),g=ut({motion:{enabled:n.animate!==!1&&!h&&ve},hydrated:f},{waiting:!1,generation:0}),w=e.chart;return(0,Ce.jsxs)("div",{ref:r,role:"group","aria-label":l,"aria-describedby":d,className:e.className,style:{position:"relative",width:"100%",...e.style},children:[(0,Ce.jsx)("p",{id:d,style:Bt,children:e.description??u.description}),(0,Ce.jsx)("div",{style:{display:"grid",gridTemplateColumns:`repeat(${u.cols}, minmax(0, 1fr))`,columnGap:bt,rowGap:co,...u.legend?{marginTop:En}:null},children:u.panels.map((x,k)=>{let $=t.paint(x.isPicked?"accentText":u.isPanelPick?"muted":"ink");return(0,Ce.jsxs)("div",{"data-facet":x.value,style:{minWidth:0,...ct(g,!1,"fade",k*os,as)},children:[(0,Ce.jsxs)("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,height:Ln,fontSize:uo,fontWeight:700,lineHeight:`${Ln}px`,color:$},children:[(0,Ce.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:x.label}),x.last!==void 0?(0,Ce.jsx)("span",{style:{flex:"none",fontVariantNumeric:"tabular-nums"},children:x.last}):null]}),(0,Ce.jsx)(w,{...n,...x.props})]},x.value)})}),u.legend?(0,Ce.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",top:0,right:0,height:En},children:u.legend}):null]})}var yo=["max","min","first","last","none"];function ye(e,t,n,r,o="max"){let i=new Set,a=n.length,s=l=>{if(a&&l!=="none"){if(l==="first")i.add(0);else if(l==="last")i.add(a-1);else if(l==="max"||l==="min"){let m=-1,u=l==="max"?-1/0:1/0;r.forEach((d,h)=>{Number.isFinite(d)&&(l==="max"?d>u:d<u)&&(u=d,m=h)}),m>=0&&i.add(m)}}};if(e==null)return s(o),i;if(typeof e=="function")return t.forEach((l,m)=>{m<a&&l!==null&&l!==void 0&&e(l,m)&&i.add(m)}),i;let c=Array.isArray(e)?e:[e];for(let l of c)typeof l=="number"?l>=0&&l<a&&i.add(l):l==="max"||l==="min"||l==="first"||l==="last"||l==="none"?s(l):n.forEach((m,u)=>{m===l&&i.add(u)});return i}var xe=C(U(),1);async function is(e,t="auto",n="",r){let o=e.headers.get("content-type")??"",i=await e.text();if(t==="text")return i;if(o.includes("text/html")||/^\s*<(!doctype html|html[\s>])/i.test(i))throw new Error(q(r)==="ko"?`데이터 대신 HTML 페이지를 받았어요. 주소를 확인해 주세요${n?`: ${n}`:"."}`:`Got an HTML page instead of data${n?` (${n})`:""}. Check the URL.`);if(t==="csv")return Ue(i);if(t==="json"||o.includes("json"))return JSON.parse(i);if(o.includes("csv")||/[./]csv(\?|#|$)|output=csv|format=csv|tqx=out:csv/i.test(n))return Ue(i);let a=i.trim();return a.startsWith("{")||a.startsWith("[")?JSON.parse(a):Ue(i)}async function ss(e,t={}){let n=t.signal??new AbortController().signal,r;if(typeof e=="function")r=await e(n);else{let o=e instanceof Request?e.url:String(e),i=await fetch(e instanceof Request?e.clone():o,{...t.init,signal:n});if(!i.ok)throw new Error(`HTTP ${i.status}${i.statusText?` ${i.statusText}`:""}`);r=await is(i,t.parse,o,t.locale)}return t.select&&(r=Kr(r,t.select)),t.transform?t.transform(r):Ie(r)}function xo(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:o=!0}=t,[i,a]=(0,xe.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,c]=(0,xe.useState)(0),l=de(t.locale),m=(0,xe.useRef)(t);m.current={...t,locale:l};let u=(0,xe.useRef)(e);u.current=e;let d=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",h=t.deps??[],f=JSON.stringify(h.map(x=>typeof x=="object"?JSON.stringify(x):String(x))),g=(0,xe.useRef)(!1);(0,xe.useEffect)(()=>{let x=u.current;if(!x||!r){a(R=>R.status==="loading"?{...R,status:"idle"}:R);return}let k=new AbortController,$=!0;return g.current=!0,a(R=>({...R,data:o?R.data:[],status:"loading",error:null})),ss(x,{...m.current,signal:k.signal}).then(R=>{$&&a({data:R,status:"success",error:null,updatedAt:Date.now()})}).catch(R=>{!$||k.signal.aborted||a(b=>({...b,status:"error",error:R instanceof Error?R:new Error(String(R))}))}).finally(()=>{$&&(g.current=!1)}),()=>{$=!1,g.current=!1,k.abort()}},[d,r,s,f,o]),(0,xe.useEffect)(()=>{if(!n||!r)return;let x=setInterval(()=>{g.current||c(k=>k+1)},n);return()=>clearInterval(x)},[n,r]);let w=(0,xe.useCallback)(()=>c(x=>x+1),[]);return{data:i.data,status:i.status,loading:i.status==="loading",error:i.error,empty:i.status==="success"&&i.data.length===0,updatedAt:i.updatedAt,reload:w}}var In=C(z(),1),ls=["csv","svg","png"],cs=/^[=+\-@\t\r\n=+-@]/,us=/var\(|color-mix\(/;function ko(e){if(typeof e=="number")return Number.isFinite(e)?String(e):"";if(e==null||e instanceof Date&&Number.isNaN(e.getTime()))return"";let t=e instanceof Date?Tr(e.getTime()):String(e);return`"${(cs.test(t)&&!Number.isFinite(Ne(t))?`'${t}`:t).replace(/"/g,'""')}"`}function ms(e){return[...new Set(e.slice(0,200).flatMap(t=>t&&typeof t=="object"?Object.keys(t):[]))]}function ds(e,t){return`\uFEFF${[t.map(ko),...e.map(r=>t.map(o=>ko(r[o])))].map(r=>r.join(",")).join(`\r
|
|
26
26
|
`)}\r
|
|
27
|
-
`}function
|
|
28
|
-
`),o=(a,i)=>{if(i==="label")return a.label;if(i==="value")return a.formatted??(a.value===null?null:n(a.value));if(i==="series")return a.series??null;let s=a.datum&&typeof a.datum=="object"?a.datum[i]:void 0;return s==null||s===""||typeof s=="number"&&!Number.isFinite(s)?null:typeof s=="number"?n(s):s instanceof Date?Ve(s,{locale:t,year:"numeric",month:"short",day:"numeric"}):String(s)};return a=>{let i=[];for(let s of r){let c=!1,l=s.replace(Hn,(m,u)=>o(a,u.trim())??(c=!0,""));c||i.push(l)}return i.length?i.map((s,c)=>(0,Ir.jsx)("div",{children:s},c)):null}}function Or(e){if(Array.isArray(e))return e;if(e&&typeof e=="object"){let t=e;if(Array.isArray(t.values))return t.values;if(typeof t.csv=="string")return Ce(t.csv)}return null}var Gr=A(j(),1);var G=A(j(),1);function Br(e,t){let n=se(e.theme),[r,o,a]=kt(e.width),i=_e(),s=e.width??(a||t.ssrWidth||480),c=typeof t.height=="function"?t.height(s):t.height,l=e.height??c,m=wt(e.reducedMotion??"auto"),u=e.animate!==!1&&!m&&ae,d=Sr(r,e.animateOnView!==!1&&u),h=Q(e.locale),f=V(h),g=(0,G.useMemo)(()=>$e(e.format,h,t.format),[e.format,h,t.format]),k=(0,G.useCallback)(B=>ot(B,{locale:h}),[h]),x=(0,G.useMemo)(()=>at(g,e.unit),[g,e.unit]),$=(0,G.useMemo)(()=>pt(e.data),[e.data]),[M,v]=(0,G.useState)(null),[b,N]=(0,G.useState)(null),D=(0,G.useRef)([]),P=(0,G.useRef)(e.onHover);P.current=e.onHover;let E=(0,G.useRef)(e.onClick);E.current=e.onClick;let L=(0,G.useRef)(null),F=(0,G.useRef)(null),S=(0,G.useRef)(null),w=(0,G.useCallback)((B,q="pointer")=>{if(S.current!==B){S.current=B;let oe=B===null?null:D.current[B]??null;queueMicrotask(()=>P.current?.(oe)),F.current?.(B)}L.current=B===null?null:q,v(B),N(L.current)},[]),p=(0,G.useCallback)(B=>{L.current!=="keyboard"&&(L.current=B===null?null:"sync",v(B),N(L.current))},[]),C=(0,G.useCallback)(B=>{let q=D.current[B];q&&E.current?.(q)},[]),R=Un(e.replayKey),I=e.width!==void 0||(a??0)>0,K={enabled:u,active:d.visible&&I,near:d.near,replayKey:R,dataKey:$,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},ve=(0,G.useCallback)((B,q=1)=>M===null||M===B?q:q*.38,[M]);return{p:n,width:s,height:l,measured:I,responsive:e.width===void 0,pending:ae&&i&&e.width===void 0&&a===null,node:r,hydrated:i,ref:o,motion:K,fv:x,fmt:g,pct:k,locale:h,lang:f,t:f==="ko"?$n:vn,active:M,via:b,setActive:w,click:C,events:D,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:ve,sig:$,description:e.description,reduced:m,publish:F,applySync:p}}var W=A(j(),1);function mi(e){return 1-Math.pow(1-e,3)}function di(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function fi(e){return e==="easeInOut"?di:e==="linear"?t=>t:mi}function hi(e,t){return e==="linear"?1:e==="easeInOut"?t<.5?12*t*t:3*Math.pow(-2*t+2,2):3*Math.pow(1-t,2)}function Oe(e,t){if(e.length===t)return e.slice();if(!e.length)return new Array(t).fill(0);if(e.length===1||t===1)return new Array(t).fill(e[0]);let n=new Array(t);for(let r=0;r<t;r++){let o=r/(t-1)*(e.length-1),a=Math.floor(o),i=Math.min(e.length-1,a+1);n[r]=e[a]+(e[i]-e[a])*(o-a)}return n}function vt(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],o=t[n];if(Number.isNaN(r)!==Number.isNaN(o)||Math.abs(r-o)>1e-6)return!1}return!0}function zr(e,t,n){for(let r=0;r<n.length;r++)(!Number.isFinite(e[r])||!Number.isFinite(n[r]))&&(e[r]=n[r],t[r]=0)}function Hr(e,t,n,r){if(!t||!n||t.length!==n.length)return Oe(e,r);let o=[],a=0;for(let i=0;i<n.length;i++){let s=e.slice(a,a+t[i]);a+=t[i];for(let c of Oe(s,n[i]))o.push(c)}return o.length===r?o:Oe(e,r)}var $t=class{constructor(){this.tracks=new Map;this.seq=0;this.easing="spring";this.duration=900;this.omega=8.2;this.animating=!1;this.entranceStart=-1;this.maxDelay=0}configure(t,n){this.easing=t,this.duration=Math.max(1,n),this.omega=7.4/(this.duration/1e3)}sameTargets(t){let n=0;for(let r of this.tracks.values())r.exiting||n++;if(n!==t.length)return!1;for(let r of t){let o=this.tracks.get(r.key);if(!o||o.exiting||!vt(o.to,r.to))return!1}return!0}refreshData(t){for(let n of t){let r=this.tracks.get(n.key);r&&(r.data=n.data)}}make(t,n,r,o){let a=t.from??t.to,i=t.enter??a;return{key:t.key,data:t.data,from:n.slice(),vel:new Array(t.to.length).fill(0),to:t.to.slice(),appear:a.slice(),enter:i.slice(),exit:(t.exit??i).slice(),delay:o,t0:r,cur:n.slice(),curVel:new Array(t.to.length).fill(0),done:!1,exiting:!1,order:this.seq++,progress:0,parts:t.parts}}snap(t){let n=new Map;for(let r of t){let o=this.tracks.get(r.key),a=this.make(r,r.to,0,0);o&&(a.order=o.order),a.done=!0,a.progress=1,n.set(r.key,a)}this.tracks=n,this.animating=!1,this.entranceStart=-1}hold(t){let n=new Map,r=0;for(let o of t){let a=this.tracks.get(o.key),i=this.make(o,o.from??o.to,1/0,o.delay??0);a&&(i.order=a.order),r=Math.max(r,o.delay??0),n.set(o.key,i)}this.maxDelay=r,this.tracks=n,this.animating=!1,this.entranceStart=-1}start(t){for(let n of this.tracks.values())n.t0=t+n.delay,n.from=n.appear.slice(),n.vel.fill(0),zr(n.from,n.vel,n.to),n.cur=n.from.slice(),n.curVel=n.vel.slice(),n.done=vt(n.from,n.to),n.done&&(n.progress=1);this.entranceStart=t,this.animating=!0}update(t,n,r=0){this.step(n);let o=new Set,a=0;for(let i of t){o.add(i.key);let s=this.tracks.get(i.key),c=r>0?Math.min(a*r,240):0;if(s){let l=i.to.length;s.from=Hr(s.cur,s.parts,i.parts,l),s.vel=Hr(s.curVel,s.parts,i.parts,l),s.parts=i.parts,s.to=i.to.slice(),zr(s.from,s.vel,s.to),s.cur=s.from.slice(),s.curVel=s.vel.slice(),s.appear=(i.from??i.to).slice(),s.enter=(i.enter??s.appear).slice(),s.exit=(i.exit??s.enter).slice(),s.data=i.data,s.exiting=!1,s.t0=n+(s.t0>n?Math.max(0,s.t0-n):c),s.done=vt(s.from,s.to)&&s.vel.every(m=>Math.abs(m)<1e-6),s.progress=s.done?1:0}else{let l=this.make(i,i.enter??i.from??i.to,n+c,0);l.done=vt(l.from,l.to),this.tracks.set(i.key,l)}a++}for(let i of this.tracks.values())o.has(i.key)||i.exiting||(i.from=i.cur.slice(),i.vel=i.curVel.slice(),i.to=Oe(i.exit,i.cur.length),i.t0=n,i.exiting=!0,i.done=!1,i.progress=0);this.animating=!0}step(t){if(!this.animating)return!1;let n=!1,r=fi(this.easing),o=this.duration/1e3,a=this.omega,i=[];for(let s of this.tracks.values()){if(s.done)continue;let c=(t-s.t0)/1e3,l=s.to.length;if(s.from.length!==l&&(s.from=Oe(s.from,l)),s.vel.length!==l&&(s.vel=Oe(s.vel,l)),s.cur.length!==l&&(s.cur=new Array(l).fill(0),s.curVel=new Array(l).fill(0)),!(c>0)){for(let u=0;u<l;u++)s.cur[u]=s.from[u],s.curVel[u]=0;s.progress=0,n=!0;continue}let m;if(this.easing==="spring"){let u=Math.exp(-a*c),d=a*c>=8&&a*c<20,h=0;for(let f=0;f<l;f++){let g=s.from[f]-s.to[f],k=s.vel[f]+a*g;s.cur[f]=s.to[f]+(g+k*c)*u,s.curVel[f]=(s.vel[f]-a*k*c)*u,d&&h<.15&&(h=Math.max(h,Math.abs(s.cur[f]-s.to[f]),Math.abs(s.curVel[f]/a)))}m=a*c>=20||d&&h<.15,s.progress=Math.min(1,1-(1+a*c)*u)}else{let u=Math.min(1,c/o),d=r(u),h=hi(this.easing,u)/o;for(let f=0;f<l;f++)s.cur[f]=s.from[f]+(s.to[f]-s.from[f])*d,s.curVel[f]=(s.to[f]-s.from[f])*h;m=u>=1,s.progress=d}if(m){for(let u=0;u<l;u++)s.cur[u]=s.to[u],s.curVel[u]=0;s.done=!0,s.progress=1,s.exiting&&i.push(s.key)}else n=!0}for(let s of i)this.tracks.delete(s);return this.animating=n,n||(this.entranceStart=-1),n}elapsed(t){return this.entranceStart<0?1/0:t-this.entranceStart}get entranceLength(){return this.duration+this.maxDelay}get(t){return this.tracks.get(t)?.cur}items(){return[...this.tracks.values()].sort((t,n)=>t.order-n.order).map(t=>({key:t.key,v:t.cur,data:t.data,exiting:t.exiting,progress:t.progress}))}get size(){return this.tracks.size}},Xe=new Set,Ct=0;function jr(e){Ct=0;let t=Array.from(Xe);for(let n of t){let r;try{r=n(e)}catch{r=!1}r||Xe.delete(n)}Xe.size&&typeof requestAnimationFrame<"u"&&(Ct=requestAnimationFrame(jr))}function Vr(e){return Xe.add(e),!Ct&&typeof requestAnimationFrame<"u"&&(Ct=requestAnimationFrame(jr)),()=>{Xe.delete(e)}}function gi(e){let t=new Map,n=!1;for(let r of e){let o=(t.get(r.key)??0)+1;t.set(r.key,o),o>1&&(n=!0)}return n?(t.clear(),e.map(r=>{let o=(t.get(r.key)??0)+1;return t.set(r.key,o),o>1?{...r,key:`${r.key}#${o}`}:r})):e}function Wr(e,t){let n=(0,W.useMemo)(()=>gi(e),[e]),{enabled:r,active:o,near:a=!0,replayKey:i,dataKey:s,easing:c="spring",duration:l=900,stagger:m=0}=t,u=(0,W.useRef)(null),d=(0,W.useRef)("init"),h=(0,W.useRef)(null),f=(0,W.useRef)(s),g=(0,W.useRef)(i),k=(0,W.useRef)(!1),x=(0,W.useRef)(0),[,$]=(0,W.useState)(0),M=(0,W.useRef)(null),v=(0,W.useRef)(!0);u.current||(u.current=new $t,u.current.configure(c,l),u.current.snap(n),h.current=n);let b=u.current;if(b.configure(c,l),h.current!==n){let F=d.current,S=!Object.is(f.current,s);b.sameTargets(n)?b.refreshData(n):!r||F==="init"?b.snap(n):F==="idle"?b.hold(n):F==="running"||S?b.update(n,tt(),m):b.snap(n),h.current=n,f.current=s}let N=(0,W.useRef)(()=>!1);N.current=F=>{if(!v.current)return!1;let S=b.step(F);return!S&&d.current==="running"&&(d.current="done"),$(w=>(w+1)%1e9),S||(M.current=null),S};let D=(0,W.useCallback)(()=>{if(!ae||M.current||!b.animating)return;let F=S=>N.current(S);M.current=Vr(F)},[b]);ue(()=>{let F=!Object.is(g.current,i);if(g.current=i,!r){(d.current!=="done"||b.animating)&&(b.snap(h.current??n),d.current="done",$(S=>S+1));return}d.current==="init"||F&&a?(b.hold(h.current??n),d.current="idle",k.current=!1,$(S=>S+1)):F&&(k.current=!0)},[r,i]),ue(()=>{!r||!a||!k.current||(k.current=!1,b.hold(h.current??n),d.current="idle",$(F=>F+1))},[a,r]),(0,W.useEffect)(()=>{r&&o&&d.current==="idle"&&(b.start(tt()),x.current+=1,d.current="running",D(),$(F=>F+1))},[r,o,i,b,D]),(0,W.useEffect)(()=>{b.animating&&D()}),(0,W.useEffect)(()=>(v.current=!0,()=>{v.current=!1,M.current?.(),M.current=null}),[]);let P=tt(),E=b.elapsed(P),L=r&&d.current==="idle";return{items:b.items(),get:F=>b.get(F),elapsed:L?0:E,fade:(F,S=320)=>L?0:Number.isFinite(E)?Math.max(0,Math.min(1,(E-F)/S)):1,waiting:L,animating:b.animating,generation:x.current}}var on=A(_(),1);function Kr(e,t,n,r,o){if(r)return o==="categorical"?ne(e,t,n):Pn(e,t,n);if(o==="categorical")return ne(e,t,n);let a=X(e,"strong"),i=X(e,"accent");return Array.from({length:t},(s,c)=>n.has(c)?i:a)}var pi=A(j(),1);var an=A(_(),1);var Ur=e=>e?"neutralStrong":"accent";var sn=A(_(),1);function Xr(e,t,n,r){if(typeof e!="function")return de(e,n,n,n.map(()=>0),"first");let o=new Map(n.map((i,s)=>[i,s])),a=new Set;return t.forEach((i,s)=>{let c=o.get(r(i,s));c!==void 0&&e(i,s)&&a.add(c)}),a}var bi=A(j(),1);var cn=A(_(),1),yi={name:"Candlestick chart",open:"Open",high:"High",low:"Low",close:"Close",change:"Change",volume:"Volume",empty:"No data.",ohlc:(e,t,n,r)=>`open ${e}, high ${t}, low ${n}, close ${r}`,span:(e,t,n)=>`${e} to ${t}: ${n}`,desc:(e,t,n,r,o)=>`${e} to ${t}, ${Se(n,"candle")}. First open ${r}, last close ${o}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},Yr={en:yi,ko:{name:"캔들스틱",open:"시가",high:"고가",low:"저가",close:"종가",change:"등락률",volume:"거래량",empty:"데이터가 없어요.",ohlc:(e,t,n,r)=>`시가 ${e}, 고가 ${t}, 저가 ${n}, 종가 ${r}`,span:(e,t,n)=>`${e}부터 ${t}까지 ${n}`,desc:(e,t,n,r,o)=>`${e}부터 ${t}까지 ${n}개 봉. 첫 시가 ${r}, 마지막 종가 ${o}`,ma:e=>`${e}일선`,up:"상승",down:"하락",maLegend:e=>`${e}일 이동평균`}},ln=["ink","muted","dim"];function qr(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,ln.length)}var xi=A(j(),1);var to=A(_(),1),ki={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${Se(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},wi={en:ki,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},Jr=(e,t)=>wi[e].other(t);function Zr(e,t,n){if(typeof t!="number"||!(t>=1)||e.length<=t+1)return{kept:e,other:null};let r=new Set(e.map((a,i)=>({v:a.value,i})).sort((a,i)=>i.v-a.v).slice(0,Math.floor(t)).map(a=>a.i)),o=e.filter((a,i)=>!r.has(i));return{kept:e.filter((a,i)=>r.has(i)),other:n(o.length,Me(o.map(a=>a.value)))}}var Qr=e=>Number.isFinite(e)&&e>0?e:0;function eo(e,t,n,r){return r==="emphasis"?Rn(e,t,n):ne(e,t,n)}var vi=A(j(),1);var ao=A(_(),1);function no(e,t){return t===!1?e.map((n,r)=>r):cr(e)}function ro(e,t,n){let r=n.map(o=>o.reduce((a,i)=>a+(Number.isFinite(i)?i:0),0));return de(e,t,t,r,"max")}function oo(e,t,n){let r=new Array(t.length),o=t.filter(a=>!n.has(a));for(let a of t)n.has(a)&&(r[a]=X(e,"accent"));return o.forEach((a,i)=>r[a]=o.length===1?X(e,"neutral"):rt(e,1-i/Math.max(1,o.length-1))),r}var Be=A(j(),1);var ge=A(_(),1),$i={kind:"Waffle chart",share:"Share",cells:"Cells",count:e=>`${e}`,of:e=>`Out of ${e} cells:`},Ci={en:$i,ko:{kind:"와플 차트",share:"비중",cells:"칸",count:e=>`${e}칸`,of:e=>`${e}칸 중`}};function io(e,t,n){let r=Math.max(n??0,Me(e));if(!(r>0))return e.map(()=>0);let o=e.map(l=>Math.max(0,l)/r*t),a=o.map(l=>Math.floor(l)),s=(n===void 0?t:Math.min(t,Math.round(Me(e)/r*t)))-Me(a),c=o.map((l,m)=>({r:l-Math.floor(l),i:m})).sort((l,m)=>m.r-l.r);for(let l=0;s>0&&l<c.length;l++,s--)a[c[l].i]++;return a}function un(e){let t=Br(e,{height:O=>Math.max(160,Math.min(230,O*.5)),duration:520,stagger:7}),{p:n,width:r,height:o}=t,a=Ci[t.lang],i=Math.max(1,Math.round(e.cells??100)),s=Math.max(1,Math.round(e.columns??10)),c=Math.ceil(i/s),l=(0,Be.useMemo)(()=>{let O=xe(e.label,"label"),H=De(e.value,"value"),U=e.data.map((Z,Tt)=>({d:Z,i:Tt,label:O(Z,Tt),value:Math.max(0,H(Z,Tt)||0)})),be=de(e.highlight,U.map(Z=>Z.d),U.map(Z=>Z.label),U.map(Z=>Z.value),"first"),Mt=io(U.map(Z=>Z.value),i,e.total),qe=e.total??Me(U.map(Z=>Z.value));return{rows:U,hi:be,counts:Mt,total:qe}},[e.data,e.label,e.value,e.highlight,i,e.total]),m=(0,Be.useMemo)(()=>ne(n,l.rows.length,l.hi),[n,l]),u=e.summary!==!1&&r>=260,d=r<360?2.5:3.5,h=u?r*.58:r,f=Math.max(3,Math.min((h-(s-1)*d)/s,(o-(c-1)*d)/c)),g=s*f+(s-1)*d,k=c*f+(c-1)*d,x=(o-k)/2,$=(0,Be.useMemo)(()=>{let O=[];return l.counts.forEach((H,U)=>{for(let be=0;be<H;be++)O.push(U)}),O},[l.counts]),M=t.motion.stagger??7,v=[...l.hi][0]??-1,b=l.rows[v],N=l.total>0&&b?b.value/l.total*100:0,D=l.rows.filter((O,H)=>!l.hi.has(H)),P=e.summaryNote??D.map(O=>`${O.label} ${t.fv(O.value)}`).join(" · "),E=Math.max(14,(r-g)*.12),L=r-g-E,F=Math.max(24,Math.min(46,L*.32,o*.24)),S=u&&b?Math.min(L,Math.max(ce(t.pct(N),F,800),ce(e.summaryLabel??b.label,12.5,700),P?ce(P,11):0)):0,w=u?Math.max(0,(r-(g+E+S))/2):(r-g)/2,p=w+g+E,C=r-p,R=(0,Be.useMemo)(()=>[{key:"__n",to:[N],from:[0],delay:100,data:null}],[N]),I=t.motion.duration??520,K=Wr(R,{...t.motion,duration:I+i*M*.8}),ve=K.get("__n")?.[0]??N,{active:B,via:q,setActive:oe,click:fe}=t,ze=Qe(t,K),mo=(0,Be.useMemo)(()=>Array.from({length:i},(O,H)=>{let U=$[H]??-1,be=H%s,Mt=Math.floor(H/s),qe=U>=0?m[U]:null;return(0,ge.jsx)("rect",{className:"ztd-mark ztd-pop","data-k":U,x:w+be*(f+d),y:x+Mt*(f+d),width:f,height:f,rx:Math.min(f*.22,4),fill:qe?qe.fill:n.paint("neutralSoft"),opacity:U>=0&&B!==null&&B!==U?.38:void 0,stroke:U>=0&&B===U&&q==="keyboard"?n.paint("ink"):void 0,strokeWidth:1.5,style:Ze(ze,K.waiting,"pop",H*M,I)},H)}),[i,$,s,w,x,f,d,m,n,B,q,ze,K.waiting,K.generation,M,I]),fo=l.rows.map((O,H)=>({datum:O.d,index:H,key:O.label,label:O.label,value:O.value,formatted:`${t.fv(O.value)} · ${t.pct(l.total?O.value/l.total*100:0)}`})),dn=null;if(t.active!==null&&l.rows[t.active]){let O=l.rows[t.active],H=$.indexOf(t.active),U=w+(H>=0?H:0)%s*(f+d)+f/2,be=x+Math.floor((H>=0?H:0)/s)*(f+d);dn={x:U,y:be,title:O.label,rows:[{label:t.t.value,value:t.fv(O.value),color:m[t.active].fill},{label:a.share,value:t.pct(l.total?O.value/l.total*100:0)},{label:a.cells,value:a.count(l.counts[t.active])}]}}let ho=e.description??`${a.kind}. ${a.of(i)} ${l.rows.map((O,H)=>`${O.label} ${a.count(l.counts[H])}`).join(", ")}.`;return(0,ge.jsxs)(Yn,{c:t,kind:a.kind,ariaLabel:e.ariaLabel,description:ho,events:fo,tip:dn,renderTip:e.tooltip,className:e.className,style:e.style,theme:e.theme,children:[(0,ge.jsx)("g",{onPointerOver:O=>{let H=Number(O.target.getAttribute("data-k"));H>=0&&oe(H,O.pointerType==="touch"?"touch":"pointer")},onClick:O=>{let H=Number(O.target.getAttribute("data-k"));H>=0&&fe(H)},children:mo},K.generation),u&&b?(0,ge.jsxs)("g",{opacity:K.fade(250,300),children:[(0,ge.jsx)(ht,{x:p,y:o/2-F*.32,size:F,weight:800,fill:n.paint("ink"),letterSpacing:-1,children:t.pct(ve)}),(0,ge.jsx)(ht,{x:p,y:o/2+F*.42,size:12.5,weight:700,fill:n.paint("ink"),children:yt(e.summaryLabel??b.label,C-2,12.5,700)}),P?(0,ge.jsx)(ht,{x:p,y:o/2+F*.42+17,size:11,fill:n.paint("muted"),children:yt(P,C-2,11)}):null]}):null]})}var pe=A(_(),1);function so(e,t){let n=gt(e);return n?.type==="scatter"&&t?.size!==void 0?gt("bubble"):n}function Mi(e,t={}){let n={};for(let r of e.encoding){let o=t[r.name];o!==void 0&&(n[r.prop??r.name]=o)}return n}function Ti(e,t,n,r=!1){let o=so(e.type,e.encoding);if(!o||!t.length)return[];let a=e.encoding??{},i=e.options??{},s=i.highlight,c=new Set(!r&&Ut.includes(o.type)&&Array.isArray(i.hidden)?i.hidden.map(String):[]),l=u=>u.filter(d=>!c.has(d.label)),m=["pie","donut","waffle"];if(o.type==="donut"&&i.legend!=="none")return[];if(m.includes(o.type)){let u=xe(a.label,"label"),d=De(a.value,"value"),h=o.type==="waffle",f=t.map((v,b)=>({r:v,label:u(v,b),value:h?d(v,b):Qr(d(v,b))})),{kept:g,other:k}=h?{kept:f,other:null}:Zr(f,i.other,(v,b)=>({r:{},label:Jr(V(n),v),value:b})),x=de(s,g.map(v=>v.r),g.map(v=>v.label),g.map(v=>v.value),h?"first":"max"),$=k?[...g,k]:g,M=je(v=>h?ne(v,$.length,x):eo(v,$.length,x,i.colorMode));return $.map((v,b)=>({label:v.label,color:M[b]}))}if(o.type==="candlestick"){let u=qr(Array.isArray(i.ma)?i.ma:void 0,t.length),d=Yr[V(n)];return[{label:d.up,color:i.upColor??"accent"},{label:d.down,color:i.downColor??"neutralStrong"},...u.map((h,f)=>({label:d.maLegend(h),color:ln[f],shape:"line"}))]}if(o.type==="scatter"){if(typeof a.series!="string")return[];let u=xe(a.series,"series"),d=Le(t.map((g,k)=>u(g,k)));if(d.length<2)return[];let h=Xr(s,t,d,u),f=je(g=>Nn(g,d.length,h));return l(d.map((g,k)=>({label:g,color:f[k],shape:"circle"})))}if(["marimekko","area","bar","line","stream","radar"].includes(o.type)){let u=[];if(Array.isArray(a.y))u=a.y;else if(typeof a.series=="string"){let M=xe(a.series,"series");u=Le(t.map((v,b)=>M(v,b)))}let d=Xt(o.type,a,i);if(d.length){let M=de(s,u,u,u.map(()=>0),"none"),v=je(N=>ne(N,u.length,M)),b=u.length<2?[{label:String((Array.isArray(a.y)?a.y[0]:a.y)??"y"),color:"neutral"}]:u.map((N,D)=>({label:N,color:v[D]}));return[...l(b),...d.map((N,D)=>({label:N,color:Ur(D),shape:"line"}))]}if(u.length<2)return[];let f=o.type==="bar"&&i.layout==="diverging"&&s===void 0?lr(u.length,Array.isArray(i.negative)?i.negative.map(M=>u.indexOf(String(M))):[],typeof i.neutral=="string"?u.indexOf(i.neutral):-1):-1,g=f>=0?new Set([f]):de(s,u,u,u.map(()=>0),"first");if(o.type==="radar")return l(u.map((M,v)=>({label:M,color:g.has(v)?"accent":"neutralStrong",shape:"square"})));let k=i.colorMode,x=M=>ne(M,u.length,g);if((o.type==="line"||o.type==="area")&&(x=M=>Kr(M,u.length,g,o.type==="area",k)),o.type==="stream"){let M=Ge(t,a.x,a.y,a.series,{xType:i.xType,locale:n,aggregate:i.aggregate,dayFirst:i.dayFirst}),v=no(M.values,i.reorder),b=ro(s,M.series,M.values);x=N=>oo(N,v,b)}let $=je(x);return l(u.map((M,v)=>({label:M,color:$[v],...o.type==="line"&&{shape:"line"}})))}return[]}function Si(e,t){let n=e.facet;return n&&typeof n=="object"&&typeof n.by=="string"&&er.includes(t)&&!(t==="bar"&&e.options?.layout==="diverging")?n:void 0}function Ai(e,t,n){let{data:r,width:o,height:a,highlight:i,syncId:s,ariaLabel:c,description:l,...m}=n;return{type:e,data:r??[],by:t.by,columns:t.columns,scale:t.scale,chartProps:m,width:o,height:a,highlight:i,syncId:s,title:c,description:l}}function lo(e,t){let{spec:n}=e,r=so(n.type,n.encoding),o=(0,Ye.useMemo)(()=>Or(n.data),[n.data]),a=!o&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,i=Qn(n,e.locale),s=Q(i),c=V(s),l=Fr(a?.url??null,{parse:a?.format??"auto",select:a?.select,init:e.fetchInit,locale:s}),m=rr(n),u=(0,Ye.useMemo)(()=>m?_r(m,s):void 0,[m,s]),d=n.options?.hidden,h=Array.isArray(d)?d.map(String):[],f=h.join(""),[g,k]=(0,Ye.useState)(null);if(!r)return(0,pe.jsx)(Kt,{error:c==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:i});let x=o??l.data,$=t[r.type],M={...n.options??{}},v={...Mi(r,n.encoding),...M,...u?{tooltip:u}:{},data:x,...e.width!==void 0?{width:e.width}:{},...e.height!==void 0?{height:e.height}:{},...e.animate!==void 0?{animate:e.animate}:{},...e.replayKey!==void 0?{replayKey:e.replayKey}:{},...e.onHover?{onHover:e.onHover}:{},...e.onClick?{onClick:e.onClick}:{},locale:i},b=n.card?.legend==="toggle"&&nr(r.type,n.encoding??{},M),N=g&&g.base===f?g.hidden:h;b&&(v.hidden=N);let D=S=>k(w=>{let p=w&&w.base===f?w.hidden:h;return{base:f,hidden:p.includes(S)?p.filter(C=>C!==S):[...p,S]}}),P=v.height??220,E=Si(n,r.type),L=a&&!x.length&&(l.loading||l.error||l.empty)?(0,pe.jsx)(Kt,{loading:l.loading,error:l.error,empty:l.empty,onRetry:l.reload,height:P,locale:i}):E?(0,pe.jsx)(Ar,{chart:$,...Ai(r.type,E,v)}):(0,pe.jsx)($,{...v});if(n.card){let S=n.card,w=S.legend==="auto"||S.legend==="toggle"?Ti(n,x,s,b):S.legend,p=w?.length?b?(0,pe.jsx)(Gt,{items:w,hidden:N,onToggle:D,locale:i}):w:void 0,C=S.download?(0,pe.jsx)(Er,{data:x,columns:or(n),filename:S.title??r.type,formats:Array.isArray(S.download)?S.download:void 0,locale:i}):void 0;L=(0,pe.jsx)(Xn,{number:S.number,title:S.title??Zn(r,c),subtitle:S.subtitle,legend:p,actions:C,source:S.source||void 0,note:S.note||void 0,accent:S.accent,takeaway:S.takeaway,level:S.level,sample:S.sample,replay:S.replay!==!1,className:e.className,locale:i,children:L})}let F=e.theme??n.theme;return F&&(L=(0,pe.jsx)(ct,{theme:F,children:L})),L}function Fi({cfg:e,components:t}){let n=_e();return lo({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function uo(e,t){let n=document.getElementById("ztd-chart-config")?.textContent,r=document.getElementById("chart");if(!n||!r)return;let o=JSON.parse(n);(0,co.hydrateRoot)(r,(0,mn.createElement)(ct,{theme:o.theme,cssVars:!0},(0,mn.createElement)(Fi,{cfg:o,components:{[e]:t}})))}uo("waffle",un);})();
|
|
27
|
+
`}function fs(e){return Array.from((e??"").replace(/[\\/:*?"<>|\r\n\t]+/g,"-").trim()).slice(0,80).join("")||"chart"}function On(e,t){let n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=t,n.click(),setTimeout(()=>URL.revokeObjectURL(n.href),1e4)}var wo=2,ze=16;function vo(e,t){if(!/^(ok)?l(ab|ch)\(|^color\(/.test(e))return e;let n=t.get(e);if(n)return n;let r=document.createElement("canvas").getContext("2d");if(!r)return e;r.fillStyle=e,r.fillRect(0,0,1,1);let[o,i,a,s]=r.getImageData(0,0,1,1).data;return n=s===255?`rgb(${o}, ${i}, ${a})`:`rgba(${o}, ${i}, ${a}, ${Math.round(s/255*1e3)/1e3})`,t.set(e,n),n}function $o(e,t){let n=document.createElementNS("http://www.w3.org/2000/svg",e);for(let[r,o]of Object.entries(t))n.setAttribute(r,String(o));return n}function Mo(e,t,n){let r=e.closest(".ztd-card"),o=r?.querySelector("svg.ztd-svg");if(!r||!o)return null;let{width:i,height:a}=o.viewBox.baseVal,[s,c]=[i+ze*2,a+ze*2],l=o.cloneNode(!0),m=l.querySelectorAll("*"),u=new Map;o.querySelectorAll("*").forEach((f,g)=>{let w;for(let x of Array.from(f.attributes)){if(!us.test(x.value))continue;let k=(w??(w=getComputedStyle(f))).getPropertyValue(x.name);k&&m[g].setAttribute(x.name,vo(k,u))}}),l.removeAttribute("style");for(let[f,g]of Object.entries({viewBox:`${-ze} ${-ze} ${s} ${c}`,width:s*t,height:c*t,"font-family":getComputedStyle(o).fontFamily}))l.setAttribute(f,String(g));let d=vo(getComputedStyle(r).backgroundColor,u),h=o.parentElement?.querySelector("canvas")??null;if(n){let f=l.querySelector("desc")?.nextSibling??l.firstChild;l.insertBefore($o("rect",{x:-ze,y:-ze,width:s,height:c,fill:d}),f),h&&l.insertBefore($o("image",{href:h.toDataURL(),width:i,height:a}),f)}return{svg:new XMLSerializer().serializeToString(l),w:s,h:c,vw:i,vh:a,bg:d,canvas:h}}function hs(e,t){let n=Mo(e,wo,!1);if(!n)return;let r=wo,o=document.createElement("canvas");o.width=Math.ceil(n.w*r),o.height=Math.ceil(n.h*r);let i=o.getContext("2d");if(!i)return;i.fillStyle=n.bg,i.fillRect(0,0,o.width,o.height),n.canvas&&i.drawImage(n.canvas,ze*r,ze*r,n.vw*r,n.vh*r);let a=URL.createObjectURL(new Blob([n.svg],{type:"image/svg+xml"})),s=new Image;s.onload=()=>{i.drawImage(s,0,0,o.width,o.height),URL.revokeObjectURL(a),o.toBlob(c=>c&&On(c,`${t}.png`),"image/png")},s.onerror=()=>URL.revokeObjectURL(a),s.src=a}function To(e){let t=Me(e.theme),n=q(de(e.locale))==="ko",r=fs(e.filename),o=(i,a)=>{if(i==="csv")return On(new Blob([ds(e.data,e.columns?.length?e.columns:ms(e.data))],{type:"text/csv;charset=utf-8"}),`${r}.csv`);if(i==="png")return hs(a,r);let s=Mo(a,1,!0);s&&On(new Blob([s.svg],{type:"image/svg+xml"}),`${r}.svg`)};return(0,In.jsx)("span",{style:{display:"inline-flex",gap:6,flex:"none"},children:ls.filter(i=>!e.formats||e.formats.includes(i)).map(i=>{let a=i.toUpperCase(),s=n?`${a} 내려받기`:`Download ${a}`;return(0,In.jsx)("button",{type:"button",className:"ztd-btn","aria-label":s,title:s,onClick:c=>o(i,c.currentTarget),style:{background:"transparent",color:t.paint("muted"),border:`1px solid ${t.paint("line2")}`,borderRadius:14,height:28,padding:"0 10px",fontSize:12,fontWeight:700,flex:"none"},children:a},i)})})}var So=C(z(),1);function Co(e,t=ue){let n=We(void 0,t),r=e.split(`
|
|
28
|
+
`),o=(i,a)=>{if(a==="label")return i.label;if(a==="value")return i.formatted??(i.value===null?null:n(i.value));if(a==="series")return i.series??null;let s=i.datum&&typeof i.datum=="object"?i.datum[a]:void 0;return s==null||s===""||typeof s=="number"&&!Number.isFinite(s)?null:typeof s=="number"?n(s):s instanceof Date?ft(s,{locale:t,year:"numeric",month:"short",day:"numeric"}):String(s)};return i=>{let a=[];for(let s of r){let c=!1,l=s.replace(Sr,(m,u)=>o(i,u.trim())??(c=!0,""));c||a.push(l)}return a.length?a.map((s,c)=>(0,So.jsx)("div",{children:s},c)):null}}function yt(e,t,n){let r=Math.max(n??0,Re(e));if(!(r>0))return e.map(()=>0);let o=e.map(l=>Math.max(0,l)/r*t),i=o.map(l=>Math.floor(l)),s=(n===void 0?t:Math.min(t,Math.round(Re(e)/r*t)))-Re(i),c=o.map((l,m)=>({r:l-Math.floor(l),i:m})).sort((l,m)=>m.r-l.r);for(let l=0;s>0&&l<c.length;l++,s--)i[c[l].i]++;return i}function zn(e){return e.flatMap((t,n)=>Array(t).fill(n))}var Yt=.38,Ao=3e3;function No(e){let t=s=>(1-Yt)/Math.max(1,s-1),n=s=>Array.from({length:s},(c,l)=>s===1?1:Yt+t(s)*l),r=s=>n(s).map(c=>Math.floor(Math.PI*c/t(s)+1e-9)+1),o=1;for(;Re(r(o))<e;)o++;let i=n(o),a=[];return yt(r(o),e).forEach((s,c)=>{for(let l=0;l<s;l++)a.push({r:i[c],a:s===1?0:-Math.PI/2+Math.PI*l/(s-1)})}),a.sort((s,c)=>s.a-c.a||s.r-c.r),{rows:o,gap:t(o),seats:a}}function Ro(e,t,n=!1){let r=be(t,"group"),o=e.map((s,c)=>r(s,c)).filter(Boolean),i=Te(o);if(!n)return i;let a=new Map;for(let s of o)a.set(s,(a.get(s)??0)+1);return i.map((s,c)=>[s,c]).sort((s,c)=>a.get(s[0])-a.get(c[0])||s[1]-c[1]).map(([s])=>s)}function Fo(e){if(Array.isArray(e))return e;if(e&&typeof e=="object"){let t=e;if(Array.isArray(t.values))return t.values;if(typeof t.csv=="string")return Ue(t.csv)}return null}var Eo=C(U(),1);var te=C(U(),1);function Bn(e,t){let n=Me(e.theme),[r,o,i]=Ut(e.width),a=ot(),s=e.width??(i||t.ssrWidth||480),c=typeof t.height=="function"?t.height(s):t.height,l=e.height??c,m=Xt(e.reducedMotion??"auto"),u=e.animate!==!1&&!m&&ve,d=po(r,e.animateOnView!==!1&&u),h=de(e.locale),f=q(h),g=(0,te.useMemo)(()=>We(e.format,h,t.format),[e.format,h,t.format]),w=(0,te.useCallback)(B=>Ft(B,{locale:h}),[h]),x=(0,te.useMemo)(()=>_t(g,e.unit),[g,e.unit]),k=(0,te.useMemo)(()=>Gt(e.data),[e.data]),[$,R]=(0,te.useState)(null),[b,A]=(0,te.useState)(null),E=(0,te.useRef)([]),_=(0,te.useRef)(e.onHover);_.current=e.onHover;let P=(0,te.useRef)(e.onClick);P.current=e.onClick;let L=(0,te.useRef)(null),F=(0,te.useRef)(null),T=(0,te.useRef)(null),v=(0,te.useCallback)((B,ie="pointer")=>{if(T.current!==B){T.current=B;let se=B===null?null:E.current[B]??null;queueMicrotask(()=>_.current?.(se)),F.current?.(B)}L.current=B===null?null:ie,R(B),A(L.current)},[]),y=(0,te.useCallback)(B=>{L.current!=="keyboard"&&(L.current=B===null?null:"sync",R(B),A(L.current))},[]),M=(0,te.useCallback)(B=>{let ie=E.current[B];ie&&P.current?.(ie)},[]),D=Pr(e.replayKey),O=e.width!==void 0||(i??0)>0,W={enabled:u,active:d.visible&&O,near:d.near,replayKey:D,dataKey:k,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},Se=(0,te.useCallback)((B,ie=1)=>$===null||$===B?ie:ie*.38,[$]);return{p:n,width:s,height:l,measured:O,responsive:e.width===void 0,pending:ve&&a&&e.width===void 0&&i===null,node:r,hydrated:a,ref:o,motion:W,fv:x,fmt:g,pct:w,locale:h,lang:f,t:f==="ko"?ur:cr,active:$,via:b,setActive:v,click:M,events:E,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:Se,sig:k,description:e.description,reduced:m,publish:F,applySync:y}}var J=C(U(),1);function gs(e){return 1-Math.pow(1-e,3)}function ps(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function bs(e){return e==="easeInOut"?ps:e==="linear"?t=>t:gs}function ys(e,t){return e==="linear"?1:e==="easeInOut"?t<.5?12*t*t:3*Math.pow(-2*t+2,2):3*Math.pow(1-t,2)}function it(e,t){if(e.length===t)return e.slice();if(!e.length)return new Array(t).fill(0);if(e.length===1||t===1)return new Array(t).fill(e[0]);let n=new Array(t);for(let r=0;r<t;r++){let o=r/(t-1)*(e.length-1),i=Math.floor(o),a=Math.min(e.length-1,i+1);n[r]=e[i]+(e[a]-e[i])*(o-i)}return n}function qt(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],o=t[n];if(Number.isNaN(r)!==Number.isNaN(o)||Math.abs(r-o)>1e-6)return!1}return!0}function _o(e,t,n){for(let r=0;r<n.length;r++)(!Number.isFinite(e[r])||!Number.isFinite(n[r]))&&(e[r]=n[r],t[r]=0)}function Po(e,t,n,r){if(!t||!n||t.length!==n.length)return it(e,r);let o=[],i=0;for(let a=0;a<n.length;a++){let s=e.slice(i,i+t[a]);i+=t[a];for(let c of it(s,n[a]))o.push(c)}return o.length===r?o:it(e,r)}var Jt=class{constructor(){this.tracks=new Map;this.seq=0;this.easing="spring";this.duration=900;this.omega=8.2;this.animating=!1;this.entranceStart=-1;this.maxDelay=0}configure(t,n){this.easing=t,this.duration=Math.max(1,n),this.omega=7.4/(this.duration/1e3)}sameTargets(t){let n=0;for(let r of this.tracks.values())r.exiting||n++;if(n!==t.length)return!1;for(let r of t){let o=this.tracks.get(r.key);if(!o||o.exiting||!qt(o.to,r.to))return!1}return!0}refreshData(t){for(let n of t){let r=this.tracks.get(n.key);r&&(r.data=n.data)}}make(t,n,r,o){let i=t.from??t.to,a=t.enter??i;return{key:t.key,data:t.data,from:n.slice(),vel:new Array(t.to.length).fill(0),to:t.to.slice(),appear:i.slice(),enter:a.slice(),exit:(t.exit??a).slice(),delay:o,t0:r,cur:n.slice(),curVel:new Array(t.to.length).fill(0),done:!1,exiting:!1,order:this.seq++,progress:0,parts:t.parts}}snap(t){let n=new Map;for(let r of t){let o=this.tracks.get(r.key),i=this.make(r,r.to,0,0);o&&(i.order=o.order),i.done=!0,i.progress=1,n.set(r.key,i)}this.tracks=n,this.animating=!1,this.entranceStart=-1}hold(t){let n=new Map,r=0;for(let o of t){let i=this.tracks.get(o.key),a=this.make(o,o.from??o.to,1/0,o.delay??0);i&&(a.order=i.order),r=Math.max(r,o.delay??0),n.set(o.key,a)}this.maxDelay=r,this.tracks=n,this.animating=!1,this.entranceStart=-1}start(t){for(let n of this.tracks.values())n.t0=t+n.delay,n.from=n.appear.slice(),n.vel.fill(0),_o(n.from,n.vel,n.to),n.cur=n.from.slice(),n.curVel=n.vel.slice(),n.done=qt(n.from,n.to),n.done&&(n.progress=1);this.entranceStart=t,this.animating=!0}update(t,n,r=0){this.step(n);let o=new Set,i=0;for(let a of t){o.add(a.key);let s=this.tracks.get(a.key),c=r>0?Math.min(i*r,240):0;if(s){let l=a.to.length;s.from=Po(s.cur,s.parts,a.parts,l),s.vel=Po(s.curVel,s.parts,a.parts,l),s.parts=a.parts,s.to=a.to.slice(),_o(s.from,s.vel,s.to),s.cur=s.from.slice(),s.curVel=s.vel.slice(),s.appear=(a.from??a.to).slice(),s.enter=(a.enter??s.appear).slice(),s.exit=(a.exit??s.enter).slice(),s.data=a.data,s.exiting=!1,s.t0=n+(s.t0>n?Math.max(0,s.t0-n):c),s.done=qt(s.from,s.to)&&s.vel.every(m=>Math.abs(m)<1e-6),s.progress=s.done?1:0}else{let l=this.make(a,a.enter??a.from??a.to,n+c,0);l.done=qt(l.from,l.to),this.tracks.set(a.key,l)}i++}for(let a of this.tracks.values())o.has(a.key)||a.exiting||(a.from=a.cur.slice(),a.vel=a.curVel.slice(),a.to=it(a.exit,a.cur.length),a.t0=n,a.exiting=!0,a.done=!1,a.progress=0);this.animating=!0}step(t){if(!this.animating)return!1;let n=!1,r=bs(this.easing),o=this.duration/1e3,i=this.omega,a=[];for(let s of this.tracks.values()){if(s.done)continue;let c=(t-s.t0)/1e3,l=s.to.length;if(s.from.length!==l&&(s.from=it(s.from,l)),s.vel.length!==l&&(s.vel=it(s.vel,l)),s.cur.length!==l&&(s.cur=new Array(l).fill(0),s.curVel=new Array(l).fill(0)),!(c>0)){for(let u=0;u<l;u++)s.cur[u]=s.from[u],s.curVel[u]=0;s.progress=0,n=!0;continue}let m;if(this.easing==="spring"){let u=Math.exp(-i*c),d=i*c>=8&&i*c<20,h=0;for(let f=0;f<l;f++){let g=s.from[f]-s.to[f],w=s.vel[f]+i*g;s.cur[f]=s.to[f]+(g+w*c)*u,s.curVel[f]=(s.vel[f]-i*w*c)*u,d&&h<.15&&(h=Math.max(h,Math.abs(s.cur[f]-s.to[f]),Math.abs(s.curVel[f]/i)))}m=i*c>=20||d&&h<.15,s.progress=Math.min(1,1-(1+i*c)*u)}else{let u=Math.min(1,c/o),d=r(u),h=ys(this.easing,u)/o;for(let f=0;f<l;f++)s.cur[f]=s.from[f]+(s.to[f]-s.from[f])*d,s.curVel[f]=(s.to[f]-s.from[f])*h;m=u>=1,s.progress=d}if(m){for(let u=0;u<l;u++)s.cur[u]=s.to[u],s.curVel[u]=0;s.done=!0,s.progress=1,s.exiting&&a.push(s.key)}else n=!0}for(let s of a)this.tracks.delete(s);return this.animating=n,n||(this.entranceStart=-1),n}elapsed(t){return this.entranceStart<0?1/0:t-this.entranceStart}get entranceLength(){return this.duration+this.maxDelay}get(t){return this.tracks.get(t)?.cur}items(){return[...this.tracks.values()].sort((t,n)=>t.order-n.order).map(t=>({key:t.key,v:t.cur,data:t.data,exiting:t.exiting,progress:t.progress}))}get size(){return this.tracks.size}},xt=new Set,Zt=0;function Do(e){Zt=0;let t=Array.from(xt);for(let n of t){let r;try{r=n(e)}catch{r=!1}r||xt.delete(n)}xt.size&&typeof requestAnimationFrame<"u"&&(Zt=requestAnimationFrame(Do))}function Lo(e){return xt.add(e),!Zt&&typeof requestAnimationFrame<"u"&&(Zt=requestAnimationFrame(Do)),()=>{xt.delete(e)}}function xs(e){let t=new Map,n=!1;for(let r of e){let o=(t.get(r.key)??0)+1;t.set(r.key,o),o>1&&(n=!0)}return n?(t.clear(),e.map(r=>{let o=(t.get(r.key)??0)+1;return t.set(r.key,o),o>1?{...r,key:`${r.key}#${o}`}:r})):e}function Hn(e,t){let n=(0,J.useMemo)(()=>xs(e),[e]),{enabled:r,active:o,near:i=!0,replayKey:a,dataKey:s,easing:c="spring",duration:l=900,stagger:m=0}=t,u=(0,J.useRef)(null),d=(0,J.useRef)("init"),h=(0,J.useRef)(null),f=(0,J.useRef)(s),g=(0,J.useRef)(a),w=(0,J.useRef)(!1),x=(0,J.useRef)(0),[,k]=(0,J.useState)(0),$=(0,J.useRef)(null),R=(0,J.useRef)(!0);u.current||(u.current=new Jt,u.current.configure(c,l),u.current.snap(n),h.current=n);let b=u.current;if(b.configure(c,l),h.current!==n){let F=d.current,T=!Object.is(f.current,s);b.sameTargets(n)?b.refreshData(n):!r||F==="init"?b.snap(n):F==="idle"?b.hold(n):F==="running"||T?b.update(n,At(),m):b.snap(n),h.current=n,f.current=s}let A=(0,J.useRef)(()=>!1);A.current=F=>{if(!R.current)return!1;let T=b.step(F);return!T&&d.current==="running"&&(d.current="done"),k(v=>(v+1)%1e9),T||($.current=null),T};let E=(0,J.useCallback)(()=>{if(!ve||$.current||!b.animating)return;let F=T=>A.current(T);$.current=Lo(F)},[b]);Ae(()=>{let F=!Object.is(g.current,a);if(g.current=a,!r){(d.current!=="done"||b.animating)&&(b.snap(h.current??n),d.current="done",k(T=>T+1));return}d.current==="init"||F&&i?(b.hold(h.current??n),d.current="idle",w.current=!1,k(T=>T+1)):F&&(w.current=!0)},[r,a]),Ae(()=>{!r||!i||!w.current||(w.current=!1,b.hold(h.current??n),d.current="idle",k(F=>F+1))},[i,r]),(0,J.useEffect)(()=>{r&&o&&d.current==="idle"&&(b.start(At()),x.current+=1,d.current="running",E(),k(F=>F+1))},[r,o,a,b,E]),(0,J.useEffect)(()=>{b.animating&&E()}),(0,J.useEffect)(()=>(R.current=!0,()=>{R.current=!1,$.current?.(),$.current=null}),[]);let _=At(),P=b.elapsed(_),L=r&&d.current==="idle";return{items:b.items(),get:F=>b.get(F),elapsed:L?0:P,fade:(F,T=320)=>L?0:Number.isFinite(P)?Math.max(0,Math.min(1,(P-F)/T)):1,waiting:L,animating:b.animating,generation:x.current}}var jn=C(z(),1);function Oo(e,t,n,r,o){if(r)return o==="categorical"?ce(e,t,n):yr(e,t,n);if(o==="categorical")return ce(e,t,n);let i=ne(e,"strong"),a=ne(e,"accent");return Array.from({length:t},(s,c)=>n.has(c)?a:i)}var ks=C(U(),1);var Gn=C(z(),1);var Io=e=>e?"neutralStrong":"accent";var Wn=C(z(),1);function zo(e,t,n,r){if(typeof e!="function")return ye(e,n,n,n.map(()=>0),"first");let o=new Map(n.map((a,s)=>[a,s])),i=new Set;return t.forEach((a,s)=>{let c=o.get(r(a,s));c!==void 0&&e(a,s)&&i.add(c)}),i}var ws=C(U(),1);var Kn=C(z(),1),vs={name:"Candlestick chart",open:"Open",high:"High",low:"Low",close:"Close",change:"Change",volume:"Volume",empty:"No data.",ohlc:(e,t,n,r)=>`open ${e}, high ${t}, low ${n}, close ${r}`,span:(e,t,n)=>`${e} to ${t}: ${n}`,desc:(e,t,n,r,o)=>`${e} to ${t}, ${Je(n,"candle")}. First open ${r}, last close ${o}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},Bo={en:vs,ko:{name:"캔들스틱",open:"시가",high:"고가",low:"저가",close:"종가",change:"등락률",volume:"거래량",empty:"데이터가 없어요.",ohlc:(e,t,n,r)=>`시가 ${e}, 고가 ${t}, 저가 ${n}, 종가 ${r}`,span:(e,t,n)=>`${e}부터 ${t}까지 ${n}`,desc:(e,t,n,r,o)=>`${e}부터 ${t}까지 ${n}개 봉. 첫 시가 ${r}, 마지막 종가 ${o}`,ma:e=>`${e}일선`,up:"상승",down:"하락",maLegend:e=>`${e}일 이동평균`}},Vn=["ink","muted","dim"];function Ho(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,Vn.length)}var $s=C(U(),1);var Ko=C(z(),1),Ms={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${Je(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},Ts={en:Ms,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},jo=(e,t)=>Ts[e].other(t);function Go(e,t,n){if(typeof t!="number"||!(t>=1)||e.length<=t+1)return{kept:e,other:null};let r=new Set(e.map((i,a)=>({v:i.value,i:a})).sort((i,a)=>a.v-i.v).slice(0,Math.floor(t)).map(i=>i.i)),o=e.filter((i,a)=>!r.has(a));return{kept:e.filter((i,a)=>r.has(a)),other:n(o.length,Re(o.map(i=>i.value)))}}var Wo=e=>Number.isFinite(e)&&e>0?e:0;function Vo(e,t,n,r){return r==="emphasis"?br(e,t,n):ce(e,t,n)}var Cs=C(U(),1);var qo=C(z(),1);function Uo(e,t){return t===!1?e.map((n,r)=>r):Xr(e)}function Xo(e,t,n){let r=n.map(o=>o.reduce((i,a)=>i+(Number.isFinite(a)?a:0),0));return ye(e,t,t,r,"max")}function Yo(e,t,n){let r=new Array(t.length),o=t.filter(i=>!n.has(i));for(let i of t)n.has(i)&&(r[i]=ne(e,"accent"));return o.forEach((i,a)=>r[i]=o.length===1?ne(e,"neutral"):Rt(e,1-a/Math.max(1,o.length-1))),r}function Jo(e){return!e||typeof e!="object"||Array.isArray(e)?[]:Te(Object.values(e).filter(t=>typeof t=="string"&&t!==""))}function Zo(e,t){return dt(e,t+1,new Set)}var Ss=C(U(),1);var ea=C(z(),1);function Qo(e,t){let n=typeof e=="string"?[e]:Array.isArray(e)?e:[],r=new Set;for(let o of n)typeof o=="string"&&!yo.includes(o)&&t.forEach((i,a)=>i===o&&r.add(a));return r}var ge=C(U(),1);var K=C(z(),1),As={kind:"Waffle chart",share:"Share",cells:"Cells",count:e=>`${e}`,of:e=>`Out of ${e} cells:`,arcKind:"Seat chart",ofTotal:(e,t)=>`${e} of ${t}`,empty:e=>`${e} empty`,perDot:e=>`Each dot is about ${e} units.`,short:(e,t)=>`${e} short of ${t}`,over:(e,t)=>`${e} past ${t}`,at:e=>`exactly at ${e}`,total:e=>`${e} in all`,refs:e=>`Reference lines: ${e}.`},na={en:As,ko:{kind:"와플 차트",share:"비중",cells:"칸",count:e=>`${e}칸`,of:e=>`${e}칸 중`,arcKind:"좌석 차트",ofTotal:(e,t)=>`${t} 중 ${e}`,empty:e=>`빈자리 ${e}`,perDot:e=>`점 하나가 약 ${e}이에요.`,short:(e,t)=>`${t}까지 ${e} 모자라요`,over:(e,t)=>`${t}보다 ${e} 많아요`,at:e=>`${e}에 꼭 맞아요`,total:e=>`모두 ${e}`,refs:e=>`기준선: ${e}.`}};function ra(e,t){let n=r=>Number(r.target.getAttribute("data-k"));return{onPointerOver:r=>{let o=n(r);o>=0&&e(o,r.pointerType==="touch"?"touch":"pointer")},onClick:r=>{let o=n(r);o>=0&&t(o)}}}function Xn(e){return e.shape==="arc"?(0,K.jsx)(Ps,{...e}):(0,K.jsx)(Ns,{...e})}function Ns(e){let t=Bn(e,{height:j=>Math.max(160,Math.min(230,j*.5)),duration:520,stagger:7}),{p:n,width:r,height:o}=t,i=na[t.lang],a=Math.max(1,Math.round(e.cells??100)),s=Math.max(1,Math.round(e.columns??10)),c=Math.ceil(a/s),l=(0,ge.useMemo)(()=>{let j=be(e.label,"label"),V=Ke(e.value,"value"),H=e.data.map((X,ke)=>({d:X,i:ke,label:j(X,ke),value:Math.max(0,V(X,ke)||0)})),De=ye(e.highlight,H.map(X=>X.d),H.map(X=>X.label),H.map(X=>X.value),"first"),Ye=yt(H.map(X=>X.value),a,e.total),He=e.total??Re(H.map(X=>X.value));return{rows:H,hi:De,counts:Ye,total:He}},[e.data,e.label,e.value,e.highlight,a,e.total]),m=(0,ge.useMemo)(()=>ce(n,l.rows.length,l.hi),[n,l]),u=e.summary!==!1&&r>=260,d=r<360?2.5:3.5,h=u?r*.58:r,f=Math.max(3,Math.min((h-(s-1)*d)/s,(o-(c-1)*d)/c)),g=s*f+(s-1)*d,w=c*f+(c-1)*d,x=(o-w)/2,k=(0,ge.useMemo)(()=>zn(l.counts),[l.counts]),$=t.motion.stagger??7,R=[...l.hi][0]??-1,b=l.rows[R],A=l.total>0&&b?b.value/l.total*100:0,E=l.rows.filter((j,V)=>!l.hi.has(V)),_=e.summaryNote??E.map(j=>`${j.label} ${t.fv(j.value)}`).join(" · "),P=Math.max(14,(r-g)*.12),L=r-g-P,F=Math.max(24,Math.min(46,L*.32,o*.24)),T=u&&b?Math.min(L,Math.max(ee(t.pct(A),F,800),ee(e.summaryLabel??b.label,12.5,700),_?ee(_,11):0)):0,v=u?Math.max(0,(r-(g+P+T))/2):(r-g)/2,y=v+g+P,M=r-y,D=(0,ge.useMemo)(()=>[{key:"__n",to:[A],from:[0],delay:100,data:null}],[A]),O=t.motion.duration??520,W=Hn(D,{...t.motion,duration:O+a*$*.8}),Se=W.get("__n")?.[0]??A,{active:B,via:ie,setActive:se,click:Z}=t,Be=ut(t,W),Qt=(0,ge.useMemo)(()=>Array.from({length:a},(j,V)=>{let H=k[V]??-1,De=V%s,Ye=Math.floor(V/s),He=H>=0?m[H]:null;return(0,K.jsx)("rect",{className:"ztd-mark ztd-pop","data-k":H,x:v+De*(f+d),y:x+Ye*(f+d),width:f,height:f,rx:Math.min(f*.22,4),fill:He?He.fill:n.paint("neutralSoft"),opacity:H>=0&&B!==null&&B!==H?.38:void 0,stroke:H>=0&&B===H&&ie==="keyboard"?n.paint("ink"):void 0,strokeWidth:1.5,style:ct(Be,W.waiting,"pop",V*$,O)},V)}),[a,k,s,v,x,f,d,m,n,B,ie,Be,W.waiting,W.generation,$,O]),wt=l.rows.map((j,V)=>({datum:j.d,index:V,key:j.label,label:j.label,value:j.value,formatted:`${t.fv(j.value)} · ${t.pct(l.total?j.value/l.total*100:0)}`})),me=null;if(t.active!==null&&l.rows[t.active]){let j=l.rows[t.active],V=k.indexOf(t.active),H=v+(V>=0?V:0)%s*(f+d)+f/2,De=x+Math.floor((V>=0?V:0)/s)*(f+d);me={x:H,y:De,title:j.label,rows:[{label:t.t.value,value:t.fv(j.value),color:m[t.active].fill},{label:i.share,value:t.pct(l.total?j.value/l.total*100:0)},{label:i.cells,value:i.count(l.counts[t.active])}]}}let Fe=e.description??`${i.kind}. ${i.of(a)} ${l.rows.map((j,V)=>`${j.label} ${i.count(l.counts[V])}`).join(", ")}.`;return(0,K.jsxs)(Cn,{c:t,kind:i.kind,ariaLabel:e.ariaLabel,description:Fe,events:wt,tip:me,renderTip:e.tooltip,className:e.className,style:e.style,theme:e.theme,children:[(0,K.jsx)("g",{...ra(se,Z),children:Qt},W.generation),u&&b?(0,K.jsxs)("g",{opacity:W.fade(250,300),children:[(0,K.jsx)(_e,{x:y,y:o/2-F*.32,size:F,weight:800,fill:n.paint("ink"),letterSpacing:-1,children:t.pct(Se)}),(0,K.jsx)(_e,{x:y,y:o/2+F*.42,size:12.5,weight:700,fill:n.paint("ink"),children:Xe(e.summaryLabel??b.label,M-2,12.5,700)}),_?(0,K.jsx)(_e,{x:y,y:o/2+F*.42+17,size:11,fill:n.paint("muted"),children:Xe(_,M-2,11)}):null]}):null]})}var Rs=1,ta=14,Un=12.5;function Fs(e,t,n){let r=e.toLocaleLowerCase().split(/[\s,;:()]+/),o=i=>i.toLocaleLowerCase().split(/\s+/).every(a=>r.some(s=>s.startsWith(a)&&!/^[\d.,]/.test(s.slice(a.length))));return t.trim()!==""&&n!==""&&o(t)&&o(n)}function _s(e,t,n,r,o){for(let i=e.lastIndexOf(" ");i>0;i=e.lastIndexOf(" ",i-1)){let a=e.slice(0,i).trimEnd(),s=`${e.slice(i+1).trimStart()} ${t}`.trim();if(ee(a,o,700)<=n&&ee(s,o,700)<=r)return[a,s]}return null}function Ps(e){let t=Bn(e,{height:N=>Math.max(150,Math.min(340,N*.5+30)),duration:520,stagger:7}),{p:n,width:r,height:o}=t,i=na[t.lang],a=(0,ge.useMemo)(()=>{let N=be(e.label,"label"),I=Ke(e.value,"value"),re=e.data.map((Q,lt)=>{let we=I(Q,lt);return{d:Q,label:N(Q,lt),value:Number.isFinite(we)?Math.max(0,we):0}}),oe=ye(e.highlight,re.map(Q=>Q.d),re.map(Q=>Q.label),re.map(Q=>Q.value),"first"),Y=Re(re.map(Q=>Q.value)),Le=typeof e.total=="number"&&Number.isFinite(e.total)&&e.total>0&&e.total>=Y?e.total:void 0,le=Le??Y,je=le>0?Math.max(1,Math.round(le)):0,Mt=Math.min(je,Ao),st=yt(re.map(Q=>Q.value),Mt,Le),Tt=le>0&&Array.isArray(e.referenceLines)?e.referenceLines.filter(Q=>typeof Q?.value=="number"&&Q.value>=0&&Q.value<=le):[];return{rows:re,hi:oe,counts:st,owner:zn(st),total:le,empty:le-Y,units:je,dots:Mt,refs:Tt}},[e.data,e.label,e.value,e.highlight,e.total,e.referenceLines]),{dots:s,refs:c,owner:l,counts:m}=a,u=(0,ge.useMemo)(()=>No(s),[s]),d=(0,ge.useMemo)(()=>ce(n,a.rows.length,a.hi),[n,a]),h=.4*u.gap,f=c.length?20:2,g=Math.max(8,Math.min((r-4)/2/(1+h),(o-f-4)/(1+2*h),Math.max(90,1.5*ta/h))),w=Math.max(Rs,Math.min(ta,h*g)),x=r/2,k=(o+f+g)/2,$=(0,ge.useMemo)(()=>u.seats.map(N=>nt(x,k,N.r*g,N.a)),[u,x,k,g]),R=(u.rows===1?1:Yt)*g,b=Math.min(t.motion.stagger??7,700/Math.max(1,s)),A=t.motion.duration??520,E=(0,ge.useMemo)(()=>[{key:"__n",to:[a.total],from:[0],delay:100,data:null}],[a.total]),_=Hn(E,{...t.motion,duration:A+s*b*.8}),{active:P,via:L,setActive:F,click:T}=t,v=ut(t,_),y=Math.min(1.5,w*.5),M=(0,ge.useMemo)(()=>{let N=(oe,Y)=>{let[Le,le]=$[oe];return(0,K.jsx)("circle",{className:"ztd-mark ztd-pop","data-k":Y,cx:Le,cy:le,r:Y<0?Math.max(.5,w-y/2):w,fill:Y<0?"none":d[Y].fill,stroke:Y<0?n.paint("line2"):void 0,strokeWidth:Y<0?y:void 0,style:ct(v,_.waiting,"pop",oe*b,A)},oe)},I=0;return{groups:m.map((oe,Y)=>Array.from({length:oe},()=>N(I++,Y))),rest:$.slice(I).map((oe,Y)=>N(I+Y,-1))}},[$,m,w,y,d,n,v,_.waiting,_.generation,b,A]),D=(0,ge.useMemo)(()=>(0,K.jsxs)("g",{...ra(F,T),children:[M.groups.map((N,I)=>(0,K.jsx)("g",{opacity:P!==null&&P!==I?.38:void 0,stroke:P===I&&L==="keyboard"?n.paint("ink"):void 0,strokeWidth:P===I&&L==="keyboard"?y:void 0,children:N},I)),M.rest]},_.generation),[M,_.generation,F,T,P,L,n,y]),O=N=>N.label??t.fv(N.value),W=c[0],Se=N=>{if(!W)return"";let I=W.value-N;return I>0?i.short(t.fv(I),O(W)):I<0?i.over(t.fv(-I),O(W)):i.at(O(W))},B=N=>a.total>0?N/a.total*100:0,ie=a.rows.map((N,I)=>({datum:N.d,index:I,key:N.label,label:N.label,value:N.value,formatted:`${i.ofTotal(t.fv(N.value),t.fv(a.total))} · ${t.pct(B(N.value))}`})),se=null,Z=a.rows[P??-1];if(P!==null&&Z){let N=l.indexOf(P),[I,re]=N>=0?$[N+Math.floor(m[P]/2)]:[x,k-g];se={x:I,y:re-w,title:Z.label,rows:[{label:t.t.value,value:t.fv(Z.value),color:d[P].fill},{label:i.share,value:t.pct(B(Z.value))},...W?[{label:Se(Z.value),value:""}]:[]]}}let Be=L==="keyboard"&&Z?[Z.label,i.ofTotal(t.fv(Z.value),t.fv(a.total)),t.pct(B(Z.value)),Se(Z.value)].filter(Boolean).join(", "):"",Qt=e.description??`${i.arcKind}. ${i.total(t.fv(a.total))}: ${a.rows.map(N=>`${N.label} ${t.fv(N.value)}`).join(", ")}${a.empty>0?`, ${i.empty(t.fv(a.empty))}`:""}.${c.length?` ${i.refs(c.map(O).join(", "))}`:""}${a.units>s?` ${i.perDot(t.fmt(a.units/s))}`:""}`,wt=P??[...a.hi][0]??-1,me=a.rows[wt],Fe=R-w-4,j=me?t.fmt(me.value):"",V=me?P===null?e.summaryLabel??me.label:me.label:"",H=e.summaryNote??"";P!==null&&me&&H&&Fs(H,me.label,j)&&(H="");let De=t.fmt(a.total),Ye=_.get("__n")?.[0]??a.total,He=()=>H?k-23:k-11,X=12.5,ke=[],vt="",qn=()=>He()-(ke.length-1)*Un,$t=()=>{let N=ke.length?qn():H?k-8:k+2,I=Math.min(40,Fe*.5,Fe*.92-(k-N)-9);return[N,Math.round(Math.min(I,I*Fe*1.6/Math.max(1,ee(De,I,800)))*10)/10]};if(me){let N=Fe*1.8,I=V?`${V} ${j}`:j,re=[12.5,11.5].find(oe=>ee(I,oe,700)<=N);if(re!==void 0)[ke,X]=[[I],re];else{X=11.5;let oe=H;H&&o-k>=14&&ee(H,11)<=2*(R-w)-8&&([vt,H]=[H,""]);let Y=k-(He()-Un)+X*.8,Le=Math.min(N,2*Math.sqrt(Math.max(0,Fe*Fe-Y*Y))),le=_s(V,j,Le,N,X);if(le&&(ke=le),!le||$t()[1]<12){[H,vt]=[oe,""];let je=[me.label,j].filter(Boolean).join(" ");ke=[V!==me.label&&ee(je,X,700)<=N?je:[Zr(V,j,N,X,700),j].filter(Boolean).join(" ")]}}}$t()[1]<12&&(H=""),$t()[1]<12&&(ke=[]);let[la,en]=$t(),ca=e.summary!==!1&&s>0&&en>=12,Jn=[],ua=c.map(N=>{let I=Math.round(N.value*s/Math.max(1,a.units)),re=I<=0?-1:I>=s?1:0,oe=re?re*Math.PI/2:(u.seats[I-1].a+u.seats[I].a)/2,Y=re?w+1.5:0,[Le,le]=nt(x,k,Math.max(0,R-w-1),oe),[je,Mt]=nt(x,k,g+w+4,oe),[st,Tt]=nt(x,k,g+w+7,oe),Q=O(N),lt=Math.sin(oe),we=lt>.4?"start":lt<-.4?"end":"middle",Ge=st+(we==="start"?2:we==="end"?-2:0),tn=we==="middle"?Tt-6:Tt+Y,nn=we==="start"?r-Ge-2:we==="end"?Ge-2:2*Math.min(Ge,r-Ge)-4,rn=ee(Q,11.5,700);rn>nn&&!re&&(we="middle",Ge=Math.max(rn/2+2,Math.min(r-rn/2-2,st)),tn=k-g-w-11,nn=r-4);let on=Xe(Q,nn,11.5,700),Zn=eo(on,Ge,tn,11.5,we,700),Qn=on!==""&&!Jn.some(ma=>Qr(Zn,ma,3));return Qn&&Jn.push(Zn),{line:[Le,le+Y,je,Mt+Y],text:Qn?on:"",x:Ge,y:tn,anchor:we}});return(0,K.jsxs)(Cn,{c:t,kind:i.arcKind,ariaLabel:e.ariaLabel,description:Qt,events:ie,tip:se,announce:Be,renderTip:e.tooltip,className:e.className,style:e.style,theme:e.theme,children:[D,ua.map((N,I)=>(0,K.jsxs)("g",{opacity:_.fade(250,300),children:[(0,K.jsx)("line",{x1:N.line[0],y1:N.line[1],x2:N.line[2],y2:N.line[3],stroke:n.paint("ink"),strokeWidth:1.25,strokeDasharray:"3 3"}),N.text?(0,K.jsx)(_e,{x:N.x,y:N.y,anchor:N.anchor,size:11.5,weight:700,fill:n.paint("ink"),children:N.text}):null]},I)),ca?(0,K.jsxs)("g",{opacity:_.fade(250,300),children:[(0,K.jsx)(_e,{x,y:la-9-en*.5,anchor:"middle",size:en,weight:800,fill:n.paint("ink"),letterSpacing:-.4,children:Ye===a.total?De:t.fmt(Math.round(Ye))}),ke.map((N,I)=>(0,K.jsx)(_e,{x,y:qn()+I*Un,anchor:"middle",size:X,weight:700,fill:n.paint(d[wt]?.role==="accent"?"accentText":"ink"),children:N},I)),H?(0,K.jsx)(_e,{x,y:k-8,anchor:"middle",size:11,fill:n.paint("muted"),children:Xe(H,Fe*1.9,11)}):null,vt?(0,K.jsx)(_e,{x,y:k+12,anchor:"middle",size:11,fill:n.paint("muted"),children:vt}):null]}):null]})}var Pe=C(z(),1);function oa(e,t,n){let r=jt(e);return r?.type==="scatter"&&t?.size!==void 0&&!Ht(n)?jt("bubble"):r}function Ds(e,t={}){let n={};for(let r of e.encoding){let o=t[r.name];o!==void 0&&(n[r.prop??r.name]=o)}return n}function Ls(e,t,n,r=!1){let o=oa(e.type,e.encoding,e.options);if(!o||!t.length)return[];let i=e.encoding??{},a=e.options??{},s=a.highlight,c=new Set(!r&&Sn.includes(o.type)&&Array.isArray(a.hidden)?a.hidden.map(String):[]),l=u=>u.filter(d=>!c.has(d.label)),m=["pie","donut","waffle"];if(o.type==="donut"&&a.legend!=="none")return[];if(m.includes(o.type)){let u=be(i.label,"label"),d=Ke(i.value,"value"),h=o.type==="waffle",f=t.map((b,A)=>({r:b,label:u(b,A),value:h?d(b,A):Wo(d(b,A))})),{kept:g,other:w}=h?{kept:f,other:null}:Go(f,a.other,(b,A)=>({r:{},label:jo(q(n),b),value:A})),x=ye(s,g.map(b=>b.r),g.map(b=>b.label),g.map(b=>b.value),h?"first":"max"),k=w?[...g,w]:g,$=Oe(b=>h?ce(b,k.length,x):Vo(b,k.length,x,a.colorMode)),R=h&&a.shape==="arc";return k.map((b,A)=>({label:b.label,color:$[A],...R&&{shape:"circle"}}))}if(o.type==="candlestick"){let u=Ho(Array.isArray(a.ma)?a.ma:void 0,t.length),d=Bo[q(n)];return[{label:d.up,color:a.upColor??"accent"},{label:d.down,color:a.downColor??"neutralStrong"},...u.map((h,f)=>({label:d.maLegend(h),color:Vn[f],shape:"line"}))]}if(o.type==="network"){let u=Jo(a.groups);if(u.length<2)return[];let d=Oe(h=>Zo(h,u.length));return u.map((h,f)=>({label:h,color:d[f],shape:"circle"}))}if(o.type==="symbolMap"){if(typeof i.group!="string")return[];let u=be(i.group,"group"),d=Te(t.map((f,g)=>u(f,g)).filter(Boolean));if(d.length<2)return[];let h=Oe(f=>dt(f,d.length,new Set));return d.map((f,g)=>({label:f,color:h[g],shape:"circle"}))}if(o.type==="scatter"){if(typeof i.series!="string"||Ht(a))return[];let u=be(i.series,"series"),d=Te(t.map((g,w)=>u(g,w)));if(d.length<2)return[];let h=zo(s,t,d,u),f=Oe(g=>dt(g,d.length,h));return l(d.map((g,w)=>({label:g,color:f[w],shape:"circle"})))}if(o.type==="timeline"){let u=typeof i.group!="string",d=u?i.status:i.group;if(typeof d!="string")return[];let h=Ro(t,d,u),f=Oe(g=>ce(g,h.length,Qo(s,h)));return l(h.map((g,w)=>({label:g,color:f[w],shape:"square"})))}if(["marimekko","area","bar","line","stream","radar"].includes(o.type)){let u=[];if(Array.isArray(i.y))u=i.y;else if(typeof i.series=="string"){let $=be(i.series,"series");u=Te(t.map((R,b)=>$(R,b)))}let d=An(o.type,i,a);if(d.length){let $=ye(s,u,u,u.map(()=>0),"none"),R=Oe(A=>ce(A,u.length,$)),b=u.length<2?[{label:String((Array.isArray(i.y)?i.y[0]:i.y)??"y"),color:"neutral"}]:u.map((A,E)=>({label:A,color:R[E]}));return[...l(b),...d.map((A,E)=>({label:A,color:Io(E),shape:"line"}))]}if(u.length<2)return[];let f=o.type==="bar"&&a.layout==="diverging"&&s===void 0?Ur(u.length,Array.isArray(a.negative)?a.negative.map($=>u.indexOf(String($))):[],typeof a.neutral=="string"?u.indexOf(a.neutral):-1):-1,g=f>=0?new Set([f]):ye(s,u,u,u.map(()=>0),"first");if(o.type==="radar")return l(u.map(($,R)=>({label:$,color:g.has(R)?"accent":"neutralStrong",shape:"square"})));let w=a.colorMode,x=$=>ce($,u.length,g);if((o.type==="line"||o.type==="area")&&(x=$=>Oo($,u.length,g,o.type==="area",w)),o.type==="stream"){let $=gt(t,i.x,i.y,i.series,{xType:a.xType,locale:n,aggregate:a.aggregate,dayFirst:a.dayFirst}),R=Uo($.values,a.reorder),b=Xo(s,$.series,$.values);x=A=>Yo(A,R,b)}let k=Oe(x);return l(u.map(($,R)=>({label:$,color:k[R],...o.type==="line"&&{shape:"line"}})))}return[]}function Es(e,t){let n=e.facet;return n&&typeof n=="object"&&typeof n.by=="string"&&zr.includes(t)&&!(t==="bar"&&e.options?.layout==="diverging")?n:void 0}function Os(e,t,n){let{data:r,width:o,height:i,highlight:a,syncId:s,ariaLabel:c,description:l,...m}=n;return{type:e,data:r??[],by:t.by,columns:t.columns,scale:t.scale,chartProps:m,width:o,height:i,highlight:a,syncId:s,title:c,description:l}}function aa(e,t){let{spec:n}=e,r=oa(n.type,n.encoding,n.options),o=(0,kt.useMemo)(()=>Fo(n.data),[n.data]),i=!o&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,a=Ir(n,e.locale),s=de(a),c=q(s),l=xo(i?.url??null,{parse:i?.format??"auto",select:i?.select,init:e.fetchInit,locale:s}),m=jr(n),u=(0,kt.useMemo)(()=>m?Co(m,s):void 0,[m,s]),d=n.options?.hidden,h=Array.isArray(d)?d.map(String):[],f=h.join(""),[g,w]=(0,kt.useState)(null);if(!r)return(0,Pe.jsx)(Tn,{error:c==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:a});let x=o??l.data,k=t[r.type],$={...n.options??{}},R={...Ds(r,n.encoding),...$,...u?{tooltip:u}:{},data:x,...e.width!==void 0?{width:e.width}:{},...e.height!==void 0?{height:e.height}:{},...e.animate!==void 0?{animate:e.animate}:{},...e.replayKey!==void 0?{replayKey:e.replayKey}:{},...e.onHover?{onHover:e.onHover}:{},...e.onClick?{onClick:e.onClick}:{},locale:a},b=n.card?.legend==="toggle"&&Hr(r.type,n.encoding??{},$),A=g&&g.base===f?g.hidden:h;b&&(R.hidden=A);let E=T=>w(v=>{let y=v&&v.base===f?v.hidden:h;return{base:f,hidden:y.includes(T)?y.filter(M=>M!==T):[...y,T]}}),_=R.height??220,P=Es(n,r.type),L=i&&!x.length&&(l.loading||l.error||l.empty)?(0,Pe.jsx)(Tn,{loading:l.loading,error:l.error,empty:l.empty,onRetry:l.reload,height:_,locale:a}):P?(0,Pe.jsx)(bo,{chart:k,...Os(r.type,P,R)}):(0,Pe.jsx)(k,{...R});if(n.card){let T=n.card,v=T.legend==="auto"||T.legend==="toggle"?Ls(n,x,s,b):T.legend,y=v?.length?b?(0,Pe.jsx)(Mn,{items:v,hidden:A,onToggle:E,locale:a}):v:void 0,M=T.download?(0,Pe.jsx)(To,{data:x,columns:Gr(n),filename:T.title??r.type,formats:Array.isArray(T.download)?T.download:void 0,locale:a}):void 0;L=(0,Pe.jsx)(Dr,{number:T.number,title:T.title??Or(r,c),subtitle:T.subtitle,legend:y,actions:M,source:T.source||void 0,note:T.note||void 0,accent:T.accent,takeaway:T.takeaway,level:T.level,sample:T.sample,replay:T.replay!==!1,className:e.className,locale:a,children:L})}let F=e.theme??n.theme;return F&&(L=(0,Pe.jsx)(Et,{theme:F,children:L})),L}function Is({cfg:e,components:t}){let n=ot();return aa({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function sa(e,t){let n=document.getElementById("ztd-chart-config")?.textContent,r=document.getElementById("chart");if(!n||!r)return;let o=JSON.parse(n);(0,ia.hydrateRoot)(r,(0,Yn.createElement)(Et,{theme:o.theme,cssVars:!0},(0,Yn.createElement)(Is,{cfg:o,components:{[e]:t}})))}sa("waffle",Xn);})();
|