ztd-charts-cli 0.10.0 → 0.11.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/dist/api.js +1 -1
- package/dist/{chunk-QVGOP3IE.js → chunk-ZZGASY2Y.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/client/area.js +6 -6
- package/dist/client/bar.js +5 -5
- package/dist/client/barRace.js +2 -2
- package/dist/client/beeswarm.js +2 -2
- package/dist/client/box.js +6 -6
- package/dist/client/bubble.js +6 -6
- package/dist/client/bullet.js +5 -5
- package/dist/client/bump.js +6 -6
- package/dist/client/calendar.js +5 -5
- package/dist/client/candlestick.js +4 -4
- package/dist/client/chord.js +5 -5
- package/dist/client/choropleth.js +5 -5
- package/dist/client/donut.js +6 -6
- package/dist/client/dumbbell.js +2 -2
- package/dist/client/flowMap.js +4 -4
- package/dist/client/funnel.js +2 -2
- package/dist/client/gauge.js +2 -2
- package/dist/client/heatmap.js +5 -5
- package/dist/client/histogram.js +5 -5
- package/dist/client/line.js +6 -6
- package/dist/client/lollipop.js +5 -5
- package/dist/client/marimekko.js +6 -6
- package/dist/client/network.js +5 -5
- package/dist/client/parallel.js +6 -6
- package/dist/client/pareto.js +5 -5
- package/dist/client/pie.js +6 -6
- package/dist/client/radar.js +6 -6
- package/dist/client/radialBar.js +2 -2
- package/dist/client/ridgeline.js +4 -4
- package/dist/client/sankey.js +4 -4
- package/dist/client/scatter.js +6 -6
- package/dist/client/segmented.js +2 -2
- package/dist/client/skyline.js +2 -2
- package/dist/client/slope.js +5 -5
- package/dist/client/sparkline.js +6 -6
- package/dist/client/stream.js +6 -6
- package/dist/client/sunburst.js +2 -2
- package/dist/client/symbolMap.js +5 -5
- package/dist/client/tileMap.js +6 -6
- package/dist/client/timeline.js +10 -10
- package/dist/client/tree.js +5 -5
- package/dist/client/treemap.js +2 -2
- package/dist/client/waffle.js +5 -5
- package/dist/client/waterfall.js +5 -5
- package/package.json +2 -2
package/dist/client/pie.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{var No=Object.create;var
|
|
1
|
+
(()=>{var No=Object.create;var Tn=Object.defineProperty;var Ro=Object.getOwnPropertyDescriptor;var Fo=Object.getOwnPropertyNames;var _o=Object.getPrototypeOf,Po=Object.prototype.hasOwnProperty;var Dt=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var Do=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Fo(t))!Po.call(e,o)&&o!==n&&Tn(e,o,{get:()=>t[o],enumerable:!(r=Ro(t,o))||r.enumerable});return e};var R=(e,t,n)=>(n=e!=null?No(_o(e)):{},Do(t||!e||!e.__esModule?Tn(n,"default",{value:e,enumerable:!0}):n,e));var U=Dt((Qi,Cn)=>{Cn.exports=globalThis.__ztdReact.react});var An=Dt((es,Sn)=>{Sn.exports=globalThis.__ztdReact["react-dom/client"]});var O=Dt((hs,rr)=>{rr.exports=globalThis.__ztdReact["react/jsx-runtime"]});var Mn=R(U(),1),Co=R(An(),1);var at=R(U(),1);var xt=R(U(),1);var Nn=R(U(),1),Oe=(0,Nn.createContext)(void 0);var Pn=R(U(),1);var Lo=["bg","panel","ink","muted","dim","accent","accentText","onAccent","accent2","accent3","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"],Rn='"Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif',Fn='"Roboto Mono", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace',Ae={name:"dark",bg:"#14171B",panel:"#14171B",ink:"#F1F3F5",muted:"#A3ABB5",dim:"#5B636D",accent:"#D6FD70",accentText:"#D6FD70",onAccent:"#14171B",accent2:"#FF8CC1",accent3:"#38C6F6",onInk:"#14171B",line:"#2A2F36",line2:"#22272D",neutral:"#3A414A",neutralStrong:"#5F6772",onNeutralStrong:"#F1F3F5",neutralSoft:"#262B31",lift:"#1D2126",tint:"rgba(214, 253, 112, 0.14)",fontFamily:Rn,monoFamily:Fn,radius:18,radiusCode:14,radiusMark:4},Lt={name:"light",bg:"#FFFFFF",panel:"#FFFFFF",ink:"#14171B",muted:"#5D6570",dim:"#B3B9C2",accent:"#0B8FD8",accentText:"#006DA8",onAccent:"#14171B",accent2:"#D8488C",accent3:"#659815",onInk:"#FFFFFF",line:"#E6E9ED",line2:"#F0F2F5",neutral:"#D5DAE0",neutralStrong:"#9AA3AE",onNeutralStrong:"#14171B",neutralSoft:"#EEF1F4",lift:"#F4F6F8",tint:"rgba(11, 143, 216, 0.12)",fontFamily:Rn,monoFamily:Fn,radius:18,radiusCode:14,radiusMark:4},Et={dark:Ae,light:Lt};function st(e){return`--ztd-${e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}`}function Ot(e){let t={};for(let n of Lo){let r=e[n];typeof r=="string"&&(t[st(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 It(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 Eo=`
|
|
2
2
|
.ztd-root{position:relative;-webkit-tap-highlight-color:transparent}
|
|
3
3
|
.ztd-root:focus{outline:none}
|
|
4
4
|
.ztd-root:focus-visible{outline:2px solid var(--ztd-accent,${Ae.accent});outline-offset:3px;border-radius:6px}
|
|
@@ -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 Dn(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 Ln(e,t){let[n]=(0,Pn.useState)(!e.motion.enabled);return e.motion.enabled&&e.hydrated&&(!n||t.waiting||t.generation>0)}var _n=!1;function Ye(){if(_n||typeof document>"u"||(_n=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=Eo,document.head.appendChild(e)}var lt=R(U(),1),de=typeof window<"u"&&typeof document<"u",$e=de?lt.useLayoutEffect:lt.useEffect;function ct(){return typeof performance<"u"?performance.now():Date.now()}function V(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function Ie(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var En={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},On={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var Oo=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],Io={basic:{bg:"line2",fg:"ink"},intermediate:{bg:"tint",fg:"accentText"},advanced:{bg:"ink",fg:"onInk"}};function zo(e,t){let n=t.trim().toLowerCase();return e.find(r=>r.id===n||r.en.toLowerCase()===n||r.ko===t.trim())}function Bo(e){return zo(Oo,e)}function In(e,t){let n=Bo(e);return{text:n?n[t]:e,...Io[n?.id??"basic"]}}var zn={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()),zn[t.toLowerCase()]&&(t=zn[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 jn(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 Bt(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 Be(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Bn(e){return .2126*Be(e[0])+.7152*Be(e[1])+.0722*Be(e[2])}function Ht(e,t,n){let r=typeof e=="string"?ze(e):e,o=typeof t=="string"?ze(t):t;if(!r||!o)return 0;let a=n?typeof n=="string"?ze(n):n:null;o[3]<1&&a&&(o=Bt(o,a));let i=r[3]<1?Bt(r,o):r,s=Bn(i),l=Bn(o);return(Math.max(s,l)+.05)/(Math.min(s,l)+.05)}function Ho(e){return[Be(e[0]),Be(e[1]),Be(e[2])]}function zt(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 Hn(e){let[t,n,r]=Ho(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 jo([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[zt(4.0767416621*o-3.3077115913*a+.2309699292*i),zt(-1.2684380046*o+2.6097574011*a-.3413193965*i),zt(-.0041960863*o-.7034186147*a+1.707614701*i),r]}function ut(e,t,n){let r=ze(e),o=ze(t);if(!r||!o)return e;let a=Hn(r),i=Hn(o),s=Math.max(0,Math.min(1,n));return jn(jo([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 jt(e,t,n){let r=t[0],o=-1;for(let a of t){let i=Ht(a,e,n);i>o&&(o=i,r=a)}return r}function J(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 Go(e,t){let n=jt(t,[e.theme.ink,e.theme.onAccent,e.theme.onNeutralStrong]);return Ht(n,t)>=4.5?n===e.theme.ink?e.paint("ink"):n===e.theme.onAccent?e.paint("onAccent"):e.paint("onNeutralStrong"):jt(t,["#FFFFFF","#000000"])}function mt(e,t){let n=ut(e.theme.neutralStrong,e.theme.neutral,t);return{role:"mix",fill:e.mix("neutralStrong","neutral",t),text:Go(e,n),raw:n}}function fe(e,t,n){let r=new Array(t),o=[];for(let i=0;i<t;i++)n.has(i)?r[i]=J(e,"accent"):o.push(i);let a=o.length;return o.forEach((i,s)=>{if(a===1)r[i]=J(e,"neutral");else if(s===0)r[i]=J(e,"ink");else if(s===a-1)r[i]=J(e,"neutral");else if(a===3)r[i]=J(e,"strong");else{let l=(s-1)/Math.max(1,a-2);r[i]=l<=.001?J(e,"strong"):mt(e,1-l)}}),r}var Gt="mix:";function Ne(e){return e({theme:Lt,cssVars:!1,paint:n=>n,color:n=>n??"neutral",raw:n=>n??"neutral",mix:(n,r,o)=>`${Gt}${o}`}).map(n=>n.fill)}function Gn(e,t){return t?.startsWith(Gt)?e.mix("neutralStrong","neutral",Number(t.slice(Gt.length))):e.color(t)}function Je(e,t,n){return fe(e,t+1,n).slice(0,t)}function Vn(e,t,n,r="neutral"){let o=J(e,"accent"),a=J(e,r);return Array.from({length:t},(i,s)=>n.has(s)?o:a)}function Wn(e,t,n){let r=new Array(t),o=[];for(let i=0;i<t;i++)n.has(i)?r[i]=J(e,"accent"):o.push(i);let a=o.length;return o.forEach((i,s)=>{a===1?r[i]=J(e,"neutral"):s===0?r[i]=J(e,"strong"):s===a-1?r[i]=J(e,"neutral"):r[i]=mt(e,1-s/(a-1))}),r}var he=R(U(),1);var ft=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),oe="en-US",Kn=new Map;function Vt(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=Kn.get(r);return o||(o=new Intl.NumberFormat(e,n),Kn.set(r,o)),o}function Wt(e){return/^[-\u2212]/.test(e)&&!/[1-9]/.test(e)?e.slice(1):e}function He(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=oe,...r}=t;return Wt(Vt(n,r).format(e))}var Kt=e=>e!==0&&Math.abs(e)<.05,Ut=(e,t,n="")=>`${He(e,{locale:t,maximumSignificantDigits:2,maximumFractionDigits:20})}${n}`;function dt(e,t={}){if(!Number.isFinite(e))return"-";if(Kt(e)&&t.maximumFractionDigits===void 0)return Ut(e,t.locale??oe,"%");let n=Math.abs(e);return`${He(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function Jn(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=oe,...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,l]=a[i],c=o/s,d=Math.max(r.minimumFractionDigits??0,r.maximumFractionDigits??(s===1||c<100?1:0)),u=Math.round(c*10**d)/10**d;if(i>0&&u>=a[i-1][0]/s){i--;continue}return(e<0&&u!==0?"-":"")+He(u,{locale:n,...r,maximumFractionDigits:d})+l}}return Wt(Vt(n,{notation:"compact",...r}).format(e))}var Vo=(e,t=V(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function Pe(e,t=oe,n){if(typeof e=="function")return e;let r=(o,a="",i="")=>{let s=Vt(t,o);return l=>Number.isFinite(l)?`${i}${Wt(s.format(l))}${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=>dt(o,{locale:t});case"ratio":return o=>dt(o*100,{locale:t});case"compact":return o=>Jn(o,{locale:t});case"currency":return r(Vo(t));default:{let o=r({maximumFractionDigits:1});return a=>Kt(a)?Ut(a,t):o(a)}}}function qn(e,t=oe,n=0){return e!==void 0?Pe(e,t):n>=1e5?r=>Kt(r)?Ut(r,t):Jn(r,{locale:t}):r=>He(r,{locale:t})}function Wo(e,t,n=1){let r=new Date(+e,+t-1,+n);return r.getMonth()===+t-1&&r.getDate()===+n?r:null}var Xt=e=>Number.isInteger(e)&&e>=1e3&&e<=9999,Ko=/^\d{4}-\d{1,2}(-\d{1,2})?([T ][\d:.]+(Z|[+-]\d{2}:?\d{2})?)?$/,Uo=["january","february","march","april","may","june","july","august","september","october","november","december"],Un=e=>{let t=e.toLowerCase();return t.length<3?0:Uo.findIndex(n=>n.startsWith(t))+1},Xn=e=>+e+(+e<30?2e3:1900);function Zn(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var Xo=[/^(\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})일)?$/],Qn=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,er=/\{([^{}]+)\}/g;function ht(e,t){let n;for(let r of Xo)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?[Xn(n[3]),+n[2],+n[1],1]:[Xn(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=Qn.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=Un(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=Un(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}var tr=e=>Ko.test(e)||ht(e)!==null;function nr(e){let t;for(let n of e){let r=typeof n=="string"?Qn.exec(n.trim()):null;if(r){if(+r[1]>12)return!0;+r[3]>12&&(t=!1)}}return t}function gt(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(Xt(e))return new Date(e,0,1);if(e>=19000101&&e<=21001231)return gt(`${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=ht(n,t);if(r)return Wo(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 Yn=new Map;function qe(e,t={month:"short",day:"numeric"}){let n=gt(e);if(!n)return"-";let{locale:r=oe,...o}=t,a=r+JSON.stringify(o),i=Yn.get(a);return i||(i=new Intl.DateTimeFormat(r,o),Yn.set(a,i)),i.format(n)}var Yt=R(O(),1),pt=(0,he.createContext)({theme:Ae,cssVars:!0});function Yo(e,t=Ae){return e?typeof e=="string"?Et[e]??t:It(t,e):t}function bt(e){let t=(0,he.useContext)(pt),n=e.base?Et[e.base]:t.theme,r=(0,he.useMemo)(()=>Yo(e.theme,n),[e.theme,n]),o=e.cssVars??t.cssVars,a=e.locale??t.locale,i=(0,he.useMemo)(()=>({theme:r,cssVars:o,locale:a}),[r,o,a]),s=(0,he.useMemo)(()=>Ot(r),[r]),l=e.paint?{background:r.bg,color:r.ink,fontFamily:r.fontFamily,...s,...e.style}:{display:"contents",...s,...e.style};return(0,Yt.jsx)(pt.Provider,{value:i,children:(0,Yt.jsx)("div",{className:e.className,"data-ztd-theme":r.name,lang:e.locale,style:l,children:e.children})})}var Jo=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","accent2","accent3","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function or(e){return Jo.has(e)}function qo(e,t){let n=r=>t?`var(${st(r)}, ${e[r]})`:e[r];return{theme:e,cssVars:t,paint:n,color:(r,o="neutral")=>r?or(r)?n(r):r:n(o),raw:(r,o="neutral")=>r?or(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)})`:ut(e[r],e[o],a)}}}function ge(e){let t=(0,he.useContext)(pt);return(0,he.useMemo)(()=>{let n=It(t.theme,e);return qo(n,t.cssVars)},[t.theme,t.cssVars,e])}function re(e){let t=(0,he.useContext)(pt);return e??t.locale??oe}function ir(e){return e?Ot(e):{}}var yt=R(U(),1),Jt=(0,yt.createContext)(void 0);function ar(e){let t=(0,yt.useContext)(Jt);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var S=R(O(),1),Zo={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`},Qo={en:Zo,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var ei={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},qt=e=>Qo[V(re(e))];function Zt(e){let t=ge(e.theme),n=qt(e.locale),[r,o]=(0,xt.useState)(!1),a=e.size??11.5,i=e.onToggle,s=new Set(i?e.hidden:void 0),l=e.items.filter(d=>!s.has(d.label)).length,c=(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((d,u)=>{let h=!s.has(d.label),m=h&&l===1,f=(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(ti,{p:t,item:d,off:!h}),(0,S.jsx)("span",{style:h?void 0:{textDecoration:"line-through"},children:d.label})]});return(0,S.jsx)("li",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:a,color:t.paint("muted"),lineHeight:1.3},children:i?(0,S.jsx)("button",{type:"button",className:"ztd-btn","aria-pressed":h,"aria-disabled":m||void 0,onClick:()=>{m||(i(d.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:m?"default":void 0},children:f}):f},u)})});return i?(0,S.jsxs)(S.Fragment,{children:[c,(0,S.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:ei,children:r?n.shown(l,e.items.length):""})]}):c}function ti({p:e,item:t,off:n}){let r=Gn(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 ni(e){let t=ge(e.theme),n=In(e.level,V(re(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 ri(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 sr(e){let t=ge(e.theme),n=qt(e.locale),[r,o]=(0,xt.useState)(0);$e(()=>Ye(),[]);let a=()=>{o(h=>h+1),e.onReplay?.()},i=Array.isArray(e.legend)?(0,S.jsx)(Zt,{items:e.legend,theme:e.theme,locale:e.locale}):e.legend,s=e.as??"h3",l=e.number===void 0?null:typeof e.number=="number"?String(e.number).padStart(2,"0"):e.number,c=e.replay||e.onReplay,d=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)(ni,{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:[l?(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:l}):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:ri(e.title,e.accent,t.paint("accentText"))}),e.actions,c?(0,S.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,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||i?(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",{}),i]}):null]}),(0,S.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:0,minWidth:0},children:(0,S.jsx)(Jt.Provider,{value:r,children:(0,S.jsx)(Oe.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),d?(0,S.jsxs)(S.Fragment,{children:[d,u]}):u]})}function Qt(e){let t=ge(e.theme),n=qt(e.locale),r=e.height??220;if($e(()=>Ye(),[]),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,a)=>(0,S.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,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 Ue=R(U(),1);var se=R(U(),1);var H=R(O(),1),kt=60;var wt={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function lr(e){let{c:t,events:n}=e,r=(0,se.useId)().replace(/:/g,""),o=`${r}t`,a=`${r}d`;t.events.current=n,$e(()=>{Ye()},[]);let i=n.length,s=!e.noNav&&i>0,l=(0,se.useContext)(Oe),c=e.ariaLabel??l??e.kind,d=(0,se.useMemo)(()=>s?`${n.length}${n.slice(0,kt).map(y=>`${y.label}${y.series??""}${y.formatted??y.value??""}`).join("")}`:"",[n,s]),u=(0,se.useMemo)(()=>(0,H.jsx)(oi,{label:c,events:n,t:t.t}),[c,d,t.t]),h=(0,se.useRef)(null);(0,se.useEffect)(()=>{let y=()=>{h.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,se.useEffect)(()=>{h.current=null},[t.width,t.height]);let m=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)%i;break;case"ArrowLeft":case"ArrowUp":D=M===null?i-1:(M-1+i)%i;break;case"Home":D=0;break;case"End":D=i-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:b,setActive:$}=t;(0,se.useEffect)(()=>{if(f!=="touch"||!b)return;let y=M=>{b.contains(M.target)||$(null)};return document.addEventListener("pointerdown",y),()=>document.removeEventListener("pointerdown",y)},[f,b,$]);let x=t.active!==null?n[t.active]:null,k=t.showTooltip&&e.renderTip!==!1&&!t.pending&&t.via!=="sync"?e.tip:null,w=k&&!t.responsive&&t.node&&t.width&&t.node.getBoundingClientRect().width/t.width||1,F=typeof e.renderTip=="function"&&x?e.renderTip(x):null,g=e.announce??(t.via==="keyboard"&&x?`${x.label}${x.series?` ${x.series}`:""}: ${x.formatted??x.value??""} (${(t.active??0)+1}/${i})`:""),C;if(k){let y=k.x*w,M=t.width*w,D=`clamp(${(4-y).toFixed(1)}px, -50%, calc(${(M-y-4).toFixed(1)}px - 100%))`,z=k.y<64;C={position:"absolute",left:y,top:k.y*w,transform:`translate(${D}, ${z?"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*w-8)}}let P=y=>{h.current=null,y.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},N=y=>y?M=>{let D=h.current??(h.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,I=N(e.onPointerMove),L=N(e.onPointerDown),_=I||L?y=>{y.pointerType==="touch"&&I?.(y),L?.(y)}:void 0,A=N(e.onPointerUp),T=ir(e.theme);return(0,H.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":c,"aria-describedby":a,tabIndex:s?0:void 0,onKeyDown:s?m:void 0,onBlur:y=>{t.via==="keyboard"&&!y.currentTarget.contains(y.relatedTarget)&&t.setActive(null)},onPointerLeave:P,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"),...T,...e.style},children:[t.pending?null:e.underlay,(0,H.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:I,onPointerDown:_,onPointerUp:A,onPointerCancel:A,style:{fontFamily:"inherit",touchAction:"pan-y",position:e.underlay?"relative":void 0},children:[(0,H.jsx)("title",{id:o,children:c}),(0,H.jsx)("desc",{id:a,children:i||t.description!==void 0?e.description:e.emptyText??t.t.empty}),e.defs&&!t.pending?(0,H.jsx)("defs",{children:e.defs}):null,t.pending?null:e.children]}),t.pending?null:e.overlay,k?(0,H.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:C,children:F??(0,H.jsxs)(H.Fragment,{children:[(0,H.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,H.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,justifyContent:"space-between"},children:[(0,H.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:7,color:t.p.paint(y.strong?"ink":"muted")},children:[y.color?(0,H.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,H.jsx)("span",{style:{fontWeight:y.strong===!1?500:700},children:y.value})]},M))]})}):null,(0,H.jsx)("span",{className:"ztd-sr",style:wt,"aria-live":"polite","aria-atomic":"true",children:g}),s&&!t.pending?u:null]})}function oi({label:e,events:t,t:n}){return(0,H.jsx)("div",{className:"ztd-sr",style:wt,children:(0,H.jsxs)("table",{children:[(0,H.jsx)("caption",{children:n.table(e)}),(0,H.jsxs)("tbody",{children:[t.slice(0,kt).map((r,o)=>(0,H.jsxs)("tr",{children:[(0,H.jsx)("th",{scope:"row",children:r.series?`${r.label} · ${r.series}`:r.label}),(0,H.jsx)("td",{children:r.formatted??r.value??""})]},o)),t.length>kt?(0,H.jsx)("tr",{children:(0,H.jsx)("td",{colSpan:2,children:n.more(t.length-kt)})}):null]})]})})}function De(e){let t=e.baseline??"central";return(0,H.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}),ce=p("label","string",!0,"Item name field"),Q=p("value","number",!0,"Value field"),ii=[ce,Q],ai=[ce,Q],si=[p("label","string",!0,"Stage name"),p("value","number",!0,"Users at the stage")],li=[ce,Q],ci=[p("label","string",!0,"Leaf (lowest level) name"),Q,p("group","string",!1,"Parent group field")],ui=[p("label","string",!0,"Leaf name"),Q,p("group","string",!1,"Parent group field")],mi=[ce,p("value","number",!0,"Change (total rows may omit it)"),p("type","string",!1,'"total" makes a total bar')],di=[ce,Q],fi=[p("x","string",!0,"Column field"),p("series","string",!0,"Stacked series field"),Q],hi=[p("x","string",!0,"Column field"),p("y","string",!0,"Row field"),Q],gi=[p("axis","string",!0,"Metric (axis) field"),p("value","number",!0,"Value field",{multi:!0}),p("series","string",!1,"Series field")],pi=[p("x","number",!0,"x value"),p("y","number",!0,"y value"),p("size","number",!1,"Circle size"),p("label","string",!1,"Name")],ur=p("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),bi=[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}),ur],yi=[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}),ur],xi=[p("x","any",!0,"x field"),p("y","number",!0,"y field",{multi:!0}),p("series","string",!1,"Series field")],ki=[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})],wi=[ce,Q],vi=[p("value","number",!0,"Value field",{prop:"valueKey"}),p("target","number",!1,"Target field",{prop:"targetKey"})],$i=[ce,p("value","number",!0,"Actual value field"),p("target","number",!1,"Target field")],Ti=[p("x","any",!1,"x field"),p("y","number",!0,"y field")],Mi=[ce,p("x","string",!1,"Period field (long tables)"),p("value","number",!1,"Value field (long tables)")],Ci=[ce,p("start","number",!0,"Before value"),p("end","number",!0,"After value")],Si=[ce,Q],Ai=[p("value","number",!0,"Value field"),p("group","string",!1,"Group (row) field"),p("label","string",!1,"Dot name")],Ni=[p("group","string",!0,"Group field"),p("value","number",!0,"Value field")],Ri=[p("source","string",!0,"Source node"),p("target","string",!0,"Target node"),Q],Fi=[p("source","string",!0,"Sending group"),p("target","string",!0,"Receiving group"),Q],_i=[p("date","date",!0,"Date field"),Q],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)")],Di=[p("group","string",!0,"Group field"),p("value","number",!0,"Value field")],Li=[p("label","string",!1,"Row name field")],Ei=[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")],Oi=[ce,Q],Ii=[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})],zi=[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)")],Bi=[p("region","string",!0,"Region name or code, matched to a tile of options.map"),Q],Hi=[ce,Q,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")],ji=[p("source","string",!0,"Source node"),p("target","string",!0,"Target node"),p("value","number",!1,"Link weight. Without it every row counts 1")],Gi=[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")],Vi=[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")],Wi=[p("region","string",!0,"Region name or code, matched to a region of options.map"),Q],Ki=[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)")],Ui=[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")],Xi=[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")],cr={pie:ii,donut:ai,funnel:si,waffle:li,treemap:ci,sunburst:ui,waterfall:mi,pareto:di,marimekko:fi,heatmap:hi,radar:gi,bubble:pi,line:bi,area:yi,stream:xi,bar:ki,radialBar:wi,gauge:vi,bullet:$i,sparkline:Ti,slope:Mi,dumbbell:Ci,lollipop:Si,beeswarm:Ai,ridgeline:Ni,sankey:Ri,chord:Fi,calendar:_i,bump:Pi,box:Di,parallel:Li,candlestick:Ei,segmented:Oi,skyline:Ii,histogram:zi,scatter:Xi,tileMap:Bi,barRace:Hi,network:ji,timeline:Gi,tree:Vi,choropleth:Wi,symbolMap:Ki,flowMap:Ui},je={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 mr(e,t){return t==="ko"?e.nameKo:e.name}function dr(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var fr=["line","area","bar","scatter"],hr=24,en=["line","area","bar","scatter","timeline"];function tn(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"&&n.layout!=="diverging"?[].concat(t.line??[]).map(String):[]}function gr(e,t,n){return en.includes(e)&&!tn(e,t,n).length&&!(e==="scatter"&&vt(n))}function vt(e){return!!e&&typeof e=="object"&&e.bin==="hex"}function pr(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var Yi={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 $t(e){let t=cr[e]?e:Yi[e]??Object.keys(je).find(n=>n.toLowerCase()===e.toLowerCase()||je[n].component.toLowerCase()===e.toLowerCase());if(!(!t||!je[t]))return{type:t,component:je[t].component,name:je[t].name,nameKo:je[t].nameKo,encoding:cr[t]}}function br(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 $t(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 yr(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function Ji(e,t){if(e==null||typeof e!="object")return;let n=e;if(yr(n,t))return n[t];if(t.includes(".")){let r=n;for(let o of t.split(".")){if(r===null||typeof r!="object"||!yr(r,o))return;r=r[o]}return r}}function Te(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 Le(e,t){if(typeof e=="function")return e;let n=e??t;return r=>Ji(r,n)}function Ge(e,t){let n=Le(e,t);return(r,o)=>Te(n(r,o))}function pe(e,t){let n=Le(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 be(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}function qi(e){let t=[],n=!1;for(let l=0;l<e.length&&l<4e3;l++){let c=e[l];if(c==='"')n=!n;else if(!n&&(c===`
|
|
23
|
-
`||c==="\r"))break;t.push(n?"":c)}let r=t.join(""),o=l=>r.split(l).length-1,
|
|
22
|
+
`;function Dn(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 Ln(e,t){let[n]=(0,Pn.useState)(!e.motion.enabled);return e.motion.enabled&&e.hydrated&&(!n||t.waiting||t.generation>0)}var _n=!1;function Ye(){if(_n||typeof document>"u"||(_n=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=Eo,document.head.appendChild(e)}var lt=R(U(),1),de=typeof window<"u"&&typeof document<"u",ve=de?lt.useLayoutEffect:lt.useEffect;function ct(){return typeof performance<"u"?performance.now():Date.now()}function V(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function Ie(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var En={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},On={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var Oo=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],Io={basic:{bg:"line2",fg:"ink"},intermediate:{bg:"tint",fg:"accentText"},advanced:{bg:"ink",fg:"onInk"}};function zo(e,t){let n=t.trim().toLowerCase();return e.find(r=>r.id===n||r.en.toLowerCase()===n||r.ko===t.trim())}function Bo(e){return zo(Oo,e)}function In(e,t){let n=Bo(e);return{text:n?n[t]:e,...Io[n?.id??"basic"]}}var zn={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()),zn[t.toLowerCase()]&&(t=zn[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 jn(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 Bt(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 Be(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Bn(e){return .2126*Be(e[0])+.7152*Be(e[1])+.0722*Be(e[2])}function Ht(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=Bt(o,i));let a=r[3]<1?Bt(r,o):r,s=Bn(a),l=Bn(o);return(Math.max(s,l)+.05)/(Math.min(s,l)+.05)}function Ho(e){return[Be(e[0]),Be(e[1]),Be(e[2])]}function zt(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 Hn(e){let[t,n,r]=Ho(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 jo([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[zt(4.0767416621*o-3.3077115913*i+.2309699292*a),zt(-1.2684380046*o+2.6097574011*i-.3413193965*a),zt(-.0041960863*o-.7034186147*i+1.707614701*a),r]}function ut(e,t,n){let r=ze(e),o=ze(t);if(!r||!o)return e;let i=Hn(r),a=Hn(o),s=Math.max(0,Math.min(1,n));return jn(jo([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 jt(e,t,n){let r=t[0],o=-1;for(let i of t){let a=Ht(i,e,n);a>o&&(o=a,r=i)}return r}function J(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 Go(e,t){let n=jt(t,[e.theme.ink,e.theme.onAccent,e.theme.onNeutralStrong]);return Ht(n,t)>=4.5?n===e.theme.ink?e.paint("ink"):n===e.theme.onAccent?e.paint("onAccent"):e.paint("onNeutralStrong"):jt(t,["#FFFFFF","#000000"])}function mt(e,t){let n=ut(e.theme.neutralStrong,e.theme.neutral,t);return{role:"mix",fill:e.mix("neutralStrong","neutral",t),text:Go(e,n),raw:n}}function fe(e,t,n){let r=new Array(t),o=[];for(let a=0;a<t;a++)n.has(a)?r[a]=J(e,"accent"):o.push(a);let i=o.length;return o.forEach((a,s)=>{if(i===1)r[a]=J(e,"neutral");else if(s===0)r[a]=J(e,"ink");else if(s===i-1)r[a]=J(e,"neutral");else if(i===3)r[a]=J(e,"strong");else{let l=(s-1)/Math.max(1,i-2);r[a]=l<=.001?J(e,"strong"):mt(e,1-l)}}),r}var Gt="mix:";function Ne(e){return e({theme:Lt,cssVars:!1,paint:n=>n,color:n=>n??"neutral",raw:n=>n??"neutral",mix:(n,r,o)=>`${Gt}${o}`}).map(n=>n.fill)}function Gn(e,t){return t?.startsWith(Gt)?e.mix("neutralStrong","neutral",Number(t.slice(Gt.length))):e.color(t)}function Je(e,t,n){return fe(e,t+1,n).slice(0,t)}function Vn(e,t,n,r="neutral"){let o=J(e,"accent"),i=J(e,r);return Array.from({length:t},(a,s)=>n.has(s)?o:i)}function Wn(e,t,n){let r=new Array(t),o=[];for(let a=0;a<t;a++)n.has(a)?r[a]=J(e,"accent"):o.push(a);let i=o.length;return o.forEach((a,s)=>{i===1?r[a]=J(e,"neutral"):s===0?r[a]=J(e,"strong"):s===i-1?r[a]=J(e,"neutral"):r[a]=mt(e,1-s/(i-1))}),r}var he=R(U(),1);var ft=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),oe="en-US",Kn=new Map;function Vt(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=Kn.get(r);return o||(o=new Intl.NumberFormat(e,n),Kn.set(r,o)),o}function Wt(e){return/^[-\u2212]/.test(e)&&!/[1-9]/.test(e)?e.slice(1):e}function He(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=oe,...r}=t;return Wt(Vt(n,r).format(e))}var Kt=e=>e!==0&&Math.abs(e)<.05,Ut=(e,t,n="")=>`${He(e,{locale:t,maximumSignificantDigits:2,maximumFractionDigits:20})}${n}`;function dt(e,t={}){if(!Number.isFinite(e))return"-";if(Kt(e)&&t.maximumFractionDigits===void 0)return Ut(e,t.locale??oe,"%");let n=Math.abs(e);return`${He(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function Jn(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=oe,...r}=t;if(V(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,l]=i[a],c=o/s,d=Math.max(r.minimumFractionDigits??0,r.maximumFractionDigits??(s===1||c<100?1:0)),u=Math.round(c*10**d)/10**d;if(a>0&&u>=i[a-1][0]/s){a--;continue}return(e<0&&u!==0?"-":"")+He(u,{locale:n,...r,maximumFractionDigits:d})+l}}return Wt(Vt(n,{notation:"compact",...r}).format(e))}var Vo=(e,t=V(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function Pe(e,t=oe,n){if(typeof e=="function")return e;let r=(o,i="",a="")=>{let s=Vt(t,o);return l=>Number.isFinite(l)?`${a}${Wt(s.format(l))}${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=>dt(o,{locale:t});case"ratio":return o=>dt(o*100,{locale:t});case"compact":return o=>Jn(o,{locale:t});case"currency":return r(Vo(t));default:{let o=r({maximumFractionDigits:1});return i=>Kt(i)?Ut(i,t):o(i)}}}function qn(e,t=oe,n=0){return e!==void 0?Pe(e,t):n>=1e5?r=>Kt(r)?Ut(r,t):Jn(r,{locale:t}):r=>He(r,{locale:t})}function Wo(e,t,n=1){let r=new Date(+e,+t-1,+n);return r.getMonth()===+t-1&&r.getDate()===+n?r:null}var Xt=e=>Number.isInteger(e)&&e>=1e3&&e<=9999,Ko=/^\d{4}-\d{1,2}(-\d{1,2})?([T ][\d:.]+(Z|[+-]\d{2}:?\d{2})?)?$/,Uo=["january","february","march","april","may","june","july","august","september","october","november","december"],Un=e=>{let t=e.toLowerCase();return t.length<3?0:Uo.findIndex(n=>n.startsWith(t))+1},Xn=e=>+e+(+e<30?2e3:1900);function Zn(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var Xo=[/^(\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})일)?$/],Qn=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,er=/\{([^{}]+)\}/g;function ht(e,t){let n;for(let r of Xo)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?[Xn(n[3]),+n[2],+n[1],1]:[Xn(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=Qn.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=Un(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=Un(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}var tr=e=>Ko.test(e)||ht(e)!==null;function nr(e){let t;for(let n of e){let r=typeof n=="string"?Qn.exec(n.trim()):null;if(r){if(+r[1]>12)return!0;+r[3]>12&&(t=!1)}}return t}function gt(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(Xt(e))return new Date(e,0,1);if(e>=19000101&&e<=21001231)return gt(`${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=ht(n,t);if(r)return Wo(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 Yn=new Map;function qe(e,t={month:"short",day:"numeric"}){let n=gt(e);if(!n)return"-";let{locale:r=oe,...o}=t,i=r+JSON.stringify(o),a=Yn.get(i);return a||(a=new Intl.DateTimeFormat(r,o),Yn.set(i,a)),a.format(n)}var Yt=R(O(),1),pt=(0,he.createContext)({theme:Ae,cssVars:!0});function Yo(e,t=Ae){return e?typeof e=="string"?Et[e]??t:It(t,e):t}function bt(e){let t=(0,he.useContext)(pt),n=e.base?Et[e.base]:t.theme,r=(0,he.useMemo)(()=>Yo(e.theme,n),[e.theme,n]),o=e.cssVars??t.cssVars,i=e.locale??t.locale,a=(0,he.useMemo)(()=>({theme:r,cssVars:o,locale:i}),[r,o,i]),s=(0,he.useMemo)(()=>Ot(r),[r]),l=e.paint?{background:r.bg,color:r.ink,fontFamily:r.fontFamily,...s,...e.style}:{display:"contents",...s,...e.style};return(0,Yt.jsx)(pt.Provider,{value:a,children:(0,Yt.jsx)("div",{className:e.className,"data-ztd-theme":r.name,lang:e.locale,style:l,children:e.children})})}var Jo=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","accent2","accent3","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function or(e){return Jo.has(e)}function qo(e,t){let n=r=>t?`var(${st(r)}, ${e[r]})`:e[r];return{theme:e,cssVars:t,paint:n,color:(r,o="neutral")=>r?or(r)?n(r):r:n(o),raw:(r,o="neutral")=>r?or(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)})`:ut(e[r],e[o],i)}}}function ge(e){let t=(0,he.useContext)(pt);return(0,he.useMemo)(()=>{let n=It(t.theme,e);return qo(n,t.cssVars)},[t.theme,t.cssVars,e])}function re(e){let t=(0,he.useContext)(pt);return e??t.locale??oe}function ar(e){return e?Ot(e):{}}var yt=R(U(),1),Jt=(0,yt.createContext)(void 0);function ir(e){let t=(0,yt.useContext)(Jt);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var S=R(O(),1),Zo={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`},Qo={en:Zo,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var ea={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},qt=e=>Qo[V(re(e))];function Zt(e){let t=ge(e.theme),n=qt(e.locale),[r,o]=(0,xt.useState)(!1),i=e.size??11.5,a=e.onToggle,s=new Set(a?e.hidden:void 0),l=e.items.filter(d=>!s.has(d.label)).length,c=(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((d,u)=>{let h=!s.has(d.label),m=h&&l===1,f=(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(ta,{p:t,item:d,off:!h}),(0,S.jsx)("span",{style:h?void 0:{textDecoration:"line-through"},children:d.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":h,"aria-disabled":m||void 0,onClick:()=>{m||(a(d.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:m?"default":void 0},children:f}):f},u)})});return a?(0,S.jsxs)(S.Fragment,{children:[c,(0,S.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:ea,children:r?n.shown(l,e.items.length):""})]}):c}function ta({p:e,item:t,off:n}){let r=Gn(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 na(e){let t=ge(e.theme),n=In(e.level,V(re(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 ra(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 sr(e){let t=ge(e.theme),n=qt(e.locale),[r,o]=(0,xt.useState)(0);ve(()=>Ye(),[]);let i=()=>{o(h=>h+1),e.onReplay?.()},a=Array.isArray(e.legend)?(0,S.jsx)(Zt,{items:e.legend,theme:e.theme,locale:e.locale}):e.legend,s=e.as??"h3",l=e.number===void 0?null:typeof e.number=="number"?String(e.number).padStart(2,"0"):e.number,c=e.replay||e.onReplay,d=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)(na,{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:[l?(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:l}):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:ra(e.title,e.accent,t.paint("accentText"))}),e.actions,c?(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)(Jt.Provider,{value:r,children:(0,S.jsx)(Oe.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),d?(0,S.jsxs)(S.Fragment,{children:[d,u]}):u]})}function Qt(e){let t=ge(e.theme),n=qt(e.locale),r=e.height??220;if(ve(()=>Ye(),[]),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 Ue=R(U(),1);var se=R(U(),1);var H=R(O(),1),kt=60;var wt={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function lr(e){let{c:t,events:n}=e,r=(0,se.useId)().replace(/:/g,""),o=`${r}t`,i=`${r}d`;t.events.current=n,ve(()=>{Ye()},[]);let a=n.length,s=!e.noNav&&a>0,l=(0,se.useContext)(Oe),c=e.ariaLabel??l??e.kind,d=(0,se.useMemo)(()=>s?`${n.length}${n.slice(0,kt).map(y=>`${y.label}${y.series??""}${y.formatted??y.value??""}`).join("")}`:"",[n,s]),u=(0,se.useMemo)(()=>(0,H.jsx)(oa,{label:c,events:n,t:t.t}),[c,d,t.t]),h=(0,se.useRef)(null);(0,se.useEffect)(()=>{let y=()=>{h.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,se.useEffect)(()=>{h.current=null},[t.width,t.height]);let m=y=>{if(y.target!==y.currentTarget)return;if(e.onKey?.(y)){y.preventDefault();return}let T=t.active,D;switch(y.key){case"ArrowRight":case"ArrowDown":D=T===null?0:(T+1)%a;break;case"ArrowLeft":case"ArrowUp":D=T===null?a-1:(T-1+a)%a;break;case"Home":D=0;break;case"End":D=a-1;break;case"Escape":if(T===null)return;D=null;break;case"Enter":case" ":T!==null&&(y.preventDefault(),t.click(T));return;default:return}y.preventDefault(),t.setActive(D,"keyboard")},{via:f,node:b,setActive:v}=t;(0,se.useEffect)(()=>{if(f!=="touch"||!b)return;let y=T=>{b.contains(T.target)||v(null)};return document.addEventListener("pointerdown",y),()=>document.removeEventListener("pointerdown",y)},[f,b,v]);let x=t.active!==null?n[t.active]:null,k=t.showTooltip&&e.renderTip!==!1&&!t.pending&&t.via!=="sync"?e.tip:null,w=k&&!t.responsive&&t.node&&t.width&&t.node.getBoundingClientRect().width/t.width||1,F=typeof e.renderTip=="function"&&x?e.renderTip(x):null,g=e.announce??(t.via==="keyboard"&&x?`${x.label}${x.series?` ${x.series}`:""}: ${x.formatted??x.value??""} (${(t.active??0)+1}/${a})`:""),C;if(k){let y=k.x*w,T=t.width*w,D=`clamp(${(4-y).toFixed(1)}px, -50%, calc(${(T-y-4).toFixed(1)}px - 100%))`,z=k.y<64;C={position:"absolute",left:y,top:k.y*w,transform:`translate(${D}, ${z?"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*w-8)}}let P=y=>{h.current=null,y.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},N=y=>y?T=>{let D=h.current??(h.current=T.currentTarget.getBoundingClientRect());D.width&&y((T.clientX-D.left)/D.width*t.width,(T.clientY-D.top)/D.height*t.height,T)}:void 0,I=N(e.onPointerMove),L=N(e.onPointerDown),_=I||L?y=>{y.pointerType==="touch"&&I?.(y),L?.(y)}:void 0,A=N(e.onPointerUp),M=ar(e.theme);return(0,H.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":c,"aria-describedby":i,tabIndex:s?0:void 0,onKeyDown:s?m:void 0,onBlur:y=>{t.via==="keyboard"&&!y.currentTarget.contains(y.relatedTarget)&&t.setActive(null)},onPointerLeave:P,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"),...M,...e.style},children:[t.pending?null:e.underlay,(0,H.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:I,onPointerDown:_,onPointerUp:A,onPointerCancel:A,style:{fontFamily:"inherit",touchAction:"pan-y",position:e.underlay?"relative":void 0},children:[(0,H.jsx)("title",{id:o,children:c}),(0,H.jsx)("desc",{id:i,children:a||t.description!==void 0?e.description:e.emptyText??t.t.empty}),e.defs&&!t.pending?(0,H.jsx)("defs",{children:e.defs}):null,t.pending?null:e.children]}),t.pending?null:e.overlay,k?(0,H.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:C,children:F??(0,H.jsxs)(H.Fragment,{children:[(0,H.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,T)=>(0,H.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,justifyContent:"space-between"},children:[(0,H.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:7,color:t.p.paint(y.strong?"ink":"muted")},children:[y.color?(0,H.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,H.jsx)("span",{style:{fontWeight:y.strong===!1?500:700},children:y.value})]},T))]})}):null,(0,H.jsx)("span",{className:"ztd-sr",style:wt,"aria-live":"polite","aria-atomic":"true",children:g}),s&&!t.pending?u:null]})}function oa({label:e,events:t,t:n}){return(0,H.jsx)("div",{className:"ztd-sr",style:wt,children:(0,H.jsxs)("table",{children:[(0,H.jsx)("caption",{children:n.table(e)}),(0,H.jsxs)("tbody",{children:[t.slice(0,kt).map((r,o)=>(0,H.jsxs)("tr",{children:[(0,H.jsx)("th",{scope:"row",children:r.series?`${r.label} · ${r.series}`:r.label}),(0,H.jsx)("td",{children:r.formatted??r.value??""})]},o)),t.length>kt?(0,H.jsx)("tr",{children:(0,H.jsx)("td",{colSpan:2,children:n.more(t.length-kt)})}):null]})]})})}function De(e){let t=e.baseline??"central";return(0,H.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}),ce=p("label","string",!0,"Item name field"),Q=p("value","number",!0,"Value field"),aa=[ce,Q],ia=[ce,Q],sa=[p("label","string",!0,"Stage name"),p("value","number",!0,"Users at the stage")],la=[ce,Q],ca=[p("label","string",!0,"Leaf (lowest level) name"),Q,p("group","string",!1,"Parent group field")],ua=[p("label","string",!0,"Leaf name"),Q,p("group","string",!1,"Parent group field")],ma=[ce,p("value","number",!0,"Change (total rows may omit it)"),p("type","string",!1,'"total" makes a total bar')],da=[ce,Q],fa=[p("x","string",!0,"Column field"),p("series","string",!0,"Stacked series field"),Q],ha=[p("x","string",!0,"Column field"),p("y","string",!0,"Row field"),Q],ga=[p("axis","string",!0,"Metric (axis) field"),p("value","number",!0,"Value field",{multi:!0}),p("series","string",!1,"Series field")],pa=[p("x","number",!0,"x value"),p("y","number",!0,"y value"),p("size","number",!1,"Circle size"),p("label","string",!1,"Name")],ur=p("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),ba=[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}),ur],ya=[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}),ur],xa=[p("x","any",!0,"x field"),p("y","number",!0,"y field",{multi:!0}),p("series","string",!1,"Series field")],ka=[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})],wa=[ce,Q],$a=[p("value","number",!0,"Value field",{prop:"valueKey"}),p("target","number",!1,"Target field",{prop:"targetKey"})],va=[ce,p("value","number",!0,"Actual value field"),p("target","number",!1,"Target field")],Ma=[p("x","any",!1,"x field"),p("y","number",!0,"y field")],Ta=[ce,p("x","string",!1,"Period field (long tables)"),p("value","number",!1,"Value field (long tables)")],Ca=[ce,p("start","number",!0,"Before value"),p("end","number",!0,"After value")],Sa=[ce,Q],Aa=[p("value","number",!0,"Value field"),p("group","string",!1,"Group (row) field"),p("label","string",!1,"Dot name")],Na=[p("group","string",!0,"Group field"),p("value","number",!0,"Value field")],Ra=[p("source","string",!0,"Source node"),p("target","string",!0,"Target node"),Q],Fa=[p("source","string",!0,"Sending group"),p("target","string",!0,"Receiving group"),Q],_a=[p("date","date",!0,"Date field"),Q],Pa=[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)")],Da=[p("group","string",!0,"Group field"),p("value","number",!0,"Value field")],La=[p("label","string",!1,"Row name field")],Ea=[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")],Oa=[ce,Q],Ia=[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})],za=[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)")],Ba=[p("region","string",!0,"Region name or code, matched to a tile of options.map"),Q],Ha=[ce,Q,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")],ja=[p("source","string",!0,"Source node"),p("target","string",!0,"Target node"),p("value","number",!1,"Link weight. Without it every row counts 1")],Ga=[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")],Va=[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")],Wa=[p("region","string",!0,"Region name or code, matched to a region of options.map"),Q],Ka=[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)")],Ua=[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")],Xa=[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")],cr={pie:aa,donut:ia,funnel:sa,waffle:la,treemap:ca,sunburst:ua,waterfall:ma,pareto:da,marimekko:fa,heatmap:ha,radar:ga,bubble:pa,line:ba,area:ya,stream:xa,bar:ka,radialBar:wa,gauge:$a,bullet:va,sparkline:Ma,slope:Ta,dumbbell:Ca,lollipop:Sa,beeswarm:Aa,ridgeline:Na,sankey:Ra,chord:Fa,calendar:_a,bump:Pa,box:Da,parallel:La,candlestick:Ea,segmented:Oa,skyline:Ia,histogram:za,scatter:Xa,tileMap:Ba,barRace:Ha,network:ja,timeline:Ga,tree:Va,choropleth:Wa,symbolMap:Ka,flowMap:Ua},je={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 mr(e,t){return t==="ko"?e.nameKo:e.name}function dr(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var fr=["line","area","bar","scatter"],hr=24,en=["line","area","bar","scatter","timeline"];function tn(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"&&n.layout!=="diverging"?[].concat(t.line??[]).map(String):[]}function gr(e,t,n){return en.includes(e)&&!tn(e,t,n).length&&!(e==="scatter"&&$t(n))}function $t(e){return!!e&&typeof e=="object"&&e.bin==="hex"}function pr(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var Ya={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 vt(e){let t=cr[e]?e:Ya[e]??Object.keys(je).find(n=>n.toLowerCase()===e.toLowerCase()||je[n].component.toLowerCase()===e.toLowerCase());if(!(!t||!je[t]))return{type:t,component:je[t].component,name:je[t].name,nameKo:je[t].nameKo,encoding:cr[t]}}function br(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 vt(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 yr(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function Ja(e,t){if(e==null||typeof e!="object")return;let n=e;if(yr(n,t))return n[t];if(t.includes(".")){let r=n;for(let o of t.split(".")){if(r===null||typeof r!="object"||!yr(r,o))return;r=r[o]}return r}}function Me(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 Le(e,t){if(typeof e=="function")return e;let n=e??t;return r=>Ja(r,n)}function Ge(e,t){let n=Le(e,t);return(r,o)=>Me(n(r,o))}function pe(e,t){let n=Le(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 be(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}function qa(e){let t=[],n=!1;for(let l=0;l<e.length&&l<4e3;l++){let c=e[l];if(c==='"')n=!n;else if(!n&&(c===`
|
|
23
|
+
`||c==="\r"))break;t.push(n?"":c)}let r=t.join(""),o=l=>r.split(l).length-1,i=[","," ",";","|"],a=",",s=0;for(let l of i){let c=o(l);c>s&&(s=c,a=l)}return a}var Za=/^[-+(]?[₩$€£¥]?\s?\d[\d,]*(\.\d+)?([eE][-+]?\d+)?\)?\s?(%|원|명|건|개|회)?$/;function xr(e){let t=e.trim();if(t==="")return null;if(/^-?0\d/.test(t))return t;if(Za.test(t)||/^[-+]?\.\d+$/.test(t)){let n=Me(t);if(Number.isFinite(n))return n}return t}function Ee(e,t={}){let{typed:n=!0,header:r=!0}=t,o=e.replace(/^\uFEFF/,"");if(!o.trim())return[];let i=t.delimiter??qa(o),a=[],s=[],l="",c=!1;for(let f=0;f<o.length;f++){let b=o[f];c?b==='"'?o[f+1]==='"'?(l+='"',f++):c=!1:l+=b:b==='"'&&!l.trim()?(c=!0,l=""):b===i?(s.push(l),l=""):b===`
|
|
24
24
|
`||b==="\r"?(b==="\r"&&o[f+1]===`
|
|
25
|
-
`&&f++,s.push(l),i.push(s),s=[],l=""):l+=b}(l!==""||s.length)&&(s.push(l),i.push(s));let d=i.filter(f=>!(f.length===1&&f[0].trim()===""));if(!d.length)return[];let u=f=>n?xr(f):f;if(!r)return d.map(f=>Object.fromEntries(f.map((b,$)=>[String($),u(b)])));let h=[],m=new Set;return d[0].forEach((f,b)=>{let $=f.trim()||`col${b+1}`,x=$;for(let k=2;m.has(x);k++)x=`${$}_${k}`;m.add(x),h.push(x)}),d.slice(1).map(f=>Object.fromEntries(h.map((b,$)=>[b,u(f[$]??"")])))}function nn(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,l)=>[s,r&&typeof i[l]=="string"?xr(i[l]):i[l]??null])))}function Qi(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,l)=>Object.fromEntries(a.map(c=>[c,e[c][l]??null])))}return Object.entries(e).map(([a,i])=>({[n]:a,[r]:i}))}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 Re(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return Re(JSON.parse(t))}catch{}return Ee(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)?Re(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)?Re(t.rows):Array.isArray(t.values)?nn(t.values):Array.isArray(t.items)?Re(t.items):Array.isArray(t.results)?Re(t.results):Qi(t)}return[]}function Tt(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 rn(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=(l,c)=>{let d=e[l][c];return Number.isFinite(d)&&d>0?d:0},s=new Array(r).fill(0);if(t==="wiggle"&&n>0&&r>1){let l=0;for(let c=1;c<r;c++){let d=0,u=0;for(let h=0;h<n;h++){let m=i(h,c),f=m-i(h,c-1),b=0;for(let $=0;$<h;$++)b+=i($,c)-i($,c-1);d+=m,u+=(f/2+b)*m}d&&(l-=u/d),s[c]=l}}for(let l=0;l<r;l++){if(t==="zero"){let u=0,h=0;for(let m=0;m<n;m++){let f=e[m][l],b=Number.isFinite(f)?f:0;b>=0?(o[m][l]=u,u+=b,a[m][l]=u):(o[m][l]=h,h+=b,a[m][l]=h)}continue}let c=0;for(let u=0;u<n;u++)c+=i(u,l);let d=t==="silhouette"?-c/2:s[l];for(let u=0;u<n;u++){let h=i(u,l);t==="expand"&&(h=c?h/c*100:0),o[u][l]=d,d+=h,a[u][l]=d}}if(t==="wiggle"&&r){let l=1/0,c=-1/0;for(let u=0;u<r;u++)l=Math.min(l,o[0]?.[u]??0),c=Math.max(c,a[n-1]?.[u]??0);let d=0;for(let u=0;u<r;u++)d+=((o[0]?.[u]??0)+(a[n-1]?.[u]??0))/2;d/=r;for(let u=0;u<n;u++)for(let h=0;h<r;h++)o[u][h]-=d,a[u][h]-=d}return{y0:o,y1:a}}function wr(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 vr(e){let t=e.length,n=e.map(c=>{let d=0,u=-1/0;return c.forEach((h,m)=>{h>u&&(u=h,d=m)}),d}),r=e.map(c=>c.reduce((d,u)=>d+(Number.isFinite(u)?u:0),0)),o=Array.from({length:t},(c,d)=>d).sort((c,d)=>n[c]-n[d]),a=[],i=[],s=0,l=0;for(let c of o)s<l?(a.push(c),s+=r[c]):(i.push(c),l+=r[c]);return[...i.reverse(),...a]}var Ve=Math.PI*2;function on(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function B(e){return Math.round(e*100)/100}function Me(e,t,n,r){return[e+n*Math.sin(r),t-n*Math.cos(r)]}function an(e,t,n,r,o,a){let i=a-o;if(!(Math.abs(i)>1e-4)||r<=0)return"";if(Math.abs(i)>=Ve-1e-4){let k=(w,F)=>{let[g,C]=Me(e,t,w,o),[P,N]=Me(e,t,w,o+Math.PI);return`M${B(g)},${B(C)}A${B(w)},${B(w)} 0 1 ${F} ${B(P)},${B(N)}A${B(w)},${B(w)} 0 1 ${F} ${B(g)},${B(C)}Z`};return n>0?`${k(r,1)}${k(n,0)}`:k(r,1)}let l=i>0?1:0,c=Math.abs(i)>Math.PI?1:0,[d,u]=Me(e,t,r,o),[h,m]=Me(e,t,r,a);if(n<=0)return`M${B(e)},${B(t)}L${B(d)},${B(u)}A${B(r)},${B(r)} 0 ${c} ${l} ${B(h)},${B(m)}Z`;let[f,b]=Me(e,t,n,a),[$,x]=Me(e,t,n,o);return`M${B(d)},${B(u)}A${B(r)},${B(r)} 0 ${c} ${l} ${B(h)},${B(m)}L${B(f)},${B(b)}A${B(n)},${B(n)} 0 ${c} ${1-l} ${B($)},${B(x)}Z`}function $r(e){let t=-1,n=-1/0;return e.forEach((r,o)=>{r>n&&(n=r,t=o)}),t}function Mr(e){return e>=44032&&e<=55203||e>=4352&&e<=4607||e>=12592&&e<=12687||e>=19968&&e<=40959}function Tr(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 Mt=new Map;function ye(e,t,n=400){let r=String(e),o=`${r}|${n>=600?1:0}`,a=Mt.get(o);if(a===void 0){let i=0,s=0;for(let l=0;l<r.length;l++){let c=r.charCodeAt(l);Mr(c)?i+=Tr(c):s+=Tr(c)}a=i+s*(n>=600?1.07:1),Mt.size>5e3&&Mt.clear(),Mt.set(o,a)}return a*t}function Ze(e,t,n,r=400){if(e=e.trim(),ye(e,n,r)<=t)return e;let o="…",a=0,i=e.length;for(;a<i;){let l=a+i+1>>1;ye(e.slice(0,l)+o,n,r)<=t?a=l:i=l-1}a>0&&(e.charCodeAt(a-1)&64512)===55296&&a--;let s=e.slice(0,a).trimEnd();return s.length<(Mr(s.charCodeAt(0))?2:3)?"":s+o}function Cr(e,t,n=-1/0,r=1/0){let o=e.map((s,l)=>({y:s,i:l})).sort((s,l)=>s.y-l.y),a=new Array(e.length),i=o.map(s=>Math.max(n,Math.min(r,s.y)));for(let s=0;s<30;s++){let l=!1;for(let c=1;c<i.length;c++){let d=i[c]-i[c-1];if(d<t){let u=(t-d)/2;i[c-1]-=u,i[c]+=u,l=!0}}for(let c=0;c<i.length;c++)i[c]=Math.max(n,Math.min(r,i[c]));if(!l)break}for(let s=1;s<i.length;s++)i[s]-i[s-1]<t&&(i[s]=i[s-1]+t);if(i.length&&i[i.length-1]>r){let s=i[i.length-1]-r;for(let l=0;l<i.length;l++)i[l]-=s}return o.forEach((s,l)=>{a[s.i]=i[l]}),a}var Ar=R(O(),1),ea=e=>Array.isArray(e)&&e.length===2;function Sr(e){let t=[];for(let n of e??[])n.type==="line"&&typeof n.y=="number"?t.push(n.y):n.type==="band"&&ea(n.y)&&t.push(Number(n.y[0]),Number(n.y[1]));return t.filter(Number.isFinite)}var Rr=R(O(),1),sn=10.5;function ta(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=>He(i,{locale:n,maximumFractionDigits:a}))}function Nr(e,t,n){let r=18;for(let o of ta(e,t,n))r=Math.max(r,ye(o,sn));return Math.ceil(r+8)}function ln(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 We(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,l=ln(i,n),c=[o,a];for(let d=0;d<4;d++){let u=Math.ceil(a/l-1e-9)*l,h=Math.floor(o/l+1e-9)*l;c=[o===0?0:o-h<=l*.3?h:o-i*s,a===0?0:u-a<=l*.3?u:a+i*s];let m=ln(c[1]-c[0],n);if(m===l)break;l=m}return c}function Fr(e,t,n=4){let r=Math.min(e,t),o=Math.max(e,t),a=ln(o-r,n),i=[],s=Math.ceil(r/a-1e-9)*a;for(let l=s,c=0;l<=o+a*1e-9&&c<200;l+=a,c++)i.push(Number((Math.round(l/a)*a).toPrecision(12)));return i}function cn(e,t){let[n,r]=e,[o,a]=t,i=r===n?0:(a-o)/(r-n),s=(l=>o+(l-n)*i);return s.domain=e,s.range=t,s.invert=l=>i===0?n:n+(l-o)/i,s.ticks=(l=4)=>Fr(n,r,l),s}function un(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]=We(r,o,Math.max(n,Math.ceil(o-r)),{zero:!1});return[10**a,10**i]}function na(e,t,n){let r=Math.log10(e),o=Math.log10(t),a=n/Math.max(1e-9,o-r),i=(c,d=1)=>{let u=[];for(let h=Math.floor(r);h<=Math.ceil(o);h++)if(!(h%d))for(let m of c){let f=Number((m*10**h).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 l=i([1,2,3,4,5,6,7,8,9]);return l.length>=2?l:Fr(e,t,3)}function _r(e,t){let n=cn([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=()=>na(e[0],e[1],Math.abs(t[1]-t[0])),r}function Qe(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 ra=864e5;function Pr(e,t,n,r=oe){let o=t-e;if(!(o>0))return[{t:e,label:qe(e,{locale:r,month:"short",day:"numeric"})}];let a=o/ra,i=[],s=new Date(e),l=new Date(e).getFullYear()===new Date(t).getFullYear(),c=(d,u,h,m=!1)=>{let f=new Date(d),b=-1,$=0;for(;f.getTime()<=t&&$++<500;){if(f.getTime()>=e){let x=f.getFullYear(),k=m&&!l&&x!==b;i.push({t:f.getTime(),label:qe(f,{locale:r,...h,...k?{year:"numeric"}:{}})}),b=x}u(f)}};if(a<=1.5){let d=Math.max(1,Math.ceil(o/36e5/Math.max(1,n))),u=[1,2,3,4,6,12].find(m=>m>=d)??12,h=new Date(s);h.setMinutes(0,0,0),c(h,m=>m.setHours(m.getHours()+u),{hour:"numeric"})}else if(a<=n*1.2){let d=new Date(s.getFullYear(),s.getMonth(),s.getDate());c(d,u=>u.setDate(u.getDate()+1),{month:"numeric",day:"numeric"})}else if(a<=n*7*1.2){let d=new Date(s.getFullYear(),s.getMonth(),s.getDate());d.setDate(d.getDate()+(8-d.getDay())%7),c(d,u=>u.setDate(u.getDate()+7),{month:"numeric",day:"numeric"})}else{let d=a/30.44,u=Math.max(1,Math.ceil(d/Math.max(1,n))),h=[1,2,3,6,12,24,60].find(m=>m>=u)??120;if(h>=12){let m=new Date(s.getFullYear()+(s.getMonth()>0||s.getDate()>1?1:0),0,1);c(m,f=>f.setFullYear(f.getFullYear()+h/12),{year:"numeric"})}else{let m=new Date(s.getFullYear(),s.getMonth()+(s.getDate()>1?1:0),1),f=m.getMonth()%h;f&&m.setMonth(m.getMonth()+(h-f)),c(m,b=>b.setMonth(b.getMonth()+h),{month:"short"},!0)}}return i}function Dr(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 l=o(i);return l>=0?(r[l]||(a[l]=t(l),r[l]=1),a[l]):Reflect.get(a,i,s)},has(a,i){return o(i)>=0||Reflect.has(a,i)}})}var oa=(e,t,n)=>e==="date"?gt(t,n)?.getTime()??NaN:Te(t);function ia(e){let t=e.filter(n=>n!=null&&n!=="");return t.length?t.every(n=>n instanceof Date)||t.every(n=>typeof n=="string"&&tr(n.trim()))?"date":t.every(n=>typeof n=="number"||typeof n=="string"&&/^-?\d+(\.\d+)?$/.test(n.trim()))?"number":"band":"band"}function et(e,t,n,r,o={}){let a=Le(t,"x"),i=Array.isArray(n),s=i?n:null,l=i?null:Le(n,"y"),c=!i&&r!==void 0?Le(r,"series"):null,d=e.map((T,y)=>a(T,y)),u=o.xType??ia(d),h=o.locale??oe,m,f,b;if(u==="band"){let T=d.map(M=>String(M??""));m=be(T);let y=new Map(m.map((M,D)=>[M,D]));f=m.map((M,D)=>D),b=Int32Array.from(T,M=>y.get(M)??-1)}else{let T=u==="date"?o.dayFirst??nr(d):void 0,y=d.map(z=>oa(u,z,T)),M=Array.from(new Set(y.filter(z=>Number.isFinite(z)))).sort((z,ie)=>z-ie),D=new Map(M.map((z,ie)=>[z,ie]));f=M,m=M.map(String),b=Int32Array.from(y,z=>D.get(z)??-1)}let $=o.dateFormat,x=T=>typeof T=="string"?ht(T.trim())?.[3]:void 0,k=u==="date"&&d.length<5e3?x(d[0]):void 0,w=(k===2||k===3)&&d.every(T=>x(T)===k),F=w&&k===3;if(u==="date"&&!$){let T=f.length>1?f[f.length-1]-f[0]:0;$=w&&k===2||T>864e5*120?{month:"short"}:T<864e5*2?{month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit"}:{month:"numeric",day:"numeric"},T>864e5*800&&($={year:"numeric",month:"short"})}let g;if(u==="band")g=m;else if(F&&!o.dateFormat){let T=V(h)==="ko";g=f.map(y=>{let M=new Date(y),D=Math.floor(M.getMonth()/3)+1;return T?`${M.getFullYear()}년 ${D}분기`:`Q${D} ${M.getFullYear()}`})}else{let T=f.every(Xt),y=u==="date"?new Intl.DateTimeFormat(h,$):new Intl.NumberFormat(h,T?{useGrouping:!1}:{maximumFractionDigits:6});g=f.length>1e3?Dr(f.length,M=>y.format(f[M])):f.map(M=>y.format(M))}let C=s?[...s]:c?be(e.map((T,y)=>String(c(T,y)??""))):[""],P=new Map(C.map((T,y)=>[T,y])),N=C.map(()=>new Array(m.length).fill(NaN)),I=C.map(()=>new Array(m.length).fill(null)),L=o.aggregate??"sum",_=L==="mean"?C.map(()=>new Uint32Array(m.length)):null,A=(T,y,M,D)=>{let z=N[T][y];L==="last"?N[T][y]=M:L==="count"?N[T][y]=(Number.isFinite(z)?z:0)+1:L==="mean"?Number.isFinite(M)&&(N[T][y]=(Number.isFinite(z)?z:0)+M,_[T][y]++):N[T][y]=Number.isFinite(z)?z+(Number.isFinite(M)?M:0):M,I[T][y]=D};for(let T=0;T<e.length;T++){let y=b[T];if(y<0)continue;let M=e[T];if(s)for(let D=0;D<s.length;D++)A(D,y,Te(M[s[D]]),M);else{let D=c?P.get(String(c(M,T)??""))??0:0;A(D,y,Te(l(M,T)),M)}}if(_)for(let T=0;T<N.length;T++)for(let y=0;y<m.length;y++)_[T][y]>1&&(N[T][y]/=_[T][y]);return{type:u,keys:m,xnum:f,labels:g,series:C,values:N,rows:I}}var aa=140,nt=12,Lr=14,mn=20,Er=12.5;function sa(e,t,n=hr){let r=pe(t,t),o=new Map;e.forEach((i,s)=>{let l=r(i,s),c=o.get(l);c?c.push(i):o.set(l,[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 la(e,t,n){if(t<1)return 1;let r=Math.max(1,Math.floor((e+nt)/(aa+nt))),o=Math.max(1,Math.min(r,Number.isInteger(n)&&n>=1?n:r,t));return Math.ceil(t/Math.ceil(t/o))}function ca(e,t,n){let r=Math.max(40,Math.floor((e-(t-1)*nt)/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 tt=e=>e.filter(Number.isFinite);function Ct(e,t){let n=[];for(let r of Array.isArray(t)?t:t===void 0?[]:[t]){let o=Ge(r,String(r));e.forEach((a,i)=>n.push(o(a,i)))}return tt(n)}function Or(e,t,n,r,o,a){return et(t,n.x,r,o,{xType:e==="bar"?"band":n.xType,aggregate:a,dayFirst:n.dayFirst})}function ua(e,t,n,r,o,a){let i=Math.max(2,Math.round(a/70)),s=r.yScale==="log"&&(e==="line"||e==="scatter"),l=r.yDomain,c=l&&(!s||l[0]>0&&l[1]>0)?l:void 0;if(e==="scatter"){let g=t.flat(),C=r.refLines??{},[P,N]=Qe([...Ct(g,r.x??"x"),...tt([Number(C.x)])]),[I,L]=Qe([...Ct(g,r.y??"y"),...tt([Number(C.y)])].filter(A=>!s||A>0)),_=r.zero??!1;return{y:c??(s?un(I,L,i):We(I,L,i,{zero:_,pad:.08})),x:r.xDomain??We(P,N,Math.max(2,Math.round(o/110)),{zero:_,pad:.06}),sameKeys:!0}}let d=e==="bar",u=d&&r.orientation==="horizontal",h=n[0]?.keys.join(""),m=n.every(g=>g.keys.join("")===h),f=n.length>0&&n.every(g=>g.type!=="band"&&g.type===n[0].type),b=r.xDomain??(!d&&f?Qe(n.flatMap(g=>tt(g.xnum))):void 0),$=d?r.layout??"grouped":e==="area"?r.stack??"auto":"none";if($==="percent")return{x:b,sameKeys:m};if(c)return{y:c,x:b,sameKeys:m};let x=[];t.forEach((g,C)=>{let P=n[C];if($==="stacked"||$==="auto"&&P.series.length>1){let I=rn(P.values,"zero");I.y0.forEach(L=>x.push(...L)),I.y1.forEach(L=>x.push(...L))}else P.values.forEach(I=>x.push(...I));d&&!u&&r.line!==void 0&&Or(e,g,r,[].concat(r.line),void 0,r.series===void 0?r.aggregate:"mean").values.forEach(I=>x.push(...I)),d||x.push(...Ct(g,r.lower),...Ct(g,r.upper))}),d&&x.push(0),u||x.push(...Sr(r.annotations));for(let g of r.referenceLines??[])x.push(g.y);r.signColors&&x.push(Number(r.baseline??0));let[k,w]=Qe(tt(x).filter(g=>!s||g>0));return{y:s?un(k,w,i):d?We(k,w,u?Math.max(2,Math.round(o/120)):i):We(k,w,i,{zero:r.zero??e==="area"}),x:b,sameKeys:m}}function ma(e,t,n,r,o,a,i,s){if(e!=="line"&&e!=="area"||!o.x||!o.y)return;let l=et(t.flat(),r.x,r.y,void 0,{xType:r.xType,locale:s,dayFirst:r.dayFirst}),c=(r.yScale==="log"&&e==="line"?_r:cn)(o.y,[i-22,10]).ticks(Math.max(2,Math.round(i/70))),d=Nr(c,qn(r.format,s,Math.max(Math.abs(o.y[0]),Math.abs(o.y[1]))),s),u=n.flatMap(g=>g.series),h=r.endLabels??n.some(g=>g.series.length>1),m=d+6,f=a-(h?Math.min(a*.28,Math.max(...u.map(g=>ye(g,11,700)),20)+14):10),b=l.keys.length,[$,x]=o.x[1]===o.x[0]?[o.x[0],o.x[0]+1]:o.x,k=l.type==="number"?b>12:b>Pr($,x,Math.max(2,Math.floor((f-m)/64)),s).length;if(l.type==="band"||!b||k)return;let w=g=>m+(l.xnum[g]-$)/(x-$)*(f-m),F=g=>ye(l.labels[g],sn);for(let g=1;;g++){let C=Array.from({length:Math.ceil(b/g)},(P,N)=>N*g);if(g>=b||C.every((P,N)=>!N||w(P)-w(C[N-1])>=(F(P)+F(C[N-1]))/2+8))return C.map(P=>({value:l.xnum[P],label:l.labels[P]}))}}function da(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 fa(e,t,n,r){let o=[n.x,n.y,n.series].map(a=>JSON.stringify(a??null)).join("|");return`ztd-facet-${da(`${e}|${t}|${o}|${Tt(r)}`)}`}function ha(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 ga={en:{intro:(e,t)=>`${Ie(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:"(빈 값)"}},dn=18;function Ir(e){let{type:t,chartProps:n}=e,{values:r,groups:o,dropped:a}=sa(e.data,e.by),i=r.length,s=typeof e.width=="number"&&Number.isFinite(e.width)&&e.width>0?e.width:480,l=la(s,i,e.columns),{pw:c,ph:d}=ca(s,l,e.height),u=e.scale!=="free",h=t==="scatter"?[]:o.map(_=>Or(t,_,n,n.y,n.series,n.aggregate)),m=u?ua(t,o,h,n,c,d):{sameKeys:!1},f=u?ma(t,o,h,n,m,c,d,e.locale):void 0,b=t==="bar"&&n.orientation==="horizontal",$=u&&(!b||m.sameKeys),x=u&&(b||m.x!==void 0||m.sameKeys),k=new Set(ha(e.highlight,r)?[e.highlight].flat():[]),w=k.size>0,F=t==="bar"&&!Array.isArray(n.y)&&n.series===void 0||t==="scatter"&&n.series===void 0,g=e.syncId??fa(t,e.by,n,e.data),C=ft(Pe(n.format,e.locale),n.unit),P=ga[e.lang],N=[],I=r.map(_=>_===""?P.blank:_);return{panels:r.map((_,A)=>{let T=o[A],y=I[A],M=A%l,D;if(t!=="scatter"){let ie=h[A],we=me=>ie.values.reduce((ve,at)=>ve+(Number.isFinite(at[me])?at[me]:0),0),j=ie.keys.map((me,ve)=>ve).filter(me=>ie.values.some(ve=>Number.isFinite(ve[me]))),ae=j[j.length-1];N.push({first:j.length?we(j[0]):NaN,last:j.length?we(ae):NaN,total:j.reduce((me,ve)=>me+we(ve),0)}),t!=="bar"&&ie.series.length===1&&ae!==void 0&&(D=C(ie.values[0][ae]))}else N.push({first:NaN,last:NaN,total:T.length});let z={data:T,width:c,height:d,ariaLabel:e.title?`${e.title}, ${y}`:y,syncId:g,highlight:w?k.has(_)?F?()=>!0:void 0:"none":e.highlight,showYAxis:!$||M===0,showXAxis:!x||A+l>=i};return m.y&&(z.yDomain=m.y),m.x&&(z.xDomain=m.x),f&&(z.xTicks=f),{value:_,label:y,props:z,last:D,isPicked:k.has(_)}}),cols:l,pw:c,ph:d,isPanelPick:w,description:pa(t,e.by,I,N,a,C,P)}}function pa(e,t,n,r,o,a,i){let s=i.intro(n.length,t),l=c=>$r(r.map(d=>d[c]));if(e==="line"||e==="area"){let c=l("last");c>=0&&(s+=i.endHigh(n[c],a(r[c].last)));let d=n.filter((u,h)=>r[h].last<r[h].first);s+=d.length?i.falling(`${d.slice(0,5).join(", ")}${d.length>5?i.more:""}`):i.noneFalling}else{let c=l("total");c>=0&&(s+=e==="bar"?i.total(n[c],a(r[c].total)):i.points(n[c],r[c].total))}return o&&(s+=i.dropped(n.length,n.length+o)),s}var le=R(U(),1);function ba(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function ya(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 St={threshold:.25,enoughPx:96,rootMargin:"0px"};function Hr(e,t=!0){let[n,r]=(0,le.useState)({visible:!t,near:!t});return(0,le.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=ya(i[i.length-1],St.threshold,St.enoughPx);r(l=>l.visible===s?l:{...l,visible:s,near:l.near||s})},{threshold:ba(St.threshold),rootMargin:St.rootMargin}),a=new IntersectionObserver(i=>{let s=i[i.length-1];r(l=>l.near===s.isIntersecting?l:{...l,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 zr(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function At(e){let[t,n]=(0,le.useState)(null),[r,o]=(0,le.useState)(e??null),a=(0,le.useCallback)(i=>{n(i),i&&e===void 0&&o(zr(i))},[e]);return $e(()=>{if(e!==void 0){o(e);return}if(!t)return;let i=c=>o(d=>d!==null&&Math.abs(d-c)<.5?d:c),s=()=>i(zr(t));if(typeof ResizeObserver>"u")return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s);let l=new ResizeObserver(c=>{let d=c[c.length-1]?.contentRect;d?i(d.width>0?Math.round(d.width*10)/10:0):s()});return l.observe(t),()=>l.disconnect()},[t,e]),[t,a,r]}var xa=()=>()=>{};function Ke(){return(0,le.useSyncExternalStore)(xa,()=>!0,()=>!1)}var Br="(prefers-reduced-motion: reduce)";function Nt(e="auto"){let[t,n]=(0,le.useState)(()=>de&&typeof window.matchMedia=="function"?window.matchMedia(Br).matches:!1);return(0,le.useEffect)(()=>{if(e!=="auto"||!de||typeof window.matchMedia!="function")return;let r=window.matchMedia(Br),o=()=>n(r.matches);return o(),r.addEventListener?.("change",o),()=>r.removeEventListener?.("change",o)},[e]),e===!0?!0:e===!1?!1:t}var xe=R(O(),1),ka=60,wa=420;function jr(e){let t=ge(),n=e.chartProps??{},[,r,o]=At(e.width),a=e.width??(o||480),i=re(e.locale??n.locale),s=V(i),l=(0,Ue.useContext)(Oe),c=e.title??l,d=e.chart.facetPlan,u=(0,Ue.useMemo)(()=>{let x=Ir({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:c,locale:i,lang:s});return d?d(x,n,i):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,a,e.height,c,i,s,d]),h=`${(0,Ue.useId)().replace(/:/g,"")}fd`,m=Nt(n.reducedMotion??"auto"),f=Ke(),b=Ln({motion:{enabled:n.animate!==!1&&!m&&de},hydrated:f},{waiting:!1,generation:0}),$=e.chart;return(0,xe.jsxs)("div",{ref:r,role:"group","aria-label":c,"aria-describedby":h,className:e.className,style:{position:"relative",width:"100%",...e.style},children:[(0,xe.jsx)("p",{id:h,style:wt,children:e.description??u.description}),(0,xe.jsx)("div",{style:{display:"grid",gridTemplateColumns:`repeat(${u.cols}, minmax(0, 1fr))`,columnGap:nt,rowGap:Lr,...u.legend?{marginTop:dn}:null},children:u.panels.map((x,k)=>{let w=t.paint(x.isPicked?"accentText":u.isPanelPick?"muted":"ink");return(0,xe.jsxs)("div",{"data-facet":x.value,style:{minWidth:0,...Dn(b,!1,"fade",k*ka,wa)},children:[(0,xe.jsxs)("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,height:mn,fontSize:Er,fontWeight:700,lineHeight:`${mn}px`,color:w},children:[(0,xe.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:x.label}),x.last!==void 0?(0,xe.jsx)("span",{style:{flex:"none",fontVariantNumeric:"tabular-nums"},children:x.last}):null]}),(0,xe.jsx)($,{...n,...x.props})]},x.value)})}),u.legend?(0,xe.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",top:0,right:0,height:dn},children:u.legend}):null]})}var Gr=["max","min","first","last","none"];function ke(e,t,n,r,o="max"){let a=new Set,i=n.length,s=c=>{if(i&&c!=="none"){if(c==="first")a.add(0);else if(c==="last")a.add(i-1);else if(c==="max"||c==="min"){let d=-1,u=c==="max"?-1/0:1/0;r.forEach((h,m)=>{Number.isFinite(h)&&(c==="max"?h>u:h<u)&&(u=h,d=m)}),d>=0&&a.add(d)}}};if(e==null)return s(o),a;if(typeof e=="function")return t.forEach((c,d)=>{d<i&&c!==null&&c!==void 0&&e(c,d)&&a.add(d)}),a;let l=Array.isArray(e)?e:[e];for(let c of l)typeof c=="number"?c>=0&&c<i&&a.add(c):c==="max"||c==="min"||c==="first"||c==="last"||c==="none"?s(c):n.forEach((d,u)=>{d===c&&a.add(u)});return a}var ue=R(U(),1);async function va(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 Ee(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 Ee(a);let i=a.trim();return i.startsWith("{")||i.startsWith("[")?JSON.parse(i):Ee(a)}async function $a(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 va(a,t.parse,o,t.locale)}return t.select&&(r=kr(r,t.select)),t.transform?t.transform(r):Re(r)}function Vr(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:o=!0}=t,[a,i]=(0,ue.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,l]=(0,ue.useState)(0),c=re(t.locale),d=(0,ue.useRef)(t);d.current={...t,locale:c};let u=(0,ue.useRef)(e);u.current=e;let h=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",m=t.deps??[],f=JSON.stringify(m.map(x=>typeof x=="object"?JSON.stringify(x):String(x))),b=(0,ue.useRef)(!1);(0,ue.useEffect)(()=>{let x=u.current;if(!x||!r){i(F=>F.status==="loading"?{...F,status:"idle"}:F);return}let k=new AbortController,w=!0;return b.current=!0,i(F=>({...F,data:o?F.data:[],status:"loading",error:null})),$a(x,{...d.current,signal:k.signal}).then(F=>{w&&i({data:F,status:"success",error:null,updatedAt:Date.now()})}).catch(F=>{!w||k.signal.aborted||i(g=>({...g,status:"error",error:F instanceof Error?F:new Error(String(F))}))}).finally(()=>{w&&(b.current=!1)}),()=>{w=!1,b.current=!1,k.abort()}},[h,r,s,f,o]),(0,ue.useEffect)(()=>{if(!n||!r)return;let x=setInterval(()=>{b.current||l(k=>k+1)},n);return()=>clearInterval(x)},[n,r]);let $=(0,ue.useCallback)(()=>l(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:$}}var hn=R(O(),1),Ta=["csv","svg","png"],Ma=/^[=+\-@\t\r\n=+-@]/,Ca=/var\(|color-mix\(/;function Wr(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?Zn(e.getTime()):String(e);return`"${(Ma.test(t)&&!Number.isFinite(Te(t))?`'${t}`:t).replace(/"/g,'""')}"`}function Sa(e){return[...new Set(e.slice(0,200).flatMap(t=>t&&typeof t=="object"?Object.keys(t):[]))]}function Aa(e,t){return`\uFEFF${[t.map(Wr),...e.map(r=>t.map(o=>Wr(r[o])))].map(r=>r.join(",")).join(`\r
|
|
25
|
+
`&&f++,s.push(l),a.push(s),s=[],l=""):l+=b}(l!==""||s.length)&&(s.push(l),a.push(s));let d=a.filter(f=>!(f.length===1&&f[0].trim()===""));if(!d.length)return[];let u=f=>n?xr(f):f;if(!r)return d.map(f=>Object.fromEntries(f.map((b,v)=>[String(v),u(b)])));let h=[],m=new Set;return d[0].forEach((f,b)=>{let v=f.trim()||`col${b+1}`,x=v;for(let k=2;m.has(x);k++)x=`${v}_${k}`;m.add(x),h.push(x)}),d.slice(1).map(f=>Object.fromEntries(h.map((b,v)=>[b,u(f[v]??"")])))}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,l)=>[s,r&&typeof a[l]=="string"?xr(a[l]):a[l]??null])))}function Qa(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,l)=>Object.fromEntries(i.map(c=>[c,e[c][l]??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 Re(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return Re(JSON.parse(t))}catch{}return Ee(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)?Re(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)?Re(t.rows):Array.isArray(t.values)?nn(t.values):Array.isArray(t.items)?Re(t.items):Array.isArray(t.results)?Re(t.results):Qa(t)}return[]}function Mt(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=(l,c)=>{let d=e[l][c];return Number.isFinite(d)&&d>0?d:0},s=new Array(r).fill(0);if(t==="wiggle"&&n>0&&r>1){let l=0;for(let c=1;c<r;c++){let d=0,u=0;for(let h=0;h<n;h++){let m=a(h,c),f=m-a(h,c-1),b=0;for(let v=0;v<h;v++)b+=a(v,c)-a(v,c-1);d+=m,u+=(f/2+b)*m}d&&(l-=u/d),s[c]=l}}for(let l=0;l<r;l++){if(t==="zero"){let u=0,h=0;for(let m=0;m<n;m++){let f=e[m][l],b=Number.isFinite(f)?f:0;b>=0?(o[m][l]=u,u+=b,i[m][l]=u):(o[m][l]=h,h+=b,i[m][l]=h)}continue}let c=0;for(let u=0;u<n;u++)c+=a(u,l);let d=t==="silhouette"?-c/2:s[l];for(let u=0;u<n;u++){let h=a(u,l);t==="expand"&&(h=c?h/c*100:0),o[u][l]=d,d+=h,i[u][l]=d}}if(t==="wiggle"&&r){let l=1/0,c=-1/0;for(let u=0;u<r;u++)l=Math.min(l,o[0]?.[u]??0),c=Math.max(c,i[n-1]?.[u]??0);let d=0;for(let u=0;u<r;u++)d+=((o[0]?.[u]??0)+(i[n-1]?.[u]??0))/2;d/=r;for(let u=0;u<n;u++)for(let h=0;h<r;h++)o[u][h]-=d,i[u][h]-=d}return{y0:o,y1:i}}function wr(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 $r(e){let t=e.length,n=e.map(c=>{let d=0,u=-1/0;return c.forEach((h,m)=>{h>u&&(u=h,d=m)}),d}),r=e.map(c=>c.reduce((d,u)=>d+(Number.isFinite(u)?u:0),0)),o=Array.from({length:t},(c,d)=>d).sort((c,d)=>n[c]-n[d]),i=[],a=[],s=0,l=0;for(let c of o)s<l?(i.push(c),s+=r[c]):(a.push(c),l+=r[c]);return[...a.reverse(),...i]}var Ve=Math.PI*2;function on(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function B(e){return Math.round(e*100)/100}function Te(e,t,n,r){return[e+n*Math.sin(r),t-n*Math.cos(r)]}function an(e,t,n,r,o,i){let a=i-o;if(!(Math.abs(a)>1e-4)||r<=0)return"";if(Math.abs(a)>=Ve-1e-4){let k=(w,F)=>{let[g,C]=Te(e,t,w,o),[P,N]=Te(e,t,w,o+Math.PI);return`M${B(g)},${B(C)}A${B(w)},${B(w)} 0 1 ${F} ${B(P)},${B(N)}A${B(w)},${B(w)} 0 1 ${F} ${B(g)},${B(C)}Z`};return n>0?`${k(r,1)}${k(n,0)}`:k(r,1)}let l=a>0?1:0,c=Math.abs(a)>Math.PI?1:0,[d,u]=Te(e,t,r,o),[h,m]=Te(e,t,r,i);if(n<=0)return`M${B(e)},${B(t)}L${B(d)},${B(u)}A${B(r)},${B(r)} 0 ${c} ${l} ${B(h)},${B(m)}Z`;let[f,b]=Te(e,t,n,i),[v,x]=Te(e,t,n,o);return`M${B(d)},${B(u)}A${B(r)},${B(r)} 0 ${c} ${l} ${B(h)},${B(m)}L${B(f)},${B(b)}A${B(n)},${B(n)} 0 ${c} ${1-l} ${B(v)},${B(x)}Z`}function vr(e){let t=-1,n=-1/0;return e.forEach((r,o)=>{r>n&&(n=r,t=o)}),t}function Tr(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 Tt=new Map;function ye(e,t,n=400){let r=String(e),o=`${r}|${n>=600?1:0}`,i=Tt.get(o);if(i===void 0){let a=0,s=0;for(let l=0;l<r.length;l++){let c=r.charCodeAt(l);Tr(c)?a+=Mr(c):s+=Mr(c)}i=a+s*(n>=600?1.07:1),Tt.size>5e3&&Tt.clear(),Tt.set(o,i)}return i*t}function Ze(e,t,n,r=400){if(e=e.trim(),ye(e,n,r)<=t)return e;let o="…",i=0,a=e.length;for(;i<a;){let l=i+a+1>>1;ye(e.slice(0,l)+o,n,r)<=t?i=l:a=l-1}i>0&&(e.charCodeAt(i-1)&64512)===55296&&i--;let s=e.slice(0,i).trimEnd();return s.length<(Tr(s.charCodeAt(0))?2:3)?"":s+o}function Cr(e,t,n=-1/0,r=1/0){let o=e.map((s,l)=>({y:s,i:l})).sort((s,l)=>s.y-l.y),i=new Array(e.length),a=o.map(s=>Math.max(n,Math.min(r,s.y)));for(let s=0;s<30;s++){let l=!1;for(let c=1;c<a.length;c++){let d=a[c]-a[c-1];if(d<t){let u=(t-d)/2;a[c-1]-=u,a[c]+=u,l=!0}}for(let c=0;c<a.length;c++)a[c]=Math.max(n,Math.min(r,a[c]));if(!l)break}for(let s=1;s<a.length;s++)a[s]-a[s-1]<t&&(a[s]=a[s-1]+t);if(a.length&&a[a.length-1]>r){let s=a[a.length-1]-r;for(let l=0;l<a.length;l++)a[l]-=s}return o.forEach((s,l)=>{i[s.i]=a[l]}),i}var Ar=R(O(),1),ei=e=>Array.isArray(e)&&e.length===2;function Sr(e){let t=[];for(let n of e??[])n.type==="line"&&typeof n.y=="number"?t.push(n.y):n.type==="band"&&ei(n.y)&&t.push(Number(n.y[0]),Number(n.y[1]));return t.filter(Number.isFinite)}var Rr=R(O(),1),sn=10.5;function ti(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=>He(a,{locale:n,maximumFractionDigits:i}))}function Nr(e,t,n){let r=18;for(let o of ti(e,t,n))r=Math.max(r,ye(o,sn));return Math.ceil(r+8)}function ln(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 We(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,l=ln(a,n),c=[o,i];for(let d=0;d<4;d++){let u=Math.ceil(i/l-1e-9)*l,h=Math.floor(o/l+1e-9)*l;c=[o===0?0:o-h<=l*.3?h:o-a*s,i===0?0:u-i<=l*.3?u:i+a*s];let m=ln(c[1]-c[0],n);if(m===l)break;l=m}return c}function Fr(e,t,n=4){let r=Math.min(e,t),o=Math.max(e,t),i=ln(o-r,n),a=[],s=Math.ceil(r/i-1e-9)*i;for(let l=s,c=0;l<=o+i*1e-9&&c<200;l+=i,c++)a.push(Number((Math.round(l/i)*i).toPrecision(12)));return a}function cn(e,t){let[n,r]=e,[o,i]=t,a=r===n?0:(i-o)/(r-n),s=(l=>o+(l-n)*a);return s.domain=e,s.range=t,s.invert=l=>a===0?n:n+(l-o)/a,s.ticks=(l=4)=>Fr(n,r,l),s}function un(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]=We(r,o,Math.max(n,Math.ceil(o-r)),{zero:!1});return[10**i,10**a]}function ni(e,t,n){let r=Math.log10(e),o=Math.log10(t),i=n/Math.max(1e-9,o-r),a=(c,d=1)=>{let u=[];for(let h=Math.floor(r);h<=Math.ceil(o);h++)if(!(h%d))for(let m of c){let f=Number((m*10**h).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 l=a([1,2,3,4,5,6,7,8,9]);return l.length>=2?l:Fr(e,t,3)}function _r(e,t){let n=cn([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=()=>ni(e[0],e[1],Math.abs(t[1]-t[0])),r}function Qe(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 ri=864e5;function Pr(e,t,n,r=oe){let o=t-e;if(!(o>0))return[{t:e,label:qe(e,{locale:r,month:"short",day:"numeric"})}];let i=o/ri,a=[],s=new Date(e),l=new Date(e).getFullYear()===new Date(t).getFullYear(),c=(d,u,h,m=!1)=>{let f=new Date(d),b=-1,v=0;for(;f.getTime()<=t&&v++<500;){if(f.getTime()>=e){let x=f.getFullYear(),k=m&&!l&&x!==b;a.push({t:f.getTime(),label:qe(f,{locale:r,...h,...k?{year:"numeric"}:{}})}),b=x}u(f)}};if(i<=1.5){let d=Math.max(1,Math.ceil(o/36e5/Math.max(1,n))),u=[1,2,3,4,6,12].find(m=>m>=d)??12,h=new Date(s);h.setMinutes(0,0,0),c(h,m=>m.setHours(m.getHours()+u),{hour:"numeric"})}else if(i<=n*1.2){let d=new Date(s.getFullYear(),s.getMonth(),s.getDate());c(d,u=>u.setDate(u.getDate()+1),{month:"numeric",day:"numeric"})}else if(i<=n*7*1.2){let d=new Date(s.getFullYear(),s.getMonth(),s.getDate());d.setDate(d.getDate()+(8-d.getDay())%7),c(d,u=>u.setDate(u.getDate()+7),{month:"numeric",day:"numeric"})}else{let d=i/30.44,u=Math.max(1,Math.ceil(d/Math.max(1,n))),h=[1,2,3,6,12,24,60].find(m=>m>=u)??120;if(h>=12){let m=new Date(s.getFullYear()+(s.getMonth()>0||s.getDate()>1?1:0),0,1);c(m,f=>f.setFullYear(f.getFullYear()+h/12),{year:"numeric"})}else{let m=new Date(s.getFullYear(),s.getMonth()+(s.getDate()>1?1:0),1),f=m.getMonth()%h;f&&m.setMonth(m.getMonth()+(h-f)),c(m,b=>b.setMonth(b.getMonth()+h),{month:"short"},!0)}}return a}function Dr(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 l=o(a);return l>=0?(r[l]||(i[l]=t(l),r[l]=1),i[l]):Reflect.get(i,a,s)},has(i,a){return o(a)>=0||Reflect.has(i,a)}})}var oi=(e,t,n)=>e==="date"?gt(t,n)?.getTime()??NaN:Me(t);function ai(e){let t=e.filter(n=>n!=null&&n!=="");return t.length?t.every(n=>n instanceof Date)||t.every(n=>typeof n=="string"&&tr(n.trim()))?"date":t.every(n=>typeof n=="number"||typeof n=="string"&&/^-?\d+(\.\d+)?$/.test(n.trim()))?"number":"band":"band"}function et(e,t,n,r,o={}){let i=Le(t,"x"),a=Array.isArray(n),s=a?n:null,l=a?null:Le(n,"y"),c=!a&&r!==void 0?Le(r,"series"):null,d=e.map((M,y)=>i(M,y)),u=o.xType??ai(d),h=o.locale??oe,m,f,b;if(u==="band"){let M=d.map(T=>String(T??""));m=be(M);let y=new Map(m.map((T,D)=>[T,D]));f=m.map((T,D)=>D),b=Int32Array.from(M,T=>y.get(T)??-1)}else{let M=u==="date"?o.dayFirst??nr(d):void 0,y=d.map(z=>oi(u,z,M)),T=Array.from(new Set(y.filter(z=>Number.isFinite(z)))).sort((z,ae)=>z-ae),D=new Map(T.map((z,ae)=>[z,ae]));f=T,m=T.map(String),b=Int32Array.from(y,z=>D.get(z)??-1)}let v=o.dateFormat,x=M=>typeof M=="string"?ht(M.trim())?.[3]:void 0,k=u==="date"&&d.length<5e3?x(d[0]):void 0,w=(k===2||k===3)&&d.every(M=>x(M)===k),F=w&&k===3;if(u==="date"&&!v){let M=f.length>1?f[f.length-1]-f[0]:0;v=w&&k===2||M>864e5*120?{month:"short"}:M<864e5*2?{month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit"}:{month:"numeric",day:"numeric"},M>864e5*800&&(v={year:"numeric",month:"short"})}let g;if(u==="band")g=m;else if(F&&!o.dateFormat){let M=V(h)==="ko";g=f.map(y=>{let T=new Date(y),D=Math.floor(T.getMonth()/3)+1;return M?`${T.getFullYear()}년 ${D}분기`:`Q${D} ${T.getFullYear()}`})}else{let M=f.every(Xt),y=u==="date"?new Intl.DateTimeFormat(h,v):new Intl.NumberFormat(h,M?{useGrouping:!1}:{maximumFractionDigits:6});g=f.length>1e3?Dr(f.length,T=>y.format(f[T])):f.map(T=>y.format(T))}let C=s?[...s]:c?be(e.map((M,y)=>String(c(M,y)??""))):[""],P=new Map(C.map((M,y)=>[M,y])),N=C.map(()=>new Array(m.length).fill(NaN)),I=C.map(()=>new Array(m.length).fill(null)),L=o.aggregate??"sum",_=L==="mean"?C.map(()=>new Uint32Array(m.length)):null,A=(M,y,T,D)=>{let z=N[M][y];L==="last"?N[M][y]=T:L==="count"?N[M][y]=(Number.isFinite(z)?z:0)+1:L==="mean"?Number.isFinite(T)&&(N[M][y]=(Number.isFinite(z)?z:0)+T,_[M][y]++):N[M][y]=Number.isFinite(z)?z+(Number.isFinite(T)?T:0):T,I[M][y]=D};for(let M=0;M<e.length;M++){let y=b[M];if(y<0)continue;let T=e[M];if(s)for(let D=0;D<s.length;D++)A(D,y,Me(T[s[D]]),T);else{let D=c?P.get(String(c(T,M)??""))??0:0;A(D,y,Me(l(T,M)),T)}}if(_)for(let M=0;M<N.length;M++)for(let y=0;y<m.length;y++)_[M][y]>1&&(N[M][y]/=_[M][y]);return{type:u,keys:m,xnum:f,labels:g,series:C,values:N,rows:I}}var ii=140,nt=12,Lr=14,mn=20,Er=12.5;function si(e,t,n=hr){let r=pe(t,t),o=new Map;e.forEach((a,s)=>{let l=r(a,s),c=o.get(l);c?c.push(a):o.set(l,[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 li(e,t,n){if(t<1)return 1;let r=Math.max(1,Math.floor((e+nt)/(ii+nt))),o=Math.max(1,Math.min(r,Number.isInteger(n)&&n>=1?n:r,t));return Math.ceil(t/Math.ceil(t/o))}function ci(e,t,n){let r=Math.max(40,Math.floor((e-(t-1)*nt)/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 tt=e=>e.filter(Number.isFinite);function Ct(e,t){let n=[];for(let r of Array.isArray(t)?t:t===void 0?[]:[t]){let o=Ge(r,String(r));e.forEach((i,a)=>n.push(o(i,a)))}return tt(n)}function Or(e,t,n,r,o,i){return et(t,n.x,r,o,{xType:e==="bar"?"band":n.xType,aggregate:i,dayFirst:n.dayFirst})}function ui(e,t,n,r,o,i){let a=Math.max(2,Math.round(i/70)),s=r.yScale==="log"&&(e==="line"||e==="scatter"),l=r.yDomain,c=l&&(!s||l[0]>0&&l[1]>0)?l:void 0;if(e==="scatter"){let g=t.flat(),C=r.refLines??{},[P,N]=Qe([...Ct(g,r.x??"x"),...tt([Number(C.x)])]),[I,L]=Qe([...Ct(g,r.y??"y"),...tt([Number(C.y)])].filter(A=>!s||A>0)),_=r.zero??!1;return{y:c??(s?un(I,L,a):We(I,L,a,{zero:_,pad:.08})),x:r.xDomain??We(P,N,Math.max(2,Math.round(o/110)),{zero:_,pad:.06}),sameKeys:!0}}let d=e==="bar",u=d&&r.orientation==="horizontal",h=n[0]?.keys.join(""),m=n.every(g=>g.keys.join("")===h),f=n.length>0&&n.every(g=>g.type!=="band"&&g.type===n[0].type),b=r.xDomain??(!d&&f?Qe(n.flatMap(g=>tt(g.xnum))):void 0),v=d?r.layout??"grouped":e==="area"?r.stack??"auto":"none";if(v==="percent")return{x:b,sameKeys:m};if(c)return{y:c,x:b,sameKeys:m};let x=[];t.forEach((g,C)=>{let P=n[C];if(v==="stacked"||v==="auto"&&P.series.length>1){let I=rn(P.values,"zero");I.y0.forEach(L=>x.push(...L)),I.y1.forEach(L=>x.push(...L))}else P.values.forEach(I=>x.push(...I));d&&!u&&r.line!==void 0&&Or(e,g,r,[].concat(r.line),void 0,r.series===void 0?r.aggregate:"mean").values.forEach(I=>x.push(...I)),d||x.push(...Ct(g,r.lower),...Ct(g,r.upper))}),d&&x.push(0),u||x.push(...Sr(r.annotations));for(let g of r.referenceLines??[])x.push(g.y);r.signColors&&x.push(Number(r.baseline??0));let[k,w]=Qe(tt(x).filter(g=>!s||g>0));return{y:s?un(k,w,a):d?We(k,w,u?Math.max(2,Math.round(o/120)):a):We(k,w,a,{zero:r.zero??e==="area"}),x:b,sameKeys:m}}function mi(e,t,n,r,o,i,a,s){if(e!=="line"&&e!=="area"||!o.x||!o.y)return;let l=et(t.flat(),r.x,r.y,void 0,{xType:r.xType,locale:s,dayFirst:r.dayFirst}),c=(r.yScale==="log"&&e==="line"?_r:cn)(o.y,[a-22,10]).ticks(Math.max(2,Math.round(a/70))),d=Nr(c,qn(r.format,s,Math.max(Math.abs(o.y[0]),Math.abs(o.y[1]))),s),u=n.flatMap(g=>g.series),h=r.endLabels??n.some(g=>g.series.length>1),m=d+6,f=i-(h?Math.min(i*.28,Math.max(...u.map(g=>ye(g,11,700)),20)+14):10),b=l.keys.length,[v,x]=o.x[1]===o.x[0]?[o.x[0],o.x[0]+1]:o.x,k=l.type==="number"?b>12:b>Pr(v,x,Math.max(2,Math.floor((f-m)/64)),s).length;if(l.type==="band"||!b||k)return;let w=g=>m+(l.xnum[g]-v)/(x-v)*(f-m),F=g=>ye(l.labels[g],sn);for(let g=1;;g++){let C=Array.from({length:Math.ceil(b/g)},(P,N)=>N*g);if(g>=b||C.every((P,N)=>!N||w(P)-w(C[N-1])>=(F(P)+F(C[N-1]))/2+8))return C.map(P=>({value:l.xnum[P],label:l.labels[P]}))}}function di(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 fi(e,t,n,r){let o=[n.x,n.y,n.series].map(i=>JSON.stringify(i??null)).join("|");return`ztd-facet-${di(`${e}|${t}|${o}|${Mt(r)}`)}`}function hi(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 gi={en:{intro:(e,t)=>`${Ie(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:"(빈 값)"}},dn=18;function Ir(e){let{type:t,chartProps:n}=e,{values:r,groups:o,dropped:i}=si(e.data,e.by),a=r.length,s=typeof e.width=="number"&&Number.isFinite(e.width)&&e.width>0?e.width:480,l=li(s,a,e.columns),{pw:c,ph:d}=ci(s,l,e.height),u=e.scale!=="free",h=t==="scatter"?[]:o.map(_=>Or(t,_,n,n.y,n.series,n.aggregate)),m=u?ui(t,o,h,n,c,d):{sameKeys:!1},f=u?mi(t,o,h,n,m,c,d,e.locale):void 0,b=t==="bar"&&n.orientation==="horizontal",v=u&&(!b||m.sameKeys),x=u&&(b||m.x!==void 0||m.sameKeys),k=new Set(hi(e.highlight,r)?[e.highlight].flat():[]),w=k.size>0,F=t==="bar"&&!Array.isArray(n.y)&&n.series===void 0||t==="scatter"&&n.series===void 0,g=e.syncId??fi(t,e.by,n,e.data),C=ft(Pe(n.format,e.locale),n.unit),P=gi[e.lang],N=[],I=r.map(_=>_===""?P.blank:_);return{panels:r.map((_,A)=>{let M=o[A],y=I[A],T=A%l,D;if(t!=="scatter"){let ae=h[A],we=me=>ae.values.reduce(($e,it)=>$e+(Number.isFinite(it[me])?it[me]:0),0),j=ae.keys.map((me,$e)=>$e).filter(me=>ae.values.some($e=>Number.isFinite($e[me]))),ie=j[j.length-1];N.push({first:j.length?we(j[0]):NaN,last:j.length?we(ie):NaN,total:j.reduce((me,$e)=>me+we($e),0)}),t!=="bar"&&ae.series.length===1&&ie!==void 0&&(D=C(ae.values[0][ie]))}else N.push({first:NaN,last:NaN,total:M.length});let z={data:M,width:c,height:d,ariaLabel:e.title?`${e.title}, ${y}`:y,syncId:g,highlight:w?k.has(_)?F?()=>!0:void 0:"none":e.highlight,showYAxis:!v||T===0,showXAxis:!x||A+l>=a};return m.y&&(z.yDomain=m.y),m.x&&(z.xDomain=m.x),f&&(z.xTicks=f),{value:_,label:y,props:z,last:D,isPicked:k.has(_)}}),cols:l,pw:c,ph:d,isPanelPick:w,description:pi(t,e.by,I,N,i,C,P)}}function pi(e,t,n,r,o,i,a){let s=a.intro(n.length,t),l=c=>vr(r.map(d=>d[c]));if(e==="line"||e==="area"){let c=l("last");c>=0&&(s+=a.endHigh(n[c],i(r[c].last)));let d=n.filter((u,h)=>r[h].last<r[h].first);s+=d.length?a.falling(`${d.slice(0,5).join(", ")}${d.length>5?a.more:""}`):a.noneFalling}else{let c=l("total");c>=0&&(s+=e==="bar"?a.total(n[c],i(r[c].total)):a.points(n[c],r[c].total))}return o&&(s+=a.dropped(n.length,n.length+o)),s}var le=R(U(),1);function bi(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function yi(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 St={threshold:.25,enoughPx:96,rootMargin:"0px"};function Hr(e,t=!0){let[n,r]=(0,le.useState)({visible:!t,near:!t});return(0,le.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=yi(a[a.length-1],St.threshold,St.enoughPx);r(l=>l.visible===s?l:{...l,visible:s,near:l.near||s})},{threshold:bi(St.threshold),rootMargin:St.rootMargin}),i=new IntersectionObserver(a=>{let s=a[a.length-1];r(l=>l.near===s.isIntersecting?l:{...l,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 zr(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function At(e){let[t,n]=(0,le.useState)(null),[r,o]=(0,le.useState)(e??null),i=(0,le.useCallback)(a=>{n(a),a&&e===void 0&&o(zr(a))},[e]);return ve(()=>{if(e!==void 0){o(e);return}if(!t)return;let a=c=>o(d=>d!==null&&Math.abs(d-c)<.5?d:c),s=()=>a(zr(t));if(typeof ResizeObserver>"u")return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s);let l=new ResizeObserver(c=>{let d=c[c.length-1]?.contentRect;d?a(d.width>0?Math.round(d.width*10)/10:0):s()});return l.observe(t),()=>l.disconnect()},[t,e]),[t,i,r]}var xi=()=>()=>{};function Ke(){return(0,le.useSyncExternalStore)(xi,()=>!0,()=>!1)}var Br="(prefers-reduced-motion: reduce)";function Nt(e="auto"){let[t,n]=(0,le.useState)(()=>de&&typeof window.matchMedia=="function"?window.matchMedia(Br).matches:!1);return(0,le.useEffect)(()=>{if(e!=="auto"||!de||typeof window.matchMedia!="function")return;let r=window.matchMedia(Br),o=()=>n(r.matches);return o(),r.addEventListener?.("change",o),()=>r.removeEventListener?.("change",o)},[e]),e===!0?!0:e===!1?!1:t}var xe=R(O(),1),ki=60,wi=420;function jr(e){let t=ge(),n=e.chartProps??{},[,r,o]=At(e.width),i=e.width??(o||480),a=re(e.locale??n.locale),s=V(a),l=(0,Ue.useContext)(Oe),c=e.title??l,d=e.chart.facetPlan,u=(0,Ue.useMemo)(()=>{let x=Ir({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:c,locale:a,lang:s});return d?d(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,c,a,s,d]),h=`${(0,Ue.useId)().replace(/:/g,"")}fd`,m=Nt(n.reducedMotion??"auto"),f=Ke(),b=Ln({motion:{enabled:n.animate!==!1&&!m&&de},hydrated:f},{waiting:!1,generation:0}),v=e.chart;return(0,xe.jsxs)("div",{ref:r,role:"group","aria-label":c,"aria-describedby":h,className:e.className,style:{position:"relative",width:"100%",...e.style},children:[(0,xe.jsx)("p",{id:h,style:wt,children:e.description??u.description}),(0,xe.jsx)("div",{style:{display:"grid",gridTemplateColumns:`repeat(${u.cols}, minmax(0, 1fr))`,columnGap:nt,rowGap:Lr,...u.legend?{marginTop:dn}:null},children:u.panels.map((x,k)=>{let w=t.paint(x.isPicked?"accentText":u.isPanelPick?"muted":"ink");return(0,xe.jsxs)("div",{"data-facet":x.value,style:{minWidth:0,...Dn(b,!1,"fade",k*ki,wi)},children:[(0,xe.jsxs)("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,height:mn,fontSize:Er,fontWeight:700,lineHeight:`${mn}px`,color:w},children:[(0,xe.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:x.label}),x.last!==void 0?(0,xe.jsx)("span",{style:{flex:"none",fontVariantNumeric:"tabular-nums"},children:x.last}):null]}),(0,xe.jsx)(v,{...n,...x.props})]},x.value)})}),u.legend?(0,xe.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",top:0,right:0,height:dn},children:u.legend}):null]})}var Gr=["max","min","first","last","none"];function ke(e,t,n,r,o="max"){let i=new Set,a=n.length,s=c=>{if(a&&c!=="none"){if(c==="first")i.add(0);else if(c==="last")i.add(a-1);else if(c==="max"||c==="min"){let d=-1,u=c==="max"?-1/0:1/0;r.forEach((h,m)=>{Number.isFinite(h)&&(c==="max"?h>u:h<u)&&(u=h,d=m)}),d>=0&&i.add(d)}}};if(e==null)return s(o),i;if(typeof e=="function")return t.forEach((c,d)=>{d<a&&c!==null&&c!==void 0&&e(c,d)&&i.add(d)}),i;let l=Array.isArray(e)?e:[e];for(let c of l)typeof c=="number"?c>=0&&c<a&&i.add(c):c==="max"||c==="min"||c==="first"||c==="last"||c==="none"?s(c):n.forEach((d,u)=>{d===c&&i.add(u)});return i}var ue=R(U(),1);async function $i(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(V(r)==="ko"?`데이터 대신 HTML 페이지를 받았어요. 주소를 확인해 주세요${n?`: ${n}`:"."}`:`Got an HTML page instead of data${n?` (${n})`:""}. Check the URL.`);if(t==="csv")return Ee(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 Ee(i);let a=i.trim();return a.startsWith("{")||a.startsWith("[")?JSON.parse(a):Ee(i)}async function vi(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 $i(i,t.parse,o,t.locale)}return t.select&&(r=kr(r,t.select)),t.transform?t.transform(r):Re(r)}function Vr(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:o=!0}=t,[i,a]=(0,ue.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,l]=(0,ue.useState)(0),c=re(t.locale),d=(0,ue.useRef)(t);d.current={...t,locale:c};let u=(0,ue.useRef)(e);u.current=e;let h=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",m=t.deps??[],f=JSON.stringify(m.map(x=>typeof x=="object"?JSON.stringify(x):String(x))),b=(0,ue.useRef)(!1);(0,ue.useEffect)(()=>{let x=u.current;if(!x||!r){a(F=>F.status==="loading"?{...F,status:"idle"}:F);return}let k=new AbortController,w=!0;return b.current=!0,a(F=>({...F,data:o?F.data:[],status:"loading",error:null})),vi(x,{...d.current,signal:k.signal}).then(F=>{w&&a({data:F,status:"success",error:null,updatedAt:Date.now()})}).catch(F=>{!w||k.signal.aborted||a(g=>({...g,status:"error",error:F instanceof Error?F:new Error(String(F))}))}).finally(()=>{w&&(b.current=!1)}),()=>{w=!1,b.current=!1,k.abort()}},[h,r,s,f,o]),(0,ue.useEffect)(()=>{if(!n||!r)return;let x=setInterval(()=>{b.current||l(k=>k+1)},n);return()=>clearInterval(x)},[n,r]);let v=(0,ue.useCallback)(()=>l(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:v}}var hn=R(O(),1),Mi=["csv","svg","png"],Ti=/^[=+\-@\t\r\n=+-@]/,Ci=/var\(|color-mix\(/;function Wr(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?Zn(e.getTime()):String(e);return`"${(Ti.test(t)&&!Number.isFinite(Me(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 Ai(e,t){return`\uFEFF${[t.map(Wr),...e.map(r=>t.map(o=>Wr(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?qe(s,{locale:t,year:"numeric",month:"short",day:"numeric"}):String(s)};return a=>{let i=[];for(let s of r){let l=!1,c=s.replace(er,(d,u)=>o(a,u.trim())??(l=!0,""));l||i.push(c)}return i.length?i.map((s,l)=>(0,Zr.jsx)("div",{children:s},l)):null}}function Qr(e,t,n=!1){let r=pe(t,"group"),o=e.map((s,l)=>r(s,l)).filter(Boolean),a=be(o);if(!n)return a;let i=new Map;for(let s of o)i.set(s,(i.get(s)??0)+1);return a.map((s,l)=>[s,l]).sort((s,l)=>i.get(s[0])-i.get(l[0])||s[1]-l[1]).map(([s])=>s)}function eo(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 Ee(t.csv)}return null}var so=R(U(),1);var Y=R(U(),1);function to(e,t){let n=ge(e.theme),[r,o,a]=At(e.width),i=Ke(),s=e.width??(a||t.ssrWidth||480),l=typeof t.height=="function"?t.height(s):t.height,c=e.height??l,d=Nt(e.reducedMotion??"auto"),u=e.animate!==!1&&!d&&de,h=Hr(r,e.animateOnView!==!1&&u),m=re(e.locale),f=V(m),b=(0,Y.useMemo)(()=>Pe(e.format,m,t.format),[e.format,m,t.format]),$=(0,Y.useCallback)(j=>dt(j,{locale:m}),[m]),x=(0,Y.useMemo)(()=>ft(b,e.unit),[b,e.unit]),k=(0,Y.useMemo)(()=>Tt(e.data),[e.data]),[w,F]=(0,Y.useState)(null),[g,C]=(0,Y.useState)(null),P=(0,Y.useRef)([]),N=(0,Y.useRef)(e.onHover);N.current=e.onHover;let I=(0,Y.useRef)(e.onClick);I.current=e.onClick;let L=(0,Y.useRef)(null),_=(0,Y.useRef)(null),A=(0,Y.useRef)(null),T=(0,Y.useCallback)((j,ae="pointer")=>{if(A.current!==j){A.current=j;let me=j===null?null:P.current[j]??null;queueMicrotask(()=>N.current?.(me)),_.current?.(j)}L.current=j===null?null:ae,F(j),C(L.current)},[]),y=(0,Y.useCallback)(j=>{L.current!=="keyboard"&&(L.current=j===null?null:"sync",F(j),C(L.current))},[]),M=(0,Y.useCallback)(j=>{let ae=P.current[j];ae&&I.current?.(ae)},[]),D=ar(e.replayKey),z=e.width!==void 0||(a??0)>0,ie={enabled:u,active:h.visible&&z,near:h.near,replayKey:D,dataKey:k,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},we=(0,Y.useCallback)((j,ae=1)=>w===null||w===j?ae:ae*.38,[w]);return{p:n,width:s,height:c,measured:z,responsive:e.width===void 0,pending:de&&i&&e.width===void 0&&a===null,node:r,hydrated:i,ref:o,motion:ie,fv:x,fmt:b,pct:$,locale:m,lang:f,t:f==="ko"?On:En,active:w,via:g,setActive:T,click:M,events:P,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:we,sig:k,description:e.description,reduced:d,publish:_,applySync:y}}var X=R(U(),1);function Fa(e){return 1-Math.pow(1-e,3)}function _a(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function Pa(e){return e==="easeInOut"?_a:e==="linear"?t=>t:Fa}function Da(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 Xe(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 Rt(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 no(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 ro(e,t,n,r){if(!t||!n||t.length!==n.length)return Xe(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 l of Xe(s,n[i]))o.push(l)}return o.length===r?o:Xe(e,r)}var Ft=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||!Rt(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),no(n.from,n.vel,n.to),n.cur=n.from.slice(),n.curVel=n.vel.slice(),n.done=Rt(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),l=r>0?Math.min(a*r,240):0;if(s){let c=i.to.length;s.from=ro(s.cur,s.parts,i.parts,c),s.vel=ro(s.curVel,s.parts,i.parts,c),s.parts=i.parts,s.to=i.to.slice(),no(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):l),s.done=Rt(s.from,s.to)&&s.vel.every(d=>Math.abs(d)<1e-6),s.progress=s.done?1:0}else{let c=this.make(i,i.enter??i.from??i.to,n+l,0);c.done=Rt(c.from,c.to),this.tracks.set(i.key,c)}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=Xe(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=Pa(this.easing),o=this.duration/1e3,a=this.omega,i=[];for(let s of this.tracks.values()){if(s.done)continue;let l=(t-s.t0)/1e3,c=s.to.length;if(s.from.length!==c&&(s.from=Xe(s.from,c)),s.vel.length!==c&&(s.vel=Xe(s.vel,c)),s.cur.length!==c&&(s.cur=new Array(c).fill(0),s.curVel=new Array(c).fill(0)),!(l>0)){for(let u=0;u<c;u++)s.cur[u]=s.from[u],s.curVel[u]=0;s.progress=0,n=!0;continue}let d;if(this.easing==="spring"){let u=Math.exp(-a*l),h=a*l>=8&&a*l<20,m=0;for(let f=0;f<c;f++){let b=s.from[f]-s.to[f],$=s.vel[f]+a*b;s.cur[f]=s.to[f]+(b+$*l)*u,s.curVel[f]=(s.vel[f]-a*$*l)*u,h&&m<.15&&(m=Math.max(m,Math.abs(s.cur[f]-s.to[f]),Math.abs(s.curVel[f]/a)))}d=a*l>=20||h&&m<.15,s.progress=Math.min(1,1-(1+a*l)*u)}else{let u=Math.min(1,l/o),h=r(u),m=Da(this.easing,u)/o;for(let f=0;f<c;f++)s.cur[f]=s.from[f]+(s.to[f]-s.from[f])*h,s.curVel[f]=(s.to[f]-s.from[f])*m;d=u>=1,s.progress=h}if(d){for(let u=0;u<c;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}},rt=new Set,_t=0;function oo(e){_t=0;let t=Array.from(rt);for(let n of t){let r;try{r=n(e)}catch{r=!1}r||rt.delete(n)}rt.size&&typeof requestAnimationFrame<"u"&&(_t=requestAnimationFrame(oo))}function io(e){return rt.add(e),!_t&&typeof requestAnimationFrame<"u"&&(_t=requestAnimationFrame(oo)),()=>{rt.delete(e)}}function La(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 ao(e,t){let n=(0,X.useMemo)(()=>La(e),[e]),{enabled:r,active:o,near:a=!0,replayKey:i,dataKey:s,easing:l="spring",duration:c=900,stagger:d=0}=t,u=(0,X.useRef)(null),h=(0,X.useRef)("init"),m=(0,X.useRef)(null),f=(0,X.useRef)(s),b=(0,X.useRef)(i),$=(0,X.useRef)(!1),x=(0,X.useRef)(0),[,k]=(0,X.useState)(0),w=(0,X.useRef)(null),F=(0,X.useRef)(!0);u.current||(u.current=new Ft,u.current.configure(l,c),u.current.snap(n),m.current=n);let g=u.current;if(g.configure(l,c),m.current!==n){let _=h.current,A=!Object.is(f.current,s);g.sameTargets(n)?g.refreshData(n):!r||_==="init"?g.snap(n):_==="idle"?g.hold(n):_==="running"||A?g.update(n,ct(),d):g.snap(n),m.current=n,f.current=s}let C=(0,X.useRef)(()=>!1);C.current=_=>{if(!F.current)return!1;let A=g.step(_);return!A&&h.current==="running"&&(h.current="done"),k(T=>(T+1)%1e9),A||(w.current=null),A};let P=(0,X.useCallback)(()=>{if(!de||w.current||!g.animating)return;let _=A=>C.current(A);w.current=io(_)},[g]);$e(()=>{let _=!Object.is(b.current,i);if(b.current=i,!r){(h.current!=="done"||g.animating)&&(g.snap(m.current??n),h.current="done",k(A=>A+1));return}h.current==="init"||_&&a?(g.hold(m.current??n),h.current="idle",$.current=!1,k(A=>A+1)):_&&($.current=!0)},[r,i]),$e(()=>{!r||!a||!$.current||($.current=!1,g.hold(m.current??n),h.current="idle",k(_=>_+1))},[a,r]),(0,X.useEffect)(()=>{r&&o&&h.current==="idle"&&(g.start(ct()),x.current+=1,h.current="running",P(),k(_=>_+1))},[r,o,i,g,P]),(0,X.useEffect)(()=>{g.animating&&P()}),(0,X.useEffect)(()=>(F.current=!0,()=>{F.current=!1,w.current?.(),w.current=null}),[]);let N=ct(),I=g.elapsed(N),L=r&&h.current==="idle";return{items:g.items(),get:_=>g.get(_),elapsed:L?0:I,fade:(_,A=320)=>L?0:Number.isFinite(I)?Math.max(0,Math.min(1,(I-_)/A)):1,waiting:L,animating:g.animating,generation:x.current}}var gn=R(O(),1);function lo(e,t,n,r,o){if(r)return o==="categorical"?fe(e,t,n):Wn(e,t,n);if(o==="categorical")return fe(e,t,n);let a=J(e,"strong"),i=J(e,"accent");return Array.from({length:t},(s,l)=>n.has(l)?i:a)}var Ea=R(U(),1);var pn=R(O(),1);var co=e=>e?"neutralStrong":"accent";var bn=R(O(),1);function uo(e,t,n,r){if(typeof e!="function")return ke(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 l=o.get(r(i,s));l!==void 0&&e(i,s)&&a.add(l)}),a}var Oa=R(U(),1);var xn=R(O(),1),Ia={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}, ${Ie(n,"candle")}. First open ${r}, last close ${o}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},mo={en:Ia,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}일 이동평균`}},yn=["ink","muted","dim"];function fo(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,yn.length)}var ot=R(U(),1);var q=R(O(),1),za={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${Ie(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},go={en:za,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},kn=(e,t)=>go[e].other(t);function wn(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,on(o.map(a=>a.value)))}}var vn=e=>Number.isFinite(e)&&e>0?e:0;function $n(e,t,n,r){return r==="emphasis"?Vn(e,t,n):fe(e,t,n)}function Ba(e){let{data:t}=e,n=V(re(e.locale));return(0,ot.useMemo)(()=>{let r=pe(e.label,"label"),o=Ge(e.value,"value"),a=t.map((m,f)=>({d:m,i:f,label:r(m,f),value:vn(o(m,f))}));e.sort&&(a=[...a].sort((m,f)=>f.value-m.value));let i=typeof e.label=="string"?e.label:"label",s=typeof e.value=="string"?e.value:"value",{kept:l,other:c}=wn(a,e.other,(m,f)=>{let b=kn(n,m);return{d:{[i]:b,[s]:f},i:-1,label:b,value:f}}),d=c?[...l,c]:l,u=on(d.map(m=>m.value)),h=ke(e.highlight,l.map(m=>m.d),l.map(m=>m.label),l.map(m=>m.value),"max");return{rows:d,total:u,hi:h}},[t,e.label,e.value,e.sort,e.highlight,e.other,n])}function Ha(e){let t=e.inner>0,{rows:n,total:r,hi:o}=Ba(e),a=v=>t?e.legend===void 0||e.legend==="auto"?v>=300?"right":"bottom":e.legend:"none",i=Math.ceil(n.length/2)*20+8,s=to(e,{height:v=>t?Math.max(170,Math.min(240,v*.5))+(a(v)==="bottom"?i:0):Math.max(180,Math.min(260,v*.62)),duration:1e3}),{p:l,width:c,height:d}=s,u=a(c),m=d-(u==="bottom"?i:0),f=Math.min(26,(m-8)/Math.max(1,n.length)),b=u==="right"?Math.min(220,Math.max(140,c*.44)):0,$=c-b,x=t?4:20,k=Math.max(10,Math.min($,m)/2-x),w=k*e.inner,F=e.centerLabel?Math.max(9.5,Math.min(11,11*w*1.6/ye(e.centerLabel,11))):11,g=u==="right"?Math.max(k+x,$/2+6):c/2,C=m/2,P=(e.startAngle??0)*Math.PI/180,N=(0,ot.useMemo)(()=>{let v=$n(l,n.length,o,e.colorMode),E=0;return n.map((G,Z)=>{let W=r>0?G.value/r*Ve:0,K={i:Z,label:G.label,value:G.value,pct:r>0?G.value/r*100:0,a0:E,a1:E+W,sw:v[Z],hi:o.has(Z),datum:G.d};return E+=W,K})},[n,r,o,l,e.colorMode]),I=t?ja(e,N,r):0,L=(0,ot.useMemo)(()=>{let v=N.map(E=>{let G=(E.a0+E.a1)/2;return{key:`s:${E.label}`,to:[E.a0,E.a1],enter:[E.a0,E.a0],exit:[G,G],data:E}});return v.push({key:"__sweep",to:[Ve],from:[0],data:null}),t&&v.push({key:"__center",to:[I],from:[0],data:null}),v},[N,t,I]),_=ao(L,{...s.motion,stagger:0}),A=_.get("__sweep")?.[0]??Ve,T=s.motion.duration??1e3,y=_.items.filter(v=>v.data),M=N.map(v=>({datum:v.datum,index:v.i,key:v.label,label:v.label,value:v.value,formatted:`${s.pct(v.pct)} · ${s.fv(v.value)}`})),D=e.labelMode??(t?"none":"percent"),z=t?(w+k)/2:k*.62,ie=(0,ot.useMemo)(()=>{let v=new Map;if(D==="none"||!s.showLabels)return v;let E=[];N.forEach(K=>{let ee=ho(K,D,s.fv,s.pct),Ce=K.a1-K.a0;if(!(Ce*z>=ye(ee,12.5,700)+10&&Ce>.32)&&K.value>0){let te=P+(K.a0+K.a1)/2,[_e,Ao]=Me(g,C,k+12,te);E.push({i:K.i,x:_e,y:Ao,side:Math.sin(te)>=0?1:-1})}});let G=15,Z=8,W=Math.max(0,Math.floor((m-2*Z)/G)+1);for(let K of[1,-1]){let ee=E.filter(ne=>ne.side===K);if(ee.length>W){let ne=new Set([...ee].sort((te,_e)=>N[_e.i].value-N[te.i].value).slice(0,W).map(te=>te.i));for(let te of ee)ne.has(te.i)||v.set(te.i,null);ee=ee.filter(te=>ne.has(te.i))}let Ce=Cr(ee.map(ne=>ne.y),G,Z,m-Z);ee.forEach((ne,te)=>{let _e=Math.abs(ne.x-g)<14;v.set(ne.i,{x:ne.x,y:Ce[te],anchor:_e?"middle":K>0?"start":"end"})})}return v},[N,D,s.showLabels,z,P,g,C,k,m,s.fv,s.pct]),we=go[s.lang],j=null;if(s.active!==null&&N[s.active]){let v=N[s.active],[E,G]=Me(g,C,k*.9,P+(v.a0+v.a1)/2);j={x:E,y:G,title:v.label,rows:[{label:s.t.value,value:s.fv(v.value),color:v.sw.fill},{label:we.share,value:s.pct(v.pct)}]}}let ae=_.get("__center")?.[0]??0,me=[...N].sort((v,E)=>E.value-v.value),ve=t?we.donut:we.pie,at=e.description??`${ve}. ${we.desc(N.length,s.fv(r),me.slice(0,4).map(v=>`${v.label} ${s.pct(v.pct)}`).join(", "))}`;return(0,q.jsxs)(lr,{c:s,kind:ve,ariaLabel:e.ariaLabel,description:at,events:M,tip:j,renderTip:e.tooltip,className:e.className,style:e.style,theme:e.theme,children:[(0,q.jsxs)("g",{children:[y.map(v=>{let E=v.data,G=P+Math.min(v.v[0],A),Z=P+Math.min(v.v[1],A),W=s.active===E.i,K=(G+Z)/2,ee=W?5:0,Ce=Math.sin(K)*ee,ne=-Math.cos(K)*ee,te=an(g,C,w,k,G,Z);return te?(0,q.jsx)("path",{className:"ztd-mark",d:te,fill:E.sw.fill,stroke:l.paint("panel"),strokeWidth:N.length>1?2:0,strokeLinejoin:"round",opacity:v.exiting?.6:s.dim(E.i),style:{transform:`translate(${Ce}px, ${ne}px)`,transition:"transform .2s ease, opacity .18s ease",cursor:e.onClick?"pointer":void 0},onPointerEnter:_e=>s.setActive(E.i,_e.pointerType==="touch"?"touch":"pointer"),onClick:()=>s.click(E.i)},v.key):null}),s.active!==null&&s.via==="keyboard"&&N[s.active]?(0,q.jsx)("path",{d:an(g,C,Math.max(0,w-2),k+3,P+N[s.active].a0,P+N[s.active].a1),fill:"none",stroke:l.paint("ink"),strokeWidth:2,pointerEvents:"none"}):null]}),D!=="none"&&s.showLabels?(0,q.jsx)("g",{children:N.map(v=>{if(v.value<=0)return null;let E=ho(v,D,s.fv,s.pct),G=P+(v.a0+v.a1)/2,Z=_.fade(T*.35+v.a0/Ve*T*.5,260)*s.dim(v.i),W=ie.get(v.i);if(W===null)return null;if(W)return(0,q.jsx)(De,{x:W.x,y:W.y,anchor:W.anchor,size:12,weight:700,fill:l.paint("ink"),opacity:Z,children:Ze(E,W.anchor==="start"?c-W.x-4:W.anchor==="end"?W.x-4:c,12,700)},v.i);let[K,ee]=Me(g,C,z,G);return(0,q.jsx)(De,{x:K,y:ee,anchor:"middle",size:13,weight:700,fill:v.sw.text,opacity:Z,children:E},v.i)})}):null,t&&e.centerValue!==null?(0,q.jsxs)("g",{opacity:_.fade(0,200),children:[(0,q.jsx)(De,{x:g,y:C-(e.centerLabel?7:0),anchor:"middle",size:Math.max(15,Math.min(26,w*.42)),weight:800,fill:l.paint("ink"),letterSpacing:-.4,children:s.fmt(Math.round(ae))}),e.centerLabel?(0,q.jsx)(De,{x:g,y:C+Math.max(11,Math.min(17,w*.3)),anchor:"middle",size:F,fill:l.paint("muted"),children:Ze(e.centerLabel,w*1.6,F)}):null]}):null,u==="right"||u==="bottom"?(0,q.jsx)("g",{children:N.map((v,E)=>{let G=u==="right",Z=G?b-12:(c-36)/2,W=G?$+8:8+E%2*(Z+20),K=G?C-(N.length-1)*f/2+E*f:m+12+Math.floor(E/2)*20,ee=_.fade(T*.25+E*90,260)*s.dim(v.i),Ce=s.pct(v.pct),ne=Z-14-ye(Ce,12,700)-10;return(0,q.jsxs)("g",{opacity:ee,onPointerEnter:()=>s.setActive(v.i),style:{cursor:"default"},children:[(0,q.jsx)("rect",{x:W,y:K-5,width:10,height:10,rx:2.5,fill:v.sw.fill,stroke:v.sw.role==="soft"||v.sw.role==="neutral"?l.paint("line2"):"none"}),(0,q.jsx)(De,{x:W+16,y:K,size:12,weight:v.hi?700:500,fill:l.paint(v.hi?"ink":"muted"),children:Ze(v.label,ne,12,v.hi?700:500)}),(0,q.jsx)(De,{x:W+Z,y:K,anchor:"end",size:12,weight:v.hi?800:500,fill:l.paint(v.hi?"ink":"muted"),children:Ce})]},v.i)})}):null]})}function ja(e,t,n){let r=e.centerValue;return typeof r=="number"?r:r==="highlight"?t.find(o=>o.hi)?.value??n:n}function ho(e,t,n,r){return t==="value"?n(e.value):t==="label"?e.label:r(e.pct)}function Pt(e){return(0,q.jsx)(Ha,{...e,inner:0})}var Ga=R(U(),1);var xo=R(O(),1);function po(e,t){return t===!1?e.map((n,r)=>r):vr(e)}function bo(e,t,n){let r=n.map(o=>o.reduce((a,i)=>a+(Number.isFinite(i)?i:0),0));return ke(e,t,t,r,"max")}function yo(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]=J(e,"accent"));return o.forEach((a,i)=>r[a]=o.length===1?J(e,"neutral"):mt(e,1-i/Math.max(1,o.length-1))),r}function ko(e){return!e||typeof e!="object"||Array.isArray(e)?[]:be(Object.values(e).filter(t=>typeof t=="string"&&t!==""))}function wo(e,t){return Je(e,t+1,new Set)}var Va=R(U(),1);var $o=R(O(),1);function vo(e,t){let n=typeof e=="string"?[e]:Array.isArray(e)?e:[],r=new Set;for(let o of n)typeof o=="string"&&!Gr.includes(o)&&t.forEach((a,i)=>a===o&&r.add(i));return r}var Se=R(O(),1);function To(e,t,n){let r=$t(e);return r?.type==="scatter"&&t?.size!==void 0&&!vt(n)?$t("bubble"):r}function Ka(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 Ua(e,t,n,r=!1){let o=To(e.type,e.encoding,e.options);if(!o||!t.length)return[];let a=e.encoding??{},i=e.options??{},s=i.highlight,l=new Set(!r&&en.includes(o.type)&&Array.isArray(i.hidden)?i.hidden.map(String):[]),c=u=>u.filter(h=>!l.has(h.label)),d=["pie","donut","waffle"];if(o.type==="donut"&&i.legend!=="none")return[];if(d.includes(o.type)){let u=pe(a.label,"label"),h=Ge(a.value,"value"),m=o.type==="waffle",f=t.map((g,C)=>({r:g,label:u(g,C),value:m?h(g,C):vn(h(g,C))})),{kept:b,other:$}=m?{kept:f,other:null}:wn(f,i.other,(g,C)=>({r:{},label:kn(V(n),g),value:C})),x=ke(s,b.map(g=>g.r),b.map(g=>g.label),b.map(g=>g.value),m?"first":"max"),k=$?[...b,$]:b,w=Ne(g=>m?fe(g,k.length,x):$n(g,k.length,x,i.colorMode)),F=m&&i.shape==="arc";return k.map((g,C)=>({label:g.label,color:w[C],...F&&{shape:"circle"}}))}if(o.type==="candlestick"){let u=fo(Array.isArray(i.ma)?i.ma:void 0,t.length),h=mo[V(n)];return[{label:h.up,color:i.upColor??"accent"},{label:h.down,color:i.downColor??"neutralStrong"},...u.map((m,f)=>({label:h.maLegend(m),color:yn[f],shape:"line"}))]}if(o.type==="network"){let u=ko(i.groups);if(u.length<2)return[];let h=Ne(m=>wo(m,u.length));return u.map((m,f)=>({label:m,color:h[f],shape:"circle"}))}if(o.type==="symbolMap"){if(typeof a.group!="string")return[];let u=pe(a.group,"group"),h=be(t.map((f,b)=>u(f,b)).filter(Boolean));if(h.length<2)return[];let m=Ne(f=>Je(f,h.length,new Set));return h.map((f,b)=>({label:f,color:m[b],shape:"circle"}))}if(o.type==="scatter"){if(typeof a.series!="string"||vt(i))return[];let u=pe(a.series,"series"),h=be(t.map((b,$)=>u(b,$)));if(h.length<2)return[];let m=uo(s,t,h,u),f=Ne(b=>Je(b,h.length,m));return c(h.map((b,$)=>({label:b,color:f[$],shape:"circle"})))}if(o.type==="timeline"){let u=typeof a.group!="string",h=u?a.status:a.group;if(typeof h!="string")return[];let m=Qr(t,h,u),f=Ne(b=>fe(b,m.length,vo(s,m)));return c(m.map((b,$)=>({label:b,color:f[$],shape:"square"})))}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 w=pe(a.series,"series");u=be(t.map((F,g)=>w(F,g)))}let h=tn(o.type,a,i);if(h.length){let w=ke(s,u,u,u.map(()=>0),"none"),F=Ne(C=>fe(C,u.length,w)),g=u.length<2?[{label:String((Array.isArray(a.y)?a.y[0]:a.y)??"y"),color:"neutral"}]:u.map((C,P)=>({label:C,color:F[P]}));return[...c(g),...h.map((C,P)=>({label:C,color:co(P),shape:"line"}))]}if(u.length<2)return[];let f=o.type==="bar"&&i.layout==="diverging"&&s===void 0?wr(u.length,Array.isArray(i.negative)?i.negative.map(w=>u.indexOf(String(w))):[],typeof i.neutral=="string"?u.indexOf(i.neutral):-1):-1,b=f>=0?new Set([f]):ke(s,u,u,u.map(()=>0),"first");if(o.type==="radar")return c(u.map((w,F)=>({label:w,color:b.has(F)?"accent":"neutralStrong",shape:"square"})));let $=i.colorMode,x=w=>fe(w,u.length,b);if((o.type==="line"||o.type==="area")&&(x=w=>lo(w,u.length,b,o.type==="area",$)),o.type==="stream"){let w=et(t,a.x,a.y,a.series,{xType:i.xType,locale:n,aggregate:i.aggregate,dayFirst:i.dayFirst}),F=po(w.values,i.reorder),g=bo(s,w.series,w.values);x=C=>yo(C,F,g)}let k=Ne(x);return c(u.map((w,F)=>({label:w,color:k[F],...o.type==="line"&&{shape:"line"}})))}return[]}function Xa(e,t){let n=e.facet;return n&&typeof n=="object"&&typeof n.by=="string"&&fr.includes(t)&&!(t==="bar"&&e.options?.layout==="diverging")?n:void 0}function Ya(e,t,n){let{data:r,width:o,height:a,highlight:i,syncId:s,ariaLabel:l,description:c,...d}=n;return{type:e,data:r??[],by:t.by,columns:t.columns,scale:t.scale,chartProps:d,width:o,height:a,highlight:i,syncId:s,title:l,description:c}}function Mo(e,t){let{spec:n}=e,r=To(n.type,n.encoding,n.options),o=(0,it.useMemo)(()=>eo(n.data),[n.data]),a=!o&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,i=dr(n,e.locale),s=re(i),l=V(s),c=Vr(a?.url??null,{parse:a?.format??"auto",select:a?.select,init:e.fetchInit,locale:s}),d=pr(n),u=(0,it.useMemo)(()=>d?qr(d,s):void 0,[d,s]),h=n.options?.hidden,m=Array.isArray(h)?h.map(String):[],f=m.join(""),[b,$]=(0,it.useState)(null);if(!r)return(0,Se.jsx)(Qt,{error:l==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:i});let x=o??c.data,k=t[r.type],w={...n.options??{}},F={...Ka(r,n.encoding),...w,...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},g=n.card?.legend==="toggle"&&gr(r.type,n.encoding??{},w),C=b&&b.base===f?b.hidden:m;g&&(F.hidden=C);let P=A=>$(T=>{let y=T&&T.base===f?T.hidden:m;return{base:f,hidden:y.includes(A)?y.filter(M=>M!==A):[...y,A]}}),N=F.height??220,I=Xa(n,r.type),L=a&&!x.length&&(c.loading||c.error||c.empty)?(0,Se.jsx)(Qt,{loading:c.loading,error:c.error,empty:c.empty,onRetry:c.reload,height:N,locale:i}):I?(0,Se.jsx)(jr,{chart:k,...Ya(r.type,I,F)}):(0,Se.jsx)(k,{...F});if(n.card){let A=n.card,T=A.legend==="auto"||A.legend==="toggle"?Ua(n,x,s,g):A.legend,y=T?.length?g?(0,Se.jsx)(Zt,{items:T,hidden:C,onToggle:P,locale:i}):T:void 0,M=A.download?(0,Se.jsx)(Jr,{data:x,columns:br(n),filename:A.title??r.type,formats:Array.isArray(A.download)?A.download:void 0,locale:i}):void 0;L=(0,Se.jsx)(sr,{number:A.number,title:A.title??mr(r,l),subtitle:A.subtitle,legend:y,actions:M,source:A.source||void 0,note:A.note||void 0,accent:A.accent,takeaway:A.takeaway,level:A.level,sample:A.sample,replay:A.replay!==!1,className:e.className,locale:i,children:L})}let _=e.theme??n.theme;return _&&(L=(0,Se.jsx)(bt,{theme:_,children:L})),L}function Ja({cfg:e,components:t}){let n=Ke();return Mo({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function So(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,Tn.createElement)(bt,{theme:o.theme,cssVars:!0},(0,Tn.createElement)(Ja,{cfg:o,components:{[e]:t}})))}So("pie",Pt);})();
|
|
27
|
+
`}function Ni(e){return Array.from((e??"").replace(/[\\/:*?"<>|\r\n\t]+/g,"-").trim()).slice(0,80).join("")||"chart"}function fn(e,t){let n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=t,n.click(),setTimeout(()=>URL.revokeObjectURL(n.href),1e4)}var Kr=2,Fe=16;function Ur(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 Xr(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 Yr(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,l]=[i+Fe*2,a+Fe*2],c=o.cloneNode(!0),d=c.querySelectorAll("*"),u=new Map;o.querySelectorAll("*").forEach((f,b)=>{let v;for(let x of Array.from(f.attributes)){if(!Ci.test(x.value))continue;let k=(v??(v=getComputedStyle(f))).getPropertyValue(x.name);k&&d[b].setAttribute(x.name,Ur(k,u))}}),c.removeAttribute("style");for(let[f,b]of Object.entries({viewBox:`${-Fe} ${-Fe} ${s} ${l}`,width:s*t,height:l*t,"font-family":getComputedStyle(o).fontFamily}))c.setAttribute(f,String(b));let h=Ur(getComputedStyle(r).backgroundColor,u),m=o.parentElement?.querySelector("canvas")??null;if(n){let f=c.querySelector("desc")?.nextSibling??c.firstChild;c.insertBefore(Xr("rect",{x:-Fe,y:-Fe,width:s,height:l,fill:h}),f),m&&c.insertBefore(Xr("image",{href:m.toDataURL(),width:i,height:a}),f)}return{svg:new XMLSerializer().serializeToString(c),w:s,h:l,vw:i,vh:a,bg:h,canvas:m}}function Ri(e,t){let n=Yr(e,Kr,!1);if(!n)return;let r=Kr,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,Fe*r,Fe*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(l=>l&&fn(l,`${t}.png`),"image/png")},s.onerror=()=>URL.revokeObjectURL(a),s.src=a}function Jr(e){let t=ge(e.theme),n=V(re(e.locale))==="ko",r=Ni(e.filename),o=(i,a)=>{if(i==="csv")return fn(new Blob([Ai(e.data,e.columns?.length?e.columns:Si(e.data))],{type:"text/csv;charset=utf-8"}),`${r}.csv`);if(i==="png")return Ri(a,r);let s=Yr(a,1,!0);s&&fn(new Blob([s.svg],{type:"image/svg+xml"}),`${r}.svg`)};return(0,hn.jsx)("span",{style:{display:"inline-flex",gap:6,flex:"none"},children:Mi.filter(i=>!e.formats||e.formats.includes(i)).map(i=>{let a=i.toUpperCase(),s=n?`${a} 내려받기`:`Download ${a}`;return(0,hn.jsx)("button",{type:"button",className:"ztd-btn","aria-label":s,title:s,onClick:l=>o(i,l.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 Zr=R(O(),1);function qr(e,t=oe){let n=Pe(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?qe(s,{locale:t,year:"numeric",month:"short",day:"numeric"}):String(s)};return i=>{let a=[];for(let s of r){let l=!1,c=s.replace(er,(d,u)=>o(i,u.trim())??(l=!0,""));l||a.push(c)}return a.length?a.map((s,l)=>(0,Zr.jsx)("div",{children:s},l)):null}}function Qr(e,t,n=!1){let r=pe(t,"group"),o=e.map((s,l)=>r(s,l)).filter(Boolean),i=be(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,l)=>[s,l]).sort((s,l)=>a.get(s[0])-a.get(l[0])||s[1]-l[1]).map(([s])=>s)}function eo(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 Ee(t.csv)}return null}var so=R(U(),1);var Y=R(U(),1);function to(e,t){let n=ge(e.theme),[r,o,i]=At(e.width),a=Ke(),s=e.width??(i||t.ssrWidth||480),l=typeof t.height=="function"?t.height(s):t.height,c=e.height??l,d=Nt(e.reducedMotion??"auto"),u=e.animate!==!1&&!d&&de,h=Hr(r,e.animateOnView!==!1&&u),m=re(e.locale),f=V(m),b=(0,Y.useMemo)(()=>Pe(e.format,m,t.format),[e.format,m,t.format]),v=(0,Y.useCallback)(j=>dt(j,{locale:m}),[m]),x=(0,Y.useMemo)(()=>ft(b,e.unit),[b,e.unit]),k=(0,Y.useMemo)(()=>Mt(e.data),[e.data]),[w,F]=(0,Y.useState)(null),[g,C]=(0,Y.useState)(null),P=(0,Y.useRef)([]),N=(0,Y.useRef)(e.onHover);N.current=e.onHover;let I=(0,Y.useRef)(e.onClick);I.current=e.onClick;let L=(0,Y.useRef)(null),_=(0,Y.useRef)(null),A=(0,Y.useRef)(null),M=(0,Y.useCallback)((j,ie="pointer")=>{if(A.current!==j){A.current=j;let me=j===null?null:P.current[j]??null;queueMicrotask(()=>N.current?.(me)),_.current?.(j)}L.current=j===null?null:ie,F(j),C(L.current)},[]),y=(0,Y.useCallback)(j=>{L.current!=="keyboard"&&(L.current=j===null?null:"sync",F(j),C(L.current))},[]),T=(0,Y.useCallback)(j=>{let ie=P.current[j];ie&&I.current?.(ie)},[]),D=ir(e.replayKey),z=e.width!==void 0||(i??0)>0,ae={enabled:u,active:h.visible&&z,near:h.near,replayKey:D,dataKey:k,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},we=(0,Y.useCallback)((j,ie=1)=>w===null||w===j?ie:ie*.38,[w]);return{p:n,width:s,height:c,measured:z,responsive:e.width===void 0,pending:de&&a&&e.width===void 0&&i===null,node:r,hydrated:a,ref:o,motion:ae,fv:x,fmt:b,pct:v,locale:m,lang:f,t:f==="ko"?On:En,active:w,via:g,setActive:M,click:T,events:P,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:we,sig:k,description:e.description,reduced:d,publish:_,applySync:y}}var X=R(U(),1);function Fi(e){return 1-Math.pow(1-e,3)}function _i(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function Pi(e){return e==="easeInOut"?_i:e==="linear"?t=>t:Fi}function Di(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 Xe(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 Rt(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 no(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 ro(e,t,n,r){if(!t||!n||t.length!==n.length)return Xe(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 l of Xe(s,n[a]))o.push(l)}return o.length===r?o:Xe(e,r)}var Ft=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||!Rt(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),no(n.from,n.vel,n.to),n.cur=n.from.slice(),n.curVel=n.vel.slice(),n.done=Rt(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),l=r>0?Math.min(i*r,240):0;if(s){let c=a.to.length;s.from=ro(s.cur,s.parts,a.parts,c),s.vel=ro(s.curVel,s.parts,a.parts,c),s.parts=a.parts,s.to=a.to.slice(),no(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):l),s.done=Rt(s.from,s.to)&&s.vel.every(d=>Math.abs(d)<1e-6),s.progress=s.done?1:0}else{let c=this.make(a,a.enter??a.from??a.to,n+l,0);c.done=Rt(c.from,c.to),this.tracks.set(a.key,c)}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=Xe(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=Pi(this.easing),o=this.duration/1e3,i=this.omega,a=[];for(let s of this.tracks.values()){if(s.done)continue;let l=(t-s.t0)/1e3,c=s.to.length;if(s.from.length!==c&&(s.from=Xe(s.from,c)),s.vel.length!==c&&(s.vel=Xe(s.vel,c)),s.cur.length!==c&&(s.cur=new Array(c).fill(0),s.curVel=new Array(c).fill(0)),!(l>0)){for(let u=0;u<c;u++)s.cur[u]=s.from[u],s.curVel[u]=0;s.progress=0,n=!0;continue}let d;if(this.easing==="spring"){let u=Math.exp(-i*l),h=i*l>=8&&i*l<20,m=0;for(let f=0;f<c;f++){let b=s.from[f]-s.to[f],v=s.vel[f]+i*b;s.cur[f]=s.to[f]+(b+v*l)*u,s.curVel[f]=(s.vel[f]-i*v*l)*u,h&&m<.15&&(m=Math.max(m,Math.abs(s.cur[f]-s.to[f]),Math.abs(s.curVel[f]/i)))}d=i*l>=20||h&&m<.15,s.progress=Math.min(1,1-(1+i*l)*u)}else{let u=Math.min(1,l/o),h=r(u),m=Di(this.easing,u)/o;for(let f=0;f<c;f++)s.cur[f]=s.from[f]+(s.to[f]-s.from[f])*h,s.curVel[f]=(s.to[f]-s.from[f])*m;d=u>=1,s.progress=h}if(d){for(let u=0;u<c;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}},rt=new Set,_t=0;function oo(e){_t=0;let t=Array.from(rt);for(let n of t){let r;try{r=n(e)}catch{r=!1}r||rt.delete(n)}rt.size&&typeof requestAnimationFrame<"u"&&(_t=requestAnimationFrame(oo))}function ao(e){return rt.add(e),!_t&&typeof requestAnimationFrame<"u"&&(_t=requestAnimationFrame(oo)),()=>{rt.delete(e)}}function Li(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 io(e,t){let n=(0,X.useMemo)(()=>Li(e),[e]),{enabled:r,active:o,near:i=!0,replayKey:a,dataKey:s,easing:l="spring",duration:c=900,stagger:d=0}=t,u=(0,X.useRef)(null),h=(0,X.useRef)("init"),m=(0,X.useRef)(null),f=(0,X.useRef)(s),b=(0,X.useRef)(a),v=(0,X.useRef)(!1),x=(0,X.useRef)(0),[,k]=(0,X.useState)(0),w=(0,X.useRef)(null),F=(0,X.useRef)(!0);u.current||(u.current=new Ft,u.current.configure(l,c),u.current.snap(n),m.current=n);let g=u.current;if(g.configure(l,c),m.current!==n){let _=h.current,A=!Object.is(f.current,s);g.sameTargets(n)?g.refreshData(n):!r||_==="init"?g.snap(n):_==="idle"?g.hold(n):_==="running"||A?g.update(n,ct(),d):g.snap(n),m.current=n,f.current=s}let C=(0,X.useRef)(()=>!1);C.current=_=>{if(!F.current)return!1;let A=g.step(_);return!A&&h.current==="running"&&(h.current="done"),k(M=>(M+1)%1e9),A||(w.current=null),A};let P=(0,X.useCallback)(()=>{if(!de||w.current||!g.animating)return;let _=A=>C.current(A);w.current=ao(_)},[g]);ve(()=>{let _=!Object.is(b.current,a);if(b.current=a,!r){(h.current!=="done"||g.animating)&&(g.snap(m.current??n),h.current="done",k(A=>A+1));return}h.current==="init"||_&&i?(g.hold(m.current??n),h.current="idle",v.current=!1,k(A=>A+1)):_&&(v.current=!0)},[r,a]),ve(()=>{!r||!i||!v.current||(v.current=!1,g.hold(m.current??n),h.current="idle",k(_=>_+1))},[i,r]),(0,X.useEffect)(()=>{r&&o&&h.current==="idle"&&(g.start(ct()),x.current+=1,h.current="running",P(),k(_=>_+1))},[r,o,a,g,P]),(0,X.useEffect)(()=>{g.animating&&P()}),(0,X.useEffect)(()=>(F.current=!0,()=>{F.current=!1,w.current?.(),w.current=null}),[]);let N=ct(),I=g.elapsed(N),L=r&&h.current==="idle";return{items:g.items(),get:_=>g.get(_),elapsed:L?0:I,fade:(_,A=320)=>L?0:Number.isFinite(I)?Math.max(0,Math.min(1,(I-_)/A)):1,waiting:L,animating:g.animating,generation:x.current}}var gn=R(O(),1);function lo(e,t,n,r,o){if(r)return o==="categorical"?fe(e,t,n):Wn(e,t,n);if(o==="categorical")return fe(e,t,n);let i=J(e,"strong"),a=J(e,"accent");return Array.from({length:t},(s,l)=>n.has(l)?a:i)}var Ei=R(U(),1);var pn=R(O(),1);var co=e=>e?"neutralStrong":"accent";var bn=R(O(),1);function uo(e,t,n,r){if(typeof e!="function")return ke(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 l=o.get(r(a,s));l!==void 0&&e(a,s)&&i.add(l)}),i}var Oi=R(U(),1);var xn=R(O(),1),Ii={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}, ${Ie(n,"candle")}. First open ${r}, last close ${o}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},mo={en:Ii,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}일 이동평균`}},yn=["ink","muted","dim"];function fo(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,yn.length)}var ot=R(U(),1);var q=R(O(),1),zi={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${Ie(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},go={en:zi,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},kn=(e,t)=>go[e].other(t);function wn(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,on(o.map(i=>i.value)))}}var $n=e=>Number.isFinite(e)&&e>0?e:0;function vn(e,t,n,r){return r==="emphasis"?Vn(e,t,n):fe(e,t,n)}function Bi(e){let{data:t}=e,n=V(re(e.locale));return(0,ot.useMemo)(()=>{let r=pe(e.label,"label"),o=Ge(e.value,"value"),i=t.map((m,f)=>({d:m,i:f,label:r(m,f),value:$n(o(m,f))}));e.sort&&(i=[...i].sort((m,f)=>f.value-m.value));let a=typeof e.label=="string"?e.label:"label",s=typeof e.value=="string"?e.value:"value",{kept:l,other:c}=wn(i,e.other,(m,f)=>{let b=kn(n,m);return{d:{[a]:b,[s]:f},i:-1,label:b,value:f}}),d=c?[...l,c]:l,u=on(d.map(m=>m.value)),h=ke(e.highlight,l.map(m=>m.d),l.map(m=>m.label),l.map(m=>m.value),"max");return{rows:d,total:u,hi:h}},[t,e.label,e.value,e.sort,e.highlight,e.other,n])}function Hi(e){let t=e.inner>0,{rows:n,total:r,hi:o}=Bi(e),i=$=>t?e.legend===void 0||e.legend==="auto"?$>=300?"right":"bottom":e.legend:"none",a=Math.ceil(n.length/2)*20+8,s=to(e,{height:$=>t?Math.max(170,Math.min(240,$*.5))+(i($)==="bottom"?a:0):Math.max(180,Math.min(260,$*.62)),duration:1e3}),{p:l,width:c,height:d}=s,u=i(c),m=d-(u==="bottom"?a:0),f=Math.min(26,(m-8)/Math.max(1,n.length)),b=u==="right"?Math.min(220,Math.max(140,c*.44)):0,v=c-b,x=t?4:20,k=Math.max(10,Math.min(v,m)/2-x),w=k*e.inner,F=e.centerLabel?Math.max(9.5,Math.min(11,11*w*1.6/ye(e.centerLabel,11))):11,g=u==="right"?Math.max(k+x,v/2+6):c/2,C=m/2,P=(e.startAngle??0)*Math.PI/180,N=(0,ot.useMemo)(()=>{let $=vn(l,n.length,o,e.colorMode),E=0;return n.map((G,Z)=>{let W=r>0?G.value/r*Ve:0,K={i:Z,label:G.label,value:G.value,pct:r>0?G.value/r*100:0,a0:E,a1:E+W,sw:$[Z],hi:o.has(Z),datum:G.d};return E+=W,K})},[n,r,o,l,e.colorMode]),I=t?ji(e,N,r):0,L=(0,ot.useMemo)(()=>{let $=N.map(E=>{let G=(E.a0+E.a1)/2;return{key:`s:${E.label}`,to:[E.a0,E.a1],enter:[E.a0,E.a0],exit:[G,G],data:E}});return $.push({key:"__sweep",to:[Ve],from:[0],data:null}),t&&$.push({key:"__center",to:[I],from:[0],data:null}),$},[N,t,I]),_=io(L,{...s.motion,stagger:0}),A=_.get("__sweep")?.[0]??Ve,M=s.motion.duration??1e3,y=_.items.filter($=>$.data),T=N.map($=>({datum:$.datum,index:$.i,key:$.label,label:$.label,value:$.value,formatted:`${s.pct($.pct)} · ${s.fv($.value)}`})),D=e.labelMode??(t?"none":"percent"),z=t?(w+k)/2:k*.62,ae=(0,ot.useMemo)(()=>{let $=new Map;if(D==="none"||!s.showLabels)return $;let E=[];N.forEach(K=>{let ee=ho(K,D,s.fv,s.pct),Ce=K.a1-K.a0;if(!(Ce*z>=ye(ee,12.5,700)+10&&Ce>.32)&&K.value>0){let te=P+(K.a0+K.a1)/2,[_e,Ao]=Te(g,C,k+12,te);E.push({i:K.i,x:_e,y:Ao,side:Math.sin(te)>=0?1:-1})}});let G=15,Z=8,W=Math.max(0,Math.floor((m-2*Z)/G)+1);for(let K of[1,-1]){let ee=E.filter(ne=>ne.side===K);if(ee.length>W){let ne=new Set([...ee].sort((te,_e)=>N[_e.i].value-N[te.i].value).slice(0,W).map(te=>te.i));for(let te of ee)ne.has(te.i)||$.set(te.i,null);ee=ee.filter(te=>ne.has(te.i))}let Ce=Cr(ee.map(ne=>ne.y),G,Z,m-Z);ee.forEach((ne,te)=>{let _e=Math.abs(ne.x-g)<14;$.set(ne.i,{x:ne.x,y:Ce[te],anchor:_e?"middle":K>0?"start":"end"})})}return $},[N,D,s.showLabels,z,P,g,C,k,m,s.fv,s.pct]),we=go[s.lang],j=null;if(s.active!==null&&N[s.active]){let $=N[s.active],[E,G]=Te(g,C,k*.9,P+($.a0+$.a1)/2);j={x:E,y:G,title:$.label,rows:[{label:s.t.value,value:s.fv($.value),color:$.sw.fill},{label:we.share,value:s.pct($.pct)}]}}let ie=_.get("__center")?.[0]??0,me=[...N].sort(($,E)=>E.value-$.value),$e=t?we.donut:we.pie,it=e.description??`${$e}. ${we.desc(N.length,s.fv(r),me.slice(0,4).map($=>`${$.label} ${s.pct($.pct)}`).join(", "))}`;return(0,q.jsxs)(lr,{c:s,kind:$e,ariaLabel:e.ariaLabel,description:it,events:T,tip:j,renderTip:e.tooltip,className:e.className,style:e.style,theme:e.theme,children:[(0,q.jsxs)("g",{children:[y.map($=>{let E=$.data,G=P+Math.min($.v[0],A),Z=P+Math.min($.v[1],A),W=s.active===E.i,K=(G+Z)/2,ee=W?5:0,Ce=Math.sin(K)*ee,ne=-Math.cos(K)*ee,te=an(g,C,w,k,G,Z);return te?(0,q.jsx)("path",{className:"ztd-mark",d:te,fill:E.sw.fill,stroke:l.paint("panel"),strokeWidth:N.length>1?2:0,strokeLinejoin:"round",opacity:$.exiting?.6:s.dim(E.i),style:{transform:`translate(${Ce}px, ${ne}px)`,transition:"transform .2s ease, opacity .18s ease",cursor:e.onClick?"pointer":void 0},onPointerEnter:_e=>s.setActive(E.i,_e.pointerType==="touch"?"touch":"pointer"),onClick:()=>s.click(E.i)},$.key):null}),s.active!==null&&s.via==="keyboard"&&N[s.active]?(0,q.jsx)("path",{d:an(g,C,Math.max(0,w-2),k+3,P+N[s.active].a0,P+N[s.active].a1),fill:"none",stroke:l.paint("ink"),strokeWidth:2,pointerEvents:"none"}):null]}),D!=="none"&&s.showLabels?(0,q.jsx)("g",{children:N.map($=>{if($.value<=0)return null;let E=ho($,D,s.fv,s.pct),G=P+($.a0+$.a1)/2,Z=_.fade(M*.35+$.a0/Ve*M*.5,260)*s.dim($.i),W=ae.get($.i);if(W===null)return null;if(W)return(0,q.jsx)(De,{x:W.x,y:W.y,anchor:W.anchor,size:12,weight:700,fill:l.paint("ink"),opacity:Z,children:Ze(E,W.anchor==="start"?c-W.x-4:W.anchor==="end"?W.x-4:c,12,700)},$.i);let[K,ee]=Te(g,C,z,G);return(0,q.jsx)(De,{x:K,y:ee,anchor:"middle",size:13,weight:700,fill:$.sw.text,opacity:Z,children:E},$.i)})}):null,t&&e.centerValue!==null?(0,q.jsxs)("g",{opacity:_.fade(0,200),children:[(0,q.jsx)(De,{x:g,y:C-(e.centerLabel?7:0),anchor:"middle",size:Math.max(15,Math.min(26,w*.42)),weight:800,fill:l.paint("ink"),letterSpacing:-.4,children:s.fmt(Math.round(ie))}),e.centerLabel?(0,q.jsx)(De,{x:g,y:C+Math.max(11,Math.min(17,w*.3)),anchor:"middle",size:F,fill:l.paint("muted"),children:Ze(e.centerLabel,w*1.6,F)}):null]}):null,u==="right"||u==="bottom"?(0,q.jsx)("g",{children:N.map(($,E)=>{let G=u==="right",Z=G?b-12:(c-36)/2,W=G?v+8:8+E%2*(Z+20),K=G?C-(N.length-1)*f/2+E*f:m+12+Math.floor(E/2)*20,ee=_.fade(M*.25+E*90,260)*s.dim($.i),Ce=s.pct($.pct),ne=Z-14-ye(Ce,12,700)-10;return(0,q.jsxs)("g",{opacity:ee,onPointerEnter:()=>s.setActive($.i),style:{cursor:"default"},children:[(0,q.jsx)("rect",{x:W,y:K-5,width:10,height:10,rx:2.5,fill:$.sw.fill,stroke:$.sw.role==="soft"||$.sw.role==="neutral"?l.paint("line2"):"none"}),(0,q.jsx)(De,{x:W+16,y:K,size:12,weight:$.hi?700:500,fill:l.paint($.hi?"ink":"muted"),children:Ze($.label,ne,12,$.hi?700:500)}),(0,q.jsx)(De,{x:W+Z,y:K,anchor:"end",size:12,weight:$.hi?800:500,fill:l.paint($.hi?"ink":"muted"),children:Ce})]},$.i)})}):null]})}function ji(e,t,n){let r=e.centerValue;return typeof r=="number"?r:r==="highlight"?t.find(o=>o.hi)?.value??n:n}function ho(e,t,n,r){return t==="value"?n(e.value):t==="label"?e.label:r(e.pct)}function Pt(e){return(0,q.jsx)(Hi,{...e,inner:0})}var Gi=R(U(),1);var xo=R(O(),1);function po(e,t){return t===!1?e.map((n,r)=>r):$r(e)}function bo(e,t,n){let r=n.map(o=>o.reduce((i,a)=>i+(Number.isFinite(a)?a:0),0));return ke(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]=J(e,"accent"));return o.forEach((i,a)=>r[i]=o.length===1?J(e,"neutral"):mt(e,1-a/Math.max(1,o.length-1))),r}function ko(e){return!e||typeof e!="object"||Array.isArray(e)?[]:be(Object.values(e).filter(t=>typeof t=="string"&&t!==""))}function wo(e,t){return Je(e,t+1,new Set)}var Vi=R(U(),1);var vo=R(O(),1);var Wi=26;var vc=Wi*.62;function $o(e,t){let n=typeof e=="string"?[e]:Array.isArray(e)?e:[],r=new Set;for(let o of n)typeof o=="string"&&!Gr.includes(o)&&t.forEach((i,a)=>i===o&&r.add(a));return r}var Se=R(O(),1);function Mo(e,t,n){let r=vt(e);return r?.type==="scatter"&&t?.size!==void 0&&!$t(n)?vt("bubble"):r}function Ui(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 Xi(e,t,n,r=!1){let o=Mo(e.type,e.encoding,e.options);if(!o||!t.length)return[];let i=e.encoding??{},a=e.options??{},s=a.highlight,l=new Set(!r&&en.includes(o.type)&&Array.isArray(a.hidden)?a.hidden.map(String):[]),c=u=>u.filter(h=>!l.has(h.label)),d=["pie","donut","waffle"];if(o.type==="donut"&&a.legend!=="none")return[];if(d.includes(o.type)){let u=pe(i.label,"label"),h=Ge(i.value,"value"),m=o.type==="waffle",f=t.map((g,C)=>({r:g,label:u(g,C),value:m?h(g,C):$n(h(g,C))})),{kept:b,other:v}=m?{kept:f,other:null}:wn(f,a.other,(g,C)=>({r:{},label:kn(V(n),g),value:C})),x=ke(s,b.map(g=>g.r),b.map(g=>g.label),b.map(g=>g.value),m?"first":"max"),k=v?[...b,v]:b,w=Ne(g=>m?fe(g,k.length,x):vn(g,k.length,x,a.colorMode)),F=m&&a.shape==="arc";return k.map((g,C)=>({label:g.label,color:w[C],...F&&{shape:"circle"}}))}if(o.type==="candlestick"){let u=fo(Array.isArray(a.ma)?a.ma:void 0,t.length),h=mo[V(n)];return[{label:h.up,color:a.upColor??"accent"},{label:h.down,color:a.downColor??"neutralStrong"},...u.map((m,f)=>({label:h.maLegend(m),color:yn[f],shape:"line"}))]}if(o.type==="network"){let u=ko(a.groups);if(u.length<2)return[];let h=Ne(m=>wo(m,u.length));return u.map((m,f)=>({label:m,color:h[f],shape:"circle"}))}if(o.type==="symbolMap"){if(typeof i.group!="string")return[];let u=pe(i.group,"group"),h=be(t.map((f,b)=>u(f,b)).filter(Boolean));if(h.length<2)return[];let m=Ne(f=>Je(f,h.length,new Set));return h.map((f,b)=>({label:f,color:m[b],shape:"circle"}))}if(o.type==="scatter"){if(typeof i.series!="string"||$t(a))return[];let u=pe(i.series,"series"),h=be(t.map((b,v)=>u(b,v)));if(h.length<2)return[];let m=uo(s,t,h,u),f=Ne(b=>Je(b,h.length,m));return c(h.map((b,v)=>({label:b,color:f[v],shape:"circle"})))}if(o.type==="timeline"){let u=typeof i.group!="string",h=u?i.status:i.group;if(typeof h!="string")return[];let m=Qr(t,h,u),f=Ne(b=>fe(b,m.length,$o(s,m)));return c(m.map((b,v)=>({label:b,color:f[v],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 w=pe(i.series,"series");u=be(t.map((F,g)=>w(F,g)))}let h=tn(o.type,i,a);if(h.length){let w=ke(s,u,u,u.map(()=>0),"none"),F=Ne(C=>fe(C,u.length,w)),g=u.length<2?[{label:String((Array.isArray(i.y)?i.y[0]:i.y)??"y"),color:"neutral"}]:u.map((C,P)=>({label:C,color:F[P]}));return[...c(g),...h.map((C,P)=>({label:C,color:co(P),shape:"line"}))]}if(u.length<2)return[];let f=o.type==="bar"&&a.layout==="diverging"&&s===void 0?wr(u.length,Array.isArray(a.negative)?a.negative.map(w=>u.indexOf(String(w))):[],typeof a.neutral=="string"?u.indexOf(a.neutral):-1):-1,b=f>=0?new Set([f]):ke(s,u,u,u.map(()=>0),"first");if(o.type==="radar")return c(u.map((w,F)=>({label:w,color:b.has(F)?"accent":"neutralStrong",shape:"square"})));let v=a.colorMode,x=w=>fe(w,u.length,b);if((o.type==="line"||o.type==="area")&&(x=w=>lo(w,u.length,b,o.type==="area",v)),o.type==="stream"){let w=et(t,i.x,i.y,i.series,{xType:a.xType,locale:n,aggregate:a.aggregate,dayFirst:a.dayFirst}),F=po(w.values,a.reorder),g=bo(s,w.series,w.values);x=C=>yo(C,F,g)}let k=Ne(x);return c(u.map((w,F)=>({label:w,color:k[F],...o.type==="line"&&{shape:"line"}})))}return[]}function Yi(e,t){let n=e.facet;return n&&typeof n=="object"&&typeof n.by=="string"&&fr.includes(t)&&!(t==="bar"&&e.options?.layout==="diverging")?n:void 0}function Ji(e,t,n){let{data:r,width:o,height:i,highlight:a,syncId:s,ariaLabel:l,description:c,...d}=n;return{type:e,data:r??[],by:t.by,columns:t.columns,scale:t.scale,chartProps:d,width:o,height:i,highlight:a,syncId:s,title:l,description:c}}function To(e,t){let{spec:n}=e,r=Mo(n.type,n.encoding,n.options),o=(0,at.useMemo)(()=>eo(n.data),[n.data]),i=!o&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,a=dr(n,e.locale),s=re(a),l=V(s),c=Vr(i?.url??null,{parse:i?.format??"auto",select:i?.select,init:e.fetchInit,locale:s}),d=pr(n),u=(0,at.useMemo)(()=>d?qr(d,s):void 0,[d,s]),h=n.options?.hidden,m=Array.isArray(h)?h.map(String):[],f=m.join(""),[b,v]=(0,at.useState)(null);if(!r)return(0,Se.jsx)(Qt,{error:l==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:a});let x=o??c.data,k=t[r.type],w={...n.options??{}},F={...Ui(r,n.encoding),...w,...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},g=n.card?.legend==="toggle"&&gr(r.type,n.encoding??{},w),C=b&&b.base===f?b.hidden:m;g&&(F.hidden=C);let P=A=>v(M=>{let y=M&&M.base===f?M.hidden:m;return{base:f,hidden:y.includes(A)?y.filter(T=>T!==A):[...y,A]}}),N=F.height??220,I=Yi(n,r.type),L=i&&!x.length&&(c.loading||c.error||c.empty)?(0,Se.jsx)(Qt,{loading:c.loading,error:c.error,empty:c.empty,onRetry:c.reload,height:N,locale:a}):I?(0,Se.jsx)(jr,{chart:k,...Ji(r.type,I,F)}):(0,Se.jsx)(k,{...F});if(n.card){let A=n.card,M=A.legend==="auto"||A.legend==="toggle"?Xi(n,x,s,g):A.legend,y=M?.length?g?(0,Se.jsx)(Zt,{items:M,hidden:C,onToggle:P,locale:a}):M:void 0,T=A.download?(0,Se.jsx)(Jr,{data:x,columns:br(n),filename:A.title??r.type,formats:Array.isArray(A.download)?A.download:void 0,locale:a}):void 0;L=(0,Se.jsx)(sr,{number:A.number,title:A.title??mr(r,l),subtitle:A.subtitle,legend:y,actions:T,source:A.source||void 0,note:A.note||void 0,accent:A.accent,takeaway:A.takeaway,level:A.level,sample:A.sample,replay:A.replay!==!1,className:e.className,locale:a,children:L})}let _=e.theme??n.theme;return _&&(L=(0,Se.jsx)(bt,{theme:_,children:L})),L}function qi({cfg:e,components:t}){let n=Ke();return To({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function So(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)(bt,{theme:o.theme,cssVars:!0},(0,Mn.createElement)(qi,{cfg:o,components:{[e]:t}})))}So("pie",Pt);})();
|