ztd-charts-cli 0.11.3 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/api.js +1 -1
- package/dist/{chunk-VUZPZ5FT.js → chunk-LR5X5LI2.js} +53 -29
- package/dist/cli.js +6 -1
- package/dist/client/area.js +6 -6
- package/dist/client/bar.js +9 -9
- package/dist/client/barRace.js +6 -6
- package/dist/client/beeswarm.js +7 -7
- package/dist/client/box.js +9 -9
- package/dist/client/bubble.js +7 -7
- package/dist/client/bullet.js +6 -6
- package/dist/client/bump.js +6 -6
- package/dist/client/calendar.js +10 -10
- package/dist/client/candlestick.js +6 -6
- package/dist/client/chord.js +7 -7
- package/dist/client/choropleth.js +9 -9
- package/dist/client/cohort.js +28 -0
- package/dist/client/donut.js +6 -6
- package/dist/client/dumbbell.js +6 -6
- package/dist/client/flowMap.js +7 -7
- package/dist/client/funnel.js +9 -9
- package/dist/client/gauge.js +6 -6
- package/dist/client/heatmap.js +9 -9
- package/dist/client/histogram.js +6 -6
- package/dist/client/horizon.js +28 -0
- package/dist/client/line.js +6 -6
- package/dist/client/lollipop.js +6 -6
- package/dist/client/marimekko.js +6 -6
- package/dist/client/network.js +9 -9
- package/dist/client/parallel.js +6 -6
- package/dist/client/pareto.js +6 -6
- package/dist/client/pie.js +6 -6
- package/dist/client/radar.js +7 -7
- package/dist/client/radialBar.js +6 -6
- package/dist/client/ridgeline.js +6 -6
- package/dist/client/sankey.js +10 -10
- package/dist/client/scatter.js +10 -10
- package/dist/client/segmented.js +6 -6
- package/dist/client/skyline.js +7 -7
- package/dist/client/slope.js +6 -6
- package/dist/client/sparkTable.js +28 -0
- package/dist/client/sparkline.js +6 -6
- package/dist/client/stream.js +7 -7
- package/dist/client/sunburst.js +7 -7
- package/dist/client/symbolMap.js +7 -7
- package/dist/client/tileMap.js +6 -6
- package/dist/client/timeline.js +9 -9
- package/dist/client/tree.js +6 -6
- package/dist/client/treemap.js +7 -7
- package/dist/client/waffle.js +7 -7
- package/dist/client/waterfall.js +6 -6
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(()=>{var ai=Object.create;var ar=Object.defineProperty;var ii=Object.getOwnPropertyDescriptor;var si=Object.getOwnPropertyNames;var li=Object.getPrototypeOf,ci=Object.prototype.hasOwnProperty;var an=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var ui=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of si(t))!ci.call(e,o)&&o!==n&&ar(e,o,{get:()=>t[o],enumerable:!(r=ii(t,o))||r.enumerable});return e};var C=(e,t,n)=>(n=e!=null?ai(li(e)):{},ui(t||!e||!e.__esModule?ar(n,"default",{value:e,enumerable:!0}):n,e));var K=an((
|
|
1
|
+
(()=>{var ai=Object.create;var ar=Object.defineProperty;var ii=Object.getOwnPropertyDescriptor;var si=Object.getOwnPropertyNames;var li=Object.getPrototypeOf,ci=Object.prototype.hasOwnProperty;var an=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var ui=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of si(t))!ci.call(e,o)&&o!==n&&ar(e,o,{get:()=>t[o],enumerable:!(r=ii(t,o))||r.enumerable});return e};var C=(e,t,n)=>(n=e!=null?ai(li(e)):{},ui(t||!e||!e.__esModule?ar(n,"default",{value:e,enumerable:!0}):n,e));var K=an((Xl,ir)=>{ir.exports=globalThis.__ztdReact.react});var lr=an((Yl,sr)=>{sr.exports=globalThis.__ztdReact["react-dom/client"]});var O=an((cc,Er)=>{Er.exports=globalThis.__ztdReact["react/jsx-runtime"]});var Zn=C(K(),1),ja=C(lr(),1);var ft=C(K(),1);var _t=C(K(),1);var cr=C(K(),1),je=(0,cr.createContext)(void 0);var fr=C(K(),1);var mi=["bg","panel","ink","muted","dim","accent","accentText","onAccent","accent2","accent3","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"],ur='"Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif',mr='"Roboto Mono", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace',Re={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:ur,monoFamily:mr,radius:18,radiusCode:14,radiusMark:4},sn={name:"light",bg:"#FFFFFF",panel:"#FFFFFF",ink:"#14171B",muted:"#5D6570",dim:"#B3B9C2",accent:"#0B8FD8",accentText:"#006DA8",onAccent:"#14171B",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:ur,monoFamily:mr,radius:18,radiusCode:14,radiusMark:4},ln={dark:Re,light:sn};function gt(e){return`--ztd-${e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}`}function cn(e){let t={};for(let n of mi){let r=e[n];typeof r=="string"&&(t[gt(n)]=r)}return e.fontFamily&&(t["--ztd-font"]=e.fontFamily),e.monoFamily&&(t["--ztd-mono"]=e.monoFamily),e.radius!==void 0&&(t["--ztd-radius"]=`${e.radius}px`),e.radiusCode!==void 0&&(t["--ztd-radius-code"]=`${e.radiusCode}px`),e.radiusMark!==void 0&&(t["--ztd-radius-mark"]=`${e.radiusMark}px`),t}function un(e,t){if(!t)return e;let n={...e};for(let r of Object.keys(t)){let o=t[r];o!==void 0&&(n[r]=o)}return n}var di=`
|
|
2
2
|
.ztd-root{position:relative;-webkit-tap-highlight-color:transparent}
|
|
3
3
|
.ztd-root:focus{outline:none}
|
|
4
|
-
.ztd-root:focus-visible{outline:2px solid var(--ztd-accent,${
|
|
4
|
+
.ztd-root:focus-visible{outline:2px solid var(--ztd-accent,${Re.accent});outline-offset:3px;border-radius:6px}
|
|
5
5
|
.ztd-svg{display:block;overflow:visible;user-select:none;-webkit-user-select:none}
|
|
6
6
|
.ztd-mark{transition:opacity .18s ease,fill .18s ease,stroke .18s ease,stroke-width .18s ease}
|
|
7
7
|
.ztd-tip{animation:ztd-fade .14s ease-out;transition:left .2s cubic-bezier(.22,1,.36,1),top .2s cubic-bezier(.22,1,.36,1)}
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
.ztd-still .ztd-tip,.ztd-still .ztd-guide{transition:none;animation:none}
|
|
10
10
|
.ztd-btn{appearance:none;font:inherit;cursor:pointer;transition:background .14s,color .14s,border-color .14s}
|
|
11
11
|
.ztd-btn:focus{outline:none}
|
|
12
|
-
.ztd-btn:focus-visible{outline:2px solid var(--ztd-accent,${
|
|
12
|
+
.ztd-btn:focus-visible{outline:2px solid var(--ztd-accent,${Re.accent});outline-offset:2px}
|
|
13
13
|
.ztd-card{transition:border-color .16s ease}
|
|
14
|
-
.ztd-card:hover{border-color:var(--ztd-dim,${
|
|
14
|
+
.ztd-card:hover{border-color:var(--ztd-dim,${Re.dim})}
|
|
15
15
|
@media (prefers-reduced-motion: reduce){.ztd-mark,.ztd-tip,.ztd-guide,.ztd-btn,.ztd-card{transition:none;animation:none}}
|
|
16
16
|
@keyframes ztd-pop{from{opacity:0;transform:scale(.45)}to{opacity:1;transform:none}}
|
|
17
17
|
@keyframes ztd-fade{from{opacity:0}to{opacity:1}}
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
@keyframes ztd-pulse{0%,100%{opacity:.55}50%{opacity:1}}
|
|
20
20
|
.ztd-skeleton{animation:ztd-pulse 1.4s ease-in-out infinite}
|
|
21
21
|
@media (prefers-reduced-motion: reduce){.ztd-skeleton{animation:none}}
|
|
22
|
-
`;function pt(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 bt(e,t){let[n]=(0,fr.useState)(!e.motion.enabled);return e.motion.enabled&&e.hydrated&&(!n||t.waiting||t.generation>0)}var dr=!1;function nt(){if(dr||typeof document>"u"||(dr=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=di,document.head.appendChild(e)}var yt=C(K(),1),he=typeof window<"u"&&typeof document<"u",$e=he?yt.useLayoutEffect:yt.useEffect;function xt(){return typeof performance<"u"?performance.now():Date.now()}function U(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function ve(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var hr={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},gr={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var fi=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],hi={basic:{bg:"line2",fg:"ink"},intermediate:{bg:"tint",fg:"accentText"},advanced:{bg:"ink",fg:"onInk"}};function gi(e,t){let n=t.trim().toLowerCase();return e.find(r=>r.id===n||r.en.toLowerCase()===n||r.ko===t.trim())}function pi(e){return gi(fi,e)}function pr(e,t){let n=pi(e);return{text:n?n[t]:e,...hi[n?.id??"basic"]}}var br={white:"#ffffff",black:"#000000",transparent:"#00000000"};function Re(e){if(!e)return null;let t=e.trim(),n=/^var\(\s*--[\w-]+\s*,\s*(.+)\)$/i.exec(t);if(n&&(t=n[1].trim()),br[t.toLowerCase()]&&(t=br[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 dn(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 kt(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 Ge(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yr(e){return .2126*Ge(e[0])+.7152*Ge(e[1])+.0722*Ge(e[2])}function fn(e,t,n){let r=typeof e=="string"?Re(e):e,o=typeof t=="string"?Re(t):t;if(!r||!o)return 0;let a=n?typeof n=="string"?Re(n):n:null;o[3]<1&&a&&(o=kt(o,a));let i=r[3]<1?kt(r,o):r,s=yr(i),l=yr(o);return(Math.max(s,l)+.05)/(Math.min(s,l)+.05)}function bi(e){return[Ge(e[0]),Ge(e[1]),Ge(e[2])]}function mn(e){let t=e<=.0031308?12.92*e:1.055*Math.pow(e,.4166666666666667)-.055;return Math.max(0,Math.min(255,t*255))}function xr(e){let[t,n,r]=bi(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 yi([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[mn(4.0767416621*o-3.3077115913*a+.2309699292*i),mn(-1.2684380046*o+2.6097574011*a-.3413193965*i),mn(-.0041960863*o-.7034186147*a+1.707614701*i),r]}function wt(e,t,n){let r=Re(e),o=Re(t);if(!r||!o)return e;let a=xr(r),i=xr(o),s=Math.max(0,Math.min(1,n));return dn(yi([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 hn(e,t,n){let r=t[0],o=-1;for(let a of t){let i=fn(a,e,n);i>o&&(o=i,r=a)}return r}function xi(e,t,n){let r=Re(e),o=Re(t);return!r||!o?e:dn(kt([r[0],r[1],r[2],n],o))}function ee(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 kr(e,t){let n=hn(t,[e.theme.ink,e.theme.onAccent,e.theme.onNeutralStrong]);return fn(n,t)>=4.5?n===e.theme.ink?e.paint("ink"):n===e.theme.onAccent?e.paint("onAccent"):e.paint("onNeutralStrong"):hn(t,["#FFFFFF","#000000"])}function $t(e,t){let n=wt(e.theme.neutralStrong,e.theme.neutral,t);return{role:"mix",fill:e.mix("neutralStrong","neutral",t),text:kr(e,n),raw:n}}function ge(e,t,n){let r=new Array(t),o=[];for(let i=0;i<t;i++)n.has(i)?r[i]=ee(e,"accent"):o.push(i);let a=o.length;return o.forEach((i,s)=>{if(a===1)r[i]=ee(e,"neutral");else if(s===0)r[i]=ee(e,"ink");else if(s===a-1)r[i]=ee(e,"neutral");else if(a===3)r[i]=ee(e,"strong");else{let l=(s-1)/Math.max(1,a-2);r[i]=l<=.001?ee(e,"strong"):$t(e,1-l)}}),r}var gn="mix:";function Pe(e){return e({theme:sn,cssVars:!1,paint:n=>n,color:n=>n??"neutral",raw:n=>n??"neutral",mix:(n,r,o)=>`${gn}${o}`}).map(n=>n.fill)}function wr(e,t){return t?.startsWith(gn)?e.mix("neutralStrong","neutral",Number(t.slice(gn.length))):e.color(t)}function rt(e,t,n){return ge(e,t+1,n).slice(0,t)}function $r(e,t,n,r="neutral"){let o=ee(e,"accent"),a=ee(e,r);return Array.from({length:t},(i,s)=>n.has(s)?o:a)}function vr(e,t,n){let r=new Array(t),o=[];for(let i=0;i<t;i++)n.has(i)?r[i]=ee(e,"accent"):o.push(i);let a=o.length;return o.forEach((i,s)=>{a===1?r[i]=ee(e,"neutral"):s===0?r[i]=ee(e,"strong"):s===a-1?r[i]=ee(e,"neutral"):r[i]=$t(e,1-s/(a-1))}),r}function ki(e,t,n=.1,r="accent"){let o=Math.max(0,Math.min(1,t)),a=n+(1-n)*o,i=xi(e.theme[r],e.theme.panel,a);return{fill:e.paint(r),opacity:a,text:kr(e,i),raw:i}}function vt(e,t){let n=t.reverse?t.center===void 0?1-e:-e:e;if(t.steps){let r=t.center===void 0?0:-1,o=Math.max(0,Math.min(t.steps-1,Math.floor((n-r)/(1-r)*t.steps)));n=r+(1-r)*o/(t.steps-1)}return n}function Mt(e,t,n,r){let o=vt(t,r);return ki(e,Math.abs(o),n,o<0?"neutralStrong":"accent")}function Mr(e,t,n){return{reverse:e,center:t,steps:n===void 0?void 0:Math.max(2,Math.min(12,Math.round(n)))}}var pe=C(K(),1);var St=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),oe="en-US",Tr=new Map;function pn(e,t){let n=t.maximumFractionDigits!==void 0||t.style==="currency"?t:{...t,maximumFractionDigits:Math.max(1,t.minimumFractionDigits??0)},r=e+JSON.stringify(n),o=Tr.get(r);return o||(o=new Intl.NumberFormat(e,n),Tr.set(r,o)),o}function bn(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 bn(pn(n,r).format(e))}var yn=e=>e!==0&&Math.abs(e)<.05,xn=(e,t,n="")=>`${He(e,{locale:t,maximumSignificantDigits:2,maximumFractionDigits:20})}${n}`;function Tt(e,t={}){if(!Number.isFinite(e))return"-";if(yn(e)&&t.maximumFractionDigits===void 0)return xn(e,t.locale??oe,"%");let n=Math.abs(e);return`${He(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function Nr(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=oe,...r}=t;if(U(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 bn(pn(n,{notation:"compact",...r}).format(e))}var wi=(e,t=U(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function Ie(e,t=oe,n){if(typeof e=="function")return e;let r=(o,a="",i="")=>{let s=pn(t,o);return l=>Number.isFinite(l)?`${i}${bn(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=>Tt(o,{locale:t});case"ratio":return o=>Tt(o*100,{locale:t});case"compact":return o=>Nr(o,{locale:t});case"currency":return r(wi(t));default:{let o=r({maximumFractionDigits:1});return a=>yn(a)?xn(a,t):o(a)}}}function Fr(e,t=oe,n=0){return e!==void 0?Ie(e,t):n>=1e5?r=>yn(r)?xn(r,t):Nr(r,{locale:t}):r=>He(r,{locale:t})}function $i(e,t,n=1){let r=new Date(+e,+t-1,+n);return r.getMonth()===+t-1&&r.getDate()===+n?r:null}var kn=e=>Number.isInteger(e)&&e>=1e3&&e<=9999,vi=/^\d{4}-\d{1,2}(-\d{1,2})?([T ][\d:.]+(Z|[+-]\d{2}:?\d{2})?)?$/,Mi=["january","february","march","april","may","june","july","august","september","october","november","december"],Sr=e=>{let t=e.toLowerCase();return t.length<3?0:Mi.findIndex(n=>n.startsWith(t))+1},Cr=e=>+e+(+e<30?2e3:1900);function Rr(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var Ti=[/^(\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})일)?$/],Pr=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,Lr=/\{([^{}]+)\}/g;function Ct(e,t){let n;for(let r of Ti)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?[Cr(n[3]),+n[2],+n[1],1]:[Cr(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=Pr.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=Sr(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=Sr(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}var _r=e=>vi.test(e)||Ct(e)!==null;function Dr(e){let t;for(let n of e){let r=typeof n=="string"?Pr.exec(n.trim()):null;if(r){if(+r[1]>12)return!0;+r[3]>12&&(t=!1)}}return t}function At(e,t){if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e=="number"){if(!Number.isFinite(e))return null;if(Number.isInteger(e)){if(kn(e))return new Date(e,0,1);if(e>=19000101&&e<=21001231)return At(`${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=Ct(n,t);if(r)return $i(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 Ar=new Map;function ot(e,t={month:"short",day:"numeric"}){let n=At(e);if(!n)return"-";let{locale:r=oe,...o}=t,a=r+JSON.stringify(o),i=Ar.get(a);return i||(i=new Intl.DateTimeFormat(r,o),Ar.set(a,i)),i.format(n)}var wn=C(O(),1),Nt=(0,pe.createContext)({theme:Fe,cssVars:!0});function Si(e,t=Fe){return e?typeof e=="string"?ln[e]??t:un(t,e):t}function Ft(e){let t=(0,pe.useContext)(Nt),n=e.base?ln[e.base]:t.theme,r=(0,pe.useMemo)(()=>Si(e.theme,n),[e.theme,n]),o=e.cssVars??t.cssVars,a=e.locale??t.locale,i=(0,pe.useMemo)(()=>({theme:r,cssVars:o,locale:a}),[r,o,a]),s=(0,pe.useMemo)(()=>cn(r),[r]),l=e.paint?{background:r.bg,color:r.ink,fontFamily:r.fontFamily,...s,...e.style}:{display:"contents",...s,...e.style};return(0,wn.jsx)(Nt.Provider,{value:i,children:(0,wn.jsx)("div",{className:e.className,"data-ztd-theme":r.name,lang:e.locale,style:l,children:e.children})})}var Ci=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","accent2","accent3","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function Ir(e){return Ci.has(e)}function Ai(e,t){let n=r=>t?`var(${gt(r)}, ${e[r]})`:e[r];return{theme:e,cssVars:t,paint:n,color:(r,o="neutral")=>r?Ir(r)?n(r):r:n(o),raw:(r,o="neutral")=>r?Ir(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)})`:wt(e[r],e[o],a)}}}function be(e){let t=(0,pe.useContext)(Nt);return(0,pe.useMemo)(()=>{let n=un(t.theme,e);return Ai(n,t.cssVars)},[t.theme,t.cssVars,e])}function se(e){let t=(0,pe.useContext)(Nt);return e??t.locale??oe}function Or(e){return e?cn(e):{}}var Rt=C(K(),1),$n=(0,Rt.createContext)(void 0);function zr(e){let t=(0,Rt.useContext)($n);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var N=C(O(),1),Ni={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`},Fi={en:Ni,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var Ri={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},vn=e=>Fi[U(se(e))];function Mn(e){let t=be(e.theme),n=vn(e.locale),[r,o]=(0,Pt.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,N.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 m=!s.has(d.label),f=m&&l===1,h=(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Pi,{p:t,item:d,off:!m}),(0,N.jsx)("span",{style:m?void 0:{textDecoration:"line-through"},children:d.label})]});return(0,N.jsx)("li",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:a,color:t.paint("muted"),lineHeight:1.3},children:i?(0,N.jsx)("button",{type:"button",className:"ztd-btn","aria-pressed":m,"aria-disabled":f||void 0,onClick:()=>{f||(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:f?"default":void 0},children:h}):h},u)})});return i?(0,N.jsxs)(N.Fragment,{children:[c,(0,N.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:Ri,children:r?n.shown(l,e.items.length):""})]}):c}function Pi({p:e,item:t,off:n}){let r=wr(e,t.color),o=t.shape??"square";return o==="line"||o==="dash"?(0,N.jsxs)("svg",{width:14,height:8,"aria-hidden":"true",style:{flex:"none",opacity:n?.35:void 0},children:[(0,N.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,N.jsx)("circle",{cx:7,cy:4,r:2.2,fill:r}):null]}):(0,N.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 Li(e){let t=be(e.theme),n=pr(e.level,U(se(e.locale)));return(0,N.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 _i(e,t,n){if(typeof e!="string"||!t)return e;let r=e.indexOf(t);return r<0?e:(0,N.jsxs)(N.Fragment,{children:[e.slice(0,r),(0,N.jsx)("span",{style:{color:n},children:t}),e.slice(r+t.length)]})}function Br(e){let t=be(e.theme),n=vn(e.locale),[r,o]=(0,Pt.useState)(0);$e(()=>nt(),[]);let a=()=>{o(m=>m+1),e.onReplay?.()},i=Array.isArray(e.legend)?(0,N.jsx)(Mn,{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,N.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,N.jsxs)("footer",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:2},children:[(0,N.jsx)("span",{style:{fontSize:17,fontWeight:800,color:t.paint("ink"),letterSpacing:-.3,lineHeight:1.3,minWidth:0},children:e.takeaway}),(0,N.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,flex:"none"},children:[e.sample?(0,N.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,N.jsx)(Li,{level:e.level,theme:e.theme,locale:e.locale}):null]})]}):null;return(0,N.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,N.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[(0,N.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[l?(0,N.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,N.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:_i(e.title,e.accent,t.paint("accentText"))}),e.actions,c?(0,N.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,N.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,N.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,N.jsx)("path",{d:"M3 3v6h6"})]})}):null]}),e.subtitle!==void 0||i?(0,N.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px 12px",flexWrap:"wrap",minHeight:18},children:[e.subtitle!==void 0?(0,N.jsx)("span",{style:{fontSize:12.5,color:t.paint("muted"),lineHeight:1.4},children:e.subtitle}):(0,N.jsx)("span",{}),i]}):null]}),(0,N.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:0,minWidth:0},children:(0,N.jsx)($n.Provider,{value:r,children:(0,N.jsx)(je.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),d?(0,N.jsxs)(N.Fragment,{children:[d,u]}):u]})}function Tn(e){let t=be(e.theme),n=vn(e.locale),r=e.height??220;if($e(()=>nt(),[]),e.error){let o=typeof e.error=="string"?e.error:e.error.message;return(0,N.jsx)("div",{role:"alert",style:{height:r,display:"grid",placeItems:"center",textAlign:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,N.jsxs)("div",{style:{display:"grid",gap:8,justifyItems:"center",padding:16},children:[(0,N.jsx)("span",{style:{fontSize:14,fontWeight:700,color:t.paint("ink")},children:n.loadError}),(0,N.jsx)("span",{style:{fontSize:12,color:t.paint("muted"),maxWidth:280,wordBreak:"break-word"},children:o}),e.onRetry?(0,N.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,N.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,N.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,N.jsx)("div",{style:{height:r,display:"grid",placeItems:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,N.jsx)("span",{style:{fontSize:13,color:t.paint("muted")},children:e.emptyText??n.empty})}):(0,N.jsx)(N.Fragment,{children:e.children})}var Xe=C(K(),1);var le=C(K(),1);var H=C(O(),1),Lt=60;var _t={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function jr(e){let{c:t,events:n}=e,r=(0,le.useId)().replace(/:/g,""),o=`${r}t`,a=`${r}d`;t.events.current=n,$e(()=>{nt()},[]);let i=n.length,s=!e.noNav&&i>0,l=(0,le.useContext)(je),c=e.ariaLabel??l??e.kind,d=(0,le.useMemo)(()=>s?`${n.length}${n.slice(0,Lt).map(b=>`${b.label}${b.series??""}${b.formatted??b.value??""}`).join("")}`:"",[n,s]),u=(0,le.useMemo)(()=>(0,H.jsx)(Di,{label:c,events:n,t:t.t}),[c,d,t.t]),m=(0,le.useRef)(null);(0,le.useEffect)(()=>{let b=()=>{m.current=null};return window.addEventListener("scroll",b,{capture:!0,passive:!0}),window.addEventListener("resize",b,{passive:!0}),()=>{window.removeEventListener("scroll",b,{capture:!0}),window.removeEventListener("resize",b)}},[]),(0,le.useEffect)(()=>{m.current=null},[t.width,t.height]);let f=b=>{if(b.target!==b.currentTarget)return;if(e.onKey?.(b)){b.preventDefault();return}let S=t.active,L;switch(b.key){case"ArrowRight":case"ArrowDown":L=S===null?0:(S+1)%i;break;case"ArrowLeft":case"ArrowUp":L=S===null?i-1:(S-1+i)%i;break;case"Home":L=0;break;case"End":L=i-1;break;case"Escape":if(S===null)return;L=null;break;case"Enter":case" ":S!==null&&(b.preventDefault(),t.click(S));return;default:return}b.preventDefault(),t.setActive(L,"keyboard")},{via:h,node:p,setActive:x}=t;(0,le.useEffect)(()=>{if(h!=="touch"||!p)return;let b=S=>{p.contains(S.target)||x(null)};return document.addEventListener("pointerdown",b),()=>document.removeEventListener("pointerdown",b)},[h,p,x]);let g=t.active!==null?n[t.active]:null,$=t.showTooltip&&e.renderTip!==!1&&!t.pending&&t.via!=="sync"?e.tip:null,v=$&&!t.responsive&&t.node&&t.width&&t.node.getBoundingClientRect().width/t.width||1,A=typeof e.renderTip=="function"&&g?e.renderTip(g):null,k=e.announce??(t.via==="keyboard"&&g?`${g.label}${g.series?` ${g.series}`:""}: ${g.formatted??g.value??""} (${(t.active??0)+1}/${i})`:""),R;if($){let b=$.x*v,S=t.width*v,L=`clamp(${(4-b).toFixed(1)}px, -50%, calc(${(S-b-4).toFixed(1)}px - 100%))`,j=$.y<64;R={position:"absolute",left:b,top:$.y*v,transform:`translate(${L}, ${j?"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*v-8)}}let F=b=>{m.current=null,b.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},E=b=>b?S=>{let L=m.current??(m.current=S.currentTarget.getBoundingClientRect());L.width&&b((S.clientX-L.left)/L.width*t.width,(S.clientY-L.top)/L.height*t.height,S)}:void 0,I=E(e.onPointerMove),z=E(e.onPointerDown),P=I||z?b=>{b.pointerType==="touch"&&I?.(b),z?.(b)}:void 0,M=E(e.onPointerUp),T=Or(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?f:void 0,onBlur:b=>{t.via==="keyboard"&&!b.currentTarget.contains(b.relatedTarget)&&t.setActive(null)},onPointerLeave:F,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:P,onPointerUp:M,onPointerCancel:M,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,$?(0,H.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:R,children:A??(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)("div",{style:{fontWeight:600,fontSize:11.5,color:t.p.paint("muted"),marginBottom:$.rows.length?4:0,overflow:"hidden",textOverflow:"ellipsis"},children:$.title}),$.rows.map((b,S)=>(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(b.strong?"ink":"muted")},children:[b.color?(0,H.jsx)("span",{style:{width:8,height:8,borderRadius:999,background:b.color,display:"inline-block",boxShadow:"inset 0 0 0 1px rgba(127,127,127,0.3)"}}):null,b.label]}),(0,H.jsx)("span",{style:{fontWeight:b.strong===!1?500:700},children:b.value})]},S))]})}):null,(0,H.jsx)("span",{className:"ztd-sr",style:_t,"aria-live":"polite","aria-atomic":"true",children:k}),s&&!t.pending?u:null]})}function Di({label:e,events:t,t:n}){return(0,H.jsx)("div",{className:"ztd-sr",style:_t,children:(0,H.jsxs)("table",{children:[(0,H.jsx)("caption",{children:n.table(e)}),(0,H.jsxs)("tbody",{children:[t.slice(0,Lt).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>Lt?(0,H.jsx)("tr",{children:(0,H.jsx)("td",{colSpan:2,children:n.more(t.length-Lt)})}):null]})]})})}function Ce(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 y=(e,t,n,r,o={})=>({name:e,type:t,required:n,description:r,...o}),de=y("label","string",!0,"Item name field"),te=y("value","number",!0,"Value field"),Ei=[de,te],Ii=[de,te],Oi=[y("label","string",!0,"Stage name"),y("value","number",!0,"Users at the stage")],zi=[de,te],Bi=[y("label","string",!0,"Leaf (lowest level) name"),te,y("group","string",!1,"Parent group field")],ji=[y("label","string",!0,"Leaf name"),te,y("group","string",!1,"Parent group field")],Gi=[de,y("value","number",!0,"Change (total rows may omit it)"),y("type","string",!1,'"total" makes a total bar')],Hi=[de,te],Wi=[y("x","string",!0,"Column field"),y("series","string",!0,"Stacked series field"),te],Vi=[y("x","string",!0,"Column field"),y("y","string",!0,"Row field"),te],Ki=[y("axis","string",!0,"Metric (axis) field"),y("value","number",!0,"Value field",{multi:!0}),y("series","string",!1,"Series field")],Ui=[y("x","number",!0,"x value"),y("y","number",!0,"y value"),y("size","number",!1,"Circle size"),y("label","string",!1,"Name")],Hr=y("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),Xi=[y("x","any",!0,"x field (date, number or category)"),y("y","number",!0,"y field. An array for wide tables",{multi:!0}),y("series","string",!1,"Series field (long tables)"),y("lower","number",!1,"Lower bound of the range band. In wide tables an array in the order of y",{multi:!0}),Hr],Yi=[y("x","any",!0,"x field"),y("y","number",!0,"y field. An array for wide tables",{multi:!0}),y("series","string",!1,"Series field"),y("lower","number",!1,'Lower bound of the range band, with stack "none" only. In wide tables an array in the order of y',{multi:!0}),Hr],Ji=[y("x","any",!0,"x field"),y("y","number",!0,"y field",{multi:!0}),y("series","string",!1,"Series field")],qi=[y("x","string",!0,"Category field"),y("y","number",!0,"Value field. An array for wide tables",{multi:!0}),y("series","string",!1,"Series field"),y("line","number",!1,"Lines over vertical bars on the same axis, such as a target or last year. An array for several. Bars stay gray unless highlight is set, and with series the line averages rows of the same x",{multi:!0})],Zi=[de,te],Qi=[y("value","number",!0,"Value field",{prop:"valueKey"}),y("target","number",!1,"Target field",{prop:"targetKey"})],es=[de,y("value","number",!0,"Actual value field"),y("target","number",!1,"Target field")],ts=[y("x","any",!1,"x field"),y("y","number",!0,"y field")],ns=[de,y("x","string",!1,"Period field (long tables)"),y("value","number",!1,"Value field (long tables)")],rs=[de,y("start","number",!0,"Before value"),y("end","number",!0,"After value")],os=[de,te],as=[y("value","number",!0,"Value field"),y("group","string",!1,"Group (row) field"),y("label","string",!1,"Dot name")],is=[y("group","string",!0,"Group field"),y("value","number",!0,"Value field")],ss=[y("source","string",!0,"Source node"),y("target","string",!0,"Target node"),te],ls=[y("source","string",!0,"Sending group"),y("target","string",!0,"Receiving group"),te],cs=[y("date","date",!0,"Date field"),te],us=[y("x","any",!0,"Period field"),y("series","string",!0,"Item field"),y("rank","number",!1,"Rank field (1 is first)"),y("value","number",!1,"Value field (instead of rank, largest is first)")],ms=[y("group","string",!0,"Group field"),y("value","number",!0,"Value field")],ds=[y("label","string",!1,"Row name field")],fs=[y("x","date",!0,"Date (period) field"),y("open","number",!0,"Open price field"),y("high","number",!0,"High price field"),y("low","number",!0,"Low price field"),y("close","number",!0,"Close price field"),y("volume","number",!1,"Volume field")],hs=[de,te],gs=[y("x","any",!0,"Period field (date or category)"),y("y","number",!0,"Back row fields stacked into each block. An array for wide tables",{multi:!0}),y("series","string",!1,"Series field (long tables, back row only)"),y("front","number",!1,"Front row fields: a smaller outcome in the same unit as y (wide tables only)",{multi:!0})],ps=[y("value","number",!1,"Sample value field (raw rows)"),y("group","string",!1,"Group field. Up to 2 groups overlap"),y("x0","number",!1,"Bin start (pre-binned rows)"),y("x1","number",!1,"Bin end (pre-binned rows)"),y("count","number",!1,"Samples in the bin (pre-binned rows)")],bs=[y("region","string",!0,"Region name or code, matched to a tile of options.map"),te],ys=[de,te,y("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")],xs=[y("source","string",!0,"Source node"),y("target","string",!0,"Target node"),y("value","number",!1,"Link weight. Without it every row counts 1")],ks=[y("label","string",!0,"Row name. Items with the same name share a row"),y("start","any",!0,"Start: a number (minutes, seconds, any unit) or a date or date-time"),y("end","any",!0,"End, same kind as start. Equal to start draws a point event; empty means still open"),y("group","string",!1,"Group field (one color per group, and the legend)"),y("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")],ws=[y("label","string",!0,"Node name field"),y("value","number",!1,"Value field. Sizes the dots; values add up from the leaves"),y("group","string",!1,"Parent group field (flat rows, as in the treemap)"),y("id","string",!1,"Row id for id/parent rows. Defaults to the label"),y("parent","string",!1,"Parent id field. Each row is one node, and rows with an empty parent hang under the root")],$s=[y("region","string",!0,"Region name or code, matched to a region of options.map"),te],vs=[y("lon","number",!1,"Longitude (degrees)"),y("lat","number",!1,"Latitude (degrees)"),y("size","number",!1,"Value (circle area). Without it all circles match"),y("label","string",!1,"Place name"),y("region","string",!1,"Region of options.map, for rows without lon and lat"),y("group","string",!1,"Group field (one color per group)")],Ms=[y("source","string",!0,"Start: a name in options.places or a region"),y("target","string",!0,"End"),y("value","number",!1,"Amount. Without it each row counts 1")],Ts=[y("x","number",!0,"x value"),y("y","number",!0,"y value"),y("series","string",!1,"Series field (one color per series)"),y("label","string",!1,"Name")],Gr={pie:Ei,donut:Ii,funnel:Oi,waffle:zi,treemap:Bi,sunburst:ji,waterfall:Gi,pareto:Hi,marimekko:Wi,heatmap:Vi,radar:Ki,bubble:Ui,line:Xi,area:Yi,stream:Ji,bar:qi,radialBar:Zi,gauge:Qi,bullet:es,sparkline:ts,slope:ns,dumbbell:rs,lollipop:os,beeswarm:as,ridgeline:is,sankey:ss,chord:ls,calendar:cs,bump:us,box:ms,parallel:ds,candlestick:fs,segmented:hs,skyline:gs,histogram:ps,scatter:Ts,tileMap:bs,barRace:ys,network:xs,timeline:ks,tree:ws,choropleth:$s,symbolMap:vs,flowMap:Ms},We={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 Wr(e,t){return t==="ko"?e.nameKo:e.name}function Vr(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var Kr=["line","area","bar","scatter"],Ur=24,Sn=["line","area","bar","scatter","timeline"];function Cn(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"&&n.layout!=="diverging"?[].concat(t.line??[]).map(String):[]}function Xr(e,t,n){return Sn.includes(e)&&!Cn(e,t,n).length&&!(e==="scatter"&&Dt(n))}function Dt(e){return!!e&&typeof e=="object"&&e.bin==="hex"}function Yr(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var Ss={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 Et(e){let t=Gr[e]?e:Ss[e]??Object.keys(We).find(n=>n.toLowerCase()===e.toLowerCase()||We[n].component.toLowerCase()===e.toLowerCase());if(!(!t||!We[t]))return{type:t,component:We[t].component,name:We[t].name,nameKo:We[t].nameKo,encoding:Gr[t]}}function Jr(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 Et(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 qr(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function Cs(e,t){if(e==null||typeof e!="object")return;let n=e;if(qr(n,t))return n[t];if(t.includes(".")){let r=n;for(let o of t.split(".")){if(r===null||typeof r!="object"||!qr(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 Oe(e,t){if(typeof e=="function")return e;let n=e??t;return r=>Cs(r,n)}function Ve(e,t){let n=Oe(e,t);return(r,o)=>Me(n(r,o))}function ye(e,t){let n=Oe(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 xe(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}function As(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,a=[","," ",";","|"],i=",",s=0;for(let l of a){let c=o(l);c>s&&(s=c,i=l)}return i}var
|
|
22
|
+
`;function pt(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 bt(e,t){let[n]=(0,fr.useState)(!e.motion.enabled);return e.motion.enabled&&e.hydrated&&(!n||t.waiting||t.generation>0)}var dr=!1;function nt(){if(dr||typeof document>"u"||(dr=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=di,document.head.appendChild(e)}var yt=C(K(),1),he=typeof window<"u"&&typeof document<"u",$e=he?yt.useLayoutEffect:yt.useEffect;function xt(){return typeof performance<"u"?performance.now():Date.now()}function U(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function ve(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var hr={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},gr={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var fi=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],hi={basic:{bg:"line2",fg:"ink"},intermediate:{bg:"tint",fg:"accentText"},advanced:{bg:"ink",fg:"onInk"}};function gi(e,t){let n=t.trim().toLowerCase();return e.find(r=>r.id===n||r.en.toLowerCase()===n||r.ko===t.trim())}function pi(e){return gi(fi,e)}function pr(e,t){let n=pi(e);return{text:n?n[t]:e,...hi[n?.id??"basic"]}}var br={white:"#ffffff",black:"#000000",transparent:"#00000000"};function Fe(e){if(!e)return null;let t=e.trim(),n=/^var\(\s*--[\w-]+\s*,\s*(.+)\)$/i.exec(t);if(n&&(t=n[1].trim()),br[t.toLowerCase()]&&(t=br[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 dn(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 kt(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 Ge(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yr(e){return .2126*Ge(e[0])+.7152*Ge(e[1])+.0722*Ge(e[2])}function fn(e,t,n){let r=typeof e=="string"?Fe(e):e,o=typeof t=="string"?Fe(t):t;if(!r||!o)return 0;let a=n?typeof n=="string"?Fe(n):n:null;o[3]<1&&a&&(o=kt(o,a));let i=r[3]<1?kt(r,o):r,s=yr(i),l=yr(o);return(Math.max(s,l)+.05)/(Math.min(s,l)+.05)}function bi(e){return[Ge(e[0]),Ge(e[1]),Ge(e[2])]}function mn(e){let t=e<=.0031308?12.92*e:1.055*Math.pow(e,.4166666666666667)-.055;return Math.max(0,Math.min(255,t*255))}function xr(e){let[t,n,r]=bi(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 yi([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[mn(4.0767416621*o-3.3077115913*a+.2309699292*i),mn(-1.2684380046*o+2.6097574011*a-.3413193965*i),mn(-.0041960863*o-.7034186147*a+1.707614701*i),r]}function wt(e,t,n){let r=Fe(e),o=Fe(t);if(!r||!o)return e;let a=xr(r),i=xr(o),s=Math.max(0,Math.min(1,n));return dn(yi([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 hn(e,t,n){let r=t[0],o=-1;for(let a of t){let i=fn(a,e,n);i>o&&(o=i,r=a)}return r}function xi(e,t,n){let r=Fe(e),o=Fe(t);return!r||!o?e:dn(kt([r[0],r[1],r[2],n],o))}function ee(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 kr(e,t){let n=hn(t,[e.theme.ink,e.theme.onAccent,e.theme.onNeutralStrong]);return fn(n,t)>=4.5?n===e.theme.ink?e.paint("ink"):n===e.theme.onAccent?e.paint("onAccent"):e.paint("onNeutralStrong"):hn(t,["#FFFFFF","#000000"])}function $t(e,t){let n=wt(e.theme.neutralStrong,e.theme.neutral,t);return{role:"mix",fill:e.mix("neutralStrong","neutral",t),text:kr(e,n),raw:n}}function ge(e,t,n){let r=new Array(t),o=[];for(let i=0;i<t;i++)n.has(i)?r[i]=ee(e,"accent"):o.push(i);let a=o.length;return o.forEach((i,s)=>{if(a===1)r[i]=ee(e,"neutral");else if(s===0)r[i]=ee(e,"ink");else if(s===a-1)r[i]=ee(e,"neutral");else if(a===3)r[i]=ee(e,"strong");else{let l=(s-1)/Math.max(1,a-2);r[i]=l<=.001?ee(e,"strong"):$t(e,1-l)}}),r}var gn="mix:";function _e(e){return e({theme:sn,cssVars:!1,paint:n=>n,color:n=>n??"neutral",raw:n=>n??"neutral",mix:(n,r,o)=>`${gn}${o}`}).map(n=>n.fill)}function wr(e,t){return t?.startsWith(gn)?e.mix("neutralStrong","neutral",Number(t.slice(gn.length))):e.color(t)}function rt(e,t,n){return ge(e,t+1,n).slice(0,t)}function $r(e,t,n,r="neutral"){let o=ee(e,"accent"),a=ee(e,r);return Array.from({length:t},(i,s)=>n.has(s)?o:a)}function vr(e,t,n){let r=new Array(t),o=[];for(let i=0;i<t;i++)n.has(i)?r[i]=ee(e,"accent"):o.push(i);let a=o.length;return o.forEach((i,s)=>{a===1?r[i]=ee(e,"neutral"):s===0?r[i]=ee(e,"strong"):s===a-1?r[i]=ee(e,"neutral"):r[i]=$t(e,1-s/(a-1))}),r}function ki(e,t,n=.1,r="accent"){let o=Math.max(0,Math.min(1,t)),a=n+(1-n)*o,i=xi(e.theme[r],e.theme.panel,a);return{fill:e.paint(r),opacity:a,text:kr(e,i),raw:i}}function vt(e,t){let n=t.reverse?t.center===void 0?1-e:-e:e;if(t.steps){let r=t.center===void 0?0:-1,o=Math.max(0,Math.min(t.steps-1,Math.floor((n-r)/(1-r)*t.steps)));n=r+(1-r)*o/(t.steps-1)}return n}function Mt(e,t,n,r){let o=vt(t,r);return ki(e,Math.abs(o),n,o<0?"neutralStrong":"accent")}function Mr(e,t,n){return{reverse:e,center:t,steps:n===void 0?void 0:Math.max(2,Math.min(12,Math.round(n)))}}var pe=C(K(),1);var St=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),oe="en-US",Tr=new Map;function pn(e,t){let n=t.maximumFractionDigits!==void 0||t.style==="currency"?t:{...t,maximumFractionDigits:Math.max(1,t.minimumFractionDigits??0)},r=e+JSON.stringify(n),o=Tr.get(r);return o||(o=new Intl.NumberFormat(e,n),Tr.set(r,o)),o}function bn(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 bn(pn(n,r).format(e))}var yn=e=>e!==0&&Math.abs(e)<.05,xn=(e,t,n="")=>`${He(e,{locale:t,maximumSignificantDigits:2,maximumFractionDigits:20})}${n}`;function Tt(e,t={}){if(!Number.isFinite(e))return"-";if(yn(e)&&t.maximumFractionDigits===void 0)return xn(e,t.locale??oe,"%");let n=Math.abs(e);return`${He(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function Nr(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=oe,...r}=t;if(U(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 bn(pn(n,{notation:"compact",...r}).format(e))}var wi=(e,t=U(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function Ie(e,t=oe,n){if(typeof e=="function")return e;let r=(o,a="",i="")=>{let s=pn(t,o);return l=>Number.isFinite(l)?`${i}${bn(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=>Tt(o,{locale:t});case"ratio":return o=>Tt(o*100,{locale:t});case"compact":return o=>Nr(o,{locale:t});case"currency":return r(wi(t));default:{let o=r({maximumFractionDigits:1});return a=>yn(a)?xn(a,t):o(a)}}}function Rr(e,t=oe,n=0){return e!==void 0?Ie(e,t):n>=1e5?r=>yn(r)?xn(r,t):Nr(r,{locale:t}):r=>He(r,{locale:t})}function $i(e,t,n=1){let r=new Date(+e,+t-1,+n);return r.getMonth()===+t-1&&r.getDate()===+n?r:null}var kn=e=>Number.isInteger(e)&&e>=1e3&&e<=9999,vi=/^\d{4}-\d{1,2}(-\d{1,2})?([T ][\d:.]+(Z|[+-]\d{2}:?\d{2})?)?$/,Mi=["january","february","march","april","may","june","july","august","september","october","november","december"],Sr=e=>{let t=e.toLowerCase();return t.length<3?0:Mi.findIndex(n=>n.startsWith(t))+1},Cr=e=>+e+(+e<30?2e3:1900);function Fr(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var Ti=[/^(\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})일)?$/],_r=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,Pr=/\{([^{}]+)\}/g;function Ct(e,t){let n;for(let r of Ti)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?[Cr(n[3]),+n[2],+n[1],1]:[Cr(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=_r.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=Sr(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=Sr(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}var Lr=e=>vi.test(e)||Ct(e)!==null;function Dr(e){let t;for(let n of e){let r=typeof n=="string"?_r.exec(n.trim()):null;if(r){if(+r[1]>12)return!0;+r[3]>12&&(t=!1)}}return t}function At(e,t){if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e=="number"){if(!Number.isFinite(e))return null;if(Number.isInteger(e)){if(kn(e))return new Date(e,0,1);if(e>=19000101&&e<=21001231)return At(`${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=Ct(n,t);if(r)return $i(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 Ar=new Map;function ot(e,t={month:"short",day:"numeric"}){let n=At(e);if(!n)return"-";let{locale:r=oe,...o}=t,a=r+JSON.stringify(o),i=Ar.get(a);return i||(i=new Intl.DateTimeFormat(r,o),Ar.set(a,i)),i.format(n)}var wn=C(O(),1),Nt=(0,pe.createContext)({theme:Re,cssVars:!0});function Si(e,t=Re){return e?typeof e=="string"?ln[e]??t:un(t,e):t}function Rt(e){let t=(0,pe.useContext)(Nt),n=e.base?ln[e.base]:t.theme,r=(0,pe.useMemo)(()=>Si(e.theme,n),[e.theme,n]),o=e.cssVars??t.cssVars,a=e.locale??t.locale,i=(0,pe.useMemo)(()=>({theme:r,cssVars:o,locale:a}),[r,o,a]),s=(0,pe.useMemo)(()=>cn(r),[r]),l=e.paint?{background:r.bg,color:r.ink,fontFamily:r.fontFamily,...s,...e.style}:{display:"contents",...s,...e.style};return(0,wn.jsx)(Nt.Provider,{value:i,children:(0,wn.jsx)("div",{className:e.className,"data-ztd-theme":r.name,lang:e.locale,style:l,children:e.children})})}var Ci=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","accent2","accent3","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function Ir(e){return Ci.has(e)}function Ai(e,t){let n=r=>t?`var(${gt(r)}, ${e[r]})`:e[r];return{theme:e,cssVars:t,paint:n,color:(r,o="neutral")=>r?Ir(r)?n(r):r:n(o),raw:(r,o="neutral")=>r?Ir(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)})`:wt(e[r],e[o],a)}}}function be(e){let t=(0,pe.useContext)(Nt);return(0,pe.useMemo)(()=>{let n=un(t.theme,e);return Ai(n,t.cssVars)},[t.theme,t.cssVars,e])}function se(e){let t=(0,pe.useContext)(Nt);return e??t.locale??oe}function Or(e){return e?cn(e):{}}var Ft=C(K(),1),$n=(0,Ft.createContext)(void 0);function zr(e){let t=(0,Ft.useContext)($n);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var N=C(O(),1),Ni={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`},Ri={en:Ni,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var Fi={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},vn=e=>Ri[U(se(e))];function Mn(e){let t=be(e.theme),n=vn(e.locale),[r,o]=(0,_t.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,N.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 m=!s.has(d.label),f=m&&l===1,h=(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(_i,{p:t,item:d,off:!m}),(0,N.jsx)("span",{style:m?void 0:{textDecoration:"line-through"},children:d.label})]});return(0,N.jsx)("li",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:a,color:t.paint("muted"),lineHeight:1.3},children:i?(0,N.jsx)("button",{type:"button",className:"ztd-btn","aria-pressed":m,"aria-disabled":f||void 0,onClick:()=>{f||(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:f?"default":void 0},children:h}):h},u)})});return i?(0,N.jsxs)(N.Fragment,{children:[c,(0,N.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:Fi,children:r?n.shown(l,e.items.length):""})]}):c}function _i({p:e,item:t,off:n}){let r=wr(e,t.color),o=t.shape??"square";return o==="line"||o==="dash"?(0,N.jsxs)("svg",{width:14,height:8,"aria-hidden":"true",style:{flex:"none",opacity:n?.35:void 0},children:[(0,N.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,N.jsx)("circle",{cx:7,cy:4,r:2.2,fill:r}):null]}):(0,N.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 Pi(e){let t=be(e.theme),n=pr(e.level,U(se(e.locale)));return(0,N.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 Li(e,t,n){if(typeof e!="string"||!t)return e;let r=e.indexOf(t);return r<0?e:(0,N.jsxs)(N.Fragment,{children:[e.slice(0,r),(0,N.jsx)("span",{style:{color:n},children:t}),e.slice(r+t.length)]})}function Br(e){let t=be(e.theme),n=vn(e.locale),[r,o]=(0,_t.useState)(0);$e(()=>nt(),[]);let a=()=>{o(m=>m+1),e.onReplay?.()},i=Array.isArray(e.legend)?(0,N.jsx)(Mn,{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,N.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,N.jsxs)("footer",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:2},children:[(0,N.jsx)("span",{style:{fontSize:17,fontWeight:800,color:t.paint("ink"),letterSpacing:-.3,lineHeight:1.3,minWidth:0},children:e.takeaway}),(0,N.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,flex:"none"},children:[e.sample?(0,N.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,N.jsx)(Pi,{level:e.level,theme:e.theme,locale:e.locale}):null]})]}):null;return(0,N.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,N.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[(0,N.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[l?(0,N.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,N.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:Li(e.title,e.accent,t.paint("accentText"))}),e.actions,c?(0,N.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,N.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,N.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,N.jsx)("path",{d:"M3 3v6h6"})]})}):null]}),e.subtitle!==void 0||i?(0,N.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px 12px",flexWrap:"wrap",minHeight:18},children:[e.subtitle!==void 0?(0,N.jsx)("span",{style:{fontSize:12.5,color:t.paint("muted"),lineHeight:1.4},children:e.subtitle}):(0,N.jsx)("span",{}),i]}):null]}),(0,N.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:0,minWidth:0},children:(0,N.jsx)($n.Provider,{value:r,children:(0,N.jsx)(je.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),d?(0,N.jsxs)(N.Fragment,{children:[d,u]}):u]})}function Tn(e){let t=be(e.theme),n=vn(e.locale),r=e.height??220;if($e(()=>nt(),[]),e.error){let o=typeof e.error=="string"?e.error:e.error.message;return(0,N.jsx)("div",{role:"alert",style:{height:r,display:"grid",placeItems:"center",textAlign:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,N.jsxs)("div",{style:{display:"grid",gap:8,justifyItems:"center",padding:16},children:[(0,N.jsx)("span",{style:{fontSize:14,fontWeight:700,color:t.paint("ink")},children:n.loadError}),(0,N.jsx)("span",{style:{fontSize:12,color:t.paint("muted"),maxWidth:280,wordBreak:"break-word"},children:o}),e.onRetry?(0,N.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,N.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,N.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,N.jsx)("div",{style:{height:r,display:"grid",placeItems:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,N.jsx)("span",{style:{fontSize:13,color:t.paint("muted")},children:e.emptyText??n.empty})}):(0,N.jsx)(N.Fragment,{children:e.children})}var Xe=C(K(),1);var le=C(K(),1);var H=C(O(),1),Pt=60;var Lt={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function jr(e){let{c:t,events:n}=e,r=(0,le.useId)().replace(/:/g,""),o=`${r}t`,a=`${r}d`;t.events.current=n,$e(()=>{nt()},[]);let i=n.length,s=!e.noNav&&i>0,l=(0,le.useContext)(je),c=e.ariaLabel??l??e.kind,d=(0,le.useMemo)(()=>s?`${n.length}${n.slice(0,Pt).map(y=>`${y.label}${y.series??""}${y.formatted??y.value??""}`).join("")}`:"",[n,s]),u=(0,le.useMemo)(()=>(0,H.jsx)(Di,{label:c,events:n,t:t.t}),[c,d,t.t]),m=(0,le.useRef)(null);(0,le.useEffect)(()=>{let y=()=>{m.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,le.useEffect)(()=>{m.current=null},[t.width,t.height]);let f=y=>{if(y.target!==y.currentTarget)return;if(e.onKey?.(y)){y.preventDefault();return}let S=t.active,P;switch(y.key){case"ArrowRight":case"ArrowDown":P=S===null?0:(S+1)%i;break;case"ArrowLeft":case"ArrowUp":P=S===null?i-1:(S-1+i)%i;break;case"Home":P=0;break;case"End":P=i-1;break;case"Escape":if(S===null)return;P=null;break;case"Enter":case" ":S!==null&&(y.preventDefault(),t.click(S));return;default:return}y.preventDefault(),t.setActive(P,"keyboard")},{via:h,node:p,setActive:x}=t;(0,le.useEffect)(()=>{if(h!=="touch"||!p)return;let y=S=>{p.contains(S.target)||x(null)};return document.addEventListener("pointerdown",y),()=>document.removeEventListener("pointerdown",y)},[h,p,x]);let g=t.active!==null?n[t.active]:null,$=t.showTooltip&&e.renderTip!==!1&&!t.pending&&t.via!=="sync"?e.tip:null,v=$&&!t.responsive&&t.node&&t.width&&t.node.getBoundingClientRect().width/t.width||1,A=typeof e.renderTip=="function"&&g?e.renderTip(g):null,k=e.announce??(t.via==="keyboard"&&g?`${g.label}${g.series?` ${g.series}`:""}: ${g.formatted??g.value??""} (${(t.active??0)+1}/${i})`:""),F;if($){let y=$.x*v,S=t.width*v,P=`clamp(${(4-y).toFixed(1)}px, -50%, calc(${(S-y-4).toFixed(1)}px - 100%))`,j=$.y<64;F={position:"absolute",left:y,top:$.y*v,transform:`translate(${P}, ${j?"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*v-8)}}let R=y=>{m.current=null,y.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},E=y=>y?S=>{let P=m.current??(m.current=S.currentTarget.getBoundingClientRect());P.width&&y((S.clientX-P.left)/P.width*t.width,(S.clientY-P.top)/P.height*t.height,S)}:void 0,I=E(e.onPointerMove),z=E(e.onPointerDown),_=I||z?y=>{y.pointerType==="touch"&&I?.(y),z?.(y)}:void 0,M=E(e.onPointerUp),T=Or(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?f:void 0,onBlur:y=>{t.via==="keyboard"&&!y.currentTarget.contains(y.relatedTarget)&&t.setActive(null)},onPointerLeave:R,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:M,onPointerCancel:M,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,$?(0,H.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:F,children:A??(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)("div",{style:{fontWeight:600,fontSize:11.5,color:t.p.paint("muted"),marginBottom:$.rows.length?4:0,overflow:"hidden",textOverflow:"ellipsis"},children:$.title}),$.rows.map((y,S)=>(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})]},S))]})}):null,(0,H.jsx)("span",{className:"ztd-sr",style:Lt,"aria-live":"polite","aria-atomic":"true",children:k}),s&&!t.pending?u:null]})}function Di({label:e,events:t,t:n}){return(0,H.jsx)("div",{className:"ztd-sr",style:Lt,children:(0,H.jsxs)("table",{children:[(0,H.jsx)("caption",{children:n.table(e)}),(0,H.jsxs)("tbody",{children:[t.slice(0,Pt).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>Pt?(0,H.jsx)("tr",{children:(0,H.jsx)("td",{colSpan:2,children:n.more(t.length-Pt)})}):null]})]})})}function Ce(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 b=(e,t,n,r,o={})=>({name:e,type:t,required:n,description:r,...o}),de=b("label","string",!0,"Item name field"),te=b("value","number",!0,"Value field"),Ei=[de,te],Ii=[de,te],Oi=[b("label","string",!0,"Stage name"),b("value","number",!0,"Users at the stage")],zi=[de,te],Bi=[b("label","string",!0,"Leaf (lowest level) name"),te,b("group","string",!1,"Parent group field")],ji=[b("label","string",!0,"Leaf name"),te,b("group","string",!1,"Parent group field")],Gi=[de,b("value","number",!0,"Change (total rows may omit it)"),b("type","string",!1,'"total" makes a total bar')],Hi=[de,te],Wi=[b("x","string",!0,"Column field"),b("series","string",!0,"Stacked series field"),te],Vi=[b("x","string",!0,"Column field"),b("y","string",!0,"Row field"),te],Ki=[b("axis","string",!0,"Metric (axis) field"),b("value","number",!0,"Value field",{multi:!0}),b("series","string",!1,"Series field")],Ui=[b("x","number",!0,"x value"),b("y","number",!0,"y value"),b("size","number",!1,"Circle size"),b("label","string",!1,"Name")],Hr=b("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),Xi=[b("x","any",!0,"x field (date, number or category)"),b("y","number",!0,"y field. An array for wide tables",{multi:!0}),b("series","string",!1,"Series field (long tables)"),b("lower","number",!1,"Lower bound of the range band. In wide tables an array in the order of y",{multi:!0}),Hr],Yi=[b("x","any",!0,"x field"),b("y","number",!0,"y field. An array for wide tables",{multi:!0}),b("series","string",!1,"Series field"),b("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}),Hr],Ji=[b("x","any",!0,"x field"),b("y","number",!0,"y field",{multi:!0}),b("series","string",!1,"Series field")],qi=[b("x","string",!0,"Category field"),b("y","number",!0,"Value field. An array for wide tables",{multi:!0}),b("series","string",!1,"Series field"),b("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})],Zi=[de,te],Qi=[b("value","number",!0,"Value field",{prop:"valueKey"}),b("target","number",!1,"Target field",{prop:"targetKey"})],es=[de,b("value","number",!0,"Actual value field"),b("target","number",!1,"Target field")],ts=[b("x","any",!1,"x field"),b("y","number",!0,"y field")],ns=[de,b("x","string",!1,"Period field (long tables)"),b("value","number",!1,"Value field (long tables)")],rs=[de,b("start","number",!0,"Before value"),b("end","number",!0,"After value")],os=[de,te],as=[b("value","number",!0,"Value field"),b("group","string",!1,"Group (row) field"),b("label","string",!1,"Dot name")],is=[b("group","string",!0,"Group field"),b("value","number",!0,"Value field")],ss=[b("source","string",!1,"Source node"),b("target","string",!1,"Target node"),b("dimensions","string",!1,"Stage columns of a wide table, left to right (2 to 6). Each row is one path, so source and target are not used. Without value, each row counts 1",{multi:!0}),b("value","number",!1,"Value field")],ls=[b("source","string",!0,"Sending group"),b("target","string",!0,"Receiving group"),te],cs=[b("date","date",!0,"Date field"),te],us=[b("x","any",!0,"Period field"),b("series","string",!0,"Item field"),b("rank","number",!1,"Rank field (1 is first)"),b("value","number",!1,"Value field (instead of rank, largest is first)")],ms=[b("group","string",!0,"Group field"),b("value","number",!0,"Value field")],ds=[b("label","string",!1,"Row name field")],fs=[b("x","date",!0,"Date (period) field"),b("open","number",!0,"Open price field"),b("high","number",!0,"High price field"),b("low","number",!0,"Low price field"),b("close","number",!0,"Close price field"),b("volume","number",!1,"Volume field")],hs=[de,te],gs=[b("x","any",!0,"Period field (date or category)"),b("y","number",!0,"Back row fields stacked into each block. An array for wide tables",{multi:!0}),b("series","string",!1,"Series field (long tables, back row only)"),b("front","number",!1,"Front row fields: a smaller outcome in the same unit as y (wide tables only)",{multi:!0})],ps=[b("value","number",!1,"Sample value field (raw rows)"),b("group","string",!1,"Group field. Up to 2 groups overlap"),b("x0","number",!1,"Bin start (pre-binned rows)"),b("x1","number",!1,"Bin end (pre-binned rows)"),b("count","number",!1,"Samples in the bin (pre-binned rows)")],bs=[b("region","string",!0,"Region name or code, matched to a tile of options.map"),te],ys=[de,te,b("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")],xs=[b("source","string",!0,"Source node"),b("target","string",!0,"Target node"),b("value","number",!1,"Link weight. Without it every row counts 1")],ks=[b("label","string",!0,"Row name. Items with the same name share a row"),b("start","any",!0,"Start: a number (minutes, seconds, any unit) or a date or date-time"),b("end","any",!0,"End, same kind as start. Equal to start draws a point event; empty means still open"),b("group","string",!1,"Group field (one color per group, and the legend)"),b("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")],ws=[b("label","string",!0,"Node name field"),b("value","number",!1,"Value field. Sizes the dots; values add up from the leaves"),b("group","string",!1,"Parent group field (flat rows, as in the treemap)"),b("id","string",!1,"Row id for id/parent rows. Defaults to the label"),b("parent","string",!1,"Parent id field. Each row is one node, and rows with an empty parent hang under the root")],$s=[b("region","string",!0,"Region name or code, matched to a region of options.map"),te],vs=[b("lon","number",!1,"Longitude (degrees)"),b("lat","number",!1,"Latitude (degrees)"),b("size","number",!1,"Value (circle area). Without it all circles match"),b("label","string",!1,"Place name"),b("region","string",!1,"Region of options.map, for rows without lon and lat"),b("group","string",!1,"Group field (one color per group)")],Ms=[b("source","string",!0,"Start: a name in options.places or a region"),b("target","string",!0,"End"),b("value","number",!1,"Amount. Without it each row counts 1")],Ts=[b("cohort","any",!0,"Cohort: a name or a start date. Cohorts go in date order when all read as dates, otherwise in order of first appearance"),b("period","any",!0,"Periods since the cohort started: 0, 1, 2 ... In number order when all are numbers"),b("value","number",!0,"People still active, or the share still active (see options.valueType)"),b("size","number",!1,"Cohort size. The first value of each cohort counts")],Ss=[b("x","any",!0,"x field (date, number or category)"),b("y","number",!0,"y field. An array for wide tables",{multi:!0}),b("series","string",!1,"Series field (long tables)")],Cs=[b("x","number",!0,"x value"),b("y","number",!0,"y value"),b("series","string",!1,"Series field (one color per series)"),b("label","string",!1,"Name")],As=[b("label","string",!0,"Row name field (one row per metric)"),b("x","any",!0,"Period field (date, number or category). Every row shares the same period axis"),te,b("target","number",!1,"Target field. Each row uses its last filled value")],Gr={pie:Ei,donut:Ii,funnel:Oi,waffle:zi,treemap:Bi,sunburst:ji,waterfall:Gi,pareto:Hi,marimekko:Wi,heatmap:Vi,radar:Ki,bubble:Ui,line:Xi,area:Yi,stream:Ji,bar:qi,radialBar:Zi,gauge:Qi,bullet:es,sparkline:ts,slope:ns,dumbbell:rs,lollipop:os,beeswarm:as,ridgeline:is,sankey:ss,chord:ls,calendar:cs,bump:us,box:ms,parallel:ds,candlestick:fs,segmented:hs,skyline:gs,histogram:ps,scatter:Cs,tileMap:bs,barRace:ys,network:xs,timeline:ks,tree:ws,choropleth:$s,symbolMap:vs,flowMap:Ms,sparkTable:As,cohort:Ts,horizon:Ss},We={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:"흐름 지도"},sparkTable:{component:"SparkTable",name:"KPI table",nameKo:"지표 표"},cohort:{component:"CohortChart",name:"Cohort chart",nameKo:"코호트 차트"},horizon:{component:"HorizonChart",name:"Horizon chart",nameKo:"호라이즌 차트"}};function Wr(e,t){return t==="ko"?e.nameKo:e.name}function Vr(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var Kr=["line","area","bar","scatter"],Ur=24;var Sn=["line","area","bar","scatter","timeline"];function Cn(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"&&n.layout!=="diverging"?[].concat(t.line??[]).map(String):[]}function Xr(e,t,n){return Sn.includes(e)&&!Cn(e,t,n).length&&!(e==="scatter"&&Dt(n))}function Dt(e){return!!e&&typeof e=="object"&&e.bin==="hex"}function Yr(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var Ns={doughnut:"donut",column:"bar",stackedBar:"bar",groupedBar:"bar",butterfly:"bar",pyramid:"bar",populationPyramid:"bar",stacked:"area",streamgraph:"stream",radial:"radialBar",radialbar:"radialBar",progress:"gauge",progressRing:"gauge",kpi:"gauge",violin:"box",boxplot:"box",raincloud:"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",alluvial:"sankey",parallelSets:"sankey",kpiTable:"sparkTable",metricTable:"sparkTable",sparklineTable:"sparkTable",retention:"cohort",cohortTable:"cohort",retentionTable:"cohort",horizonChart:"horizon",horizonGraph:"horizon"};function Et(e){let t=Gr[e]?e:Ns[e]??Object.keys(We).find(n=>n.toLowerCase()===e.toLowerCase()||We[n].component.toLowerCase()===e.toLowerCase());if(!(!t||!We[t]))return{type:t,component:We[t].component,name:We[t].name,nameKo:We[t].nameKo,encoding:Gr[t]}}function Jr(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 Et(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 qr(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function Rs(e,t){if(e==null||typeof e!="object")return;let n=e;if(qr(n,t))return n[t];if(t.includes(".")){let r=n;for(let o of t.split(".")){if(r===null||typeof r!="object"||!qr(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 Oe(e,t){if(typeof e=="function")return e;let n=e??t;return r=>Rs(r,n)}function Ve(e,t){let n=Oe(e,t);return(r,o)=>Me(n(r,o))}function ye(e,t){let n=Oe(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 xe(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}function Fs(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,a=[","," ",";","|"],i=",",s=0;for(let l of a){let c=o(l);c>s&&(s=c,i=l)}return i}var _s=/^[-+(]?[₩$€£¥]?\s?\d[\d,]*(\.\d+)?([eE][-+]?\d+)?\)?\s?(%|원|명|건|개|회)?$/;function Zr(e){let t=e.trim();if(t==="")return null;if(/^-?0\d/.test(t))return t;if(_s.test(t)||/^[-+]?\.\d+$/.test(t)){let n=Me(t);if(Number.isFinite(n))return n}return t}function ze(e,t={}){let{typed:n=!0,header:r=!0}=t,o=e.replace(/^\uFEFF/,"");if(!o.trim())return[];let a=t.delimiter??Fs(o),i=[],s=[],l="",c=!1;for(let h=0;h<o.length;h++){let p=o[h];c?p==='"'?o[h+1]==='"'?(l+='"',h++):c=!1:l+=p:p==='"'&&!l.trim()?(c=!0,l=""):p===a?(s.push(l),l=""):p===`
|
|
24
24
|
`||p==="\r"?(p==="\r"&&o[h+1]===`
|
|
25
|
-
`&&h++,s.push(l),i.push(s),s=[],l=""):l+=p}(l!==""||s.length)&&(s.push(l),i.push(s));let d=i.filter(h=>!(h.length===1&&h[0].trim()===""));if(!d.length)return[];let u=h=>n?Zr(h):h;if(!r)return d.map(h=>Object.fromEntries(h.map((p,x)=>[String(x),u(p)])));let m=[],f=new Set;return d[0].forEach((h,p)=>{let x=h.trim()||`col${p+1}`,g=x;for(let $=2;f.has(g);$++)g=`${x}_${$}`;f.add(g),m.push(g)}),d.slice(1).map(h=>Object.fromEntries(m.map((p,x)=>[p,u(h[x]??"")])))}function An(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"?Zr(i[l]):i[l]??null])))}function Fs(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 Qr(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 Le(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return Le(JSON.parse(t))}catch{}return ze(t)}if(Array.isArray(e))return e.length?Array.isArray(e[0])?An(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)?Le(t.data):Array.isArray(t.rows)&&Array.isArray(t.columns)?An(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)?Le(t.rows):Array.isArray(t.values)?An(t.values):Array.isArray(t.items)?Le(t.items):Array.isArray(t.results)?Le(t.results):Fs(t)}return[]}function It(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 Nn(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 m=0;m<n;m++){let f=i(m,c),h=f-i(m,c-1),p=0;for(let x=0;x<m;x++)p+=i(x,c)-i(x,c-1);d+=f,u+=(h/2+p)*f}d&&(l-=u/d),s[c]=l}}for(let l=0;l<r;l++){if(t==="zero"){let u=0,m=0;for(let f=0;f<n;f++){let h=e[f][l],p=Number.isFinite(h)?h:0;p>=0?(o[f][l]=u,u+=p,a[f][l]=u):(o[f][l]=m,m+=p,a[f][l]=m)}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 m=i(u,l);t==="expand"&&(m=c?m/c*100:0),o[u][l]=d,d+=m,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 m=0;m<r;m++)o[u][m]-=d,a[u][m]-=d}return{y0:o,y1:a}}function eo(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 to(e){let t=e.length,n=e.map(c=>{let d=0,u=-1/0;return c.forEach((m,f)=>{m>u&&(u=m,d=f)}),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 Rs=Math.PI*2;function at(e,t,n){return e<t?t:e>n?n:e}function Ot(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function no(e){let t=-1,n=-1/0;return e.forEach((r,o)=>{r>n&&(n=r,t=o)}),t}function oo(e){return e>=44032&&e<=55203||e>=4352&&e<=4607||e>=12592&&e<=12687||e>=19968&&e<=40959}function ro(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 zt=new Map;function ne(e,t,n=400){let r=String(e),o=`${r}|${n>=600?1:0}`,a=zt.get(o);if(a===void 0){let i=0,s=0;for(let l=0;l<r.length;l++){let c=r.charCodeAt(l);oo(c)?i+=ro(c):s+=ro(c)}a=i+s*(n>=600?1.07:1),zt.size>5e3&&zt.clear(),zt.set(o,a)}return a*t}function Bt(e,t,n,r=400){if(e=e.trim(),ne(e,n,r)<=t)return e;let o="…",a=0,i=e.length;for(;a<i;){let l=a+i+1>>1;ne(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<(oo(s.charCodeAt(0))?2:3)?"":s+o}var io=C(O(),1),Ps=e=>Array.isArray(e)&&e.length===2;function ao(e){let t=[];for(let n of e??[])n.type==="line"&&typeof n.y=="number"?t.push(n.y):n.type==="band"&&Ps(n.y)&&t.push(Number(n.y[0]),Number(n.y[1]));return t.filter(Number.isFinite)}var lo=C(O(),1),Fn=10.5;function Ls(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 so(e,t,n){let r=18;for(let o of Ls(e,t,n))r=Math.max(r,ne(o,Fn));return Math.ceil(r+8)}function Rn(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 Ke(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=Rn(i,n),c=[o,a];for(let d=0;d<4;d++){let u=Math.ceil(a/l-1e-9)*l,m=Math.floor(o/l+1e-9)*l;c=[o===0?0:o-m<=l*.3?m:o-i*s,a===0?0:u-a<=l*.3?u:a+i*s];let f=Rn(c[1]-c[0],n);if(f===l)break;l=f}return c}function co(e,t,n=4){let r=Math.min(e,t),o=Math.max(e,t),a=Rn(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 Pn(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)=>co(n,r,l),s}function Ln(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]=Ke(r,o,Math.max(n,Math.ceil(o-r)),{zero:!1});return[10**a,10**i]}function _s(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 m=Math.floor(r);m<=Math.ceil(o);m++)if(!(m%d))for(let f of c){let h=Number((f*10**m).toPrecision(12));h>=e*(1-1e-9)&&h<=t*(1+1e-9)&&u.push(h)}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:co(e,t,3)}function uo(e,t){let n=Pn([Math.log10(e[0]),Math.log10(e[1])],t),r=(o=>o>0?n(Math.log10(o)):Number.NaN);return r.domain=e,r.range=t,r.invert=o=>10**n.invert(o),r.ticks=()=>_s(e[0],e[1],Math.abs(t[1]-t[0])),r}function it(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 Ds=864e5;function mo(e,t,n,r=oe){let o=t-e;if(!(o>0))return[{t:e,label:ot(e,{locale:r,month:"short",day:"numeric"})}];let a=o/Ds,i=[],s=new Date(e),l=new Date(e).getFullYear()===new Date(t).getFullYear(),c=(d,u,m,f=!1)=>{let h=new Date(d),p=-1,x=0;for(;h.getTime()<=t&&x++<500;){if(h.getTime()>=e){let g=h.getFullYear(),$=f&&!l&&g!==p;i.push({t:h.getTime(),label:ot(h,{locale:r,...m,...$?{year:"numeric"}:{}})}),p=g}u(h)}};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(f=>f>=d)??12,m=new Date(s);m.setMinutes(0,0,0),c(m,f=>f.setHours(f.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))),m=[1,2,3,6,12,24,60].find(f=>f>=u)??120;if(m>=12){let f=new Date(s.getFullYear()+(s.getMonth()>0||s.getDate()>1?1:0),0,1);c(f,h=>h.setFullYear(h.getFullYear()+m/12),{year:"numeric"})}else{let f=new Date(s.getFullYear(),s.getMonth()+(s.getDate()>1?1:0),1),h=f.getMonth()%m;h&&f.setMonth(f.getMonth()+(m-h)),c(f,p=>p.setMonth(p.getMonth()+m),{month:"short"},!0)}}return i}function fo(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 Es=(e,t,n)=>e==="date"?At(t,n)?.getTime()??NaN:Me(t);function Is(e){let t=e.filter(n=>n!=null&&n!=="");return t.length?t.every(n=>n instanceof Date)||t.every(n=>typeof n=="string"&&_r(n.trim()))?"date":t.every(n=>typeof n=="number"||typeof n=="string"&&/^-?\d+(\.\d+)?$/.test(n.trim()))?"number":"band":"band"}function st(e,t,n,r,o={}){let a=Oe(t,"x"),i=Array.isArray(n),s=i?n:null,l=i?null:Oe(n,"y"),c=!i&&r!==void 0?Oe(r,"series"):null,d=e.map((T,b)=>a(T,b)),u=o.xType??Is(d),m=o.locale??oe,f,h,p;if(u==="band"){let T=d.map(S=>String(S??""));f=xe(T);let b=new Map(f.map((S,L)=>[S,L]));h=f.map((S,L)=>L),p=Int32Array.from(T,S=>b.get(S)??-1)}else{let T=u==="date"?o.dayFirst??Dr(d):void 0,b=d.map(j=>Es(u,j,T)),S=Array.from(new Set(b.filter(j=>Number.isFinite(j)))).sort((j,ae)=>j-ae),L=new Map(S.map((j,ae)=>[j,ae]));h=S,f=S.map(String),p=Int32Array.from(b,j=>L.get(j)??-1)}let x=o.dateFormat,g=T=>typeof T=="string"?Ct(T.trim())?.[3]:void 0,$=u==="date"&&d.length<5e3?g(d[0]):void 0,v=($===2||$===3)&&d.every(T=>g(T)===$),A=v&&$===3;if(u==="date"&&!x){let T=h.length>1?h[h.length-1]-h[0]:0;x=v&&$===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&&(x={year:"numeric",month:"short"})}let k;if(u==="band")k=f;else if(A&&!o.dateFormat){let T=U(m)==="ko";k=h.map(b=>{let S=new Date(b),L=Math.floor(S.getMonth()/3)+1;return T?`${S.getFullYear()}년 ${L}분기`:`Q${L} ${S.getFullYear()}`})}else{let T=h.every(kn),b=u==="date"?new Intl.DateTimeFormat(m,x):new Intl.NumberFormat(m,T?{useGrouping:!1}:{maximumFractionDigits:6});k=h.length>1e3?fo(h.length,S=>b.format(h[S])):h.map(S=>b.format(S))}let R=s?[...s]:c?xe(e.map((T,b)=>String(c(T,b)??""))):[""],F=new Map(R.map((T,b)=>[T,b])),E=R.map(()=>new Array(f.length).fill(NaN)),I=R.map(()=>new Array(f.length).fill(null)),z=o.aggregate??"sum",P=z==="mean"?R.map(()=>new Uint32Array(f.length)):null,M=(T,b,S,L)=>{let j=E[T][b];z==="last"?E[T][b]=S:z==="count"?E[T][b]=(Number.isFinite(j)?j:0)+1:z==="mean"?Number.isFinite(S)&&(E[T][b]=(Number.isFinite(j)?j:0)+S,P[T][b]++):E[T][b]=Number.isFinite(j)?j+(Number.isFinite(S)?S:0):S,I[T][b]=L};for(let T=0;T<e.length;T++){let b=p[T];if(b<0)continue;let S=e[T];if(s)for(let L=0;L<s.length;L++)M(L,b,Me(S[s[L]]),S);else{let L=c?F.get(String(c(S,T)??""))??0:0;M(L,b,Me(l(S,T)),S)}}if(P)for(let T=0;T<E.length;T++)for(let b=0;b<f.length;b++)P[T][b]>1&&(E[T][b]/=P[T][b]);return{type:u,keys:f,xnum:h,labels:k,series:R,values:E,rows:I}}var Os=140,ct=12,ho=14,_n=20,go=12.5;function zs(e,t,n=Ur){let r=ye(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 Bs(e,t,n){if(t<1)return 1;let r=Math.max(1,Math.floor((e+ct)/(Os+ct))),o=Math.max(1,Math.min(r,Number.isInteger(n)&&n>=1?n:r,t));return Math.ceil(t/Math.ceil(t/o))}function js(e,t,n){let r=Math.max(40,Math.floor((e-(t-1)*ct)/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 lt=e=>e.filter(Number.isFinite);function jt(e,t){let n=[];for(let r of Array.isArray(t)?t:t===void 0?[]:[t]){let o=Ve(r,String(r));e.forEach((a,i)=>n.push(o(a,i)))}return lt(n)}function po(e,t,n,r,o,a){return st(t,n.x,r,o,{xType:e==="bar"?"band":n.xType,aggregate:a,dayFirst:n.dayFirst})}function Gs(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 k=t.flat(),R=r.refLines??{},[F,E]=it([...jt(k,r.x??"x"),...lt([Number(R.x)])]),[I,z]=it([...jt(k,r.y??"y"),...lt([Number(R.y)])].filter(M=>!s||M>0)),P=r.zero??!1;return{y:c??(s?Ln(I,z,i):Ke(I,z,i,{zero:P,pad:.08})),x:r.xDomain??Ke(F,E,Math.max(2,Math.round(o/110)),{zero:P,pad:.06}),sameKeys:!0}}let d=e==="bar",u=d&&r.orientation==="horizontal",m=n[0]?.keys.join(""),f=n.every(k=>k.keys.join("")===m),h=n.length>0&&n.every(k=>k.type!=="band"&&k.type===n[0].type),p=r.xDomain??(!d&&h?it(n.flatMap(k=>lt(k.xnum))):void 0),x=d?r.layout??"grouped":e==="area"?r.stack??"auto":"none";if(x==="percent")return{x:p,sameKeys:f};if(c)return{y:c,x:p,sameKeys:f};let g=[];t.forEach((k,R)=>{let F=n[R];if(x==="stacked"||x==="auto"&&F.series.length>1){let I=Nn(F.values,"zero");I.y0.forEach(z=>g.push(...z)),I.y1.forEach(z=>g.push(...z))}else F.values.forEach(I=>g.push(...I));d&&!u&&r.line!==void 0&&po(e,k,r,[].concat(r.line),void 0,r.series===void 0?r.aggregate:"mean").values.forEach(I=>g.push(...I)),d||g.push(...jt(k,r.lower),...jt(k,r.upper))}),d&&g.push(0),u||g.push(...ao(r.annotations));for(let k of r.referenceLines??[])g.push(k.y);r.signColors&&g.push(Number(r.baseline??0));let[$,v]=it(lt(g).filter(k=>!s||k>0));return{y:s?Ln($,v,i):d?Ke($,v,u?Math.max(2,Math.round(o/120)):i):Ke($,v,i,{zero:r.zero??e==="area"}),x:p,sameKeys:f}}function Hs(e,t,n,r,o,a,i,s){if(e!=="line"&&e!=="area"||!o.x||!o.y)return;let l=st(t.flat(),r.x,r.y,void 0,{xType:r.xType,locale:s,dayFirst:r.dayFirst}),c=(r.yScale==="log"&&e==="line"?uo:Pn)(o.y,[i-22,10]).ticks(Math.max(2,Math.round(i/70))),d=so(c,Fr(r.format,s,Math.max(Math.abs(o.y[0]),Math.abs(o.y[1]))),s),u=n.flatMap(k=>k.series),m=r.endLabels??n.some(k=>k.series.length>1),f=d+6,h=a-(m?Math.min(a*.28,Math.max(...u.map(k=>ne(k,11,700)),20)+14):10),p=l.keys.length,[x,g]=o.x[1]===o.x[0]?[o.x[0],o.x[0]+1]:o.x,$=l.type==="number"?p>12:p>mo(x,g,Math.max(2,Math.floor((h-f)/64)),s).length;if(l.type==="band"||!p||$)return;let v=k=>f+(l.xnum[k]-x)/(g-x)*(h-f),A=k=>ne(l.labels[k],Fn);for(let k=1;;k++){let R=Array.from({length:Math.ceil(p/k)},(F,E)=>E*k);if(k>=p||R.every((F,E)=>!E||v(F)-v(R[E-1])>=(A(F)+A(R[E-1]))/2+8))return R.map(F=>({value:l.xnum[F],label:l.labels[F]}))}}function Ws(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 Vs(e,t,n,r){let o=[n.x,n.y,n.series].map(a=>JSON.stringify(a??null)).join("|");return`ztd-facet-${Ws(`${e}|${t}|${o}|${It(r)}`)}`}function Ks(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 Us={en:{intro:(e,t)=>`${ve(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 bo(e){let{type:t,chartProps:n}=e,{values:r,groups:o,dropped:a}=zs(e.data,e.by),i=r.length,s=typeof e.width=="number"&&Number.isFinite(e.width)&&e.width>0?e.width:480,l=Bs(s,i,e.columns),{pw:c,ph:d}=js(s,l,e.height),u=e.scale!=="free",m=t==="scatter"?[]:o.map(P=>po(t,P,n,n.y,n.series,n.aggregate)),f=u?Gs(t,o,m,n,c,d):{sameKeys:!1},h=u?Hs(t,o,m,n,f,c,d,e.locale):void 0,p=t==="bar"&&n.orientation==="horizontal",x=u&&(!p||f.sameKeys),g=u&&(p||f.x!==void 0||f.sameKeys),$=new Set(Ks(e.highlight,r)?[e.highlight].flat():[]),v=$.size>0,A=t==="bar"&&!Array.isArray(n.y)&&n.series===void 0||t==="scatter"&&n.series===void 0,k=e.syncId??Vs(t,e.by,n,e.data),R=St(Ie(n.format,e.locale),n.unit),F=Us[e.lang],E=[],I=r.map(P=>P===""?F.blank:P);return{panels:r.map((P,M)=>{let T=o[M],b=I[M],S=M%l,L;if(t!=="scatter"){let ae=m[M],ue=Z=>ae.values.reduce((me,et)=>me+(Number.isFinite(et[Z])?et[Z]:0),0),W=ae.keys.map((Z,me)=>me).filter(Z=>ae.values.some(me=>Number.isFinite(me[Z]))),Y=W[W.length-1];E.push({first:W.length?ue(W[0]):NaN,last:W.length?ue(Y):NaN,total:W.reduce((Z,me)=>Z+ue(me),0)}),t!=="bar"&&ae.series.length===1&&Y!==void 0&&(L=R(ae.values[0][Y]))}else E.push({first:NaN,last:NaN,total:T.length});let j={data:T,width:c,height:d,ariaLabel:e.title?`${e.title}, ${b}`:b,syncId:k,highlight:v?$.has(P)?A?()=>!0:void 0:"none":e.highlight,showYAxis:!x||S===0,showXAxis:!g||M+l>=i};return f.y&&(j.yDomain=f.y),f.x&&(j.xDomain=f.x),h&&(j.xTicks=h),{value:P,label:b,props:j,last:L,isPicked:$.has(P)}}),cols:l,pw:c,ph:d,isPanelPick:v,description:Xs(t,e.by,I,E,a,R,F)}}function Xs(e,t,n,r,o,a,i){let s=i.intro(n.length,t),l=c=>no(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,m)=>r[m].last<r[m].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 ce=C(K(),1);function Ys(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function Js(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 Gt={threshold:.25,enoughPx:96,rootMargin:"0px"};function ko(e,t=!0){let[n,r]=(0,ce.useState)({visible:!t,near:!t});return(0,ce.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=Js(i[i.length-1],Gt.threshold,Gt.enoughPx);r(l=>l.visible===s?l:{...l,visible:s,near:l.near||s})},{threshold:Ys(Gt.threshold),rootMargin:Gt.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 yo(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function Ht(e){let[t,n]=(0,ce.useState)(null),[r,o]=(0,ce.useState)(e??null),a=(0,ce.useCallback)(i=>{n(i),i&&e===void 0&&o(yo(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(yo(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 qs=()=>()=>{};function Ue(){return(0,ce.useSyncExternalStore)(qs,()=>!0,()=>!1)}var xo="(prefers-reduced-motion: reduce)";function Wt(e="auto"){let[t,n]=(0,ce.useState)(()=>he&&typeof window.matchMedia=="function"?window.matchMedia(xo).matches:!1);return(0,ce.useEffect)(()=>{if(e!=="auto"||!he||typeof window.matchMedia!="function")return;let r=window.matchMedia(xo),o=()=>n(r.matches);return o(),r.addEventListener?.("change",o),()=>r.removeEventListener?.("change",o)},[e]),e===!0?!0:e===!1?!1:t}var ke=C(O(),1),Zs=60,Qs=420;function wo(e){let t=be(),n=e.chartProps??{},[,r,o]=Ht(e.width),a=e.width??(o||480),i=se(e.locale??n.locale),s=U(i),l=(0,Xe.useContext)(je),c=e.title??l,d=e.chart.facetPlan,u=(0,Xe.useMemo)(()=>{let g=bo({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(g,n,i):g},[e.type,e.data,e.by,e.columns,e.scale,JSON.stringify(n,(g,$)=>typeof $=="function"?String($):$),e.highlight,e.syncId,a,e.height,c,i,s,d]),m=`${(0,Xe.useId)().replace(/:/g,"")}fd`,f=Wt(n.reducedMotion??"auto"),h=Ue(),p=bt({motion:{enabled:n.animate!==!1&&!f&&he},hydrated:h},{waiting:!1,generation:0}),x=e.chart;return(0,ke.jsxs)("div",{ref:r,role:"group","aria-label":c,"aria-describedby":m,className:e.className,style:{position:"relative",width:"100%",...e.style},children:[(0,ke.jsx)("p",{id:m,style:_t,children:e.description??u.description}),(0,ke.jsx)("div",{style:{display:"grid",gridTemplateColumns:`repeat(${u.cols}, minmax(0, 1fr))`,columnGap:ct,rowGap:ho,...u.legend?{marginTop:Dn}:null},children:u.panels.map((g,$)=>{let v=t.paint(g.isPicked?"accentText":u.isPanelPick?"muted":"ink");return(0,ke.jsxs)("div",{"data-facet":g.value,style:{minWidth:0,...pt(p,!1,"fade",$*Zs,Qs)},children:[(0,ke.jsxs)("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,height:_n,fontSize:go,fontWeight:700,lineHeight:`${_n}px`,color:v},children:[(0,ke.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:g.label}),g.last!==void 0?(0,ke.jsx)("span",{style:{flex:"none",fontVariantNumeric:"tabular-nums"},children:g.last}):null]}),(0,ke.jsx)(x,{...n,...g.props})]},g.value)})}),u.legend?(0,ke.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",top:0,right:0,height:Dn},children:u.legend}):null]})}var Vt=["max","min","first","last","none"];function we(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((m,f)=>{Number.isFinite(m)&&(c==="max"?m>u:m<u)&&(u=m,d=f)}),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 fe=C(K(),1);async function el(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(U(r)==="ko"?`데이터 대신 HTML 페이지를 받았어요. 주소를 확인해 주세요${n?`: ${n}`:"."}`:`Got an HTML page instead of data${n?` (${n})`:""}. Check the URL.`);if(t==="csv")return ze(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 ze(a);let i=a.trim();return i.startsWith("{")||i.startsWith("[")?JSON.parse(i):ze(a)}async function tl(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 el(a,t.parse,o,t.locale)}return t.select&&(r=Qr(r,t.select)),t.transform?t.transform(r):Le(r)}function $o(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:o=!0}=t,[a,i]=(0,fe.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,l]=(0,fe.useState)(0),c=se(t.locale),d=(0,fe.useRef)(t);d.current={...t,locale:c};let u=(0,fe.useRef)(e);u.current=e;let m=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",f=t.deps??[],h=JSON.stringify(f.map(g=>typeof g=="object"?JSON.stringify(g):String(g))),p=(0,fe.useRef)(!1);(0,fe.useEffect)(()=>{let g=u.current;if(!g||!r){i(A=>A.status==="loading"?{...A,status:"idle"}:A);return}let $=new AbortController,v=!0;return p.current=!0,i(A=>({...A,data:o?A.data:[],status:"loading",error:null})),tl(g,{...d.current,signal:$.signal}).then(A=>{v&&i({data:A,status:"success",error:null,updatedAt:Date.now()})}).catch(A=>{!v||$.signal.aborted||i(k=>({...k,status:"error",error:A instanceof Error?A:new Error(String(A))}))}).finally(()=>{v&&(p.current=!1)}),()=>{v=!1,p.current=!1,$.abort()}},[m,r,s,h,o]),(0,fe.useEffect)(()=>{if(!n||!r)return;let g=setInterval(()=>{p.current||l($=>$+1)},n);return()=>clearInterval(g)},[n,r]);let x=(0,fe.useCallback)(()=>l(g=>g+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:x}}var In=C(O(),1),nl=["csv","svg","png"],rl=/^[=+\-@\t\r\n=+-@]/,ol=/var\(|color-mix\(/;function vo(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?Rr(e.getTime()):String(e);return`"${(rl.test(t)&&!Number.isFinite(Me(t))?`'${t}`:t).replace(/"/g,'""')}"`}function al(e){return[...new Set(e.slice(0,200).flatMap(t=>t&&typeof t=="object"?Object.keys(t):[]))]}function il(e,t){return`\uFEFF${[t.map(vo),...e.map(r=>t.map(o=>vo(r[o])))].map(r=>r.join(",")).join(`\r
|
|
25
|
+
`&&h++,s.push(l),i.push(s),s=[],l=""):l+=p}(l!==""||s.length)&&(s.push(l),i.push(s));let d=i.filter(h=>!(h.length===1&&h[0].trim()===""));if(!d.length)return[];let u=h=>n?Zr(h):h;if(!r)return d.map(h=>Object.fromEntries(h.map((p,x)=>[String(x),u(p)])));let m=[],f=new Set;return d[0].forEach((h,p)=>{let x=h.trim()||`col${p+1}`,g=x;for(let $=2;f.has(g);$++)g=`${x}_${$}`;f.add(g),m.push(g)}),d.slice(1).map(h=>Object.fromEntries(m.map((p,x)=>[p,u(h[x]??"")])))}function An(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"?Zr(i[l]):i[l]??null])))}function Ps(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 Qr(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 Pe(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return Pe(JSON.parse(t))}catch{}return ze(t)}if(Array.isArray(e))return e.length?Array.isArray(e[0])?An(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)?Pe(t.data):Array.isArray(t.rows)&&Array.isArray(t.columns)?An(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)?Pe(t.rows):Array.isArray(t.values)?An(t.values):Array.isArray(t.items)?Pe(t.items):Array.isArray(t.results)?Pe(t.results):Ps(t)}return[]}function It(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 Nn(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 m=0;m<n;m++){let f=i(m,c),h=f-i(m,c-1),p=0;for(let x=0;x<m;x++)p+=i(x,c)-i(x,c-1);d+=f,u+=(h/2+p)*f}d&&(l-=u/d),s[c]=l}}for(let l=0;l<r;l++){if(t==="zero"){let u=0,m=0;for(let f=0;f<n;f++){let h=e[f][l],p=Number.isFinite(h)?h:0;p>=0?(o[f][l]=u,u+=p,a[f][l]=u):(o[f][l]=m,m+=p,a[f][l]=m)}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 m=i(u,l);t==="expand"&&(m=c?m/c*100:0),o[u][l]=d,d+=m,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 m=0;m<r;m++)o[u][m]-=d,a[u][m]-=d}return{y0:o,y1:a}}function eo(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 to(e){let t=e.length,n=e.map(c=>{let d=0,u=-1/0;return c.forEach((m,f)=>{m>u&&(u=m,d=f)}),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 Ls=Math.PI*2;function at(e,t,n){return e<t?t:e>n?n:e}function Ot(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function no(e){let t=-1,n=-1/0;return e.forEach((r,o)=>{r>n&&(n=r,t=o)}),t}function oo(e){return e>=44032&&e<=55203||e>=4352&&e<=4607||e>=12592&&e<=12687||e>=19968&&e<=40959}function ro(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 zt=new Map;function ne(e,t,n=400){let r=String(e),o=`${r}|${n>=600?1:0}`,a=zt.get(o);if(a===void 0){let i=0,s=0;for(let l=0;l<r.length;l++){let c=r.charCodeAt(l);oo(c)?i+=ro(c):s+=ro(c)}a=i+s*(n>=600?1.07:1),zt.size>5e3&&zt.clear(),zt.set(o,a)}return a*t}function Bt(e,t,n,r=400){if(e=e.trim(),ne(e,n,r)<=t)return e;let o="…",a=0,i=e.length;for(;a<i;){let l=a+i+1>>1;ne(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<(oo(s.charCodeAt(0))?2:3)?"":s+o}var io=C(O(),1),Ds=e=>Array.isArray(e)&&e.length===2;function ao(e){let t=[];for(let n of e??[])n.type==="line"&&typeof n.y=="number"?t.push(n.y):n.type==="band"&&Ds(n.y)&&t.push(Number(n.y[0]),Number(n.y[1]));return t.filter(Number.isFinite)}var lo=C(O(),1),Rn=10.5;function Es(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 so(e,t,n){let r=18;for(let o of Es(e,t,n))r=Math.max(r,ne(o,Rn));return Math.ceil(r+8)}function Fn(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 Ke(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=Fn(i,n),c=[o,a];for(let d=0;d<4;d++){let u=Math.ceil(a/l-1e-9)*l,m=Math.floor(o/l+1e-9)*l;c=[o===0?0:o-m<=l*.3?m:o-i*s,a===0?0:u-a<=l*.3?u:a+i*s];let f=Fn(c[1]-c[0],n);if(f===l)break;l=f}return c}function co(e,t,n=4){let r=Math.min(e,t),o=Math.max(e,t),a=Fn(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 _n(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)=>co(n,r,l),s}function Pn(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]=Ke(r,o,Math.max(n,Math.ceil(o-r)),{zero:!1});return[10**a,10**i]}function Is(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 m=Math.floor(r);m<=Math.ceil(o);m++)if(!(m%d))for(let f of c){let h=Number((f*10**m).toPrecision(12));h>=e*(1-1e-9)&&h<=t*(1+1e-9)&&u.push(h)}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:co(e,t,3)}function uo(e,t){let n=_n([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=()=>Is(e[0],e[1],Math.abs(t[1]-t[0])),r}function it(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 Os=864e5;function mo(e,t,n,r=oe){let o=t-e;if(!(o>0))return[{t:e,label:ot(e,{locale:r,month:"short",day:"numeric"})}];let a=o/Os,i=[],s=new Date(e),l=new Date(e).getFullYear()===new Date(t).getFullYear(),c=(d,u,m,f=!1)=>{let h=new Date(d),p=-1,x=0;for(;h.getTime()<=t&&x++<500;){if(h.getTime()>=e){let g=h.getFullYear(),$=f&&!l&&g!==p;i.push({t:h.getTime(),label:ot(h,{locale:r,...m,...$?{year:"numeric"}:{}})}),p=g}u(h)}};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(f=>f>=d)??12,m=new Date(s);m.setMinutes(0,0,0),c(m,f=>f.setHours(f.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))),m=[1,2,3,6,12,24,60].find(f=>f>=u)??120;if(m>=12){let f=new Date(s.getFullYear()+(s.getMonth()>0||s.getDate()>1?1:0),0,1);c(f,h=>h.setFullYear(h.getFullYear()+m/12),{year:"numeric"})}else{let f=new Date(s.getFullYear(),s.getMonth()+(s.getDate()>1?1:0),1),h=f.getMonth()%m;h&&f.setMonth(f.getMonth()+(m-h)),c(f,p=>p.setMonth(p.getMonth()+m),{month:"short"},!0)}}return i}function fo(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 zs=(e,t,n)=>e==="date"?At(t,n)?.getTime()??NaN:Me(t);function Bs(e){let t=e.filter(n=>n!=null&&n!=="");return t.length?t.every(n=>n instanceof Date)||t.every(n=>typeof n=="string"&&Lr(n.trim()))?"date":t.every(n=>typeof n=="number"||typeof n=="string"&&/^-?\d+(\.\d+)?$/.test(n.trim()))?"number":"band":"band"}function st(e,t,n,r,o={}){let a=Oe(t,"x"),i=Array.isArray(n),s=i?n:null,l=i?null:Oe(n,"y"),c=!i&&r!==void 0?Oe(r,"series"):null,d=e.map((T,y)=>a(T,y)),u=o.xType??Bs(d),m=o.locale??oe,f,h,p;if(u==="band"){let T=d.map(S=>String(S??""));f=xe(T);let y=new Map(f.map((S,P)=>[S,P]));h=f.map((S,P)=>P),p=Int32Array.from(T,S=>y.get(S)??-1)}else{let T=u==="date"?o.dayFirst??Dr(d):void 0,y=d.map(j=>zs(u,j,T)),S=Array.from(new Set(y.filter(j=>Number.isFinite(j)))).sort((j,ae)=>j-ae),P=new Map(S.map((j,ae)=>[j,ae]));h=S,f=S.map(String),p=Int32Array.from(y,j=>P.get(j)??-1)}let x=o.dateFormat,g=T=>typeof T=="string"?Ct(T.trim())?.[3]:void 0,$=u==="date"&&d.length<5e3?g(d[0]):void 0,v=($===2||$===3)&&d.every(T=>g(T)===$),A=v&&$===3;if(u==="date"&&!x){let T=h.length>1?h[h.length-1]-h[0]:0;x=v&&$===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&&(x={year:"numeric",month:"short"})}let k;if(u==="band")k=f;else if(A&&!o.dateFormat){let T=U(m)==="ko";k=h.map(y=>{let S=new Date(y),P=Math.floor(S.getMonth()/3)+1;return T?`${S.getFullYear()}년 ${P}분기`:`Q${P} ${S.getFullYear()}`})}else{let T=h.every(kn),y=u==="date"?new Intl.DateTimeFormat(m,x):new Intl.NumberFormat(m,T?{useGrouping:!1}:{maximumFractionDigits:6});k=h.length>1e3?fo(h.length,S=>y.format(h[S])):h.map(S=>y.format(S))}let F=s?[...s]:c?xe(e.map((T,y)=>String(c(T,y)??""))):[""],R=new Map(F.map((T,y)=>[T,y])),E=F.map(()=>new Array(f.length).fill(NaN)),I=F.map(()=>new Array(f.length).fill(null)),z=o.aggregate??"sum",_=z==="mean"?F.map(()=>new Uint32Array(f.length)):null,M=(T,y,S,P)=>{let j=E[T][y];z==="last"?E[T][y]=S:z==="count"?E[T][y]=(Number.isFinite(j)?j:0)+1:z==="mean"?Number.isFinite(S)&&(E[T][y]=(Number.isFinite(j)?j:0)+S,_[T][y]++):E[T][y]=Number.isFinite(j)?j+(Number.isFinite(S)?S:0):S,I[T][y]=P};for(let T=0;T<e.length;T++){let y=p[T];if(y<0)continue;let S=e[T];if(s)for(let P=0;P<s.length;P++)M(P,y,Me(S[s[P]]),S);else{let P=c?R.get(String(c(S,T)??""))??0:0;M(P,y,Me(l(S,T)),S)}}if(_)for(let T=0;T<E.length;T++)for(let y=0;y<f.length;y++)_[T][y]>1&&(E[T][y]/=_[T][y]);return{type:u,keys:f,xnum:h,labels:k,series:F,values:E,rows:I}}var js=140,ct=12,ho=14,Ln=20,go=12.5;function Gs(e,t,n=Ur){let r=ye(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 Hs(e,t,n){if(t<1)return 1;let r=Math.max(1,Math.floor((e+ct)/(js+ct))),o=Math.max(1,Math.min(r,Number.isInteger(n)&&n>=1?n:r,t));return Math.ceil(t/Math.ceil(t/o))}function Ws(e,t,n){let r=Math.max(40,Math.floor((e-(t-1)*ct)/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 lt=e=>e.filter(Number.isFinite);function jt(e,t){let n=[];for(let r of Array.isArray(t)?t:t===void 0?[]:[t]){let o=Ve(r,String(r));e.forEach((a,i)=>n.push(o(a,i)))}return lt(n)}function po(e,t,n,r,o,a){return st(t,n.x,r,o,{xType:e==="bar"?"band":n.xType,aggregate:a,dayFirst:n.dayFirst})}function Vs(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 k=t.flat(),F=r.refLines??{},[R,E]=it([...jt(k,r.x??"x"),...lt([Number(F.x)])]),[I,z]=it([...jt(k,r.y??"y"),...lt([Number(F.y)])].filter(M=>!s||M>0)),_=r.zero??!1;return{y:c??(s?Pn(I,z,i):Ke(I,z,i,{zero:_,pad:.08})),x:r.xDomain??Ke(R,E,Math.max(2,Math.round(o/110)),{zero:_,pad:.06}),sameKeys:!0}}let d=e==="bar",u=d&&r.orientation==="horizontal",m=n[0]?.keys.join(""),f=n.every(k=>k.keys.join("")===m),h=n.length>0&&n.every(k=>k.type!=="band"&&k.type===n[0].type),p=r.xDomain??(!d&&h?it(n.flatMap(k=>lt(k.xnum))):void 0),x=d?r.layout??"grouped":e==="area"?r.stack??"auto":"none";if(x==="percent")return{x:p,sameKeys:f};if(c)return{y:c,x:p,sameKeys:f};let g=[];t.forEach((k,F)=>{let R=n[F];if(x==="stacked"||x==="auto"&&R.series.length>1){let I=Nn(R.values,"zero");I.y0.forEach(z=>g.push(...z)),I.y1.forEach(z=>g.push(...z))}else R.values.forEach(I=>g.push(...I));d&&!u&&r.line!==void 0&&po(e,k,r,[].concat(r.line),void 0,r.series===void 0?r.aggregate:"mean").values.forEach(I=>g.push(...I)),d||g.push(...jt(k,r.lower),...jt(k,r.upper))}),d&&g.push(0),u||g.push(...ao(r.annotations));for(let k of r.referenceLines??[])g.push(k.y);r.signColors&&g.push(Number(r.baseline??0));let[$,v]=it(lt(g).filter(k=>!s||k>0));return{y:s?Pn($,v,i):d?Ke($,v,u?Math.max(2,Math.round(o/120)):i):Ke($,v,i,{zero:r.zero??e==="area"}),x:p,sameKeys:f}}function Ks(e,t,n,r,o,a,i,s){if(e!=="line"&&e!=="area"||!o.x||!o.y)return;let l=st(t.flat(),r.x,r.y,void 0,{xType:r.xType,locale:s,dayFirst:r.dayFirst}),c=(r.yScale==="log"&&e==="line"?uo:_n)(o.y,[i-22,10]).ticks(Math.max(2,Math.round(i/70))),d=so(c,Rr(r.format,s,Math.max(Math.abs(o.y[0]),Math.abs(o.y[1]))),s),u=n.flatMap(k=>k.series),m=r.endLabels??n.some(k=>k.series.length>1),f=d+6,h=a-(m?Math.min(a*.28,Math.max(...u.map(k=>ne(k,11,700)),20)+14):10),p=l.keys.length,[x,g]=o.x[1]===o.x[0]?[o.x[0],o.x[0]+1]:o.x,$=l.type==="number"?p>12:p>mo(x,g,Math.max(2,Math.floor((h-f)/64)),s).length;if(l.type==="band"||!p||$)return;let v=k=>f+(l.xnum[k]-x)/(g-x)*(h-f),A=k=>ne(l.labels[k],Rn);for(let k=1;;k++){let F=Array.from({length:Math.ceil(p/k)},(R,E)=>E*k);if(k>=p||F.every((R,E)=>!E||v(R)-v(F[E-1])>=(A(R)+A(F[E-1]))/2+8))return F.map(R=>({value:l.xnum[R],label:l.labels[R]}))}}function Us(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 Xs(e,t,n,r){let o=[n.x,n.y,n.series].map(a=>JSON.stringify(a??null)).join("|");return`ztd-facet-${Us(`${e}|${t}|${o}|${It(r)}`)}`}function Ys(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 Js={en:{intro:(e,t)=>`${ve(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 bo(e){let{type:t,chartProps:n}=e,{values:r,groups:o,dropped:a}=Gs(e.data,e.by),i=r.length,s=typeof e.width=="number"&&Number.isFinite(e.width)&&e.width>0?e.width:480,l=Hs(s,i,e.columns),{pw:c,ph:d}=Ws(s,l,e.height),u=e.scale!=="free",m=t==="scatter"?[]:o.map(_=>po(t,_,n,n.y,n.series,n.aggregate)),f=u?Vs(t,o,m,n,c,d):{sameKeys:!1},h=u?Ks(t,o,m,n,f,c,d,e.locale):void 0,p=t==="bar"&&n.orientation==="horizontal",x=u&&(!p||f.sameKeys),g=u&&(p||f.x!==void 0||f.sameKeys),$=new Set(Ys(e.highlight,r)?[e.highlight].flat():[]),v=$.size>0,A=t==="bar"&&!Array.isArray(n.y)&&n.series===void 0||t==="scatter"&&n.series===void 0,k=e.syncId??Xs(t,e.by,n,e.data),F=St(Ie(n.format,e.locale),n.unit),R=Js[e.lang],E=[],I=r.map(_=>_===""?R.blank:_);return{panels:r.map((_,M)=>{let T=o[M],y=I[M],S=M%l,P;if(t!=="scatter"){let ae=m[M],ue=Z=>ae.values.reduce((me,et)=>me+(Number.isFinite(et[Z])?et[Z]:0),0),W=ae.keys.map((Z,me)=>me).filter(Z=>ae.values.some(me=>Number.isFinite(me[Z]))),Y=W[W.length-1];E.push({first:W.length?ue(W[0]):NaN,last:W.length?ue(Y):NaN,total:W.reduce((Z,me)=>Z+ue(me),0)}),t!=="bar"&&ae.series.length===1&&Y!==void 0&&(P=F(ae.values[0][Y]))}else E.push({first:NaN,last:NaN,total:T.length});let j={data:T,width:c,height:d,ariaLabel:e.title?`${e.title}, ${y}`:y,syncId:k,highlight:v?$.has(_)?A?()=>!0:void 0:"none":e.highlight,showYAxis:!x||S===0,showXAxis:!g||M+l>=i};return f.y&&(j.yDomain=f.y),f.x&&(j.xDomain=f.x),h&&(j.xTicks=h),{value:_,label:y,props:j,last:P,isPicked:$.has(_)}}),cols:l,pw:c,ph:d,isPanelPick:v,description:qs(t,e.by,I,E,a,F,R)}}function qs(e,t,n,r,o,a,i){let s=i.intro(n.length,t),l=c=>no(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,m)=>r[m].last<r[m].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 ce=C(K(),1);function Zs(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function Qs(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 Gt={threshold:.25,enoughPx:96,rootMargin:"0px"};function ko(e,t=!0){let[n,r]=(0,ce.useState)({visible:!t,near:!t});return(0,ce.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=Qs(i[i.length-1],Gt.threshold,Gt.enoughPx);r(l=>l.visible===s?l:{...l,visible:s,near:l.near||s})},{threshold:Zs(Gt.threshold),rootMargin:Gt.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 yo(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function Ht(e){let[t,n]=(0,ce.useState)(null),[r,o]=(0,ce.useState)(e??null),a=(0,ce.useCallback)(i=>{n(i),i&&e===void 0&&o(yo(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(yo(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 el=()=>()=>{};function Ue(){return(0,ce.useSyncExternalStore)(el,()=>!0,()=>!1)}var xo="(prefers-reduced-motion: reduce)";function Wt(e="auto"){let[t,n]=(0,ce.useState)(()=>he&&typeof window.matchMedia=="function"?window.matchMedia(xo).matches:!1);return(0,ce.useEffect)(()=>{if(e!=="auto"||!he||typeof window.matchMedia!="function")return;let r=window.matchMedia(xo),o=()=>n(r.matches);return o(),r.addEventListener?.("change",o),()=>r.removeEventListener?.("change",o)},[e]),e===!0?!0:e===!1?!1:t}var ke=C(O(),1),tl=60,nl=420;function wo(e){let t=be(),n=e.chartProps??{},[,r,o]=Ht(e.width),a=e.width??(o||480),i=se(e.locale??n.locale),s=U(i),l=(0,Xe.useContext)(je),c=e.title??l,d=e.chart.facetPlan,u=(0,Xe.useMemo)(()=>{let g=bo({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(g,n,i):g},[e.type,e.data,e.by,e.columns,e.scale,JSON.stringify(n,(g,$)=>typeof $=="function"?String($):$),e.highlight,e.syncId,a,e.height,c,i,s,d]),m=`${(0,Xe.useId)().replace(/:/g,"")}fd`,f=Wt(n.reducedMotion??"auto"),h=Ue(),p=bt({motion:{enabled:n.animate!==!1&&!f&&he},hydrated:h},{waiting:!1,generation:0}),x=e.chart;return(0,ke.jsxs)("div",{ref:r,role:"group","aria-label":c,"aria-describedby":m,className:e.className,style:{position:"relative",width:"100%",...e.style},children:[(0,ke.jsx)("p",{id:m,style:Lt,children:e.description??u.description}),(0,ke.jsx)("div",{style:{display:"grid",gridTemplateColumns:`repeat(${u.cols}, minmax(0, 1fr))`,columnGap:ct,rowGap:ho,...u.legend?{marginTop:Dn}:null},children:u.panels.map((g,$)=>{let v=t.paint(g.isPicked?"accentText":u.isPanelPick?"muted":"ink");return(0,ke.jsxs)("div",{"data-facet":g.value,style:{minWidth:0,...pt(p,!1,"fade",$*tl,nl)},children:[(0,ke.jsxs)("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,height:Ln,fontSize:go,fontWeight:700,lineHeight:`${Ln}px`,color:v},children:[(0,ke.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:g.label}),g.last!==void 0?(0,ke.jsx)("span",{style:{flex:"none",fontVariantNumeric:"tabular-nums"},children:g.last}):null]}),(0,ke.jsx)(x,{...n,...g.props})]},g.value)})}),u.legend?(0,ke.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",top:0,right:0,height:Dn},children:u.legend}):null]})}var Vt=["max","min","first","last","none"];function we(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((m,f)=>{Number.isFinite(m)&&(c==="max"?m>u:m<u)&&(u=m,d=f)}),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 fe=C(K(),1);async function rl(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(U(r)==="ko"?`데이터 대신 HTML 페이지를 받았어요. 주소를 확인해 주세요${n?`: ${n}`:"."}`:`Got an HTML page instead of data${n?` (${n})`:""}. Check the URL.`);if(t==="csv")return ze(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 ze(a);let i=a.trim();return i.startsWith("{")||i.startsWith("[")?JSON.parse(i):ze(a)}async function ol(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 rl(a,t.parse,o,t.locale)}return t.select&&(r=Qr(r,t.select)),t.transform?t.transform(r):Pe(r)}function $o(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:o=!0}=t,[a,i]=(0,fe.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,l]=(0,fe.useState)(0),c=se(t.locale),d=(0,fe.useRef)(t);d.current={...t,locale:c};let u=(0,fe.useRef)(e);u.current=e;let m=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",f=t.deps??[],h=JSON.stringify(f.map(g=>typeof g=="object"?JSON.stringify(g):String(g))),p=(0,fe.useRef)(!1);(0,fe.useEffect)(()=>{let g=u.current;if(!g||!r){i(A=>A.status==="loading"?{...A,status:"idle"}:A);return}let $=new AbortController,v=!0;return p.current=!0,i(A=>({...A,data:o?A.data:[],status:"loading",error:null})),ol(g,{...d.current,signal:$.signal}).then(A=>{v&&i({data:A,status:"success",error:null,updatedAt:Date.now()})}).catch(A=>{!v||$.signal.aborted||i(k=>({...k,status:"error",error:A instanceof Error?A:new Error(String(A))}))}).finally(()=>{v&&(p.current=!1)}),()=>{v=!1,p.current=!1,$.abort()}},[m,r,s,h,o]),(0,fe.useEffect)(()=>{if(!n||!r)return;let g=setInterval(()=>{p.current||l($=>$+1)},n);return()=>clearInterval(g)},[n,r]);let x=(0,fe.useCallback)(()=>l(g=>g+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:x}}var In=C(O(),1),al=["csv","svg","png"],il=/^[=+\-@\t\r\n=+-@]/,sl=/var\(|color-mix\(/;function vo(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?Fr(e.getTime()):String(e);return`"${(il.test(t)&&!Number.isFinite(Me(t))?`'${t}`:t).replace(/"/g,'""')}"`}function ll(e){return[...new Set(e.slice(0,200).flatMap(t=>t&&typeof t=="object"?Object.keys(t):[]))]}function cl(e,t){return`\uFEFF${[t.map(vo),...e.map(r=>t.map(o=>vo(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?ot(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(Lr,(d,u)=>o(a,u.trim())??(l=!0,""));l||i.push(c)}return i.length?i.map((s,l)=>(0,Fo.jsx)("div",{children:s},l)):null}}var Ro=/[가-힣ㄱ-ㆎ]/;function On(e){let t=String(e??"").normalize("NFC").trim().replace(/\s+/g," ").toLowerCase();return/^\d+$/.test(t)?t.replace(/^0+(?=\d)/,""):t}function Kt(e){let t=new Map;return e.forEach((n,r)=>{for(let o of n){let a=On(o);a&&!t.has(a)&&t.set(a,r)}}),n=>t.get(On(n))??-1}function Po(e,t){let n=[...new Set([...new Set(e)].map(On))].filter(Boolean),r=-1,o=0;return t.forEach((a,i)=>{let s=n.filter(l=>a(l)>=0).length;s>o&&(o=s,r=i)}),r}var cl={ArrowRight:[0,1],ArrowLeft:[0,-1],ArrowDown:[1,0],ArrowUp:[-1,0]};function Lo(e,t,n){let r=cl[n],o=e[t];if(!r||!o)return-1;let a=-1,i=1/0;return e.forEach((s,l)=>{let c=(s.row-o.row)*r[0]+(s.col-o.col)*r[1],d=Math.abs(r[0]?s.col-o.col:s.row-o.row);if(c<=0||d>c)return;let u=c+d*2;u<i&&(i=u,a=l)}),a}function _o(e,t,n=!1){let r=ye(t,"group"),o=e.map((s,l)=>r(s,l)).filter(Boolean),a=xe(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)}var ul="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function Do(e){if(typeof e!="string")return[];let t=new Int8Array(128).fill(-1);for(let i=0;i<64;i++)t[ul.charCodeAt(i)]=i;let n=[],r=0,o=1,a=0;for(let i=0;i<e.length;i++){let s=t[e.charCodeAt(i)]??-1;s<0||(r+=(s&31)*o,a++,s&32&&a<7?o*=32:(s&32||n.push(r%2?-(r+1)/2:r/2),r=0,o=1,a=0))}return n}var Eo=new WeakMap,Ut=(e,t)=>typeof e=="number"&&Number.isInteger(e)&&e>=0&&e<=t?e:-1;function zo(e){let t=Eo.get(e);if(t)return t;let n=Array.isArray(e.topo?.t)?e.topo.t:[],[r,o,a]=n.every(p=>Number.isFinite(p))&&n.length>=3?n:[NaN,NaN,NaN],i=Number.isFinite(r)&&r>0,s=i?Do(e.topo.arcs):[],l=[],c=0;for(let p=0;p<s.length;){let x=Ut(s[p++],(s.length-p)/2);if(x<0)break;let g=[],$=0,v=0;for(let A=0;A<x;A++)$+=s[p++],v+=s[p++],g.push([$*r+o,v*r+a]);c+=x,l.push(g)}let d=i?Do(e.topo.shapes):[],u=0,m=c*4,h=(Array.isArray(e.regions)?e.regions:[]).map(p=>{let x=Array.isArray(p)?p.filter(A=>typeof A=="string"):[],g=[];for(let A=Ut(d[u++],d.length-u);A>0;A--){let k=[];for(let R=Ut(d[u++],d.length-u);R>0;R--){let F=[];for(let E=Ut(d[u++],d.length-u),I=0;I<E;I++){let z=d[u++],P=(z>=0?l[z]:l[~z]?.slice().reverse())??[];if(m-=P.length,m<0)break;for(let M=I?1:0;M<P.length;M++)F.push(P[M])}if(F.length>1&&F[0][0]===F[F.length-1][0]&&F[0][1]===F[F.length-1][1]&&F.pop(),F.length>=3&&k.push(F),m<0||u>d.length)break}if(k.length&&g.push(k),m<0||u>d.length)break}let $=x[0]??"",v=e.namesKo?.[$];return{id:$,name:x[1]??$,nameKo:typeof v=="string"?v:void 0,keys:typeof v=="string"?[...x,v]:x,polygons:g}});return Eo.set(e,h),h}var De=e=>typeof e=="string"&&e.trim()!==""?e:typeof e=="number"&&Number.isFinite(e)?String(e):void 0;function Io(e,t){if(!Array.isArray(e))return null;let n=[];for(let r of e){if(!Array.isArray(r)||typeof r[0]!="number"||typeof r[1]!="number"||!Number.isFinite(r[0])||!Number.isFinite(r[1]))continue;let[o,a]=r;a>90||a<-90||o>540||o<-540?(t.n++,a=Math.max(-90,Math.min(90,a)),o=((o+180)%360+360)%360-180):(o>180||o<-180)&&t.n++;let i=n[n.length-1];(!i||i[0]!==o||i[1]!==a)&&n.push([o,a])}return n.length>1&&n[0][0]===n[n.length-1][0]&&n[0][1]===n[n.length-1][1]&&n.pop(),n.length>=3?n:null}function Bo(e,t,n){let r=`${t??""}${n??""}`,o=Oo.get(e),a=o?.get(r);if(a)return a;let i=ml(e,t,n);return o||Oo.set(e,o=new Map),o.set(r,i),i}var Oo=new WeakMap;function ml(e,t,n){let r=[],o=[],a={n:0};return(Array.isArray(e.features)?e.features:[]).forEach((i,s)=>{let l=i&&typeof i.properties=="object"&&i.properties||{},c=i?.geometry,d=c&&Array.isArray(c.coordinates)?c.type==="Polygon"?[c.coordinates]:c.type==="MultiPolygon"?c.coordinates:[]:[],u=[];for(let h of d){if(!Array.isArray(h))continue;let p=Io(h[0],a);p&&u.push([p,...h.slice(1).map(x=>Io(x,a)).filter(x=>x!==null)])}if(!u.length)return void o.push(s);let m=(t?De(l[t]):void 0)??De(i?.id)??De(l.id)??De(l.code)??String(s+1),f=(n?De(l[n]):void 0)??De(l.name)??De(l.NAME)??m;r.push({id:m,name:f,keys:[...new Set([m,f,De(i?.id)].filter(h=>!!h))],polygons:u})}),{shapes:r,skipped:o,outOfRange:a.n}}var ut=["world","us-states","kr-sido"];function Go(){var t;let e=globalThis;return e[t=Symbol.for("ztd-charts.geo.maps")]??(e[t]=new Map)}function Bn(e){let t=e;return!!t&&typeof t=="object"&&typeof t.name=="string"&&Array.isArray(t.regions)&&!!t.topo&&typeof t.topo.arcs=="string"}function dl(e){let t=e;return!!t&&typeof t=="object"&&t.type==="FeatureCollection"&&Array.isArray(t.features)}function zn(e){return Go().get(e)}function fl(){return[...Go().keys()]}function hl(e){return e.regions.map(t=>{let n=Array.isArray(t)?t.filter(o=>typeof o=="string"):[],r=n[0]!==void 0?e.namesKo?.[n[0]]:void 0;return typeof r=="string"?[...n,r]:n})}var jo=new WeakMap;function jn(e){let t=jo.get(e);return t||jo.set(e,t=Kt(hl(e))),t}function Ho(e,t){if(e===void 0||e==="auto"){let n=fl();if(!n.length)return{missing:"auto"};let r=Po(t(),n.map(a=>jn(zn(a)))),o=n[Math.max(0,r)];return{map:zn(o),name:o}}if(typeof e=="string"){let n=zn(e);return n?{map:n,name:e}:{missing:e}}return Bn(e)?{map:e,name:e.name}:dl(e)?{map:e}:null}var Je=.017453292519943295,Gn=e=>((e+180)%360+360)%360-180,Wo=1.340264,Vo=-.081106,Ko=893e-6,Uo=.003796,Xo=.8660254037844386,gl=(e,t)=>{let n=Math.asin(Xo*Math.sin(t)),r=n*n,o=r*r*r;return[e*Math.cos(n)/(Xo*(Wo+3*Vo*r+o*(7*Ko+9*Uo*r))),n*(Wo+Vo*r+o*(Ko+Uo*r))]};function Xt(e,t){let n=Math.sin(e*Je),r=(n+Math.sin(t*Je))/2;if(Math.abs(r)<.001)return(i,s)=>[i,Math.sin(s)];let o=1+n*(2*r-n),a=Math.sqrt(o)/r;return(i,s)=>{let l=Math.sqrt(Math.max(0,o-2*r*Math.sin(s)))/r;return[l*Math.sin(i*r),a-l*Math.cos(i*r)]}}function mt(e,t,n=[0,0],r=1,o=[0,0]){let[a,i]=t(n[0]*Je,n[1]*Je);return{lon0:e,raw:(s,l)=>{let[c,d]=t(s*Je,Math.max(-90,Math.min(90,l))*Je);return[r*(c-a)+o[0],-r*(d-i)+o[1]]}}}function Hn(e,t,n,r){let o=e.pick(t,n,r);return o.raw(Gn(t-o.lon0),n)}function Wn(e,t=0,n){if(e==="albersUsa"){let o=mt(-96,Xt(29.5,45.5),[-.6,38.7]),a=mt(-154,Xt(55,65),[-2,58.5],.35,[-.307,.201]),i=mt(-157,Xt(8,18),[-3,19.9],1,[-.205,.212]);return{name:e,pick:(s,l,c)=>c!==void 0?c==="AK"?a:c==="HI"?i:o:l>=50&&(s<=-129||s>=170)?a:l>=18&&l<=23&&s>=-161&&s<=-154?i:o}}if(e==="conic"&&n){let[,o,,a]=n,i=mt(t,Xt(o+(a-o)/6,o+(a-o)*5/6),[0,(o+a)/2]);return{name:e,pick:()=>i}}let r=mt(t,gl);return{name:"equalEarth",pick:()=>r}}function Jo(e){let t=[],n=1/0,r=-1/0;for(let i of e)for(let s of i.polygons)for(let[l,c]of s[0])t.push(Gn(l)),c<n&&(n=c),c>r&&(r=c);if(!t.length)return null;t.sort((i,s)=>i-s);let o=t[0]+360-t[t.length-1],a=t[0];for(let i=1;i<t.length;i++)t[i]-t[i-1]>o&&(o=t[i]-t[i-1],a=t[i]);return[a,n,a+360-o,r]}function qo(e){return e[2]-e[0]>150||e[3]-e[1]>70?"equalEarth":"conic"}function Yo(e,t,n){let r=[];for(let o=0;o<e.length;o++){let a=e[o],i=e[(o+1)%e.length],s=(a[0]-t)*n>=0,l=(i[0]-t)*n>=0;s&&r.push(a),s!==l&&r.push([t,a[1]+(i[1]-a[1])*(t-a[0])/(i[0]-a[0])])}return r}function pl(e){let t=0,n=-1;for(let a=0;a<e.length;a++)Math.abs(e[a][0]-e[(a+e.length-1)%e.length][0])>180&&(t++,n<0&&(n=a));if(!t)return[e];if(t%2){let a=e[(n+e.length-1)%e.length],i=e[n],s=a[0]>0?180:-180,l=360-Math.abs(a[0]-i[0]),c=a[1]+(i[1]-a[1])*(Math.abs(s-a[0])||0)/(l||1),d=e.reduce((u,m)=>u+m[1],0)<0?-90:90;return[[...e.slice(0,n),[s,c],[s,d],[-s,d],[-s,c],...e.slice(n)]]}let r=[e[0]];for(let a=1;a<e.length;a++){let i=e[a][0],s=r[a-1][0];for(;i-s>180;)i-=360;for(;i-s<-180;)i+=360;r.push([i,e[a][1]])}let o=[];for(let a of[-1,0,1]){let i=Yo(Yo(r,a*360-180,1),a*360+180,-1),s=0;for(let l=0,c=i.length-1;l<i.length;c=l++)s+=(i[c][0]-i[l][0])*(i[c][1]+i[l][1]);i.length>=3&&Math.abs(s)>1e-9&&o.push(a?i.map(([l,c])=>[l-a*360,c]):i)}return o}function Zo(e,t){let n=[],r=[],o=[],a=[1/0,1/0,-1/0,-1/0];return t.polygons.forEach((i,s)=>i.forEach((l,c)=>{let d=e.pick(l[0][0],l[0][1],e.name==="albersUsa"?t.id:void 0);for(let u of pl(l.map(([m,f])=>[Gn(m-d.lon0),f]))){let m=new Float64Array(u.length*2);u.forEach(([f,h],p)=>{let[x,g]=d.raw(f,h);m[p*2]=x,m[p*2+1]=g,x<a[0]&&(a[0]=x),g<a[1]&&(a[1]=g),x>a[2]&&(a[2]=x),g>a[3]&&(a[3]=g)}),n.push(m),r.push(s),o.push(c===0)}})),{rings:n,poly:r,outer:o,box:a}}function Qo(e,t){let n=[1/0,1/0,-1/0,-1/0],[r,o,a,i]=t;for(let s=0;s<=24;s++){let l=s/24;for(let[c,d]of[[r+(a-r)*l,o],[r+(a-r)*l,i],[r,o+(i-o)*l],[a,o+(i-o)*l]]){let[u,m]=Hn(e,c,d);n[0]=Math.min(n[0],u),n[1]=Math.min(n[1],m),n[2]=Math.max(n[2],u),n[3]=Math.max(n[3],m)}}return n}function ea(e,t,n){let r=e[2]-e[0],o=e[3]-e[1],a=r>0&&o>0?Math.min(t/r,n/o):1;return{k:a,tx:(t-r*a)/2-e[0]*a,ty:(n-o*a)/2-e[1]*a}}var Ye=e=>Math.round(e*10)/10||0;function Yt(e,t,n,r=0){let o="";for(let a of e){let i="",s=NaN,l=NaN,c=0,d=1/0,u=-1/0,m=1/0,f=-1/0;for(let p=0;p<a.length;p+=2){let x=Ye(a[p]*t.k+t.tx),g=Ye(a[p+1]*t.k+t.ty);Math.abs(x-s)<.35&&Math.abs(g-l)<.35||(i+=c?`${c===1?"l":" "}${Ye(x-s)} ${Ye(g-l)}`:`M${x} ${g}`,s=x,l=g,c++,x<d&&(d=x),x>u&&(u=x),g<m&&(m=g),g>f&&(f=g))}n!==void 0&&(u<0||f<0||d>n[0]||m>n[1])||Math.min(u-d,f-m)<r||(c>=3&&(u-d>=1||f-m>=1)?o+=`${i}Z`:r||(o+=`M${Ye((d+u)/2-.8)} ${Ye((m+f)/2-.8)}h1.6v1.6h-1.6Z`))}return o}function bl(e){let t=0,n=0,r=0,o=e.length/2;for(let a=0,i=o-1;a<o;i=a++){let s=e[i*2]*e[a*2+1]-e[a*2]*e[i*2+1];t+=s,n+=(e[i*2]+e[a*2])*s,r+=(e[i*2+1]+e[a*2+1])*s}return[t/2,t?n/(3*t):NaN,t?r/(3*t):NaN]}function ta(e){let t=new Map,n=e.rings.map(bl);e.rings.forEach((m,f)=>t.set(e.poly[f],(t.get(e.poly[f])??0)+(e.outer[f]?1:-1)*Math.abs(n[f][0])));let r=-1,o=0;for(let[m,f]of t)f>o&&(o=f,r=m);if(r<0)return[NaN,NaN];let a=e.rings.map((m,f)=>f).filter(m=>e.poly[m]===r),i=0,s=0;for(let m of a)e.outer[m]&&(i+=n[m][2]*Math.abs(n[m][0]),s+=Math.abs(n[m][0]));let l=i/s,c=[];for(let m of a){let f=e.rings[m],h=f.length/2;for(let p=0,x=h-1;p<h;x=p++){let g=f[p*2+1],$=f[x*2+1];g>l!=$>l&&c.push(f[p*2]+(f[x*2]-f[p*2])*(l-g)/($-g))}}c.sort((m,f)=>m-f);let d=NaN,u=-1;for(let m=0;m+1<c.length;m+=2)c[m+1]-c[m]>u&&(u=c[m+1]-c[m],d=(c[m]+c[m+1])/2);return[d,l]}function na(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 ze(t.csv)}return null}var ca=C(K(),1);var J=C(K(),1);function ra(e,t){let n=be(e.theme),[r,o,a]=Ht(e.width),i=Ue(),s=e.width??(a||t.ssrWidth||480),l=typeof t.height=="function"?t.height(s):t.height,c=e.height??l,d=Wt(e.reducedMotion??"auto"),u=e.animate!==!1&&!d&&he,m=ko(r,e.animateOnView!==!1&&u),f=se(e.locale),h=U(f),p=(0,J.useMemo)(()=>Ie(e.format,f,t.format),[e.format,f,t.format]),x=(0,J.useCallback)(W=>Tt(W,{locale:f}),[f]),g=(0,J.useMemo)(()=>St(p,e.unit),[p,e.unit]),$=(0,J.useMemo)(()=>It(e.data),[e.data]),[v,A]=(0,J.useState)(null),[k,R]=(0,J.useState)(null),F=(0,J.useRef)([]),E=(0,J.useRef)(e.onHover);E.current=e.onHover;let I=(0,J.useRef)(e.onClick);I.current=e.onClick;let z=(0,J.useRef)(null),P=(0,J.useRef)(null),M=(0,J.useRef)(null),T=(0,J.useCallback)((W,Y="pointer")=>{if(M.current!==W){M.current=W;let Z=W===null?null:F.current[W]??null;queueMicrotask(()=>E.current?.(Z)),P.current?.(W)}z.current=W===null?null:Y,A(W),R(z.current)},[]),b=(0,J.useCallback)(W=>{z.current!=="keyboard"&&(z.current=W===null?null:"sync",A(W),R(z.current))},[]),S=(0,J.useCallback)(W=>{let Y=F.current[W];Y&&I.current?.(Y)},[]),L=zr(e.replayKey),j=e.width!==void 0||(a??0)>0,ae={enabled:u,active:m.visible&&j,near:m.near,replayKey:L,dataKey:$,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},ue=(0,J.useCallback)((W,Y=1)=>v===null||v===W?Y:Y*.38,[v]);return{p:n,width:s,height:c,measured:j,responsive:e.width===void 0,pending:he&&i&&e.width===void 0&&a===null,node:r,hydrated:i,ref:o,motion:ae,fv:g,fmt:p,pct:x,locale:f,lang:h,t:h==="ko"?gr:hr,active:v,via:k,setActive:T,click:S,events:F,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:ue,sig:$,description:e.description,reduced:d,publish:P,applySync:b}}var X=C(K(),1);function yl(e){return 1-Math.pow(1-e,3)}function xl(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function kl(e){return e==="easeInOut"?xl:e==="linear"?t=>t:yl}function wl(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 qe(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 Jt(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 oa(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 aa(e,t,n,r){if(!t||!n||t.length!==n.length)return qe(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 qe(s,n[i]))o.push(l)}return o.length===r?o:qe(e,r)}var qt=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||!Jt(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),oa(n.from,n.vel,n.to),n.cur=n.from.slice(),n.curVel=n.vel.slice(),n.done=Jt(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=aa(s.cur,s.parts,i.parts,c),s.vel=aa(s.curVel,s.parts,i.parts,c),s.parts=i.parts,s.to=i.to.slice(),oa(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=Jt(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=Jt(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=qe(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=kl(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=qe(s.from,c)),s.vel.length!==c&&(s.vel=qe(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),m=a*l>=8&&a*l<20,f=0;for(let h=0;h<c;h++){let p=s.from[h]-s.to[h],x=s.vel[h]+a*p;s.cur[h]=s.to[h]+(p+x*l)*u,s.curVel[h]=(s.vel[h]-a*x*l)*u,m&&f<.15&&(f=Math.max(f,Math.abs(s.cur[h]-s.to[h]),Math.abs(s.curVel[h]/a)))}d=a*l>=20||m&&f<.15,s.progress=Math.min(1,1-(1+a*l)*u)}else{let u=Math.min(1,l/o),m=r(u),f=wl(this.easing,u)/o;for(let h=0;h<c;h++)s.cur[h]=s.from[h]+(s.to[h]-s.from[h])*m,s.curVel[h]=(s.to[h]-s.from[h])*f;d=u>=1,s.progress=m}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}},dt=new Set,Zt=0;function ia(e){Zt=0;let t=Array.from(dt);for(let n of t){let r;try{r=n(e)}catch{r=!1}r||dt.delete(n)}dt.size&&typeof requestAnimationFrame<"u"&&(Zt=requestAnimationFrame(ia))}function sa(e){return dt.add(e),!Zt&&typeof requestAnimationFrame<"u"&&(Zt=requestAnimationFrame(ia)),()=>{dt.delete(e)}}function $l(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 la(e,t){let n=(0,X.useMemo)(()=>$l(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),m=(0,X.useRef)("init"),f=(0,X.useRef)(null),h=(0,X.useRef)(s),p=(0,X.useRef)(i),x=(0,X.useRef)(!1),g=(0,X.useRef)(0),[,$]=(0,X.useState)(0),v=(0,X.useRef)(null),A=(0,X.useRef)(!0);u.current||(u.current=new qt,u.current.configure(l,c),u.current.snap(n),f.current=n);let k=u.current;if(k.configure(l,c),f.current!==n){let P=m.current,M=!Object.is(h.current,s);k.sameTargets(n)?k.refreshData(n):!r||P==="init"?k.snap(n):P==="idle"?k.hold(n):P==="running"||M?k.update(n,xt(),d):k.snap(n),f.current=n,h.current=s}let R=(0,X.useRef)(()=>!1);R.current=P=>{if(!A.current)return!1;let M=k.step(P);return!M&&m.current==="running"&&(m.current="done"),$(T=>(T+1)%1e9),M||(v.current=null),M};let F=(0,X.useCallback)(()=>{if(!he||v.current||!k.animating)return;let P=M=>R.current(M);v.current=sa(P)},[k]);$e(()=>{let P=!Object.is(p.current,i);if(p.current=i,!r){(m.current!=="done"||k.animating)&&(k.snap(f.current??n),m.current="done",$(M=>M+1));return}m.current==="init"||P&&a?(k.hold(f.current??n),m.current="idle",x.current=!1,$(M=>M+1)):P&&(x.current=!0)},[r,i]),$e(()=>{!r||!a||!x.current||(x.current=!1,k.hold(f.current??n),m.current="idle",$(P=>P+1))},[a,r]),(0,X.useEffect)(()=>{r&&o&&m.current==="idle"&&(k.start(xt()),g.current+=1,m.current="running",F(),$(P=>P+1))},[r,o,i,k,F]),(0,X.useEffect)(()=>{k.animating&&F()}),(0,X.useEffect)(()=>(A.current=!0,()=>{A.current=!1,v.current?.(),v.current=null}),[]);let E=xt(),I=k.elapsed(E),z=r&&m.current==="idle";return{items:k.items(),get:P=>k.get(P),elapsed:z?0:I,fade:(P,M=320)=>z?0:Number.isFinite(I)?Math.max(0,Math.min(1,(I-P)/M)):1,waiting:z,animating:k.animating,generation:g.current}}var Vn=C(O(),1);function ua(e,t,n,r,o){if(r)return o==="categorical"?ge(e,t,n):vr(e,t,n);if(o==="categorical")return ge(e,t,n);let a=ee(e,"strong"),i=ee(e,"accent");return Array.from({length:t},(s,l)=>n.has(l)?i:a)}var vl=C(K(),1);var Kn=C(O(),1);var ma=e=>e?"neutralStrong":"accent";var Ze=C(O(),1);function da(e,t){return ne(t[0],10)+10+e*14+ne(t[1],10)}function fa({p:e,right:t,steps:n,scale:r,labels:o,min:a}){let i=r.center,s=t-n*14-ne(o[1],10);return(0,Ze.jsxs)("g",{"aria-hidden":"true",children:[Array.from({length:n},(l,c)=>{let d=Mt(e,i===void 0?c/(n-1):2*c/(n-1)-1,a,r);return(0,Ze.jsx)("rect",{x:s-6+c*14,y:3,width:12,height:9,rx:2,fill:d.fill,opacity:d.opacity},c)}),(0,Ze.jsx)(Ce,{x:s-10,y:7.5,anchor:"end",size:10,fill:e.paint("muted"),children:o[0]}),(0,Ze.jsx)(Ce,{x:t,y:7.5,anchor:"end",size:10,fill:e.paint("muted"),children:o[1]})]})}var Un=C(O(),1);function ha(e,t,n,r){if(typeof e!="function")return we(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 Ml=C(K(),1);var Yn=C(O(),1),Tl={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}, ${ve(n,"candle")}. First open ${r}, last close ${o}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},ga={en:Tl,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}일 이동평균`}},Xn=["ink","muted","dim"];function pa(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,Xn.length)}var q=C(K(),1);var ba=C(K(),1),xa=C(O(),1);function ya({p:e,frame:t,regions:n,opacity:r}){let o=(0,ba.useMemo)(()=>n.map(a=>t.paths[a]).join(""),[t,n]);return o?(0,xa.jsx)("path",{d:o,fill:e.paint("neutralSoft"),fillOpacity:r,stroke:e.paint("panel"),strokeWidth:.6,strokeLinejoin:"round",fillRule:"evenodd",pointerEvents:"none"}):null}var Sl=(e,t)=>e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1],ka=new WeakMap;function wa(e,t={}){let n=Number.isFinite(t.lon0)?((t.lon0+180)%360+360)%360-180:0,r=`${t.focus??""}${t.featureId??""}${t.featureName??""}${n?`${n}`:""}`,o=ka.get(e),a=o?.get(r);if(a)return a;let i=Bn(e)?e:null,s=i?zo(i):Bo(e,t.featureId,t.featureName).shapes,l=new Set(i?.hidden??[]),c=t.focus!==void 0&&i?.focus&&Object.hasOwn(i.focus,t.focus)?i.focus[t.focus]:void 0,d=s.map((g,$)=>$).filter(g=>!l.has(s[g].id)&&s[g].polygons.length),u;if(c)u=Wn("equalEarth",c.lon0);else{let g=Jo(d.map(v=>s[v]))??[-180,-60,180,85],$=i?i.projection:qo(g);u=Wn($,$==="conic"||!i?(g[0]+g[2])/2:$==="equalEarth"?n:0,g)}let m=s.map(g=>Zo(u,g)),f=[1/0,1/0,-1/0,-1/0];if(c)f=Qo(u,c.box);else for(let g of d){let $=m[g].box;f=[Math.min(f[0],$[0]),Math.min(f[1],$[1]),Math.max(f[2],$[2]),Math.max(f[3],$[3])]}Number.isFinite(f[0])||(f=[0,0,1,1]);let h=d.filter(g=>Sl(m[g].box,f)),p=c?new Set(c.ids.split(" ")):null,x={shapes:s,projected:m,projection:u,box:f,regions:p?h.filter(g=>p.has(s[g].id)):h,context:p?h.filter(g=>!p.has(s[g].id)):[],clip:!!c,centers:m.map(ta),match:i?jn(i):Kt(s.map(g=>g.keys))};return o||ka.set(e,o=new Map),o.set(r,x),x}function $a(e){let t=e.box[2]-e.box[0],n=e.box[3]-e.box[1];return t>0&&n>0?t/n:2}function va(e,t,n,r=2,o=e.box){let a=ea(o,Math.max(1,t-r*2),Math.max(1,n-r*2));a.tx+=r,a.ty+=r;let i=new Set([...e.regions,...e.context]);return{fit:a,paths:e.projected.map((s,l)=>i.has(l)?Yt(s.rings,a,[t,n]):""),centers:e.centers.map(([s,l])=>[s*a.k+a.tx,l*a.k+a.ty]),project:(s,l,c)=>{let[d,u]=Hn(e.projection,s,l,c);return[d*a.k+a.tx,u*a.k+a.ty]}}}var B=C(O(),1),Cl=new Intl.PluralRules("en-US",{type:"ordinal"}),Al={one:"st",two:"nd",few:"rd"},Nl={kind:"Choropleth map",legend:["Less","More"],noData:"No data",rankLabel:"Rank",rank:(e,t)=>`${e}${Al[Cl.select(e)]??"th"} of ${t}`,highest:"Highest",lowest:"Lowest",inStep:e=>`${ve(e,"region")} in this step`,desc:(e,t,n,r)=>`${ve(e,"region")} with data. Highest ${t}, lowest ${n}, mean ${r}`,same:(e,t)=>e===1?`1 region with data, at ${t}`:`${e} regions with data, all at the same value, ${t}`,missing:e=>`${ve(e,"region")} without data`,notLoaded:e=>e==="auto"?"No map is registered. Import one from ztd-charts/geo and pass it to registerMap":ut.includes(e)?`Map "${e}" is not registered. Import it from ztd-charts/geo/${e} and pass it to registerMap`:`Map "${e}" is not registered. Pass a map to registerMap, or use ${ut.join(", ")} or a GeoJSON`},Fl={en:Nl,ko:{kind:"단계구분도",legend:["적음","많음"],noData:"데이터 없음",rankLabel:"순위",rank:(e,t)=>`${t}곳 중 ${e}위`,highest:"가장 높은 곳",lowest:"가장 낮은 곳",inStep:e=>`이 단계 ${e}곳`,desc:(e,t,n,r)=>`데이터가 있는 지역 ${e}곳. 가장 높은 곳 ${t}, 가장 낮은 곳 ${n}, 평균 ${r}`,same:(e,t)=>e===1?`데이터가 있는 지역 1곳, 값 ${t}`:`데이터가 있는 지역 ${e}곳, 모두 같은 값 ${t}`,missing:e=>`데이터 없는 지역 ${e}곳`,notLoaded:e=>e==="auto"?"등록한 지도가 없어요. ztd-charts/geo의 지도를 registerMap에 넘겨 주세요":ut.includes(e)?`"${e}" 지도를 등록하지 않았어요. ztd-charts/geo/${e}에서 불러와 registerMap에 넘겨 주세요`:`"${e}" 지도를 등록하지 않았어요. 지도를 registerMap에 넘기거나 ${ut.join(", ")}, GeoJSON을 써 주세요`}},Ma=.14,Qe=172,Ee=17,Ta=16,Rl=600,Pl=8,Jn=10;function qn(e){let t=ye(e.region,"region"),n=(0,q.useMemo)(()=>Ho(e.map,()=>e.data.map((w,_)=>t(w,_))),[e.map,e.data,e.region]),r=n&&"map"in n?n.map:null,o=(0,q.useMemo)(()=>r?wa(r,{focus:e.focus,featureId:e.featureId,featureName:e.featureName}):null,[r,e.focus,e.featureId,e.featureName]),a=o?$a(o):2,i=e.legend===!1?0:22,s=w=>e.ranking===!0||e.ranking!==!1&&w>=Rl,l=ra(e,{height:w=>{let _=s(w)?w-Qe-Ta:w;return Math.round(i+Math.max(120,Math.min(_/a,w*.85)))},duration:480,stagger:60}),{p:c,width:d,height:u}=l,m=Fl[l.lang],f=(0,q.useId)().replace(/:/g,""),h=(0,q.useMemo)(()=>{if(!o)return[];let w=Ve(e.value,"value"),_=new Map,V=o.regions.map(G=>{let Q={i:G,label:"",value:NaN,datum:null,rank:0};return _.set(G,Q),Q}),D=!1;e.data.forEach((G,Q)=>{let Ne=t(G,Q),Se=_.get(o.match(Ne));Se&&(D||(D=Ro.test(String(Ne))),Se.value=w(G,Q),Se.datum=G)});let ie=e.labels==="ko"||e.labels==="en"?e.labels:D?"ko":l.lang;for(let G of V){let Q=o.shapes[G.i];G.label=(ie==="ko"?Q.nameKo:void 0)??Q.name}let re=V.filter(G=>Number.isFinite(G.value)).map(G=>G.value).sort((G,Q)=>Q-G);for(let G of V)if(Number.isFinite(G.value)){let Q=0,Ne=re.length;for(;Q<Ne;){let Se=Q+Ne>>1;re[Se]>G.value?Q=Se+1:Ne=Se}G.rank=Q+1}return V},[o,e.data,e.region,e.value,e.labels,l.lang]),p=(0,q.useMemo)(()=>[...h].sort((w,_)=>(w.rank||1/0)-(_.rank||1/0)||w.i-_.i),[h]),x=p.filter(w=>w.rank>0),g=x.length,$=g?x[0].value:0,v=g?x[g-1].value:0,A=g>0&&$===v,k=Number.isFinite(e.colorSteps)?e.colorSteps:5,R=Number.isFinite(e.colorCenter)?e.colorCenter:void 0,F=(0,q.useMemo)(()=>Mr(e.colorReverse,R,k),[e.colorReverse,R,k]),E=F.steps??5,I=F.center,z=w=>{if(I!==void 0){let _=Math.max(Math.abs($-I),Math.abs(v-I));return _>0?at((w-I)/_,-1,1):0}return $>v?(w-v)/($-v):1},P=s(d)&&g>=2,M=P?d-Qe-Ta:d,T=Math.max(1,u-i),b=(0,q.useMemo)(()=>o?va(o,M,T):null,[o,M,T]),S=(0,q.useMemo)(()=>h.map(w=>({sw:w.rank?Mt(c,z(w.value),Ma,F):null,step:w.rank?vt(z(w.value),F):NaN})),[h,c,F,$,v]),[L,j]=(0,q.useState)(null),ae=w=>vt(I===void 0?w/(E-1):2*w/(E-1)-1,F),ue=(0,q.useMemo)(()=>new Map(h.map((w,_)=>[w.i,_])),[h]),W=(0,q.useMemo)(()=>{if(!o)return new Set;let w=e.highlight,_=D=>typeof D=="string"&&!Vt.includes(D)?ue.get(o.match(D))??-1:typeof D=="number"?p[D]?ue.get(p[D].i):-1:D,V=typeof w=="string"||typeof w=="number"||Array.isArray(w)?(Array.isArray(w)?w:[w]).filter(D=>!(A&&(D==="max"||D==="min"))).map(_):w;return we(V,h.map(D=>D.datum),h.map(D=>D.label),h.map(D=>D.value),A?"none":e.colorReverse?"min":"max")},[o,h,ue,p,A,e.highlight,e.colorReverse]),{fv:Y}=l,Z=(0,q.useMemo)(()=>g?p:[],[p,g]),me=(0,q.useMemo)(()=>Z.map(w=>({datum:w.datum,index:w.i,key:o?.shapes[w.i].id??w.label,label:w.label,value:w.rank?w.value:null,formatted:w.rank?`${Y(w.value)}, ${m.rank(w.rank,g)}`:m.noData})),[Z,o,Y,m,g]),et=(0,q.useMemo)(()=>new Map(Z.map((w,_)=>[w.i,_])),[Z]),Ha=(0,q.useMemo)(()=>Z.map(w=>({row:b?.centers[w.i][1]??0,col:b?.centers[w.i][0]??0})),[Z,b]),Wa=(0,q.useMemo)(()=>{let w=Array.from({length:Jn},()=>[]);return b&&h.forEach((_,V)=>{if(!b.paths[_.i])return;let D=b.centers[_.i][0];w[Math.min(Jn-1,Math.max(0,Math.floor((Number.isFinite(D)?D:0)/Math.max(1,M)*Jn)))].push(V)}),w},[b,h,M]),Va=w=>{let _=b&&o?Yt(o.projected[w].rings,b.fit,[M,T],Pl):"",V=o?.projected[w].box??[0,0,0,0],D=b?.fit.k??1,ie=Math.max(V[2]-V[0],V[3]-V[1])*D/2,[re,G]=b?.centers[w]??[0,0];return{big:_,cx:Number.isFinite(re)?re:0,cy:Number.isFinite(G)?G:0,r:at(ie+4,6,14)}},Ka=(0,q.useMemo)(()=>[{key:"__m",to:[1],from:[0],data:null}],[]),Qt=la(Ka,l.motion),Ua=bt(l,Qt),Xa=l.motion.duration??480,Ya=l.motion.stagger??60,Te=l.active!==null?Z[l.active]:void 0,Qn=null;if(Te&&b){let[w,_]=b.centers[Te.i],V=ue.get(Te.i)??-1;Qn={x:at(Number.isFinite(w)?w:M/2,0,M),y:i+at(Number.isFinite(_)?_:T/2,0,T),title:Te.label,rows:Te.rank?[{label:l.t.value,value:Y(Te.value),color:S[V]?.sw?.raw??c.paint("accent")},{label:m.rankLabel,value:m.rank(Te.rank,g),strong:!1}]:[{label:l.t.value,value:m.noData,strong:!1}]}}let en=e.legendLabels??m.legend,tn=da(E,en),nn=h.length-g,Ja=g?Ot(x.map(w=>w.value))/g:0,qa=g?A?m.same(g,Y($)):m.desc(g,`${x[0].label} ${Y($)}`,`${x[g-1].label} ${Y(v)}`,Y(Ja)):"",Be=n&&"missing"in n?n.missing:null,Za=e.description??(g?`${m.kind}. ${qa}${nn?`. ${m.missing(nn)}`:""}.`:Be?m.notLoaded(Be):""),Qa=l.via==="keyboard"&&l.active!==null&&me[l.active]?`${me[l.active].label}: ${me[l.active].formatted}`:"",ei=L===null?NaN:ae(L),tt=Math.max(0,Math.floor((T-8)/Ee)-2),ht=w=>Math.abs((S[w]?.step??NaN)-ei)<1e-9,er=L===null?[]:x.filter(w=>ht(ue.get(w.i)??-1)),tr=L!==null?er.slice(0,tt+1):g<=tt+1?x:x.slice(0,Math.ceil(tt/2)),nr=L!==null||g<=tt+1?[]:x.slice(g-Math.floor(tt/2)),ti=d-Qe,rr=nr.length>0||L!==null,rn=(w,_)=>l.setActive(w,_==="touch"?"touch":"pointer"),ni=w=>L===null&&l.active!==null&&Z[l.active]?.i!==h[w].i?.55:1,or=ne(m.noData,10)+18,on=nn&&g&&M-tn-14-or>=0?or:0,ri=M-E*14-ne(en[1],10);return(0,B.jsxs)(jr,{c:l,kind:m.kind,ariaLabel:e.ariaLabel,description:Za,emptyText:Be?m.notLoaded(Be):void 0,events:me,tip:Qn,renderTip:e.tooltip,announce:Qa,className:e.className,style:e.style,theme:e.theme,defs:o?.clip?(0,B.jsx)("clipPath",{id:`${f}c`,children:(0,B.jsx)("rect",{width:M,height:T})}):void 0,onKey:w=>{if(w.key==="End"&&g)return l.setActive(g-1,"keyboard"),!0;if(!w.key.startsWith("Arrow"))return!1;let _=l.active===null?0:Lo(Ha,l.active,w.key);return _>=0&&l.setActive(_,"keyboard"),!0},children:[Be?(0,B.jsx)(Ce,{x:d/2,y:u/2,anchor:"middle",size:12,fill:c.paint("muted"),children:Bt(m.notLoaded(Be),d-16,12)}):null,e.legend!==!1&&g?(0,B.jsxs)("g",{children:[(0,B.jsx)(fa,{p:c,right:M,steps:E,scale:F,labels:en,min:Ma}),Array.from({length:E},(w,_)=>(0,B.jsx)("rect",{x:ri-7+_*14,y:0,width:14,height:16,fill:"transparent",onPointerEnter:()=>j(_),onPointerLeave:()=>j(null)},_)),on?(0,B.jsxs)("g",{"aria-hidden":"true",children:[(0,B.jsx)("rect",{x:M-tn-14-on,y:3,width:12,height:9,rx:2,fill:c.paint("neutralSoft"),stroke:c.paint("line2"),strokeWidth:.5}),(0,B.jsx)(Ce,{x:M-tn-14-on+16,y:7.5,size:10,fill:c.paint("muted"),children:m.noData})]}):null]}):null,b&&o?(0,B.jsxs)("g",{transform:i?`translate(0 ${i})`:void 0,children:[(0,B.jsx)("rect",{width:M,height:T,fill:"transparent",onPointerEnter:w=>l.via==="keyboard"?void 0:rn(null,w.pointerType)}),(0,B.jsxs)("g",{clipPath:o.clip?`url(#${f}c)`:void 0,children:[o.context.length?(0,B.jsx)(ya,{p:c,frame:b,regions:o.context,opacity:.6}):null,Wa.map((w,_)=>w.length?(0,B.jsx)("g",{style:pt(Ua,Qt.waiting,"fade",_*Ya,Xa),children:w.map(V=>{let D=h[V],ie=L!==null&&!ht(V)?null:S[V].sw,re=et.get(D.i);return(0,B.jsx)("path",{d:b.paths[D.i],fill:ie?ie.fill:c.paint("neutralSoft"),opacity:(ie?ie.opacity:1)*ni(V),stroke:c.paint("panel"),strokeWidth:.6,strokeLinejoin:"round",fillRule:"evenodd",className:"ztd-mark",onPointerEnter:G=>rn(re??null,G.pointerType),onClick:()=>re!==void 0&&l.click(re)},D.i)})},_):null),L!==null?(0,B.jsx)("g",{pointerEvents:"none",fill:"none",stroke:c.paint("ink"),strokeWidth:.75,strokeLinejoin:"round",children:h.map((w,_)=>ht(_)&&b.paths[w.i]?(0,B.jsx)("path",{d:b.paths[w.i]},`s${w.i}`):null)}):null,h.map((w,_)=>{let V=Te?.i===w.i;if(!(W.has(_)&&(L===null||ht(_))||V)||!b.paths[w.i])return null;let D=Va(w.i),ie=V?2:1.4;return D.big?(0,B.jsx)("path",{d:D.big,fill:"none",stroke:c.paint("ink"),strokeWidth:ie,strokeLinejoin:"round",pointerEvents:"none"},`o${w.i}`):(0,B.jsxs)("g",{pointerEvents:"none",children:[(0,B.jsx)("path",{d:b.paths[w.i],fill:"none",stroke:c.paint("ink"),strokeWidth:.75,strokeLinejoin:"round"}),(0,B.jsx)("circle",{cx:D.cx,cy:D.cy,r:D.r,fill:"none",stroke:c.paint("ink"),strokeWidth:ie})]},`o${w.i}`)})]})]},Qt.generation):null,P?(0,B.jsx)("g",{transform:`translate(${ti} ${i})`,children:[[L!==null?m.inStep(er.length):m.highest,tr,0],[m.lowest,nr,(tr.length+1)*Ee+6]].map(([w,_,V])=>_.length?(0,B.jsxs)("g",{transform:V?`translate(0 ${V})`:void 0,children:[rr?(0,B.jsx)(Ce,{x:0,y:Ee/2,size:10,weight:600,fill:c.paint("muted"),children:w}):null,_.map((D,ie)=>{let re=ue.get(D.i)??0,G=(ie+(rr?1:0))*Ee,Q=Y(D.value),Ne=ne(Q,11,600),Se=Te?.i===D.i;return(0,B.jsxs)("g",{onPointerEnter:oi=>rn(et.get(D.i)??null,oi.pointerType),children:[(0,B.jsx)("rect",{x:-4,y:G,width:Qe+4,height:Ee,rx:4,fill:Se?c.paint("lift"):"transparent"}),(0,B.jsx)("rect",{x:0,y:G+Ee/2-4,width:8,height:8,rx:2,fill:S[re].sw?.fill??c.paint("neutralSoft"),opacity:S[re].sw?.opacity??1}),(0,B.jsx)(Ce,{x:12,y:G+Ee/2,size:11,weight:W.has(re)?700:500,fill:c.paint("ink"),children:Bt(`${D.rank}. ${D.label}`,Qe-Ne-22,11,W.has(re)?700:500)}),(0,B.jsx)(Ce,{x:Qe-2,y:G+Ee/2,anchor:"end",size:11,weight:600,fill:c.paint("ink"),children:Q})]},D.i)})]},w):null)}):null]})}var Ll=C(K(),1);var Fa=C(O(),1),_l={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${ve(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},Dl={en:_l,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},Sa=(e,t)=>Dl[e].other(t);function Ca(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,Ot(o.map(a=>a.value)))}}var Aa=e=>Number.isFinite(e)&&e>0?e:0;function Na(e,t,n,r){return r==="emphasis"?$r(e,t,n):ge(e,t,n)}var El=C(K(),1);var _a=C(O(),1);function Ra(e,t){return t===!1?e.map((n,r)=>r):to(e)}function Pa(e,t,n){let r=n.map(o=>o.reduce((a,i)=>a+(Number.isFinite(i)?i:0),0));return we(e,t,t,r,"max")}function La(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]=ee(e,"accent"));return o.forEach((a,i)=>r[a]=o.length===1?ee(e,"neutral"):$t(e,1-i/Math.max(1,o.length-1))),r}function Da(e){return!e||typeof e!="object"||Array.isArray(e)?[]:xe(Object.values(e).filter(t=>typeof t=="string"&&t!==""))}function Ea(e,t){return rt(e,t+1,new Set)}var Il=C(K(),1);var Oa=C(O(),1);var Ol=26;var Gm=Ol*.62;function Ia(e,t){let n=typeof e=="string"?[e]:Array.isArray(e)?e:[],r=new Set;for(let o of n)typeof o=="string"&&!Vt.includes(o)&&t.forEach((a,i)=>a===o&&r.add(i));return r}var Ae=C(O(),1);function za(e,t,n){let r=Et(e);return r?.type==="scatter"&&t?.size!==void 0&&!Dt(n)?Et("bubble"):r}function zl(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 Bl(e,t,n,r=!1){let o=za(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&&Sn.includes(o.type)&&Array.isArray(i.hidden)?i.hidden.map(String):[]),c=u=>u.filter(m=>!l.has(m.label)),d=["pie","donut","waffle"];if(o.type==="donut"&&i.legend!=="none")return[];if(d.includes(o.type)){let u=ye(a.label,"label"),m=Ve(a.value,"value"),f=o.type==="waffle",h=t.map((k,R)=>({r:k,label:u(k,R),value:f?m(k,R):Aa(m(k,R))})),{kept:p,other:x}=f?{kept:h,other:null}:Ca(h,i.other,(k,R)=>({r:{},label:Sa(U(n),k),value:R})),g=we(s,p.map(k=>k.r),p.map(k=>k.label),p.map(k=>k.value),f?"first":"max"),$=x?[...p,x]:p,v=Pe(k=>f?ge(k,$.length,g):Na(k,$.length,g,i.colorMode)),A=f&&i.shape==="arc";return $.map((k,R)=>({label:k.label,color:v[R],...A&&{shape:"circle"}}))}if(o.type==="candlestick"){let u=pa(Array.isArray(i.ma)?i.ma:void 0,t.length),m=ga[U(n)];return[{label:m.up,color:i.upColor??"accent"},{label:m.down,color:i.downColor??"neutralStrong"},...u.map((f,h)=>({label:m.maLegend(f),color:Xn[h],shape:"line"}))]}if(o.type==="network"){let u=Da(i.groups);if(u.length<2)return[];let m=Pe(f=>Ea(f,u.length));return u.map((f,h)=>({label:f,color:m[h],shape:"circle"}))}if(o.type==="symbolMap"){if(typeof a.group!="string")return[];let u=ye(a.group,"group"),m=xe(t.map((h,p)=>u(h,p)).filter(Boolean));if(m.length<2)return[];let f=Pe(h=>rt(h,m.length,new Set));return m.map((h,p)=>({label:h,color:f[p],shape:"circle"}))}if(o.type==="scatter"){if(typeof a.series!="string"||Dt(i))return[];let u=ye(a.series,"series"),m=xe(t.map((p,x)=>u(p,x)));if(m.length<2)return[];let f=ha(s,t,m,u),h=Pe(p=>rt(p,m.length,f));return c(m.map((p,x)=>({label:p,color:h[x],shape:"circle"})))}if(o.type==="timeline"){let u=typeof a.group!="string",m=u?a.status:a.group;if(typeof m!="string")return[];let f=_o(t,m,u),h=Pe(p=>ge(p,f.length,Ia(s,f)));return c(f.map((p,x)=>({label:p,color:h[x],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 v=ye(a.series,"series");u=xe(t.map((A,k)=>v(A,k)))}let m=Cn(o.type,a,i);if(m.length){let v=we(s,u,u,u.map(()=>0),"none"),A=Pe(R=>ge(R,u.length,v)),k=u.length<2?[{label:String((Array.isArray(a.y)?a.y[0]:a.y)??"y"),color:"neutral"}]:u.map((R,F)=>({label:R,color:A[F]}));return[...c(k),...m.map((R,F)=>({label:R,color:ma(F),shape:"line"}))]}if(u.length<2)return[];let h=o.type==="bar"&&i.layout==="diverging"&&s===void 0?eo(u.length,Array.isArray(i.negative)?i.negative.map(v=>u.indexOf(String(v))):[],typeof i.neutral=="string"?u.indexOf(i.neutral):-1):-1,p=h>=0?new Set([h]):we(s,u,u,u.map(()=>0),"first");if(o.type==="radar")return c(u.map((v,A)=>({label:v,color:p.has(A)?"accent":"neutralStrong",shape:"square"})));let x=i.colorMode,g=v=>ge(v,u.length,p);if((o.type==="line"||o.type==="area")&&(g=v=>ua(v,u.length,p,o.type==="area",x)),o.type==="stream"){let v=st(t,a.x,a.y,a.series,{xType:i.xType,locale:n,aggregate:i.aggregate,dayFirst:i.dayFirst}),A=Ra(v.values,i.reorder),k=Pa(s,v.series,v.values);g=R=>La(R,A,k)}let $=Pe(g);return c(u.map((v,A)=>({label:v,color:$[A],...o.type==="line"&&{shape:"line"}})))}return[]}function jl(e,t){let n=e.facet;return n&&typeof n=="object"&&typeof n.by=="string"&&Kr.includes(t)&&!(t==="bar"&&e.options?.layout==="diverging")?n:void 0}function Gl(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 Ba(e,t){let{spec:n}=e,r=za(n.type,n.encoding,n.options),o=(0,ft.useMemo)(()=>na(n.data),[n.data]),a=!o&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,i=Vr(n,e.locale),s=se(i),l=U(s),c=$o(a?.url??null,{parse:a?.format??"auto",select:a?.select,init:e.fetchInit,locale:s}),d=Yr(n),u=(0,ft.useMemo)(()=>d?No(d,s):void 0,[d,s]),m=n.options?.hidden,f=Array.isArray(m)?m.map(String):[],h=f.join(""),[p,x]=(0,ft.useState)(null);if(!r)return(0,Ae.jsx)(Tn,{error:l==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:i});let g=o??c.data,$=t[r.type],v={...n.options??{}},A={...zl(r,n.encoding),...v,...u?{tooltip:u}:{},data:g,...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},k=n.card?.legend==="toggle"&&Xr(r.type,n.encoding??{},v),R=p&&p.base===h?p.hidden:f;k&&(A.hidden=R);let F=M=>x(T=>{let b=T&&T.base===h?T.hidden:f;return{base:h,hidden:b.includes(M)?b.filter(S=>S!==M):[...b,M]}}),E=A.height??220,I=jl(n,r.type),z=a&&!g.length&&(c.loading||c.error||c.empty)?(0,Ae.jsx)(Tn,{loading:c.loading,error:c.error,empty:c.empty,onRetry:c.reload,height:E,locale:i}):I?(0,Ae.jsx)(wo,{chart:$,...Gl(r.type,I,A)}):(0,Ae.jsx)($,{...A});if(n.card){let M=n.card,T=M.legend==="auto"||M.legend==="toggle"?Bl(n,g,s,k):M.legend,b=T?.length?k?(0,Ae.jsx)(Mn,{items:T,hidden:R,onToggle:F,locale:i}):T:void 0,S=M.download?(0,Ae.jsx)(Ao,{data:g,columns:Jr(n),filename:M.title??r.type,formats:Array.isArray(M.download)?M.download:void 0,locale:i}):void 0;z=(0,Ae.jsx)(Br,{number:M.number,title:M.title??Wr(r,l),subtitle:M.subtitle,legend:b,actions:S,source:M.source||void 0,note:M.note||void 0,accent:M.accent,takeaway:M.takeaway,level:M.level,sample:M.sample,replay:M.replay!==!1,className:e.className,locale:i,children:z})}let P=e.theme??n.theme;return P&&(z=(0,Ae.jsx)(Ft,{theme:P,children:z})),z}function Hl({cfg:e,components:t}){let n=Ue();return Ba({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function Ga(e,t){let n=document.getElementById("ztd-chart-config")?.textContent,r=document.getElementById("chart");if(!n||!r)return;let o=JSON.parse(n);(0,ja.hydrateRoot)(r,(0,Zn.createElement)(Ft,{theme:o.theme,cssVars:!0},(0,Zn.createElement)(Hl,{cfg:o,components:{[e]:t}})))}Ga("choropleth",qn);})();
|
|
27
|
+
`}function ul(e){return Array.from((e??"").replace(/[\\/:*?"<>|\r\n\t]+/g,"-").trim()).slice(0,80).join("")||"chart"}function En(e,t){let n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=t,n.click(),setTimeout(()=>URL.revokeObjectURL(n.href),1e4)}var Mo=2,Le=16;function To(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,a,i,s]=r.getImageData(0,0,1,1).data;return n=s===255?`rgb(${o}, ${a}, ${i})`:`rgba(${o}, ${a}, ${i}, ${Math.round(s/255*1e3)/1e3})`,t.set(e,n),n}function So(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 Co(e,t,n){let r=e.closest(".ztd-card"),o=r?.querySelector("svg.ztd-svg");if(!r||!o)return null;let{width:a,height:i}=o.viewBox.baseVal,[s,l]=[a+Le*2,i+Le*2],c=o.cloneNode(!0),d=c.querySelectorAll("*"),u=new Map;o.querySelectorAll("*").forEach((h,p)=>{let x;for(let g of Array.from(h.attributes)){if(!sl.test(g.value))continue;let $=(x??(x=getComputedStyle(h))).getPropertyValue(g.name);$&&d[p].setAttribute(g.name,To($,u))}}),c.removeAttribute("style");for(let[h,p]of Object.entries({viewBox:`${-Le} ${-Le} ${s} ${l}`,width:s*t,height:l*t,"font-family":getComputedStyle(o).fontFamily}))c.setAttribute(h,String(p));let m=To(getComputedStyle(r).backgroundColor,u),f=o.parentElement?.querySelector("canvas")??null;if(n){let h=c.querySelector("desc")?.nextSibling??c.firstChild;c.insertBefore(So("rect",{x:-Le,y:-Le,width:s,height:l,fill:m}),h),f&&c.insertBefore(So("image",{href:f.toDataURL(),width:a,height:i}),h)}return{svg:new XMLSerializer().serializeToString(c),w:s,h:l,vw:a,vh:i,bg:m,canvas:f}}function ml(e,t){let n=Co(e,Mo,!1);if(!n)return;let r=Mo,o=document.createElement("canvas");o.width=Math.ceil(n.w*r),o.height=Math.ceil(n.h*r);let a=o.getContext("2d");if(!a)return;a.fillStyle=n.bg,a.fillRect(0,0,o.width,o.height),n.canvas&&a.drawImage(n.canvas,Le*r,Le*r,n.vw*r,n.vh*r);let i=URL.createObjectURL(new Blob([n.svg],{type:"image/svg+xml"})),s=new Image;s.onload=()=>{a.drawImage(s,0,0,o.width,o.height),URL.revokeObjectURL(i),o.toBlob(l=>l&&En(l,`${t}.png`),"image/png")},s.onerror=()=>URL.revokeObjectURL(i),s.src=i}function Ao(e){let t=be(e.theme),n=U(se(e.locale))==="ko",r=ul(e.filename),o=(a,i)=>{if(a==="csv")return En(new Blob([cl(e.data,e.columns?.length?e.columns:ll(e.data))],{type:"text/csv;charset=utf-8"}),`${r}.csv`);if(a==="png")return ml(i,r);let s=Co(i,1,!0);s&&En(new Blob([s.svg],{type:"image/svg+xml"}),`${r}.svg`)};return(0,In.jsx)("span",{style:{display:"inline-flex",gap:6,flex:"none"},children:al.filter(a=>!e.formats||e.formats.includes(a)).map(a=>{let i=a.toUpperCase(),s=n?`${i} 내려받기`:`Download ${i}`;return(0,In.jsx)("button",{type:"button",className:"ztd-btn","aria-label":s,title:s,onClick:l=>o(a,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:i},a)})})}var Ro=C(O(),1);function No(e,t=oe){let n=Ie(void 0,t),r=e.split(`
|
|
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?ot(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(Pr,(d,u)=>o(a,u.trim())??(l=!0,""));l||i.push(c)}return i.length?i.map((s,l)=>(0,Ro.jsx)("div",{children:s},l)):null}}var Fo=/[가-힣ㄱ-ㆎ]/;function On(e){let t=String(e??"").normalize("NFC").trim().replace(/\s+/g," ").toLowerCase();return/^\d+$/.test(t)?t.replace(/^0+(?=\d)/,""):t}function Kt(e){let t=new Map;return e.forEach((n,r)=>{for(let o of n){let a=On(o);a&&!t.has(a)&&t.set(a,r)}}),n=>t.get(On(n))??-1}function _o(e,t){let n=[...new Set([...new Set(e)].map(On))].filter(Boolean),r=-1,o=0;return t.forEach((a,i)=>{let s=n.filter(l=>a(l)>=0).length;s>o&&(o=s,r=i)}),r}var dl={ArrowRight:[0,1],ArrowLeft:[0,-1],ArrowDown:[1,0],ArrowUp:[-1,0]};function Po(e,t,n){let r=dl[n],o=e[t];if(!r||!o)return-1;let a=-1,i=1/0;return e.forEach((s,l)=>{let c=(s.row-o.row)*r[0]+(s.col-o.col)*r[1],d=Math.abs(r[0]?s.col-o.col:s.row-o.row);if(c<=0||d>c)return;let u=c+d*2;u<i&&(i=u,a=l)}),a}function Lo(e,t,n=!1){let r=ye(t,"group"),o=e.map((s,l)=>r(s,l)).filter(Boolean),a=xe(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)}var fl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function Do(e){if(typeof e!="string")return[];let t=new Int8Array(128).fill(-1);for(let i=0;i<64;i++)t[fl.charCodeAt(i)]=i;let n=[],r=0,o=1,a=0;for(let i=0;i<e.length;i++){let s=t[e.charCodeAt(i)]??-1;s<0||(r+=(s&31)*o,a++,s&32&&a<7?o*=32:(s&32||n.push(r%2?-(r+1)/2:r/2),r=0,o=1,a=0))}return n}var Eo=new WeakMap,Ut=(e,t)=>typeof e=="number"&&Number.isInteger(e)&&e>=0&&e<=t?e:-1;function zo(e){let t=Eo.get(e);if(t)return t;let n=Array.isArray(e.topo?.t)?e.topo.t:[],[r,o,a]=n.every(p=>Number.isFinite(p))&&n.length>=3?n:[NaN,NaN,NaN],i=Number.isFinite(r)&&r>0,s=i?Do(e.topo.arcs):[],l=[],c=0;for(let p=0;p<s.length;){let x=Ut(s[p++],(s.length-p)/2);if(x<0)break;let g=[],$=0,v=0;for(let A=0;A<x;A++)$+=s[p++],v+=s[p++],g.push([$*r+o,v*r+a]);c+=x,l.push(g)}let d=i?Do(e.topo.shapes):[],u=0,m=c*4,h=(Array.isArray(e.regions)?e.regions:[]).map(p=>{let x=Array.isArray(p)?p.filter(A=>typeof A=="string"):[],g=[];for(let A=Ut(d[u++],d.length-u);A>0;A--){let k=[];for(let F=Ut(d[u++],d.length-u);F>0;F--){let R=[];for(let E=Ut(d[u++],d.length-u),I=0;I<E;I++){let z=d[u++],_=(z>=0?l[z]:l[~z]?.slice().reverse())??[];if(m-=_.length,m<0)break;for(let M=I?1:0;M<_.length;M++)R.push(_[M])}if(R.length>1&&R[0][0]===R[R.length-1][0]&&R[0][1]===R[R.length-1][1]&&R.pop(),R.length>=3&&k.push(R),m<0||u>d.length)break}if(k.length&&g.push(k),m<0||u>d.length)break}let $=x[0]??"",v=e.namesKo?.[$];return{id:$,name:x[1]??$,nameKo:typeof v=="string"?v:void 0,keys:typeof v=="string"?[...x,v]:x,polygons:g}});return Eo.set(e,h),h}var De=e=>typeof e=="string"&&e.trim()!==""?e:typeof e=="number"&&Number.isFinite(e)?String(e):void 0;function Io(e,t){if(!Array.isArray(e))return null;let n=[];for(let r of e){if(!Array.isArray(r)||typeof r[0]!="number"||typeof r[1]!="number"||!Number.isFinite(r[0])||!Number.isFinite(r[1]))continue;let[o,a]=r;a>90||a<-90||o>540||o<-540?(t.n++,a=Math.max(-90,Math.min(90,a)),o=((o+180)%360+360)%360-180):(o>180||o<-180)&&t.n++;let i=n[n.length-1];(!i||i[0]!==o||i[1]!==a)&&n.push([o,a])}return n.length>1&&n[0][0]===n[n.length-1][0]&&n[0][1]===n[n.length-1][1]&&n.pop(),n.length>=3?n:null}function Bo(e,t,n){let r=`${t??""}${n??""}`,o=Oo.get(e),a=o?.get(r);if(a)return a;let i=hl(e,t,n);return o||Oo.set(e,o=new Map),o.set(r,i),i}var Oo=new WeakMap;function hl(e,t,n){let r=[],o=[],a={n:0};return(Array.isArray(e.features)?e.features:[]).forEach((i,s)=>{let l=i&&typeof i.properties=="object"&&i.properties||{},c=i?.geometry,d=c&&Array.isArray(c.coordinates)?c.type==="Polygon"?[c.coordinates]:c.type==="MultiPolygon"?c.coordinates:[]:[],u=[];for(let h of d){if(!Array.isArray(h))continue;let p=Io(h[0],a);p&&u.push([p,...h.slice(1).map(x=>Io(x,a)).filter(x=>x!==null)])}if(!u.length)return void o.push(s);let m=(t?De(l[t]):void 0)??De(i?.id)??De(l.id)??De(l.code)??String(s+1),f=(n?De(l[n]):void 0)??De(l.name)??De(l.NAME)??m;r.push({id:m,name:f,keys:[...new Set([m,f,De(i?.id)].filter(h=>!!h))],polygons:u})}),{shapes:r,skipped:o,outOfRange:a.n}}var ut=["world","us-states","kr-sido"];function Go(){var t;let e=globalThis;return e[t=Symbol.for("ztd-charts.geo.maps")]??(e[t]=new Map)}function Bn(e){let t=e;return!!t&&typeof t=="object"&&typeof t.name=="string"&&Array.isArray(t.regions)&&!!t.topo&&typeof t.topo.arcs=="string"}function gl(e){let t=e;return!!t&&typeof t=="object"&&t.type==="FeatureCollection"&&Array.isArray(t.features)}function zn(e){return Go().get(e)}function pl(){return[...Go().keys()]}function bl(e){return e.regions.map(t=>{let n=Array.isArray(t)?t.filter(o=>typeof o=="string"):[],r=n[0]!==void 0?e.namesKo?.[n[0]]:void 0;return typeof r=="string"?[...n,r]:n})}var jo=new WeakMap;function jn(e){let t=jo.get(e);return t||jo.set(e,t=Kt(bl(e))),t}function Ho(e,t){if(e===void 0||e==="auto"){let n=pl();if(!n.length)return{missing:"auto"};let r=_o(t(),n.map(a=>jn(zn(a)))),o=n[Math.max(0,r)];return{map:zn(o),name:o}}if(typeof e=="string"){let n=zn(e);return n?{map:n,name:e}:{missing:e}}return Bn(e)?{map:e,name:e.name}:gl(e)?{map:e}:null}var Je=.017453292519943295,Gn=e=>((e+180)%360+360)%360-180,Wo=1.340264,Vo=-.081106,Ko=893e-6,Uo=.003796,Xo=.8660254037844386,yl=(e,t)=>{let n=Math.asin(Xo*Math.sin(t)),r=n*n,o=r*r*r;return[e*Math.cos(n)/(Xo*(Wo+3*Vo*r+o*(7*Ko+9*Uo*r))),n*(Wo+Vo*r+o*(Ko+Uo*r))]};function Xt(e,t){let n=Math.sin(e*Je),r=(n+Math.sin(t*Je))/2;if(Math.abs(r)<.001)return(i,s)=>[i,Math.sin(s)];let o=1+n*(2*r-n),a=Math.sqrt(o)/r;return(i,s)=>{let l=Math.sqrt(Math.max(0,o-2*r*Math.sin(s)))/r;return[l*Math.sin(i*r),a-l*Math.cos(i*r)]}}function mt(e,t,n=[0,0],r=1,o=[0,0]){let[a,i]=t(n[0]*Je,n[1]*Je);return{lon0:e,raw:(s,l)=>{let[c,d]=t(s*Je,Math.max(-90,Math.min(90,l))*Je);return[r*(c-a)+o[0],-r*(d-i)+o[1]]}}}function Hn(e,t,n,r){let o=e.pick(t,n,r);return o.raw(Gn(t-o.lon0),n)}function Wn(e,t=0,n){if(e==="albersUsa"){let o=mt(-96,Xt(29.5,45.5),[-.6,38.7]),a=mt(-154,Xt(55,65),[-2,58.5],.35,[-.307,.201]),i=mt(-157,Xt(8,18),[-3,19.9],1,[-.205,.212]);return{name:e,pick:(s,l,c)=>c!==void 0?c==="AK"?a:c==="HI"?i:o:l>=50&&(s<=-129||s>=170)?a:l>=18&&l<=23&&s>=-161&&s<=-154?i:o}}if(e==="conic"&&n){let[,o,,a]=n,i=mt(t,Xt(o+(a-o)/6,o+(a-o)*5/6),[0,(o+a)/2]);return{name:e,pick:()=>i}}let r=mt(t,yl);return{name:"equalEarth",pick:()=>r}}function Jo(e){let t=[],n=1/0,r=-1/0;for(let i of e)for(let s of i.polygons)for(let[l,c]of s[0])t.push(Gn(l)),c<n&&(n=c),c>r&&(r=c);if(!t.length)return null;t.sort((i,s)=>i-s);let o=t[0]+360-t[t.length-1],a=t[0];for(let i=1;i<t.length;i++)t[i]-t[i-1]>o&&(o=t[i]-t[i-1],a=t[i]);return[a,n,a+360-o,r]}function qo(e){return e[2]-e[0]>150||e[3]-e[1]>70?"equalEarth":"conic"}function Yo(e,t,n){let r=[];for(let o=0;o<e.length;o++){let a=e[o],i=e[(o+1)%e.length],s=(a[0]-t)*n>=0,l=(i[0]-t)*n>=0;s&&r.push(a),s!==l&&r.push([t,a[1]+(i[1]-a[1])*(t-a[0])/(i[0]-a[0])])}return r}function xl(e){let t=0,n=-1;for(let a=0;a<e.length;a++)Math.abs(e[a][0]-e[(a+e.length-1)%e.length][0])>180&&(t++,n<0&&(n=a));if(!t)return[e];if(t%2){let a=e[(n+e.length-1)%e.length],i=e[n],s=a[0]>0?180:-180,l=360-Math.abs(a[0]-i[0]),c=a[1]+(i[1]-a[1])*(Math.abs(s-a[0])||0)/(l||1),d=e.reduce((u,m)=>u+m[1],0)<0?-90:90;return[[...e.slice(0,n),[s,c],[s,d],[-s,d],[-s,c],...e.slice(n)]]}let r=[e[0]];for(let a=1;a<e.length;a++){let i=e[a][0],s=r[a-1][0];for(;i-s>180;)i-=360;for(;i-s<-180;)i+=360;r.push([i,e[a][1]])}let o=[];for(let a of[-1,0,1]){let i=Yo(Yo(r,a*360-180,1),a*360+180,-1),s=0;for(let l=0,c=i.length-1;l<i.length;c=l++)s+=(i[c][0]-i[l][0])*(i[c][1]+i[l][1]);i.length>=3&&Math.abs(s)>1e-9&&o.push(a?i.map(([l,c])=>[l-a*360,c]):i)}return o}function Zo(e,t){let n=[],r=[],o=[],a=[1/0,1/0,-1/0,-1/0];return t.polygons.forEach((i,s)=>i.forEach((l,c)=>{let d=e.pick(l[0][0],l[0][1],e.name==="albersUsa"?t.id:void 0);for(let u of xl(l.map(([m,f])=>[Gn(m-d.lon0),f]))){let m=new Float64Array(u.length*2);u.forEach(([f,h],p)=>{let[x,g]=d.raw(f,h);m[p*2]=x,m[p*2+1]=g,x<a[0]&&(a[0]=x),g<a[1]&&(a[1]=g),x>a[2]&&(a[2]=x),g>a[3]&&(a[3]=g)}),n.push(m),r.push(s),o.push(c===0)}})),{rings:n,poly:r,outer:o,box:a}}function Qo(e,t){let n=[1/0,1/0,-1/0,-1/0],[r,o,a,i]=t;for(let s=0;s<=24;s++){let l=s/24;for(let[c,d]of[[r+(a-r)*l,o],[r+(a-r)*l,i],[r,o+(i-o)*l],[a,o+(i-o)*l]]){let[u,m]=Hn(e,c,d);n[0]=Math.min(n[0],u),n[1]=Math.min(n[1],m),n[2]=Math.max(n[2],u),n[3]=Math.max(n[3],m)}}return n}function ea(e,t,n){let r=e[2]-e[0],o=e[3]-e[1],a=r>0&&o>0?Math.min(t/r,n/o):1;return{k:a,tx:(t-r*a)/2-e[0]*a,ty:(n-o*a)/2-e[1]*a}}var Ye=e=>Math.round(e*10)/10||0;function Yt(e,t,n,r=0){let o="";for(let a of e){let i="",s=NaN,l=NaN,c=0,d=1/0,u=-1/0,m=1/0,f=-1/0;for(let p=0;p<a.length;p+=2){let x=Ye(a[p]*t.k+t.tx),g=Ye(a[p+1]*t.k+t.ty);Math.abs(x-s)<.35&&Math.abs(g-l)<.35||(i+=c?`${c===1?"l":" "}${Ye(x-s)} ${Ye(g-l)}`:`M${x} ${g}`,s=x,l=g,c++,x<d&&(d=x),x>u&&(u=x),g<m&&(m=g),g>f&&(f=g))}n!==void 0&&(u<0||f<0||d>n[0]||m>n[1])||Math.min(u-d,f-m)<r||(c>=3&&(u-d>=1||f-m>=1)?o+=`${i}Z`:r||(o+=`M${Ye((d+u)/2-.8)} ${Ye((m+f)/2-.8)}h1.6v1.6h-1.6Z`))}return o}function kl(e){let t=0,n=0,r=0,o=e.length/2;for(let a=0,i=o-1;a<o;i=a++){let s=e[i*2]*e[a*2+1]-e[a*2]*e[i*2+1];t+=s,n+=(e[i*2]+e[a*2])*s,r+=(e[i*2+1]+e[a*2+1])*s}return[t/2,t?n/(3*t):NaN,t?r/(3*t):NaN]}function ta(e){let t=new Map,n=e.rings.map(kl);e.rings.forEach((m,f)=>t.set(e.poly[f],(t.get(e.poly[f])??0)+(e.outer[f]?1:-1)*Math.abs(n[f][0])));let r=-1,o=0;for(let[m,f]of t)f>o&&(o=f,r=m);if(r<0)return[NaN,NaN];let a=e.rings.map((m,f)=>f).filter(m=>e.poly[m]===r),i=0,s=0;for(let m of a)e.outer[m]&&(i+=n[m][2]*Math.abs(n[m][0]),s+=Math.abs(n[m][0]));let l=i/s,c=[];for(let m of a){let f=e.rings[m],h=f.length/2;for(let p=0,x=h-1;p<h;x=p++){let g=f[p*2+1],$=f[x*2+1];g>l!=$>l&&c.push(f[p*2]+(f[x*2]-f[p*2])*(l-g)/($-g))}}c.sort((m,f)=>m-f);let d=NaN,u=-1;for(let m=0;m+1<c.length;m+=2)c[m+1]-c[m]>u&&(u=c[m+1]-c[m],d=(c[m]+c[m+1])/2);return[d,l]}function na(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 ze(t.csv)}return null}var ca=C(K(),1);var J=C(K(),1);function ra(e,t){let n=be(e.theme),[r,o,a]=Ht(e.width),i=Ue(),s=e.width??(a||t.ssrWidth||480),l=typeof t.height=="function"?t.height(s):t.height,c=e.height??l,d=Wt(e.reducedMotion??"auto"),u=e.animate!==!1&&!d&&he,m=ko(r,e.animateOnView!==!1&&u),f=se(e.locale),h=U(f),p=(0,J.useMemo)(()=>Ie(e.format,f,t.format),[e.format,f,t.format]),x=(0,J.useCallback)(W=>Tt(W,{locale:f}),[f]),g=(0,J.useMemo)(()=>St(p,e.unit),[p,e.unit]),$=(0,J.useMemo)(()=>It(e.data),[e.data]),[v,A]=(0,J.useState)(null),[k,F]=(0,J.useState)(null),R=(0,J.useRef)([]),E=(0,J.useRef)(e.onHover);E.current=e.onHover;let I=(0,J.useRef)(e.onClick);I.current=e.onClick;let z=(0,J.useRef)(null),_=(0,J.useRef)(null),M=(0,J.useRef)(null),T=(0,J.useCallback)((W,Y="pointer")=>{if(M.current!==W){M.current=W;let Z=W===null?null:R.current[W]??null;queueMicrotask(()=>E.current?.(Z)),_.current?.(W)}z.current=W===null?null:Y,A(W),F(z.current)},[]),y=(0,J.useCallback)(W=>{z.current!=="keyboard"&&(z.current=W===null?null:"sync",A(W),F(z.current))},[]),S=(0,J.useCallback)(W=>{let Y=R.current[W];Y&&I.current?.(Y)},[]),P=zr(e.replayKey),j=e.width!==void 0||(a??0)>0,ae={enabled:u,active:m.visible&&j,near:m.near,replayKey:P,dataKey:$,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},ue=(0,J.useCallback)((W,Y=1)=>v===null||v===W?Y:Y*.38,[v]);return{p:n,width:s,height:c,measured:j,responsive:e.width===void 0,pending:he&&i&&e.width===void 0&&a===null,node:r,hydrated:i,ref:o,motion:ae,fv:g,fmt:p,pct:x,locale:f,lang:h,t:h==="ko"?gr:hr,active:v,via:k,setActive:T,click:S,events:R,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:ue,sig:$,description:e.description,reduced:d,publish:_,applySync:y}}var X=C(K(),1);function wl(e){return 1-Math.pow(1-e,3)}function $l(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function vl(e){return e==="easeInOut"?$l:e==="linear"?t=>t:wl}function Ml(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 qe(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 Jt(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 oa(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 aa(e,t,n,r){if(!t||!n||t.length!==n.length)return qe(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 qe(s,n[i]))o.push(l)}return o.length===r?o:qe(e,r)}var qt=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||!Jt(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),oa(n.from,n.vel,n.to),n.cur=n.from.slice(),n.curVel=n.vel.slice(),n.done=Jt(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=aa(s.cur,s.parts,i.parts,c),s.vel=aa(s.curVel,s.parts,i.parts,c),s.parts=i.parts,s.to=i.to.slice(),oa(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=Jt(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=Jt(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=qe(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=vl(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=qe(s.from,c)),s.vel.length!==c&&(s.vel=qe(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),m=a*l>=8&&a*l<20,f=0;for(let h=0;h<c;h++){let p=s.from[h]-s.to[h],x=s.vel[h]+a*p;s.cur[h]=s.to[h]+(p+x*l)*u,s.curVel[h]=(s.vel[h]-a*x*l)*u,m&&f<.15&&(f=Math.max(f,Math.abs(s.cur[h]-s.to[h]),Math.abs(s.curVel[h]/a)))}d=a*l>=20||m&&f<.15,s.progress=Math.min(1,1-(1+a*l)*u)}else{let u=Math.min(1,l/o),m=r(u),f=Ml(this.easing,u)/o;for(let h=0;h<c;h++)s.cur[h]=s.from[h]+(s.to[h]-s.from[h])*m,s.curVel[h]=(s.to[h]-s.from[h])*f;d=u>=1,s.progress=m}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}},dt=new Set,Zt=0;function ia(e){Zt=0;let t=Array.from(dt);for(let n of t){let r;try{r=n(e)}catch{r=!1}r||dt.delete(n)}dt.size&&typeof requestAnimationFrame<"u"&&(Zt=requestAnimationFrame(ia))}function sa(e){return dt.add(e),!Zt&&typeof requestAnimationFrame<"u"&&(Zt=requestAnimationFrame(ia)),()=>{dt.delete(e)}}function Tl(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 la(e,t){let n=(0,X.useMemo)(()=>Tl(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),m=(0,X.useRef)("init"),f=(0,X.useRef)(null),h=(0,X.useRef)(s),p=(0,X.useRef)(i),x=(0,X.useRef)(!1),g=(0,X.useRef)(0),[,$]=(0,X.useState)(0),v=(0,X.useRef)(null),A=(0,X.useRef)(!0);u.current||(u.current=new qt,u.current.configure(l,c),u.current.snap(n),f.current=n);let k=u.current;if(k.configure(l,c),f.current!==n){let _=m.current,M=!Object.is(h.current,s);k.sameTargets(n)?k.refreshData(n):!r||_==="init"?k.snap(n):_==="idle"?k.hold(n):_==="running"||M?k.update(n,xt(),d):k.snap(n),f.current=n,h.current=s}let F=(0,X.useRef)(()=>!1);F.current=_=>{if(!A.current)return!1;let M=k.step(_);return!M&&m.current==="running"&&(m.current="done"),$(T=>(T+1)%1e9),M||(v.current=null),M};let R=(0,X.useCallback)(()=>{if(!he||v.current||!k.animating)return;let _=M=>F.current(M);v.current=sa(_)},[k]);$e(()=>{let _=!Object.is(p.current,i);if(p.current=i,!r){(m.current!=="done"||k.animating)&&(k.snap(f.current??n),m.current="done",$(M=>M+1));return}m.current==="init"||_&&a?(k.hold(f.current??n),m.current="idle",x.current=!1,$(M=>M+1)):_&&(x.current=!0)},[r,i]),$e(()=>{!r||!a||!x.current||(x.current=!1,k.hold(f.current??n),m.current="idle",$(_=>_+1))},[a,r]),(0,X.useEffect)(()=>{r&&o&&m.current==="idle"&&(k.start(xt()),g.current+=1,m.current="running",R(),$(_=>_+1))},[r,o,i,k,R]),(0,X.useEffect)(()=>{k.animating&&R()}),(0,X.useEffect)(()=>(A.current=!0,()=>{A.current=!1,v.current?.(),v.current=null}),[]);let E=xt(),I=k.elapsed(E),z=r&&m.current==="idle";return{items:k.items(),get:_=>k.get(_),elapsed:z?0:I,fade:(_,M=320)=>z?0:Number.isFinite(I)?Math.max(0,Math.min(1,(I-_)/M)):1,waiting:z,animating:k.animating,generation:g.current}}var Vn=C(O(),1);function ua(e,t,n,r,o){if(r)return o==="categorical"?ge(e,t,n):vr(e,t,n);if(o==="categorical")return ge(e,t,n);let a=ee(e,"strong"),i=ee(e,"accent");return Array.from({length:t},(s,l)=>n.has(l)?i:a)}var Sl=C(K(),1);var Kn=C(O(),1);var ma=e=>e?"neutralStrong":"accent";var Ze=C(O(),1);function da(e,t){return ne(t[0],10)+10+e*14+ne(t[1],10)}function fa({p:e,right:t,steps:n,scale:r,labels:o,min:a}){let i=r.center,s=t-n*14-ne(o[1],10);return(0,Ze.jsxs)("g",{"aria-hidden":"true",children:[Array.from({length:n},(l,c)=>{let d=Mt(e,i===void 0?c/(n-1):2*c/(n-1)-1,a,r);return(0,Ze.jsx)("rect",{x:s-6+c*14,y:3,width:12,height:9,rx:2,fill:d.fill,opacity:d.opacity},c)}),(0,Ze.jsx)(Ce,{x:s-10,y:7.5,anchor:"end",size:10,fill:e.paint("muted"),children:o[0]}),(0,Ze.jsx)(Ce,{x:t,y:7.5,anchor:"end",size:10,fill:e.paint("muted"),children:o[1]})]})}var Un=C(O(),1);function ha(e,t,n,r){if(typeof e!="function")return we(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 Cl=C(K(),1);var Yn=C(O(),1),Al={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}, ${ve(n,"candle")}. First open ${r}, last close ${o}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},ga={en:Al,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}일 이동평균`}},Xn=["ink","muted","dim"];function pa(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,Xn.length)}var q=C(K(),1);var ba=C(K(),1),xa=C(O(),1);function ya({p:e,frame:t,regions:n,opacity:r}){let o=(0,ba.useMemo)(()=>n.map(a=>t.paths[a]).join(""),[t,n]);return o?(0,xa.jsx)("path",{d:o,fill:e.paint("neutralSoft"),fillOpacity:r,stroke:e.paint("panel"),strokeWidth:.6,strokeLinejoin:"round",fillRule:"evenodd",pointerEvents:"none"}):null}var Nl=(e,t)=>e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1],ka=new WeakMap;function wa(e,t={}){let n=Number.isFinite(t.lon0)?((t.lon0+180)%360+360)%360-180:0,r=`${t.focus??""}${t.featureId??""}${t.featureName??""}${n?`${n}`:""}`,o=ka.get(e),a=o?.get(r);if(a)return a;let i=Bn(e)?e:null,s=i?zo(i):Bo(e,t.featureId,t.featureName).shapes,l=new Set(i?.hidden??[]),c=t.focus!==void 0&&i?.focus&&Object.hasOwn(i.focus,t.focus)?i.focus[t.focus]:void 0,d=s.map((g,$)=>$).filter(g=>!l.has(s[g].id)&&s[g].polygons.length),u;if(c)u=Wn("equalEarth",c.lon0);else{let g=Jo(d.map(v=>s[v]))??[-180,-60,180,85],$=i?i.projection:qo(g);u=Wn($,$==="conic"||!i?(g[0]+g[2])/2:$==="equalEarth"?n:0,g)}let m=s.map(g=>Zo(u,g)),f=[1/0,1/0,-1/0,-1/0];if(c)f=Qo(u,c.box);else for(let g of d){let $=m[g].box;f=[Math.min(f[0],$[0]),Math.min(f[1],$[1]),Math.max(f[2],$[2]),Math.max(f[3],$[3])]}Number.isFinite(f[0])||(f=[0,0,1,1]);let h=d.filter(g=>Nl(m[g].box,f)),p=c?new Set(c.ids.split(" ")):null,x={shapes:s,projected:m,projection:u,box:f,regions:p?h.filter(g=>p.has(s[g].id)):h,context:p?h.filter(g=>!p.has(s[g].id)):[],clip:!!c,centers:m.map(ta),match:i?jn(i):Kt(s.map(g=>g.keys))};return o||ka.set(e,o=new Map),o.set(r,x),x}function $a(e){let t=e.box[2]-e.box[0],n=e.box[3]-e.box[1];return t>0&&n>0?t/n:2}function va(e,t,n,r=2,o=e.box){let a=ea(o,Math.max(1,t-r*2),Math.max(1,n-r*2));a.tx+=r,a.ty+=r;let i=new Set([...e.regions,...e.context]);return{fit:a,paths:e.projected.map((s,l)=>i.has(l)?Yt(s.rings,a,[t,n]):""),centers:e.centers.map(([s,l])=>[s*a.k+a.tx,l*a.k+a.ty]),project:(s,l,c)=>{let[d,u]=Hn(e.projection,s,l,c);return[d*a.k+a.tx,u*a.k+a.ty]}}}var B=C(O(),1),Rl=new Intl.PluralRules("en-US",{type:"ordinal"}),Fl={one:"st",two:"nd",few:"rd"},_l={kind:"Choropleth map",legend:["Less","More"],noData:"No data",rankLabel:"Rank",rank:(e,t)=>`${e}${Fl[Rl.select(e)]??"th"} of ${t}`,highest:"Highest",lowest:"Lowest",inStep:e=>`${ve(e,"region")} in this step`,desc:(e,t,n,r)=>`${ve(e,"region")} with data. Highest ${t}, lowest ${n}, mean ${r}`,same:(e,t)=>e===1?`1 region with data, at ${t}`:`${e} regions with data, all at the same value, ${t}`,missing:e=>`${ve(e,"region")} without data`,notLoaded:e=>e==="auto"?"No map is registered. Import one from ztd-charts/geo and pass it to registerMap":ut.includes(e)?`Map "${e}" is not registered. Import it from ztd-charts/geo/${e} and pass it to registerMap`:`Map "${e}" is not registered. Pass a map to registerMap, or use ${ut.join(", ")} or a GeoJSON`},Pl={en:_l,ko:{kind:"단계구분도",legend:["적음","많음"],noData:"데이터 없음",rankLabel:"순위",rank:(e,t)=>`${t}곳 중 ${e}위`,highest:"가장 높은 곳",lowest:"가장 낮은 곳",inStep:e=>`이 단계 ${e}곳`,desc:(e,t,n,r)=>`데이터가 있는 지역 ${e}곳. 가장 높은 곳 ${t}, 가장 낮은 곳 ${n}, 평균 ${r}`,same:(e,t)=>e===1?`데이터가 있는 지역 1곳, 값 ${t}`:`데이터가 있는 지역 ${e}곳, 모두 같은 값 ${t}`,missing:e=>`데이터 없는 지역 ${e}곳`,notLoaded:e=>e==="auto"?"등록한 지도가 없어요. ztd-charts/geo의 지도를 registerMap에 넘겨 주세요":ut.includes(e)?`"${e}" 지도를 등록하지 않았어요. ztd-charts/geo/${e}에서 불러와 registerMap에 넘겨 주세요`:`"${e}" 지도를 등록하지 않았어요. 지도를 registerMap에 넘기거나 ${ut.join(", ")}, GeoJSON을 써 주세요`}},Ma=.14,Qe=172,Ee=17,Ta=16,Ll=600,Dl=8,Jn=10;function qn(e){let t=ye(e.region,"region"),n=(0,q.useMemo)(()=>Ho(e.map,()=>e.data.map((w,L)=>t(w,L))),[e.map,e.data,e.region]),r=n&&"map"in n?n.map:null,o=(0,q.useMemo)(()=>r?wa(r,{focus:e.focus,featureId:e.featureId,featureName:e.featureName}):null,[r,e.focus,e.featureId,e.featureName]),a=o?$a(o):2,i=e.legend===!1?0:22,s=w=>e.ranking===!0||e.ranking!==!1&&w>=Ll,l=ra(e,{height:w=>{let L=s(w)?w-Qe-Ta:w;return Math.round(i+Math.max(120,Math.min(L/a,w*.85)))},duration:480,stagger:60}),{p:c,width:d,height:u}=l,m=Pl[l.lang],f=(0,q.useId)().replace(/:/g,""),h=(0,q.useMemo)(()=>{if(!o)return[];let w=Ve(e.value,"value"),L=new Map,V=o.regions.map(G=>{let Q={i:G,label:"",value:NaN,datum:null,rank:0};return L.set(G,Q),Q}),D=!1;e.data.forEach((G,Q)=>{let Ne=t(G,Q),Se=L.get(o.match(Ne));Se&&(D||(D=Fo.test(String(Ne))),Se.value=w(G,Q),Se.datum=G)});let ie=e.labels==="ko"||e.labels==="en"?e.labels:D?"ko":l.lang;for(let G of V){let Q=o.shapes[G.i];G.label=(ie==="ko"?Q.nameKo:void 0)??Q.name}let re=V.filter(G=>Number.isFinite(G.value)).map(G=>G.value).sort((G,Q)=>Q-G);for(let G of V)if(Number.isFinite(G.value)){let Q=0,Ne=re.length;for(;Q<Ne;){let Se=Q+Ne>>1;re[Se]>G.value?Q=Se+1:Ne=Se}G.rank=Q+1}return V},[o,e.data,e.region,e.value,e.labels,l.lang]),p=(0,q.useMemo)(()=>[...h].sort((w,L)=>(w.rank||1/0)-(L.rank||1/0)||w.i-L.i),[h]),x=p.filter(w=>w.rank>0),g=x.length,$=g?x[0].value:0,v=g?x[g-1].value:0,A=g>0&&$===v,k=Number.isFinite(e.colorSteps)?e.colorSteps:5,F=Number.isFinite(e.colorCenter)?e.colorCenter:void 0,R=(0,q.useMemo)(()=>Mr(e.colorReverse,F,k),[e.colorReverse,F,k]),E=R.steps??5,I=R.center,z=w=>{if(I!==void 0){let L=Math.max(Math.abs($-I),Math.abs(v-I));return L>0?at((w-I)/L,-1,1):0}return $>v?(w-v)/($-v):1},_=s(d)&&g>=2,M=_?d-Qe-Ta:d,T=Math.max(1,u-i),y=(0,q.useMemo)(()=>o?va(o,M,T):null,[o,M,T]),S=(0,q.useMemo)(()=>h.map(w=>({sw:w.rank?Mt(c,z(w.value),Ma,R):null,step:w.rank?vt(z(w.value),R):NaN})),[h,c,R,$,v]),[P,j]=(0,q.useState)(null),ae=w=>vt(I===void 0?w/(E-1):2*w/(E-1)-1,R),ue=(0,q.useMemo)(()=>new Map(h.map((w,L)=>[w.i,L])),[h]),W=(0,q.useMemo)(()=>{if(!o)return new Set;let w=e.highlight,L=D=>typeof D=="string"&&!Vt.includes(D)?ue.get(o.match(D))??-1:typeof D=="number"?p[D]?ue.get(p[D].i):-1:D,V=typeof w=="string"||typeof w=="number"||Array.isArray(w)?(Array.isArray(w)?w:[w]).filter(D=>!(A&&(D==="max"||D==="min"))).map(L):w;return we(V,h.map(D=>D.datum),h.map(D=>D.label),h.map(D=>D.value),A?"none":e.colorReverse?"min":"max")},[o,h,ue,p,A,e.highlight,e.colorReverse]),{fv:Y}=l,Z=(0,q.useMemo)(()=>g?p:[],[p,g]),me=(0,q.useMemo)(()=>Z.map(w=>({datum:w.datum,index:w.i,key:o?.shapes[w.i].id??w.label,label:w.label,value:w.rank?w.value:null,formatted:w.rank?`${Y(w.value)}, ${m.rank(w.rank,g)}`:m.noData})),[Z,o,Y,m,g]),et=(0,q.useMemo)(()=>new Map(Z.map((w,L)=>[w.i,L])),[Z]),Ha=(0,q.useMemo)(()=>Z.map(w=>({row:y?.centers[w.i][1]??0,col:y?.centers[w.i][0]??0})),[Z,y]),Wa=(0,q.useMemo)(()=>{let w=Array.from({length:Jn},()=>[]);return y&&h.forEach((L,V)=>{if(!y.paths[L.i])return;let D=y.centers[L.i][0];w[Math.min(Jn-1,Math.max(0,Math.floor((Number.isFinite(D)?D:0)/Math.max(1,M)*Jn)))].push(V)}),w},[y,h,M]),Va=w=>{let L=y&&o?Yt(o.projected[w].rings,y.fit,[M,T],Dl):"",V=o?.projected[w].box??[0,0,0,0],D=y?.fit.k??1,ie=Math.max(V[2]-V[0],V[3]-V[1])*D/2,[re,G]=y?.centers[w]??[0,0];return{big:L,cx:Number.isFinite(re)?re:0,cy:Number.isFinite(G)?G:0,r:at(ie+4,6,14)}},Ka=(0,q.useMemo)(()=>[{key:"__m",to:[1],from:[0],data:null}],[]),Qt=la(Ka,l.motion),Ua=bt(l,Qt),Xa=l.motion.duration??480,Ya=l.motion.stagger??60,Te=l.active!==null?Z[l.active]:void 0,Qn=null;if(Te&&y){let[w,L]=y.centers[Te.i],V=ue.get(Te.i)??-1;Qn={x:at(Number.isFinite(w)?w:M/2,0,M),y:i+at(Number.isFinite(L)?L:T/2,0,T),title:Te.label,rows:Te.rank?[{label:l.t.value,value:Y(Te.value),color:S[V]?.sw?.raw??c.paint("accent")},{label:m.rankLabel,value:m.rank(Te.rank,g),strong:!1}]:[{label:l.t.value,value:m.noData,strong:!1}]}}let en=e.legendLabels??m.legend,tn=da(E,en),nn=h.length-g,Ja=g?Ot(x.map(w=>w.value))/g:0,qa=g?A?m.same(g,Y($)):m.desc(g,`${x[0].label} ${Y($)}`,`${x[g-1].label} ${Y(v)}`,Y(Ja)):"",Be=n&&"missing"in n?n.missing:null,Za=e.description??(g?`${m.kind}. ${qa}${nn?`. ${m.missing(nn)}`:""}.`:Be?m.notLoaded(Be):""),Qa=l.via==="keyboard"&&l.active!==null&&me[l.active]?`${me[l.active].label}: ${me[l.active].formatted}`:"",ei=P===null?NaN:ae(P),tt=Math.max(0,Math.floor((T-8)/Ee)-2),ht=w=>Math.abs((S[w]?.step??NaN)-ei)<1e-9,er=P===null?[]:x.filter(w=>ht(ue.get(w.i)??-1)),tr=P!==null?er.slice(0,tt+1):g<=tt+1?x:x.slice(0,Math.ceil(tt/2)),nr=P!==null||g<=tt+1?[]:x.slice(g-Math.floor(tt/2)),ti=d-Qe,rr=nr.length>0||P!==null,rn=(w,L)=>l.setActive(w,L==="touch"?"touch":"pointer"),ni=w=>P===null&&l.active!==null&&Z[l.active]?.i!==h[w].i?.55:1,or=ne(m.noData,10)+18,on=nn&&g&&M-tn-14-or>=0?or:0,ri=M-E*14-ne(en[1],10);return(0,B.jsxs)(jr,{c:l,kind:m.kind,ariaLabel:e.ariaLabel,description:Za,emptyText:Be?m.notLoaded(Be):void 0,events:me,tip:Qn,renderTip:e.tooltip,announce:Qa,className:e.className,style:e.style,theme:e.theme,defs:o?.clip?(0,B.jsx)("clipPath",{id:`${f}c`,children:(0,B.jsx)("rect",{width:M,height:T})}):void 0,onKey:w=>{if(w.key==="End"&&g)return l.setActive(g-1,"keyboard"),!0;if(!w.key.startsWith("Arrow"))return!1;let L=l.active===null?0:Po(Ha,l.active,w.key);return L>=0&&l.setActive(L,"keyboard"),!0},children:[Be?(0,B.jsx)(Ce,{x:d/2,y:u/2,anchor:"middle",size:12,fill:c.paint("muted"),children:Bt(m.notLoaded(Be),d-16,12)}):null,e.legend!==!1&&g?(0,B.jsxs)("g",{children:[(0,B.jsx)(fa,{p:c,right:M,steps:E,scale:R,labels:en,min:Ma}),Array.from({length:E},(w,L)=>(0,B.jsx)("rect",{x:ri-7+L*14,y:0,width:14,height:16,fill:"transparent",onPointerEnter:()=>j(L),onPointerLeave:()=>j(null)},L)),on?(0,B.jsxs)("g",{"aria-hidden":"true",children:[(0,B.jsx)("rect",{x:M-tn-14-on,y:3,width:12,height:9,rx:2,fill:c.paint("neutralSoft"),stroke:c.paint("line2"),strokeWidth:.5}),(0,B.jsx)(Ce,{x:M-tn-14-on+16,y:7.5,size:10,fill:c.paint("muted"),children:m.noData})]}):null]}):null,y&&o?(0,B.jsxs)("g",{transform:i?`translate(0 ${i})`:void 0,children:[(0,B.jsx)("rect",{width:M,height:T,fill:"transparent",onPointerEnter:w=>l.via==="keyboard"?void 0:rn(null,w.pointerType)}),(0,B.jsxs)("g",{clipPath:o.clip?`url(#${f}c)`:void 0,children:[o.context.length?(0,B.jsx)(ya,{p:c,frame:y,regions:o.context,opacity:.6}):null,Wa.map((w,L)=>w.length?(0,B.jsx)("g",{style:pt(Ua,Qt.waiting,"fade",L*Ya,Xa),children:w.map(V=>{let D=h[V],ie=P!==null&&!ht(V)?null:S[V].sw,re=et.get(D.i);return(0,B.jsx)("path",{d:y.paths[D.i],fill:ie?ie.fill:c.paint("neutralSoft"),opacity:(ie?ie.opacity:1)*ni(V),stroke:c.paint("panel"),strokeWidth:.6,strokeLinejoin:"round",fillRule:"evenodd",className:"ztd-mark",onPointerEnter:G=>rn(re??null,G.pointerType),onClick:()=>re!==void 0&&l.click(re)},D.i)})},L):null),P!==null?(0,B.jsx)("g",{pointerEvents:"none",fill:"none",stroke:c.paint("ink"),strokeWidth:.75,strokeLinejoin:"round",children:h.map((w,L)=>ht(L)&&y.paths[w.i]?(0,B.jsx)("path",{d:y.paths[w.i]},`s${w.i}`):null)}):null,h.map((w,L)=>{let V=Te?.i===w.i;if(!(W.has(L)&&(P===null||ht(L))||V)||!y.paths[w.i])return null;let D=Va(w.i),ie=V?2:1.4;return D.big?(0,B.jsx)("path",{d:D.big,fill:"none",stroke:c.paint("ink"),strokeWidth:ie,strokeLinejoin:"round",pointerEvents:"none"},`o${w.i}`):(0,B.jsxs)("g",{pointerEvents:"none",children:[(0,B.jsx)("path",{d:y.paths[w.i],fill:"none",stroke:c.paint("ink"),strokeWidth:.75,strokeLinejoin:"round"}),(0,B.jsx)("circle",{cx:D.cx,cy:D.cy,r:D.r,fill:"none",stroke:c.paint("ink"),strokeWidth:ie})]},`o${w.i}`)})]})]},Qt.generation):null,_?(0,B.jsx)("g",{transform:`translate(${ti} ${i})`,children:[[P!==null?m.inStep(er.length):m.highest,tr,0],[m.lowest,nr,(tr.length+1)*Ee+6]].map(([w,L,V])=>L.length?(0,B.jsxs)("g",{transform:V?`translate(0 ${V})`:void 0,children:[rr?(0,B.jsx)(Ce,{x:0,y:Ee/2,size:10,weight:600,fill:c.paint("muted"),children:w}):null,L.map((D,ie)=>{let re=ue.get(D.i)??0,G=(ie+(rr?1:0))*Ee,Q=Y(D.value),Ne=ne(Q,11,600),Se=Te?.i===D.i;return(0,B.jsxs)("g",{onPointerEnter:oi=>rn(et.get(D.i)??null,oi.pointerType),children:[(0,B.jsx)("rect",{x:-4,y:G,width:Qe+4,height:Ee,rx:4,fill:Se?c.paint("lift"):"transparent"}),(0,B.jsx)("rect",{x:0,y:G+Ee/2-4,width:8,height:8,rx:2,fill:S[re].sw?.fill??c.paint("neutralSoft"),opacity:S[re].sw?.opacity??1}),(0,B.jsx)(Ce,{x:12,y:G+Ee/2,size:11,weight:W.has(re)?700:500,fill:c.paint("ink"),children:Bt(`${D.rank}. ${D.label}`,Qe-Ne-22,11,W.has(re)?700:500)}),(0,B.jsx)(Ce,{x:Qe-2,y:G+Ee/2,anchor:"end",size:11,weight:600,fill:c.paint("ink"),children:Q})]},D.i)})]},w):null)}):null]})}var El=C(K(),1);var Ra=C(O(),1),Il={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${ve(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},Ol={en:Il,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},Sa=(e,t)=>Ol[e].other(t);function Ca(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,Ot(o.map(a=>a.value)))}}var Aa=e=>Number.isFinite(e)&&e>0?e:0;function Na(e,t,n,r){return r==="emphasis"?$r(e,t,n):ge(e,t,n)}var zl=C(K(),1);var La=C(O(),1);function Fa(e,t){return t===!1?e.map((n,r)=>r):to(e)}function _a(e,t,n){let r=n.map(o=>o.reduce((a,i)=>a+(Number.isFinite(i)?i:0),0));return we(e,t,t,r,"max")}function Pa(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]=ee(e,"accent"));return o.forEach((a,i)=>r[a]=o.length===1?ee(e,"neutral"):$t(e,1-i/Math.max(1,o.length-1))),r}function Da(e){return!e||typeof e!="object"||Array.isArray(e)?[]:xe(Object.values(e).filter(t=>typeof t=="string"&&t!==""))}function Ea(e,t){return rt(e,t+1,new Set)}var Bl=C(K(),1);var Oa=C(O(),1);var jl=26;var Vm=jl*.62;function Ia(e,t){let n=typeof e=="string"?[e]:Array.isArray(e)?e:[],r=new Set;for(let o of n)typeof o=="string"&&!Vt.includes(o)&&t.forEach((a,i)=>a===o&&r.add(i));return r}var Ae=C(O(),1);function za(e,t,n){let r=Et(e);return r?.type==="scatter"&&t?.size!==void 0&&!Dt(n)?Et("bubble"):r}function Gl(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 Hl(e,t,n,r=!1){let o=za(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&&Sn.includes(o.type)&&Array.isArray(i.hidden)?i.hidden.map(String):[]),c=u=>u.filter(m=>!l.has(m.label)),d=["pie","donut","waffle"];if(o.type==="donut"&&i.legend!=="none")return[];if(d.includes(o.type)){let u=ye(a.label,"label"),m=Ve(a.value,"value"),f=o.type==="waffle",h=t.map((k,F)=>({r:k,label:u(k,F),value:f?m(k,F):Aa(m(k,F))})),{kept:p,other:x}=f?{kept:h,other:null}:Ca(h,i.other,(k,F)=>({r:{},label:Sa(U(n),k),value:F})),g=we(s,p.map(k=>k.r),p.map(k=>k.label),p.map(k=>k.value),f?"first":"max"),$=x?[...p,x]:p,v=_e(k=>f?ge(k,$.length,g):Na(k,$.length,g,i.colorMode)),A=f&&i.shape==="arc";return $.map((k,F)=>({label:k.label,color:v[F],...A&&{shape:"circle"}}))}if(o.type==="candlestick"){let u=pa(Array.isArray(i.ma)?i.ma:void 0,t.length),m=ga[U(n)];return[{label:m.up,color:i.upColor??"accent"},{label:m.down,color:i.downColor??"neutralStrong"},...u.map((f,h)=>({label:m.maLegend(f),color:Xn[h],shape:"line"}))]}if(o.type==="network"){let u=Da(i.groups);if(u.length<2)return[];let m=_e(f=>Ea(f,u.length));return u.map((f,h)=>({label:f,color:m[h],shape:"circle"}))}if(o.type==="symbolMap"){if(typeof a.group!="string")return[];let u=ye(a.group,"group"),m=xe(t.map((h,p)=>u(h,p)).filter(Boolean));if(m.length<2)return[];let f=_e(h=>rt(h,m.length,new Set));return m.map((h,p)=>({label:h,color:f[p],shape:"circle"}))}if(o.type==="scatter"){if(typeof a.series!="string"||Dt(i))return[];let u=ye(a.series,"series"),m=xe(t.map((p,x)=>u(p,x)));if(m.length<2)return[];let f=ha(s,t,m,u),h=_e(p=>rt(p,m.length,f));return c(m.map((p,x)=>({label:p,color:h[x],shape:"circle"})))}if(o.type==="timeline"){let u=typeof a.group!="string",m=u?a.status:a.group;if(typeof m!="string")return[];let f=Lo(t,m,u),h=_e(p=>ge(p,f.length,Ia(s,f)));return c(f.map((p,x)=>({label:p,color:h[x],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 v=ye(a.series,"series");u=xe(t.map((A,k)=>v(A,k)))}let m=Cn(o.type,a,i);if(m.length){let v=we(s,u,u,u.map(()=>0),"none"),A=_e(F=>ge(F,u.length,v)),k=u.length<2?[{label:String((Array.isArray(a.y)?a.y[0]:a.y)??"y"),color:"neutral"}]:u.map((F,R)=>({label:F,color:A[R]}));return[...c(k),...m.map((F,R)=>({label:F,color:ma(R),shape:"line"}))]}if(u.length<2)return[];let h=o.type==="bar"&&i.layout==="diverging"&&s===void 0?eo(u.length,Array.isArray(i.negative)?i.negative.map(v=>u.indexOf(String(v))):[],typeof i.neutral=="string"?u.indexOf(i.neutral):-1):-1,p=h>=0?new Set([h]):we(s,u,u,u.map(()=>0),"first");if(o.type==="radar")return c(u.map((v,A)=>({label:v,color:p.has(A)?"accent":"neutralStrong",shape:"square"})));let x=i.colorMode,g=v=>ge(v,u.length,p);if((o.type==="line"||o.type==="area")&&(g=v=>ua(v,u.length,p,o.type==="area",x)),o.type==="stream"){let v=st(t,a.x,a.y,a.series,{xType:i.xType,locale:n,aggregate:i.aggregate,dayFirst:i.dayFirst}),A=Fa(v.values,i.reorder),k=_a(s,v.series,v.values);g=F=>Pa(F,A,k)}let $=_e(g);return c(u.map((v,A)=>({label:v,color:$[A],...o.type==="line"&&{shape:"line"}})))}return[]}function Wl(e,t){let n=e.facet;return n&&typeof n=="object"&&typeof n.by=="string"&&Kr.includes(t)&&!(t==="bar"&&e.options?.layout==="diverging")?n:void 0}function Vl(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 Ba(e,t){let{spec:n}=e,r=za(n.type,n.encoding,n.options),o=(0,ft.useMemo)(()=>na(n.data),[n.data]),a=!o&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,i=Vr(n,e.locale),s=se(i),l=U(s),c=$o(a?.url??null,{parse:a?.format??"auto",select:a?.select,init:e.fetchInit,locale:s}),d=Yr(n),u=(0,ft.useMemo)(()=>d?No(d,s):void 0,[d,s]),m=n.options?.hidden,f=Array.isArray(m)?m.map(String):[],h=f.join(""),[p,x]=(0,ft.useState)(null);if(!r)return(0,Ae.jsx)(Tn,{error:l==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:i});let g=o??c.data,$=t[r.type],v={...n.options??{}},A={...Gl(r,n.encoding),...v,...u?{tooltip:u}:{},data:g,...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},k=n.card?.legend==="toggle"&&Xr(r.type,n.encoding??{},v),F=p&&p.base===h?p.hidden:f;k&&(A.hidden=F);let R=M=>x(T=>{let y=T&&T.base===h?T.hidden:f;return{base:h,hidden:y.includes(M)?y.filter(S=>S!==M):[...y,M]}}),E=A.height??220,I=Wl(n,r.type),z=a&&!g.length&&(c.loading||c.error||c.empty)?(0,Ae.jsx)(Tn,{loading:c.loading,error:c.error,empty:c.empty,onRetry:c.reload,height:E,locale:i}):I?(0,Ae.jsx)(wo,{chart:$,...Vl(r.type,I,A)}):(0,Ae.jsx)($,{...A});if(n.card){let M=n.card,T=M.legend==="auto"||M.legend==="toggle"?Hl(n,g,s,k):M.legend,y=T?.length?k?(0,Ae.jsx)(Mn,{items:T,hidden:F,onToggle:R,locale:i}):T:void 0,S=M.download?(0,Ae.jsx)(Ao,{data:g,columns:Jr(n),filename:M.title??r.type,formats:Array.isArray(M.download)?M.download:void 0,locale:i}):void 0;z=(0,Ae.jsx)(Br,{number:M.number,title:M.title??Wr(r,l),subtitle:M.subtitle,legend:y,actions:S,source:M.source||void 0,note:M.note||void 0,accent:M.accent,takeaway:M.takeaway,level:M.level,sample:M.sample,replay:M.replay!==!1,className:e.className,locale:i,children:z})}let _=e.theme??n.theme;return _&&(z=(0,Ae.jsx)(Rt,{theme:_,children:z})),z}function Kl({cfg:e,components:t}){let n=Ue();return Ba({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function Ga(e,t){let n=document.getElementById("ztd-chart-config")?.textContent,r=document.getElementById("chart");if(!n||!r)return;let o=JSON.parse(n);(0,ja.hydrateRoot)(r,(0,Zn.createElement)(Rt,{theme:o.theme,cssVars:!0},(0,Zn.createElement)(Kl,{cfg:o,components:{[e]:t}})))}Ga("choropleth",qn);})();
|