@toclocoinc/lattice-grid 1.80.0 → 1.81.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/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/angular/package.json +1 -1
- package/docs/API.html +4 -4
- package/docs/THEMING.md +6 -3
- package/docs/api/adapters.html +1 -1
- package/docs/api/ai.html +1 -1
- package/docs/api/alarms.html +1 -1
- package/docs/api/charts.html +1 -1
- package/docs/api/dashboard.html +1 -1
- package/docs/api/data-router.html +1 -1
- package/docs/api/deckgl.html +1 -1
- package/docs/api/gantt.html +1 -1
- package/docs/api/geometry.html +1 -1
- package/docs/api/grid.html +2 -2
- package/docs/api/index.html +1 -1
- package/docs/api/kanban.html +1 -1
- package/docs/api/kpi.html +1 -1
- package/docs/api/layout.html +1 -1
- package/docs/api/leaflet.html +1 -1
- package/docs/api/list.html +1 -1
- package/docs/api/mock-socket.html +1 -1
- package/docs/api/presets.html +1 -1
- package/docs/api/tabs.html +1 -1
- package/docs/api/types.html +1 -1
- package/docs/api-detail.html +4 -4
- package/docs/warnings.json +1 -1
- package/lattice-grid.d.ts +1 -1
- package/lattice-grid.esm.min.js +3 -3
- package/lattice-grid.min.cjs +3 -3
- package/lattice-grid.min.css +1 -1
- package/lattice-grid.min.js +3 -3
- package/modules/ai.d.ts +1 -1
- package/modules/ai.esm.min.js +2 -2
- package/modules/ai.min.cjs +2 -2
- package/modules/ai.min.js +2 -2
- package/modules/alarms.d.ts +1 -1
- package/modules/alarms.esm.min.js +2 -2
- package/modules/alarms.min.cjs +2 -2
- package/modules/alarms.min.js +2 -2
- package/modules/angular.d.ts +1 -1
- package/modules/angular.esm.min.js +2 -2
- package/modules/angular.min.cjs +2 -2
- package/modules/angular.min.js +2 -2
- package/modules/chart-alluvial.d.ts +1 -1
- package/modules/chart-alluvial.esm.min.js +1 -1
- package/modules/chart-alluvial.min.cjs +1 -1
- package/modules/chart-alluvial.min.js +1 -1
- package/modules/chart-arc.d.ts +1 -1
- package/modules/chart-arc.esm.min.js +1 -1
- package/modules/chart-arc.min.cjs +1 -1
- package/modules/chart-arc.min.js +1 -1
- package/modules/chart-bubblemap.d.ts +1 -1
- package/modules/chart-bubblemap.esm.min.js +1 -1
- package/modules/chart-bubblemap.min.cjs +1 -1
- package/modules/chart-bubblemap.min.js +1 -1
- package/modules/chart-bump.d.ts +1 -1
- package/modules/chart-bump.esm.min.js +1 -1
- package/modules/chart-bump.min.cjs +1 -1
- package/modules/chart-bump.min.js +1 -1
- package/modules/chart-calendar.d.ts +1 -1
- package/modules/chart-calendar.esm.min.js +1 -1
- package/modules/chart-calendar.min.cjs +1 -1
- package/modules/chart-calendar.min.js +1 -1
- package/modules/chart-choropleth.d.ts +1 -1
- package/modules/chart-choropleth.esm.min.js +1 -1
- package/modules/chart-choropleth.min.cjs +1 -1
- package/modules/chart-choropleth.min.js +1 -1
- package/modules/chart-decomposition.d.ts +1 -1
- package/modules/chart-decomposition.esm.min.js +1 -1
- package/modules/chart-decomposition.min.cjs +1 -1
- package/modules/chart-decomposition.min.js +1 -1
- package/modules/chart-diverging.d.ts +1 -1
- package/modules/chart-diverging.esm.min.js +1 -1
- package/modules/chart-diverging.min.cjs +1 -1
- package/modules/chart-diverging.min.js +1 -1
- package/modules/chart-dumbbell.d.ts +1 -1
- package/modules/chart-dumbbell.esm.min.js +1 -1
- package/modules/chart-dumbbell.min.cjs +1 -1
- package/modules/chart-dumbbell.min.js +1 -1
- package/modules/chart-fan.d.ts +1 -1
- package/modules/chart-fan.esm.min.js +1 -1
- package/modules/chart-fan.min.cjs +1 -1
- package/modules/chart-fan.min.js +1 -1
- package/modules/chart-hexbin.d.ts +1 -1
- package/modules/chart-hexbin.esm.min.js +1 -1
- package/modules/chart-hexbin.min.cjs +1 -1
- package/modules/chart-hexbin.min.js +1 -1
- package/modules/chart-hexmap.d.ts +1 -1
- package/modules/chart-hexmap.esm.min.js +1 -1
- package/modules/chart-hexmap.min.cjs +1 -1
- package/modules/chart-hexmap.min.js +1 -1
- package/modules/chart-icicle.d.ts +1 -1
- package/modules/chart-icicle.esm.min.js +1 -1
- package/modules/chart-icicle.min.cjs +1 -1
- package/modules/chart-icicle.min.js +1 -1
- package/modules/chart-markermap.d.ts +1 -1
- package/modules/chart-markermap.esm.min.js +1 -1
- package/modules/chart-markermap.min.cjs +1 -1
- package/modules/chart-markermap.min.js +1 -1
- package/modules/chart-parallel.d.ts +1 -1
- package/modules/chart-parallel.esm.min.js +1 -1
- package/modules/chart-parallel.min.cjs +1 -1
- package/modules/chart-parallel.min.js +1 -1
- package/modules/chart-ridgeline.d.ts +1 -1
- package/modules/chart-ridgeline.esm.min.js +1 -1
- package/modules/chart-ridgeline.min.cjs +1 -1
- package/modules/chart-ridgeline.min.js +1 -1
- package/modules/chart-roc.d.ts +1 -1
- package/modules/chart-roc.esm.min.js +1 -1
- package/modules/chart-roc.min.cjs +1 -1
- package/modules/chart-roc.min.js +1 -1
- package/modules/chart-slope.d.ts +1 -1
- package/modules/chart-slope.esm.min.js +1 -1
- package/modules/chart-slope.min.cjs +1 -1
- package/modules/chart-slope.min.js +1 -1
- package/modules/chart-splom.d.ts +1 -1
- package/modules/chart-splom.esm.min.js +1 -1
- package/modules/chart-splom.min.cjs +1 -1
- package/modules/chart-splom.min.js +1 -1
- package/modules/chart-waffle.d.ts +1 -1
- package/modules/chart-waffle.esm.min.js +1 -1
- package/modules/chart-waffle.min.cjs +1 -1
- package/modules/chart-waffle.min.js +1 -1
- package/modules/charts.d.ts +1 -1
- package/modules/charts.esm.min.js +2 -2
- package/modules/charts.min.cjs +2 -2
- package/modules/charts.min.js +2 -2
- package/modules/dashboard.d.ts +1 -1
- package/modules/dashboard.esm.min.js +2 -2
- package/modules/dashboard.min.cjs +2 -2
- package/modules/dashboard.min.js +2 -2
- package/modules/data-router.d.ts +1 -1
- package/modules/data-router.esm.min.js +2 -2
- package/modules/data-router.min.cjs +2 -2
- package/modules/data-router.min.js +2 -2
- package/modules/deckgl.d.ts +1 -1
- package/modules/deckgl.esm.min.js +2 -2
- package/modules/deckgl.min.cjs +2 -2
- package/modules/deckgl.min.js +2 -2
- package/modules/devtools.d.ts +1 -1
- package/modules/devtools.esm.min.js +1 -1
- package/modules/devtools.min.cjs +1 -1
- package/modules/devtools.min.js +1 -1
- package/modules/dhtmlx-compat.d.ts +1 -1
- package/modules/dhtmlx-compat.esm.min.js +2 -2
- package/modules/dhtmlx-compat.min.cjs +2 -2
- package/modules/dhtmlx-compat.min.js +2 -2
- package/modules/gantt.d.ts +1 -1
- package/modules/gantt.esm.min.js +2 -2
- package/modules/gantt.min.cjs +2 -2
- package/modules/gantt.min.js +2 -2
- package/modules/geo-europe-nuts.d.ts +1 -1
- package/modules/geo-europe-nuts.esm.min.js +1 -1
- package/modules/geo-europe-nuts.min.cjs +1 -1
- package/modules/geo-europe-nuts.min.js +1 -1
- package/modules/geo-uk.d.ts +1 -1
- package/modules/geo-uk.esm.min.js +1 -1
- package/modules/geo-uk.min.cjs +1 -1
- package/modules/geo-uk.min.js +1 -1
- package/modules/geo-us-states.d.ts +1 -1
- package/modules/geo-us-states.esm.min.js +1 -1
- package/modules/geo-us-states.min.cjs +1 -1
- package/modules/geo-us-states.min.js +1 -1
- package/modules/geo-world-110m.d.ts +1 -1
- package/modules/geo-world-110m.esm.min.js +1 -1
- package/modules/geo-world-110m.min.cjs +1 -1
- package/modules/geo-world-110m.min.js +1 -1
- package/modules/geo-world-50m.d.ts +1 -1
- package/modules/geo-world-50m.esm.min.js +1 -1
- package/modules/geo-world-50m.min.cjs +1 -1
- package/modules/geo-world-50m.min.js +1 -1
- package/modules/geometry.d.ts +1 -1
- package/modules/geometry.esm.min.js +2 -2
- package/modules/geometry.min.cjs +2 -2
- package/modules/geometry.min.js +2 -2
- package/modules/htmx.d.ts +1 -1
- package/modules/htmx.esm.min.js +3 -3
- package/modules/htmx.min.cjs +3 -3
- package/modules/htmx.min.js +3 -3
- package/modules/kanban.d.ts +1 -1
- package/modules/kanban.esm.min.js +2 -2
- package/modules/kanban.min.cjs +2 -2
- package/modules/kanban.min.js +2 -2
- package/modules/kpi.d.ts +1 -1
- package/modules/kpi.esm.min.js +2 -2
- package/modules/kpi.min.cjs +2 -2
- package/modules/kpi.min.js +2 -2
- package/modules/layout.d.ts +1 -1
- package/modules/layout.esm.min.js +2 -2
- package/modules/layout.min.cjs +2 -2
- package/modules/layout.min.js +2 -2
- package/modules/leaflet.d.ts +1 -1
- package/modules/leaflet.esm.min.js +2 -2
- package/modules/leaflet.min.cjs +2 -2
- package/modules/leaflet.min.js +2 -2
- package/modules/list.d.ts +1 -1
- package/modules/list.esm.min.js +2 -2
- package/modules/list.min.cjs +2 -2
- package/modules/list.min.js +2 -2
- package/modules/mock-socket.d.ts +1 -1
- package/modules/mock-socket.esm.min.js +1 -1
- package/modules/mock-socket.min.cjs +1 -1
- package/modules/mock-socket.min.js +1 -1
- package/modules/presets/antd5.css +23 -0
- package/modules/presets/bootstrap5.css +46 -5
- package/modules/presets/fluent2.css +31 -4
- package/modules/presets/material3.css +53 -5
- package/modules/presets.d.ts +1 -1
- package/modules/presets.esm.min.js +2 -2
- package/modules/presets.min.cjs +2 -2
- package/modules/presets.min.js +2 -2
- package/modules/react.d.ts +1 -1
- package/modules/react.esm.min.js +2 -2
- package/modules/react.min.cjs +2 -2
- package/modules/react.min.js +2 -2
- package/modules/svelte.d.ts +1 -1
- package/modules/svelte.esm.min.js +2 -2
- package/modules/svelte.min.cjs +2 -2
- package/modules/svelte.min.js +2 -2
- package/modules/tabs.d.ts +1 -1
- package/modules/tabs.esm.min.js +2 -2
- package/modules/tabs.min.cjs +2 -2
- package/modules/tabs.min.js +2 -2
- package/modules/vue.d.ts +1 -1
- package/modules/vue.esm.min.js +2 -2
- package/modules/vue.min.cjs +2 -2
- package/modules/vue.min.js +2 -2
- package/modules/webcomponent.d.ts +1 -1
- package/modules/webcomponent.esm.min.js +3 -3
- package/modules/webcomponent.min.cjs +3 -3
- package/modules/webcomponent.min.js +3 -3
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.
|
|
2
|
+
* Lattice Grid 1.81.0, charts module
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
6
|
-
var rr=Object.create(null),or=Object.create(null);function st(i,X){rr[i]=X}function sr(i){var X=or[i];if(X)return X;var ye=Object.create(null);or[i]=ye;var ne=rr[i];if(!ne)throw new Error("[lattice] missing module: "+i);return ne(ye,sr),ye}st("packages/modules/charts/svg.js",function(i,X){"use strict";Object.defineProperty(i,"SVG_NS",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(i,"el",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(i,"svg",{enumerable:!0,get:function(){return j}}),Object.defineProperty(i,"attr",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(i,"attrs",{enumerable:!0,get:function(){return de}}),Object.defineProperty(i,"setText",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(i,"clear",{enumerable:!0,get:function(){return J}}),Object.defineProperty(i,"append",{enumerable:!0,get:function(){return W}}),Object.defineProperty(i,"path",{enumerable:!0,get:function(){return se}}),Object.defineProperty(i,"ribbonPath",{enumerable:!0,get:function(){return M}}),Object.defineProperty(i,"round",{enumerable:!0,get:function(){return m}}),Object.defineProperty(i,"pathRings",{enumerable:!0,get:function(){return B}}),Object.defineProperty(i,"insideRings",{enumerable:!0,get:function(){return I}});const ye="http://www.w3.org/2000/svg";function ne(_,U,C){const N=_.createElement(U);return C&&N.setAttribute("class",C),N}function j(_,U,C){const N=_.createElementNS(ye,U);if(C)for(const d of Object.keys(C))N.setAttribute(d,String(C[d]));return N}function pe(_,U,C){_&&(C==null?_.removeAttribute(U):_.setAttribute(U,String(C)))}function de(_,U){if(_)for(const C of Object.keys(U))pe(_,C,U[C])}function ee(_,U){_&&(_.textContent=U==null?"":String(U))}function J(_){if(_)for(;_.firstChild;)_.removeChild(_.firstChild)}function W(_,U){for(const C of U)C&&_.appendChild(C);return _}function se(_){return _.join(" ")}function M(_){if(!_||_.length<2)return"";const U=["M",_[0].x,_[0].upper];for(let C=1;C<_.length;C++)U.push("L",_[C].x,_[C].upper);for(let C=_.length-1;C>=0;C--)U.push("L",_[C].x,_[C].lower);return U.push("Z"),se(U)}function m(_){return Math.round(_*100)/100}function B(_){const U=[];let C=[];const N=String(_||"").match(/[A-Za-z]|-?\d*\.?\d+(?:e[-+]?\d+)?/gi)||[];let d="",a=[];const u=()=>{if(!d||!a.length){a=[];return}if(d==="M"||d==="L")for(let w=0;w+1<a.length;w+=2)C.push([a[w],a[w+1]]);else d!=="Z"&&a.length>=2&&C.push([a[a.length-2],a[a.length-1]]);a=[]};for(const w of N){if(/[A-Za-z]/.test(w)){if(u(),w==="Z"||w==="z"){C.length>2&&U.push(C),C=[],d="";continue}w==="M"&&C.length>2&&(U.push(C),C=[]),d=w;continue}a.push(Number(w))}return u(),C.length>2&&U.push(C),U}function I(_,U,C){let N=!1;for(const d of _)for(let a=0,u=d.length-1;a<d.length;u=a++){const[w,L]=d[a],[D,F]=d[u];L>C!=F>C&&U<(D-w)*(C-L)/(F-L||1e-12)+w&&(N=!N)}return N}}),st("packages/modules/charts/typography.js",function(i,X){"use strict";Object.defineProperty(i,"BASE_SIZE",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(i,"BASE_FAMILY",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(i,"CHAR_RATIO",{enumerable:!0,get:function(){return j}}),Object.defineProperty(i,"resolveType",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(i,"textWidth",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(i,"widestLabel",{enumerable:!0,get:function(){return J}}),Object.defineProperty(i,"truncateTo",{enumerable:!0,get:function(){return W}}),Object.defineProperty(i,"applySize",{enumerable:!0,get:function(){return se}});const ye=12,ne="var(--lattice-font-family, system-ui, -apple-system, sans-serif)",j=.62;function pe(M){const m=M&&M.font,B=typeof m=="number"?{size:m}:m||{},I=de(B.size,ye);return{family:B.family||ne,size:I,small:de(B.small??B.tickSize,Math.max(9,I-1)),title:de(B.title,Math.round(I*1.15)),axisTitle:de(B.axisTitle,Math.max(10,I-1)),weight:B.weight||"inherit"}}function de(M,m){const B=Number(M);return Number.isFinite(B)&&B>0?B:m}function ee(M,m){return String(M??"").length*m*j}function J(M,m){let B=0;for(const I of M||[]){const _=ee(I,m);_>B&&(B=_)}return B}function W(M,m,B){const I=String(M??""),_=Math.floor(m/(B*j));return _<=0?"":I.length<=_?I:_===1?"…":`${I.slice(0,_-1)}…`}function se(M,m){!M||!Number.isFinite(m)||(M.style?M.style.fontSize=`${m}px`:M.setAttribute("style",`font-size:${m}px`))}}),st("packages/modules/charts/frame.js",function(i,X){"use strict";Object.defineProperty(i,"LABEL_GAP",{enumerable:!0,get:function(){return J}}),Object.defineProperty(i,"LABEL_GUTTER_SHARE",{enumerable:!0,get:function(){return W}}),Object.defineProperty(i,"resolveMargin",{enumerable:!0,get:function(){return se}}),Object.defineProperty(i,"plotRect",{enumerable:!0,get:function(){return M}}),Object.defineProperty(i,"shouldRotate",{enumerable:!0,get:function(){return m}}),Object.defineProperty(i,"Pool",{enumerable:!0,get:function(){return B}});const ne=X("packages/modules/charts/svg.js").SVG_NS,j=X("packages/modules/charts/typography.js"),pe=j.textWidth,de=j.widestLabel,ee=8,J=6,W=.4;function se(I,_){const U=typeof I=="number"?I:_,C=I&&typeof I=="object"?I:{},N=d=>Number.isFinite(d)&&d>=0?Number(d):U;return{base:U,top:N(C.top),right:N(C.right),bottom:N(C.bottom),left:N(C.left)}}function M(I){const _=se(I.margin,typeof I.padding=="number"?I.padding:8),U=_.base,C=I.fontSize||12,N=I.yLabels||[],d=I.xLabels||[],a=I.ySide==="right"?"right":"left",u=a==="right"?"left":"right",w=I.titles||{},L=I.titleSize||C,D=Z=>Z?L+J:0,F=de(N,C),Y=N.length?Math.min(I.width*W,_[a]+F+J):Math.max(ee,_[a]),re=_[u]+(I.rightGutter||0),te=(a==="left"?Y:re)+D(w.left),G=de(d.map(Z=>String(Z).slice(0,14)),C),me=(d.length?I.rotated?Math.min(I.height*W,J+G):C+J+_.bottom:Math.max(ee,_.bottom))+D(w.bottom),x=(a==="right"?Y:re)+D(w.right),Q=_.top+(I.topGutter||0),ae=Math.max(0,I.width-te-x),T=Math.max(0,I.height-Q-me);return{left:te,top:Q,width:ae,height:T,right:te+ae,bottom:Q+T,gutter:{left:te,bottom:me,right:x,top:Q}}}function m(I,_,U,C){if(!I.length||_<=0)return!1;const N=Number.isFinite(C)&&C>0?Number(C):1;return de(I,U)>_*N-4}class B{#r;#n=0;static#l="data-pool-key";constructor(_){this.#r=_}next(_,U,C){if(C!=null)return this.#e(_,U,String(C));const N=this.#r.childNodes[this.#n],d=N&&N.tagName;if(d&&String(d).toLowerCase()===_.toLowerCase())return U&&N.setAttribute("class",U),this.#n++,N;const a=this.#r.ownerDocument.createElementNS(ne,_);return U&&a.setAttribute("class",U),N?this.#r.insertBefore(a,N):this.#r.appendChild(a),this.#n++,a}#e(_,U,C){const N=_.toLowerCase();for(let u=this.#n;u<this.#r.childNodes.length;u++){const w=this.#r.childNodes[u],L=w&&w.tagName;if(L&&String(L).toLowerCase()===N&&w.getAttribute(B.#l)===C)return u!==this.#n&&this.#r.insertBefore(w,this.#r.childNodes[this.#n]),U&&w.setAttribute("class",U),this.#n++,w}const d=this.#r.ownerDocument.createElementNS(ne,_);d.setAttribute(B.#l,C),U&&d.setAttribute("class",U);const a=this.#r.childNodes[this.#n];return a?this.#r.insertBefore(d,a):this.#r.appendChild(d),this.#n++,d}finish(){for(;this.#r.childNodes.length>this.#n;)this.#r.removeChild(this.#r.lastChild);this.#n=0}}}),st("packages/core/src/internal/util.js",function(i,X){"use strict";Object.defineProperty(i,"VERSION",{enumerable:!0,get:function(){return j}}),Object.defineProperty(i,"reportedWarnings",{enumerable:!0,get:function(){return m}}),Object.defineProperty(i,"warnOnce",{enumerable:!0,get:function(){return I}}),Object.defineProperty(i,"infoOnce",{enumerable:!0,get:function(){return _}}),Object.defineProperty(i,"resetWarnings",{enumerable:!0,get:function(){return U}}),Object.defineProperty(i,"fail",{enumerable:!0,get:function(){return C}}),Object.defineProperty(i,"invariant",{enumerable:!0,get:function(){return N}}),Object.defineProperty(i,"DEV",{enumerable:!0,get:function(){return d}}),Object.defineProperty(i,"isObject",{enumerable:!0,get:function(){return a}}),Object.defineProperty(i,"isFunction",{enumerable:!0,get:function(){return u}}),Object.defineProperty(i,"isNil",{enumerable:!0,get:function(){return w}}),Object.defineProperty(i,"isBlank",{enumerable:!0,get:function(){return L}}),Object.defineProperty(i,"isCtor",{enumerable:!0,get:function(){return D}}),Object.defineProperty(i,"pathGetter",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(i,"pathSetter",{enumerable:!0,get:function(){return te}}),Object.defineProperty(i,"getPath",{enumerable:!0,get:function(){return G}}),Object.defineProperty(i,"setPath",{enumerable:!0,get:function(){return me}}),Object.defineProperty(i,"humanise",{enumerable:!0,get:function(){return x}}),Object.defineProperty(i,"escapeHtml",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(i,"titleCase",{enumerable:!0,get:function(){return T}}),Object.defineProperty(i,"expand",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(i,"toArray",{enumerable:!0,get:function(){return R}}),Object.defineProperty(i,"merge",{enumerable:!0,get:function(){return b}}),Object.defineProperty(i,"mergeRow",{enumerable:!0,get:function(){return h}}),Object.defineProperty(i,"Lru",{enumerable:!0,get:function(){return k}}),Object.defineProperty(i,"collator",{enumerable:!0,get:function(){return E}}),Object.defineProperty(i,"defaultCompare",{enumerable:!0,get:function(){return A}}),Object.defineProperty(i,"now",{enumerable:!0,get:function(){return y}}),Object.defineProperty(i,"nextFrame",{enumerable:!0,get:function(){return c}}),Object.defineProperty(i,"cancelFrame",{enumerable:!0,get:function(){return S}}),Object.defineProperty(i,"frameBatched",{enumerable:!0,get:function(){return f}}),Object.defineProperty(i,"settleDebounce",{enumerable:!0,get:function(){return e}}),Object.defineProperty(i,"whenIdle",{enumerable:!0,get:function(){return o}}),Object.defineProperty(i,"uid",{enumerable:!0,get:function(){return l}});const ye="1.80.0";async function ne(){return ye}const j="1.80.0",pe=new Set,de=2e3;function ee(n){if(pe.add(n),pe.size>de){const s=pe.values().next().value;s!==void 0&&pe.delete(s)}}const J=[],W=500;function se(n,s,v){J.push({key:n,level:s,message:v.map(p=>typeof p=="string"?p:M(p)).join(" "),at:Date.now()}),J.length>W&&J.shift()}function M(n){if(n instanceof Error)return n.message;try{return JSON.stringify(n)}catch{return String(n)}}function m(){return J.map(n=>({...n}))}function B(n){if(n.length===0||typeof n[0]!="string")return n;const s=n[0].replace(/^\[lattice\]\s*/,"");return s===n[0]?n:[s,...n.slice(1)]}function I(n,...s){if(pe.has(n))return;ee(n);const v=B(s);se(n,"warn",v),console.warn("[lattice]",...v)}function _(n,...s){if(pe.has(n))return;ee(n);const v=B(s);se(n,"info",v),console.info("[lattice]",...v)}function U(){pe.clear(),J.length=0}function C(n,s){const v=new Error(`[lattice] ${n}`);throw s!==void 0&&(v.cause=s),v}function N(n,s){n||C(s)}const d=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function a(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function u(n){return typeof n=="function"}function w(n){return n==null}function L(n){return n==null||n===""}function D(n){return typeof n!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(n))?!0:!!(n.prototype&&Object.getOwnPropertyNames(n.prototype).length>1)}const F=new Map;function Y(n){let s=F.get(n);if(s)return s;if(!n.includes("."))s=v=>v?.[n];else{const v=n.split("."),p=v.length;s=$=>{let q=$;for(let ie=0;ie<p;ie++){if(q==null)return;q=q[v[ie]]}return q}}return F.set(n,s),s}const re=new Map;function te(n){let s=re.get(n);if(s)return s;if(!n.includes("."))s=(v,p)=>{v!=null&&(v[n]=p)};else{const v=n.split("."),p=v.length-1;s=($,q)=>{let ie=$;for(let he=0;he<p;he++){if(ie==null)return;const ke=v[he];ie[ke]==null&&(ie[ke]={}),ie=ie[ke]}ie!=null&&(ie[v[p]]=q)}}return re.set(n,s),s}function G(n,s){return Y(s)(n)}function me(n,s,v){te(s)(n,v)}function x(n){return n?(n.includes(".")?n.slice(n.lastIndexOf(".")+1):n).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,v=>v.toUpperCase()):""}const Q={"&":"&","<":"<",">":">",'"':""","'":"'"};function ae(n){const s=n==null?"":String(n);return/[&<>"']/.test(s)?s.replace(/[&<>"']/g,v=>Q[v]):s}function T(n){return String(n).replace(/\w\S*/g,s=>s[0].toUpperCase()+s.slice(1).toLowerCase())}function Z(n,s,v){if(n!==void 0)return n===!0?{enabled:!0,...v}:n===!1?{enabled:!1}:a(n)?n:{[s]:n,enabled:!0}}function R(n){return n==null?[]:Array.isArray(n)?n:[n]}const g=Object.freeze(new Set(["__proto__","constructor","prototype"]));function b(n,s){if(!a(n))return a(s)?{...s}:s;if(!a(s))return s===void 0?n:s;const v={...n};for(const p of Object.keys(s)){if(g.has(p))continue;const $=s[p];$!==void 0&&(v[p]=a($)&&a(v[p])?b(v[p],$):$)}return v}function h(n,s){if(!a(n)||!a(s)||n===s)return s;const v=Object.create(Object.getPrototypeOf(n));return Object.assign(v,n,s),v}class k{#r;#n=new Map;#l;constructor(s=256,v=null){this.#r=s,this.#l=v}get size(){return this.#n.size}get max(){return this.#r}set max(s){this.#r=s,this.#e()}has(s){return this.#n.has(s)}get(s){const v=this.#n;if(!v.has(s))return;const p=v.get(s);return v.delete(s),v.set(s,p),p}peek(s){return this.#n.get(s)}set(s,v){const p=this.#n;return p.has(s)&&p.delete(s),p.set(s,v),this.#e(),v}delete(s){const v=this.#n.get(s);return this.#n.delete(s)&&this.#l&&this.#l(v,s),v}clear(){if(this.#l)for(const[s,v]of this.#n)this.#l(v,s);this.#n.clear()}keys(){return this.#n.keys()}values(){return this.#n.values()}#e(){const s=this.#n;for(;s.size>this.#r;){const v=s.keys().next().value,p=s.get(v);s.delete(v),this.#l&&this.#l(p,v)}}}const z=new Map;function E(n,s){const v=`${n||""}|${s?JSON.stringify(s):""}`;let p=z.get(v);return p||(p=new Intl.Collator(n||void 0,{numeric:!0,sensitivity:"variant",...s}),z.set(v,p)),p}function A(n,s){if(n===s)return 0;if(n==null)return 1;if(s==null)return-1;if(typeof n=="number"&&typeof s=="number")return Number.isNaN(n)?Number.isNaN(s)?0:1:Number.isNaN(s)||n<s?-1:n>s?1:0;const v=String(n),p=String(s);return v<p?-1:v>p?1:0}function y(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const r=typeof requestAnimationFrame=="function";function c(n){return r?requestAnimationFrame(n):setTimeout(()=>n(y()),16)}function S(n){n!=null&&(r?cancelAnimationFrame(n):clearTimeout(n))}function f(n){let s=null,v=null;const p=()=>{s=null;const q=v;v=null,n(...q||[])},$=(...q)=>{v=q,s===null&&(s=c(p))};return $.cancel=()=>{S(s),s=null,v=null},$.flush=()=>{s!==null&&(S(s),p())},$}function e(n,s){let v=null,p=null;const $=()=>{if(v=null,p===null)return;const he=p;p=null,n(...he),q()},q=()=>{v=setTimeout($,s),typeof v?.unref=="function"&&v.unref()},ie=(...he)=>{v===null?(n(...he),q()):(p=he,clearTimeout(v),q())};return ie.flush=()=>{if(v!==null&&clearTimeout(v),v=null,p===null)return;const he=p;p=null,n(...he)},ie.cancel=()=>{v!==null&&clearTimeout(v),v=null,p=null},ie.pending=()=>v!==null||p!==null,ie}function o(n,s=50){return typeof requestIdleCallback=="function"?requestIdleCallback(n,{timeout:s}):setTimeout(()=>n({timeRemaining:()=>0,didTimeout:!0}),1)}let t=0;function l(n="l"){return`${n}${(++t).toString(36)}`}}),st("packages/modules/charts/scheme.js",function(i,X){"use strict";Object.defineProperty(i,"PALETTE",{enumerable:!0,get:function(){return j}}),Object.defineProperty(i,"SCHEMES",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(i,"registerScheme",{enumerable:!0,get:function(){return J}}),Object.defineProperty(i,"setDefaultScheme",{enumerable:!0,get:function(){return W}}),Object.defineProperty(i,"schemeNames",{enumerable:!0,get:function(){return se}}),Object.defineProperty(i,"resolveScheme",{enumerable:!0,get:function(){return I}}),Object.defineProperty(i,"RAMP_SCALES",{enumerable:!0,get:function(){return _}}),Object.defineProperty(i,"toRgb",{enumerable:!0,get:function(){return N}}),Object.defineProperty(i,"rampStops",{enumerable:!0,get:function(){return d}});const ne=X("packages/core/src/internal/util.js").warnOnce,j=Object.freeze(["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#7a5195","#6b7d8c"]),pe=Object.freeze({default:{series:j,sequential:["#ecf3f9","#005280"],diverging:["#b04a00","#f7f7f7","#005280"],positive:"#009e73",negative:"#d55e00"},bright:{series:["#1f77d0","#ff7f0e","#2ca02c","#d62728","#9467bd","#17becf","#e377c2","#7f7f7f"],sequential:["#eef4fb","#1f77d0"],diverging:["#d62728","#f7f7f7","#1f77d0"],positive:"#2ca02c",negative:"#d62728"},earth:{series:["#5b7c6f","#c08b52","#7a6a53","#a4553f","#4e6a83","#8f8259","#6d5566","#8c9196"],sequential:["#f2efe9","#4e6a83"],diverging:["#a4553f","#f2efe9","#4e6a83"],positive:"#5b7c6f",negative:"#a4553f"},mono:{series:["#0b2a3d","#17475f","#2c6480","#4a82a0","#6da0bd","#94bcd6","#bcd7e9","#dfecf5"],sequential:["#eef3f7","#0b2a3d"],diverging:["#7a5c00","#f5f5f5","#0b2a3d"],positive:"#17475f",negative:"#7a5c00"}}),de=new Map;let ee="default";function J(a,u){!a||!u||de.set(String(a),u)}function W(a){if(typeof a=="string"){ee=a;return}a&&typeof a=="object"&&(de.set("__default__",a),ee="__default__")}function se(){return[...Object.keys(pe),...de.keys()].filter(a=>!a.startsWith("__"))}function M(a){return de.has(a)?de.get(a):pe[a]||null}const m=["series","sequential","diverging","positive","negative"];function B(a){return!a||typeof a!="object"||Array.isArray(a)?!1:!m.some(u=>u in a)}function I(a){const u=M(ee)||pe.default,w=a&&a.scheme,L=B(w)?w:null,D=typeof w=="string"?M(w):L?null:w||null,F=a&&Array.isArray(a.palette)&&a.palette.length?a.palette:null;L&&F&&ne("chart:scheme:array-and-map",'chart "scheme" was given as a name map together with a "palette" array; the two do not combine. Colours came from the map and the array was ignored. Pass one or the other.');const Y=L?null:F,re={...pe.default,...u,...D||{}};Y&&(re.series=Y);const te=a&&a.ramp&&typeof a.ramp=="object"&&!Array.isArray(a.ramp)?a.ramp:null,G=te?te.colours:a&&a.ramp,me=Array.isArray(G)&&G.length>=2?G:null;me&&(re.sequential=me);const x=te?U(te.scale):null,Q=!!(D||Y||L),ae=re.series&&re.series.length?re.series:j,T=new Map;let Z=0;return{...re,series:(g,b)=>{if(L&&b!==void 0&&b!==null){const h=String(b);return Object.prototype.hasOwnProperty.call(L,h)?L[h]:(T.has(h)||T.set(h,Z++),C(ae,T.get(h),!0))}return C(ae,g,Q)},explicit:Q,nameMap:!!L,rampScale:x}}const _=Object.freeze(["linear","log","quantile"]);function U(a){return a==null?null:_.includes(a)?a:(ne(`chart:ramp:scale:${String(a)}`,`chart "ramp.scale" was "${String(a)}", which is not a ramp scale; the chart chose one from its values instead. Use "linear", "log" or "quantile".`),null)}function C(a,u,w){const L=(u%a.length+a.length)%a.length;return w?a[L]:`var(--lattice-chart-${L+1}, ${a[L]})`}function N(a){if(typeof a!="string")return null;const u=a.trim(),w=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(u);if(w){const F=w[1];return F.length===3?[0,1,2].map(Y=>parseInt(F[Y]+F[Y],16)):[0,2,4].map(Y=>parseInt(F.slice(Y,Y+2),16))}const L=/^rgba?\(([^)]+)\)$/i.exec(u);if(!L)return null;const D=L[1].split(/[\s,/]+/).filter(Boolean).slice(0,3).map(Number);return D.length===3&&D.every(F=>Number.isFinite(F))?D:null}function d(a,u){const w=u?a.diverging:a.sequential,L=u?pe.default.diverging:pe.default.sequential,D=(Array.isArray(w)?w:L).map((F,Y)=>N(F)||N(L[Y])||[0,0,0]);return D.length>=2?D:L.map(F=>N(F))}}),st("packages/modules/charts/styles.js",function(i,X){"use strict";Object.defineProperty(i,"NS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(i,"seriesColour",{enumerable:!0,get:function(){return de}}),Object.defineProperty(i,"css",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(i,"injectStyles",{enumerable:!0,get:function(){return J}});const ne=X("packages/modules/charts/scheme.js").PALETTE,j="lat-chartview",pe="data-lattice-chartview";function de(W){const se=(W%ne.length+ne.length)%ne.length;return`var(--lattice-chart-${se+1}, ${ne[se]})`}function ee(){return`
|
|
6
|
+
var rr=Object.create(null),or=Object.create(null);function st(i,X){rr[i]=X}function sr(i){var X=or[i];if(X)return X;var ye=Object.create(null);or[i]=ye;var ne=rr[i];if(!ne)throw new Error("[lattice] missing module: "+i);return ne(ye,sr),ye}st("packages/modules/charts/svg.js",function(i,X){"use strict";Object.defineProperty(i,"SVG_NS",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(i,"el",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(i,"svg",{enumerable:!0,get:function(){return j}}),Object.defineProperty(i,"attr",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(i,"attrs",{enumerable:!0,get:function(){return de}}),Object.defineProperty(i,"setText",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(i,"clear",{enumerable:!0,get:function(){return J}}),Object.defineProperty(i,"append",{enumerable:!0,get:function(){return W}}),Object.defineProperty(i,"path",{enumerable:!0,get:function(){return se}}),Object.defineProperty(i,"ribbonPath",{enumerable:!0,get:function(){return M}}),Object.defineProperty(i,"round",{enumerable:!0,get:function(){return m}}),Object.defineProperty(i,"pathRings",{enumerable:!0,get:function(){return B}}),Object.defineProperty(i,"insideRings",{enumerable:!0,get:function(){return I}});const ye="http://www.w3.org/2000/svg";function ne(_,U,C){const N=_.createElement(U);return C&&N.setAttribute("class",C),N}function j(_,U,C){const N=_.createElementNS(ye,U);if(C)for(const d of Object.keys(C))N.setAttribute(d,String(C[d]));return N}function pe(_,U,C){_&&(C==null?_.removeAttribute(U):_.setAttribute(U,String(C)))}function de(_,U){if(_)for(const C of Object.keys(U))pe(_,C,U[C])}function ee(_,U){_&&(_.textContent=U==null?"":String(U))}function J(_){if(_)for(;_.firstChild;)_.removeChild(_.firstChild)}function W(_,U){for(const C of U)C&&_.appendChild(C);return _}function se(_){return _.join(" ")}function M(_){if(!_||_.length<2)return"";const U=["M",_[0].x,_[0].upper];for(let C=1;C<_.length;C++)U.push("L",_[C].x,_[C].upper);for(let C=_.length-1;C>=0;C--)U.push("L",_[C].x,_[C].lower);return U.push("Z"),se(U)}function m(_){return Math.round(_*100)/100}function B(_){const U=[];let C=[];const N=String(_||"").match(/[A-Za-z]|-?\d*\.?\d+(?:e[-+]?\d+)?/gi)||[];let d="",a=[];const u=()=>{if(!d||!a.length){a=[];return}if(d==="M"||d==="L")for(let w=0;w+1<a.length;w+=2)C.push([a[w],a[w+1]]);else d!=="Z"&&a.length>=2&&C.push([a[a.length-2],a[a.length-1]]);a=[]};for(const w of N){if(/[A-Za-z]/.test(w)){if(u(),w==="Z"||w==="z"){C.length>2&&U.push(C),C=[],d="";continue}w==="M"&&C.length>2&&(U.push(C),C=[]),d=w;continue}a.push(Number(w))}return u(),C.length>2&&U.push(C),U}function I(_,U,C){let N=!1;for(const d of _)for(let a=0,u=d.length-1;a<d.length;u=a++){const[w,L]=d[a],[D,F]=d[u];L>C!=F>C&&U<(D-w)*(C-L)/(F-L||1e-12)+w&&(N=!N)}return N}}),st("packages/modules/charts/typography.js",function(i,X){"use strict";Object.defineProperty(i,"BASE_SIZE",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(i,"BASE_FAMILY",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(i,"CHAR_RATIO",{enumerable:!0,get:function(){return j}}),Object.defineProperty(i,"resolveType",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(i,"textWidth",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(i,"widestLabel",{enumerable:!0,get:function(){return J}}),Object.defineProperty(i,"truncateTo",{enumerable:!0,get:function(){return W}}),Object.defineProperty(i,"applySize",{enumerable:!0,get:function(){return se}});const ye=12,ne="var(--lattice-font-family, system-ui, -apple-system, sans-serif)",j=.62;function pe(M){const m=M&&M.font,B=typeof m=="number"?{size:m}:m||{},I=de(B.size,ye);return{family:B.family||ne,size:I,small:de(B.small??B.tickSize,Math.max(9,I-1)),title:de(B.title,Math.round(I*1.15)),axisTitle:de(B.axisTitle,Math.max(10,I-1)),weight:B.weight||"inherit"}}function de(M,m){const B=Number(M);return Number.isFinite(B)&&B>0?B:m}function ee(M,m){return String(M??"").length*m*j}function J(M,m){let B=0;for(const I of M||[]){const _=ee(I,m);_>B&&(B=_)}return B}function W(M,m,B){const I=String(M??""),_=Math.floor(m/(B*j));return _<=0?"":I.length<=_?I:_===1?"…":`${I.slice(0,_-1)}…`}function se(M,m){!M||!Number.isFinite(m)||(M.style?M.style.fontSize=`${m}px`:M.setAttribute("style",`font-size:${m}px`))}}),st("packages/modules/charts/frame.js",function(i,X){"use strict";Object.defineProperty(i,"LABEL_GAP",{enumerable:!0,get:function(){return J}}),Object.defineProperty(i,"LABEL_GUTTER_SHARE",{enumerable:!0,get:function(){return W}}),Object.defineProperty(i,"resolveMargin",{enumerable:!0,get:function(){return se}}),Object.defineProperty(i,"plotRect",{enumerable:!0,get:function(){return M}}),Object.defineProperty(i,"shouldRotate",{enumerable:!0,get:function(){return m}}),Object.defineProperty(i,"Pool",{enumerable:!0,get:function(){return B}});const ne=X("packages/modules/charts/svg.js").SVG_NS,j=X("packages/modules/charts/typography.js"),pe=j.textWidth,de=j.widestLabel,ee=8,J=6,W=.4;function se(I,_){const U=typeof I=="number"?I:_,C=I&&typeof I=="object"?I:{},N=d=>Number.isFinite(d)&&d>=0?Number(d):U;return{base:U,top:N(C.top),right:N(C.right),bottom:N(C.bottom),left:N(C.left)}}function M(I){const _=se(I.margin,typeof I.padding=="number"?I.padding:8),U=_.base,C=I.fontSize||12,N=I.yLabels||[],d=I.xLabels||[],a=I.ySide==="right"?"right":"left",u=a==="right"?"left":"right",w=I.titles||{},L=I.titleSize||C,D=Z=>Z?L+J:0,F=de(N,C),Y=N.length?Math.min(I.width*W,_[a]+F+J):Math.max(ee,_[a]),re=_[u]+(I.rightGutter||0),te=(a==="left"?Y:re)+D(w.left),G=de(d.map(Z=>String(Z).slice(0,14)),C),me=(d.length?I.rotated?Math.min(I.height*W,J+G):C+J+_.bottom:Math.max(ee,_.bottom))+D(w.bottom),x=(a==="right"?Y:re)+D(w.right),Q=_.top+(I.topGutter||0),ae=Math.max(0,I.width-te-x),T=Math.max(0,I.height-Q-me);return{left:te,top:Q,width:ae,height:T,right:te+ae,bottom:Q+T,gutter:{left:te,bottom:me,right:x,top:Q}}}function m(I,_,U,C){if(!I.length||_<=0)return!1;const N=Number.isFinite(C)&&C>0?Number(C):1;return de(I,U)>_*N-4}class B{#r;#n=0;static#l="data-pool-key";constructor(_){this.#r=_}next(_,U,C){if(C!=null)return this.#e(_,U,String(C));const N=this.#r.childNodes[this.#n],d=N&&N.tagName;if(d&&String(d).toLowerCase()===_.toLowerCase())return U&&N.setAttribute("class",U),this.#n++,N;const a=this.#r.ownerDocument.createElementNS(ne,_);return U&&a.setAttribute("class",U),N?this.#r.insertBefore(a,N):this.#r.appendChild(a),this.#n++,a}#e(_,U,C){const N=_.toLowerCase();for(let u=this.#n;u<this.#r.childNodes.length;u++){const w=this.#r.childNodes[u],L=w&&w.tagName;if(L&&String(L).toLowerCase()===N&&w.getAttribute(B.#l)===C)return u!==this.#n&&this.#r.insertBefore(w,this.#r.childNodes[this.#n]),U&&w.setAttribute("class",U),this.#n++,w}const d=this.#r.ownerDocument.createElementNS(ne,_);d.setAttribute(B.#l,C),U&&d.setAttribute("class",U);const a=this.#r.childNodes[this.#n];return a?this.#r.insertBefore(d,a):this.#r.appendChild(d),this.#n++,d}finish(){for(;this.#r.childNodes.length>this.#n;)this.#r.removeChild(this.#r.lastChild);this.#n=0}}}),st("packages/core/src/internal/util.js",function(i,X){"use strict";Object.defineProperty(i,"VERSION",{enumerable:!0,get:function(){return j}}),Object.defineProperty(i,"reportedWarnings",{enumerable:!0,get:function(){return m}}),Object.defineProperty(i,"warnOnce",{enumerable:!0,get:function(){return I}}),Object.defineProperty(i,"infoOnce",{enumerable:!0,get:function(){return _}}),Object.defineProperty(i,"resetWarnings",{enumerable:!0,get:function(){return U}}),Object.defineProperty(i,"fail",{enumerable:!0,get:function(){return C}}),Object.defineProperty(i,"invariant",{enumerable:!0,get:function(){return N}}),Object.defineProperty(i,"DEV",{enumerable:!0,get:function(){return d}}),Object.defineProperty(i,"isObject",{enumerable:!0,get:function(){return a}}),Object.defineProperty(i,"isFunction",{enumerable:!0,get:function(){return u}}),Object.defineProperty(i,"isNil",{enumerable:!0,get:function(){return w}}),Object.defineProperty(i,"isBlank",{enumerable:!0,get:function(){return L}}),Object.defineProperty(i,"isCtor",{enumerable:!0,get:function(){return D}}),Object.defineProperty(i,"pathGetter",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(i,"pathSetter",{enumerable:!0,get:function(){return te}}),Object.defineProperty(i,"getPath",{enumerable:!0,get:function(){return G}}),Object.defineProperty(i,"setPath",{enumerable:!0,get:function(){return me}}),Object.defineProperty(i,"humanise",{enumerable:!0,get:function(){return x}}),Object.defineProperty(i,"escapeHtml",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(i,"titleCase",{enumerable:!0,get:function(){return T}}),Object.defineProperty(i,"expand",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(i,"toArray",{enumerable:!0,get:function(){return R}}),Object.defineProperty(i,"merge",{enumerable:!0,get:function(){return b}}),Object.defineProperty(i,"mergeRow",{enumerable:!0,get:function(){return h}}),Object.defineProperty(i,"Lru",{enumerable:!0,get:function(){return k}}),Object.defineProperty(i,"collator",{enumerable:!0,get:function(){return E}}),Object.defineProperty(i,"defaultCompare",{enumerable:!0,get:function(){return A}}),Object.defineProperty(i,"now",{enumerable:!0,get:function(){return y}}),Object.defineProperty(i,"nextFrame",{enumerable:!0,get:function(){return c}}),Object.defineProperty(i,"cancelFrame",{enumerable:!0,get:function(){return S}}),Object.defineProperty(i,"frameBatched",{enumerable:!0,get:function(){return f}}),Object.defineProperty(i,"settleDebounce",{enumerable:!0,get:function(){return e}}),Object.defineProperty(i,"whenIdle",{enumerable:!0,get:function(){return o}}),Object.defineProperty(i,"uid",{enumerable:!0,get:function(){return l}});const ye="1.81.0";async function ne(){return ye}const j="1.81.0",pe=new Set,de=2e3;function ee(n){if(pe.add(n),pe.size>de){const s=pe.values().next().value;s!==void 0&&pe.delete(s)}}const J=[],W=500;function se(n,s,v){J.push({key:n,level:s,message:v.map(p=>typeof p=="string"?p:M(p)).join(" "),at:Date.now()}),J.length>W&&J.shift()}function M(n){if(n instanceof Error)return n.message;try{return JSON.stringify(n)}catch{return String(n)}}function m(){return J.map(n=>({...n}))}function B(n){if(n.length===0||typeof n[0]!="string")return n;const s=n[0].replace(/^\[lattice\]\s*/,"");return s===n[0]?n:[s,...n.slice(1)]}function I(n,...s){if(pe.has(n))return;ee(n);const v=B(s);se(n,"warn",v),console.warn("[lattice]",...v)}function _(n,...s){if(pe.has(n))return;ee(n);const v=B(s);se(n,"info",v),console.info("[lattice]",...v)}function U(){pe.clear(),J.length=0}function C(n,s){const v=new Error(`[lattice] ${n}`);throw s!==void 0&&(v.cause=s),v}function N(n,s){n||C(s)}const d=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function a(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function u(n){return typeof n=="function"}function w(n){return n==null}function L(n){return n==null||n===""}function D(n){return typeof n!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(n))?!0:!!(n.prototype&&Object.getOwnPropertyNames(n.prototype).length>1)}const F=new Map;function Y(n){let s=F.get(n);if(s)return s;if(!n.includes("."))s=v=>v?.[n];else{const v=n.split("."),p=v.length;s=$=>{let q=$;for(let ie=0;ie<p;ie++){if(q==null)return;q=q[v[ie]]}return q}}return F.set(n,s),s}const re=new Map;function te(n){let s=re.get(n);if(s)return s;if(!n.includes("."))s=(v,p)=>{v!=null&&(v[n]=p)};else{const v=n.split("."),p=v.length-1;s=($,q)=>{let ie=$;for(let he=0;he<p;he++){if(ie==null)return;const ke=v[he];ie[ke]==null&&(ie[ke]={}),ie=ie[ke]}ie!=null&&(ie[v[p]]=q)}}return re.set(n,s),s}function G(n,s){return Y(s)(n)}function me(n,s,v){te(s)(n,v)}function x(n){return n?(n.includes(".")?n.slice(n.lastIndexOf(".")+1):n).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,v=>v.toUpperCase()):""}const Q={"&":"&","<":"<",">":">",'"':""","'":"'"};function ae(n){const s=n==null?"":String(n);return/[&<>"']/.test(s)?s.replace(/[&<>"']/g,v=>Q[v]):s}function T(n){return String(n).replace(/\w\S*/g,s=>s[0].toUpperCase()+s.slice(1).toLowerCase())}function Z(n,s,v){if(n!==void 0)return n===!0?{enabled:!0,...v}:n===!1?{enabled:!1}:a(n)?n:{[s]:n,enabled:!0}}function R(n){return n==null?[]:Array.isArray(n)?n:[n]}const g=Object.freeze(new Set(["__proto__","constructor","prototype"]));function b(n,s){if(!a(n))return a(s)?{...s}:s;if(!a(s))return s===void 0?n:s;const v={...n};for(const p of Object.keys(s)){if(g.has(p))continue;const $=s[p];$!==void 0&&(v[p]=a($)&&a(v[p])?b(v[p],$):$)}return v}function h(n,s){if(!a(n)||!a(s)||n===s)return s;const v=Object.create(Object.getPrototypeOf(n));return Object.assign(v,n,s),v}class k{#r;#n=new Map;#l;constructor(s=256,v=null){this.#r=s,this.#l=v}get size(){return this.#n.size}get max(){return this.#r}set max(s){this.#r=s,this.#e()}has(s){return this.#n.has(s)}get(s){const v=this.#n;if(!v.has(s))return;const p=v.get(s);return v.delete(s),v.set(s,p),p}peek(s){return this.#n.get(s)}set(s,v){const p=this.#n;return p.has(s)&&p.delete(s),p.set(s,v),this.#e(),v}delete(s){const v=this.#n.get(s);return this.#n.delete(s)&&this.#l&&this.#l(v,s),v}clear(){if(this.#l)for(const[s,v]of this.#n)this.#l(v,s);this.#n.clear()}keys(){return this.#n.keys()}values(){return this.#n.values()}#e(){const s=this.#n;for(;s.size>this.#r;){const v=s.keys().next().value,p=s.get(v);s.delete(v),this.#l&&this.#l(p,v)}}}const z=new Map;function E(n,s){const v=`${n||""}|${s?JSON.stringify(s):""}`;let p=z.get(v);return p||(p=new Intl.Collator(n||void 0,{numeric:!0,sensitivity:"variant",...s}),z.set(v,p)),p}function A(n,s){if(n===s)return 0;if(n==null)return 1;if(s==null)return-1;if(typeof n=="number"&&typeof s=="number")return Number.isNaN(n)?Number.isNaN(s)?0:1:Number.isNaN(s)||n<s?-1:n>s?1:0;const v=String(n),p=String(s);return v<p?-1:v>p?1:0}function y(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const r=typeof requestAnimationFrame=="function";function c(n){return r?requestAnimationFrame(n):setTimeout(()=>n(y()),16)}function S(n){n!=null&&(r?cancelAnimationFrame(n):clearTimeout(n))}function f(n){let s=null,v=null;const p=()=>{s=null;const q=v;v=null,n(...q||[])},$=(...q)=>{v=q,s===null&&(s=c(p))};return $.cancel=()=>{S(s),s=null,v=null},$.flush=()=>{s!==null&&(S(s),p())},$}function e(n,s){let v=null,p=null;const $=()=>{if(v=null,p===null)return;const he=p;p=null,n(...he),q()},q=()=>{v=setTimeout($,s),typeof v?.unref=="function"&&v.unref()},ie=(...he)=>{v===null?(n(...he),q()):(p=he,clearTimeout(v),q())};return ie.flush=()=>{if(v!==null&&clearTimeout(v),v=null,p===null)return;const he=p;p=null,n(...he)},ie.cancel=()=>{v!==null&&clearTimeout(v),v=null,p=null},ie.pending=()=>v!==null||p!==null,ie}function o(n,s=50){return typeof requestIdleCallback=="function"?requestIdleCallback(n,{timeout:s}):setTimeout(()=>n({timeRemaining:()=>0,didTimeout:!0}),1)}let t=0;function l(n="l"){return`${n}${(++t).toString(36)}`}}),st("packages/modules/charts/scheme.js",function(i,X){"use strict";Object.defineProperty(i,"PALETTE",{enumerable:!0,get:function(){return j}}),Object.defineProperty(i,"SCHEMES",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(i,"registerScheme",{enumerable:!0,get:function(){return J}}),Object.defineProperty(i,"setDefaultScheme",{enumerable:!0,get:function(){return W}}),Object.defineProperty(i,"schemeNames",{enumerable:!0,get:function(){return se}}),Object.defineProperty(i,"resolveScheme",{enumerable:!0,get:function(){return I}}),Object.defineProperty(i,"RAMP_SCALES",{enumerable:!0,get:function(){return _}}),Object.defineProperty(i,"toRgb",{enumerable:!0,get:function(){return N}}),Object.defineProperty(i,"rampStops",{enumerable:!0,get:function(){return d}});const ne=X("packages/core/src/internal/util.js").warnOnce,j=Object.freeze(["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#7a5195","#6b7d8c"]),pe=Object.freeze({default:{series:j,sequential:["#ecf3f9","#005280"],diverging:["#b04a00","#f7f7f7","#005280"],positive:"#009e73",negative:"#d55e00"},bright:{series:["#1f77d0","#ff7f0e","#2ca02c","#d62728","#9467bd","#17becf","#e377c2","#7f7f7f"],sequential:["#eef4fb","#1f77d0"],diverging:["#d62728","#f7f7f7","#1f77d0"],positive:"#2ca02c",negative:"#d62728"},earth:{series:["#5b7c6f","#c08b52","#7a6a53","#a4553f","#4e6a83","#8f8259","#6d5566","#8c9196"],sequential:["#f2efe9","#4e6a83"],diverging:["#a4553f","#f2efe9","#4e6a83"],positive:"#5b7c6f",negative:"#a4553f"},mono:{series:["#0b2a3d","#17475f","#2c6480","#4a82a0","#6da0bd","#94bcd6","#bcd7e9","#dfecf5"],sequential:["#eef3f7","#0b2a3d"],diverging:["#7a5c00","#f5f5f5","#0b2a3d"],positive:"#17475f",negative:"#7a5c00"}}),de=new Map;let ee="default";function J(a,u){!a||!u||de.set(String(a),u)}function W(a){if(typeof a=="string"){ee=a;return}a&&typeof a=="object"&&(de.set("__default__",a),ee="__default__")}function se(){return[...Object.keys(pe),...de.keys()].filter(a=>!a.startsWith("__"))}function M(a){return de.has(a)?de.get(a):pe[a]||null}const m=["series","sequential","diverging","positive","negative"];function B(a){return!a||typeof a!="object"||Array.isArray(a)?!1:!m.some(u=>u in a)}function I(a){const u=M(ee)||pe.default,w=a&&a.scheme,L=B(w)?w:null,D=typeof w=="string"?M(w):L?null:w||null,F=a&&Array.isArray(a.palette)&&a.palette.length?a.palette:null;L&&F&&ne("chart:scheme:array-and-map",'chart "scheme" was given as a name map together with a "palette" array; the two do not combine. Colours came from the map and the array was ignored. Pass one or the other.');const Y=L?null:F,re={...pe.default,...u,...D||{}};Y&&(re.series=Y);const te=a&&a.ramp&&typeof a.ramp=="object"&&!Array.isArray(a.ramp)?a.ramp:null,G=te?te.colours:a&&a.ramp,me=Array.isArray(G)&&G.length>=2?G:null;me&&(re.sequential=me);const x=te?U(te.scale):null,Q=!!(D||Y||L),ae=re.series&&re.series.length?re.series:j,T=new Map;let Z=0;return{...re,series:(g,b)=>{if(L&&b!==void 0&&b!==null){const h=String(b);return Object.prototype.hasOwnProperty.call(L,h)?L[h]:(T.has(h)||T.set(h,Z++),C(ae,T.get(h),!0))}return C(ae,g,Q)},explicit:Q,nameMap:!!L,rampScale:x}}const _=Object.freeze(["linear","log","quantile"]);function U(a){return a==null?null:_.includes(a)?a:(ne(`chart:ramp:scale:${String(a)}`,`chart "ramp.scale" was "${String(a)}", which is not a ramp scale; the chart chose one from its values instead. Use "linear", "log" or "quantile".`),null)}function C(a,u,w){const L=(u%a.length+a.length)%a.length;return w?a[L]:`var(--lattice-chart-${L+1}, ${a[L]})`}function N(a){if(typeof a!="string")return null;const u=a.trim(),w=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(u);if(w){const F=w[1];return F.length===3?[0,1,2].map(Y=>parseInt(F[Y]+F[Y],16)):[0,2,4].map(Y=>parseInt(F.slice(Y,Y+2),16))}const L=/^rgba?\(([^)]+)\)$/i.exec(u);if(!L)return null;const D=L[1].split(/[\s,/]+/).filter(Boolean).slice(0,3).map(Number);return D.length===3&&D.every(F=>Number.isFinite(F))?D:null}function d(a,u){const w=u?a.diverging:a.sequential,L=u?pe.default.diverging:pe.default.sequential,D=(Array.isArray(w)?w:L).map((F,Y)=>N(F)||N(L[Y])||[0,0,0]);return D.length>=2?D:L.map(F=>N(F))}}),st("packages/modules/charts/styles.js",function(i,X){"use strict";Object.defineProperty(i,"NS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(i,"seriesColour",{enumerable:!0,get:function(){return de}}),Object.defineProperty(i,"css",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(i,"injectStyles",{enumerable:!0,get:function(){return J}});const ne=X("packages/modules/charts/scheme.js").PALETTE,j="lat-chartview",pe="data-lattice-chartview";function de(W){const se=(W%ne.length+ne.length)%ne.length;return`var(--lattice-chart-${se+1}, ${ne[se]})`}function ee(){return`
|
|
7
7
|
.${j}{position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;
|
|
8
8
|
width:100%;height:100%;box-sizing:border-box;
|
|
9
9
|
font-family:var(--lattice-font-family,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif);
|
package/modules/charts.min.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.
|
|
2
|
+
* Lattice Grid 1.81.0, charts module
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
6
|
-
(function(Dn){"use strict";var Bn=Object.create(null),Gn=Object.create(null);function it(s,X){Bn[s]=X}function Un(s){var X=Gn[s];if(X)return X;var ye=Object.create(null);Gn[s]=ye;var ne=Bn[s];if(!ne)throw new Error("[lattice] missing module: "+s);return ne(ye,Un),ye}it("packages/modules/charts/svg.js",function(s,X){"use strict";Object.defineProperty(s,"SVG_NS",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(s,"el",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(s,"svg",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"attr",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(s,"attrs",{enumerable:!0,get:function(){return de}}),Object.defineProperty(s,"setText",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(s,"clear",{enumerable:!0,get:function(){return J}}),Object.defineProperty(s,"append",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"path",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"ribbonPath",{enumerable:!0,get:function(){return M}}),Object.defineProperty(s,"round",{enumerable:!0,get:function(){return m}}),Object.defineProperty(s,"pathRings",{enumerable:!0,get:function(){return B}}),Object.defineProperty(s,"insideRings",{enumerable:!0,get:function(){return I}});const ye="http://www.w3.org/2000/svg";function ne(_,U,C){const N=_.createElement(U);return C&&N.setAttribute("class",C),N}function j(_,U,C){const N=_.createElementNS(ye,U);if(C)for(const d of Object.keys(C))N.setAttribute(d,String(C[d]));return N}function pe(_,U,C){_&&(C==null?_.removeAttribute(U):_.setAttribute(U,String(C)))}function de(_,U){if(_)for(const C of Object.keys(U))pe(_,C,U[C])}function ee(_,U){_&&(_.textContent=U==null?"":String(U))}function J(_){if(_)for(;_.firstChild;)_.removeChild(_.firstChild)}function W(_,U){for(const C of U)C&&_.appendChild(C);return _}function ie(_){return _.join(" ")}function M(_){if(!_||_.length<2)return"";const U=["M",_[0].x,_[0].upper];for(let C=1;C<_.length;C++)U.push("L",_[C].x,_[C].upper);for(let C=_.length-1;C>=0;C--)U.push("L",_[C].x,_[C].lower);return U.push("Z"),ie(U)}function m(_){return Math.round(_*100)/100}function B(_){const U=[];let C=[];const N=String(_||"").match(/[A-Za-z]|-?\d*\.?\d+(?:e[-+]?\d+)?/gi)||[];let d="",a=[];const u=()=>{if(!d||!a.length){a=[];return}if(d==="M"||d==="L")for(let w=0;w+1<a.length;w+=2)C.push([a[w],a[w+1]]);else d!=="Z"&&a.length>=2&&C.push([a[a.length-2],a[a.length-1]]);a=[]};for(const w of N){if(/[A-Za-z]/.test(w)){if(u(),w==="Z"||w==="z"){C.length>2&&U.push(C),C=[],d="";continue}w==="M"&&C.length>2&&(U.push(C),C=[]),d=w;continue}a.push(Number(w))}return u(),C.length>2&&U.push(C),U}function I(_,U,C){let N=!1;for(const d of _)for(let a=0,u=d.length-1;a<d.length;u=a++){const[w,L]=d[a],[D,F]=d[u];L>C!=F>C&&U<(D-w)*(C-L)/(F-L||1e-12)+w&&(N=!N)}return N}}),it("packages/modules/charts/typography.js",function(s,X){"use strict";Object.defineProperty(s,"BASE_SIZE",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(s,"BASE_FAMILY",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(s,"CHAR_RATIO",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"resolveType",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(s,"textWidth",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(s,"widestLabel",{enumerable:!0,get:function(){return J}}),Object.defineProperty(s,"truncateTo",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"applySize",{enumerable:!0,get:function(){return ie}});const ye=12,ne="var(--lattice-font-family, system-ui, -apple-system, sans-serif)",j=.62;function pe(M){const m=M&&M.font,B=typeof m=="number"?{size:m}:m||{},I=de(B.size,ye);return{family:B.family||ne,size:I,small:de(B.small??B.tickSize,Math.max(9,I-1)),title:de(B.title,Math.round(I*1.15)),axisTitle:de(B.axisTitle,Math.max(10,I-1)),weight:B.weight||"inherit"}}function de(M,m){const B=Number(M);return Number.isFinite(B)&&B>0?B:m}function ee(M,m){return String(M??"").length*m*j}function J(M,m){let B=0;for(const I of M||[]){const _=ee(I,m);_>B&&(B=_)}return B}function W(M,m,B){const I=String(M??""),_=Math.floor(m/(B*j));return _<=0?"":I.length<=_?I:_===1?"…":`${I.slice(0,_-1)}…`}function ie(M,m){!M||!Number.isFinite(m)||(M.style?M.style.fontSize=`${m}px`:M.setAttribute("style",`font-size:${m}px`))}}),it("packages/modules/charts/frame.js",function(s,X){"use strict";Object.defineProperty(s,"LABEL_GAP",{enumerable:!0,get:function(){return J}}),Object.defineProperty(s,"LABEL_GUTTER_SHARE",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"resolveMargin",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"plotRect",{enumerable:!0,get:function(){return M}}),Object.defineProperty(s,"shouldRotate",{enumerable:!0,get:function(){return m}}),Object.defineProperty(s,"Pool",{enumerable:!0,get:function(){return B}});const ne=X("packages/modules/charts/svg.js").SVG_NS,j=X("packages/modules/charts/typography.js"),pe=j.textWidth,de=j.widestLabel,ee=8,J=6,W=.4;function ie(I,_){const U=typeof I=="number"?I:_,C=I&&typeof I=="object"?I:{},N=d=>Number.isFinite(d)&&d>=0?Number(d):U;return{base:U,top:N(C.top),right:N(C.right),bottom:N(C.bottom),left:N(C.left)}}function M(I){const _=ie(I.margin,typeof I.padding=="number"?I.padding:8),U=_.base,C=I.fontSize||12,N=I.yLabels||[],d=I.xLabels||[],a=I.ySide==="right"?"right":"left",u=a==="right"?"left":"right",w=I.titles||{},L=I.titleSize||C,D=Y=>Y?L+J:0,F=de(N,C),Z=N.length?Math.min(I.width*W,_[a]+F+J):Math.max(ee,_[a]),re=_[u]+(I.rightGutter||0),te=(a==="left"?Z:re)+D(w.left),G=de(d.map(Y=>String(Y).slice(0,14)),C),me=(d.length?I.rotated?Math.min(I.height*W,J+G):C+J+_.bottom:Math.max(ee,_.bottom))+D(w.bottom),x=(a==="right"?Z:re)+D(w.right),Q=_.top+(I.topGutter||0),ae=Math.max(0,I.width-te-x),T=Math.max(0,I.height-Q-me);return{left:te,top:Q,width:ae,height:T,right:te+ae,bottom:Q+T,gutter:{left:te,bottom:me,right:x,top:Q}}}function m(I,_,U,C){if(!I.length||_<=0)return!1;const N=Number.isFinite(C)&&C>0?Number(C):1;return de(I,U)>_*N-4}class B{#r;#n=0;static#l="data-pool-key";constructor(_){this.#r=_}next(_,U,C){if(C!=null)return this.#e(_,U,String(C));const N=this.#r.childNodes[this.#n],d=N&&N.tagName;if(d&&String(d).toLowerCase()===_.toLowerCase())return U&&N.setAttribute("class",U),this.#n++,N;const a=this.#r.ownerDocument.createElementNS(ne,_);return U&&a.setAttribute("class",U),N?this.#r.insertBefore(a,N):this.#r.appendChild(a),this.#n++,a}#e(_,U,C){const N=_.toLowerCase();for(let u=this.#n;u<this.#r.childNodes.length;u++){const w=this.#r.childNodes[u],L=w&&w.tagName;if(L&&String(L).toLowerCase()===N&&w.getAttribute(B.#l)===C)return u!==this.#n&&this.#r.insertBefore(w,this.#r.childNodes[this.#n]),U&&w.setAttribute("class",U),this.#n++,w}const d=this.#r.ownerDocument.createElementNS(ne,_);d.setAttribute(B.#l,C),U&&d.setAttribute("class",U);const a=this.#r.childNodes[this.#n];return a?this.#r.insertBefore(d,a):this.#r.appendChild(d),this.#n++,d}finish(){for(;this.#r.childNodes.length>this.#n;)this.#r.removeChild(this.#r.lastChild);this.#n=0}}}),it("packages/core/src/internal/util.js",function(s,X){"use strict";Object.defineProperty(s,"VERSION",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"reportedWarnings",{enumerable:!0,get:function(){return m}}),Object.defineProperty(s,"warnOnce",{enumerable:!0,get:function(){return I}}),Object.defineProperty(s,"infoOnce",{enumerable:!0,get:function(){return _}}),Object.defineProperty(s,"resetWarnings",{enumerable:!0,get:function(){return U}}),Object.defineProperty(s,"fail",{enumerable:!0,get:function(){return C}}),Object.defineProperty(s,"invariant",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"DEV",{enumerable:!0,get:function(){return d}}),Object.defineProperty(s,"isObject",{enumerable:!0,get:function(){return a}}),Object.defineProperty(s,"isFunction",{enumerable:!0,get:function(){return u}}),Object.defineProperty(s,"isNil",{enumerable:!0,get:function(){return w}}),Object.defineProperty(s,"isBlank",{enumerable:!0,get:function(){return L}}),Object.defineProperty(s,"isCtor",{enumerable:!0,get:function(){return D}}),Object.defineProperty(s,"pathGetter",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(s,"pathSetter",{enumerable:!0,get:function(){return te}}),Object.defineProperty(s,"getPath",{enumerable:!0,get:function(){return G}}),Object.defineProperty(s,"setPath",{enumerable:!0,get:function(){return me}}),Object.defineProperty(s,"humanise",{enumerable:!0,get:function(){return x}}),Object.defineProperty(s,"escapeHtml",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(s,"titleCase",{enumerable:!0,get:function(){return T}}),Object.defineProperty(s,"expand",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(s,"toArray",{enumerable:!0,get:function(){return R}}),Object.defineProperty(s,"merge",{enumerable:!0,get:function(){return b}}),Object.defineProperty(s,"mergeRow",{enumerable:!0,get:function(){return h}}),Object.defineProperty(s,"Lru",{enumerable:!0,get:function(){return k}}),Object.defineProperty(s,"collator",{enumerable:!0,get:function(){return E}}),Object.defineProperty(s,"defaultCompare",{enumerable:!0,get:function(){return A}}),Object.defineProperty(s,"now",{enumerable:!0,get:function(){return y}}),Object.defineProperty(s,"nextFrame",{enumerable:!0,get:function(){return c}}),Object.defineProperty(s,"cancelFrame",{enumerable:!0,get:function(){return S}}),Object.defineProperty(s,"frameBatched",{enumerable:!0,get:function(){return f}}),Object.defineProperty(s,"settleDebounce",{enumerable:!0,get:function(){return e}}),Object.defineProperty(s,"whenIdle",{enumerable:!0,get:function(){return o}}),Object.defineProperty(s,"uid",{enumerable:!0,get:function(){return l}});const ye="1.80.0";async function ne(){return ye}const j="1.80.0",pe=new Set,de=2e3;function ee(n){if(pe.add(n),pe.size>de){const i=pe.values().next().value;i!==void 0&&pe.delete(i)}}const J=[],W=500;function ie(n,i,v){J.push({key:n,level:i,message:v.map(p=>typeof p=="string"?p:M(p)).join(" "),at:Date.now()}),J.length>W&&J.shift()}function M(n){if(n instanceof Error)return n.message;try{return JSON.stringify(n)}catch{return String(n)}}function m(){return J.map(n=>({...n}))}function B(n){if(n.length===0||typeof n[0]!="string")return n;const i=n[0].replace(/^\[lattice\]\s*/,"");return i===n[0]?n:[i,...n.slice(1)]}function I(n,...i){if(pe.has(n))return;ee(n);const v=B(i);ie(n,"warn",v),console.warn("[lattice]",...v)}function _(n,...i){if(pe.has(n))return;ee(n);const v=B(i);ie(n,"info",v),console.info("[lattice]",...v)}function U(){pe.clear(),J.length=0}function C(n,i){const v=new Error(`[lattice] ${n}`);throw i!==void 0&&(v.cause=i),v}function N(n,i){n||C(i)}const d=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function a(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function u(n){return typeof n=="function"}function w(n){return n==null}function L(n){return n==null||n===""}function D(n){return typeof n!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(n))?!0:!!(n.prototype&&Object.getOwnPropertyNames(n.prototype).length>1)}const F=new Map;function Z(n){let i=F.get(n);if(i)return i;if(!n.includes("."))i=v=>v?.[n];else{const v=n.split("."),p=v.length;i=$=>{let q=$;for(let se=0;se<p;se++){if(q==null)return;q=q[v[se]]}return q}}return F.set(n,i),i}const re=new Map;function te(n){let i=re.get(n);if(i)return i;if(!n.includes("."))i=(v,p)=>{v!=null&&(v[n]=p)};else{const v=n.split("."),p=v.length-1;i=($,q)=>{let se=$;for(let he=0;he<p;he++){if(se==null)return;const ke=v[he];se[ke]==null&&(se[ke]={}),se=se[ke]}se!=null&&(se[v[p]]=q)}}return re.set(n,i),i}function G(n,i){return Z(i)(n)}function me(n,i,v){te(i)(n,v)}function x(n){return n?(n.includes(".")?n.slice(n.lastIndexOf(".")+1):n).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,v=>v.toUpperCase()):""}const Q={"&":"&","<":"<",">":">",'"':""","'":"'"};function ae(n){const i=n==null?"":String(n);return/[&<>"']/.test(i)?i.replace(/[&<>"']/g,v=>Q[v]):i}function T(n){return String(n).replace(/\w\S*/g,i=>i[0].toUpperCase()+i.slice(1).toLowerCase())}function Y(n,i,v){if(n!==void 0)return n===!0?{enabled:!0,...v}:n===!1?{enabled:!1}:a(n)?n:{[i]:n,enabled:!0}}function R(n){return n==null?[]:Array.isArray(n)?n:[n]}const g=Object.freeze(new Set(["__proto__","constructor","prototype"]));function b(n,i){if(!a(n))return a(i)?{...i}:i;if(!a(i))return i===void 0?n:i;const v={...n};for(const p of Object.keys(i)){if(g.has(p))continue;const $=i[p];$!==void 0&&(v[p]=a($)&&a(v[p])?b(v[p],$):$)}return v}function h(n,i){if(!a(n)||!a(i)||n===i)return i;const v=Object.create(Object.getPrototypeOf(n));return Object.assign(v,n,i),v}class k{#r;#n=new Map;#l;constructor(i=256,v=null){this.#r=i,this.#l=v}get size(){return this.#n.size}get max(){return this.#r}set max(i){this.#r=i,this.#e()}has(i){return this.#n.has(i)}get(i){const v=this.#n;if(!v.has(i))return;const p=v.get(i);return v.delete(i),v.set(i,p),p}peek(i){return this.#n.get(i)}set(i,v){const p=this.#n;return p.has(i)&&p.delete(i),p.set(i,v),this.#e(),v}delete(i){const v=this.#n.get(i);return this.#n.delete(i)&&this.#l&&this.#l(v,i),v}clear(){if(this.#l)for(const[i,v]of this.#n)this.#l(v,i);this.#n.clear()}keys(){return this.#n.keys()}values(){return this.#n.values()}#e(){const i=this.#n;for(;i.size>this.#r;){const v=i.keys().next().value,p=i.get(v);i.delete(v),this.#l&&this.#l(p,v)}}}const z=new Map;function E(n,i){const v=`${n||""}|${i?JSON.stringify(i):""}`;let p=z.get(v);return p||(p=new Intl.Collator(n||void 0,{numeric:!0,sensitivity:"variant",...i}),z.set(v,p)),p}function A(n,i){if(n===i)return 0;if(n==null)return 1;if(i==null)return-1;if(typeof n=="number"&&typeof i=="number")return Number.isNaN(n)?Number.isNaN(i)?0:1:Number.isNaN(i)||n<i?-1:n>i?1:0;const v=String(n),p=String(i);return v<p?-1:v>p?1:0}function y(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const r=typeof requestAnimationFrame=="function";function c(n){return r?requestAnimationFrame(n):setTimeout(()=>n(y()),16)}function S(n){n!=null&&(r?cancelAnimationFrame(n):clearTimeout(n))}function f(n){let i=null,v=null;const p=()=>{i=null;const q=v;v=null,n(...q||[])},$=(...q)=>{v=q,i===null&&(i=c(p))};return $.cancel=()=>{S(i),i=null,v=null},$.flush=()=>{i!==null&&(S(i),p())},$}function e(n,i){let v=null,p=null;const $=()=>{if(v=null,p===null)return;const he=p;p=null,n(...he),q()},q=()=>{v=setTimeout($,i),typeof v?.unref=="function"&&v.unref()},se=(...he)=>{v===null?(n(...he),q()):(p=he,clearTimeout(v),q())};return se.flush=()=>{if(v!==null&&clearTimeout(v),v=null,p===null)return;const he=p;p=null,n(...he)},se.cancel=()=>{v!==null&&clearTimeout(v),v=null,p=null},se.pending=()=>v!==null||p!==null,se}function o(n,i=50){return typeof requestIdleCallback=="function"?requestIdleCallback(n,{timeout:i}):setTimeout(()=>n({timeRemaining:()=>0,didTimeout:!0}),1)}let t=0;function l(n="l"){return`${n}${(++t).toString(36)}`}}),it("packages/modules/charts/scheme.js",function(s,X){"use strict";Object.defineProperty(s,"PALETTE",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"SCHEMES",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(s,"registerScheme",{enumerable:!0,get:function(){return J}}),Object.defineProperty(s,"setDefaultScheme",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"schemeNames",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"resolveScheme",{enumerable:!0,get:function(){return I}}),Object.defineProperty(s,"RAMP_SCALES",{enumerable:!0,get:function(){return _}}),Object.defineProperty(s,"toRgb",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"rampStops",{enumerable:!0,get:function(){return d}});const ne=X("packages/core/src/internal/util.js").warnOnce,j=Object.freeze(["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#7a5195","#6b7d8c"]),pe=Object.freeze({default:{series:j,sequential:["#ecf3f9","#005280"],diverging:["#b04a00","#f7f7f7","#005280"],positive:"#009e73",negative:"#d55e00"},bright:{series:["#1f77d0","#ff7f0e","#2ca02c","#d62728","#9467bd","#17becf","#e377c2","#7f7f7f"],sequential:["#eef4fb","#1f77d0"],diverging:["#d62728","#f7f7f7","#1f77d0"],positive:"#2ca02c",negative:"#d62728"},earth:{series:["#5b7c6f","#c08b52","#7a6a53","#a4553f","#4e6a83","#8f8259","#6d5566","#8c9196"],sequential:["#f2efe9","#4e6a83"],diverging:["#a4553f","#f2efe9","#4e6a83"],positive:"#5b7c6f",negative:"#a4553f"},mono:{series:["#0b2a3d","#17475f","#2c6480","#4a82a0","#6da0bd","#94bcd6","#bcd7e9","#dfecf5"],sequential:["#eef3f7","#0b2a3d"],diverging:["#7a5c00","#f5f5f5","#0b2a3d"],positive:"#17475f",negative:"#7a5c00"}}),de=new Map;let ee="default";function J(a,u){!a||!u||de.set(String(a),u)}function W(a){if(typeof a=="string"){ee=a;return}a&&typeof a=="object"&&(de.set("__default__",a),ee="__default__")}function ie(){return[...Object.keys(pe),...de.keys()].filter(a=>!a.startsWith("__"))}function M(a){return de.has(a)?de.get(a):pe[a]||null}const m=["series","sequential","diverging","positive","negative"];function B(a){return!a||typeof a!="object"||Array.isArray(a)?!1:!m.some(u=>u in a)}function I(a){const u=M(ee)||pe.default,w=a&&a.scheme,L=B(w)?w:null,D=typeof w=="string"?M(w):L?null:w||null,F=a&&Array.isArray(a.palette)&&a.palette.length?a.palette:null;L&&F&&ne("chart:scheme:array-and-map",'chart "scheme" was given as a name map together with a "palette" array; the two do not combine. Colours came from the map and the array was ignored. Pass one or the other.');const Z=L?null:F,re={...pe.default,...u,...D||{}};Z&&(re.series=Z);const te=a&&a.ramp&&typeof a.ramp=="object"&&!Array.isArray(a.ramp)?a.ramp:null,G=te?te.colours:a&&a.ramp,me=Array.isArray(G)&&G.length>=2?G:null;me&&(re.sequential=me);const x=te?U(te.scale):null,Q=!!(D||Z||L),ae=re.series&&re.series.length?re.series:j,T=new Map;let Y=0;return{...re,series:(g,b)=>{if(L&&b!==void 0&&b!==null){const h=String(b);return Object.prototype.hasOwnProperty.call(L,h)?L[h]:(T.has(h)||T.set(h,Y++),C(ae,T.get(h),!0))}return C(ae,g,Q)},explicit:Q,nameMap:!!L,rampScale:x}}const _=Object.freeze(["linear","log","quantile"]);function U(a){return a==null?null:_.includes(a)?a:(ne(`chart:ramp:scale:${String(a)}`,`chart "ramp.scale" was "${String(a)}", which is not a ramp scale; the chart chose one from its values instead. Use "linear", "log" or "quantile".`),null)}function C(a,u,w){const L=(u%a.length+a.length)%a.length;return w?a[L]:`var(--lattice-chart-${L+1}, ${a[L]})`}function N(a){if(typeof a!="string")return null;const u=a.trim(),w=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(u);if(w){const F=w[1];return F.length===3?[0,1,2].map(Z=>parseInt(F[Z]+F[Z],16)):[0,2,4].map(Z=>parseInt(F.slice(Z,Z+2),16))}const L=/^rgba?\(([^)]+)\)$/i.exec(u);if(!L)return null;const D=L[1].split(/[\s,/]+/).filter(Boolean).slice(0,3).map(Number);return D.length===3&&D.every(F=>Number.isFinite(F))?D:null}function d(a,u){const w=u?a.diverging:a.sequential,L=u?pe.default.diverging:pe.default.sequential,D=(Array.isArray(w)?w:L).map((F,Z)=>N(F)||N(L[Z])||[0,0,0]);return D.length>=2?D:L.map(F=>N(F))}}),it("packages/modules/charts/styles.js",function(s,X){"use strict";Object.defineProperty(s,"NS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"seriesColour",{enumerable:!0,get:function(){return de}}),Object.defineProperty(s,"css",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(s,"injectStyles",{enumerable:!0,get:function(){return J}});const ne=X("packages/modules/charts/scheme.js").PALETTE,j="lat-chartview",pe="data-lattice-chartview";function de(W){const ie=(W%ne.length+ne.length)%ne.length;return`var(--lattice-chart-${ie+1}, ${ne[ie]})`}function ee(){return`
|
|
6
|
+
(function(Dn){"use strict";var Bn=Object.create(null),Gn=Object.create(null);function it(s,X){Bn[s]=X}function Un(s){var X=Gn[s];if(X)return X;var ye=Object.create(null);Gn[s]=ye;var ne=Bn[s];if(!ne)throw new Error("[lattice] missing module: "+s);return ne(ye,Un),ye}it("packages/modules/charts/svg.js",function(s,X){"use strict";Object.defineProperty(s,"SVG_NS",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(s,"el",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(s,"svg",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"attr",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(s,"attrs",{enumerable:!0,get:function(){return de}}),Object.defineProperty(s,"setText",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(s,"clear",{enumerable:!0,get:function(){return J}}),Object.defineProperty(s,"append",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"path",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"ribbonPath",{enumerable:!0,get:function(){return M}}),Object.defineProperty(s,"round",{enumerable:!0,get:function(){return m}}),Object.defineProperty(s,"pathRings",{enumerable:!0,get:function(){return B}}),Object.defineProperty(s,"insideRings",{enumerable:!0,get:function(){return I}});const ye="http://www.w3.org/2000/svg";function ne(_,U,C){const N=_.createElement(U);return C&&N.setAttribute("class",C),N}function j(_,U,C){const N=_.createElementNS(ye,U);if(C)for(const d of Object.keys(C))N.setAttribute(d,String(C[d]));return N}function pe(_,U,C){_&&(C==null?_.removeAttribute(U):_.setAttribute(U,String(C)))}function de(_,U){if(_)for(const C of Object.keys(U))pe(_,C,U[C])}function ee(_,U){_&&(_.textContent=U==null?"":String(U))}function J(_){if(_)for(;_.firstChild;)_.removeChild(_.firstChild)}function W(_,U){for(const C of U)C&&_.appendChild(C);return _}function ie(_){return _.join(" ")}function M(_){if(!_||_.length<2)return"";const U=["M",_[0].x,_[0].upper];for(let C=1;C<_.length;C++)U.push("L",_[C].x,_[C].upper);for(let C=_.length-1;C>=0;C--)U.push("L",_[C].x,_[C].lower);return U.push("Z"),ie(U)}function m(_){return Math.round(_*100)/100}function B(_){const U=[];let C=[];const N=String(_||"").match(/[A-Za-z]|-?\d*\.?\d+(?:e[-+]?\d+)?/gi)||[];let d="",a=[];const u=()=>{if(!d||!a.length){a=[];return}if(d==="M"||d==="L")for(let w=0;w+1<a.length;w+=2)C.push([a[w],a[w+1]]);else d!=="Z"&&a.length>=2&&C.push([a[a.length-2],a[a.length-1]]);a=[]};for(const w of N){if(/[A-Za-z]/.test(w)){if(u(),w==="Z"||w==="z"){C.length>2&&U.push(C),C=[],d="";continue}w==="M"&&C.length>2&&(U.push(C),C=[]),d=w;continue}a.push(Number(w))}return u(),C.length>2&&U.push(C),U}function I(_,U,C){let N=!1;for(const d of _)for(let a=0,u=d.length-1;a<d.length;u=a++){const[w,L]=d[a],[D,F]=d[u];L>C!=F>C&&U<(D-w)*(C-L)/(F-L||1e-12)+w&&(N=!N)}return N}}),it("packages/modules/charts/typography.js",function(s,X){"use strict";Object.defineProperty(s,"BASE_SIZE",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(s,"BASE_FAMILY",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(s,"CHAR_RATIO",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"resolveType",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(s,"textWidth",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(s,"widestLabel",{enumerable:!0,get:function(){return J}}),Object.defineProperty(s,"truncateTo",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"applySize",{enumerable:!0,get:function(){return ie}});const ye=12,ne="var(--lattice-font-family, system-ui, -apple-system, sans-serif)",j=.62;function pe(M){const m=M&&M.font,B=typeof m=="number"?{size:m}:m||{},I=de(B.size,ye);return{family:B.family||ne,size:I,small:de(B.small??B.tickSize,Math.max(9,I-1)),title:de(B.title,Math.round(I*1.15)),axisTitle:de(B.axisTitle,Math.max(10,I-1)),weight:B.weight||"inherit"}}function de(M,m){const B=Number(M);return Number.isFinite(B)&&B>0?B:m}function ee(M,m){return String(M??"").length*m*j}function J(M,m){let B=0;for(const I of M||[]){const _=ee(I,m);_>B&&(B=_)}return B}function W(M,m,B){const I=String(M??""),_=Math.floor(m/(B*j));return _<=0?"":I.length<=_?I:_===1?"…":`${I.slice(0,_-1)}…`}function ie(M,m){!M||!Number.isFinite(m)||(M.style?M.style.fontSize=`${m}px`:M.setAttribute("style",`font-size:${m}px`))}}),it("packages/modules/charts/frame.js",function(s,X){"use strict";Object.defineProperty(s,"LABEL_GAP",{enumerable:!0,get:function(){return J}}),Object.defineProperty(s,"LABEL_GUTTER_SHARE",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"resolveMargin",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"plotRect",{enumerable:!0,get:function(){return M}}),Object.defineProperty(s,"shouldRotate",{enumerable:!0,get:function(){return m}}),Object.defineProperty(s,"Pool",{enumerable:!0,get:function(){return B}});const ne=X("packages/modules/charts/svg.js").SVG_NS,j=X("packages/modules/charts/typography.js"),pe=j.textWidth,de=j.widestLabel,ee=8,J=6,W=.4;function ie(I,_){const U=typeof I=="number"?I:_,C=I&&typeof I=="object"?I:{},N=d=>Number.isFinite(d)&&d>=0?Number(d):U;return{base:U,top:N(C.top),right:N(C.right),bottom:N(C.bottom),left:N(C.left)}}function M(I){const _=ie(I.margin,typeof I.padding=="number"?I.padding:8),U=_.base,C=I.fontSize||12,N=I.yLabels||[],d=I.xLabels||[],a=I.ySide==="right"?"right":"left",u=a==="right"?"left":"right",w=I.titles||{},L=I.titleSize||C,D=Y=>Y?L+J:0,F=de(N,C),Z=N.length?Math.min(I.width*W,_[a]+F+J):Math.max(ee,_[a]),re=_[u]+(I.rightGutter||0),te=(a==="left"?Z:re)+D(w.left),G=de(d.map(Y=>String(Y).slice(0,14)),C),me=(d.length?I.rotated?Math.min(I.height*W,J+G):C+J+_.bottom:Math.max(ee,_.bottom))+D(w.bottom),x=(a==="right"?Z:re)+D(w.right),Q=_.top+(I.topGutter||0),ae=Math.max(0,I.width-te-x),T=Math.max(0,I.height-Q-me);return{left:te,top:Q,width:ae,height:T,right:te+ae,bottom:Q+T,gutter:{left:te,bottom:me,right:x,top:Q}}}function m(I,_,U,C){if(!I.length||_<=0)return!1;const N=Number.isFinite(C)&&C>0?Number(C):1;return de(I,U)>_*N-4}class B{#r;#n=0;static#l="data-pool-key";constructor(_){this.#r=_}next(_,U,C){if(C!=null)return this.#e(_,U,String(C));const N=this.#r.childNodes[this.#n],d=N&&N.tagName;if(d&&String(d).toLowerCase()===_.toLowerCase())return U&&N.setAttribute("class",U),this.#n++,N;const a=this.#r.ownerDocument.createElementNS(ne,_);return U&&a.setAttribute("class",U),N?this.#r.insertBefore(a,N):this.#r.appendChild(a),this.#n++,a}#e(_,U,C){const N=_.toLowerCase();for(let u=this.#n;u<this.#r.childNodes.length;u++){const w=this.#r.childNodes[u],L=w&&w.tagName;if(L&&String(L).toLowerCase()===N&&w.getAttribute(B.#l)===C)return u!==this.#n&&this.#r.insertBefore(w,this.#r.childNodes[this.#n]),U&&w.setAttribute("class",U),this.#n++,w}const d=this.#r.ownerDocument.createElementNS(ne,_);d.setAttribute(B.#l,C),U&&d.setAttribute("class",U);const a=this.#r.childNodes[this.#n];return a?this.#r.insertBefore(d,a):this.#r.appendChild(d),this.#n++,d}finish(){for(;this.#r.childNodes.length>this.#n;)this.#r.removeChild(this.#r.lastChild);this.#n=0}}}),it("packages/core/src/internal/util.js",function(s,X){"use strict";Object.defineProperty(s,"VERSION",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"reportedWarnings",{enumerable:!0,get:function(){return m}}),Object.defineProperty(s,"warnOnce",{enumerable:!0,get:function(){return I}}),Object.defineProperty(s,"infoOnce",{enumerable:!0,get:function(){return _}}),Object.defineProperty(s,"resetWarnings",{enumerable:!0,get:function(){return U}}),Object.defineProperty(s,"fail",{enumerable:!0,get:function(){return C}}),Object.defineProperty(s,"invariant",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"DEV",{enumerable:!0,get:function(){return d}}),Object.defineProperty(s,"isObject",{enumerable:!0,get:function(){return a}}),Object.defineProperty(s,"isFunction",{enumerable:!0,get:function(){return u}}),Object.defineProperty(s,"isNil",{enumerable:!0,get:function(){return w}}),Object.defineProperty(s,"isBlank",{enumerable:!0,get:function(){return L}}),Object.defineProperty(s,"isCtor",{enumerable:!0,get:function(){return D}}),Object.defineProperty(s,"pathGetter",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(s,"pathSetter",{enumerable:!0,get:function(){return te}}),Object.defineProperty(s,"getPath",{enumerable:!0,get:function(){return G}}),Object.defineProperty(s,"setPath",{enumerable:!0,get:function(){return me}}),Object.defineProperty(s,"humanise",{enumerable:!0,get:function(){return x}}),Object.defineProperty(s,"escapeHtml",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(s,"titleCase",{enumerable:!0,get:function(){return T}}),Object.defineProperty(s,"expand",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(s,"toArray",{enumerable:!0,get:function(){return R}}),Object.defineProperty(s,"merge",{enumerable:!0,get:function(){return b}}),Object.defineProperty(s,"mergeRow",{enumerable:!0,get:function(){return h}}),Object.defineProperty(s,"Lru",{enumerable:!0,get:function(){return k}}),Object.defineProperty(s,"collator",{enumerable:!0,get:function(){return E}}),Object.defineProperty(s,"defaultCompare",{enumerable:!0,get:function(){return A}}),Object.defineProperty(s,"now",{enumerable:!0,get:function(){return y}}),Object.defineProperty(s,"nextFrame",{enumerable:!0,get:function(){return c}}),Object.defineProperty(s,"cancelFrame",{enumerable:!0,get:function(){return S}}),Object.defineProperty(s,"frameBatched",{enumerable:!0,get:function(){return f}}),Object.defineProperty(s,"settleDebounce",{enumerable:!0,get:function(){return e}}),Object.defineProperty(s,"whenIdle",{enumerable:!0,get:function(){return o}}),Object.defineProperty(s,"uid",{enumerable:!0,get:function(){return l}});const ye="1.81.0";async function ne(){return ye}const j="1.81.0",pe=new Set,de=2e3;function ee(n){if(pe.add(n),pe.size>de){const i=pe.values().next().value;i!==void 0&&pe.delete(i)}}const J=[],W=500;function ie(n,i,v){J.push({key:n,level:i,message:v.map(p=>typeof p=="string"?p:M(p)).join(" "),at:Date.now()}),J.length>W&&J.shift()}function M(n){if(n instanceof Error)return n.message;try{return JSON.stringify(n)}catch{return String(n)}}function m(){return J.map(n=>({...n}))}function B(n){if(n.length===0||typeof n[0]!="string")return n;const i=n[0].replace(/^\[lattice\]\s*/,"");return i===n[0]?n:[i,...n.slice(1)]}function I(n,...i){if(pe.has(n))return;ee(n);const v=B(i);ie(n,"warn",v),console.warn("[lattice]",...v)}function _(n,...i){if(pe.has(n))return;ee(n);const v=B(i);ie(n,"info",v),console.info("[lattice]",...v)}function U(){pe.clear(),J.length=0}function C(n,i){const v=new Error(`[lattice] ${n}`);throw i!==void 0&&(v.cause=i),v}function N(n,i){n||C(i)}const d=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function a(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function u(n){return typeof n=="function"}function w(n){return n==null}function L(n){return n==null||n===""}function D(n){return typeof n!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(n))?!0:!!(n.prototype&&Object.getOwnPropertyNames(n.prototype).length>1)}const F=new Map;function Z(n){let i=F.get(n);if(i)return i;if(!n.includes("."))i=v=>v?.[n];else{const v=n.split("."),p=v.length;i=$=>{let q=$;for(let se=0;se<p;se++){if(q==null)return;q=q[v[se]]}return q}}return F.set(n,i),i}const re=new Map;function te(n){let i=re.get(n);if(i)return i;if(!n.includes("."))i=(v,p)=>{v!=null&&(v[n]=p)};else{const v=n.split("."),p=v.length-1;i=($,q)=>{let se=$;for(let he=0;he<p;he++){if(se==null)return;const ke=v[he];se[ke]==null&&(se[ke]={}),se=se[ke]}se!=null&&(se[v[p]]=q)}}return re.set(n,i),i}function G(n,i){return Z(i)(n)}function me(n,i,v){te(i)(n,v)}function x(n){return n?(n.includes(".")?n.slice(n.lastIndexOf(".")+1):n).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,v=>v.toUpperCase()):""}const Q={"&":"&","<":"<",">":">",'"':""","'":"'"};function ae(n){const i=n==null?"":String(n);return/[&<>"']/.test(i)?i.replace(/[&<>"']/g,v=>Q[v]):i}function T(n){return String(n).replace(/\w\S*/g,i=>i[0].toUpperCase()+i.slice(1).toLowerCase())}function Y(n,i,v){if(n!==void 0)return n===!0?{enabled:!0,...v}:n===!1?{enabled:!1}:a(n)?n:{[i]:n,enabled:!0}}function R(n){return n==null?[]:Array.isArray(n)?n:[n]}const g=Object.freeze(new Set(["__proto__","constructor","prototype"]));function b(n,i){if(!a(n))return a(i)?{...i}:i;if(!a(i))return i===void 0?n:i;const v={...n};for(const p of Object.keys(i)){if(g.has(p))continue;const $=i[p];$!==void 0&&(v[p]=a($)&&a(v[p])?b(v[p],$):$)}return v}function h(n,i){if(!a(n)||!a(i)||n===i)return i;const v=Object.create(Object.getPrototypeOf(n));return Object.assign(v,n,i),v}class k{#r;#n=new Map;#l;constructor(i=256,v=null){this.#r=i,this.#l=v}get size(){return this.#n.size}get max(){return this.#r}set max(i){this.#r=i,this.#e()}has(i){return this.#n.has(i)}get(i){const v=this.#n;if(!v.has(i))return;const p=v.get(i);return v.delete(i),v.set(i,p),p}peek(i){return this.#n.get(i)}set(i,v){const p=this.#n;return p.has(i)&&p.delete(i),p.set(i,v),this.#e(),v}delete(i){const v=this.#n.get(i);return this.#n.delete(i)&&this.#l&&this.#l(v,i),v}clear(){if(this.#l)for(const[i,v]of this.#n)this.#l(v,i);this.#n.clear()}keys(){return this.#n.keys()}values(){return this.#n.values()}#e(){const i=this.#n;for(;i.size>this.#r;){const v=i.keys().next().value,p=i.get(v);i.delete(v),this.#l&&this.#l(p,v)}}}const z=new Map;function E(n,i){const v=`${n||""}|${i?JSON.stringify(i):""}`;let p=z.get(v);return p||(p=new Intl.Collator(n||void 0,{numeric:!0,sensitivity:"variant",...i}),z.set(v,p)),p}function A(n,i){if(n===i)return 0;if(n==null)return 1;if(i==null)return-1;if(typeof n=="number"&&typeof i=="number")return Number.isNaN(n)?Number.isNaN(i)?0:1:Number.isNaN(i)||n<i?-1:n>i?1:0;const v=String(n),p=String(i);return v<p?-1:v>p?1:0}function y(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const r=typeof requestAnimationFrame=="function";function c(n){return r?requestAnimationFrame(n):setTimeout(()=>n(y()),16)}function S(n){n!=null&&(r?cancelAnimationFrame(n):clearTimeout(n))}function f(n){let i=null,v=null;const p=()=>{i=null;const q=v;v=null,n(...q||[])},$=(...q)=>{v=q,i===null&&(i=c(p))};return $.cancel=()=>{S(i),i=null,v=null},$.flush=()=>{i!==null&&(S(i),p())},$}function e(n,i){let v=null,p=null;const $=()=>{if(v=null,p===null)return;const he=p;p=null,n(...he),q()},q=()=>{v=setTimeout($,i),typeof v?.unref=="function"&&v.unref()},se=(...he)=>{v===null?(n(...he),q()):(p=he,clearTimeout(v),q())};return se.flush=()=>{if(v!==null&&clearTimeout(v),v=null,p===null)return;const he=p;p=null,n(...he)},se.cancel=()=>{v!==null&&clearTimeout(v),v=null,p=null},se.pending=()=>v!==null||p!==null,se}function o(n,i=50){return typeof requestIdleCallback=="function"?requestIdleCallback(n,{timeout:i}):setTimeout(()=>n({timeRemaining:()=>0,didTimeout:!0}),1)}let t=0;function l(n="l"){return`${n}${(++t).toString(36)}`}}),it("packages/modules/charts/scheme.js",function(s,X){"use strict";Object.defineProperty(s,"PALETTE",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"SCHEMES",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(s,"registerScheme",{enumerable:!0,get:function(){return J}}),Object.defineProperty(s,"setDefaultScheme",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"schemeNames",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"resolveScheme",{enumerable:!0,get:function(){return I}}),Object.defineProperty(s,"RAMP_SCALES",{enumerable:!0,get:function(){return _}}),Object.defineProperty(s,"toRgb",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"rampStops",{enumerable:!0,get:function(){return d}});const ne=X("packages/core/src/internal/util.js").warnOnce,j=Object.freeze(["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#7a5195","#6b7d8c"]),pe=Object.freeze({default:{series:j,sequential:["#ecf3f9","#005280"],diverging:["#b04a00","#f7f7f7","#005280"],positive:"#009e73",negative:"#d55e00"},bright:{series:["#1f77d0","#ff7f0e","#2ca02c","#d62728","#9467bd","#17becf","#e377c2","#7f7f7f"],sequential:["#eef4fb","#1f77d0"],diverging:["#d62728","#f7f7f7","#1f77d0"],positive:"#2ca02c",negative:"#d62728"},earth:{series:["#5b7c6f","#c08b52","#7a6a53","#a4553f","#4e6a83","#8f8259","#6d5566","#8c9196"],sequential:["#f2efe9","#4e6a83"],diverging:["#a4553f","#f2efe9","#4e6a83"],positive:"#5b7c6f",negative:"#a4553f"},mono:{series:["#0b2a3d","#17475f","#2c6480","#4a82a0","#6da0bd","#94bcd6","#bcd7e9","#dfecf5"],sequential:["#eef3f7","#0b2a3d"],diverging:["#7a5c00","#f5f5f5","#0b2a3d"],positive:"#17475f",negative:"#7a5c00"}}),de=new Map;let ee="default";function J(a,u){!a||!u||de.set(String(a),u)}function W(a){if(typeof a=="string"){ee=a;return}a&&typeof a=="object"&&(de.set("__default__",a),ee="__default__")}function ie(){return[...Object.keys(pe),...de.keys()].filter(a=>!a.startsWith("__"))}function M(a){return de.has(a)?de.get(a):pe[a]||null}const m=["series","sequential","diverging","positive","negative"];function B(a){return!a||typeof a!="object"||Array.isArray(a)?!1:!m.some(u=>u in a)}function I(a){const u=M(ee)||pe.default,w=a&&a.scheme,L=B(w)?w:null,D=typeof w=="string"?M(w):L?null:w||null,F=a&&Array.isArray(a.palette)&&a.palette.length?a.palette:null;L&&F&&ne("chart:scheme:array-and-map",'chart "scheme" was given as a name map together with a "palette" array; the two do not combine. Colours came from the map and the array was ignored. Pass one or the other.');const Z=L?null:F,re={...pe.default,...u,...D||{}};Z&&(re.series=Z);const te=a&&a.ramp&&typeof a.ramp=="object"&&!Array.isArray(a.ramp)?a.ramp:null,G=te?te.colours:a&&a.ramp,me=Array.isArray(G)&&G.length>=2?G:null;me&&(re.sequential=me);const x=te?U(te.scale):null,Q=!!(D||Z||L),ae=re.series&&re.series.length?re.series:j,T=new Map;let Y=0;return{...re,series:(g,b)=>{if(L&&b!==void 0&&b!==null){const h=String(b);return Object.prototype.hasOwnProperty.call(L,h)?L[h]:(T.has(h)||T.set(h,Y++),C(ae,T.get(h),!0))}return C(ae,g,Q)},explicit:Q,nameMap:!!L,rampScale:x}}const _=Object.freeze(["linear","log","quantile"]);function U(a){return a==null?null:_.includes(a)?a:(ne(`chart:ramp:scale:${String(a)}`,`chart "ramp.scale" was "${String(a)}", which is not a ramp scale; the chart chose one from its values instead. Use "linear", "log" or "quantile".`),null)}function C(a,u,w){const L=(u%a.length+a.length)%a.length;return w?a[L]:`var(--lattice-chart-${L+1}, ${a[L]})`}function N(a){if(typeof a!="string")return null;const u=a.trim(),w=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(u);if(w){const F=w[1];return F.length===3?[0,1,2].map(Z=>parseInt(F[Z]+F[Z],16)):[0,2,4].map(Z=>parseInt(F.slice(Z,Z+2),16))}const L=/^rgba?\(([^)]+)\)$/i.exec(u);if(!L)return null;const D=L[1].split(/[\s,/]+/).filter(Boolean).slice(0,3).map(Number);return D.length===3&&D.every(F=>Number.isFinite(F))?D:null}function d(a,u){const w=u?a.diverging:a.sequential,L=u?pe.default.diverging:pe.default.sequential,D=(Array.isArray(w)?w:L).map((F,Z)=>N(F)||N(L[Z])||[0,0,0]);return D.length>=2?D:L.map(F=>N(F))}}),it("packages/modules/charts/styles.js",function(s,X){"use strict";Object.defineProperty(s,"NS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"seriesColour",{enumerable:!0,get:function(){return de}}),Object.defineProperty(s,"css",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(s,"injectStyles",{enumerable:!0,get:function(){return J}});const ne=X("packages/modules/charts/scheme.js").PALETTE,j="lat-chartview",pe="data-lattice-chartview";function de(W){const ie=(W%ne.length+ne.length)%ne.length;return`var(--lattice-chart-${ie+1}, ${ne[ie]})`}function ee(){return`
|
|
7
7
|
.${j}{position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;
|
|
8
8
|
width:100%;height:100%;box-sizing:border-box;
|
|
9
9
|
font-family:var(--lattice-font-family,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif);
|
package/modules/charts.min.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.
|
|
2
|
+
* Lattice Grid 1.81.0, charts module
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
6
|
-
(function(Dn){"use strict";var Bn=Object.create(null),Gn=Object.create(null);function it(s,X){Bn[s]=X}function Un(s){var X=Gn[s];if(X)return X;var ye=Object.create(null);Gn[s]=ye;var ne=Bn[s];if(!ne)throw new Error("[lattice] missing module: "+s);return ne(ye,Un),ye}it("packages/modules/charts/svg.js",function(s,X){"use strict";Object.defineProperty(s,"SVG_NS",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(s,"el",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(s,"svg",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"attr",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(s,"attrs",{enumerable:!0,get:function(){return de}}),Object.defineProperty(s,"setText",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(s,"clear",{enumerable:!0,get:function(){return J}}),Object.defineProperty(s,"append",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"path",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"ribbonPath",{enumerable:!0,get:function(){return M}}),Object.defineProperty(s,"round",{enumerable:!0,get:function(){return m}}),Object.defineProperty(s,"pathRings",{enumerable:!0,get:function(){return B}}),Object.defineProperty(s,"insideRings",{enumerable:!0,get:function(){return I}});const ye="http://www.w3.org/2000/svg";function ne(_,U,C){const N=_.createElement(U);return C&&N.setAttribute("class",C),N}function j(_,U,C){const N=_.createElementNS(ye,U);if(C)for(const d of Object.keys(C))N.setAttribute(d,String(C[d]));return N}function pe(_,U,C){_&&(C==null?_.removeAttribute(U):_.setAttribute(U,String(C)))}function de(_,U){if(_)for(const C of Object.keys(U))pe(_,C,U[C])}function ee(_,U){_&&(_.textContent=U==null?"":String(U))}function J(_){if(_)for(;_.firstChild;)_.removeChild(_.firstChild)}function W(_,U){for(const C of U)C&&_.appendChild(C);return _}function ie(_){return _.join(" ")}function M(_){if(!_||_.length<2)return"";const U=["M",_[0].x,_[0].upper];for(let C=1;C<_.length;C++)U.push("L",_[C].x,_[C].upper);for(let C=_.length-1;C>=0;C--)U.push("L",_[C].x,_[C].lower);return U.push("Z"),ie(U)}function m(_){return Math.round(_*100)/100}function B(_){const U=[];let C=[];const N=String(_||"").match(/[A-Za-z]|-?\d*\.?\d+(?:e[-+]?\d+)?/gi)||[];let d="",a=[];const u=()=>{if(!d||!a.length){a=[];return}if(d==="M"||d==="L")for(let w=0;w+1<a.length;w+=2)C.push([a[w],a[w+1]]);else d!=="Z"&&a.length>=2&&C.push([a[a.length-2],a[a.length-1]]);a=[]};for(const w of N){if(/[A-Za-z]/.test(w)){if(u(),w==="Z"||w==="z"){C.length>2&&U.push(C),C=[],d="";continue}w==="M"&&C.length>2&&(U.push(C),C=[]),d=w;continue}a.push(Number(w))}return u(),C.length>2&&U.push(C),U}function I(_,U,C){let N=!1;for(const d of _)for(let a=0,u=d.length-1;a<d.length;u=a++){const[w,L]=d[a],[D,F]=d[u];L>C!=F>C&&U<(D-w)*(C-L)/(F-L||1e-12)+w&&(N=!N)}return N}}),it("packages/modules/charts/typography.js",function(s,X){"use strict";Object.defineProperty(s,"BASE_SIZE",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(s,"BASE_FAMILY",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(s,"CHAR_RATIO",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"resolveType",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(s,"textWidth",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(s,"widestLabel",{enumerable:!0,get:function(){return J}}),Object.defineProperty(s,"truncateTo",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"applySize",{enumerable:!0,get:function(){return ie}});const ye=12,ne="var(--lattice-font-family, system-ui, -apple-system, sans-serif)",j=.62;function pe(M){const m=M&&M.font,B=typeof m=="number"?{size:m}:m||{},I=de(B.size,ye);return{family:B.family||ne,size:I,small:de(B.small??B.tickSize,Math.max(9,I-1)),title:de(B.title,Math.round(I*1.15)),axisTitle:de(B.axisTitle,Math.max(10,I-1)),weight:B.weight||"inherit"}}function de(M,m){const B=Number(M);return Number.isFinite(B)&&B>0?B:m}function ee(M,m){return String(M??"").length*m*j}function J(M,m){let B=0;for(const I of M||[]){const _=ee(I,m);_>B&&(B=_)}return B}function W(M,m,B){const I=String(M??""),_=Math.floor(m/(B*j));return _<=0?"":I.length<=_?I:_===1?"…":`${I.slice(0,_-1)}…`}function ie(M,m){!M||!Number.isFinite(m)||(M.style?M.style.fontSize=`${m}px`:M.setAttribute("style",`font-size:${m}px`))}}),it("packages/modules/charts/frame.js",function(s,X){"use strict";Object.defineProperty(s,"LABEL_GAP",{enumerable:!0,get:function(){return J}}),Object.defineProperty(s,"LABEL_GUTTER_SHARE",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"resolveMargin",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"plotRect",{enumerable:!0,get:function(){return M}}),Object.defineProperty(s,"shouldRotate",{enumerable:!0,get:function(){return m}}),Object.defineProperty(s,"Pool",{enumerable:!0,get:function(){return B}});const ne=X("packages/modules/charts/svg.js").SVG_NS,j=X("packages/modules/charts/typography.js"),pe=j.textWidth,de=j.widestLabel,ee=8,J=6,W=.4;function ie(I,_){const U=typeof I=="number"?I:_,C=I&&typeof I=="object"?I:{},N=d=>Number.isFinite(d)&&d>=0?Number(d):U;return{base:U,top:N(C.top),right:N(C.right),bottom:N(C.bottom),left:N(C.left)}}function M(I){const _=ie(I.margin,typeof I.padding=="number"?I.padding:8),U=_.base,C=I.fontSize||12,N=I.yLabels||[],d=I.xLabels||[],a=I.ySide==="right"?"right":"left",u=a==="right"?"left":"right",w=I.titles||{},L=I.titleSize||C,D=Y=>Y?L+J:0,F=de(N,C),Z=N.length?Math.min(I.width*W,_[a]+F+J):Math.max(ee,_[a]),re=_[u]+(I.rightGutter||0),te=(a==="left"?Z:re)+D(w.left),G=de(d.map(Y=>String(Y).slice(0,14)),C),me=(d.length?I.rotated?Math.min(I.height*W,J+G):C+J+_.bottom:Math.max(ee,_.bottom))+D(w.bottom),x=(a==="right"?Z:re)+D(w.right),Q=_.top+(I.topGutter||0),ae=Math.max(0,I.width-te-x),T=Math.max(0,I.height-Q-me);return{left:te,top:Q,width:ae,height:T,right:te+ae,bottom:Q+T,gutter:{left:te,bottom:me,right:x,top:Q}}}function m(I,_,U,C){if(!I.length||_<=0)return!1;const N=Number.isFinite(C)&&C>0?Number(C):1;return de(I,U)>_*N-4}class B{#r;#n=0;static#l="data-pool-key";constructor(_){this.#r=_}next(_,U,C){if(C!=null)return this.#e(_,U,String(C));const N=this.#r.childNodes[this.#n],d=N&&N.tagName;if(d&&String(d).toLowerCase()===_.toLowerCase())return U&&N.setAttribute("class",U),this.#n++,N;const a=this.#r.ownerDocument.createElementNS(ne,_);return U&&a.setAttribute("class",U),N?this.#r.insertBefore(a,N):this.#r.appendChild(a),this.#n++,a}#e(_,U,C){const N=_.toLowerCase();for(let u=this.#n;u<this.#r.childNodes.length;u++){const w=this.#r.childNodes[u],L=w&&w.tagName;if(L&&String(L).toLowerCase()===N&&w.getAttribute(B.#l)===C)return u!==this.#n&&this.#r.insertBefore(w,this.#r.childNodes[this.#n]),U&&w.setAttribute("class",U),this.#n++,w}const d=this.#r.ownerDocument.createElementNS(ne,_);d.setAttribute(B.#l,C),U&&d.setAttribute("class",U);const a=this.#r.childNodes[this.#n];return a?this.#r.insertBefore(d,a):this.#r.appendChild(d),this.#n++,d}finish(){for(;this.#r.childNodes.length>this.#n;)this.#r.removeChild(this.#r.lastChild);this.#n=0}}}),it("packages/core/src/internal/util.js",function(s,X){"use strict";Object.defineProperty(s,"VERSION",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"reportedWarnings",{enumerable:!0,get:function(){return m}}),Object.defineProperty(s,"warnOnce",{enumerable:!0,get:function(){return I}}),Object.defineProperty(s,"infoOnce",{enumerable:!0,get:function(){return _}}),Object.defineProperty(s,"resetWarnings",{enumerable:!0,get:function(){return U}}),Object.defineProperty(s,"fail",{enumerable:!0,get:function(){return C}}),Object.defineProperty(s,"invariant",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"DEV",{enumerable:!0,get:function(){return d}}),Object.defineProperty(s,"isObject",{enumerable:!0,get:function(){return a}}),Object.defineProperty(s,"isFunction",{enumerable:!0,get:function(){return u}}),Object.defineProperty(s,"isNil",{enumerable:!0,get:function(){return w}}),Object.defineProperty(s,"isBlank",{enumerable:!0,get:function(){return L}}),Object.defineProperty(s,"isCtor",{enumerable:!0,get:function(){return D}}),Object.defineProperty(s,"pathGetter",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(s,"pathSetter",{enumerable:!0,get:function(){return te}}),Object.defineProperty(s,"getPath",{enumerable:!0,get:function(){return G}}),Object.defineProperty(s,"setPath",{enumerable:!0,get:function(){return me}}),Object.defineProperty(s,"humanise",{enumerable:!0,get:function(){return x}}),Object.defineProperty(s,"escapeHtml",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(s,"titleCase",{enumerable:!0,get:function(){return T}}),Object.defineProperty(s,"expand",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(s,"toArray",{enumerable:!0,get:function(){return R}}),Object.defineProperty(s,"merge",{enumerable:!0,get:function(){return b}}),Object.defineProperty(s,"mergeRow",{enumerable:!0,get:function(){return h}}),Object.defineProperty(s,"Lru",{enumerable:!0,get:function(){return k}}),Object.defineProperty(s,"collator",{enumerable:!0,get:function(){return E}}),Object.defineProperty(s,"defaultCompare",{enumerable:!0,get:function(){return A}}),Object.defineProperty(s,"now",{enumerable:!0,get:function(){return y}}),Object.defineProperty(s,"nextFrame",{enumerable:!0,get:function(){return c}}),Object.defineProperty(s,"cancelFrame",{enumerable:!0,get:function(){return S}}),Object.defineProperty(s,"frameBatched",{enumerable:!0,get:function(){return f}}),Object.defineProperty(s,"settleDebounce",{enumerable:!0,get:function(){return e}}),Object.defineProperty(s,"whenIdle",{enumerable:!0,get:function(){return o}}),Object.defineProperty(s,"uid",{enumerable:!0,get:function(){return l}});const ye="1.80.0";async function ne(){return ye}const j="1.80.0",pe=new Set,de=2e3;function ee(n){if(pe.add(n),pe.size>de){const i=pe.values().next().value;i!==void 0&&pe.delete(i)}}const J=[],W=500;function ie(n,i,v){J.push({key:n,level:i,message:v.map(p=>typeof p=="string"?p:M(p)).join(" "),at:Date.now()}),J.length>W&&J.shift()}function M(n){if(n instanceof Error)return n.message;try{return JSON.stringify(n)}catch{return String(n)}}function m(){return J.map(n=>({...n}))}function B(n){if(n.length===0||typeof n[0]!="string")return n;const i=n[0].replace(/^\[lattice\]\s*/,"");return i===n[0]?n:[i,...n.slice(1)]}function I(n,...i){if(pe.has(n))return;ee(n);const v=B(i);ie(n,"warn",v),console.warn("[lattice]",...v)}function _(n,...i){if(pe.has(n))return;ee(n);const v=B(i);ie(n,"info",v),console.info("[lattice]",...v)}function U(){pe.clear(),J.length=0}function C(n,i){const v=new Error(`[lattice] ${n}`);throw i!==void 0&&(v.cause=i),v}function N(n,i){n||C(i)}const d=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function a(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function u(n){return typeof n=="function"}function w(n){return n==null}function L(n){return n==null||n===""}function D(n){return typeof n!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(n))?!0:!!(n.prototype&&Object.getOwnPropertyNames(n.prototype).length>1)}const F=new Map;function Z(n){let i=F.get(n);if(i)return i;if(!n.includes("."))i=v=>v?.[n];else{const v=n.split("."),p=v.length;i=$=>{let q=$;for(let se=0;se<p;se++){if(q==null)return;q=q[v[se]]}return q}}return F.set(n,i),i}const re=new Map;function te(n){let i=re.get(n);if(i)return i;if(!n.includes("."))i=(v,p)=>{v!=null&&(v[n]=p)};else{const v=n.split("."),p=v.length-1;i=($,q)=>{let se=$;for(let he=0;he<p;he++){if(se==null)return;const ke=v[he];se[ke]==null&&(se[ke]={}),se=se[ke]}se!=null&&(se[v[p]]=q)}}return re.set(n,i),i}function G(n,i){return Z(i)(n)}function me(n,i,v){te(i)(n,v)}function x(n){return n?(n.includes(".")?n.slice(n.lastIndexOf(".")+1):n).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,v=>v.toUpperCase()):""}const Q={"&":"&","<":"<",">":">",'"':""","'":"'"};function ae(n){const i=n==null?"":String(n);return/[&<>"']/.test(i)?i.replace(/[&<>"']/g,v=>Q[v]):i}function T(n){return String(n).replace(/\w\S*/g,i=>i[0].toUpperCase()+i.slice(1).toLowerCase())}function Y(n,i,v){if(n!==void 0)return n===!0?{enabled:!0,...v}:n===!1?{enabled:!1}:a(n)?n:{[i]:n,enabled:!0}}function R(n){return n==null?[]:Array.isArray(n)?n:[n]}const g=Object.freeze(new Set(["__proto__","constructor","prototype"]));function b(n,i){if(!a(n))return a(i)?{...i}:i;if(!a(i))return i===void 0?n:i;const v={...n};for(const p of Object.keys(i)){if(g.has(p))continue;const $=i[p];$!==void 0&&(v[p]=a($)&&a(v[p])?b(v[p],$):$)}return v}function h(n,i){if(!a(n)||!a(i)||n===i)return i;const v=Object.create(Object.getPrototypeOf(n));return Object.assign(v,n,i),v}class k{#r;#n=new Map;#l;constructor(i=256,v=null){this.#r=i,this.#l=v}get size(){return this.#n.size}get max(){return this.#r}set max(i){this.#r=i,this.#e()}has(i){return this.#n.has(i)}get(i){const v=this.#n;if(!v.has(i))return;const p=v.get(i);return v.delete(i),v.set(i,p),p}peek(i){return this.#n.get(i)}set(i,v){const p=this.#n;return p.has(i)&&p.delete(i),p.set(i,v),this.#e(),v}delete(i){const v=this.#n.get(i);return this.#n.delete(i)&&this.#l&&this.#l(v,i),v}clear(){if(this.#l)for(const[i,v]of this.#n)this.#l(v,i);this.#n.clear()}keys(){return this.#n.keys()}values(){return this.#n.values()}#e(){const i=this.#n;for(;i.size>this.#r;){const v=i.keys().next().value,p=i.get(v);i.delete(v),this.#l&&this.#l(p,v)}}}const z=new Map;function E(n,i){const v=`${n||""}|${i?JSON.stringify(i):""}`;let p=z.get(v);return p||(p=new Intl.Collator(n||void 0,{numeric:!0,sensitivity:"variant",...i}),z.set(v,p)),p}function A(n,i){if(n===i)return 0;if(n==null)return 1;if(i==null)return-1;if(typeof n=="number"&&typeof i=="number")return Number.isNaN(n)?Number.isNaN(i)?0:1:Number.isNaN(i)||n<i?-1:n>i?1:0;const v=String(n),p=String(i);return v<p?-1:v>p?1:0}function y(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const r=typeof requestAnimationFrame=="function";function c(n){return r?requestAnimationFrame(n):setTimeout(()=>n(y()),16)}function S(n){n!=null&&(r?cancelAnimationFrame(n):clearTimeout(n))}function f(n){let i=null,v=null;const p=()=>{i=null;const q=v;v=null,n(...q||[])},$=(...q)=>{v=q,i===null&&(i=c(p))};return $.cancel=()=>{S(i),i=null,v=null},$.flush=()=>{i!==null&&(S(i),p())},$}function e(n,i){let v=null,p=null;const $=()=>{if(v=null,p===null)return;const he=p;p=null,n(...he),q()},q=()=>{v=setTimeout($,i),typeof v?.unref=="function"&&v.unref()},se=(...he)=>{v===null?(n(...he),q()):(p=he,clearTimeout(v),q())};return se.flush=()=>{if(v!==null&&clearTimeout(v),v=null,p===null)return;const he=p;p=null,n(...he)},se.cancel=()=>{v!==null&&clearTimeout(v),v=null,p=null},se.pending=()=>v!==null||p!==null,se}function o(n,i=50){return typeof requestIdleCallback=="function"?requestIdleCallback(n,{timeout:i}):setTimeout(()=>n({timeRemaining:()=>0,didTimeout:!0}),1)}let t=0;function l(n="l"){return`${n}${(++t).toString(36)}`}}),it("packages/modules/charts/scheme.js",function(s,X){"use strict";Object.defineProperty(s,"PALETTE",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"SCHEMES",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(s,"registerScheme",{enumerable:!0,get:function(){return J}}),Object.defineProperty(s,"setDefaultScheme",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"schemeNames",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"resolveScheme",{enumerable:!0,get:function(){return I}}),Object.defineProperty(s,"RAMP_SCALES",{enumerable:!0,get:function(){return _}}),Object.defineProperty(s,"toRgb",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"rampStops",{enumerable:!0,get:function(){return d}});const ne=X("packages/core/src/internal/util.js").warnOnce,j=Object.freeze(["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#7a5195","#6b7d8c"]),pe=Object.freeze({default:{series:j,sequential:["#ecf3f9","#005280"],diverging:["#b04a00","#f7f7f7","#005280"],positive:"#009e73",negative:"#d55e00"},bright:{series:["#1f77d0","#ff7f0e","#2ca02c","#d62728","#9467bd","#17becf","#e377c2","#7f7f7f"],sequential:["#eef4fb","#1f77d0"],diverging:["#d62728","#f7f7f7","#1f77d0"],positive:"#2ca02c",negative:"#d62728"},earth:{series:["#5b7c6f","#c08b52","#7a6a53","#a4553f","#4e6a83","#8f8259","#6d5566","#8c9196"],sequential:["#f2efe9","#4e6a83"],diverging:["#a4553f","#f2efe9","#4e6a83"],positive:"#5b7c6f",negative:"#a4553f"},mono:{series:["#0b2a3d","#17475f","#2c6480","#4a82a0","#6da0bd","#94bcd6","#bcd7e9","#dfecf5"],sequential:["#eef3f7","#0b2a3d"],diverging:["#7a5c00","#f5f5f5","#0b2a3d"],positive:"#17475f",negative:"#7a5c00"}}),de=new Map;let ee="default";function J(a,u){!a||!u||de.set(String(a),u)}function W(a){if(typeof a=="string"){ee=a;return}a&&typeof a=="object"&&(de.set("__default__",a),ee="__default__")}function ie(){return[...Object.keys(pe),...de.keys()].filter(a=>!a.startsWith("__"))}function M(a){return de.has(a)?de.get(a):pe[a]||null}const m=["series","sequential","diverging","positive","negative"];function B(a){return!a||typeof a!="object"||Array.isArray(a)?!1:!m.some(u=>u in a)}function I(a){const u=M(ee)||pe.default,w=a&&a.scheme,L=B(w)?w:null,D=typeof w=="string"?M(w):L?null:w||null,F=a&&Array.isArray(a.palette)&&a.palette.length?a.palette:null;L&&F&&ne("chart:scheme:array-and-map",'chart "scheme" was given as a name map together with a "palette" array; the two do not combine. Colours came from the map and the array was ignored. Pass one or the other.');const Z=L?null:F,re={...pe.default,...u,...D||{}};Z&&(re.series=Z);const te=a&&a.ramp&&typeof a.ramp=="object"&&!Array.isArray(a.ramp)?a.ramp:null,G=te?te.colours:a&&a.ramp,me=Array.isArray(G)&&G.length>=2?G:null;me&&(re.sequential=me);const x=te?U(te.scale):null,Q=!!(D||Z||L),ae=re.series&&re.series.length?re.series:j,T=new Map;let Y=0;return{...re,series:(g,b)=>{if(L&&b!==void 0&&b!==null){const h=String(b);return Object.prototype.hasOwnProperty.call(L,h)?L[h]:(T.has(h)||T.set(h,Y++),C(ae,T.get(h),!0))}return C(ae,g,Q)},explicit:Q,nameMap:!!L,rampScale:x}}const _=Object.freeze(["linear","log","quantile"]);function U(a){return a==null?null:_.includes(a)?a:(ne(`chart:ramp:scale:${String(a)}`,`chart "ramp.scale" was "${String(a)}", which is not a ramp scale; the chart chose one from its values instead. Use "linear", "log" or "quantile".`),null)}function C(a,u,w){const L=(u%a.length+a.length)%a.length;return w?a[L]:`var(--lattice-chart-${L+1}, ${a[L]})`}function N(a){if(typeof a!="string")return null;const u=a.trim(),w=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(u);if(w){const F=w[1];return F.length===3?[0,1,2].map(Z=>parseInt(F[Z]+F[Z],16)):[0,2,4].map(Z=>parseInt(F.slice(Z,Z+2),16))}const L=/^rgba?\(([^)]+)\)$/i.exec(u);if(!L)return null;const D=L[1].split(/[\s,/]+/).filter(Boolean).slice(0,3).map(Number);return D.length===3&&D.every(F=>Number.isFinite(F))?D:null}function d(a,u){const w=u?a.diverging:a.sequential,L=u?pe.default.diverging:pe.default.sequential,D=(Array.isArray(w)?w:L).map((F,Z)=>N(F)||N(L[Z])||[0,0,0]);return D.length>=2?D:L.map(F=>N(F))}}),it("packages/modules/charts/styles.js",function(s,X){"use strict";Object.defineProperty(s,"NS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"seriesColour",{enumerable:!0,get:function(){return de}}),Object.defineProperty(s,"css",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(s,"injectStyles",{enumerable:!0,get:function(){return J}});const ne=X("packages/modules/charts/scheme.js").PALETTE,j="lat-chartview",pe="data-lattice-chartview";function de(W){const ie=(W%ne.length+ne.length)%ne.length;return`var(--lattice-chart-${ie+1}, ${ne[ie]})`}function ee(){return`
|
|
6
|
+
(function(Dn){"use strict";var Bn=Object.create(null),Gn=Object.create(null);function it(s,X){Bn[s]=X}function Un(s){var X=Gn[s];if(X)return X;var ye=Object.create(null);Gn[s]=ye;var ne=Bn[s];if(!ne)throw new Error("[lattice] missing module: "+s);return ne(ye,Un),ye}it("packages/modules/charts/svg.js",function(s,X){"use strict";Object.defineProperty(s,"SVG_NS",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(s,"el",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(s,"svg",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"attr",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(s,"attrs",{enumerable:!0,get:function(){return de}}),Object.defineProperty(s,"setText",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(s,"clear",{enumerable:!0,get:function(){return J}}),Object.defineProperty(s,"append",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"path",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"ribbonPath",{enumerable:!0,get:function(){return M}}),Object.defineProperty(s,"round",{enumerable:!0,get:function(){return m}}),Object.defineProperty(s,"pathRings",{enumerable:!0,get:function(){return B}}),Object.defineProperty(s,"insideRings",{enumerable:!0,get:function(){return I}});const ye="http://www.w3.org/2000/svg";function ne(_,U,C){const N=_.createElement(U);return C&&N.setAttribute("class",C),N}function j(_,U,C){const N=_.createElementNS(ye,U);if(C)for(const d of Object.keys(C))N.setAttribute(d,String(C[d]));return N}function pe(_,U,C){_&&(C==null?_.removeAttribute(U):_.setAttribute(U,String(C)))}function de(_,U){if(_)for(const C of Object.keys(U))pe(_,C,U[C])}function ee(_,U){_&&(_.textContent=U==null?"":String(U))}function J(_){if(_)for(;_.firstChild;)_.removeChild(_.firstChild)}function W(_,U){for(const C of U)C&&_.appendChild(C);return _}function ie(_){return _.join(" ")}function M(_){if(!_||_.length<2)return"";const U=["M",_[0].x,_[0].upper];for(let C=1;C<_.length;C++)U.push("L",_[C].x,_[C].upper);for(let C=_.length-1;C>=0;C--)U.push("L",_[C].x,_[C].lower);return U.push("Z"),ie(U)}function m(_){return Math.round(_*100)/100}function B(_){const U=[];let C=[];const N=String(_||"").match(/[A-Za-z]|-?\d*\.?\d+(?:e[-+]?\d+)?/gi)||[];let d="",a=[];const u=()=>{if(!d||!a.length){a=[];return}if(d==="M"||d==="L")for(let w=0;w+1<a.length;w+=2)C.push([a[w],a[w+1]]);else d!=="Z"&&a.length>=2&&C.push([a[a.length-2],a[a.length-1]]);a=[]};for(const w of N){if(/[A-Za-z]/.test(w)){if(u(),w==="Z"||w==="z"){C.length>2&&U.push(C),C=[],d="";continue}w==="M"&&C.length>2&&(U.push(C),C=[]),d=w;continue}a.push(Number(w))}return u(),C.length>2&&U.push(C),U}function I(_,U,C){let N=!1;for(const d of _)for(let a=0,u=d.length-1;a<d.length;u=a++){const[w,L]=d[a],[D,F]=d[u];L>C!=F>C&&U<(D-w)*(C-L)/(F-L||1e-12)+w&&(N=!N)}return N}}),it("packages/modules/charts/typography.js",function(s,X){"use strict";Object.defineProperty(s,"BASE_SIZE",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(s,"BASE_FAMILY",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(s,"CHAR_RATIO",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"resolveType",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(s,"textWidth",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(s,"widestLabel",{enumerable:!0,get:function(){return J}}),Object.defineProperty(s,"truncateTo",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"applySize",{enumerable:!0,get:function(){return ie}});const ye=12,ne="var(--lattice-font-family, system-ui, -apple-system, sans-serif)",j=.62;function pe(M){const m=M&&M.font,B=typeof m=="number"?{size:m}:m||{},I=de(B.size,ye);return{family:B.family||ne,size:I,small:de(B.small??B.tickSize,Math.max(9,I-1)),title:de(B.title,Math.round(I*1.15)),axisTitle:de(B.axisTitle,Math.max(10,I-1)),weight:B.weight||"inherit"}}function de(M,m){const B=Number(M);return Number.isFinite(B)&&B>0?B:m}function ee(M,m){return String(M??"").length*m*j}function J(M,m){let B=0;for(const I of M||[]){const _=ee(I,m);_>B&&(B=_)}return B}function W(M,m,B){const I=String(M??""),_=Math.floor(m/(B*j));return _<=0?"":I.length<=_?I:_===1?"…":`${I.slice(0,_-1)}…`}function ie(M,m){!M||!Number.isFinite(m)||(M.style?M.style.fontSize=`${m}px`:M.setAttribute("style",`font-size:${m}px`))}}),it("packages/modules/charts/frame.js",function(s,X){"use strict";Object.defineProperty(s,"LABEL_GAP",{enumerable:!0,get:function(){return J}}),Object.defineProperty(s,"LABEL_GUTTER_SHARE",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"resolveMargin",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"plotRect",{enumerable:!0,get:function(){return M}}),Object.defineProperty(s,"shouldRotate",{enumerable:!0,get:function(){return m}}),Object.defineProperty(s,"Pool",{enumerable:!0,get:function(){return B}});const ne=X("packages/modules/charts/svg.js").SVG_NS,j=X("packages/modules/charts/typography.js"),pe=j.textWidth,de=j.widestLabel,ee=8,J=6,W=.4;function ie(I,_){const U=typeof I=="number"?I:_,C=I&&typeof I=="object"?I:{},N=d=>Number.isFinite(d)&&d>=0?Number(d):U;return{base:U,top:N(C.top),right:N(C.right),bottom:N(C.bottom),left:N(C.left)}}function M(I){const _=ie(I.margin,typeof I.padding=="number"?I.padding:8),U=_.base,C=I.fontSize||12,N=I.yLabels||[],d=I.xLabels||[],a=I.ySide==="right"?"right":"left",u=a==="right"?"left":"right",w=I.titles||{},L=I.titleSize||C,D=Y=>Y?L+J:0,F=de(N,C),Z=N.length?Math.min(I.width*W,_[a]+F+J):Math.max(ee,_[a]),re=_[u]+(I.rightGutter||0),te=(a==="left"?Z:re)+D(w.left),G=de(d.map(Y=>String(Y).slice(0,14)),C),me=(d.length?I.rotated?Math.min(I.height*W,J+G):C+J+_.bottom:Math.max(ee,_.bottom))+D(w.bottom),x=(a==="right"?Z:re)+D(w.right),Q=_.top+(I.topGutter||0),ae=Math.max(0,I.width-te-x),T=Math.max(0,I.height-Q-me);return{left:te,top:Q,width:ae,height:T,right:te+ae,bottom:Q+T,gutter:{left:te,bottom:me,right:x,top:Q}}}function m(I,_,U,C){if(!I.length||_<=0)return!1;const N=Number.isFinite(C)&&C>0?Number(C):1;return de(I,U)>_*N-4}class B{#r;#n=0;static#l="data-pool-key";constructor(_){this.#r=_}next(_,U,C){if(C!=null)return this.#e(_,U,String(C));const N=this.#r.childNodes[this.#n],d=N&&N.tagName;if(d&&String(d).toLowerCase()===_.toLowerCase())return U&&N.setAttribute("class",U),this.#n++,N;const a=this.#r.ownerDocument.createElementNS(ne,_);return U&&a.setAttribute("class",U),N?this.#r.insertBefore(a,N):this.#r.appendChild(a),this.#n++,a}#e(_,U,C){const N=_.toLowerCase();for(let u=this.#n;u<this.#r.childNodes.length;u++){const w=this.#r.childNodes[u],L=w&&w.tagName;if(L&&String(L).toLowerCase()===N&&w.getAttribute(B.#l)===C)return u!==this.#n&&this.#r.insertBefore(w,this.#r.childNodes[this.#n]),U&&w.setAttribute("class",U),this.#n++,w}const d=this.#r.ownerDocument.createElementNS(ne,_);d.setAttribute(B.#l,C),U&&d.setAttribute("class",U);const a=this.#r.childNodes[this.#n];return a?this.#r.insertBefore(d,a):this.#r.appendChild(d),this.#n++,d}finish(){for(;this.#r.childNodes.length>this.#n;)this.#r.removeChild(this.#r.lastChild);this.#n=0}}}),it("packages/core/src/internal/util.js",function(s,X){"use strict";Object.defineProperty(s,"VERSION",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"reportedWarnings",{enumerable:!0,get:function(){return m}}),Object.defineProperty(s,"warnOnce",{enumerable:!0,get:function(){return I}}),Object.defineProperty(s,"infoOnce",{enumerable:!0,get:function(){return _}}),Object.defineProperty(s,"resetWarnings",{enumerable:!0,get:function(){return U}}),Object.defineProperty(s,"fail",{enumerable:!0,get:function(){return C}}),Object.defineProperty(s,"invariant",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"DEV",{enumerable:!0,get:function(){return d}}),Object.defineProperty(s,"isObject",{enumerable:!0,get:function(){return a}}),Object.defineProperty(s,"isFunction",{enumerable:!0,get:function(){return u}}),Object.defineProperty(s,"isNil",{enumerable:!0,get:function(){return w}}),Object.defineProperty(s,"isBlank",{enumerable:!0,get:function(){return L}}),Object.defineProperty(s,"isCtor",{enumerable:!0,get:function(){return D}}),Object.defineProperty(s,"pathGetter",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(s,"pathSetter",{enumerable:!0,get:function(){return te}}),Object.defineProperty(s,"getPath",{enumerable:!0,get:function(){return G}}),Object.defineProperty(s,"setPath",{enumerable:!0,get:function(){return me}}),Object.defineProperty(s,"humanise",{enumerable:!0,get:function(){return x}}),Object.defineProperty(s,"escapeHtml",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(s,"titleCase",{enumerable:!0,get:function(){return T}}),Object.defineProperty(s,"expand",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(s,"toArray",{enumerable:!0,get:function(){return R}}),Object.defineProperty(s,"merge",{enumerable:!0,get:function(){return b}}),Object.defineProperty(s,"mergeRow",{enumerable:!0,get:function(){return h}}),Object.defineProperty(s,"Lru",{enumerable:!0,get:function(){return k}}),Object.defineProperty(s,"collator",{enumerable:!0,get:function(){return E}}),Object.defineProperty(s,"defaultCompare",{enumerable:!0,get:function(){return A}}),Object.defineProperty(s,"now",{enumerable:!0,get:function(){return y}}),Object.defineProperty(s,"nextFrame",{enumerable:!0,get:function(){return c}}),Object.defineProperty(s,"cancelFrame",{enumerable:!0,get:function(){return S}}),Object.defineProperty(s,"frameBatched",{enumerable:!0,get:function(){return f}}),Object.defineProperty(s,"settleDebounce",{enumerable:!0,get:function(){return e}}),Object.defineProperty(s,"whenIdle",{enumerable:!0,get:function(){return o}}),Object.defineProperty(s,"uid",{enumerable:!0,get:function(){return l}});const ye="1.81.0";async function ne(){return ye}const j="1.81.0",pe=new Set,de=2e3;function ee(n){if(pe.add(n),pe.size>de){const i=pe.values().next().value;i!==void 0&&pe.delete(i)}}const J=[],W=500;function ie(n,i,v){J.push({key:n,level:i,message:v.map(p=>typeof p=="string"?p:M(p)).join(" "),at:Date.now()}),J.length>W&&J.shift()}function M(n){if(n instanceof Error)return n.message;try{return JSON.stringify(n)}catch{return String(n)}}function m(){return J.map(n=>({...n}))}function B(n){if(n.length===0||typeof n[0]!="string")return n;const i=n[0].replace(/^\[lattice\]\s*/,"");return i===n[0]?n:[i,...n.slice(1)]}function I(n,...i){if(pe.has(n))return;ee(n);const v=B(i);ie(n,"warn",v),console.warn("[lattice]",...v)}function _(n,...i){if(pe.has(n))return;ee(n);const v=B(i);ie(n,"info",v),console.info("[lattice]",...v)}function U(){pe.clear(),J.length=0}function C(n,i){const v=new Error(`[lattice] ${n}`);throw i!==void 0&&(v.cause=i),v}function N(n,i){n||C(i)}const d=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function a(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function u(n){return typeof n=="function"}function w(n){return n==null}function L(n){return n==null||n===""}function D(n){return typeof n!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(n))?!0:!!(n.prototype&&Object.getOwnPropertyNames(n.prototype).length>1)}const F=new Map;function Z(n){let i=F.get(n);if(i)return i;if(!n.includes("."))i=v=>v?.[n];else{const v=n.split("."),p=v.length;i=$=>{let q=$;for(let se=0;se<p;se++){if(q==null)return;q=q[v[se]]}return q}}return F.set(n,i),i}const re=new Map;function te(n){let i=re.get(n);if(i)return i;if(!n.includes("."))i=(v,p)=>{v!=null&&(v[n]=p)};else{const v=n.split("."),p=v.length-1;i=($,q)=>{let se=$;for(let he=0;he<p;he++){if(se==null)return;const ke=v[he];se[ke]==null&&(se[ke]={}),se=se[ke]}se!=null&&(se[v[p]]=q)}}return re.set(n,i),i}function G(n,i){return Z(i)(n)}function me(n,i,v){te(i)(n,v)}function x(n){return n?(n.includes(".")?n.slice(n.lastIndexOf(".")+1):n).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,v=>v.toUpperCase()):""}const Q={"&":"&","<":"<",">":">",'"':""","'":"'"};function ae(n){const i=n==null?"":String(n);return/[&<>"']/.test(i)?i.replace(/[&<>"']/g,v=>Q[v]):i}function T(n){return String(n).replace(/\w\S*/g,i=>i[0].toUpperCase()+i.slice(1).toLowerCase())}function Y(n,i,v){if(n!==void 0)return n===!0?{enabled:!0,...v}:n===!1?{enabled:!1}:a(n)?n:{[i]:n,enabled:!0}}function R(n){return n==null?[]:Array.isArray(n)?n:[n]}const g=Object.freeze(new Set(["__proto__","constructor","prototype"]));function b(n,i){if(!a(n))return a(i)?{...i}:i;if(!a(i))return i===void 0?n:i;const v={...n};for(const p of Object.keys(i)){if(g.has(p))continue;const $=i[p];$!==void 0&&(v[p]=a($)&&a(v[p])?b(v[p],$):$)}return v}function h(n,i){if(!a(n)||!a(i)||n===i)return i;const v=Object.create(Object.getPrototypeOf(n));return Object.assign(v,n,i),v}class k{#r;#n=new Map;#l;constructor(i=256,v=null){this.#r=i,this.#l=v}get size(){return this.#n.size}get max(){return this.#r}set max(i){this.#r=i,this.#e()}has(i){return this.#n.has(i)}get(i){const v=this.#n;if(!v.has(i))return;const p=v.get(i);return v.delete(i),v.set(i,p),p}peek(i){return this.#n.get(i)}set(i,v){const p=this.#n;return p.has(i)&&p.delete(i),p.set(i,v),this.#e(),v}delete(i){const v=this.#n.get(i);return this.#n.delete(i)&&this.#l&&this.#l(v,i),v}clear(){if(this.#l)for(const[i,v]of this.#n)this.#l(v,i);this.#n.clear()}keys(){return this.#n.keys()}values(){return this.#n.values()}#e(){const i=this.#n;for(;i.size>this.#r;){const v=i.keys().next().value,p=i.get(v);i.delete(v),this.#l&&this.#l(p,v)}}}const z=new Map;function E(n,i){const v=`${n||""}|${i?JSON.stringify(i):""}`;let p=z.get(v);return p||(p=new Intl.Collator(n||void 0,{numeric:!0,sensitivity:"variant",...i}),z.set(v,p)),p}function A(n,i){if(n===i)return 0;if(n==null)return 1;if(i==null)return-1;if(typeof n=="number"&&typeof i=="number")return Number.isNaN(n)?Number.isNaN(i)?0:1:Number.isNaN(i)||n<i?-1:n>i?1:0;const v=String(n),p=String(i);return v<p?-1:v>p?1:0}function y(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const r=typeof requestAnimationFrame=="function";function c(n){return r?requestAnimationFrame(n):setTimeout(()=>n(y()),16)}function S(n){n!=null&&(r?cancelAnimationFrame(n):clearTimeout(n))}function f(n){let i=null,v=null;const p=()=>{i=null;const q=v;v=null,n(...q||[])},$=(...q)=>{v=q,i===null&&(i=c(p))};return $.cancel=()=>{S(i),i=null,v=null},$.flush=()=>{i!==null&&(S(i),p())},$}function e(n,i){let v=null,p=null;const $=()=>{if(v=null,p===null)return;const he=p;p=null,n(...he),q()},q=()=>{v=setTimeout($,i),typeof v?.unref=="function"&&v.unref()},se=(...he)=>{v===null?(n(...he),q()):(p=he,clearTimeout(v),q())};return se.flush=()=>{if(v!==null&&clearTimeout(v),v=null,p===null)return;const he=p;p=null,n(...he)},se.cancel=()=>{v!==null&&clearTimeout(v),v=null,p=null},se.pending=()=>v!==null||p!==null,se}function o(n,i=50){return typeof requestIdleCallback=="function"?requestIdleCallback(n,{timeout:i}):setTimeout(()=>n({timeRemaining:()=>0,didTimeout:!0}),1)}let t=0;function l(n="l"){return`${n}${(++t).toString(36)}`}}),it("packages/modules/charts/scheme.js",function(s,X){"use strict";Object.defineProperty(s,"PALETTE",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"SCHEMES",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(s,"registerScheme",{enumerable:!0,get:function(){return J}}),Object.defineProperty(s,"setDefaultScheme",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"schemeNames",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"resolveScheme",{enumerable:!0,get:function(){return I}}),Object.defineProperty(s,"RAMP_SCALES",{enumerable:!0,get:function(){return _}}),Object.defineProperty(s,"toRgb",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"rampStops",{enumerable:!0,get:function(){return d}});const ne=X("packages/core/src/internal/util.js").warnOnce,j=Object.freeze(["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#7a5195","#6b7d8c"]),pe=Object.freeze({default:{series:j,sequential:["#ecf3f9","#005280"],diverging:["#b04a00","#f7f7f7","#005280"],positive:"#009e73",negative:"#d55e00"},bright:{series:["#1f77d0","#ff7f0e","#2ca02c","#d62728","#9467bd","#17becf","#e377c2","#7f7f7f"],sequential:["#eef4fb","#1f77d0"],diverging:["#d62728","#f7f7f7","#1f77d0"],positive:"#2ca02c",negative:"#d62728"},earth:{series:["#5b7c6f","#c08b52","#7a6a53","#a4553f","#4e6a83","#8f8259","#6d5566","#8c9196"],sequential:["#f2efe9","#4e6a83"],diverging:["#a4553f","#f2efe9","#4e6a83"],positive:"#5b7c6f",negative:"#a4553f"},mono:{series:["#0b2a3d","#17475f","#2c6480","#4a82a0","#6da0bd","#94bcd6","#bcd7e9","#dfecf5"],sequential:["#eef3f7","#0b2a3d"],diverging:["#7a5c00","#f5f5f5","#0b2a3d"],positive:"#17475f",negative:"#7a5c00"}}),de=new Map;let ee="default";function J(a,u){!a||!u||de.set(String(a),u)}function W(a){if(typeof a=="string"){ee=a;return}a&&typeof a=="object"&&(de.set("__default__",a),ee="__default__")}function ie(){return[...Object.keys(pe),...de.keys()].filter(a=>!a.startsWith("__"))}function M(a){return de.has(a)?de.get(a):pe[a]||null}const m=["series","sequential","diverging","positive","negative"];function B(a){return!a||typeof a!="object"||Array.isArray(a)?!1:!m.some(u=>u in a)}function I(a){const u=M(ee)||pe.default,w=a&&a.scheme,L=B(w)?w:null,D=typeof w=="string"?M(w):L?null:w||null,F=a&&Array.isArray(a.palette)&&a.palette.length?a.palette:null;L&&F&&ne("chart:scheme:array-and-map",'chart "scheme" was given as a name map together with a "palette" array; the two do not combine. Colours came from the map and the array was ignored. Pass one or the other.');const Z=L?null:F,re={...pe.default,...u,...D||{}};Z&&(re.series=Z);const te=a&&a.ramp&&typeof a.ramp=="object"&&!Array.isArray(a.ramp)?a.ramp:null,G=te?te.colours:a&&a.ramp,me=Array.isArray(G)&&G.length>=2?G:null;me&&(re.sequential=me);const x=te?U(te.scale):null,Q=!!(D||Z||L),ae=re.series&&re.series.length?re.series:j,T=new Map;let Y=0;return{...re,series:(g,b)=>{if(L&&b!==void 0&&b!==null){const h=String(b);return Object.prototype.hasOwnProperty.call(L,h)?L[h]:(T.has(h)||T.set(h,Y++),C(ae,T.get(h),!0))}return C(ae,g,Q)},explicit:Q,nameMap:!!L,rampScale:x}}const _=Object.freeze(["linear","log","quantile"]);function U(a){return a==null?null:_.includes(a)?a:(ne(`chart:ramp:scale:${String(a)}`,`chart "ramp.scale" was "${String(a)}", which is not a ramp scale; the chart chose one from its values instead. Use "linear", "log" or "quantile".`),null)}function C(a,u,w){const L=(u%a.length+a.length)%a.length;return w?a[L]:`var(--lattice-chart-${L+1}, ${a[L]})`}function N(a){if(typeof a!="string")return null;const u=a.trim(),w=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(u);if(w){const F=w[1];return F.length===3?[0,1,2].map(Z=>parseInt(F[Z]+F[Z],16)):[0,2,4].map(Z=>parseInt(F.slice(Z,Z+2),16))}const L=/^rgba?\(([^)]+)\)$/i.exec(u);if(!L)return null;const D=L[1].split(/[\s,/]+/).filter(Boolean).slice(0,3).map(Number);return D.length===3&&D.every(F=>Number.isFinite(F))?D:null}function d(a,u){const w=u?a.diverging:a.sequential,L=u?pe.default.diverging:pe.default.sequential,D=(Array.isArray(w)?w:L).map((F,Z)=>N(F)||N(L[Z])||[0,0,0]);return D.length>=2?D:L.map(F=>N(F))}}),it("packages/modules/charts/styles.js",function(s,X){"use strict";Object.defineProperty(s,"NS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"seriesColour",{enumerable:!0,get:function(){return de}}),Object.defineProperty(s,"css",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(s,"injectStyles",{enumerable:!0,get:function(){return J}});const ne=X("packages/modules/charts/scheme.js").PALETTE,j="lat-chartview",pe="data-lattice-chartview";function de(W){const ie=(W%ne.length+ne.length)%ne.length;return`var(--lattice-chart-${ie+1}, ${ne[ie]})`}function ee(){return`
|
|
7
7
|
.${j}{position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;
|
|
8
8
|
width:100%;height:100%;box-sizing:border-box;
|
|
9
9
|
font-family:var(--lattice-font-family,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif);
|
package/modules/dashboard.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.
|
|
2
|
+
* Lattice Grid 1.81.0, dashboard module
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
6
|
-
var De=Object.create(null),Le=Object.create(null);function Pe(m,x){De[m]=x}function Me(m){var x=Le[m];if(x)return x;var T=Object.create(null);Le[m]=T;var C=De[m];if(!C)throw new Error("[lattice] missing module: "+m);return C(T,Me),T}Pe("packages/core/src/internal/util.js",function(m,x){"use strict";Object.defineProperty(m,"VERSION",{enumerable:!0,get:function(){return A}}),Object.defineProperty(m,"reportedWarnings",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(m,"warnOnce",{enumerable:!0,get:function(){return E}}),Object.defineProperty(m,"infoOnce",{enumerable:!0,get:function(){return w}}),Object.defineProperty(m,"resetWarnings",{enumerable:!0,get:function(){return $}}),Object.defineProperty(m,"fail",{enumerable:!0,get:function(){return u}}),Object.defineProperty(m,"invariant",{enumerable:!0,get:function(){return f}}),Object.defineProperty(m,"DEV",{enumerable:!0,get:function(){return z}}),Object.defineProperty(m,"isObject",{enumerable:!0,get:function(){return L}}),Object.defineProperty(m,"isFunction",{enumerable:!0,get:function(){return O}}),Object.defineProperty(m,"isNil",{enumerable:!0,get:function(){return B}}),Object.defineProperty(m,"isBlank",{enumerable:!0,get:function(){return M}}),Object.defineProperty(m,"isCtor",{enumerable:!0,get:function(){return N}}),Object.defineProperty(m,"pathGetter",{enumerable:!0,get:function(){return R}}),Object.defineProperty(m,"pathSetter",{enumerable:!0,get:function(){return o}}),Object.defineProperty(m,"getPath",{enumerable:!0,get:function(){return d}}),Object.defineProperty(m,"setPath",{enumerable:!0,get:function(){return s}}),Object.defineProperty(m,"humanise",{enumerable:!0,get:function(){return a}}),Object.defineProperty(m,"escapeHtml",{enumerable:!0,get:function(){return b}}),Object.defineProperty(m,"titleCase",{enumerable:!0,get:function(){return K}}),Object.defineProperty(m,"expand",{enumerable:!0,get:function(){return te}}),Object.defineProperty(m,"toArray",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(m,"merge",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(m,"mergeRow",{enumerable:!0,get:function(){return we}}),Object.defineProperty(m,"Lru",{enumerable:!0,get:function(){return H}}),Object.defineProperty(m,"collator",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(m,"defaultCompare",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(m,"now",{enumerable:!0,get:function(){return he}}),Object.defineProperty(m,"nextFrame",{enumerable:!0,get:function(){return me}}),Object.defineProperty(m,"cancelFrame",{enumerable:!0,get:function(){return le}}),Object.defineProperty(m,"frameBatched",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(m,"settleDebounce",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(m,"whenIdle",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(m,"uid",{enumerable:!0,get:function(){return Re}});const T="1.80.0";async function C(){return T}const A="1.80.0",F=new Set,de=2e3;function _(t){if(F.add(t),F.size>de){const n=F.values().next().value;n!==void 0&&F.delete(n)}}const W=[],ie=500;function v(t,n,i){W.push({key:t,level:n,message:i.map(k=>typeof k=="string"?k:ee(k)).join(" "),at:Date.now()}),W.length>ie&&W.shift()}function ee(t){if(t instanceof Error)return t.message;try{return JSON.stringify(t)}catch{return String(t)}}function ue(){return W.map(t=>({...t}))}function re(t){if(t.length===0||typeof t[0]!="string")return t;const n=t[0].replace(/^\[lattice\]\s*/,"");return n===t[0]?t:[n,...t.slice(1)]}function E(t,...n){if(F.has(t))return;_(t);const i=re(n);v(t,"warn",i),console.warn("[lattice]",...i)}function w(t,...n){if(F.has(t))return;_(t);const i=re(n);v(t,"info",i),console.info("[lattice]",...i)}function $(){F.clear(),W.length=0}function u(t,n){const i=new Error(`[lattice] ${t}`);throw n!==void 0&&(i.cause=n),i}function f(t,n){t||u(n)}const z=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function L(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function O(t){return typeof t=="function"}function B(t){return t==null}function M(t){return t==null||t===""}function N(t){return typeof t!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(t))?!0:!!(t.prototype&&Object.getOwnPropertyNames(t.prototype).length>1)}const S=new Map;function R(t){let n=S.get(t);if(n)return n;if(!t.includes("."))n=i=>i?.[t];else{const i=t.split("."),k=i.length;n=J=>{let U=J;for(let V=0;V<k;V++){if(U==null)return;U=U[i[V]]}return U}}return S.set(t,n),n}const D=new Map;function o(t){let n=D.get(t);if(n)return n;if(!t.includes("."))n=(i,k)=>{i!=null&&(i[t]=k)};else{const i=t.split("."),k=i.length-1;n=(J,U)=>{let V=J;for(let Q=0;Q<k;Q++){if(V==null)return;const ge=i[Q];V[ge]==null&&(V[ge]={}),V=V[ge]}V!=null&&(V[i[k]]=U)}}return D.set(t,n),n}function d(t,n){return R(n)(t)}function s(t,n,i){o(n)(t,i)}function a(t){return t?(t.includes(".")?t.slice(t.lastIndexOf(".")+1):t).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,i=>i.toUpperCase()):""}const g={"&":"&","<":"<",">":">",'"':""","'":"'"};function b(t){const n=t==null?"":String(t);return/[&<>"']/.test(n)?n.replace(/[&<>"']/g,i=>g[i]):n}function K(t){return String(t).replace(/\w\S*/g,n=>n[0].toUpperCase()+n.slice(1).toLowerCase())}function te(t,n,i){if(t!==void 0)return t===!0?{enabled:!0,...i}:t===!1?{enabled:!1}:L(t)?t:{[n]:t,enabled:!0}}function oe(t){return t==null?[]:Array.isArray(t)?t:[t]}const ke=Object.freeze(new Set(["__proto__","constructor","prototype"]));function pe(t,n){if(!L(t))return L(n)?{...n}:n;if(!L(n))return n===void 0?t:n;const i={...t};for(const k of Object.keys(n)){if(ke.has(k))continue;const J=n[k];J!==void 0&&(i[k]=L(J)&&L(i[k])?pe(i[k],J):J)}return i}function we(t,n){if(!L(t)||!L(n)||t===n)return n;const i=Object.create(Object.getPrototypeOf(t));return Object.assign(i,t,n),i}class H{#n;#e=new Map;#t;constructor(n=256,i=null){this.#n=n,this.#t=i}get size(){return this.#e.size}get max(){return this.#n}set max(n){this.#n=n,this.#r()}has(n){return this.#e.has(n)}get(n){const i=this.#e;if(!i.has(n))return;const k=i.get(n);return i.delete(n),i.set(n,k),k}peek(n){return this.#e.get(n)}set(n,i){const k=this.#e;return k.has(n)&&k.delete(n),k.set(n,i),this.#r(),i}delete(n){const i=this.#e.get(n);return this.#e.delete(n)&&this.#t&&this.#t(i,n),i}clear(){if(this.#t)for(const[n,i]of this.#e)this.#t(i,n);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const n=this.#e;for(;n.size>this.#n;){const i=n.keys().next().value,k=n.get(i);n.delete(i),this.#t&&this.#t(k,i)}}}const ce=new Map;function Ae(t,n){const i=`${t||""}|${n?JSON.stringify(n):""}`;let k=ce.get(i);return k||(k=new Intl.Collator(t||void 0,{numeric:!0,sensitivity:"variant",...n}),ce.set(i,k)),k}function ne(t,n){if(t===n)return 0;if(t==null)return 1;if(n==null)return-1;if(typeof t=="number"&&typeof n=="number")return Number.isNaN(t)?Number.isNaN(n)?0:1:Number.isNaN(n)||t<n?-1:t>n?1:0;const i=String(t),k=String(n);return i<k?-1:i>k?1:0}function he(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const $e=typeof requestAnimationFrame=="function";function me(t){return $e?requestAnimationFrame(t):setTimeout(()=>t(he()),16)}function le(t){t!=null&&($e?cancelAnimationFrame(t):clearTimeout(t))}function ve(t){let n=null,i=null;const k=()=>{n=null;const U=i;i=null,t(...U||[])},J=(...U)=>{i=U,n===null&&(n=me(k))};return J.cancel=()=>{le(n),n=null,i=null},J.flush=()=>{n!==null&&(le(n),k())},J}function Oe(t,n){let i=null,k=null;const J=()=>{if(i=null,k===null)return;const Q=k;k=null,t(...Q),U()},U=()=>{i=setTimeout(J,n),typeof i?.unref=="function"&&i.unref()},V=(...Q)=>{i===null?(t(...Q),U()):(k=Q,clearTimeout(i),U())};return V.flush=()=>{if(i!==null&&clearTimeout(i),i=null,k===null)return;const Q=k;k=null,t(...Q)},V.cancel=()=>{i!==null&&clearTimeout(i),i=null,k=null},V.pending=()=>i!==null||k!==null,V}function Ne(t,n=50){return typeof requestIdleCallback=="function"?requestIdleCallback(t,{timeout:n}):setTimeout(()=>t({timeRemaining:()=>0,didTimeout:!0}),1)}let je=0;function Re(t="l"){return`${t}${(++je).toString(36)}`}}),Pe("packages/modules/dashboard/spec.js",function(m,x){"use strict";Object.defineProperty(m,"PANEL_KINDS",{enumerable:!0,get:function(){return T}}),Object.defineProperty(m,"SOURCE_KINDS",{enumerable:!0,get:function(){return C}}),Object.defineProperty(m,"MAP_BINDINGS",{enumerable:!0,get:function(){return A}}),Object.defineProperty(m,"GRID_REF",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(m,"isPlain",{enumerable:!0,get:function(){return v}}),Object.defineProperty(m,"copySpec",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(m,"sameSpec",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(m,"parseSourceRef",{enumerable:!0,get:function(){return re}}),Object.defineProperty(m,"readRelation",{enumerable:!0,get:function(){return E}}),Object.defineProperty(m,"inspectSpec",{enumerable:!0,get:function(){return w}}),Object.defineProperty(m,"validateDashboardSpec",{enumerable:!0,get:function(){return $}});const T=Object.freeze(["grid","chart","kpi","map","html"]),C=Object.freeze(["rows","pushdown","router","grid"]),A=Object.freeze(["chart","leaflet","deckgl"]),F=Object.freeze(["layout","panels","sources","links"]),de=Object.freeze(["id","kind","title","source","options","binding"]),_=Object.freeze(["from","to","on"]),W=Object.freeze({rows:["kind","rows","columns","rowKey"],router:["kind","router","predicate","route","columns","rowKey"],grid:["kind","of"]}),ie="grid:";function v(u){if(!u||typeof u!="object"||Array.isArray(u))return!1;const f=Object.getPrototypeOf(u);return f===Object.prototype||f===null}function ee(u,f){if(f==="rows"&&Array.isArray(u))return u;if(Array.isArray(u))return u.map(L=>ee(L));if(!v(u)||Object.values(u).some(L=>typeof L=="function"))return u;const z={};for(const[L,O]of Object.entries(u))O!==void 0&&(z[L]=ee(O,L));return z}function ue(u,f){if(u===f)return!0;if(Array.isArray(u)||Array.isArray(f))return!Array.isArray(u)||!Array.isArray(f)||u.length!==f.length?!1:u.every((O,B)=>ue(O,f[B]));if(!v(u)||!v(f))return!1;const z=Object.keys(u).filter(O=>u[O]!==void 0),L=Object.keys(f).filter(O=>f[O]!==void 0);return z.length!==L.length?!1:z.every(O=>ue(u[O],f[O]))}function re(u){return typeof u!="string"||u===""?null:u.startsWith(ie)?{kind:"grid",of:u.slice(ie.length)}:{kind:"named",id:u}}function E(u){return typeof u=="string"&&u!==""?{from:u,to:u}:typeof u=="function"?u:v(u)&&typeof u.from=="string"&&u.from!==""&&typeof u.to=="string"&&u.to!==""?{from:u.from,to:u.to}:null}function w(u){const f=[],z=new Set,L=new Set,O=new Set,B=new Set,M={fatal:null,problems:f,badPanels:z,badSources:L,badLinks:O,badWindows:B};if(!v(u))return M.fatal="the spec is not an object",f.push({path:"",message:"is not an object: a spec is { layout, panels, sources, links }"}),M;const N=u;if(!Array.isArray(N.panels))return M.fatal="spec.panels is not an array",f.push({path:"panels",message:"is not an array of panels"}),M;for(const o of Object.keys(N))F.includes(o)||f.push({path:o,message:`is not a dashboard spec key (${F.join(", ")})`});const S=new Map;N.panels.forEach((o,d)=>{const s=`panels[${d}]`;if(!v(o)){z.add(d),f.push({path:s,message:"is not an object"});return}if(typeof o.id!="string"||o.id===""){z.add(d),f.push({path:`${s}.id`,message:"is missing: every panel needs a unique string id"});return}if(S.has(o.id)){z.add(d),f.push({path:`${s}.id`,panel:o.id,message:`repeats "${o.id}", which panels[${S.get(o.id).index}] already uses`});return}S.set(o.id,{index:d,kind:o.kind})});const R=N.sources===void 0?{}:N.sources;if(!v(R))f.push({path:"sources",message:"is not an object of named sources"});else for(const[o,d]of Object.entries(R)){const s=`sources.${o}`,a=(b,K)=>{L.add(o),f.push({path:b,message:K})};if(!v(d)){a(s,"is not an object");continue}if(!C.includes(d.kind)){a(`${s}.kind`,`names no source kind (${C.join(", ")})`);continue}const g=W[d.kind];if(g)for(const b of Object.keys(d))g.includes(b)||f.push({path:`${s}.${b}`,message:`is not a key of a ${d.kind} source (${g.join(", ")})`});if(d.columns!==void 0&&!Array.isArray(d.columns)&&a(`${s}.columns`,"is not an array of columns"),d.kind==="rows"&&!Array.isArray(d.rows)&&a(`${s}.rows`,"is not an array of rows"),d.kind==="pushdown"&&!(d.adapter&&typeof d.adapter.execute=="function")&&a(`${s}.adapter`,"is not a pushdown adapter (an object with execute())"),d.kind==="router"&&(d.router&&typeof d.router.attach=="function"||a(`${s}.router`,"is not a Data Router (an object with attach())"),d.predicate===void 0&&a(`${s}.predicate`,"is missing: name the partition value or predicate the route matches")),d.kind==="grid"){const b=typeof d.of=="string"?S.get(d.of):void 0;b?b.kind!=="grid"&&a(`${s}.of`,`names "${d.of}", a ${b.kind} panel: only a grid panel has a grid to view`):a(`${s}.of`,"names no panel")}}const D=new Map;N.panels.forEach((o,d)=>{if(z.has(d))return;const s=`panels[${d}]`,a=(K,te)=>{z.add(d),f.push({path:K,panel:o.id,message:te})};for(const K of Object.keys(o))de.includes(K)||f.push({path:`${s}.${K}`,panel:o.id,message:`is not a panel key (${de.join(", ")}); a viewer's own settings go in options`});if(!T.includes(o.kind)){a(`${s}.kind`,`names no panel kind (${T.join(", ")})`);return}if(o.title!==void 0&&typeof o.title!="string"&&f.push({path:`${s}.title`,panel:o.id,message:"is not a string"}),o.options!==void 0&&!v(o.options)){a(`${s}.options`,"is not an object");return}if(o.binding!==void 0&&(o.kind!=="map"?a(`${s}.binding`,`is only read on a map panel, and this is a ${o.kind} panel`):A.includes(o.binding)||a(`${s}.binding`,`names no map binding (${A.join(", ")})`)),o.source===void 0){(o.kind==="chart"||o.kind==="map")&&a(`${s}.source`,`is missing: a ${o.kind} panel draws a source's rows`);return}if(o.kind==="html"){a(`${s}.source`,"is set on an html panel, which reads no rows");return}const g=re(o.source);if(!g){a(`${s}.source`,"is not a source id");return}let b=null;if(g.kind==="grid")b=g.of;else if(!v(R)||!Object.hasOwn(R,g.id)){a(`${s}.source`,`names "${g.id}", which is not in sources`);return}else if(L.has(g.id)){a(`${s}.source`,`names "${g.id}", a source that is not usable`);return}else R[g.id].kind==="grid"&&(b=R[g.id].of);if(b!==null){const K=S.get(b);if(!K){a(`${s}.source`,`views the grid of "${b}", which is not a panel`);return}if(K.kind!=="grid"){a(`${s}.source`,`views the grid of "${b}", a ${K.kind} panel`);return}if(b===o.id){a(`${s}.source`,"views its own grid");return}D.set(o.id,b)}});for(let o=!0;o;)o=!1,N.panels.forEach((d,s)=>{if(z.has(s)||!D.has(d.id))return;const a=new Set([d.id]);let g=D.get(d.id);for(;g!==void 0;){const b=S.get(g);if(a.has(g)){z.add(s),f.push({path:`panels[${s}].source`,panel:d.id,message:`is part of a cycle of panels viewing each other's grids (${[...a,g].join(" -> ")})`}),o=!0;return}if(!b||z.has(b.index)){z.add(s),f.push({path:`panels[${s}].source`,panel:d.id,message:`views the grid of "${g}", a panel that was not built`}),o=!0;return}a.add(g),g=D.get(g)}});if(N.links!==void 0&&!Array.isArray(N.links)?f.push({path:"links",message:"is not an array of links"}):(N.links||[]).forEach((o,d)=>{const s=`links[${d}]`,a=(g,b)=>{O.add(d),f.push({path:g,link:d,message:b})};if(!v(o)){a(s,"is not an object");return}for(const g of Object.keys(o))_.includes(g)||f.push({path:`${s}.${g}`,link:d,message:`is not a link key (${_.join(", ")})`});if(typeof o.from!="string"||!S.has(o.from)){a(`${s}.from`,"names no panel");return}if(typeof o.to!="string"||!S.has(o.to)){a(`${s}.to`,"names no panel");return}if(o.from===o.to){a(`${s}.to`,"is the panel the link starts from");return}E(o.on)||a(`${s}.on`,"is not a column name, a { from, to } pair of column names, or a relation function")}),N.layout!==void 0){if(!v(N.layout))f.push({path:"layout",message:"is not an object"});else if(N.layout.windows!==void 0)if(!Array.isArray(N.layout.windows))f.push({path:"layout.windows",message:"is not an array of windows"});else{const o=new Set;N.layout.windows.forEach((d,s)=>{const a=`layout.windows[${s}]`;!v(d)||typeof d.id!="string"?(B.add(s),f.push({path:a,message:"is not a window with a string id"})):S.has(d.id)?o.has(d.id)?(B.add(s),f.push({path:`${a}.id`,message:`places "${d.id}" a second time`})):o.add(d.id):(B.add(s),f.push({path:`${a}.id`,message:`names "${d.id}", which is not a panel`}))})}}return M}function $(u){const{problems:f}=w(u);return{ok:f.length===0,problems:f.map(({path:z,message:L})=>({path:z,message:L}))}}}),Pe("packages/modules/dashboard/propose.js",function(m,x){"use strict";Object.defineProperty(m,"PROPOSE_SYSTEM",{enumerable:!0,get:function(){return _}}),Object.defineProperty(m,"columnRefs",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(m,"proposalRequest",{enumerable:!0,get:function(){return v}}),Object.defineProperty(m,"parseProposal",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(m,"checkProposal",{enumerable:!0,get:function(){return re}});const T=x("packages/modules/dashboard/spec.js"),C=T.inspectSpec,A=T.isPlain,F=T.copySpec,de=T.parseSourceRef,_=["You design dashboards for a data grid. Return ONLY a JSON object of the form",'{ "layout": { "columns": <n>, "rows": <n> }, "panels": [ { "id": "<id>", "kind": "<kind>",','"title": "<title>", "source": "<source id>", "binding": "chart", "options": { ... } } ],','"links": [ { "from": "<grid panel id>", "to": "<panel id>", "on": "<column>" } ] }.',"Use only the panel kinds and the columns listed in SCHEMA, and only the source it names.","A chart panel's options are a chart spec (type, x, y, series); a kpi panel's are",'{ tiles: [ { id, field, aggregation } ] }; a map panel with binding "chart" takes a map chart',`spec (type "markermap", lon, lat); a grid panel's are { columns: [ { field } ] }.`,"A person reviews the proposal before anything is built."].join(" "),W=Object.freeze(["x","y","series","measure","size","value","volume","lon","lat","geometry","label","start","end","source","target","multiples"]);function ie(E){const w=new Set,$=A(E.options)?E.options:{},u=f=>{typeof f=="string"&&f!==""&&w.add(f)};if(E.kind==="grid")for(const f of Array.isArray($.columns)?$.columns:[])A(f)&&u(f.field);else if(E.kind==="kpi"){for(const f of Array.isArray($.tiles)?$.tiles:[])A(f)&&u(f.field);for(const f of Array.isArray($.fields)?$.fields:[])u(f)}else if(E.kind==="chart"||E.kind==="map"&&(E.binding||"chart")==="chart")for(const f of W)u($[f]);else E.kind==="map"&&A($.position)&&(u($.position.lon),u($.position.lat),u($.position.geometry));return[...w]}function v(E,w){const $={source:w.source,columns:w.columns,kinds:w.kinds};let u=`${E}
|
|
6
|
+
var De=Object.create(null),Le=Object.create(null);function Pe(m,x){De[m]=x}function Me(m){var x=Le[m];if(x)return x;var T=Object.create(null);Le[m]=T;var C=De[m];if(!C)throw new Error("[lattice] missing module: "+m);return C(T,Me),T}Pe("packages/core/src/internal/util.js",function(m,x){"use strict";Object.defineProperty(m,"VERSION",{enumerable:!0,get:function(){return A}}),Object.defineProperty(m,"reportedWarnings",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(m,"warnOnce",{enumerable:!0,get:function(){return E}}),Object.defineProperty(m,"infoOnce",{enumerable:!0,get:function(){return w}}),Object.defineProperty(m,"resetWarnings",{enumerable:!0,get:function(){return $}}),Object.defineProperty(m,"fail",{enumerable:!0,get:function(){return u}}),Object.defineProperty(m,"invariant",{enumerable:!0,get:function(){return f}}),Object.defineProperty(m,"DEV",{enumerable:!0,get:function(){return z}}),Object.defineProperty(m,"isObject",{enumerable:!0,get:function(){return L}}),Object.defineProperty(m,"isFunction",{enumerable:!0,get:function(){return O}}),Object.defineProperty(m,"isNil",{enumerable:!0,get:function(){return B}}),Object.defineProperty(m,"isBlank",{enumerable:!0,get:function(){return M}}),Object.defineProperty(m,"isCtor",{enumerable:!0,get:function(){return N}}),Object.defineProperty(m,"pathGetter",{enumerable:!0,get:function(){return R}}),Object.defineProperty(m,"pathSetter",{enumerable:!0,get:function(){return o}}),Object.defineProperty(m,"getPath",{enumerable:!0,get:function(){return d}}),Object.defineProperty(m,"setPath",{enumerable:!0,get:function(){return s}}),Object.defineProperty(m,"humanise",{enumerable:!0,get:function(){return a}}),Object.defineProperty(m,"escapeHtml",{enumerable:!0,get:function(){return b}}),Object.defineProperty(m,"titleCase",{enumerable:!0,get:function(){return K}}),Object.defineProperty(m,"expand",{enumerable:!0,get:function(){return te}}),Object.defineProperty(m,"toArray",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(m,"merge",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(m,"mergeRow",{enumerable:!0,get:function(){return we}}),Object.defineProperty(m,"Lru",{enumerable:!0,get:function(){return H}}),Object.defineProperty(m,"collator",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(m,"defaultCompare",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(m,"now",{enumerable:!0,get:function(){return he}}),Object.defineProperty(m,"nextFrame",{enumerable:!0,get:function(){return me}}),Object.defineProperty(m,"cancelFrame",{enumerable:!0,get:function(){return le}}),Object.defineProperty(m,"frameBatched",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(m,"settleDebounce",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(m,"whenIdle",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(m,"uid",{enumerable:!0,get:function(){return Re}});const T="1.81.0";async function C(){return T}const A="1.81.0",F=new Set,de=2e3;function _(t){if(F.add(t),F.size>de){const n=F.values().next().value;n!==void 0&&F.delete(n)}}const W=[],ie=500;function v(t,n,i){W.push({key:t,level:n,message:i.map(k=>typeof k=="string"?k:ee(k)).join(" "),at:Date.now()}),W.length>ie&&W.shift()}function ee(t){if(t instanceof Error)return t.message;try{return JSON.stringify(t)}catch{return String(t)}}function ue(){return W.map(t=>({...t}))}function re(t){if(t.length===0||typeof t[0]!="string")return t;const n=t[0].replace(/^\[lattice\]\s*/,"");return n===t[0]?t:[n,...t.slice(1)]}function E(t,...n){if(F.has(t))return;_(t);const i=re(n);v(t,"warn",i),console.warn("[lattice]",...i)}function w(t,...n){if(F.has(t))return;_(t);const i=re(n);v(t,"info",i),console.info("[lattice]",...i)}function $(){F.clear(),W.length=0}function u(t,n){const i=new Error(`[lattice] ${t}`);throw n!==void 0&&(i.cause=n),i}function f(t,n){t||u(n)}const z=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function L(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function O(t){return typeof t=="function"}function B(t){return t==null}function M(t){return t==null||t===""}function N(t){return typeof t!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(t))?!0:!!(t.prototype&&Object.getOwnPropertyNames(t.prototype).length>1)}const S=new Map;function R(t){let n=S.get(t);if(n)return n;if(!t.includes("."))n=i=>i?.[t];else{const i=t.split("."),k=i.length;n=J=>{let U=J;for(let V=0;V<k;V++){if(U==null)return;U=U[i[V]]}return U}}return S.set(t,n),n}const D=new Map;function o(t){let n=D.get(t);if(n)return n;if(!t.includes("."))n=(i,k)=>{i!=null&&(i[t]=k)};else{const i=t.split("."),k=i.length-1;n=(J,U)=>{let V=J;for(let Q=0;Q<k;Q++){if(V==null)return;const ge=i[Q];V[ge]==null&&(V[ge]={}),V=V[ge]}V!=null&&(V[i[k]]=U)}}return D.set(t,n),n}function d(t,n){return R(n)(t)}function s(t,n,i){o(n)(t,i)}function a(t){return t?(t.includes(".")?t.slice(t.lastIndexOf(".")+1):t).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,i=>i.toUpperCase()):""}const g={"&":"&","<":"<",">":">",'"':""","'":"'"};function b(t){const n=t==null?"":String(t);return/[&<>"']/.test(n)?n.replace(/[&<>"']/g,i=>g[i]):n}function K(t){return String(t).replace(/\w\S*/g,n=>n[0].toUpperCase()+n.slice(1).toLowerCase())}function te(t,n,i){if(t!==void 0)return t===!0?{enabled:!0,...i}:t===!1?{enabled:!1}:L(t)?t:{[n]:t,enabled:!0}}function oe(t){return t==null?[]:Array.isArray(t)?t:[t]}const ke=Object.freeze(new Set(["__proto__","constructor","prototype"]));function pe(t,n){if(!L(t))return L(n)?{...n}:n;if(!L(n))return n===void 0?t:n;const i={...t};for(const k of Object.keys(n)){if(ke.has(k))continue;const J=n[k];J!==void 0&&(i[k]=L(J)&&L(i[k])?pe(i[k],J):J)}return i}function we(t,n){if(!L(t)||!L(n)||t===n)return n;const i=Object.create(Object.getPrototypeOf(t));return Object.assign(i,t,n),i}class H{#n;#e=new Map;#t;constructor(n=256,i=null){this.#n=n,this.#t=i}get size(){return this.#e.size}get max(){return this.#n}set max(n){this.#n=n,this.#r()}has(n){return this.#e.has(n)}get(n){const i=this.#e;if(!i.has(n))return;const k=i.get(n);return i.delete(n),i.set(n,k),k}peek(n){return this.#e.get(n)}set(n,i){const k=this.#e;return k.has(n)&&k.delete(n),k.set(n,i),this.#r(),i}delete(n){const i=this.#e.get(n);return this.#e.delete(n)&&this.#t&&this.#t(i,n),i}clear(){if(this.#t)for(const[n,i]of this.#e)this.#t(i,n);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const n=this.#e;for(;n.size>this.#n;){const i=n.keys().next().value,k=n.get(i);n.delete(i),this.#t&&this.#t(k,i)}}}const ce=new Map;function Ae(t,n){const i=`${t||""}|${n?JSON.stringify(n):""}`;let k=ce.get(i);return k||(k=new Intl.Collator(t||void 0,{numeric:!0,sensitivity:"variant",...n}),ce.set(i,k)),k}function ne(t,n){if(t===n)return 0;if(t==null)return 1;if(n==null)return-1;if(typeof t=="number"&&typeof n=="number")return Number.isNaN(t)?Number.isNaN(n)?0:1:Number.isNaN(n)||t<n?-1:t>n?1:0;const i=String(t),k=String(n);return i<k?-1:i>k?1:0}function he(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const $e=typeof requestAnimationFrame=="function";function me(t){return $e?requestAnimationFrame(t):setTimeout(()=>t(he()),16)}function le(t){t!=null&&($e?cancelAnimationFrame(t):clearTimeout(t))}function ve(t){let n=null,i=null;const k=()=>{n=null;const U=i;i=null,t(...U||[])},J=(...U)=>{i=U,n===null&&(n=me(k))};return J.cancel=()=>{le(n),n=null,i=null},J.flush=()=>{n!==null&&(le(n),k())},J}function Oe(t,n){let i=null,k=null;const J=()=>{if(i=null,k===null)return;const Q=k;k=null,t(...Q),U()},U=()=>{i=setTimeout(J,n),typeof i?.unref=="function"&&i.unref()},V=(...Q)=>{i===null?(t(...Q),U()):(k=Q,clearTimeout(i),U())};return V.flush=()=>{if(i!==null&&clearTimeout(i),i=null,k===null)return;const Q=k;k=null,t(...Q)},V.cancel=()=>{i!==null&&clearTimeout(i),i=null,k=null},V.pending=()=>i!==null||k!==null,V}function Ne(t,n=50){return typeof requestIdleCallback=="function"?requestIdleCallback(t,{timeout:n}):setTimeout(()=>t({timeRemaining:()=>0,didTimeout:!0}),1)}let je=0;function Re(t="l"){return`${t}${(++je).toString(36)}`}}),Pe("packages/modules/dashboard/spec.js",function(m,x){"use strict";Object.defineProperty(m,"PANEL_KINDS",{enumerable:!0,get:function(){return T}}),Object.defineProperty(m,"SOURCE_KINDS",{enumerable:!0,get:function(){return C}}),Object.defineProperty(m,"MAP_BINDINGS",{enumerable:!0,get:function(){return A}}),Object.defineProperty(m,"GRID_REF",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(m,"isPlain",{enumerable:!0,get:function(){return v}}),Object.defineProperty(m,"copySpec",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(m,"sameSpec",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(m,"parseSourceRef",{enumerable:!0,get:function(){return re}}),Object.defineProperty(m,"readRelation",{enumerable:!0,get:function(){return E}}),Object.defineProperty(m,"inspectSpec",{enumerable:!0,get:function(){return w}}),Object.defineProperty(m,"validateDashboardSpec",{enumerable:!0,get:function(){return $}});const T=Object.freeze(["grid","chart","kpi","map","html"]),C=Object.freeze(["rows","pushdown","router","grid"]),A=Object.freeze(["chart","leaflet","deckgl"]),F=Object.freeze(["layout","panels","sources","links"]),de=Object.freeze(["id","kind","title","source","options","binding"]),_=Object.freeze(["from","to","on"]),W=Object.freeze({rows:["kind","rows","columns","rowKey"],router:["kind","router","predicate","route","columns","rowKey"],grid:["kind","of"]}),ie="grid:";function v(u){if(!u||typeof u!="object"||Array.isArray(u))return!1;const f=Object.getPrototypeOf(u);return f===Object.prototype||f===null}function ee(u,f){if(f==="rows"&&Array.isArray(u))return u;if(Array.isArray(u))return u.map(L=>ee(L));if(!v(u)||Object.values(u).some(L=>typeof L=="function"))return u;const z={};for(const[L,O]of Object.entries(u))O!==void 0&&(z[L]=ee(O,L));return z}function ue(u,f){if(u===f)return!0;if(Array.isArray(u)||Array.isArray(f))return!Array.isArray(u)||!Array.isArray(f)||u.length!==f.length?!1:u.every((O,B)=>ue(O,f[B]));if(!v(u)||!v(f))return!1;const z=Object.keys(u).filter(O=>u[O]!==void 0),L=Object.keys(f).filter(O=>f[O]!==void 0);return z.length!==L.length?!1:z.every(O=>ue(u[O],f[O]))}function re(u){return typeof u!="string"||u===""?null:u.startsWith(ie)?{kind:"grid",of:u.slice(ie.length)}:{kind:"named",id:u}}function E(u){return typeof u=="string"&&u!==""?{from:u,to:u}:typeof u=="function"?u:v(u)&&typeof u.from=="string"&&u.from!==""&&typeof u.to=="string"&&u.to!==""?{from:u.from,to:u.to}:null}function w(u){const f=[],z=new Set,L=new Set,O=new Set,B=new Set,M={fatal:null,problems:f,badPanels:z,badSources:L,badLinks:O,badWindows:B};if(!v(u))return M.fatal="the spec is not an object",f.push({path:"",message:"is not an object: a spec is { layout, panels, sources, links }"}),M;const N=u;if(!Array.isArray(N.panels))return M.fatal="spec.panels is not an array",f.push({path:"panels",message:"is not an array of panels"}),M;for(const o of Object.keys(N))F.includes(o)||f.push({path:o,message:`is not a dashboard spec key (${F.join(", ")})`});const S=new Map;N.panels.forEach((o,d)=>{const s=`panels[${d}]`;if(!v(o)){z.add(d),f.push({path:s,message:"is not an object"});return}if(typeof o.id!="string"||o.id===""){z.add(d),f.push({path:`${s}.id`,message:"is missing: every panel needs a unique string id"});return}if(S.has(o.id)){z.add(d),f.push({path:`${s}.id`,panel:o.id,message:`repeats "${o.id}", which panels[${S.get(o.id).index}] already uses`});return}S.set(o.id,{index:d,kind:o.kind})});const R=N.sources===void 0?{}:N.sources;if(!v(R))f.push({path:"sources",message:"is not an object of named sources"});else for(const[o,d]of Object.entries(R)){const s=`sources.${o}`,a=(b,K)=>{L.add(o),f.push({path:b,message:K})};if(!v(d)){a(s,"is not an object");continue}if(!C.includes(d.kind)){a(`${s}.kind`,`names no source kind (${C.join(", ")})`);continue}const g=W[d.kind];if(g)for(const b of Object.keys(d))g.includes(b)||f.push({path:`${s}.${b}`,message:`is not a key of a ${d.kind} source (${g.join(", ")})`});if(d.columns!==void 0&&!Array.isArray(d.columns)&&a(`${s}.columns`,"is not an array of columns"),d.kind==="rows"&&!Array.isArray(d.rows)&&a(`${s}.rows`,"is not an array of rows"),d.kind==="pushdown"&&!(d.adapter&&typeof d.adapter.execute=="function")&&a(`${s}.adapter`,"is not a pushdown adapter (an object with execute())"),d.kind==="router"&&(d.router&&typeof d.router.attach=="function"||a(`${s}.router`,"is not a Data Router (an object with attach())"),d.predicate===void 0&&a(`${s}.predicate`,"is missing: name the partition value or predicate the route matches")),d.kind==="grid"){const b=typeof d.of=="string"?S.get(d.of):void 0;b?b.kind!=="grid"&&a(`${s}.of`,`names "${d.of}", a ${b.kind} panel: only a grid panel has a grid to view`):a(`${s}.of`,"names no panel")}}const D=new Map;N.panels.forEach((o,d)=>{if(z.has(d))return;const s=`panels[${d}]`,a=(K,te)=>{z.add(d),f.push({path:K,panel:o.id,message:te})};for(const K of Object.keys(o))de.includes(K)||f.push({path:`${s}.${K}`,panel:o.id,message:`is not a panel key (${de.join(", ")}); a viewer's own settings go in options`});if(!T.includes(o.kind)){a(`${s}.kind`,`names no panel kind (${T.join(", ")})`);return}if(o.title!==void 0&&typeof o.title!="string"&&f.push({path:`${s}.title`,panel:o.id,message:"is not a string"}),o.options!==void 0&&!v(o.options)){a(`${s}.options`,"is not an object");return}if(o.binding!==void 0&&(o.kind!=="map"?a(`${s}.binding`,`is only read on a map panel, and this is a ${o.kind} panel`):A.includes(o.binding)||a(`${s}.binding`,`names no map binding (${A.join(", ")})`)),o.source===void 0){(o.kind==="chart"||o.kind==="map")&&a(`${s}.source`,`is missing: a ${o.kind} panel draws a source's rows`);return}if(o.kind==="html"){a(`${s}.source`,"is set on an html panel, which reads no rows");return}const g=re(o.source);if(!g){a(`${s}.source`,"is not a source id");return}let b=null;if(g.kind==="grid")b=g.of;else if(!v(R)||!Object.hasOwn(R,g.id)){a(`${s}.source`,`names "${g.id}", which is not in sources`);return}else if(L.has(g.id)){a(`${s}.source`,`names "${g.id}", a source that is not usable`);return}else R[g.id].kind==="grid"&&(b=R[g.id].of);if(b!==null){const K=S.get(b);if(!K){a(`${s}.source`,`views the grid of "${b}", which is not a panel`);return}if(K.kind!=="grid"){a(`${s}.source`,`views the grid of "${b}", a ${K.kind} panel`);return}if(b===o.id){a(`${s}.source`,"views its own grid");return}D.set(o.id,b)}});for(let o=!0;o;)o=!1,N.panels.forEach((d,s)=>{if(z.has(s)||!D.has(d.id))return;const a=new Set([d.id]);let g=D.get(d.id);for(;g!==void 0;){const b=S.get(g);if(a.has(g)){z.add(s),f.push({path:`panels[${s}].source`,panel:d.id,message:`is part of a cycle of panels viewing each other's grids (${[...a,g].join(" -> ")})`}),o=!0;return}if(!b||z.has(b.index)){z.add(s),f.push({path:`panels[${s}].source`,panel:d.id,message:`views the grid of "${g}", a panel that was not built`}),o=!0;return}a.add(g),g=D.get(g)}});if(N.links!==void 0&&!Array.isArray(N.links)?f.push({path:"links",message:"is not an array of links"}):(N.links||[]).forEach((o,d)=>{const s=`links[${d}]`,a=(g,b)=>{O.add(d),f.push({path:g,link:d,message:b})};if(!v(o)){a(s,"is not an object");return}for(const g of Object.keys(o))_.includes(g)||f.push({path:`${s}.${g}`,link:d,message:`is not a link key (${_.join(", ")})`});if(typeof o.from!="string"||!S.has(o.from)){a(`${s}.from`,"names no panel");return}if(typeof o.to!="string"||!S.has(o.to)){a(`${s}.to`,"names no panel");return}if(o.from===o.to){a(`${s}.to`,"is the panel the link starts from");return}E(o.on)||a(`${s}.on`,"is not a column name, a { from, to } pair of column names, or a relation function")}),N.layout!==void 0){if(!v(N.layout))f.push({path:"layout",message:"is not an object"});else if(N.layout.windows!==void 0)if(!Array.isArray(N.layout.windows))f.push({path:"layout.windows",message:"is not an array of windows"});else{const o=new Set;N.layout.windows.forEach((d,s)=>{const a=`layout.windows[${s}]`;!v(d)||typeof d.id!="string"?(B.add(s),f.push({path:a,message:"is not a window with a string id"})):S.has(d.id)?o.has(d.id)?(B.add(s),f.push({path:`${a}.id`,message:`places "${d.id}" a second time`})):o.add(d.id):(B.add(s),f.push({path:`${a}.id`,message:`names "${d.id}", which is not a panel`}))})}}return M}function $(u){const{problems:f}=w(u);return{ok:f.length===0,problems:f.map(({path:z,message:L})=>({path:z,message:L}))}}}),Pe("packages/modules/dashboard/propose.js",function(m,x){"use strict";Object.defineProperty(m,"PROPOSE_SYSTEM",{enumerable:!0,get:function(){return _}}),Object.defineProperty(m,"columnRefs",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(m,"proposalRequest",{enumerable:!0,get:function(){return v}}),Object.defineProperty(m,"parseProposal",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(m,"checkProposal",{enumerable:!0,get:function(){return re}});const T=x("packages/modules/dashboard/spec.js"),C=T.inspectSpec,A=T.isPlain,F=T.copySpec,de=T.parseSourceRef,_=["You design dashboards for a data grid. Return ONLY a JSON object of the form",'{ "layout": { "columns": <n>, "rows": <n> }, "panels": [ { "id": "<id>", "kind": "<kind>",','"title": "<title>", "source": "<source id>", "binding": "chart", "options": { ... } } ],','"links": [ { "from": "<grid panel id>", "to": "<panel id>", "on": "<column>" } ] }.',"Use only the panel kinds and the columns listed in SCHEMA, and only the source it names.","A chart panel's options are a chart spec (type, x, y, series); a kpi panel's are",'{ tiles: [ { id, field, aggregation } ] }; a map panel with binding "chart" takes a map chart',`spec (type "markermap", lon, lat); a grid panel's are { columns: [ { field } ] }.`,"A person reviews the proposal before anything is built."].join(" "),W=Object.freeze(["x","y","series","measure","size","value","volume","lon","lat","geometry","label","start","end","source","target","multiples"]);function ie(E){const w=new Set,$=A(E.options)?E.options:{},u=f=>{typeof f=="string"&&f!==""&&w.add(f)};if(E.kind==="grid")for(const f of Array.isArray($.columns)?$.columns:[])A(f)&&u(f.field);else if(E.kind==="kpi"){for(const f of Array.isArray($.tiles)?$.tiles:[])A(f)&&u(f.field);for(const f of Array.isArray($.fields)?$.fields:[])u(f)}else if(E.kind==="chart"||E.kind==="map"&&(E.binding||"chart")==="chart")for(const f of W)u($[f]);else E.kind==="map"&&A($.position)&&(u($.position.lon),u($.position.lat),u($.position.geometry));return[...w]}function v(E,w){const $={source:w.source,columns:w.columns,kinds:w.kinds};let u=`${E}
|
|
7
7
|
|
|
8
8
|
SCHEMA
|
|
9
9
|
${JSON.stringify($)}`;w.rows&&(u+=`
|