yamchart 0.8.7 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{advisor-54JBE2EV.js → advisor-Z7TKPPBR.js} +10 -10
- package/dist/agent-KWKPAYT2.js +8 -0
- package/dist/{chunk-NCPWAWIM.js → chunk-AMHCOB4D.js} +4 -4
- package/dist/{chunk-5N3FYFBV.js → chunk-CWAWATL4.js} +34 -7
- package/dist/chunk-CWAWATL4.js.map +1 -0
- package/dist/{chunk-C7A7TKSY.js → chunk-E2QN2M7S.js} +77 -7
- package/dist/chunk-E2QN2M7S.js.map +1 -0
- package/dist/{chunk-YMQ4PWVJ.js → chunk-FZFBBB7K.js} +2 -2
- package/dist/{chunk-GLCEDWGH.js → chunk-G57J2WQM.js} +4 -4
- package/dist/chunk-ZA6AOQVZ.js +677 -0
- package/dist/chunk-ZA6AOQVZ.js.map +1 -0
- package/dist/{connection-utils-MXEF6X7K.js → connection-utils-CTPN7PV3.js} +4 -4
- package/dist/{describe-XKLBZEWG.js → describe-4NME6RCB.js} +5 -5
- package/dist/{dev-Z2R2DBWO.js → dev-6QGAB4ZH.js} +845 -70
- package/dist/dev-6QGAB4ZH.js.map +1 -0
- package/dist/{dist-LJR7TAW4.js → dist-4GUE24QV.js} +4 -2
- package/dist/{dist-GVNWQXFR.js → dist-7CRX2GIR.js} +2 -2
- package/dist/{dist-E2PVGIPT.js → dist-VNX77VV5.js} +4 -2
- package/dist/index.js +21 -21
- package/dist/public/assets/{EventManagement-DtPDwZ-w.js → EventManagement-MMsAkJKj.js} +2 -2
- package/dist/public/assets/ExplorePage-BSkSNgLT.js +1 -0
- package/dist/public/assets/{LoginPage-DBq1qDOK.js → LoginPage-vaI1dnyL.js} +1 -1
- package/dist/public/assets/PublicViewer-B-OKj2cg.js +1 -0
- package/dist/public/assets/{SetupWizard-hgd12cdr.js → SetupWizard-DvlVX2O6.js} +1 -1
- package/dist/public/assets/{ShareManagement-D82oEJJg.js → ShareManagement-ulvPrOAQ.js} +1 -1
- package/dist/public/assets/{UserManagement-CZsxY9aP.js → UserManagement-CvmpNy3o.js} +1 -1
- package/dist/public/assets/{index-B_fusLA_.css → index-CfyF2Wf-.css} +1 -1
- package/dist/public/assets/index-DD59fsOk.js +195 -0
- package/dist/public/assets/{index.es-BmKO-vE1.js → index.es-BeTaRWIv.js} +1 -1
- package/dist/public/assets/{jspdf.es.min-DMVrmE3G.js → jspdf.es.min-9haD1GSE.js} +3 -3
- package/dist/public/index.html +2 -2
- package/dist/{query-MXMFI5TB.js → query-Z75RKTHV.js} +4 -4
- package/dist/{sample-HDPYNAKS.js → sample-OIJNXQNC.js} +4 -4
- package/dist/{search-6CPEPJTI.js → search-YDCPIDZX.js} +5 -5
- package/dist/{source-resolver-PCASPRSD.js → source-resolver-4SUWXUGW.js} +5 -5
- package/dist/source-resolver-4SUWXUGW.js.map +1 -0
- package/dist/{sync-warehouse-XC7YYZKC.js → sync-warehouse-NZFDS6WK.js} +4 -4
- package/dist/{tables-26PNVZIC.js → tables-WJS2VI4L.js} +5 -5
- package/dist/templates/default/CLAUDE.md +1 -1
- package/dist/templates/default/docs/yamchart-reference.md +164 -2
- package/dist/templates/default/yamchart.yaml +3 -0
- package/dist/{test-APA44AIF.js → test-I4XOF7TZ.js} +5 -17
- package/dist/test-I4XOF7TZ.js.map +1 -0
- package/package.json +3 -2
- package/dist/chunk-5N3FYFBV.js.map +0 -1
- package/dist/chunk-C7A7TKSY.js.map +0 -1
- package/dist/dev-Z2R2DBWO.js.map +0 -1
- package/dist/public/assets/PublicViewer-Da8Cu1C1.js +0 -1
- package/dist/public/assets/index-DVSm0iiw.js +0 -187
- package/dist/test-APA44AIF.js.map +0 -1
- /package/dist/{advisor-54JBE2EV.js.map → advisor-Z7TKPPBR.js.map} +0 -0
- /package/dist/{connection-utils-MXEF6X7K.js.map → agent-KWKPAYT2.js.map} +0 -0
- /package/dist/{chunk-NCPWAWIM.js.map → chunk-AMHCOB4D.js.map} +0 -0
- /package/dist/{chunk-YMQ4PWVJ.js.map → chunk-FZFBBB7K.js.map} +0 -0
- /package/dist/{chunk-GLCEDWGH.js.map → chunk-G57J2WQM.js.map} +0 -0
- /package/dist/{dist-E2PVGIPT.js.map → connection-utils-CTPN7PV3.js.map} +0 -0
- /package/dist/{describe-XKLBZEWG.js.map → describe-4NME6RCB.js.map} +0 -0
- /package/dist/{dist-LJR7TAW4.js.map → dist-4GUE24QV.js.map} +0 -0
- /package/dist/{dist-GVNWQXFR.js.map → dist-7CRX2GIR.js.map} +0 -0
- /package/dist/{source-resolver-PCASPRSD.js.map → dist-VNX77VV5.js.map} +0 -0
- /package/dist/{query-MXMFI5TB.js.map → query-Z75RKTHV.js.map} +0 -0
- /package/dist/{sample-HDPYNAKS.js.map → sample-OIJNXQNC.js.map} +0 -0
- /package/dist/{search-6CPEPJTI.js.map → search-YDCPIDZX.js.map} +0 -0
- /package/dist/{sync-warehouse-XC7YYZKC.js.map → sync-warehouse-NZFDS6WK.js.map} +0 -0
- /package/dist/{tables-26PNVZIC.js.map → tables-WJS2VI4L.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,c as U,b as G,d as I,e as Y,f as q,g as _,F as z,S as K,C as X,D as Q,h as J,T as Z,G as ee,W as re,i as te,H as se,k as ae,l as le,m as oe,P as ce,n as ne,B as ie,L as de,a as he,o as xe,p as me}from"./index-DVSm0iiw.js";import{a as f}from"./echarts-DtOYsfLX.js";function ue({title:a,description:l,loading:r=!1,error:i=null,cached:t,durationMs:o,hasDrillDown:b,onRefresh:s,children:u}){return e.jsxs("div",{className:"chart-container",children:[e.jsxs("div",{className:"flex items-start justify-between p-4 border-b",style:{borderColor:"var(--yc-color-border)"},children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-lg font-semibold",style:{color:"var(--yc-color-text)"},children:a}),b&&e.jsxs("svg",{className:"w-4 h-4 flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:[e.jsx("title",{children:"Right-click to drill down"}),e.jsx("path",{fillRule:"evenodd",d:"M5.22 14.78a.75.75 0 001.06 0l7.22-7.22v5.69a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75h-7.5a.75.75 0 000 1.5h5.69l-7.22 7.22a.75.75 0 000 1.06z",clipRule:"evenodd"})]})]}),l&&e.jsx("p",{className:"text-sm mt-1",style:{color:"var(--yc-color-text-secondary)"},children:l})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[t!==void 0&&e.jsx("span",{className:"text-xs px-2 py-1 rounded",style:t?{backgroundColor:"color-mix(in srgb, var(--yc-color-success) 15%, transparent)",color:"var(--yc-color-success)"}:{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 15%, transparent)",color:"var(--yc-color-primary)"},children:t?"Cached":"Fresh"}),o!==void 0&&e.jsxs("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},children:[o,"ms"]}),s&&e.jsx("button",{onClick:s,disabled:r,className:"p-1.5 hover:bg-black/5 rounded transition-colors disabled:opacity-50",style:{color:"var(--yc-color-text-muted)"},title:"Refresh",children:e.jsx("svg",{className:U("w-4 h-4",r&&"animate-spin"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})]})]}),e.jsx("div",{className:"p-4",children:i?e.jsx("div",{className:"flex items-center justify-center h-64",style:{color:"var(--yc-color-danger)"},children:e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"font-medium",children:"Failed to load chart"}),e.jsx("p",{className:"text-sm mt-1",children:i.message})]})}):u})]})}const ye={day:{label:"Date",format:"%b %d, %Y"},week:{label:"Week Starting",format:"%b %d"},month:{label:"Month",format:"%b '%y"},quarter:{label:"Quarter",format:"quarter"},year:{label:"Year",format:"%Y"}};function fe({chartName:a}){const[l,r]=f.useState(!1),i=async()=>{const t=`{{${a}}}`;try{await navigator.clipboard.writeText(t),r(!0),setTimeout(()=>r(!1),2e3)}catch(o){console.error("Failed to copy:",o)}};return e.jsx("button",{onClick:i,className:"text-sm flex items-center gap-1.5 px-2 py-1 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)"},title:`Copy {{${a}}} for use in markdown widgets`,children:l?e.jsxs(e.Fragment,{children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:"var(--yc-color-success)"},children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),e.jsx("span",{style:{color:"var(--yc-color-success)"},children:"Copied!"})]}):e.jsxs(e.Fragment,{children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})}),e.jsx("span",{children:"Copy Reference"})]})})}function F(a,l){if(!l)return a.toLocaleString();const r=l.decimals??0;switch(l.type){case"currency":return new Intl.NumberFormat("en-US",{style:"currency",currency:l.currency||"USD",minimumFractionDigits:r,maximumFractionDigits:r}).format(a);case"percent":return new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:r,maximumFractionDigits:r}).format(a/100);default:return a.toLocaleString(void 0,{minimumFractionDigits:r,maximumFractionDigits:r})}}function ve(a,l){const r=a>=0?"+":"";return l==="percent_change"?`${r}${a.toFixed(1)}%`:`${r}${a.toLocaleString()}`}function ge({data:a,config:l,title:r,comparison:i}){var p,n,j;if(!(a!=null&&a[0])||!((p=l.value)!=null&&p.field))return e.jsx("div",{className:"h-80 flex items-center justify-center",style:{color:"var(--yc-color-text-muted)"},children:"No data available"});const t=a[0],o=t[l.value.field],b=F(o,l.format);let s=null,u="percent_change",C,w,v;if(i)s=i.change,u=i.changeType,C=i.currentPeriodLabel,w=i.previousPeriodLabel,v=F(i.previousValue,l.format);else if((n=l.comparison)!=null&&n.enabled&&l.comparison.field){const x=t[l.comparison.field];u=l.comparison.type,x&&x!==0&&(u==="percent_change"?s=(o-x)/x*100:s=o-x,v=F(x,l.format))}const h=l.goal,g=h&&h.value!==0?Math.max(0,Math.min(o/h.value*100,100)):null,N=h?o>=h.value?"var(--yc-color-success)":"var(--yc-color-danger)":void 0;return e.jsxs("div",{className:"h-80 flex flex-col items-center justify-center p-8",children:[e.jsxs("div",{className:"text-6xl font-bold tabular-nums",style:{color:"var(--yc-color-text)"},children:[b,l.unit&&e.jsx("span",{className:"text-3xl font-normal ml-2",style:{color:"var(--yc-color-text-muted)"},children:l.unit})]}),C&&e.jsx("div",{className:"text-sm mt-2",style:{color:"var(--yc-color-text-muted)"},children:C}),r&&e.jsx("div",{className:"text-lg mt-3",style:{color:"var(--yc-color-text-secondary)"},children:r}),s!==null&&e.jsxs("div",{className:"mt-4 flex flex-col items-center gap-1",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-lg font-medium px-3 py-1 rounded",style:s>=0?{backgroundColor:"color-mix(in srgb, var(--yc-color-success) 15%, transparent)",color:"var(--yc-color-success)"}:{backgroundColor:"color-mix(in srgb, var(--yc-color-danger) 15%, transparent)",color:"var(--yc-color-danger)"},children:ve(s,u)}),v&&e.jsxs("span",{className:"text-sm",style:{color:"var(--yc-color-text-muted)"},children:["vs ",v]}),!v&&((j=l.comparison)==null?void 0:j.label)&&e.jsx("span",{className:"text-sm",style:{color:"var(--yc-color-text-muted)"},children:l.comparison.label})]}),w&&e.jsx("div",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},children:w})]}),h&&g!==null&&e.jsxs("div",{className:"mt-4 w-full max-w-[280px]",children:[h.show_progress&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex justify-between text-sm mb-1",style:{color:"var(--yc-color-text-muted)"},children:[e.jsxs("span",{children:[F(o,l.format)," / ",F(h.value,l.format)]}),e.jsxs("span",{children:[g.toFixed(0),"%"]})]}),e.jsx("div",{className:"w-full h-2 rounded-full",style:{backgroundColor:"var(--yc-color-surface-hover)"},children:e.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${g}%`,backgroundColor:N}})})]}),h.label&&e.jsx("div",{className:"text-sm mt-1 text-center",style:{color:"var(--yc-color-text-muted)"},children:h.label})]})]})}function je({chartName:a,drillParams:l}){var S,T,$,V,R,B;const{data:r,isLoading:i}=G(a),{data:t,isLoading:o,error:b}=I(a),{data:s}=Y(),u=q(),C=_(c=>c.getEffectiveFilters),w=_(c=>c.setChartFilter),v=i||o,h=l==null?void 0:l._from,g=l?Object.fromEntries(Object.entries(l).filter(([c])=>!c.startsWith("_"))):{},N=Object.keys(g).length>0,p=Object.entries(g).map(([c,d])=>`${c}: ${d}`).join(", ");f.useEffect(()=>{if(N)for(const[c,d]of Object.entries(g))w(a,c,d)},[a,N]);const[n,j]=f.useState(null),x=f.useCallback((c,d,y)=>{j({x:y.x,y:y.y,field:c,value:d})},[]),E=f.useCallback(()=>{var k,D;if(!n||!((k=r==null?void 0:r.drillDown)!=null&&k.model))return;const c=r.drillDown,d=c.fields?typeof c.fields=="string"?c.fields:c.fields[0]:c.field??((D=r.chart.x)==null?void 0:D.field)??n.field,y=new URLSearchParams;if(n.allFields)for(const[O,H]of Object.entries(n.allFields))y.set(O,H);else y.set(d,n.value);y.set("_from",a),window.location.hash=`/charts/${a}/detail?${y.toString()}`,j(null)},[n,r,a]),W=f.useCallback(()=>{var k,D;if(!n||!((k=r==null?void 0:r.drillDown)!=null&&k.chart))return;const c=r.drillDown,d=c.fields?typeof c.fields=="string"?c.fields:c.fields[0]:c.field??((D=r.chart.x)==null?void 0:D.field)??n.field,y=new URLSearchParams({[d]:n.value,_from:a});window.location.hash=`/charts/${r.drillDown.chart}?${y.toString()}`,j(null)},[n,r,a]),M=C(a).granularity,m=M?ye[M]:void 0,L=m==null?void 0:m.label,A=m==null?void 0:m.format;if(i)return e.jsxs("div",{className:"chart-container animate-pulse",children:[e.jsx("div",{className:"p-4 border-b",style:{borderColor:"var(--yc-color-border)"},children:e.jsx("div",{className:"h-6 rounded w-48",style:{backgroundColor:"var(--yc-color-surface-hover)"}})}),e.jsx("div",{className:"p-4",children:e.jsx("div",{className:"h-80 rounded",style:{backgroundColor:"var(--yc-color-surface-hover)"}})})]});if(!r)return e.jsxs("div",{className:"chart-container p-8 text-center",style:{color:"var(--yc-color-text-secondary)"},children:["Chart not found: ",a]});const P=()=>{if(!t)return e.jsx("div",{className:"h-80 rounded animate-pulse",style:{backgroundColor:"var(--yc-color-surface-hover)"}});const c=r.chart.type;switch(c){case"line":if(!r.chart.x||!r.chart.y&&!r.chart.series)return e.jsx("div",{className:"h-80 flex items-center justify-center",style:{color:"var(--yc-color-text-secondary)"},children:"Missing axis configuration"});{const d=m?{...r.chart.x,label:L,format:A}:r.chart.x;return e.jsx(de,{data:t.rows,columns:t.columns,xAxis:d,yAxis:r.chart.y,chartConfig:r.chart,theme:s==null?void 0:s.theme,loading:o,onChartClick:x,goalData:t.goalData})}case"bar":if(!r.chart.x||!r.chart.y&&!r.chart.series)return e.jsx("div",{className:"h-80 flex items-center justify-center",style:{color:"var(--yc-color-text-secondary)"},children:"Missing axis configuration"});{const d=m?{...r.chart.x,label:L,format:A}:r.chart.x;return e.jsx(ie,{data:t.rows,xAxis:d,yAxis:r.chart.y,chartConfig:r.chart,theme:s==null?void 0:s.theme,loading:o,onChartClick:x,goalData:t.goalData})}case"area":if(!r.chart.x||!r.chart.y&&!r.chart.series)return e.jsx("div",{className:"h-80 flex items-center justify-center",style:{color:"var(--yc-color-text-secondary)"},children:"Missing axis configuration"});{const d=m?{...r.chart.x,label:L,format:A}:r.chart.x;return e.jsx(ne,{data:t.rows,xAxis:d,yAxis:r.chart.y,chartConfig:r.chart,theme:s==null?void 0:s.theme,loading:o,onChartClick:x,goalData:t.goalData})}case"pie":return!r.chart.x||!r.chart.y?e.jsx("div",{className:"h-80 flex items-center justify-center",style:{color:"var(--yc-color-text-secondary)"},children:"Missing pie chart configuration"}):e.jsx(ce,{data:t.rows,xAxis:r.chart.x,yAxis:r.chart.y,theme:s==null?void 0:s.theme,loading:o,onChartClick:x});case"donut":return!r.chart.x||!r.chart.y?e.jsx("div",{className:"h-80 flex items-center justify-center",style:{color:"var(--yc-color-text-secondary)"},children:"Missing donut chart configuration"}):e.jsx(oe,{data:t.rows,xAxis:r.chart.x,yAxis:r.chart.y,centerValue:r.chart.centerValue,theme:s==null?void 0:s.theme,loading:o,onChartClick:x});case"scatter":return!r.chart.x||!r.chart.y?e.jsx("div",{className:"h-80 flex items-center justify-center",style:{color:"var(--yc-color-text-secondary)"},children:"Missing axis configuration"}):e.jsx(le,{data:t.rows,xAxis:r.chart.x,yAxis:r.chart.y,chartConfig:r.chart,theme:s==null?void 0:s.theme,loading:o});case"combo":if(!r.chart.x)return e.jsx("div",{className:"h-80 flex items-center justify-center",style:{color:"var(--yc-color-text-secondary)"},children:"Missing axis configuration"});{const d=m?{...r.chart.x,label:L,format:A}:r.chart.x;return e.jsx(ae,{data:t.rows,xAxis:d,chartConfig:r.chart,theme:s==null?void 0:s.theme,loading:o,onChartClick:x,goalData:t.goalData})}case"kpi":return e.jsx(ge,{data:t.rows,config:r.chart,title:r.title,comparison:t.comparison});case"heatmap":return!r.chart.x||!r.chart.y?e.jsx("div",{className:"h-80 flex items-center justify-center",style:{color:"var(--yc-color-text-secondary)"},children:"Missing axis configuration"}):e.jsx(se,{data:t.rows,chartConfig:r.chart,theme:s==null?void 0:s.theme,loading:o});case"funnel":return e.jsx(te,{data:t.rows,chartConfig:r.chart,theme:s==null?void 0:s.theme,loading:o});case"waterfall":return e.jsx(re,{data:t.rows,chartConfig:r.chart,theme:s==null?void 0:s.theme,loading:o});case"gauge":return e.jsx(ee,{data:t.rows,chartConfig:r.chart,theme:s==null?void 0:s.theme,loading:o});case"table":return e.jsx(Z,{data:t.rows,columns:t.columns,chartConfig:r.chart,height:"100%",loading:o});default:return e.jsxs("div",{className:"h-80 flex items-center justify-center text-gray-500",children:['Chart type "',c,'" not yet implemented']})}};return e.jsxs("div",{className:"space-y-4",children:[h&&e.jsxs("div",{className:"flex items-center gap-2 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[e.jsx("button",{onClick:()=>{window.location.hash=`/charts/${h}`},className:"transition-colors hover:opacity-80",style:{color:"var(--yc-color-primary)"},children:h}),e.jsx("span",{children:"/"}),e.jsx("span",{className:"font-medium",style:{color:"var(--yc-color-text)"},children:r.title}),p&&e.jsxs("span",{style:{color:"var(--yc-color-text-muted)"},children:["(",p,")"]})]}),e.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[r.parameters.length>0?e.jsx(z,{parameters:r.parameters,chartName:a}):e.jsx("div",{}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(fe,{chartName:a}),e.jsx(K,{resourceType:"chart",resourceName:a})]})]}),e.jsx(ue,{title:r.title,description:r.description,loading:v,cached:t==null?void 0:t.meta.cached,durationMs:t==null?void 0:t.meta.durationMs,hasDrillDown:!!((S=r.drillDown)!=null&&S.chart),onRefresh:()=>u(a),children:e.jsx(X,{isLoading:o,error:b,data:t==null?void 0:t.rows,onRetry:()=>u(a),children:P()})}),N&&t&&e.jsx(Q,{data:t.rows,columns:t.columns,drillDownColumns:(T=r.drillDown)==null?void 0:T.columns,filterDisplay:p,chartName:a}),n&&e.jsx(J,{x:n.x,y:n.y,field:n.field,value:n.value,allFields:n.allFields,onViewDetails:($=r.drillDown)!=null&&$.model?E:void 0,onGoToChart:(V=r.drillDown)!=null&&V.chart?W:void 0,detailModel:(R=r.drillDown)==null?void 0:R.model,targetChart:(B=r.drillDown)==null?void 0:B.chart,onClose:()=>j(null)})]})}function we({parsed:a}){const l=a.params.token,[r,i]=f.useState(null),[t,o]=f.useState(!1);return f.useEffect(()=>{if(!l){i("No share token provided");return}he.getPublicConfig(l).then(()=>o(!0)).catch(()=>i("This link has expired or been revoked"))},[l]),r?e.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:e.jsx("div",{className:"text-center",children:e.jsx("div",{className:"text-gray-400 text-lg",children:r})})}):t?e.jsx(xe,{value:l??null,children:e.jsxs("div",{className:"min-h-screen",style:{backgroundColor:"var(--yc-color-bg, #f9fafb)"},children:[a.type==="public_chart"?e.jsx("div",{className:"max-w-7xl mx-auto py-6 px-4",children:e.jsx(je,{chartName:a.name})}):e.jsx(me,{dashboardId:a.name,initialTab:a.params.tab}),e.jsx("div",{className:"text-center py-4 text-xs",style:{color:"var(--yc-color-text-muted, #9ca3af)"},children:"Shared via yamchart"})]})}):e.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:e.jsx("div",{className:"text-gray-500",children:"Loading..."})})}export{we as PublicViewer};
|