@svgrid/enterprise 3.1.0 → 3.1.2

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.
Files changed (78) hide show
  1. package/dist/SvSheet.svelte +93 -8
  2. package/dist/cdn/svgrid-enterprise.svelte-external.js +9339 -9077
  3. package/dist/designer/assets/{GridMenus-8gTNssgV.js → GridMenus-DGZJKFvX.js} +1 -1
  4. package/dist/designer/assets/SvGrid.helpers-DE5mmORW.js +1 -0
  5. package/dist/designer/assets/{SvGridCellEditor-DMoWJjEI.js → SvGridCellEditor-C7NWcnNC.js} +1 -1
  6. package/dist/designer/assets/{SvGridChart-Cy1ATrWh.js → SvGridChart-Fg43Yi0M.js} +2 -2
  7. package/dist/designer/assets/{SvGridChartBuilder-eQ3mn0L9.js → SvGridChartBuilder-BqGuA3yU.js} +1 -1
  8. package/dist/designer/assets/{SvGridChartPanel-CATdVc9X.js → SvGridChartPanel-BsiXRAnx.js} +3 -3
  9. package/dist/designer/assets/{SvGridChartView-CmsZtCED.js → SvGridChartView-BgttK0tR.js} +1 -1
  10. package/dist/designer/assets/{SvListBox-BDS66lmZ.js → SvListBox-v2jm0-vf.js} +1 -1
  11. package/dist/designer/assets/cell-formatting-BWrW_O0n.js +1 -0
  12. package/dist/designer/assets/{chart-Cn7MnNqA.js → chart-BIl-dIRv.js} +1 -1
  13. package/dist/designer/assets/{chart-panel-messages-Dz7PTIqT.js → chart-panel-messages-4cF2vw7L.js} +1 -1
  14. package/dist/designer/assets/{chart-summary-BD1qYB2R.js → chart-summary-B7bTtSCC.js} +1 -1
  15. package/dist/designer/assets/{chart-trend-B8xr5LuD.js → chart-trend-CLsn5Hgd.js} +1 -1
  16. package/dist/designer/assets/export-format-DGscOjS9.js +6 -0
  17. package/dist/designer/assets/{index-BSjv6Qec.js → index-V_cMXdxt.js} +314 -314
  18. package/dist/designer/assets/index-l21iGkpF.css +1 -0
  19. package/dist/designer/assets/src-Mu7AGqT8.js +58 -0
  20. package/dist/designer/assets/validate-YxSrBF1H.js +1 -0
  21. package/dist/designer/index.html +12 -12
  22. package/dist/export-ooxml.d.ts +10 -0
  23. package/dist/export-ooxml.js +22 -5
  24. package/dist/import.js +11 -2
  25. package/dist/index.d.ts +2 -2
  26. package/dist/index.js +1 -1
  27. package/dist/node/studio.js +236 -132
  28. package/dist/server/index.d.ts +1 -0
  29. package/dist/server/index.js +1 -0
  30. package/dist/server/server-row-model.d.ts +9 -0
  31. package/dist/server/server-row-model.js +120 -3
  32. package/dist/server/worker-data-source.d.ts +62 -0
  33. package/dist/server/worker-data-source.js +133 -0
  34. package/dist/sheet/objects.d.ts +47 -0
  35. package/dist/sheet/objects.js +33 -0
  36. package/dist/studio/cli.js +55 -1
  37. package/dist/studio/emit-project.js +8 -3
  38. package/dist/studio/init-flow.d.ts +6 -1
  39. package/dist/studio/init-flow.js +43 -2
  40. package/dist/studio/scaffold-app.d.ts +6 -0
  41. package/dist/studio/scaffold-app.js +5 -3
  42. package/dist/studio/scaffold.js +29 -12
  43. package/dist/sveltekit/in-memory.d.ts +21 -1
  44. package/dist/sveltekit/in-memory.js +153 -105
  45. package/dist/sveltekit/index.d.ts +1 -1
  46. package/dist/version.d.ts +14 -1
  47. package/dist/version.js +14 -1
  48. package/dist/wc/{GridMenus-By9vPuq0.js → GridMenus-6_fF5jIm.js} +2 -2
  49. package/dist/wc/{SvGrid.helpers-BdVDtjUm.js → SvGrid.helpers-zBkDTryR.js} +36 -37
  50. package/dist/wc/{SvGridCellEditor-Bnf1Kr5C.js → SvGridCellEditor-CzUKEbkI.js} +1 -1
  51. package/dist/wc/{SvGridChart-BqUJh2pG.js → SvGridChart-C6UvNIbN.js} +3 -3
  52. package/dist/wc/{SvGridChartBuilder-CGycC5cn.js → SvGridChartBuilder-ikf_5LyW.js} +3 -3
  53. package/dist/wc/{SvGridChartPanel-CRnizsHD.js → SvGridChartPanel-Dc_jj7B-.js} +4 -4
  54. package/dist/wc/{SvGridChartView-D1pa_xMy.js → SvGridChartView-thkznAOb.js} +2 -2
  55. package/dist/wc/{cell-formatting-CBfgahv1.js → cell-formatting-hb3vzxhJ.js} +27 -5
  56. package/dist/wc/{chart-6OXlybVT.js → chart-CV5D7_k8.js} +1 -1
  57. package/dist/wc/{chart-summary-2m3ia1-n.js → chart-summary-DGx0QhJa.js} +1 -1
  58. package/dist/wc/{chart-trend-CQOQtTMl.js → chart-trend-BIRH_xH8.js} +1 -1
  59. package/dist/wc/sv-sheet-element.js +7454 -7352
  60. package/dist/wc/{svelte-virtualizer.svelte-CXtQy2TQ.js → svelte-virtualizer.svelte-Du4tjrIP.js} +7 -3
  61. package/dist/wc/{validate-BqDthkNr.js → validate-JAuMsk6Z.js} +36 -36
  62. package/dist/worker/columnar.d.ts +42 -0
  63. package/dist/worker/columnar.js +410 -0
  64. package/dist/worker/index.d.ts +12 -0
  65. package/dist/worker/index.js +12 -0
  66. package/dist/worker/infer-schema.d.ts +21 -0
  67. package/dist/worker/infer-schema.js +34 -0
  68. package/dist/worker/protocol.d.ts +73 -0
  69. package/dist/worker/protocol.js +14 -0
  70. package/dist/worker/serve.d.ts +44 -0
  71. package/dist/worker/serve.js +100 -0
  72. package/package.json +7 -3
  73. package/dist/designer/assets/SvGrid.helpers-BgT-gnCo.js +0 -1
  74. package/dist/designer/assets/cell-formatting-BbubJTVz.js +0 -1
  75. package/dist/designer/assets/export-format-DGckmgKr.js +0 -6
  76. package/dist/designer/assets/index-_JVFxt02.css +0 -1
  77. package/dist/designer/assets/src-DUQ4xE3x.js +0 -58
  78. package/dist/designer/assets/validate-C3B8QKsM.js +0 -1
@@ -0,0 +1,58 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./jszip.min-CX2fPs3O.js","./rolldown-runtime-Dd_uD5pT.js","./pdfmake-BpIYFHoG.js","./vfs_fonts-BV-Ul9v2.js","./src-CITpcm6b.js","./chart-export-B6bkQ3X8.js"])))=>i.map(i=>d[i]);
2
+ import{i as e,n as t}from"./rolldown-runtime-Dd_uD5pT.js";import{a as n,c as r,d as i,i as a,l as o,n as s,o as c,s as l,t as u,u as d}from"./export-format-DGscOjS9.js";import{t as f}from"./preload-helper-HclGiUj8.js";var p={arrows:[`↓`,`→`,`↑`],traffic:[`🔴`,`🟡`,`🟢`],triangles:[`▼`,`◆`,`▲`]};function m(e){let t=1/0,n=-1/0,r=!1;for(let i of e){if(i==null||i===``)continue;let e=Number(i);Number.isFinite(e)&&(r=!0,e<t&&(t=e),e>n&&(n=e))}return r?{min:t,max:n}:null}function h(e,t,n){let r=0;for(let e=0;e<t.length;e+=1)n>=t[e]&&(r=e+1);return e[Math.min(e.length-1,Math.max(0,r))]??e[e.length-1]}function g(e){return e<0?0:e>1?1:e}function _(e){let t=/^#?([0-9a-f]{6})$/i.exec(e.trim());if(!t)return null;let n=parseInt(t[1],16);return[n>>16&255,n>>8&255,n&255]}function v(e){return`#`+e.map(e=>Math.round(g(e/255)*255).toString(16).padStart(2,`0`)).join(``)}function y(e){let t=_(e);if(!t)return null;let n=t.map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return .2126*n[0]+.7152*n[1]+.0722*n[2]>.45?`#1e293b`:`#ffffff`}function b(e,t,n){let r=_(e),i=_(t);if(!r||!i)return e;let a=g(n);return v([r[0]+(i[0]-r[0])*a,r[1]+(i[1]-r[1])*a,r[2]+(i[2]-r[2])*a])}function x(e,t){let n=_(e);return n?`rgba(${n[0]}, ${n[1]}, ${n[2]}, ${g(t).toFixed(3)})`:e}function ee(e,t){let n=[...e].sort((e,t)=>e.offset-t.offset);if(n.length===0)return`#000000`;if(t<=n[0].offset)return n[0].color;let r=n[n.length-1];if(t>=r.offset)return r.color;for(let e=0;e<n.length-1;e+=1){let r=n[e],i=n[e+1];if(t>=r.offset&&t<=i.offset){let e=i.offset-r.offset||1;return b(r.color,i.color,(t-r.offset)/e)}}return r.color}function te(e,t){if(e.stops&&e.stops.length>=2)return ee(e.stops,t);let n=e.min??`#ffffff`,r=e.max??`#000000`;return e.mid?t<=.5?b(n,e.mid,t/.5):b(e.mid,r,(t-.5)/.5):b(n,r,t)}function S(e,t,n,r){let i;if(e.compareColumn){let r=Number(n?.[e.compareColumn]);if(!Number.isFinite(r)||r===0)return null;i=g(t/r)}else if(e.type===`colorScale`&&e.zeroCentred){let n=e.minValue??r?.min??t,a=e.maxValue??r?.max??t;i=g(.5+t/(Math.max(Math.abs(n),Math.abs(a))||1)/2)}else{let n=r?.min??t,a=r?.max??t,o,s;if(e.bounds===`percent`){let t=a-n;o=n+(e.minValue??0)/100*t,s=n+(e.maxValue??100)/100*t}else o=e.minValue??n,s=e.maxValue??a;i=s===o?.5:g((t-o)/(s-o))}return e.type===`colorScale`&&e.reverse&&(i=1-i),i}function ne(e,t,n,r,i){let a={};for(let o of r){if(o.columns&&!o.columns.includes(n))continue;let r=Number(e);if(o.type===`rule`){if(o.when({value:e,row:t})){if(o.background&&(a.background=o.background,!o.color)){let e=y(o.background);e&&(a.color=e)}o.color&&(a.color=o.color),o.fontWeight!=null&&(a.fontWeight=o.fontWeight),o.icon&&(a.icon=o.icon)}continue}if(!(e==null||e===``||!Number.isFinite(r))){if(o.type===`colorScale`){let n=S(o,r,t,i);if(n==null)continue;if(o.mode===`alpha`){let[e,t]=o.alphaBounds??[.05,.85];a.background=x(o.base??`#2563eb`,e+(t-e)*n)}else{a.background=te(o,n);let e=y(a.background);e&&(a.color=e)}o.tooltip===`value`?a.title=String(e):o.tooltip===`percent`&&(a.title=`${Math.round(n*100)}%`)}else if(o.type===`dataBar`){let e;if(o.compareColumn){let n=S(o,r,t,i);if(n==null)continue;e=n*100}else if(o.bounds===`percent`){let n=S(o,r,t,i);if(n==null)continue;e=n*100}else{let t=o.minValue??Math.min(0,i?.min??0),n=(o.maxValue??i?.max??r)-t||1;e=g((r-t)/n)*100}a.dataBar={percent:e,color:r<0?o.negativeColor??`#ef4444`:o.color,fromRight:!1,gradient:o.gradient},o.showValue===!1&&(a.color=`transparent`)}else if(o.type===`iconSet`){let e=p[o.set??`arrows`];a.icon=h(e,o.thresholds,r),o.iconOnly&&(a.iconOnly=!0)}}}return a}function C(e){return(e.type===`colorScale`||e.type===`dataBar`)&&!(`compareColumn`in e&&e.compareColumn)}function re(e){return e.some(C)}var w=new Set([]),T=`SVENTERPRISE-`;function ie(e,t){return e===`suite`||t===`grid`}function E(e){if(!e)return null;let t=e.split(`-`);if(t.length<3)return null;let n=t[t.length-2];if(n==null)return null;if(/^\d{6}$/.test(n)){let e=Number(n.slice(0,4)),t=Number(n.slice(4,6));return t<1||t>12?null:new Date(Date.UTC(e,t,1)-1)}if(/^\d{8}$/.test(n)){let e=Number(n.slice(0,4)),t=Number(n.slice(4,6)),r=Number(n.slice(6,8));if(t<1||t>12||r<1||r>31)return null;let i=new Date(Date.UTC(e,t-1,r,23,59,59,999));return i.getUTCMonth()===t-1?i:null}return null}function D(e,t=new Date){if(e==null||e===``)return{status:`unset`,valid:!1,edition:`suite`};if(!e.startsWith(`SVENTERPRISE-`))return{status:`invalid`,valid:!1,edition:`suite`};if(w.has(e))return{status:`revoked`,valid:!1,edition:`suite`};let n=E(e)??void 0,r=n?t.getTime()>n.getTime():void 0,i=e.startsWith(`SVENTERPRISE-DEV`)?`dev`:e.startsWith(`SVENTERPRISE-EVAL`)?`eval`:`licensed`;return{status:i,valid:!0,edition:i===`licensed`&&e.startsWith(`SVENTERPRISE-GRID-`)?`grid`:`suite`,expiresAt:n,expired:r}}var O=`data-svgrid-enterprise-watermark`,k=`data-svgrid-enterprise-nudged`,ae=`https://svgrid.com`,A=`www.svgrid.com`,j=5e3,M=700,oe=!1,N=null;function P(){se(),!(typeof document>`u`||typeof window>`u`)&&(queueMicrotask(()=>ce()),N||(N=new MutationObserver(()=>ce()),N.observe(document.body,{childList:!0,subtree:!0})))}function se(){oe||(oe=!0,!(typeof console>`u`)&&console.log(`%c @svgrid/enterprise %c User is using a Commercial version which requires a license.
3
+ Contact sales@jqwidgets.com for details or visit the license page: https://svgrid.com/pricing/`,`background:#4f46e5;color:#fff;padding:2px 6px;border-radius:3px;font-weight:600`,`color:inherit`))}function ce(){if(typeof document>`u`)return;let e=document.querySelectorAll(`.sv-grid-root, [role="grid"]`);if(e.length===0){de();return}document.querySelectorAll(`[${O}="fixed"]`).forEach(e=>e.remove());let t=new Set;e.forEach(e=>{let n=le(e);n&&t.add(n)}),t.forEach(ue)}function le(e){let t=e.closest(`.sv-grid-root`);if(t)return t;let n=e;for(;n&&/^(TABLE|THEAD|TBODY|TFOOT|TR|COLGROUP)$/.test(n.tagName);)n=n.parentElement;return n}function ue(e){if(e.hasAttribute(k))return;e.setAttribute(k,`1`),getComputedStyle(e).position===`static`&&(e.style.position=`relative`);let t=fe(`grid`);me(t,!1),e.appendChild(t),pe(t)}function de(){if(typeof document>`u`||document.querySelector(`[${O}="fixed"]`))return;let e=fe(`fixed`);me(e,!0),document.body.appendChild(e),pe(e)}function fe(e){let t=document.createElement(`a`);return t.setAttribute(O,e),t.href=ae,t.target=`_blank`,t.rel=`noopener noreferrer`,t.textContent=A,t.title=`Unlicensed @svgrid/enterprise. Contact sales@jqwidgets.com or visit www.svgrid.com.`,t}function pe(e){if(typeof window>`u`){e.remove();return}window.setTimeout(()=>{if(typeof window>`u`){e.remove();return}e.style.opacity=`0`,window.setTimeout(()=>e.remove(),M)},j)}function me(e,t){Object.assign(e.style,{position:t?`fixed`:`absolute`,bottom:t?`12px`:`6px`,right:t?`12px`:`8px`,zIndex:`2147483647`,background:`rgba(15,23,42,0.85)`,color:`#fff`,padding:t?`6px 10px`:`4px 8px`,borderRadius:t?`4px`:`3px`,fontFamily:`-apple-system, "Segoe UI", Roboto, sans-serif`,fontSize:t?`11px`:`10px`,lineHeight:`1.2`,textDecoration:`none`,boxShadow:t?`0 2px 12px rgba(0,0,0,0.35)`:`0 1px 4px rgba(0,0,0,0.3)`,border:`1px solid rgba(255,255,255,0.18)`,pointerEvents:`auto`,letterSpacing:`0.02em`,opacity:`1`,transition:`opacity ${M}ms ease`})}var he=`data-svgrid-enterprise-upgrade`,ge=`https://svgrid.com/pricing`,_e=`https://svgrid.com/pricing?ref=in-app&utm_source=svgrid-enterprise&utm_medium=upgrade-prompt`,ve=!1;function F(e,t){if(ve||typeof document>`u`||typeof window>`u`||document.querySelector(`[${he}]`))return;ve=!0;let n=ye(e,t?.expired===!0);document.body.appendChild(n),requestAnimationFrame(()=>{n.style.opacity=`1`,n.style.transform=`translateY(0)`})}function I(e){e.style.opacity=`0`,e.style.transform=`translateY(8px)`,window.setTimeout(()=>e.remove(),220)}function ye(e,t=!1){let n=document.createElement(`div`);n.setAttribute(he,`1`),n.setAttribute(`role`,`dialog`),n.setAttribute(`aria-label`,t?`Your trial has ended`:`Unlock SvGrid Pro`),Object.assign(n.style,{position:`fixed`,bottom:`16px`,right:`16px`,zIndex:`2147483646`,width:`320px`,maxWidth:`calc(100vw - 32px)`,boxSizing:`border-box`,padding:`16px 16px 14px`,background:`#0f172a`,color:`#e2e8f0`,borderRadius:`12px`,border:`1px solid rgba(99,102,241,0.4)`,boxShadow:`0 12px 40px rgba(0,0,0,0.45)`,fontFamily:`-apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`,fontSize:`13px`,lineHeight:`1.45`,opacity:`0`,transform:`translateY(8px)`,transition:`opacity 220ms ease, transform 220ms ease`});let r=e?`<strong style="color:#fff">${be(e?String(e):`This`)}</strong> is a Pro feature.`:`You just used a <strong style="color:#fff">Pro</strong> feature.`,i=t?`TRIAL ENDED`:`PRO`,a=t?`Your trial has ended`:`Unlock SvGrid Pro`,o=t?`${r} Your evaluation period is over - everything still works,
4
+ but this notice stays until a licence key is set.`:`${r} It runs in evaluation with a watermark - start a free trial
5
+ to remove it and ship to production.`;return n.innerHTML=`
6
+ <button type="button" data-act="x" aria-label="Dismiss"
7
+ style="position:absolute;top:8px;right:8px;width:24px;height:24px;display:flex;
8
+ align-items:center;justify-content:center;background:transparent;border:0;
9
+ color:#94a3b8;font-size:18px;line-height:1;cursor:pointer;border-radius:6px;">&times;</button>
10
+ <div style="display:flex;align-items:center;gap:8px;margin-bottom:8px;">
11
+ <span style="display:inline-block;background:${t?`#b45309`:`#4f46e5`};color:#fff;font-size:10px;
12
+ font-weight:700;letter-spacing:0.06em;padding:2px 7px;border-radius:999px;">${i}</span>
13
+ <span style="font-weight:700;color:#fff;">${a}</span>
14
+ </div>
15
+ <p style="margin:0 0 12px;color:#cbd5e1;">
16
+ ${o}
17
+ </p>
18
+ <div style="display:flex;gap:8px;align-items:center;">
19
+ <a data-act="trial" href="${_e}" target="_blank" rel="noopener noreferrer"
20
+ style="flex:1;text-align:center;background:#6366f1;color:#fff;font-weight:600;
21
+ text-decoration:none;padding:8px 12px;border-radius:8px;">${t?`Buy a licence`:`Start free trial`}</a>
22
+ <a data-act="pricing" href="${ge}" target="_blank" rel="noopener noreferrer"
23
+ style="color:#a5b4fc;text-decoration:none;padding:8px 6px;font-weight:600;">Pricing</a>
24
+ </div>
25
+ <p style="margin:10px 0 0;font-size:11px;color:#64748b;">
26
+ Already licensed? Call <code style="color:#94a3b8;">setLicenseKey()</code> at startup to hide this.
27
+ </p>
28
+ `,n.querySelector(`[data-act="x"]`)?.addEventListener(`click`,()=>I(n)),n.querySelector(`[data-act="trial"]`)?.addEventListener(`click`,()=>I(n)),n.querySelector(`[data-act="pricing"]`)?.addEventListener(`click`,()=>I(n)),n}function be(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}var L=null,xe=!1,Se=!1,Ce=new Set;function R(e){if(Se)return;Se=!0;let t=e.expiresAt?` on ${e.expiresAt.toISOString().slice(0,10)}`:``;console.info(`@svgrid/enterprise: your evaluation license expired${t}. Everything still works, but the watermark and upgrade notice stay until a license key is set. Contact sales@jqwidgets.com or see https://svgrid.com/pricing`)}function we(){return L!=null}function Te(e){let t=D(L);if(t.valid&&!t.expired)return;let n=t.valid&&t.expired===!0;P(),n&&R(t),F(e,{expired:n})}var Ee={grid:`the enterprise grid`,spreadsheet:`the spreadsheet`,studio:`the Studio`};function De(e){Ce.has(e)||(Ce.add(e),console.info(`@svgrid/enterprise: your Grid license does not cover ${Ee[e]}. Everything still works, but the watermark and upgrade notice stay until the license is upgraded to Suite. Contact sales@jqwidgets.com or see https://svgrid.com/pricing`))}function Oe(e,t){let n=D(L),r=n.valid&&ie(n.edition,e);if(r&&!n.expired)return;let i=n.valid&&n.expired!==!0&&!r;P(),i?De(e):n.valid&&n.expired===!0&&R(n),F(t,{expired:n.valid&&n.expired===!0})}function ke(e){let t=D(L);switch(t.status){case`unset`:P(),F(e);return;case`invalid`:throw Error(`@svgrid/enterprise: invalid license key format (expected "${T}..." prefix).`);case`revoked`:throw Error(`@svgrid/enterprise: this license key has been revoked. Contact sales@jqwidgets.com for a replacement.`);case`dev`:case`eval`:if(t.expired){P(),R(t),F(e,{expired:!0});return}xe||=(console.info(`@svgrid/enterprise: using a development / evaluation license. Not for production use.`),!0);return;case`licensed`:return}}var Ae=!1;function je(){if(Ae)return;if(typeof window>`u`)throw Error(`@svgrid/enterprise: installSmartShim() requires a browser environment`);let e=window.Smart??{Utilities:{}};e.Utilities=e.Utilities??{},typeof e.Utilities.Assign!=`function`&&(e.Utilities.Assign=(t,n)=>{e.Utilities[t]=n}),(!e.Utilities.Core||typeof e.Utilities.Core.toDash!=`function`)&&(e.Utilities.Core={toDash:e=>e.replace(/[A-Z]/g,e=>`-`+e.toLowerCase())}),window.Smart=e,Ae=!0}var Me=/[\x00-\x08\x0B\x0C\x0E-\x1F]/g;function z(e){return e.replace(Me,``).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}function Ne(e){let t=(e,t=2)=>String(e).padStart(t,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}:${t(e.getSeconds())}.000`}async function Pe(e,t,n,r={}){let o=Math.max(1,r.chunkRows??5e3),s=n.length,c=r.rawValues===!0,l=r.cellVisual,u=r.precisionSafe===!0,f=new Map,p=[`<Style ss:ID="sHeader"><Font ss:Bold="1"/><Interior ss:Color="#F2F2F2" ss:Pattern="Solid"/></Style>`],m=e=>e===`right`?`Right`:e===`center`?`Center`:`Left`,h=e=>{let t=e.align&&e.align!==`left`;if(!e.numFmt&&!e.fill&&!e.color&&!e.bold&&!t)return;let n=`${e.numFmt??``}|${e.fill??``}|${e.color??``}|${e.bold?`b`:``}|${e.align??``}`,r=f.get(n);if(r)return r;let i=`s${f.size+1}`,a=[];return t&&a.push(`<Alignment ss:Horizontal="${m(e.align)}"/>`),(e.color||e.bold)&&a.push(`<Font${e.color?` ss:Color="${e.color}"`:``}${e.bold?` ss:Bold="1"`:``}/>`),e.fill&&a.push(`<Interior ss:Color="${e.fill}" ss:Pattern="Solid"/>`),e.numFmt&&a.push(`<NumberFormat ss:Format="${z(e.numFmt)}"/>`),p.push(`<Style ss:ID="${i}">${a.join(``)}</Style>`),f.set(n,i),i};function g(e,t,n,r){let o=e.link?.(t)||void 0,s=l?.(n,r),f=t=>h({numFmt:t,fill:s?.fill,color:s?.color,bold:s?.bold,align:e.align});if(e.exportValue){let n=e.exportValue(t),r=n==null?``:String(n);return{type:`String`,value:s?.icon?`${s.icon} ${r}`:r,styleId:f(),href:o}}let p=t[e.field];if(s?.icon){let t=c?String(p??``):a(p,e.format);return{type:`String`,value:`${s.icon} ${t}`,styleId:f(),href:o}}let m=e=>u&&Math.abs(e)>=0x38d7ea4c68000;if(c){let e=p==null?``:String(p);return typeof p==`number`&&Number.isFinite(p)&&!m(p)?{type:`Number`,value:e,styleId:f(),href:o}:{type:`String`,value:e,styleId:f(),href:o}}let g=i(p,e.format);if(g.ok){let t=d(e.format);return g.value instanceof Date?{type:`DateTime`,value:Ne(g.value),styleId:f(t),href:o}:m(g.value)?{type:`String`,value:String(g.value),styleId:f(),href:o}:{type:`Number`,value:String(g.value),styleId:f(t),href:o}}return{type:`String`,value:a(p,e.format),styleId:f(),href:o}}let _=e=>`<Cell${e.styleId?` ss:StyleID="${e.styleId}"`:``}${e.href?` ss:HRef="${z(e.href)}"`:``}><Data ss:Type="${e.type}">${z(e.value)}</Data></Cell>`,v=r.widths?r.widths.map(e=>`<Column ss:Width="${Math.round(e*.75)}"/>`).join(``):``,y=Math.max(0,Math.floor(r.freezeColumns??0)),b=r.freezeHeader||y>0?`<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel"><FreezePanes/><FrozenNoSplit/>`+(r.freezeHeader?`<SplitHorizontal>1</SplitHorizontal><TopRowBottomPane>1</TopRowBottomPane>`:``)+(y>0?`<SplitVertical>${y}</SplitVertical><LeftColumnRightPane>${y}</LeftColumnRightPane>`:``)+`<ActivePane>2</ActivePane></WorksheetOptions>`:``,x=[`<Row>${t.map(e=>`<Cell ss:StyleID="sHeader"><Data ss:Type="String">${z(e.header??e.field)}</Data></Cell>`).join(``)}</Row>`];for(let e=0;e<s;e++){if(r.signal?.aborted)throw new DOMException(`Export aborted`,`AbortError`);let i=n[e],a=t.map((t,n)=>_(g(t,i,e,n))).join(``);x.push(`<Row>${a}</Row>`),e>0&&e%o===0&&(r.onProgress?.({phase:`serialize`,ratio:e/s,row:e,total:s}),await new Promise(e=>setTimeout(e,0)))}return r.onProgress?.({phase:`serialize`,ratio:1,row:s,total:s}),`<?xml version="1.0"?>
29
+ <?mso-application progid="Excel.Sheet"?>
30
+ <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40"><Styles>${p.join(``)}</Styles><Worksheet ss:Name="${z(e.slice(0,31)||`Sheet1`)}"><Table>${v}${x.join(``)}</Table>`+b+`</Worksheet></Workbook>`}var Fe={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&apos;`},Ie=/[\x00-\x08\x0B\x0C\x0E-\x1F]/g;function B(e){return e.replace(Ie,``).replace(/[&<>"']/g,e=>Fe[e])}function V(e){let t=e,n=``;do n=String.fromCharCode(65+t%26)+n,t=Math.floor(t/26)-1;while(t>=0);return n}function H(e){if(!e)return null;let t=/^#?([0-9a-f]{6})$/i.exec(e.trim());return t?`FF`+t[1].toUpperCase():null}function Le(e){return(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())-Date.UTC(1899,11,30))/864e5}function Re(e){if(e instanceof Date)return e;let t=String(e).trim(),n=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t);return n?new Date(Number(n[1]),Number(n[2])-1,Number(n[3])):new Date(t)}var ze=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
31
+ <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/></Types>`,Be=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
32
+ <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>`;function Ve(e){return e.replace(/[\\/?*[\]:]/g,` `).trim().slice(0,31)||`Sheet1`}function He(e){return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
33
+ <workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><sheets><sheet name="${B(Ve(e))}" sheetId="1" r:id="rId1"/></sheets></workbook>`}var Ue=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
34
+ <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet1.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/></Relationships>`;function We(e,t){let n=new Map,r=164,i=e=>{if(!e)return 0;let t=n.get(e);if(t!=null)return t;let i=r++;return n.set(e,i),i},a=[`<font><sz val="11"/><name val="Calibri"/></font>`,`<font><b/><sz val="11"/><name val="Calibri"/></font>`],o=new Map,s=(e,t)=>{let n=H(t);if(!e&&!n)return 0;let r=`${e?`b`:``}|${n??``}`,i=o.get(r);if(i!=null)return i;let s=a.length;return a.push(`<font>${e?`<b/>`:``}<sz val="11"/><name val="Calibri"/>${n?`<color rgb="${n}"/>`:``}</font>`),o.set(r,s),s},c=[`<fill><patternFill patternType="none"/></fill>`,`<fill><patternFill patternType="gray125"/></fill>`],l=new Map,u=e=>{let t=H(e);if(!t)return 0;let n=l.get(t);if(n!=null)return n;let r=c.length;return c.push(`<fill><patternFill patternType="solid"><fgColor rgb="${t}"/><bgColor indexed="64"/></patternFill></fill>`),l.set(t,r),r},d=[`<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>`,`<xf numFmtId="0" fontId="1" fillId="0" borderId="0" xfId="0" applyFont="1"/>`],f=new Map,p=(e,t,n,r)=>{let i=`${e}|${t}|${n}|${r??``}`,a=f.get(i);if(a!=null)return a;let o=d.length,s=r&&r!==`left`?`<alignment horizontal="${r}"/>`:``;return d.push(`<xf numFmtId="${e}" fontId="${t}" fillId="${n}" borderId="0" xfId="0"${e?` applyNumberFormat="1"`:``}${t?` applyFont="1"`:``}${n?` applyFill="1"`:``}${s?` applyAlignment="1"`:``}>${s}</xf>`),f.set(i,o),o},m=e=>{let t=i(e.numFmt),n=s(e.bold===!0,e.color),r=u(e.fill);return t===0&&n===0&&r===0&&(!e.align||e.align===`left`)?0:p(t,n,r,e.align)};for(let e of t)for(let t of e)m(t);return{styleIndexOf:m,build:()=>`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
35
+ <styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">`+(n.size>0?`<numFmts count="${n.size}">${[...n.entries()].map(([e,t])=>`<numFmt numFmtId="${t}" formatCode="${B(e)}"/>`).join(``)}</numFmts>`:``)+`<fonts count="${a.length}">${a.join(``)}</fonts><fills count="${c.length}">${c.join(``)}</fills><borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="${d.length}">${d.join(``)}</cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles></styleSheet>`}}function Ge(e){let{header:t,rows:n}=e,r=We(t,n),i=[],a=[`<row r="1">${t.map((e,t)=>`<c r="${V(t)}1" s="1" t="inlineStr"><is><t xml:space="preserve">${B(e)}</t></is></c>`).join(``)}</row>`];for(let e=0;e<n.length;e++){let t=e+2,o=n[e],s=[];for(let e=0;e<o.length;e++){let n=o[e],a=`${V(e)}${t}`,c=r.styleIndexOf(n),l=c?` s="${c}"`:``;if(n.link&&i.push({ref:a,url:n.link,id:`rId${i.length+1}`}),n.value==null||n.value===``)s.push(`<c r="${a}"${l}/>`);else if(n.t===`n`)s.push(`<c r="${a}"${l}><v>${Number(n.value)}</v></c>`);else if(n.t===`d`){let e=Re(n.value);s.push(`<c r="${a}"${l}><v>${Le(e)}</v></c>`)}else n.t===`b`?s.push(`<c r="${a}"${l} t="b"><v>${+!!n.value}</v></c>`):s.push(`<c r="${a}"${l} t="inlineStr"><is><t xml:space="preserve">${B(String(n.value))}</t></is></c>`)}a.push(`<row r="${t}">${s.join(``)}</row>`)}let o=e.widths?`<cols>${e.widths.map((e,t)=>`<col min="${t+1}" max="${t+1}" width="${Math.max(4,Math.round(e/7*100)/100)}" customWidth="1"/>`).join(``)}</cols>`:``,s=Math.max(0,Math.floor(e.freezeColumns??0)),c=+!!e.freezeHeader,l=`<sheetView workbookViewId="0"/>`;if(c>0||s>0){let e=`${V(s)}${c+1}`,t=s>0&&c>0?`bottomRight`:s>0?`topRight`:`bottomLeft`;l=`<sheetView workbookViewId="0"><pane${s>0?` xSplit="${s}"`:``}${c>0?` ySplit="${c}"`:``} topLeftCell="${e}" activePane="${t}" state="frozen"/><selection pane="${t}" activeCell="${e}" sqref="${e}"/></sheetView>`}let u=n.length>0?(e.condFormats??[]).map((e,t)=>{let r=V(e.colIdx),i=`${r}2:${r}${n.length+1}`;if(e.kind===`dataBar`){let n=H(e.color)??`FF638EC6`;return`<conditionalFormatting sqref="${i}"><cfRule type="dataBar" priority="${t+1}"><dataBar><cfvo type="min"/><cfvo type="max"/><color rgb="${n}"/></dataBar></cfRule></conditionalFormatting>`}let a=e.colors.map(e=>H(e)??`FFFFFFFF`),o=a.length>=3?`<cfvo type="min"/><cfvo type="percentile" val="50"/><cfvo type="max"/>`:`<cfvo type="min"/><cfvo type="max"/>`,s=a.map(e=>`<color rgb="${e}"/>`).join(``);return`<conditionalFormatting sqref="${i}"><cfRule type="colorScale" priority="${t+1}"><colorScale>${o}${s}</colorScale></cfRule></conditionalFormatting>`}).join(``):``,d=i.length?`<hyperlinks>${i.map(e=>`<hyperlink ref="${e.ref}" r:id="${e.id}"/>`).join(``)}</hyperlinks>`:``,f=``,p=``,m=``;if(e.table&&t.length>0){let o=e.table,s=new Set,c=t.map((e,t)=>{let n=(e??``).trim()||`Column${t+1}`,r=n,i=1;for(;s.has(r.toLowerCase());)r=`${n}${++i}`;return s.add(r.toLowerCase()),r}),l=V(t.length-1),u=n.length+1,d=u+1,h=o.totalsRow&&n.length>0,g=o.totalsFns.findIndex(e=>!e);if(h){let e=t.map((e,t)=>{let i=`${V(t)}${d}`,a=o.totalsFns[t];if(a){let e=0;for(let r of n){let n=r[t];n?.t===`n`&&typeof n.value==`number`&&(e+=n.value)}let s=n.find(e=>e[t]?.t===`n`)?.[t]?.numFmt,l=r.styleIndexOf({t:`n`,value:e,numFmt:s,bold:!0}),u=a===`average`?101:a===`count`?103:109,d=a===`count`?n.length:e;return`<c r="${i}"${l?` s="${l}"`:``}><f>SUBTOTAL(${u},${o.name}[${B(c[t])}])</f><v>${d}</v></c>`}if(t===g){let e=r.styleIndexOf({t:`s`,value:`Total`,bold:!0});return`<c r="${i}"${e?` s="${e}"`:``} t="inlineStr"><is><t>Total</t></is></c>`}return`<c r="${i}"/>`});a.push(`<row r="${d}">${e.join(``)}</row>`)}let _=c.map((e,t)=>{let n=h?o.totalsFns[t]:void 0,r=h?n?` totalsRowFunction="${n}"`:t===g?` totalsRowLabel="Total"`:``:``;return`<tableColumn id="${t+1}" name="${B(e)}"${r}/>`}).join(``);f=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
36
+ <table xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" id="1" name="${B(o.name)}" displayName="${B(o.name)}" ref="A1:${l}${h?d:u}"${h?` totalsRowCount="1"`:` totalsRowShown="0"`}><autoFilter ref="A1:${l}${u}"/><tableColumns count="${t.length}">${_}</tableColumns><tableStyleInfo name="${B(o.style??`TableStyleMedium2`)}" showFirstColumn="0" showLastColumn="0" showRowStripes="1" showColumnStripes="0"/></table>`,m=`rId${i.length+1}`,p=`<tableParts count="1"><tablePart r:id="${m}"/></tableParts>`}let h=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
37
+ <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><sheetViews>${l}</sheetViews><sheetFormatPr defaultRowHeight="15"/>`+o+`<sheetData>${a.join(``)}</sheetData>`+u+d+p+`</worksheet>`,g={"[Content_Types].xml":f?ze.replace(`</Types>`,`<Override PartName="/xl/tables/table1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"/></Types>`):ze,"_rels/.rels":Be,"xl/workbook.xml":He(e.sheetName),"xl/_rels/workbook.xml.rels":Ue,"xl/styles.xml":r.build(),"xl/worksheets/sheet1.xml":h};if(f&&(g[`xl/tables/table1.xml`]=f),i.length||m){let e=i.map(e=>`<Relationship Id="${e.id}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Target="${B(e.url)}" TargetMode="External"/>`);m&&e.push(`<Relationship Id="${m}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/table" Target="../tables/table1.xml"/>`),g[`xl/worksheets/_rels/sheet1.xml.rels`]=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
38
+ <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`+e.join(``)+`</Relationships>`}return g}async function Ke(e,t){let n=new t;for(let[t,r]of Object.entries(e))n.file(t,r);return n.generateAsync({type:`blob`,mimeType:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`})}function qe(e){let t=e=>!!e&&typeof e==`object`&&Object.keys(e).some(e=>/\.(ttf|otf)$/i.test(e))&&Object.values(e).every(e=>typeof e==`string`),n=new Set,r=e=>{if(!e||typeof e!=`object`||n.has(e))return null;if(n.add(e),t(e))return e;let i=e;return r(i.pdfMake?.vfs)??r(i.vfs)??r(i.default)};return r(e)}function Je(e,t){let n=qe(t);return n?(typeof e.addVirtualFileSystem==`function`&&e.addVirtualFileSystem(n),e.vfs=n,!0):!1}function Ye(e){if(!e)return null;let t=e.trim(),n=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(t);if(n){let e=n[1];return`#`+(e.length===3?e.split(``).map(e=>e+e).join(``):e).toLowerCase()}let r=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:[\s,/]+([\d.]+%?))?\s*\)$/i.exec(t);if(!r||!((r[4]===void 0?1:r[4].endsWith(`%`)?Number(r[4].slice(0,-1))/100:Number(r[4]))>.05))return null;let i=e=>Math.max(0,Math.min(255,Math.round(Number(e)))).toString(16).padStart(2,`0`);return`#`+i(r[1])+i(r[2])+i(r[3])}function Xe(e){let t=parseInt(e.slice(1),16),n=e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};return .2126*n(t>>16&255)+.7152*n(t>>8&255)+.0722*n(t&255)}function Ze(e){if(!e||typeof getComputedStyle!=`function`)return{};let t=t=>e.querySelector(t),n=(e,t)=>e?Ye(getComputedStyle(e).getPropertyValue(t)):null,r=e=>{for(let t=e;t;t=t.parentElement){let e=n(t,`background-color`);if(e)return e}return null},i=`:not([class*="row-number"]):not([class*="selection"])`,a=t(`.sv-grid-head .sv-grid-column${i}`)??t(`.sv-grid-header-cell`)??t(`thead th`),o=t(`.sv-grid-body .sv-grid-row:not(.sv-grid-row-alt):not(.sv-grid-header-row) .sv-grid-cell${i}`)??t(`tbody td`),s=t(`.sv-grid-body .sv-grid-row-alt .sv-grid-cell${i}`),c=t(`.sv-grid-group-row .sv-grid-cell`),l={},u=r(a),d=n(a,`color`);u&&(l.headerColor=u),d&&(l.headerTextColor=d);let f=r(o?o.parentElement:t(`.sv-grid-container`)??e),p=n(o,`color`);if(f&&Xe(f)<.4||p&&Xe(p)>.5)return l;p&&(l.textColor=p);let m=n(o,`border-bottom-color`)??n(a,`border-bottom-color`);m&&(l.borderColor=m);let h=n(s,`background-color`);h&&h!==f&&(l.zebraColor=h);let g=n(c,`background-color`),_=n(c,`color`);return g&&g!==f&&(l.groupColor=g),_&&(l.groupTextColor=_),l}var Qe={A4:[595.28,841.89],A3:[841.89,1190.55],A5:[419.53,595.28],LETTER:[612,792],LEGAL:[612,1008]};async function $e(e,t){if(!e?.length)return[];let n=[];for(let r of e){if(`image`in r){n.push(r);continue}let e=await t(r.element),i=await new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result)),r.onerror=()=>n(r.error??Error(`could not read the chart image`)),r.readAsDataURL(e)});n.push({image:i,title:r.title,caption:r.caption,width:r.width})}return n}function et(e){let{columns:t}=e,n=e.opts??{},r=e.styles??{},i=e.theme??{},a=e.now??new Date(0),o=n.fontSize??8,s=n.headerColor??r.headerRow?.backgroundColor??i.headerColor??`#334155`,c=n.headerTextColor??r.headerRow?.color??i.headerTextColor??`#ffffff`,l=n.zebra??!0,u=n.zebraColor??r.rowAlternate?.backgroundColor??i.zebraColor??`#f1f5f9`,d=n.groupColor??i.groupColor??`#e2e8f0`,f=n.groupTextColor??i.groupTextColor??`#0f172a`,p=n.subtotalColor??i.subtotalColor??`#f8fafc`,m=n.textColor??r.rows?.color??i.textColor,h=n.borderColor??i.borderColor??`#e2e8f0`,g=n.repeatHeader??!0,_=e=>e===`bold`||typeof e==`number`&&e>=600,v=e=>{if(e===void 0)return;let t=typeof e==`number`?e:parseFloat(e);return Number.isFinite(t)&&t>0?t:void 0},y=(e,t)=>{if(!t)return;t.backgroundColor&&(e.fillColor=t.backgroundColor),t.color&&(e.color=t.color),_(t.fontWeight)?e.bold=!0:t.fontWeight===`normal`&&(e.bold=!1),t.fontStyle===`italic`&&(e.italics=!0);let n=v(t.fontSize);n&&(e.fontSize=n),t.textAlign&&(e.alignment=t.textAlign)},b=new Map;for(let[e,t]of Object.entries(r.cells??{})){let n=/^([A-Z]+)(\d+)$/i.exec(e.trim());if(!n)continue;let r=0;for(let e of n[1].toUpperCase())r=r*26+(e.charCodeAt(0)-64);b.set(`${Number(n[2])-1}:${r-1}`,t)}let x=n.pageOrientation??(t.length>(n.autoLandscapeThreshold??8)?`landscape`:`portrait`),ee=Array.isArray(n.columnWidths)?n.columnWidths:t.map(()=>n.columnWidths===`auto`?`auto`:`*`),te=t.map((e,t)=>{let n={text:e.header,bold:!0,alignment:e.align??`left`,color:c,fillColor:s};return y(n,r.headerRow?{...r.headerRow,backgroundColor:void 0,color:void 0}:void 0),y(n,b.get(`0:${t}`)),n}),S=e.body??(e.rows??[]).map(e=>({kind:`data`,cells:e})),ne=e.dataCellStyle,C=e.dataCellLink,re=0,w=new Set,T=[te];if(S.forEach((e,n)=>{let i=n+1;if(e.kind===`group`){let n={text:e.label,bold:!0,color:f,fillColor:d,colSpan:t.length,margin:[(e.level??0)*12,2,0,2]},r=Array.from({length:Math.max(0,t.length-1)},()=>({text:``}));T.push([n,...r])}else if(e.kind===`subtotal`)T.push(t.map((t,n)=>({text:e.cells[n]??``,bold:!0,alignment:t.align??`left`,fillColor:p})));else{w.add(i);let n=re++;T.push(t.map((t,i)=>{let a={text:e.cells[i]??``,alignment:t.align??`left`};m&&(a.color=m),y(a,r.rows?{...r.rows,backgroundColor:void 0}:void 0),l&&n%2==1&&r.rowAlternate?.color&&(a.color=r.rowAlternate.color),y(a,b.get(`${n+1}:${i}`));let o=ne?.(n,i);o&&(o.fill&&(a.fillColor=o.fill),o.color&&(a.color=o.color),o.bold&&(a.bold=!0));let s=C?.(n,i);return s&&(a.link=s,a.decoration=`underline`,o?.color||(a.color=`#2563eb`)),a}))}}),e.merges?.length&&!e.body){let n=[...w].sort((e,t)=>e-t);for(let r of e.merges){let e=Math.max(1,Math.floor(r.rowSpan??1)),i=Math.max(1,Math.floor(r.colSpan??1));if(e===1&&i===1)continue;let a=n[r.row];if(a===void 0||r.col<0||r.col>=t.length)continue;let o=T[a]?.[r.col];if(o){e>1&&(o.rowSpan=Math.min(e,T.length-a)),i>1&&(o.colSpan=Math.min(i,t.length-r.col));for(let e=0;e<(o.rowSpan??1);e+=1)for(let t=0;t<(o.colSpan??1);t+=1){if(e===0&&t===0)continue;let n=T[a+e]?.[r.col+t];n&&(n.text=``)}}}}let ie={table:{headerRows:+!!g,dontBreakRows:!0,widths:ee,body:T},layout:{fillColor:e=>l&&e>0&&e%2==0&&w.has(e)?u:null,hLineWidth:()=>.5,vLineWidth:()=>.5,hLineColor:()=>h,vLineColor:()=>h,paddingTop:()=>3,paddingBottom:()=>3,paddingLeft:()=>5,paddingRight:()=>5}},E=(e,t)=>(e??[]).map(e=>{if(`image`in e)return{image:e.image,...e.width?{width:e.width}:{},...e.height?{height:e.height}:{},margin:t};if(`text`in e){let n={text:e.text};return y(n,e.style),{...n,margin:t}}return{columns:[{text:e.left??``,alignment:`left`},{text:e.center??``,alignment:`center`},{text:e.right??``,alignment:`right`}],margin:t}}),D=[];if(D.push(...E(e.headerLines,[0,0,0,4])),n.logo&&D.push({image:n.logo,width:n.logoWidth??90,margin:[0,0,0,8]}),n.title&&D.push({text:n.title,fontSize:o+8,bold:!0,margin:[0,0,0,2]}),n.subtitle&&D.push({text:n.subtitle,fontSize:o+1,color:`#64748b`,margin:[0,0,0,8]}),n.kpis?.length){let e=n.kpiColor??`#f8fafc`;D.push({table:{widths:n.kpis.map(()=>`*`),body:[n.kpis.map(t=>({fillColor:e,margin:[8,6,8,6],stack:[{text:t.label,fontSize:o,color:`#64748b`},{text:t.value,fontSize:o+10,bold:!0,margin:[0,2,0,0]},...t.delta?[{text:t.delta,fontSize:o,color:t.color??`#64748b`,margin:[0,2,0,0]}]:[]]}))]},layout:{hLineWidth:()=>0,vLineWidth:()=>4,vLineColor:()=>`#ffffff`,paddingLeft:()=>0,paddingRight:()=>0,paddingTop:()=>0,paddingBottom:()=>0},margin:[0,0,0,10]})}let O=n.margins??[28,34,28,34],[k,ae]=Qe[n.pageSize??`A4`],A=(x===`landscape`?ae:k)-O[0]-O[2],j=(e.charts??(n.charts??[]).filter(e=>`image`in e)).map(e=>({stack:[...e.title?[{text:e.title,fontSize:o+3,bold:!0,margin:[0,0,0,4]}]:[],{image:e.image,width:Math.min(e.width??A,A)},...e.caption?[{text:e.caption,fontSize:o,color:`#64748b`,margin:[0,3,0,0]}]:[]],margin:[0,0,0,12],unbreakable:!0}));n.chartsPosition!==`below`&&D.push(...j),D.push(ie),n.chartsPosition===`below`&&(j.length&&D.push({text:``,margin:[0,0,0,12]}),D.push(...j)),D.push(...E(e.footerLines,[0,4,0,0]));let M={pageSize:n.pageSize??`A4`,pageOrientation:x,pageMargins:n.margins??[28,34,28,34],defaultStyle:{fontSize:o},content:D};if(n.showPageNumbers??!0){let e=a.toISOString().slice(0,10);M.footer=(t,n)=>({margin:[28,6,28,0],columns:[{text:e,alignment:`left`,fontSize:7,color:`#94a3b8`},{text:`Page ${t} of ${n}`,alignment:`right`,fontSize:7,color:`#94a3b8`}]})}return M}function tt(e,t){let n=/^#?([0-9a-f]{6})$/i.exec(e.trim());if(!n)return e;let r=parseInt(n[1],16);return`#`+[r>>16&255,r>>8&255,r&255].map(e=>Math.round(e+(255-e)*t).toString(16).padStart(2,`0`)).join(``)}function nt(e){let t={};return e.background&&(t.fill=e.background),!t.fill&&e.dataBar&&(t.fill=tt(e.dataBar.color,.72)),e.color&&e.color!==`transparent`&&(t.color=e.color),(e.fontWeight===`bold`||typeof e.fontWeight==`number`&&e.fontWeight>=600)&&(t.bold=!0),e.icon&&(t.icon=e.icon),Object.keys(t).length>0?t:void 0}function U(e,t,n){if(!n||n.length===0)return()=>void 0;let r=new Map;if(re(n))for(let n of e)r.set(n.field,m(t.map(e=>e[n.field])));return(i,a)=>{let o=e[a],s=t[i];if(!o||!s)return;let c=s[o.field];return nt(ne(c,s,o.field,n,r.get(o.field)??null))}}var rt=[`csv`,`tsv`,`html`,`json`,`xml`,`md`],it=null;async function at(){if(typeof window>`u`)throw Error(`@svgrid/enterprise: export requires a browser environment`);return it||=(async()=>{je(),await f(()=>import(`./smart.export-CDCwbFH4.js`),[],import.meta.url);let e=window.Smart?.Utilities?.DataExporter;if(!e)throw Error(`@svgrid/enterprise: failed to load Smart.Utilities.DataExporter`);return e})(),it}async function W(t){let n=globalThis;if(t===`xlsx`&&n.JSZip==null){let t;try{t=await f(()=>import(`./jszip.min-CX2fPs3O.js`).then(t=>e(t.default,1)),__vite__mapDeps([0,1]),import.meta.url)}catch{throw Error(`@svgrid/enterprise: xlsx export requires the "jszip" peer dependency. Install it with: pnpm add jszip`)}n.JSZip=t.default??t}if(t===`pdf`&&n.pdfMake==null){let t,r;try{t=await f(()=>import(`./pdfmake-BpIYFHoG.js`).then(t=>e(t.default,1)),__vite__mapDeps([2,1]),import.meta.url),r=await f(()=>import(`./vfs_fonts-BV-Ul9v2.js`).then(t=>e(t.default,1)),__vite__mapDeps([3,1]),import.meta.url)}catch{throw Error(`@svgrid/enterprise: pdf export requires the "pdfmake" peer dependency. Install it with: pnpm add pdfmake`)}let i=t.default??t;if(!Je(i,r))throw Error(`@svgrid/enterprise: "pdfmake/build/vfs_fonts" did not contain a font map; the installed pdfmake is not one this export knows.`);n.pdfMake=i}}function G(e,t){if(Array.isArray(t))return t;switch(t){case`selected`:return e.getSelectedRows();case`all`:return e.getData();case`displayed`:case void 0:default:return e.getDisplayedRows()}}function K(e,t,n){if(t.columns&&t.columns.length>0)return t.columns;let r=e.getColumns().filter(e=>e.visible&&e.field);return r.length>0?r.map(e=>({field:e.field,header:e.header,format:e.format,align:e.align})):n.length>0?Object.keys(n[0]).filter(e=>!e.startsWith(`_`)).map(e=>({field:e})):[]}function q(e,t,n){if(e.exportValue)return e.exportValue(t)??``;let r=t[e.field];return n?r:a(r,e.format)}async function J(e,t,n){let r=n.rawValues===!0,i={};for(let e of t)i[e.field]=e.header??e.field;let a=[i],o=e.length;for(let i=0;i<o;i++){if(n.signal?.aborted)throw new DOMException(`Export aborted`,`AbortError`);let s=e[i],c={};for(let e of t)c[e.field]=q(e,s,r);a.push(c),i>0&&i%5e3==0&&(n.onProgress?.({phase:`project`,ratio:i/o,row:i,total:o}),await new Promise(e=>setTimeout(e,0)))}return n.onProgress?.({phase:`project`,ratio:1,row:o,total:o}),a}function ot(e){if(!e)return;let t={};e.headerRow&&(t.header={...e.headerRow});let n=e.rows?{...e.rows}:{};return e.rowAlternate&&(n.alternationCount=2,n.alternationStart=0,e.rowAlternate.backgroundColor&&(n.alternationIndex1BackgroundColor=e.rowAlternate.backgroundColor),e.rowAlternate.color&&(n.alternationIndex1Color=e.rowAlternate.color)),Object.keys(n).length>0&&(t.rows=n),e.cells&&(t.cells=e.cells),t}var st=0,ct=new Map;function lt(e){let t=ct.get(e);if(t)return t;let n=`img${++st}`;return ct.set(e,n),n}function ut(e,t=64,n=64){let r=/^data:image\/([a-zA-Z0-9+]+);/i.exec(e)?.[1]?.toLowerCase()??`png`,i=r===`jpg`?`jpeg`:r===`svg+xml`?`svg`:r;return{id:lt(e),base64:e,imageType:i,width:t,height:n}}function dt(e,t){if(!e||e.length===0||t.length===0)return;let n=t[0],r=[];for(let i of e){let e={},a;if(`image`in i)e[n]=i.image,a={mergeAcross:!0,textAlign:`left`};else if(`text`in i)e[n]=i.text,a={mergeAcross:!0,...i.style??{}};else{let r=t[Math.floor(t.length/2)],o=t[t.length-1];i.left!==void 0&&(e[n]=i.left),i.center!==void 0&&(e[r]=i.center),i.right!==void 0&&(e[o]=i.right),a={textAlign:`left`}}r.push({cells:e,style:a})}return r}function ft(e,t){let n=e&&e.length>0?new Set(e):null;return(e,r,i)=>typeof i!=`string`||!/^data:image\//i.test(i)?null:n&&!n.has(r)?{image:ut(i,96,96),value:``}:{image:ut(i,t.width,t.height),value:``}}function pt(e){let t={exportHeader:!0,pageOrientation:e.pageOrientation??`portrait`};e.freezeHeader!==!1&&(t.freezeHeader=!0),e.freezeColumns&&e.freezeColumns>0&&(t.freezeColumnsCount=Math.floor(e.freezeColumns));let n=ot(e.styles);if(n&&(t.style=n),e.hierarchical&&(t.hierarchical=!0),e.merges?.length&&!e.groupBy?.length&&!e.hierarchical){let n=e.merges.map(e=>({cell:[e.row,e.col],rowspan:Math.max(1,Math.floor(e.rowSpan??1)),colspan:Math.max(1,Math.floor(e.colSpan??1))})).filter(e=>e.rowspan>1||e.colspan>1);n.length&&(t.mergedCells=n)}return t}function mt(e,t,n){let r=dt(t.header,n),i=dt(t.footer,n);r&&(e.headerContent=r),i&&(e.footerContent=i);let a=(t.header?.some(e=>`image`in e)??!1)||(t.footer?.some(e=>`image`in e)??!1);if(t.imageFields?.length||a){let n=t.imageSize??{width:32,height:32};e.addImageToCell=ft(t.imageFields,n)}return e}function Y(e,t){return e.toLowerCase().endsWith(`.`+t)?e:`${e}.${t}`}function ht(e,t,n,r,i){return i!==!1&&u(e,t),{blob:e,filename:t,mime:n,rowCount:r,byteSize:e.size}}function gt(e,t,n,r,i){i!==!1&&s(e,t,n);let a=new Blob([e],{type:n});return{blob:a,filename:t,mime:n,rowCount:r,byteSize:a.size}}function X(e,t,n){let r=Math.min(t.length,200);return e.map(e=>{if(typeof e.width==`number`)return e.width;let i=String(e.header??e.field).length;for(let a=0;a<r;a++){let r=q(e,t[a],n),o=r==null?0:String(r).length;o>i&&(i=o)}return Math.max(48,Math.min(400,i*7+14))})}function _t(e,t,n){if(typeof t.freezeColumns==`number`)return t.freezeColumns;let r=e.getColumnPinning().left;if(!r||r.length===0)return;let i=new Set(r),a=0;for(let e of n)if(i.has(e.field))a++;else break;return a>0?a:void 0}function vt(e){let t=e,n=``;do n=String.fromCharCode(65+t%26)+n,t=Math.floor(t/26)-1;while(t>=0);return n}function Z(e,t){if(e.some(e=>e.link))return(n,r)=>{let i=e[r],a=t[n];if(!(!i?.link||!a))return i.link(a)||void 0}}function yt(e){let t={};for(let n of e)n.align&&(t[n.field]=n.align);return t}async function bt(e,t,i,a,s,u){let d=i.map(e=>e.field),f={onProgress:a.onProgress,signal:a.signal};switch(e){case`html`:return{text:await c(t,d,{...f,title:(a.filename??`grid`).trim()||`grid`,align:yt(i),cellStyle:s,cellLink:u}),mime:`text/html;charset=utf-8`,ext:`html`};case`json`:return{text:await l(t,d,f),mime:`application/json;charset=utf-8`,ext:`json`};case`xml`:return{text:await o(t,d,f),mime:`application/xml;charset=utf-8`,ext:`xml`};case`md`:return{text:await r(t,d,{...f,align:yt(i)}),mime:`text/markdown;charset=utf-8`,ext:`md`};case`tsv`:return{text:await n(t,d,{...f,csv:{...a.csv,delimiter:` `}}),mime:`text/tab-separated-values;charset=utf-8`,ext:`tsv`};default:{let e=a.csv?.delimiter??`,`;return{text:await n(t,d,{...f,csv:{...a.csv,delimiter:e}}),mime:`text/csv;charset=utf-8`,ext:`csv`}}}}async function xt(e,t){if(t.sheets&&t.sheets.length>0)throw Error(`@svgrid/enterprise: multi-sheet export requires format 'xlsx', got '${t.format}'`);let n=G(e,t.rows);if(n.length===0)throw Error(`@svgrid/enterprise: nothing to export - the grid has no rows`);let r=K(e,t,n),i=await J(n,r,t.format===`json`?{...t,rawValues:t.rawValues??!0}:t),a=(t.filename??`grid`).trim()||`grid`,o=t.format===`html`?U(r,n,t.conditionalFormats):void 0,s=t.format===`html`?Z(r,n):void 0,{text:c,mime:l,ext:u}=await bt(t.format,i,r,t,o,s);return gt(c,Y(a,u),l,n.length,t.download)}async function St(e,t){if(t.sheets&&t.sheets.length>0)throw Error(`@svgrid/enterprise: multi-sheet export requires format 'xlsx'. Use 'xls' for a single legacy sheet.`);let n=G(e,t.rows);if(n.length===0)throw Error(`@svgrid/enterprise: nothing to export - the grid has no rows`);let r=K(e,t,n),i=(t.filename??`grid`).trim()||`grid`,a=U(r,n,t.conditionalFormats);return gt(await Pe(i,r,n,{rawValues:t.rawValues,onProgress:t.onProgress,signal:t.signal,freezeHeader:t.freezeHeader!==!1,freezeColumns:_t(e,t,r),widths:t.autoFitColumns===!1?void 0:X(r,n,t.rawValues===!0),cellVisual:t.conditionalFormats?.length?a:void 0,precisionSafe:t.precisionSafe}),Y(i,`xls`),`application/vnd.ms-excel;charset=utf-8`,n.length,t.download)}function Q(e){return e.format?.type===`number`||e.format?.type===`currency`}function Ct(e,t,n){let r=[],i=t=>e.find(e=>e.field===t)?.header??t,o=e.findIndex(e=>!Q(e)),s=(t,c)=>{if(c>=n.length){for(let n of t)r.push({kind:`data`,cells:e.map(e=>String(q(e,n,!1)??``))});return}let l=n[c],u=new Map;for(let e of t){let t=String(e[l]??``),n=u.get(t);n?n.push(e):u.set(t,[e])}for(let[t,n]of u)if(r.push({kind:`group`,label:`${i(l)}: ${t} (${n.length})`,level:c}),s(n,c+1),e.some(Q)){let i=e.map(e=>{if(!Q(e))return``;let t=n.reduce((t,n)=>t+(Number(n[e.field])||0),0);return a(t,e.format)});o>=0&&(i[o]=`Subtotal (${t})`),r.push({kind:`subtotal`,cells:i})}};return s(t,0),r}async function wt(e,t){await W(`pdf`);let n=globalThis.pdfMake;if(!n)throw Error(`@svgrid/enterprise: pdf export requires the "pdfmake" peer dependency.`);let r=G(e,t.rows);if(r.length===0)throw Error(`@svgrid/enterprise: nothing to export - the grid has no rows`);let i=K(e,t,r),a=i.map(e=>e.field),o=i.map(e=>({header:e.header??e.field,align:e.align})),s=t.autoGroup!==!1&&!t.groupBy?.length&&!t.hierarchical?(e.getState().grouping??[]).filter(e=>!!e).map(e=>String(e)):[],c=t.groupBy?.length?t.groupBy:s.length>0?s:void 0;if(t.signal?.aborted)throw new DOMException(`Export aborted`,`AbortError`);t.onProgress?.({phase:`write`,ratio:0,total:r.length});let l={...t.pdf,pageOrientation:t.pdf?.pageOrientation??t.pageOrientation},u=l.matchTheme===!1?{}:Ze(e.getElement?.()??null),d={headerLines:t.header,footerLines:t.footer},p=await $e(l.charts,async e=>{let{chartToPngBlob:t}=await f(async()=>{let{chartToPngBlob:e}=await import(`./src-CITpcm6b.js`).then(e=>e.t);return{chartToPngBlob:e}},__vite__mapDeps([4,1,5]),import.meta.url);return t(e,{scale:2})}),m=new Date,h;if(c?.length)h=et({columns:o,body:Ct(i,r,c),opts:l,styles:t.styles,theme:u,...d,charts:p,now:m});else{let e=(await J(r,i,t)).slice(1).map(e=>a.map(t=>String(e[t]??``))),n=U(i,r,t.conditionalFormats);for(let t=0;t<e.length;t++)for(let r=0;r<i.length;r++){let i=n(t,r)?.icon;i&&(e[t][r]=`${i} ${e[t][r]??``}`)}h=et({columns:o,rows:e,dataCellStyle:(e,t)=>{let r=n(e,t);return r?{fill:r.fill,color:r.color,bold:r.bold}:void 0},dataCellLink:Z(i,r),opts:l,styles:t.styles,theme:u,...d,merges:t.merges,charts:p,now:m})}let g=(t.filename??`grid`).trim()||`grid`,_=await new Promise(e=>n.createPdf(h).getBlob(e));return t.onProgress?.({phase:`write`,ratio:1,total:r.length}),ht(_,Y(g,`pdf`),`application/pdf`,r.length,t.download)}async function Tt(e,t,n,r,o,s){let c=e.map(e=>e.header??e.field),l=s?.precisionSafe===!0,u=(e,t,n)=>l&&Math.abs(e)>=0x38d7ea4c68000?{t:`s`,value:String(e),...t}:{t:`n`,value:e,numFmt:n,...t},f=(t,s,c)=>{let l=e[c],f=r(s,c),p={align:l.align,fill:f?.fill,color:f?.color,bold:f?.bold,link:o?.(s,c)};if(l.exportValue){let e=l.exportValue(t);return typeof e==`number`&&Number.isFinite(e)?u(e,p,d(l.format)):e instanceof Date?{t:`d`,value:e,numFmt:d(l.format)??`yyyy-mm-dd`,...p}:{t:`s`,value:e==null?``:String(e),...p}}let m=t[l.field];if(f?.icon){let e=n?String(m??``):a(m,l.format);return{t:`s`,value:`${f.icon} ${e}`,...p}}if(n)return typeof m==`number`&&Number.isFinite(m)?u(m,p):{t:`s`,value:m==null?``:String(m),...p};let h=i(m,l.format);return h.ok?h.value instanceof Date?{t:`d`,value:h.value,numFmt:d(l.format)??`yyyy-mm-dd`,...p}:u(h.value,p,d(l.format)):{t:`s`,value:a(m,l.format),...p}},p=[],m=t.length;for(let n=0;n<m;n++){if(s?.signal?.aborted)throw new DOMException(`Export aborted`,`AbortError`);let r=t[n];p.push(e.map((e,t)=>f(r,n,t))),n>0&&n%2e3==0&&(s?.onProgress?.({phase:`project`,ratio:n/m,row:n,total:m}),await new Promise(e=>setTimeout(e,0)))}return{header:c,cells:p}}async function Et(e,t){await W(`xlsx`);let n=globalThis.JSZip;if(!n)throw Error(`@svgrid/enterprise: xlsx export requires the "jszip" peer dependency.`);let r=G(e,t.rows);if(r.length===0)throw Error(`@svgrid/enterprise: nothing to export - the grid has no rows`);let i=K(e,t,r),a=t.rawValues===!0,o=t.conditionalFormats??[],s=U(i,r,o.filter(e=>e.type===`rule`||e.type===`iconSet`)),c=Z(i,r),l=[];for(let e of o){if(e.type!==`colorScale`&&e.type!==`dataBar`)continue;let t=e.columns&&e.columns.length>0?i.map((t,n)=>e.columns.includes(t.field)?n:-1).filter(e=>e>=0):i.map((e,t)=>t);for(let n of t)if(e.type===`dataBar`)l.push({kind:`dataBar`,colIdx:n,color:e.color});else{let t=e.min??`#ffffff`,r=e.max??`#000000`;l.push({kind:`colorScale`,colIdx:n,colors:e.mid?[t,e.mid,r]:[t,r]})}}if(t.signal?.aborted)throw new DOMException(`Export aborted`,`AbortError`);t.onProgress?.({phase:`write`,ratio:0,total:r.length});let{header:u,cells:d}=await Tt(i,r,a,s,c,{onProgress:t.onProgress,signal:t.signal,precisionSafe:t.precisionSafe}),f=t.autoFitColumns===!1?void 0:X(i,r,a),p=(t.filename??`grid`).trim()||`grid`,m;t.excelTable&&(m={name:`Table1`,totalsRow:typeof t.excelTable==`object`&&t.excelTable.totalsRow===!0,style:typeof t.excelTable==`object`?t.excelTable.style:void 0,totalsFns:i.map(e=>Q(e)?`sum`:void 0)});let h=await Ke(Ge({sheetName:p,header:u,rows:d,widths:f,freezeHeader:t.freezeHeader!==!1,freezeColumns:_t(e,t,i),condFormats:l,table:m}),n);return t.onProgress?.({phase:`write`,ratio:1,total:r.length}),ht(h,Y(p,`xlsx`),`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,r.length,t.download)}async function Dt(e,t){if(ke(`Export`),rt.includes(t.format))return xt(e,t);if(t.format===`xls`)return St(e,t);if(t.format===`pdf`)return wt(e,t);if(t.format===`xlsx`){let n=t.autoGroup===!1?[]:(e.getState().grouping??[]).filter(e=>!!e),r=(t.groupBy?.length??0)>0||n.length>0,i=!!t.styles&&!t.conditionalFormats?.length;if(!t.sheets?.length&&!r&&!t.hierarchical&&!t.merges?.length&&!t.header?.length&&!t.footer?.length&&!t.imageFields?.length&&!i)return Et(e,t)}await W(t.format);let n=await at();if(t.sheets&&t.sheets.length>0){if(t.format!==`xlsx`)throw Error(`@svgrid/enterprise: multi-sheet export requires format 'xlsx', got '${t.format}'`);let r=t.rawValues===!0,i=t.sheets.map(n=>{let i=K(e,{columns:n.columns??t.columns},n.rows),a=n.rows.map(e=>{let t={};for(let n of i)t[n.field]=q(n,e,r);return t}),o=t.autoFitColumns===!1?null:X(i,n.rows,r);return{label:n.label,dataSource:a,columns:i.map((e,t)=>o?{dataField:e.field,label:e.header??e.field,width:o[t]}:{dataField:e.field,label:e.header??e.field}),dataFields:i.map(e=>e.field),style:ot(n.styles??t.styles)}}),a=(t.filename??`grid`).trim()||`grid`,o=pt(t),s=i[0],c=new n(o);c.spreadsheets=i,mt(c,t,s.dataFields);let l={};for(let e of s.columns)l[e.dataField]=e.label;let u=[l,...s.dataSource];if(t.download===!1)throw Error(`@svgrid/enterprise: download:false is not supported for multi-sheet xlsx.`);c.exportData(u,t.format,a);return}let r=G(e,t.rows);if(r.length===0)throw Error(`@svgrid/enterprise: nothing to export - the grid has no rows`);let i=K(e,t,r),a=await J(r,i,t),o=(t.filename??`grid`).trim()||`grid`,s=i.map(e=>e.field),c=t.autoGroup!==!1&&!t.groupBy?.length&&!t.hierarchical?(e.getState().grouping??[]).filter(e=>!!e).map(e=>String(e)):[],l=t.groupBy?.length?t.groupBy:c.length>0?c:void 0,u=!t.hierarchical&&l?.length?l:void 0,d=pt(t);if(t.conditionalFormats?.length){let e=U(i,r,t.conditionalFormats),n={};for(let t=0;t<r.length;t++)for(let r=0;r<i.length;r++){let o=e(t,r);if(!o)continue;let s={};if(o.fill&&(s.backgroundColor=o.fill),o.color&&(s.color=o.color),o.bold&&(s.fontWeight=`bold`),Object.keys(s).length&&(n[vt(r)+(t+2)]=s),o.icon){let e=a[t+1],n=i[r].field;e&&(e[n]=`${o.icon} ${e[n]??``}`)}}if(Object.keys(n).length){let e=d.style??{};d.style={...e,cells:{...e.cells??{},...n}}}}if(t.download===!1)throw Error(`@svgrid/enterprise: download:false is not supported for this xlsx export (grouped / merges / header / footer / images). Use a plain xlsx, xls, pdf, or a text format.`);if(t.signal?.aborted)throw new DOMException(`Export aborted`,`AbortError`);t.onProgress?.({phase:`write`,ratio:0,total:a.length-1});let f=new n(d,u);mt(f,t,s),f.exportData(a,t.format,o),t.onProgress?.({phase:`write`,ratio:1,total:a.length-1})}var Ot={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`};function $(e){return(e==null?``:String(e)).replace(/[&<>"']/g,e=>Ot[e])}function kt(e){let{columns:t,rows:n}=e,r=e.cellStyle,i=e.cellLink,a=e.opts??{},o=a.orientation??`portrait`,s=a.pageSize?`${a.pageSize} ${o}`:o,c=a.margin??`14mm`,l=a.zebra??!0,u=a.zebraColor??`#f6f8fa`,d=a.headerColor??`#f1f5f9`,f=a.headerTextColor??`#0f172a`,p=a.fontSize??9,m=e=>e&&e!==`left`?` style="text-align:${e}"`:``,h=`<thead><tr>`+t.map(e=>`<th${m(e.align)}>${$(e.header)}</th>`).join(``)+`</tr></thead>`,g=(e,t,n,a)=>{let o=[];e.align&&e.align!==`left`&&o.push(`text-align:${e.align}`);let s=r?.(n,a);s?.fill&&o.push(`background:${s.fill}`),s?.color&&o.push(`color:${s.color}`),s?.bold&&o.push(`font-weight:700`);let c=o.length?` style="${o.join(`;`)}"`:``,l=s?.icon?`${$(s.icon)} ${$(t)}`:$(t),u=i?.(n,a);return u&&(l=`<a href="${$(u)}">${l}</a>`),`<td${c}>${l}</td>`},_=`<tbody>`+n.map((e,n)=>`<tr>`+t.map((t,r)=>g(t,e[r]??``,n,r)).join(``)+`</tr>`).join(``)+`</tbody>`,v=[];return a.logo&&v.push(`<img class="logo" src="${$(a.logo)}" alt="" />`),a.title&&v.push(`<h1>${$(a.title)}</h1>`),a.subtitle&&v.push(`<p class="subtitle">${$(a.subtitle)}</p>`),`<!DOCTYPE html>
39
+ <html><head><meta charset="utf-8"><title>${$(a.title??`Grid`)}</title>
40
+ <style>
41
+ @page { size: ${s}; margin: ${c}; }
42
+ @media print { body { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
43
+ body { font-family: -apple-system, "Segoe UI", Roboto, sans-serif; color: #111; margin: 0; }
44
+ .logo { max-height: ${a.logoWidth?``:`48px`}; width: ${a.logoWidth?`${a.logoWidth}px`:`auto`}; display: block; margin-bottom: 8px; }
45
+ h1 { font-size: 16pt; margin: 0 0 2px 0; }
46
+ .subtitle { font-size: 10pt; color: #64748b; margin: 0 0 10px 0; }
47
+ table { border-collapse: collapse; width: 100%; font-size: ${p}pt; }
48
+ thead { display: table-header-group; }
49
+ tr { break-inside: avoid; }
50
+ th, td { border: 1px solid #cbd5e1; padding: 4px 7px; text-align: left; }
51
+ th { background: ${d}; color: ${f}; font-weight: 700; }
52
+ ${l?`tbody tr:nth-child(even) { background: ${u}; }`:``}
53
+ </style></head>
54
+ <body>
55
+ ${v.join(`
56
+ `)}
57
+ <table>${h}${_}</table>
58
+ </body></html>`}async function At(e,t){if(ke(`Print`),typeof window>`u`)throw Error(`@svgrid/enterprise: print requires a browser environment`);let n=G(e,t?.rows);if(n.length===0)throw Error(`@svgrid/enterprise: nothing to print - the grid has no rows`);let r=K(e,{columns:t?.columns},n),i=r.map(e=>e.field),a=(await J(n,r,{rawValues:t?.rawValues})).slice(1).map(e=>i.map(t=>String(e[t]??``))),o=r.map(e=>({header:e.header??e.field,align:e.align})),s={title:t?.title??`Grid`,subtitle:t?.subtitle,logo:t?.logo,orientation:t?.orientation??`portrait`,pageSize:t?.pageSize,margin:t?.margin,zebra:t?.zebra,headerColor:t?.headerColor},c=U(r,n,t?.conditionalFormats),l=kt({columns:o,rows:a,cellStyle:(e,t)=>c(e,t),cellLink:Z(r,n),opts:s}),u=window.open(``,`_blank`,`width=900,height=700`);if(!u)throw Error(`@svgrid/enterprise: print() could not open a window - the browser blocked the popup`);u.document.open(),u.document.write(l),u.document.close(),u.focus(),u.addEventListener(`load`,()=>{setTimeout(()=>u.print(),50)}),setTimeout(()=>{try{u.print()}catch{}},300)}var jt=t({ALL_VALUES:()=>ALL_VALUES,DATA_BAR_COLOR:()=>DATA_BAR_COLOR,DATA_BAR_NEGATIVE_COLOR:()=>DATA_BAR_NEGATIVE_COLOR,DEFAULT_ALERT_MESSAGE:()=>DEFAULT_ALERT_MESSAGE,DEFAULT_TABLE_STYLE:()=>DEFAULT_TABLE_STYLE,GRAND_TOTAL_ROW_ID:()=>GRAND_TOTAL_ROW_ID,GROUP_TOTAL_ROW_ID_PREFIX:()=>GROUP_TOTAL_ROW_ID_PREFIX,NO_TABLE_STYLE:()=>NO_TABLE_STYLE,PROTECTED_MESSAGE:()=>PROTECTED_MESSAGE,countReducer:()=>countReducer,exportGrid:()=>Dt,printGrid:()=>At});export{P as a,re as c,Oe as i,ne as l,we as n,m as o,Te as r,C as s,jt as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./server-block-cache-CXJKkJpy.js";var t=10,n=1e3,r=`https://svgrid.com/docs/getting-started/3-data-and-columns/`;function i(e,t=[]){for(let n of e)n.columns?.length?i(n.columns,t):t.push(n);return t}function a(a){let s=[],c=i(a.columns??[]),l=[],u=a.data??[],d=Math.min(u.length,n);for(let n=0;n<d&&l.length<t;n+=1){let t=u[n];e(t)||l.push(t)}if(l.length&&!a.serverGroup){let e=new Set;for(let t of l)if(t&&typeof t==`object`)for(let n of Object.keys(t))e.add(n);for(let t of c){let n=t.field;if(!n||t.fieldFn||e.has(n))continue;let i=o(n,[...e]);s.push(`[svgrid] Column field "${n}" does not exist on your row data, so that column renders empty.${i?` Did you mean "${i}"?`:``} Available keys: ${[...e].slice(0,12).join(`, `)}. See ${r}`)}}let f=new Map;for(let e of c){let t=e.id??e.field;t&&f.set(t,(f.get(t)??0)+1)}for(let[e,t]of f)t>1&&s.push(`[svgrid] ${t} columns share the id "${e}". Column state (sorting, filtering, pinning, width) is keyed by id, so they will act as one. Give each an explicit \`id\`. See ${r}`);let p=a.pageable===void 0&&a.showPagination===void 0;a.pageSize!==void 0&&p&&s.push("[svgrid] `pageSize` is set but pagination was never turned on, so it has no effect and every row renders. Add `pageable` to switch the pager on."),!(a.sortable===!0||a.features?.rowSortingFeature)&&c.some(e=>e.sortable===!0)&&s.push("[svgrid] A column sets `sortable: true`, but sorting is not enabled on the grid, so its header does nothing. Add `sortable` to <SvGrid> (it registers the sorting feature for you).");let m=new Set;for(let e of c){let t=e.id??e.field;t&&m.add(t)}for(let e of a.groupBy??[]){if(m.has(e))continue;let t=o(e,[...m]);s.push(`[svgrid] \`groupBy\` refers to column "${e}", which does not exist, so that grouping level is ignored.${t?` Did you mean "${t}"?`:``} Column ids: ${[...m].slice(0,12).join(`, `)}`)}let h=a.treeData?.column;if(h&&!m.has(h)&&s.push(`[svgrid] \`treeData.column\` refers to column "${h}", which does not exist, so the expander falls back to the first visible column.`),l.length&&a.treeData){let e=new Set;for(let t of l)if(t&&typeof t==`object`)for(let n of Object.keys(t))e.add(n);let t=a.treeData.parentField;if(t&&!e.has(t)){let n=o(t,[...e]);s.push(`[svgrid] \`treeData.parentField\` is "${t}", which is not on your row data, so every row becomes a root and no hierarchy appears.${n?` Did you mean "${n}"?`:``}`)}let n=a.treeData.idField;n&&!e.has(n)&&s.push(`[svgrid] \`treeData.idField\` is "${n}", which is not on your row data, so parent lookups cannot match and the tree stays flat.`)}return a.gantt&&a.treeData&&s.push("[svgrid] `gantt` and `treeData` are both set. The Gantt builds its own work-breakdown tree from `gantt.parentField` and needs every descendant row, but `treeData` hides collapsed children from the view, so summary bars will under-report. Remove `treeData` and set `gantt.parentField` instead."),(a.initialColumnPinning?.left?.length??0)+(a.initialColumnPinning?.right?.length??0)>0&&a.columnVirtualization!==!1&&s.push("[svgrid] `initialColumnPinning` is set while column virtualization is on (its default), so the pinned columns will not stick - the virtualizer recycles column nodes. Add `columnVirtualization={false}`."),a.externalPagination===!0&&a.rowCount===void 0&&s.push("[svgrid] `externalPagination` is on but `rowCount` is not set, so the pager cannot know how many pages exist. Pass the server total as `rowCount`."),a.externalSort===!0&&!a.onSortingChange&&s.push("[svgrid] `externalSort` is on but there is no `onSortingChange` handler, so clicking a header changes nothing - the grid stopped sorting and nobody is listening. Add `onSortingChange` and re-fetch in your handler."),a.externalFilter===!0&&!a.onFiltersChange&&s.push("[svgrid] `externalFilter` is on but there is no `onFiltersChange` handler, so filtering the grid changes nothing. Add `onFiltersChange` and re-fetch in your handler."),s}function o(e,t){let n,r=1/0;for(let i of t){let t=s(e.toLowerCase(),i.toLowerCase());t<r&&(r=t,n=i)}let i=Math.min(3,Math.floor(e.length/3)+1);return r<=i?n:void 0}function s(e,t){if(e===t)return 0;let n=Array(t.length+1);for(let e=0;e<=t.length;e++)n[e]=e;for(let r=1;r<=e.length;r++){let i=n[0];n[0]=r;for(let a=1;a<=t.length;a++){let o=Math.min(n[a]+1,n[a-1]+1,i+(e[r-1]===t[a-1]?0:1));i=n[a],n[a]=o}}return n[t.length]}export{a as validateGridConfig};
@@ -4,18 +4,18 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>SvGrid Studio - Designer</title>
7
- <script type="module" crossorigin src="./assets/index-BSjv6Qec.js"></script>
7
+ <script type="module" crossorigin src="./assets/index-V_cMXdxt.js"></script>
8
8
  <link rel="modulepreload" crossorigin href="./assets/rolldown-runtime-Dd_uD5pT.js">
9
9
  <link rel="modulepreload" crossorigin href="./assets/disclose-version-CIm4S9xS.js">
10
- <link rel="modulepreload" crossorigin href="./assets/cell-formatting-BbubJTVz.js">
11
- <link rel="modulepreload" crossorigin href="./assets/export-format-DGckmgKr.js">
10
+ <link rel="modulepreload" crossorigin href="./assets/cell-formatting-BWrW_O0n.js">
11
+ <link rel="modulepreload" crossorigin href="./assets/export-format-DGscOjS9.js">
12
12
  <link rel="modulepreload" crossorigin href="./assets/preload-helper-HclGiUj8.js">
13
- <link rel="modulepreload" crossorigin href="./assets/src-DUQ4xE3x.js">
13
+ <link rel="modulepreload" crossorigin href="./assets/src-Mu7AGqT8.js">
14
14
  <link rel="modulepreload" crossorigin href="./assets/editor-contract-Bpoa7A5g.js">
15
15
  <link rel="modulepreload" crossorigin href="./assets/date-format-B8JbEtIG.js">
16
16
  <link rel="modulepreload" crossorigin href="./assets/list-option-BP_dWS66.js">
17
- <link rel="modulepreload" crossorigin href="./assets/SvListBox-BDS66lmZ.js">
18
- <link rel="modulepreload" crossorigin href="./assets/SvGrid.helpers-BgT-gnCo.js">
17
+ <link rel="modulepreload" crossorigin href="./assets/SvListBox-v2jm0-vf.js">
18
+ <link rel="modulepreload" crossorigin href="./assets/SvGrid.helpers-DE5mmORW.js">
19
19
  <link rel="modulepreload" crossorigin href="./assets/editor-registry-BjP16H0v.js">
20
20
  <link rel="modulepreload" crossorigin href="./assets/popover-CUkLsvRX.js">
21
21
  <link rel="modulepreload" crossorigin href="./assets/SvGridDropdown-Cjz0H-fI.js">
@@ -25,12 +25,12 @@
25
25
  <link rel="modulepreload" crossorigin href="./assets/focus-trap-V2-6Fy9I.js">
26
26
  <link rel="modulepreload" crossorigin href="./assets/SvTabs-2mHC6oaz.js">
27
27
  <link rel="modulepreload" crossorigin href="./assets/SvMenuList-Dgq2D5VN.js">
28
- <link rel="modulepreload" crossorigin href="./assets/chart-trend-B8xr5LuD.js">
29
- <link rel="modulepreload" crossorigin href="./assets/chart-Cn7MnNqA.js">
28
+ <link rel="modulepreload" crossorigin href="./assets/chart-trend-CLsn5Hgd.js">
29
+ <link rel="modulepreload" crossorigin href="./assets/chart-BIl-dIRv.js">
30
30
  <link rel="modulepreload" crossorigin href="./assets/chart-export-B6bkQ3X8.js">
31
- <link rel="modulepreload" crossorigin href="./assets/SvGridChart-Cy1ATrWh.js">
32
- <link rel="modulepreload" crossorigin href="./assets/chart-panel-messages-Dz7PTIqT.js">
33
- <link rel="modulepreload" crossorigin href="./assets/SvGridChartPanel-CATdVc9X.js">
31
+ <link rel="modulepreload" crossorigin href="./assets/SvGridChart-Fg43Yi0M.js">
32
+ <link rel="modulepreload" crossorigin href="./assets/chart-panel-messages-4cF2vw7L.js">
33
+ <link rel="modulepreload" crossorigin href="./assets/SvGridChartPanel-BsiXRAnx.js">
34
34
  <link rel="modulepreload" crossorigin href="./assets/server-block-cache-CXJKkJpy.js">
35
35
  <link rel="stylesheet" crossorigin href="./assets/date-format-DKS-z0xS.css">
36
36
  <link rel="stylesheet" crossorigin href="./assets/SvListBox-BXfyqy4a.css">
@@ -41,7 +41,7 @@
41
41
  <link rel="stylesheet" crossorigin href="./assets/SvMenuList-DJ47ba1h.css">
42
42
  <link rel="stylesheet" crossorigin href="./assets/SvGridChart-BgLuPO7I.css">
43
43
  <link rel="stylesheet" crossorigin href="./assets/SvGridChartPanel-4Pc8y5yO.css">
44
- <link rel="stylesheet" crossorigin href="./assets/index-_JVFxt02.css">
44
+ <link rel="stylesheet" crossorigin href="./assets/index-l21iGkpF.css">
45
45
  </head>
46
46
  <body>
47
47
  <div id="app"></div>
@@ -78,6 +78,16 @@ export type XlsxModel = {
78
78
  };
79
79
  /** 0-based column index -> Excel letter (0 -> A, 26 -> AA). */
80
80
  export declare function colName(index: number): string;
81
+ /**
82
+ * Excel serial date: days since 1899-12-30 on the LOCAL wall clock.
83
+ *
84
+ * An Excel serial has no timezone; it is the date and time a person reads. So
85
+ * it has to be built from the local parts the grid displays. Subtracting a UTC
86
+ * epoch from `getTime()` wrote local midnight on the 15th as 45305.9167 in
87
+ * UTC+2, which Excel shows as the 14th, and west of UTC added a spurious time
88
+ * to every pure date (#103).
89
+ */
90
+ export declare function toSerialDate(d: Date): number;
81
91
  /**
82
92
  * Build the OOXML package parts for a single-sheet workbook. Returns a map of
83
93
  * `path -> xml string` ready to be zipped by {@link packageXlsx}.
@@ -46,10 +46,27 @@ function argb(hex) {
46
46
  const m = /^#?([0-9a-f]{6})$/i.exec(hex.trim());
47
47
  return m ? 'FF' + m[1].toUpperCase() : null;
48
48
  }
49
- /** Excel serial date (days since 1899-12-30), UTC-based. */
50
- function toSerialDate(d) {
51
- const epoch = Date.UTC(1899, 11, 30);
52
- return (d.getTime() - epoch) / 86400000;
49
+ /**
50
+ * Excel serial date: days since 1899-12-30 on the LOCAL wall clock.
51
+ *
52
+ * An Excel serial has no timezone; it is the date and time a person reads. So
53
+ * it has to be built from the local parts the grid displays. Subtracting a UTC
54
+ * epoch from `getTime()` wrote local midnight on the 15th as 45305.9167 in
55
+ * UTC+2, which Excel shows as the 14th, and west of UTC added a spurious time
56
+ * to every pure date (#103).
57
+ */
58
+ export function toSerialDate(d) {
59
+ const wallClock = Date.UTC(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds());
60
+ return (wallClock - Date.UTC(1899, 11, 30)) / 86400000;
61
+ }
62
+ /** A non-Date `t: 'd'` value as a Date. A bare 'YYYY-MM-DD' is that local day,
63
+ * not UTC midnight, which would be the day before west of UTC. */
64
+ function toCellDate(value) {
65
+ if (value instanceof Date)
66
+ return value;
67
+ const s = String(value).trim();
68
+ const ymd = /^(\d{4})-(\d{2})-(\d{2})$/.exec(s);
69
+ return ymd ? new Date(Number(ymd[1]), Number(ymd[2]) - 1, Number(ymd[3])) : new Date(s);
53
70
  }
54
71
  // Static package parts that never change.
55
72
  const CONTENT_TYPES = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n` +
@@ -208,7 +225,7 @@ export function buildXlsxParts(model) {
208
225
  cellXml.push(`<c r="${ref}"${sAttr}><v>${Number(cell.value)}</v></c>`);
209
226
  }
210
227
  else if (cell.t === 'd') {
211
- const d = cell.value instanceof Date ? cell.value : new Date(String(cell.value));
228
+ const d = toCellDate(cell.value);
212
229
  cellXml.push(`<c r="${ref}"${sAttr}><v>${toSerialDate(d)}</v></c>`);
213
230
  }
214
231
  else if (cell.t === 'b') {
package/dist/import.js CHANGED
@@ -463,6 +463,12 @@ function buildRecords(matrix, columnMap, columnTypes, maxErrors) {
463
463
  * silently coerce to 0 / null - the consumer can drop the row in
464
464
  * their validator if blanks should be tolerated.
465
465
  */
466
+ /** Local wall-clock `YYYY-MM-DDTHH:mm:ss`, no zone: what the file said, unshifted. */
467
+ function localIso(d) {
468
+ const pad = (n) => String(n).padStart(2, '0');
469
+ return (`${String(d.getFullYear()).padStart(4, '0')}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}` +
470
+ `T${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`);
471
+ }
466
472
  function coerceTyped(raw, type) {
467
473
  const trimmed = raw.trim();
468
474
  // Empty cells map to `null` for most types and the empty string for
@@ -517,7 +523,9 @@ function coerceTyped(raw, type) {
517
523
  }
518
524
  const parsed = Date.parse(trimmed);
519
525
  if (!Number.isNaN(parsed)) {
520
- return { ok: true, value: new Date(parsed).toISOString().slice(0, 10) };
526
+ // Date.parse reads 'Jan 15 2024' as LOCAL midnight; slicing the UTC
527
+ // ISO string gave the 14th east of UTC.
528
+ return { ok: true, value: localIso(new Date(parsed)).slice(0, 10) };
521
529
  }
522
530
  return { ok: false, message: `not a date: ${trimmed}` };
523
531
  }
@@ -526,7 +534,8 @@ function coerceTyped(raw, type) {
526
534
  const parsed = Date.parse(trimmed);
527
535
  if (Number.isNaN(parsed))
528
536
  return { ok: false, message: `not a datetime: ${trimmed}` };
529
- return { ok: true, value: new Date(parsed).toISOString().slice(0, 19) };
537
+ // Zone-less out, so local in: a UTC slice shifted the time by the offset.
538
+ return { ok: true, value: localIso(new Date(parsed)) };
530
539
  }
531
540
  case 'json': {
532
541
  try {
package/dist/index.d.ts CHANGED
@@ -122,8 +122,8 @@ export { dismissUnlicensedNudge } from './watermark.js';
122
122
  export { showUpgradePrompt, dismissUpgradePrompt, type EnterpriseFeatureLabel, } from './upgrade-prompt.js';
123
123
  export { createPivotModel, pivotAggregators, filterCollapsedPivotRows, type PivotAggregator, type PivotAggregatorId, type PivotConfig, type PivotResult, type PivotRow, type PivotRowKind, type PivotValueConfig, } from './pivot.js';
124
124
  export { titleCase, resolveIdField, schemaToColumns, schemaToFormFields, isFieldHidden, validateField, applyComputed, validateEntity, type EntitySchema, type EntityField, type EntityFieldType, type EntityHooks, type FormFieldDescriptor, type FormLayout, type FormSection, type StudioEditorType, type StandardSchemaV1, type StandardSchemaResult, type ValidationOp, type ValidationRuleSpec, } from './schema.js';
125
- export { planQuery, coerce, createInMemoryDataSource, createKitDataSource, createKitHandlers, createSqlDataSource, planToSql, BUILTIN_AGGREGATORS, type QueryPlan, type PlanPredicate, type PlanOp, type PlanAggregate, type PlanOptions, type KitDataSourceOptions, type KitHandlerOptions, type KitScope, type KitHandlers, type KitMessage, type SqlDialect, type SqlPlan, type SqlExecutor, type SqlDataSourceConfig, type WritableDataSource, } from './sveltekit/index.js';
126
- export { createServerRowModel, serverRowModelRows, serverRowModelNav, serverGroupText, defaultServerGroupMessages, resolveServerGroupMessages, type ServerGroupMessages, GRAND_TOTAL_ROW_ID, GROUP_TOTAL_ROW_ID_PREFIX, type ServerRowModel, type ServerRowModelOptions, type ServerRowModelState, type ServerRowModelGridRow, type ServerRowModelDisplayRow, type ServerLevelParams, type ServerLevelState, type RefreshOptions, type ServerTransaction, type ServerTransactionResult, type ServerTransactionStatus, type ServerRowModelPaginationOptions, type ServerRowModelPagination, createServerSelectionModel, buildPivotResultColumns, type PivotResultColumnOptions, adaptCallbackDatasource, toCallbackDatasource, fromCallbackRequest, toCallbackRequest, fromCallbackFilterModel, toCallbackFilterModel, fromCallbackSelectionState, toCallbackSelectionState, isCallbackSelectionState, type CallbackSelectionState, type CallbackGroupSelectionState, type SelectionStateMapping, type CallbackServerRequest, type CallbackColumnFilter, type CallbackGetRowsParams, type CallbackDatasource, type ServerSelectionModel, type ServerSelectionModelOptions, type ServerSelectionState, type ServerGroupSelectionNode, type ServerSelectionGroupMode, createServerGroupModel, serverGroupRows, serverGroupNav, enableServerRowModel, SvGroupCell, SvRowGroupPanel, type ServerGroupController, type ServerGroupControllerOptions, type ServerGroupState, type ServerGroupGridRow, } from './server/index.js';
125
+ export { planQuery, coerce, createInMemoryDataSource, createKitDataSource, createKitHandlers, createSqlDataSource, planToSql, BUILTIN_AGGREGATORS, type QueryPlan, type PlanPredicate, type PlanOp, type PlanAggregate, type PlanOptions, type KitDataSourceOptions, type KitHandlerOptions, type KitScope, type KitHandlers, type KitMessage, type SqlDialect, type SqlPlan, type SqlExecutor, type SqlDataSourceConfig, type WritableDataSource, type InMemoryDataSourceOptions, } from './sveltekit/index.js';
126
+ export { createServerRowModel, serverRowModelRows, serverRowModelNav, serverGroupText, defaultServerGroupMessages, resolveServerGroupMessages, type ServerGroupMessages, GRAND_TOTAL_ROW_ID, GROUP_TOTAL_ROW_ID_PREFIX, type ServerRowModel, type ServerRowModelOptions, type ServerRowModelState, type ServerRowModelGridRow, type ServerRowModelDisplayRow, type ServerLevelParams, type ServerLevelState, type RefreshOptions, type ServerTransaction, type ServerTransactionResult, type ServerTransactionStatus, type ServerRowModelPaginationOptions, type ServerRowModelPagination, createServerSelectionModel, buildPivotResultColumns, type PivotResultColumnOptions, adaptCallbackDatasource, toCallbackDatasource, fromCallbackRequest, toCallbackRequest, fromCallbackFilterModel, toCallbackFilterModel, fromCallbackSelectionState, toCallbackSelectionState, isCallbackSelectionState, type CallbackSelectionState, type CallbackGroupSelectionState, type SelectionStateMapping, type CallbackServerRequest, type CallbackColumnFilter, type CallbackGetRowsParams, type CallbackDatasource, type ServerSelectionModel, type ServerSelectionModelOptions, type ServerSelectionState, type ServerGroupSelectionNode, type ServerSelectionGroupMode, createServerGroupModel, serverGroupRows, serverGroupNav, createWorkerDataSource, type WorkerDataSource, type WorkerDataSourceOptions, type WorkerLike, enableServerRowModel, SvGroupCell, SvRowGroupPanel, type ServerGroupController, type ServerGroupControllerOptions, type ServerGroupState, type ServerGroupGridRow, } from './server/index.js';
127
127
  export { createSupabaseDataSource, createRestDataSource, offsetLimitAdapter, dummyJsonAdapter, jsonServerAdapter, introspectSupabaseTable, listSupabaseTables, createSupabaseRealtime, createRelationLookup, createSupabaseAuth, aggregateRows, chartFieldsFromSchema, normalizeFilters, buildEntitySchema, pickLabelField, linkRelationLabels, type SupabaseDataSourceConfig, type SupabaseClientLike, type RestDataSourceConfig, type RestAdapter, type OffsetLimitOptions, type IntrospectSupabaseOptions, type IntrospectedColumn, type ColumnReference, type NormalizedFilter, type NormalizedPredicate, type SupabaseRealtimeConfig, type SupabaseRealtimeClientLike, type SupabaseRealtimeHandle, type RealtimeChannelLike, type RealtimeChange, type RelationLookup, type RelationLookupConfig, type RelationOption, type SupabaseAuthConfig, type SupabaseAuthController, type SupabaseAuthClientLike, type AuthState, type AuthUser, withEntityRules, withRelationLabels, reduceValue, kpiSeries, sparklinePoints, seriesDelta, formatKpiValue, dashboardFromSchema, type AggregateReduce, type AggregateRequest, type AggregateBucket, type AggregateSource, type DashboardSpec, type DashboardWidget, type KpiWidget, type ChartWidget, type RelationLabelConfig, } from './sources/index.js';
128
128
  export { buildInitialValues, controlKind, editMode, evalValidationRules, fieldState, sectionVisible, hasFieldConditions, rowId, stripHiddenValues, toSubmitValues, validateAll, visibleFormFields, type EditMode, type ControlKind, type FieldState, } from './edit-panel.js';
129
129
  export { default as SvGridEditPanel } from './SvGridEditPanel.svelte';
package/dist/index.js CHANGED
@@ -151,7 +151,7 @@ export { titleCase, resolveIdField, schemaToColumns, schemaToFormFields, isField
151
151
  export { planQuery, coerce, createInMemoryDataSource, createKitDataSource, createKitHandlers, createSqlDataSource, planToSql, BUILTIN_AGGREGATORS, } from './sveltekit/index.js';
152
152
  // Server-Side Row Model: lazy server-side grouping and tree data over the
153
153
  // free grid's datasource contract. Also available as '@svgrid/enterprise/server'.
154
- export { createServerRowModel, serverRowModelRows, serverRowModelNav, serverGroupText, defaultServerGroupMessages, resolveServerGroupMessages, GRAND_TOTAL_ROW_ID, GROUP_TOTAL_ROW_ID_PREFIX, createServerSelectionModel, buildPivotResultColumns, adaptCallbackDatasource, toCallbackDatasource, fromCallbackRequest, toCallbackRequest, fromCallbackFilterModel, toCallbackFilterModel, fromCallbackSelectionState, toCallbackSelectionState, isCallbackSelectionState, createServerGroupModel, serverGroupRows, serverGroupNav, enableServerRowModel, SvGroupCell, SvRowGroupPanel, } from './server/index.js';
154
+ export { createServerRowModel, serverRowModelRows, serverRowModelNav, serverGroupText, defaultServerGroupMessages, resolveServerGroupMessages, GRAND_TOTAL_ROW_ID, GROUP_TOTAL_ROW_ID_PREFIX, createServerSelectionModel, buildPivotResultColumns, adaptCallbackDatasource, toCallbackDatasource, fromCallbackRequest, toCallbackRequest, fromCallbackFilterModel, toCallbackFilterModel, fromCallbackSelectionState, toCallbackSelectionState, isCallbackSelectionState, createServerGroupModel, serverGroupRows, serverGroupNav, createWorkerDataSource, enableServerRowModel, SvGroupCell, SvRowGroupPanel, } from './server/index.js';
155
155
  export { createSupabaseDataSource, createRestDataSource, offsetLimitAdapter, dummyJsonAdapter, jsonServerAdapter, introspectSupabaseTable, listSupabaseTables, createSupabaseRealtime, createRelationLookup, createSupabaseAuth, aggregateRows, chartFieldsFromSchema, normalizeFilters, buildEntitySchema, pickLabelField, linkRelationLabels, withEntityRules, withRelationLabels, reduceValue, kpiSeries, sparklinePoints, seriesDelta, formatKpiValue, dashboardFromSchema, } from './sources/index.js';
156
156
  export { buildInitialValues, controlKind, editMode, evalValidationRules, fieldState, sectionVisible, hasFieldConditions, rowId, stripHiddenValues, toSubmitValues, validateAll, visibleFormFields, } from './edit-panel.js';
157
157
  export { default as SvGridEditPanel } from './SvGridEditPanel.svelte';