react-semaphor 0.1.478 → 0.1.479
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-7qAW16mO.cjs → dashboard-briefing-launcher-DWwSdfV7.cjs} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-DAhtLQPc.js → dashboard-briefing-launcher-Dk4yNOLY.js} +3 -3
- package/dist/chunks/{dashboard-controls-CoVqAeKG.cjs → dashboard-controls-B0Pm_y8L.cjs} +1 -1
- package/dist/chunks/{dashboard-controls-C_CBmEwW.js → dashboard-controls-CIC5_549.js} +5 -5
- package/dist/chunks/{dashboard-filter-value-compatibility-Bco2gN96.cjs → dashboard-filter-value-compatibility-ByT__CYM.cjs} +1 -1
- package/dist/chunks/{dashboard-filter-value-compatibility-BAatYtUS.js → dashboard-filter-value-compatibility-DQkUs41q.js} +72 -67
- package/dist/chunks/{dashboard-json-B3XSl7b_.cjs → dashboard-json-Bk6nEHap.cjs} +1 -1
- package/dist/chunks/{dashboard-json-0w58H39L.js → dashboard-json-YDTb3r4e.js} +2 -2
- package/dist/chunks/{edit-dashboard-visual-BsLRKeuO.cjs → edit-dashboard-visual-B3oH-O0L.cjs} +1 -1
- package/dist/chunks/{edit-dashboard-visual-BsWEU8xf.js → edit-dashboard-visual-q5Yj9dMP.js} +4 -4
- package/dist/chunks/{editor-action-buttons-B3CB5c__.js → editor-action-buttons-BqelO0n9.js} +2 -2
- package/dist/chunks/{editor-action-buttons-DMLDvrJD.cjs → editor-action-buttons-vZ63-lN-.cjs} +1 -1
- package/dist/chunks/{index-DgGcVyUs.js → index-CUCiMVzS.js} +22006 -22002
- package/dist/chunks/{index--0Il-Bpd.cjs → index-DhDfPZUu.cjs} +165 -165
- package/dist/chunks/{report-preferences-dialog-I0Pbn_Yb.cjs → report-preferences-dialog--aV7ITSE.cjs} +1 -1
- package/dist/chunks/{report-preferences-dialog-Bytgubvz.js → report-preferences-dialog-DKq0k5BH.js} +2 -2
- package/dist/chunks/switch-D12C40LN.cjs +138 -0
- package/dist/chunks/{switch-BsGTOjuD.js → switch-LucIPRtD.js} +5249 -4987
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.cjs +1 -1
- package/dist/dashboard-authoring/index.js +2 -2
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +7 -7
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/briefings.d.ts +8 -2
- package/dist/types/dashboard-authoring.d.ts +9 -3
- package/dist/types/dashboard.d.ts +9 -3
- package/dist/types/main.d.ts +27 -18
- package/dist/types/shared.d.ts +8 -2
- package/dist/types/surfboard.d.ts +9 -3
- package/dist/types/types.d.ts +9 -3
- package/package.json +1 -1
- package/dist/chunks/switch-Cpj3DrCZ.cjs +0 -138
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("react"),d=require("../chunks/switch-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("react"),d=require("../chunks/switch-D12C40LN.cjs"),oe=require("../chunks/color-CyB5o13F.cjs"),L=require("../chunks/x-B6ghREd2.cjs");require("../chunks/card-config-utils-D3Xuu0ub.cjs");require("../chunks/validators-DqIM0B3C.cjs");require("../chunks/analyze-result-contract-BX_nQmPN.cjs");require("../value-format-preferences/index.cjs");const W=require("../chunks/index-ByFbacH7.cjs"),_=require("../chunks/palette-BN-jYtaK.cjs"),fe=require("../chunks/braces-v55uLCAK.cjs"),me=require("../chunks/save-3dYRmehL.cjs"),xe=require("../chunks/layout-grid-xm8pqtx0.cjs");/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as d, jsx as r, Fragment as ce } from "react/jsx-runtime";
|
|
2
2
|
import m from "react";
|
|
3
|
-
import { c as q, P as ge, a as be, B as C, b as fe, U as De, C as Ie, R as me, L as le, S as se, d as Je, T as je, F as Le, G as U, H as $e, I as M, J as _e, K as Ve, M as Ue, N as Me, O as E, Q as K, V as Q, W as ee, X as he, Y as re, Z as oe, _ as ke, $ as xe, a0 as ye, a1 as ve, a2 as Ce, a3 as Ge } from "../chunks/switch-
|
|
3
|
+
import { c as q, P as ge, a as be, B as C, b as fe, U as De, C as Ie, R as me, L as le, S as se, d as Je, T as je, F as Le, G as U, H as $e, I as M, J as _e, K as Ve, M as Ue, N as Me, O as E, Q as K, V as Q, W as ee, X as he, Y as re, Z as oe, _ as ke, $ as xe, a0 as ye, a1 as ve, a2 as Ce, a3 as Ge } from "../chunks/switch-LucIPRtD.js";
|
|
4
4
|
import { A as We, p as He } from "../chunks/color-CJvdlFM_.js";
|
|
5
5
|
import { c as ae, X as Xe } from "../chunks/x-CXDkqdur.js";
|
|
6
6
|
import "../chunks/card-config-utils-CyDKaPNT.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),p=require("react"),s=require("./index
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),p=require("react"),s=require("./index-DhDfPZUu.cjs"),n=require("./switch-D12C40LN.cjs"),Ce=require("./layout-grid-xm8pqtx0.cjs"),K=require("./x-B6ghREd2.cjs"),V=require("./editor-action-buttons-vZ63-lN-.cjs"),we=require("./card-config-utils-D3Xuu0ub.cjs");require("./validators-DqIM0B3C.cjs");require("./analyze-result-contract-BX_nQmPN.cjs");require("../value-format-preferences/index.cjs");const Ue=require("./search-BqqhaMx9.cjs"),Oe=require("./mouse-pointer-2-DX4A_XZw.cjs"),Ne=require("./pivot-header-presentation-8Ra1RfHg.cjs");require("./appearance-runtime-provider-BgNYdUYH.cjs");require("./appearance-context-DhyjbQk1.cjs");require("./index-ByFbacH7.cjs");require("./temporal-bucket-authoring-DueSgLJU.cjs");require("./color-CyB5o13F.cjs");require("react-dom");const X=require("./index-CXeIDdjd.cjs");/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as e, jsxs as r, Fragment as W } from "react/jsx-runtime";
|
|
2
2
|
import Wt, { useState as E, useEffect as Y, useMemo as ee, useContext as Ht, useRef as he, useCallback as q } from "react";
|
|
3
|
-
import { cl as et, aG as De, aH as ke, aJ as Ae, ba as wt, bX as Gt, cm as qt, cn as Kt, aY as fe, c9 as Nt, bk as Pe, r as Qt, n as Xt, co as Yt, aO as tt, aR as rt, aS as at, aT as nt, aU as st, aV as ot, aW as it, aX as St, bj as lt, aF as O, cp as Zt, cq as Jt, cr as Ke, ca as $e, cb as je, cs as Dt, cc as We, bV as G, b0 as er, bA as Me, ct as tr, bU as rr, aI as ct, aK as dt, cu as ar, aE as nr, b9 as sr, bv as kt, cv as or, bY as ir, u as lr, aL as cr, b2 as dr, ay as He, N as ue, av as ut, ar as At, as as ht, O as Et, aq as ur, ax as hr, cg as mr, cw as pr, bt as fr, at as gt, R as gr, Q as br, cx as xr, cy as vr, cz as yr, cA as Cr, cB as wr, cC as Nr, cD as It, cE as Sr, b3 as Dr, cF as kr, cd as Ft, cG as Ar, cH as Er, cI as Re, cJ as Ir, cK as Fr, cL as Lr, am as Br, ao as Tr, a2 as Vr, a1 as Rr, a0 as Ur, $ as Pr, Y as Mr, W as Or, cM as _r, cN as zr, cO as $r, cP as jr, cQ as Wr, ak as Hr, cR as Gr, cS as qr, a8 as Kr, cT as Qr, cU as Xr, cV as Yr } from "./index-
|
|
4
|
-
import { B, O as Se, Z as Ze, L as te, M as Lt, d as Bt, c as K, K as Zr, D as ge, u as P, z as be, aw as Tt, av as Je, E as Vt, P as Oe, a as _e, b as ze, aH as Jr, aI as ea, S as Rt, aJ as ta, aK as ra, aL as aa, aM as na, aF as sa } from "./switch-
|
|
3
|
+
import { cl as et, aG as De, aH as ke, aJ as Ae, ba as wt, bX as Gt, cm as qt, cn as Kt, aY as fe, c9 as Nt, bk as Pe, r as Qt, n as Xt, co as Yt, aO as tt, aR as rt, aS as at, aT as nt, aU as st, aV as ot, aW as it, aX as St, bj as lt, aF as O, cp as Zt, cq as Jt, cr as Ke, ca as $e, cb as je, cs as Dt, cc as We, bV as G, b0 as er, bA as Me, ct as tr, bU as rr, aI as ct, aK as dt, cu as ar, aE as nr, b9 as sr, bv as kt, cv as or, bY as ir, u as lr, aL as cr, b2 as dr, ay as He, N as ue, av as ut, ar as At, as as ht, O as Et, aq as ur, ax as hr, cg as mr, cw as pr, bt as fr, at as gt, R as gr, Q as br, cx as xr, cy as vr, cz as yr, cA as Cr, cB as wr, cC as Nr, cD as It, cE as Sr, b3 as Dr, cF as kr, cd as Ft, cG as Ar, cH as Er, cI as Re, cJ as Ir, cK as Fr, cL as Lr, am as Br, ao as Tr, a2 as Vr, a1 as Rr, a0 as Ur, $ as Pr, Y as Mr, W as Or, cM as _r, cN as zr, cO as $r, cP as jr, cQ as Wr, ak as Hr, cR as Gr, cS as qr, a8 as Kr, cT as Qr, cU as Xr, cV as Yr } from "./index-CUCiMVzS.js";
|
|
4
|
+
import { B, O as Se, Z as Ze, L as te, M as Lt, d as Bt, c as K, K as Zr, D as ge, u as P, z as be, aw as Tt, av as Je, E as Vt, P as Oe, a as _e, b as ze, aH as Jr, aI as ea, S as Rt, aJ as ta, aK as ra, aL as aa, aM as na, aF as sa } from "./switch-LucIPRtD.js";
|
|
5
5
|
import { L as mt } from "./layout-grid-CiubineE.js";
|
|
6
6
|
import { c as Ee, X as Ge, C as Ut } from "./x-CXDkqdur.js";
|
|
7
|
-
import { u as pt, V as oa, E as Qe, a as Xe, b as ia, c as la, L as ca, d as da, e as Pt, C as Mt, F as ua, f as ha } from "./editor-action-buttons-
|
|
7
|
+
import { u as pt, V as oa, E as Qe, a as Xe, b as ia, c as la, L as ca, d as da, e as Pt, C as Mt, F as ua, f as ha } from "./editor-action-buttons-BqelO0n9.js";
|
|
8
8
|
import { v as bt } from "./card-config-utils-CyDKaPNT.js";
|
|
9
9
|
import "./validators-D3AarM2T.js";
|
|
10
10
|
import "./analyze-result-contract-DsiAzCYn.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("./switch-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("./switch-D12C40LN.cjs"),s=require("./index-DhDfPZUu.cjs"),U=require("./x-B6ghREd2.cjs");require("./card-config-utils-D3Xuu0ub.cjs");require("./validators-DqIM0B3C.cjs");require("./analyze-result-contract-BX_nQmPN.cjs");require("../value-format-preferences/index.cjs");const y=require("react");require("./appearance-context-DhyjbQk1.cjs");require("./index-ByFbacH7.cjs");require("./temporal-bucket-authoring-DueSgLJU.cjs");require("./color-CyB5o13F.cjs");const us=require("react-dom");require("./index-CXeIDdjd.cjs");require("./appearance-runtime-provider-BgNYdUYH.cjs");const $=require("./dashboard-briefing-launcher-DWwSdfV7.cjs"),St=require("./search-BqqhaMx9.cjs"),Dt=require("./index-ByQgqT9d.cjs"),Ge=require("./dashboard-filter-value-compatibility-ByT__CYM.cjs"),ms=require("./report-preferences-dialog--aV7ITSE.cjs"),hs=require("./use-debounced-dirty-check-XHSwAefL.cjs"),qe=require("./normalize-dashboard-for-dirty-check-BXRUMVb2.cjs"),gt=require("./save-3dYRmehL.cjs"),ps=require("./palette-BN-jYtaK.cjs"),xs=require("./braces-v55uLCAK.cjs");function fs(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(a,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return a.default=t,Object.freeze(a)}const M=fs(y);/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as e, jsxs as o, Fragment as T } from "react/jsx-runtime";
|
|
2
|
-
import { u as S, B as R, ax as mt, z as sr, O as na, Z as sa, c as be, ay as oa, az as ia, aA as ot, aB as xe, aC as pt, aD as or, L as Be, aE as ir, aF as da, D as $t, Q as Gt, V as Bt, W as zt, Y as Ht, X as la, i as ca, aG as ua } from "./switch-
|
|
3
|
-
import { bw as ma, bx as pa, ay as q, aG as dr, by as ha, aY as K, aH as lr, aI as fa, aJ as it, aK as dt, aE as ga, bz as ge, bA as Ge, bB as ba, bC as jt, bD as cr, bE as ur, bF as xa, bG as ht, bH as va, bI as ya, bJ as wa, bK as Na, bL as Sa, bM as Da, b7 as ve, bN as ye, aF as C, bO as Ca, bP as mr, bk as ft, bQ as ka, bR as Ea, bS as pr, bT as La, bU as hr, bV as V, bW as Ia, ao as Ma, bX as Aa, bY as Pa, bZ as Oa, b_ as _a, m as Ra, u as Fe, s as Ua, n as rt, b$ as Va, c0 as Ta, c1 as Fa, c2 as $a, L as Ga, c3 as Ba, c4 as za, I as qt, c5 as Ha, c6 as ja, c7 as qa, c8 as Ka, c9 as Wa, ca as Kt, cb as Wt, cc as Qt, cd as Qa, ce as Ja, cf as Ya, cg as Xa, b0 as Jt, ch as Za, ci as en, cj as tn, r as rn, ck as an, aO as nn, aR as sn, aS as on, aT as dn, aU as ln, aV as cn, aW as un, aX as Yt } from "./index-
|
|
2
|
+
import { u as S, B as R, ax as mt, z as sr, O as na, Z as sa, c as be, ay as oa, az as ia, aA as ot, aB as xe, aC as pt, aD as or, L as Be, aE as ir, aF as da, D as $t, Q as Gt, V as Bt, W as zt, Y as Ht, X as la, i as ca, aG as ua } from "./switch-LucIPRtD.js";
|
|
3
|
+
import { bw as ma, bx as pa, ay as q, aG as dr, by as ha, aY as K, aH as lr, aI as fa, aJ as it, aK as dt, aE as ga, bz as ge, bA as Ge, bB as ba, bC as jt, bD as cr, bE as ur, bF as xa, bG as ht, bH as va, bI as ya, bJ as wa, bK as Na, bL as Sa, bM as Da, b7 as ve, bN as ye, aF as C, bO as Ca, bP as mr, bk as ft, bQ as ka, bR as Ea, bS as pr, bT as La, bU as hr, bV as V, bW as Ia, ao as Ma, bX as Aa, bY as Pa, bZ as Oa, b_ as _a, m as Ra, u as Fe, s as Ua, n as rt, b$ as Va, c0 as Ta, c1 as Fa, c2 as $a, L as Ga, c3 as Ba, c4 as za, I as qt, c5 as Ha, c6 as ja, c7 as qa, c8 as Ka, c9 as Wa, ca as Kt, cb as Wt, cc as Qt, cd as Qa, ce as Ja, cf as Ya, cg as Xa, b0 as Jt, ch as Za, ci as en, cj as tn, r as rn, ck as an, aO as nn, aR as sn, aS as on, aT as dn, aU as ln, aV as cn, aW as un, aX as Yt } from "./index-CUCiMVzS.js";
|
|
4
4
|
import { c as ee, X as fr, C as mn } from "./x-CXDkqdur.js";
|
|
5
5
|
import "./card-config-utils-CyDKaPNT.js";
|
|
6
6
|
import "./validators-D3AarM2T.js";
|
|
@@ -15,11 +15,11 @@ import "./color-CJvdlFM_.js";
|
|
|
15
15
|
import { createPortal as fn } from "react-dom";
|
|
16
16
|
import "./index-BvRREsU9.js";
|
|
17
17
|
import "./appearance-runtime-provider-CjmE4gBY.js";
|
|
18
|
-
import { c as gn, u as bn, A as xn, a as vn, f as yn, V as wn, N as Nn, g as Sn, U as Dn } from "./dashboard-briefing-launcher-
|
|
18
|
+
import { c as gn, u as bn, A as xn, a as vn, f as yn, V as wn, N as Nn, g as Sn, U as Dn } from "./dashboard-briefing-launcher-Dk4yNOLY.js";
|
|
19
19
|
import { S as Cn, C as kn } from "./search-BHsQIWBV.js";
|
|
20
20
|
import { d as br } from "./index-BS0_dp0l.js";
|
|
21
|
-
import { c as lt } from "./dashboard-filter-value-compatibility-
|
|
22
|
-
import { R as En } from "./report-preferences-dialog-
|
|
21
|
+
import { c as lt } from "./dashboard-filter-value-compatibility-DQkUs41q.js";
|
|
22
|
+
import { R as En } from "./report-preferences-dialog-DKq0k5BH.js";
|
|
23
23
|
import { u as Ln } from "./use-debounced-dirty-check-BwAbnX_5.js";
|
|
24
24
|
import { s as at } from "./normalize-dashboard-for-dirty-check-5KpZN8xr.js";
|
|
25
25
|
import { S as Zt } from "./save-DgMfP0j8.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ge=Object.defineProperty;var pe=(e,t,n)=>t in e?ge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var H=(e,t,n)=>pe(e,typeof t!="symbol"?t+"":t,n);const m=require("./validators-DqIM0B3C.cjs");require("./analyze-result-contract-BX_nQmPN.cjs");require("../value-format-preferences/index.cjs");const be=require("./source-entity-resolution-DCAAS-y8.cjs"),ee=(e,t)=>{const n={};if(e===null||t===null)return t;const r=new Set([...Object.keys(e),...Object.keys(t)]);for(const i of r){if(!(i in e)&&i in t){n[i]=t[i];continue}if(i in e&&!(i in t)){n[i]=void 0;continue}const s=e[i],a=t[i];if(!x(s,a))if(Array.isArray(s)&&Array.isArray(a))n[i]=a;else if(W(s)&&W(a)){const d=ee(s,a);Object.keys(d).length>0&&(n[i]=d)}else n[i]=a}return n},x=(e,t)=>{if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((i,s)=>x(i,t[s]));const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>x(e[i],t[i]))}return!1},W=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),_=e=>{if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);if(Array.isArray(e))return e.map(n=>_(n));const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=_(e[n]));return t},G=/\[\[\s*param\.([A-Za-z0-9_.-]+)\s*\]\]/g,U=/\bparam\s*\(\s*(['"])([^'"]+)\1/g;function ye(e){const t=[];let n=0;for(;n<e.length;){const r=e.indexOf("{{",n),i=e.indexOf("{%",n);let s=-1,a="";if(r===-1?(s=i,a="%}"):i===-1||r<i?(s=r,a="}}"):(s=i,a="%}"),s===-1)break;const d=e.indexOf(a,s+2);if(d===-1){n=s+2;continue}t.push(e.slice(s+2,d)),n=d+2}return t}function P(e){var r,i;if(!e)return[];const t=new Set;let n;for(G.lastIndex=0;(n=G.exec(e))!==null;){const s=(r=n[1])==null?void 0:r.trim();s&&t.add(s)}for(const s of ye(e))for(U.lastIndex=0;(n=U.exec(s))!==null;){const a=(i=n[2])==null?void 0:i.trim();a&&t.add(a)}return Array.from(t)}function Ie(e){const t=new Set,n=new Map;for(const r of e.controlBindings||[])t.add(r.controlId),r.target==="sql_param"&&n.set(r.paramId,r.controlId);for(const r of P(e.sql))t.add(n.get(r)??r);return Array.from(t)}function te(e){const t=new Map,n=new Map;for(const r of e.controlBindings||[])r.target==="sql_param"&&n.set(r.paramId,r.controlId);for(const r of P(e.sql))t.set(r,{paramId:r,controlId:n.get(r)??r});return Array.from(t.values())}function Fe(e,t){var i;const n=(i=e.controlBindings)==null?void 0:i.map(s=>({...s,controlId:t.get(s.controlId)??s.controlId})),r=te(e).flatMap(({paramId:s,controlId:a})=>{var c;const d=t.get(a);return!d||d===a||(c=e.controlBindings)!=null&&c.some(o=>o.target==="sql_param"&&o.paramId===s)?[]:[{target:"sql_param",paramId:s,controlId:d}]});return r.length?[...n??[],...r]:n}function ne(e,t){var i,s;const n=e.source==="dashboardInputAlias"?((i=t.inputAliases)==null?void 0:i[e.variableName])??e:e,r=e.source==="dashboardInputAlias"&&n!==e?{...n,export:e.export??"label"}:n;return r.source==="dashboardInput"?{...r,inputId:((s=t.inputIds)==null?void 0:s[r.inputId])??r.inputId}:r}function Te(e,t){var i;const n={};for(const s of["cardIds","sheetIds","inputIds","controlIds","filterIds"]){const a={...t[s]};for(const[d,c]of Object.entries((e==null?void 0:e[s])??{}))a[d]=((i=t[s])==null?void 0:i[c])??c;Object.keys(a).length&&(n[s]=a)}const r={...t.inputAliases};for(const[s,a]of Object.entries((e==null?void 0:e.inputAliases)??{}))r[s]=ne(a,t);return Object.keys(r).length&&(n.inputAliases=r),n}function De(e,t){var i,s,a,d;const n=_(e);n.controlBindings=Fe(e,new Map(Object.entries(t.controlIds??{})));for(const c of n.controls??[])c.id=((i=t.controlIds)==null?void 0:i[c.id])??c.id;for(const c of n.inlineFilters??[])c.id=((s=t.filterIds)==null?void 0:s[c.id])??c.id;const r=c=>{var h,f,u;if(!c||typeof c!="object")return;if(Array.isArray(c)){c.forEach(r);return}const o=c;if(o.type==="variable"&&o.ref&&typeof o.ref=="object"){const g=o.ref;o.ref=g.source==="input"?{...g,inputId:((h=t.inputIds)==null?void 0:h[g.inputId])??g.inputId}:ne(g,t)}if(typeof o.entityId=="string"){const g=o.entityId;o.fieldScope==="card"&&(o.entityId=((f=t.cardIds)==null?void 0:f[g])??g),o.fieldScope==="sheet"&&(o.entityId=((u=t.sheetIds)==null?void 0:u[g])??g)}for(const[g,y]of Object.entries(o))g!=="linkedReferenceOverrides"&&r(y)};r(n);for(const c of Object.values(((a=n.customCardPreferences)==null?void 0:a.dataInputCardIds)??{}))c.cardId=((d=t.cardIds)==null?void 0:d[c.cardId])??c.cardId;return n}function C(e){return(e==null?void 0:e.trim())||void 0}function K(e){return e.split(".").at(-1)||e}function Q(e,t){var c,o;const n=C(t);if(!n)return;const r=K(n),i=C((c=e.fieldMeta)==null?void 0:c.name);if(i&&i!==n&&i!==r)return;const s=C((o=e.fieldMeta)==null?void 0:o.qualifiedFieldName);if(s&&K(s)!==r)return;const a=n.includes(".")?n:void 0,d=s!=null&&s.includes(".")?s:void 0;if(!(a&&d&&a!==d))return{leafName:r,...a||d?{qualifiedFieldName:a||d}:{}}}function Y(e,t){return Q(e,t)||Q({},t)}function V({source:e,sourceFieldName:t,target:n,targetFieldName:r}){const i=Y(e,t),s=Y(n,r);return!i||!s||i.leafName!==s.leafName?!1:s.qualifiedFieldName?i.qualifiedFieldName===s.qualifiedFieldName:!0}function A(e,t){var i,s;const n=Ne(e);if(n)return n;const r=(s=(i=e==null?void 0:e.fieldMeta)==null?void 0:i.nativeDataType)==null?void 0:s.trim();if(S(e==null?void 0:e.fieldMeta,t)&&r&&r!=="date"&&r!=="datetime")return r}function Ne(e){var n;const t=(n=e==null?void 0:e.nativeDataType)==null?void 0:n.trim();return t&&t!=="date"&&t!=="datetime"?t:void 0}function S(e,t){var a,d;const n=t.trim();if(!n)return!1;const r=n.split(".").at(-1),i=(a=e==null?void 0:e.qualifiedFieldName)==null?void 0:a.trim();if(i&&!(i===n||!i.includes(".")&&i===r))return!1;const s=(d=e==null?void 0:e.name)==null?void 0:d.trim();return s&&s!==n&&s!==r?!1:!!(i||s)}function ve({fieldName:e,definition:t,value:n}){if((t==null?void 0:t.column)===e){const r=A(t,e);if(r)return r}return(n==null?void 0:n.name)===e?A(n,e):void 0}function ie({definition:e,value:t,sourceValue:n=t}){const r=e&&V({source:e,sourceFieldName:e.column,target:t,targetFieldName:t.name})?e:void 0,i=n&&V({source:n,sourceFieldName:n.name,target:t,targetFieldName:t.name})?n:void 0,s=(r?A(r,r.column):void 0)||(i?A(i,i.name):void 0);return re({carrier:t,nativeDataType:s,projectNestedNativeDataType:S(t.fieldMeta,t.name)})}function _e({filterDefinitions:e,filterValues:t}){if(!(e!=null&&e.length)||!t.length)return t;const n=new Map(e.map(s=>[s.id,s]));let r=!1;const i=t.map(s=>{if(typeof s.name!="string"||!s.name.trim())return s;const a=n.get(s.filterId);if(!a)return s;const d=ie({definition:a,value:s});return r||(r=d!==s),d});return r?i:t}function Ae(e){const t=ve({fieldName:e.column,definition:e});return re({carrier:e,nativeDataType:t,projectNestedNativeDataType:S(e.fieldMeta,e.column)})}function re({carrier:e,nativeDataType:t,projectNestedNativeDataType:n}){var o;const r=(o=e.fieldMeta)==null?void 0:o.nativeDataType;if(t){if(e.nativeDataType===t&&(!e.fieldMeta||(n?r===t:!r)))return e;const{nativeDataType:h,...f}=e.fieldMeta||{};return{...e,nativeDataType:t,...e.fieldMeta?{fieldMeta:n?{...e.fieldMeta,nativeDataType:t}:f}:{}}}if(e.nativeDataType===void 0&&r===void 0)return e;const{nativeDataType:i,fieldMeta:s,...a}=e,{nativeDataType:d,...c}=s||{};return{...a,...s?{fieldMeta:c}:{}}}function l(e){return typeof e=="string"&&e.trim().length>0?e.trim():null}function se(e){return Array.from(new Set(e.filter(t=>!!t)))}function $e(e){const t=l(e.table),n=l(e.schema),r=l(e.catalog)||l(e.database);return t?se([t,n?`${n}.${t}`:null,r?`${r}.${t}`:null,r&&n?`${r}.${n}.${t}`:null]):[]}function X(e){const t=l(e.table)||l(e.tableName);return se([l(e.name),l(e.alias),...$e({table:t,schema:l(e.schema)||l(e.schemaName),catalog:l(e.catalog),database:l(e.database)||l(e.databaseName)})])}function Ee(e,t){const n=l(e.domainId),r=l(t.domainId);if(n&&r&&n!==r)return!0;if(e.type==="dataset")return!1;const i=l(e.id),s=l(t.id);if(i&&s&&i!==s)return!0;const a=l(e.connectionId),d=l(t.connectionId);return!!(a&&d&&a!==d)}function w(e,t=!1){return l(e.table)||l(e.tableName)||(e.type!=="dataset"||t?l(e.name):null)}function O(e){return l(e.catalog)||l(e.database)||l(e.databaseName)}function z(e){return l(e.schema)||l(e.schemaName)}function N(e){return e.length===1?e[0]:void 0}function ke(e,t){const n=w(t,!0),r=O(t),i=z(t);if(!(!n||!r&&!i))return N(e.filter(s=>{const a=s;return!(w(a)!==n||r&&O(a)!==r||i&&z(a)!==i)}))}function $(e,t){if(!t||!(e!=null&&e.length))return;const n=e.filter(d=>!Ee(d,t));if(t.type==="dataset"){const d=l(t.id);if(d)return N(n.filter(o=>o.type==="dataset"&&l(o.id)===d));if(l(t.domainId)){const o=l(t.name);return N(n.filter(h=>h.type==="dataset"&&l(h.name)===o))}}let r=[];if(t.type==="dataset"){const d=l(t.name);if(r=n.filter(c=>c.type==="dataset"&&l(c.name)===d),r.length===1)return r[0]}if(!!(w(t,!0)&&(O(t)||z(t))))return ke(n,t);if(r.length>1)return;const s=X(t);if(s.length===0)return;const a=n.filter(d=>X(d).some(o=>s.includes(o)));return N(a)}function R(e,t){const n=$(e,t);return n?{...t,...n}:t}function Ce(e,t){const n=t||[];return n.length===0?e:{...e,baseEntity:R(n,e.baseEntity),joins:e.joins.map(r=>({...r,source:R(n,r.source),target:R(n,r.target)}))}}function Re(e,t){if(!(e!=null&&e.joins.length))return[];const n=[e.baseEntity,...e.joins.flatMap(i=>[i.source,i.target])],r=[];return n.forEach(i=>{!$(t,i)&&!$(r,i)&&r.push(i)}),r}function F(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function v(e){return F(e)&&typeof e.name=="string"}function q(e){return!F(e)||e.kind!=="semantic"&&e.kind!=="physical"||(e.kind==="semantic"?[e.datasetId,e.datasetName,e.connectionId]:[e.databaseName,e.schemaName]).some(n=>n!==void 0&&typeof n!="string")?!1:m.hasCompleteSemaphorSourceIdentity(e)}function M(e,t){var o,h;const n=Array.isArray(t==null?void 0:t.selectedEntities)?t.selectedEntities.filter(v):void 0,r=$(n,e),i=r?{...e,...r}:e,s="domainId"in i&&typeof i.domainId=="string"&&!!i.domainId.trim();if((t==null?void 0:t.mode)==="semanticDomain"&&!s)return;if((t==null?void 0:t.mode)!=="database"&&i.type==="dataset"){const f=be.resolveSemaphorSemanticDatasetEntity({entities:[i],semanticDomainId:t==null?void 0:t.semanticDomainId,connectionId:t==null?void 0:t.connectionId,fieldEntityType:"dataset"},{includePhysicalDatasets:!0});if(f.kind==="resolved"){const u="label"in i&&typeof i.label=="string"?i.label:void 0;return{...f.source,...u?{label:u}:{}}}}if((t==null?void 0:t.mode)==="semanticDomain")return;const a=i.connectionId||(t==null?void 0:t.connectionId),d=i.type==="dataset"&&"table"in i&&i.table?i.table:i.name;if(!a||!d)return;const c={kind:"physical",connectionId:a,connectionType:i.connectionType||(t==null?void 0:t.connectionType),tableName:d,databaseName:i.database||((o=t==null?void 0:t.dbSelection)==null?void 0:o.database),schemaName:i.schema||((h=t==null?void 0:t.dbSelection)==null?void 0:h.schema),dialect:i.dialect};return q(c)?c:void 0}function xe(e,t){var d,c;const n=M(e,t);if(!n)return;const r=e.type==="dataset"&&"table"in e&&typeof e.table=="string"?e.table.trim():void 0,i=n.kind==="physical"?n.tableName:r,s=e.connectionId||(t==null?void 0:t.connectionId),a=i&&s?{connectionId:s,databaseName:e.database||((d=t==null?void 0:t.dbSelection)==null?void 0:d.database),schemaName:e.schema||((c=t==null?void 0:t.dbSelection)==null?void 0:c.schema),tableName:i}:void 0;return{source:n,...a?{executionTable:a}:{}}}function ae(e){const t=F(e.dataSource)?e.dataSource:void 0;if(typeof e.sql=="string"&&e.sql.trim()){const a=[],d=Array.isArray(t==null?void 0:t.selectedEntities)?t.selectedEntities:[];for(const c of d){if(!v(c))continue;const o=xe(c,t);o&&!a.some(h=>m.semaphorSourcesReferToSameDataset(h.source,o.source))&&a.push(o)}return{cardId:e.id,kind:"sql",pinnedCatalogSources:a}}if(!F(e.config))return{cardId:e.id,kind:"unconfigured"};const n=[],r=F(e.config.matrixIntent)?e.config.matrixIntent:void 0,i=e.type==="matrixTable"?(r==null?void 0:r.kind)==="matrix"?r.source:e.config.source:void 0;q(i)&&n.push(i);const s=F(e.config.joinPlan)?e.config.joinPlan:void 0;if(s){const a=Array.isArray(s.joins)?s.joins:[],d=[s.baseEntity];for(const o of a)F(o)&&d.push(o.source,o.target);let c=!1;for(const o of d){if(!v(o)){c=!0;continue}const h=M(o,t);h?n.push(h):c=!0}c&&(n.length=0)}else if(e.type!=="matrixTable"){const a=Array.isArray(t==null?void 0:t.selectedEntities)?t.selectedEntities:[];if(a.length===1&&v(a[0])){const d=M(a[0],t);d&&n.push(d)}}if(!n.length&&!s&&e.type!=="matrixTable"){const a=e.config.queryBaseSource;q(a)&&n.push(a)}return{cardId:e.id,kind:"config",executableSources:m.mergeSemaphorSourcesByIdentity(n)}}function oe(e,t){return(e.kind==="config"?e.executableSources:e.kind==="sql"?e.pinnedCatalogSources.map(r=>r.source):[]).some(r=>m.semaphorSourcesReferToSameDataset(r,t))}function we(e,t){if(e.kind==="config")return e.executableSources.find(n=>m.semaphorSourcesReferToSameDataset(n,t))}function Oe(e,t){var n;return(n=B(e,t))==null?void 0:n.source}function B(e,t){if(e.kind==="sql")return e.pinnedCatalogSources.find(n=>m.semaphorSourcesReferToSameDataset(n.source,t))}function Z(e){const t=new Set;for(const n of[e.name,e.sourceField]){if(!n)continue;const r=m.normalizeAnalyticsCatalogName(n);if(!r)continue;t.add(r);const i=r.split("."),s=i[i.length-1];s&&t.add(s)}return t}function de(e,t){const n=m.normalizeAnalyticsCatalogDataType(e),r=m.normalizeAnalyticsCatalogDataType(t);return n==="unknown"||r==="unknown"?!1:(n==="date"||n==="datetime")&&(r==="date"||r==="datetime")?!0:n===r}function ze(e,t){return m.semaphorSourcesReferToSameDataset(e.field.source,t.field.source)&&m.normalizeAnalyticsCatalogName(e.field.name)===m.normalizeAnalyticsCatalogName(t.field.name)&&m.normalizeAnalyticsCatalogName(e.field.sourceField||e.field.name)===m.normalizeAnalyticsCatalogName(t.field.sourceField||t.field.name)}function ce(e,t){if(e.kind!=="field")return!1;const n=Z(t),r=Z(e.field);return de(t.dataType,e.field.dataType)&&[...r].some(i=>n.has(i))}function qe(e){const t=e.candidates.filter(n=>ce(n,e.logicalValueField));return t.length===1?{status:"matched",target:t[0]}:t.length>1?{status:"ambiguous"}:{status:"notApplicable"}}function Me(e){const t=[];for(const n of e.acceptedTargets)!de(e.logicalValueField.dataType,n.field.dataType)||t.some(r=>ze(r,n))||t.push(n);return t.length===1?{status:"matched",target:t[0]}:t.length>1?{status:"ambiguous"}:{status:"notApplicable"}}const Pe=/\{\{-?\s*filters\s*\|\s*where\s*-?\}\}/i,Se=/\{\{-?\s*filters\s*\|\s*and\s*-?\}\}/i,Be=/\bwhere\b/i;function le(e){return e!=null&&e.trim()?Pe.test(e)||Se.test(e):!1}function je(e){return!(e!=null&&e.trim())||le(e)?null:Be.test(e)?{helper:"{{ filters | and }}",description:"For queries with an existing WHERE clause."}:{helper:"{{ filters | where }}",description:"For queries without a WHERE clause."}}function Le(e){return(e.field.sourceField||e.field.name).trim()||void 0}function Je(e){if(e.inventory.kind!=="sql"||e.target.kind!=="field")return{status:"ineligible"};const t=B(e.inventory,e.target.field.source),n=Le(e.target);if(!t||!n)return{status:"ineligible"};if(t.executionTable){const a=[t.executionTable.databaseName,t.executionTable.schemaName,t.executionTable.tableName,n].filter(Boolean).join(".");return{status:"eligible",source:t.source,executionIdentifier:a}}if(e.inventory.pinnedCatalogSources.length!==1)return{status:"ineligible"};const r=m.normalizeAnalyticsCatalogName(n),i=(e.candidateTargets||[]).filter(a=>m.normalizeAnalyticsCatalogName(a.field.sourceField||a.field.name)===r),s=[];for(const a of i)s.some(d=>m.semaphorSourcesReferToSameDataset(d,a.field.source))||s.push(a.field.source);return s.length>1?{status:"ineligible"}:{status:"eligible",source:t.source,executionIdentifier:n}}class fe extends Error{constructor(n){super(n.map(r=>r.message).join(" "));H(this,"issues");this.name="DashboardFilterMappingContractError",this.issues=n}}const He={string:!0,number:!0,boolean:!0,date:!0,datetime:!0};function b(e){return typeof e=="string"&&e.trim().length>0}function p(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function D(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function We(e){if(!p(e))return!1;switch(e.kind){case"allSheets":return e.sheetKinds===void 0||D(e.sheetKinds)&&e.sheetKinds.every(t=>t==="dashboard"||t==="document");case"sheets":return D(e.sheetIds);case"cards":return D(e.cardIds);case"documentSections":return b(e.sheetId)&&D(e.sectionIds);default:return!1}}function Ge(e){return e==="shared"||e==="perSheet"||e==="perCard"||e==="perDocumentSection"}function Ue(e){return p(e)?b(e.id)&&b(e.column)&&b(e.dataType):!1}function Ke(e,t,n,r){var d;if(!p(t)){r.push({code:"invalid_option_source",path:n,message:`${n} must be a semantic or physical option source.`,inputId:e});return}const i=t.source,s=[["labelField",t.labelField],["valueField",t.valueField],["searchField",t.searchField]];if(!p(i)||i.kind!=="semantic"&&i.kind!=="physical"||!m.hasCompleteSemaphorSourceIdentity(i)||!p(t.labelField)||!p(t.valueField)||t.searchField!==void 0&&!p(t.searchField)||t.disambiguationFields!==void 0&&(!Array.isArray(t.disambiguationFields)||!t.disambiguationFields.every(p))){r.push({code:"invalid_option_source",path:n,message:`${n} must contain a valid semantic or physical source and field references.`,inputId:e});return}for(const[c,o]of s)o!==void 0&&p(o)&&(!b(o.name)||o.source!==void 0&&!m.semaphorSourcesReferToSameDataset(o.source,i))&&r.push({code:"invalid_option_source",path:`${n}.${c}`,message:`${n}.${c} must be a named field belonging to the declared option source.`,inputId:e});for(const[c,o]of((d=t.disambiguationFields)==null?void 0:d.entries())||[])(!p(o)||!b(o.name)||o.source!==void 0&&!m.semaphorSourcesReferToSameDataset(o.source,i))&&r.push({code:"invalid_option_source",path:`${n}.disambiguationFields[${c}]`,message:`${n}.disambiguationFields[${c}] must be a named field belonging to the declared option source.`,inputId:e});const a=t.valueField;["string","number","boolean","date","datetime"].includes(String(a.dataType))||r.push({code:"invalid_option_source",path:`${n}.valueField.dataType`,message:`${n}.valueField.dataType must be a known option-value datatype.`,inputId:e})}function Qe(e,t,n,r,i,s){var o;if(b(t.bindingId)||i.push({code:"invalid_binding_id",path:`${n}.bindingId`,message:`${n}.bindingId must be an opaque non-empty id.`,inputId:e,cardId:t.cardId}),((o=t.target)==null?void 0:o.kind)!=="field"){i.push({code:"unsupported_target",path:`${n}.target`,message:`${n}.target must be one direct field target.`,inputId:e,cardId:t.cardId,bindingId:t.bindingId});return}const a=t.target.field;if(!b(a==null?void 0:a.name)||!a.source||a.source.kind!=="semantic"&&a.source.kind!=="physical"||!m.hasCompleteSemaphorSourceIdentity(a.source)){i.push({code:"invalid_target_field",path:`${n}.target.field`,message:`${n}.target.field must have a name and a source-qualified semantic or physical identity.`,inputId:e,cardId:t.cardId,bindingId:t.bindingId});return}if(Object.prototype.hasOwnProperty.call(He,a.dataType)||i.push({code:"unknown_target_data_type",path:`${n}.target.field.dataType`,message:`${n}.target.field.dataType must be known.`,inputId:e,cardId:t.cardId,bindingId:t.bindingId}),a.sourceField!==void 0&&!b(a.sourceField)&&i.push({code:"invalid_target_field",path:`${n}.target.field.sourceField`,message:`${n}.target.field.sourceField must be a non-empty catalog-grounded column when provided.`,inputId:e,cardId:t.cardId,bindingId:t.bindingId}),!s)return;const d=r.get(t.cardId);if(!d){i.push({code:"unknown_card",path:`${n}.cardId`,message:`${n}.cardId '${t.cardId}' does not exist.`,inputId:e,cardId:t.cardId,bindingId:t.bindingId});return}const c=ae(d);(c.kind==="unconfigured"||!oe(c,a.source))&&i.push({code:"unavailable_card_source",path:`${n}.target.field.source`,message:`${n}.target field source is not declared by card '${d.id}'.`,inputId:e,cardId:d.id,bindingId:t.bindingId})}function Ye(e,t,n,r,i,s){if(t===void 0)return;if(!p(t)||t.kind!=="cardMappings"||!Array.isArray(t.cards)){i.push({code:"invalid_application",path:n,message:`${n} must be a cardMappings application with a cards array.`,inputId:e});return}const a=new Set;t.cards.forEach((d,c)=>{const o=`${n}.cards[${c}]`;if(!b(d==null?void 0:d.cardId)){i.push({code:"unknown_card",path:`${o}.cardId`,message:`${o}.cardId is required.`,inputId:e});return}if(a.has(d.cardId)){i.push({code:"duplicate_card_application",path:`${o}.cardId`,message:`${n} contains more than one entry for card '${d.cardId}'.`,inputId:e,cardId:d.cardId});return}if(a.add(d.cardId),s&&!r.has(d.cardId)){i.push({code:"unknown_card",path:`${o}.cardId`,message:`${o}.cardId '${d.cardId}' does not exist.`,inputId:e,cardId:d.cardId});return}d.kind==="bound"?Qe(e,d,o,r,i,s):d.kind!=="excluded"&&i.push({code:"invalid_application",path:o,message:`${o}.kind must be 'bound' or 'excluded'.`,inputId:e,cardId:d.cardId})})}function ue({inputs:e,dashboardFilters:t,cards:n=[],validateCardTargets:r=!1}){const i=[],s=new Map((t||[]).map(o=>[o.id,o])),a=new Map(r?n.map(o=>[o.id,o]):[]),d=[],c=new Map;return e!=null&&!Array.isArray(e)?(i.push({code:"invalid_input",path:"dashboard.inputs",message:"dashboard.inputs must be an array when present."}),{ok:!1,inputs:d,issues:i}):((Array.isArray(e)?e:[]).forEach((o,h)=>{const f=`dashboard.inputs[${h}]`;if(!p(o)||o.kind!=="filter"&&o.kind!=="control"||!b(o.id)||!b(o.label)||!b(o.variableName)||!We(o.scope)||!Ge(o.runtimeScope)){i.push({code:"invalid_input",path:f,message:`${f} must be a complete filter or control Dashboard Input envelope.`,inputId:p(o)&&typeof o.id=="string"?o.id:void 0});return}if(o.kind==="control"&&!p(o.control)){i.push({code:"invalid_input",path:`${f}.control`,message:`${f}.control must be a control definition.`,inputId:o.id});return}const u=o;if(u.kind==="control"){d.push(u);return}const g=u.filter,y=u.filterReference,T=g!==void 0,j=!!y;if(T&&j){i.push({code:"both_filter_definitions",path:f,message:`${f} must contain either filter or filterReference, not both.`,inputId:u.id});return}if(!T&&!j){i.push({code:"missing_filter_definition",path:f,message:`${f} must contain filter or filterReference.`,inputId:u.id});return}if(T&&!Ue(g)){i.push({code:"invalid_input",path:`${f}.filter`,message:`${f}.filter must be a complete dashboard filter definition.`,inputId:u.id});return}let I,E;if(T)I=g,E="embedded";else{if((y==null?void 0:y.kind)!=="dashboardFilter"){i.push({code:"invalid_filter_reference",path:`${f}.filterReference.kind`,message:`${f}.filterReference.kind must be 'dashboardFilter'.`,inputId:u.id});return}const k=typeof(y==null?void 0:y.filterId)=="string"?y.filterId:void 0;if(I=k?s.get(k):void 0,E="dashboardFilter",!I){i.push({code:"orphaned_filter_reference",path:`${f}.filterReference.filterId`,message:`${f}.filterReference cannot resolve dashboard filter '${k||""}'.`,inputId:u.id});return}if(I.kind==="global-date"){i.push({code:"global_date_reference",path:`${f}.filterReference`,message:`${f}.filterReference cannot reference the Global Date filter.`,inputId:u.id});return}const J=c.get(I.id);if(J){i.push({code:"duplicate_filter_reference",path:`${f}.filterReference.filterId`,message:`${f}.filterReference duplicates dashboard filter '${I.id}' already owned by Dashboard Input '${J}'.`,inputId:u.id});return}c.set(I.id,u.id)}if(!I)return;if(u.optionSource!==void 0&&Ke(u.id,u.optionSource,`${f}.optionSource`,i),u.application&&I.kind==="global-date"){i.push({code:"global_date_reference",path:`${f}.application`,message:`${f}.application cannot map the Global Date filter.`,inputId:u.id});return}u.application&&u.scope.kind!=="allSheets"&&u.scope.kind!=="sheets"&&i.push({code:"unsupported_mapped_scope",path:`${f}.scope`,message:`${f}.scope must be allSheets or sheets when cardMappings are present.`,inputId:u.id}),Ye(u.id,u.application,`${f}.application`,a,i,r);const{filter:tt,filterReference:nt,compatibility:L,...he}=u;d.push({...he,filter:I,...T&&L?{compatibility:L}:{},...u.optionSource?{optionSource:u.optionSource}:{},definitionOrigin:E})}),i.length?{ok:!1,inputs:d,issues:i}:{ok:!0,inputs:d})}function Ve(e){const t=ue(e);if(!t.ok)throw new fe(t.issues);return t.inputs}function Xe(e=()=>globalThis.crypto.randomUUID()){return e()}const Ze={date:new Set(["between","not between","=","!=",">",">=","<","<=","is null","is not null"]),number:new Set(["between","not between","=","!=",">",">=","<","<=","in","not in","is null","is not null"]),string:new Set(["=","!=","in","not in","like","not like","is null","is not null"]),boolean:new Set(["=","!=","in","not in","is null","is not null"])};function me(e){const t=m.normalizeAnalyticsCatalogDataType(e);return t==="number"||t==="boolean"?t:t==="date"||t==="datetime"?"date":"string"}function et(e,t){return typeof t!="string"?!1:Ze[me(e)].has(t)}exports.DashboardFilterMappingContractError=fe;exports.applyCardReferenceRemapping=De;exports.buildDashboardCardSourceIndex=ae;exports.cloneDeep=_;exports.composeCardReferenceRemapping=Te;exports.createDashboardFilterBindingId=Xe;exports.dashboardCardFilterSourceInventoryContains=oe;exports.dashboardFilterTargetMatchesLogicalValue=ce;exports.dashboardFilterValueTypeForDataType=me;exports.extractParamControlIdsFromSql=P;exports.extractReferencedControlIds=Ie;exports.extractSqlParamReferences=te;exports.findDashboardCardExecutableSource=we;exports.findDashboardCardPinnedCatalogSource=Oe;exports.findDashboardSqlPinnedCatalogSource=B;exports.findOrphanedJoinPlanEntities=Re;exports.getDashboardFilterSubscriptionHint=je;exports.getObjectDiff=ee;exports.hasDashboardFilterSubscription=le;exports.isDashboardFilterOperationCompatible=et;exports.materializeFilterDefinitionNativeDataType=Ae;exports.materializeFilterValueNativeDataType=ie;exports.materializeFilterValuesNativeDataType=_e;exports.normalizeDashboardInputs=ue;exports.normalizeJoinPlanEntityReferences=Ce;exports.requireNormalizedDashboardInputs=Ve;exports.resolveDashboardFilterAutomaticTarget=qe;exports.resolveDashboardFilterInheritedTarget=Me;exports.resolveDashboardSqlFilterTarget=Je;
|
|
1
|
+
"use strict";var ge=Object.defineProperty;var pe=(e,t,n)=>t in e?ge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var H=(e,t,n)=>pe(e,typeof t!="symbol"?t+"":t,n);const m=require("./validators-DqIM0B3C.cjs");require("./analyze-result-contract-BX_nQmPN.cjs");require("../value-format-preferences/index.cjs");const be=require("./source-entity-resolution-DCAAS-y8.cjs"),ee=(e,t)=>{const n={};if(e===null||t===null)return t;const r=new Set([...Object.keys(e),...Object.keys(t)]);for(const i of r){if(!(i in e)&&i in t){n[i]=t[i];continue}if(i in e&&!(i in t)){n[i]=void 0;continue}const s=e[i],o=t[i];if(!x(s,o))if(Array.isArray(s)&&Array.isArray(o))n[i]=o;else if(W(s)&&W(o)){const d=ee(s,o);Object.keys(d).length>0&&(n[i]=d)}else n[i]=o}return n},x=(e,t)=>{if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((i,s)=>x(i,t[s]));const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>x(e[i],t[i]))}return!1},W=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),_=e=>{if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);if(Array.isArray(e))return e.map(n=>_(n));const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=_(e[n]));return t},G=/\[\[\s*param\.([A-Za-z0-9_.-]+)\s*\]\]/g,U=/\bparam\s*\(\s*(['"])([^'"]+)\1/g;function ye(e){const t=[];let n=0;for(;n<e.length;){const r=e.indexOf("{{",n),i=e.indexOf("{%",n);let s=-1,o="";if(r===-1?(s=i,o="%}"):i===-1||r<i?(s=r,o="}}"):(s=i,o="%}"),s===-1)break;const d=e.indexOf(o,s+2);if(d===-1){n=s+2;continue}t.push(e.slice(s+2,d)),n=d+2}return t}function M(e){var r,i;if(!e)return[];const t=new Set;let n;for(G.lastIndex=0;(n=G.exec(e))!==null;){const s=(r=n[1])==null?void 0:r.trim();s&&t.add(s)}for(const s of ye(e))for(U.lastIndex=0;(n=U.exec(s))!==null;){const o=(i=n[2])==null?void 0:i.trim();o&&t.add(o)}return Array.from(t)}function Ie(e){const t=new Set,n=new Map;for(const r of e.controlBindings||[])t.add(r.controlId),r.target==="sql_param"&&n.set(r.paramId,r.controlId);for(const r of M(e.sql))t.add(n.get(r)??r);return Array.from(t)}function te(e){const t=new Map,n=new Map;for(const r of e.controlBindings||[])r.target==="sql_param"&&n.set(r.paramId,r.controlId);for(const r of M(e.sql))t.set(r,{paramId:r,controlId:n.get(r)??r});return Array.from(t.values())}function Fe(e,t){var i;const n=(i=e.controlBindings)==null?void 0:i.map(s=>({...s,controlId:t.get(s.controlId)??s.controlId})),r=te(e).flatMap(({paramId:s,controlId:o})=>{var c;const d=t.get(o);return!d||d===o||(c=e.controlBindings)!=null&&c.some(a=>a.target==="sql_param"&&a.paramId===s)?[]:[{target:"sql_param",paramId:s,controlId:d}]});return r.length?[...n??[],...r]:n}function ne(e,t){var i,s;const n=e.source==="dashboardInputAlias"?((i=t.inputAliases)==null?void 0:i[e.variableName])??e:e,r=e.source==="dashboardInputAlias"&&n!==e?{...n,export:e.export??"label"}:n;return r.source==="dashboardInput"?{...r,inputId:((s=t.inputIds)==null?void 0:s[r.inputId])??r.inputId}:r}function Te(e,t){var i;const n={};for(const s of["cardIds","sheetIds","inputIds","controlIds","filterIds"]){const o={...t[s]};for(const[d,c]of Object.entries((e==null?void 0:e[s])??{}))o[d]=((i=t[s])==null?void 0:i[c])??c;Object.keys(o).length&&(n[s]=o)}const r={...t.inputAliases};for(const[s,o]of Object.entries((e==null?void 0:e.inputAliases)??{}))r[s]=ne(o,t);return Object.keys(r).length&&(n.inputAliases=r),n}function De(e,t){var i,s,o,d;const n=_(e);n.controlBindings=Fe(e,new Map(Object.entries(t.controlIds??{})));for(const c of n.controls??[])c.id=((i=t.controlIds)==null?void 0:i[c.id])??c.id;for(const c of n.inlineFilters??[])c.id=((s=t.filterIds)==null?void 0:s[c.id])??c.id;const r=c=>{var h,f,l;if(!c||typeof c!="object")return;if(Array.isArray(c)){c.forEach(r);return}const a=c;if(a.type==="variable"&&a.ref&&typeof a.ref=="object"){const g=a.ref;a.ref=g.source==="input"?{...g,inputId:((h=t.inputIds)==null?void 0:h[g.inputId])??g.inputId}:ne(g,t)}if(typeof a.entityId=="string"){const g=a.entityId;a.fieldScope==="card"&&(a.entityId=((f=t.cardIds)==null?void 0:f[g])??g),a.fieldScope==="sheet"&&(a.entityId=((l=t.sheetIds)==null?void 0:l[g])??g)}for(const[g,y]of Object.entries(a))g!=="linkedReferenceOverrides"&&r(y)};r(n);for(const c of Object.values(((o=n.customCardPreferences)==null?void 0:o.dataInputCardIds)??{}))c.cardId=((d=t.cardIds)==null?void 0:d[c.cardId])??c.cardId;return n}function C(e){return(e==null?void 0:e.trim())||void 0}function K(e){return e.split(".").at(-1)||e}function Q(e,t){var c,a;const n=C(t);if(!n)return;const r=K(n),i=C((c=e.fieldMeta)==null?void 0:c.name);if(i&&i!==n&&i!==r)return;const s=C((a=e.fieldMeta)==null?void 0:a.qualifiedFieldName);if(s&&K(s)!==r)return;const o=n.includes(".")?n:void 0,d=s!=null&&s.includes(".")?s:void 0;if(!(o&&d&&o!==d))return{leafName:r,...o||d?{qualifiedFieldName:o||d}:{}}}function Y(e,t){return Q(e,t)||Q({},t)}function V({source:e,sourceFieldName:t,target:n,targetFieldName:r}){const i=Y(e,t),s=Y(n,r);return!i||!s||i.leafName!==s.leafName?!1:s.qualifiedFieldName?i.qualifiedFieldName===s.qualifiedFieldName:!0}function $(e,t){var i,s;const n=Ne(e);if(n)return n;const r=(s=(i=e==null?void 0:e.fieldMeta)==null?void 0:i.nativeDataType)==null?void 0:s.trim();if(P(e==null?void 0:e.fieldMeta,t)&&r&&r!=="date"&&r!=="datetime")return r}function Ne(e){var n;const t=(n=e==null?void 0:e.nativeDataType)==null?void 0:n.trim();return t&&t!=="date"&&t!=="datetime"?t:void 0}function P(e,t){var o,d;const n=t.trim();if(!n)return!1;const r=n.split(".").at(-1),i=(o=e==null?void 0:e.qualifiedFieldName)==null?void 0:o.trim();if(i&&!(i===n||!i.includes(".")&&i===r))return!1;const s=(d=e==null?void 0:e.name)==null?void 0:d.trim();return s&&s!==n&&s!==r?!1:!!(i||s)}function ve({fieldName:e,definition:t,value:n}){if((t==null?void 0:t.column)===e){const r=$(t,e);if(r)return r}return(n==null?void 0:n.name)===e?$(n,e):void 0}function ie({definition:e,value:t,sourceValue:n=t}){const r=e&&V({source:e,sourceFieldName:e.column,target:t,targetFieldName:t.name})?e:void 0,i=n&&V({source:n,sourceFieldName:n.name,target:t,targetFieldName:t.name})?n:void 0,s=(r?$(r,r.column):void 0)||(i?$(i,i.name):void 0);return re({carrier:t,nativeDataType:s,projectNestedNativeDataType:P(t.fieldMeta,t.name)})}function _e({filterDefinitions:e,filterValues:t}){if(!(e!=null&&e.length)||!t.length)return t;const n=new Map(e.map(s=>[s.id,s]));let r=!1;const i=t.map(s=>{if(typeof s.name!="string"||!s.name.trim())return s;const o=n.get(s.filterId);if(!o)return s;const d=ie({definition:o,value:s});return r||(r=d!==s),d});return r?i:t}function $e(e){const t=ve({fieldName:e.column,definition:e});return re({carrier:e,nativeDataType:t,projectNestedNativeDataType:P(e.fieldMeta,e.column)})}function re({carrier:e,nativeDataType:t,projectNestedNativeDataType:n}){var a;const r=(a=e.fieldMeta)==null?void 0:a.nativeDataType;if(t){if(e.nativeDataType===t&&(!e.fieldMeta||(n?r===t:!r)))return e;const{nativeDataType:h,...f}=e.fieldMeta||{};return{...e,nativeDataType:t,...e.fieldMeta?{fieldMeta:n?{...e.fieldMeta,nativeDataType:t}:f}:{}}}if(e.nativeDataType===void 0&&r===void 0)return e;const{nativeDataType:i,fieldMeta:s,...o}=e,{nativeDataType:d,...c}=s||{};return{...o,...s?{fieldMeta:c}:{}}}function u(e){return typeof e=="string"&&e.trim().length>0?e.trim():null}function se(e){return Array.from(new Set(e.filter(t=>!!t)))}function Ae(e){const t=u(e.table),n=u(e.schema),r=u(e.catalog)||u(e.database);return t?se([t,n?`${n}.${t}`:null,r?`${r}.${t}`:null,r&&n?`${r}.${n}.${t}`:null]):[]}function X(e){const t=u(e.table)||u(e.tableName);return se([u(e.name),u(e.alias),...Ae({table:t,schema:u(e.schema)||u(e.schemaName),catalog:u(e.catalog),database:u(e.database)||u(e.databaseName)})])}function Ee(e,t){const n=u(e.domainId),r=u(t.domainId);if(n&&r&&n!==r)return!0;if(e.type==="dataset")return!1;const i=u(e.id),s=u(t.id);if(i&&s&&i!==s)return!0;const o=u(e.connectionId),d=u(t.connectionId);return!!(o&&d&&o!==d)}function w(e,t=!1){return u(e.table)||u(e.tableName)||(e.type!=="dataset"||t?u(e.name):null)}function O(e){return u(e.catalog)||u(e.database)||u(e.databaseName)}function z(e){return u(e.schema)||u(e.schemaName)}function N(e){return e.length===1?e[0]:void 0}function ke(e,t){const n=w(t,!0),r=O(t),i=z(t);if(!(!n||!r&&!i))return N(e.filter(s=>{const o=s;return!(w(o)!==n||r&&O(o)!==r||i&&z(o)!==i)}))}function A(e,t){if(!t||!(e!=null&&e.length))return;const n=e.filter(d=>!Ee(d,t));if(t.type==="dataset"){const d=u(t.id);if(d)return N(n.filter(a=>a.type==="dataset"&&u(a.id)===d));if(u(t.domainId)){const a=u(t.name);return N(n.filter(h=>h.type==="dataset"&&u(h.name)===a))}}let r=[];if(t.type==="dataset"){const d=u(t.name);if(r=n.filter(c=>c.type==="dataset"&&u(c.name)===d),r.length===1)return r[0]}if(!!(w(t,!0)&&(O(t)||z(t))))return ke(n,t);if(r.length>1)return;const s=X(t);if(s.length===0)return;const o=n.filter(d=>X(d).some(a=>s.includes(a)));return N(o)}function R(e,t){const n=A(e,t);return n?{...t,...n}:t}function Ce(e,t){const n=t||[];return n.length===0?e:{...e,baseEntity:R(n,e.baseEntity),joins:e.joins.map(r=>({...r,source:R(n,r.source),target:R(n,r.target)}))}}function Re(e,t){if(!(e!=null&&e.joins.length))return[];const n=[e.baseEntity,...e.joins.flatMap(i=>[i.source,i.target])],r=[];return n.forEach(i=>{!A(t,i)&&!A(r,i)&&r.push(i)}),r}function F(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function v(e){return F(e)&&typeof e.name=="string"}function S(e){return!F(e)||e.kind!=="semantic"&&e.kind!=="physical"||(e.kind==="semantic"?[e.datasetId,e.datasetName,e.connectionId]:[e.databaseName,e.schemaName]).some(n=>n!==void 0&&typeof n!="string")?!1:m.hasCompleteSemaphorSourceIdentity(e)}function q(e,t){var a,h;const n=Array.isArray(t==null?void 0:t.selectedEntities)?t.selectedEntities.filter(v):void 0,r=A(n,e),i=r?{...e,...r}:e,s="domainId"in i&&typeof i.domainId=="string"&&!!i.domainId.trim();if((t==null?void 0:t.mode)==="semanticDomain"&&!s)return;if((t==null?void 0:t.mode)!=="database"&&i.type==="dataset"){const f=be.resolveSemaphorSemanticDatasetEntity({entities:[i],semanticDomainId:t==null?void 0:t.semanticDomainId,connectionId:t==null?void 0:t.connectionId,fieldEntityType:"dataset"},{includePhysicalDatasets:!0});if(f.kind==="resolved"){const l="label"in i&&typeof i.label=="string"?i.label:void 0;return{...f.source,...l?{label:l}:{}}}}if((t==null?void 0:t.mode)==="semanticDomain")return;const o=i.connectionId||(t==null?void 0:t.connectionId),d=i.type==="dataset"&&"table"in i&&i.table?i.table:i.name;if(!o||!d)return;const c={kind:"physical",connectionId:o,connectionType:i.connectionType||(t==null?void 0:t.connectionType),tableName:d,databaseName:i.database||((a=t==null?void 0:t.dbSelection)==null?void 0:a.database),schemaName:i.schema||((h=t==null?void 0:t.dbSelection)==null?void 0:h.schema),dialect:i.dialect};return S(c)?c:void 0}function xe(e,t){var d,c;const n=q(e,t);if(!n)return;const r=e.type==="dataset"&&"table"in e&&typeof e.table=="string"?e.table.trim():void 0,i=n.kind==="physical"?n.tableName:r,s=e.connectionId||(t==null?void 0:t.connectionId),o=i&&s?{connectionId:s,databaseName:e.database||((d=t==null?void 0:t.dbSelection)==null?void 0:d.database),schemaName:e.schema||((c=t==null?void 0:t.dbSelection)==null?void 0:c.schema),tableName:i}:void 0;return{source:n,...o?{executionTable:o}:{}}}function oe(e){const t=F(e.dataSource)?e.dataSource:void 0;if(typeof e.sql=="string"&&e.sql.trim()){const o=[],d=Array.isArray(t==null?void 0:t.selectedEntities)?t.selectedEntities:[];for(const c of d){if(!v(c))continue;const a=xe(c,t);a&&!o.some(h=>m.semaphorSourcesReferToSameDataset(h.source,a.source))&&o.push(a)}return{cardId:e.id,kind:"sql",pinnedCatalogSources:o}}if(!F(e.config))return{cardId:e.id,kind:"unconfigured"};const n=[],r=F(e.config.matrixIntent)?e.config.matrixIntent:void 0,i=e.type==="matrixTable"?(r==null?void 0:r.kind)==="matrix"?r.source:e.config.source:void 0;S(i)&&n.push(i);const s=F(e.config.joinPlan)?e.config.joinPlan:void 0;if(s){const o=Array.isArray(s.joins)?s.joins:[],d=[s.baseEntity];for(const a of o)F(a)&&d.push(a.source,a.target);let c=!1;for(const a of d){if(!v(a)){c=!0;continue}const h=q(a,t);h?n.push(h):c=!0}c&&(n.length=0)}else if(e.type!=="matrixTable"){const o=Array.isArray(t==null?void 0:t.selectedEntities)?t.selectedEntities:[];if(o.length===1&&v(o[0])){const d=q(o[0],t);d&&n.push(d)}}if(!n.length&&!s&&e.type!=="matrixTable"){const o=e.config.queryBaseSource;S(o)&&n.push(o)}return{cardId:e.id,kind:"config",executableSources:m.mergeSemaphorSourcesByIdentity(n)}}function ae(e,t){return(e.kind==="config"?e.executableSources:e.kind==="sql"?e.pinnedCatalogSources.map(r=>r.source):[]).some(r=>m.semaphorSourcesReferToSameDataset(r,t))}function we(e,t){if(e.kind==="config")return e.executableSources.find(n=>m.semaphorSourcesReferToSameDataset(n,t))}function Oe(e,t){var n;return(n=B(e,t))==null?void 0:n.source}function B(e,t){if(e.kind==="sql")return e.pinnedCatalogSources.find(n=>m.semaphorSourcesReferToSameDataset(n.source,t))}function Z(e){const t=new Set;for(const n of[e.name,e.sourceField]){if(!n)continue;const r=m.normalizeAnalyticsCatalogName(n);if(!r)continue;t.add(r);const i=r.split("."),s=i[i.length-1];s&&t.add(s)}return t}function de(e,t){const n=m.normalizeAnalyticsCatalogDataType(e),r=m.normalizeAnalyticsCatalogDataType(t);return n==="unknown"||r==="unknown"?!1:(n==="date"||n==="datetime")&&(r==="date"||r==="datetime")?!0:n===r}function ze(e,t){return m.semaphorSourcesReferToSameDataset(e.field.source,t.field.source)&&m.normalizeAnalyticsCatalogName(e.field.name)===m.normalizeAnalyticsCatalogName(t.field.name)&&m.normalizeAnalyticsCatalogName(e.field.sourceField||e.field.name)===m.normalizeAnalyticsCatalogName(t.field.sourceField||t.field.name)}function ce(e,t){if(e.kind!=="field")return!1;const n=Z(t),r=Z(e.field);return de(t.dataType,e.field.dataType)&&[...r].some(i=>n.has(i))}function Se(e){const t=e.candidates.filter(n=>ce(n,e.logicalValueField));return t.length===1?{status:"matched",target:t[0]}:t.length>1?{status:"ambiguous"}:{status:"notApplicable"}}function qe(e){const t=[];for(const n of e.acceptedTargets)!de(e.logicalValueField.dataType,n.field.dataType)||t.some(r=>ze(r,n))||t.push(n);return t.length===1?{status:"matched",target:t[0]}:t.length>1?{status:"ambiguous"}:{status:"notApplicable"}}const Me=/\{\{-?\s*filters\s*\|\s*where\s*-?\}\}/i,Pe=/\{\{-?\s*filters\s*\|\s*and\s*-?\}\}/i,Be=/\bwhere\b/i;function le(e){return e!=null&&e.trim()?Me.test(e)||Pe.test(e):!1}function je(e){return!(e!=null&&e.trim())||le(e)?null:Be.test(e)?{helper:"{{ filters | and }}",description:"For queries with an existing WHERE clause."}:{helper:"{{ filters | where }}",description:"For queries without a WHERE clause."}}function Le(e){return(e.field.sourceField||e.field.name).trim()||void 0}function Je(e){if(e.inventory.kind!=="sql"||e.target.kind!=="field")return{status:"ineligible"};const t=B(e.inventory,e.target.field.source),n=Le(e.target);if(!t||!n)return{status:"ineligible"};if(t.executionTable){const o=[t.executionTable.databaseName,t.executionTable.schemaName,t.executionTable.tableName,n].filter(Boolean).join(".");return{status:"eligible",source:t.source,executionIdentifier:o}}if(e.inventory.pinnedCatalogSources.length!==1)return{status:"ineligible"};const r=m.normalizeAnalyticsCatalogName(n),i=(e.candidateTargets||[]).filter(o=>m.normalizeAnalyticsCatalogName(o.field.sourceField||o.field.name)===r),s=[];for(const o of i)s.some(d=>m.semaphorSourcesReferToSameDataset(d,o.field.source))||s.push(o.field.source);return s.length>1?{status:"ineligible"}:{status:"eligible",source:t.source,executionIdentifier:n}}class fe extends Error{constructor(n){super(n.map(r=>r.message).join(" "));H(this,"issues");this.name="DashboardFilterMappingContractError",this.issues=n}}const He={string:!0,number:!0,boolean:!0,date:!0,datetime:!0};function b(e){return typeof e=="string"&&e.trim().length>0}function p(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function D(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function We(e){if(!p(e))return!1;switch(e.kind){case"allSheets":return e.sheetKinds===void 0||D(e.sheetKinds)&&e.sheetKinds.every(t=>t==="dashboard"||t==="document");case"sheets":return D(e.sheetIds);case"cards":return D(e.cardIds);case"documentSections":return b(e.sheetId)&&D(e.sectionIds);default:return!1}}function Ge(e){return e==="shared"||e==="perSheet"||e==="perCard"||e==="perDocumentSection"}function Ue(e){return p(e)?b(e.id)&&b(e.column)&&b(e.dataType):!1}function Ke(e,t,n,r){var d;if(!p(t)){r.push({code:"invalid_option_source",path:n,message:`${n} must be a semantic or physical option source.`,inputId:e});return}const i=t.source,s=[["labelField",t.labelField],["valueField",t.valueField],["searchField",t.searchField]];if(!p(i)||i.kind!=="semantic"&&i.kind!=="physical"||!m.hasCompleteSemaphorSourceIdentity(i)||!p(t.labelField)||!p(t.valueField)||t.searchField!==void 0&&!p(t.searchField)||t.disambiguationFields!==void 0&&(!Array.isArray(t.disambiguationFields)||!t.disambiguationFields.every(p))){r.push({code:"invalid_option_source",path:n,message:`${n} must contain a valid semantic or physical source and field references.`,inputId:e});return}for(const[c,a]of s)a!==void 0&&p(a)&&(!b(a.name)||a.source!==void 0&&!m.semaphorSourcesReferToSameDataset(a.source,i))&&r.push({code:"invalid_option_source",path:`${n}.${c}`,message:`${n}.${c} must be a named field belonging to the declared option source.`,inputId:e});for(const[c,a]of((d=t.disambiguationFields)==null?void 0:d.entries())||[])(!p(a)||!b(a.name)||a.source!==void 0&&!m.semaphorSourcesReferToSameDataset(a.source,i))&&r.push({code:"invalid_option_source",path:`${n}.disambiguationFields[${c}]`,message:`${n}.disambiguationFields[${c}] must be a named field belonging to the declared option source.`,inputId:e});const o=t.valueField;["string","number","boolean","date","datetime"].includes(String(o.dataType))||r.push({code:"invalid_option_source",path:`${n}.valueField.dataType`,message:`${n}.valueField.dataType must be a known option-value datatype.`,inputId:e})}function Qe(e,t,n,r,i,s){var a;if(b(t.bindingId)||i.push({code:"invalid_binding_id",path:`${n}.bindingId`,message:`${n}.bindingId must be an opaque non-empty id.`,inputId:e,cardId:t.cardId}),((a=t.target)==null?void 0:a.kind)!=="field"){i.push({code:"unsupported_target",path:`${n}.target`,message:`${n}.target must be one direct field target.`,inputId:e,cardId:t.cardId,bindingId:t.bindingId});return}const o=t.target.field;if(!b(o==null?void 0:o.name)||!o.source||o.source.kind!=="semantic"&&o.source.kind!=="physical"||!m.hasCompleteSemaphorSourceIdentity(o.source)){i.push({code:"invalid_target_field",path:`${n}.target.field`,message:`${n}.target.field must have a name and a source-qualified semantic or physical identity.`,inputId:e,cardId:t.cardId,bindingId:t.bindingId});return}if(Object.prototype.hasOwnProperty.call(He,o.dataType)||i.push({code:"unknown_target_data_type",path:`${n}.target.field.dataType`,message:`${n}.target.field.dataType must be known.`,inputId:e,cardId:t.cardId,bindingId:t.bindingId}),o.sourceField!==void 0&&!b(o.sourceField)&&i.push({code:"invalid_target_field",path:`${n}.target.field.sourceField`,message:`${n}.target.field.sourceField must be a non-empty catalog-grounded column when provided.`,inputId:e,cardId:t.cardId,bindingId:t.bindingId}),!s)return;const d=r.get(t.cardId);if(!d){i.push({code:"unknown_card",path:`${n}.cardId`,message:`${n}.cardId '${t.cardId}' does not exist.`,inputId:e,cardId:t.cardId,bindingId:t.bindingId});return}const c=oe(d);(c.kind==="unconfigured"||!ae(c,o.source))&&i.push({code:"unavailable_card_source",path:`${n}.target.field.source`,message:`${n}.target field source is not declared by card '${d.id}'.`,inputId:e,cardId:d.id,bindingId:t.bindingId})}function Ye(e,t,n,r,i,s){if(t===void 0)return;if(!p(t)||t.kind!=="cardMappings"||!Array.isArray(t.cards)){i.push({code:"invalid_application",path:n,message:`${n} must be a cardMappings application with a cards array.`,inputId:e});return}const o=new Set;t.cards.forEach((d,c)=>{const a=`${n}.cards[${c}]`;if(!b(d==null?void 0:d.cardId)){i.push({code:"unknown_card",path:`${a}.cardId`,message:`${a}.cardId is required.`,inputId:e});return}if(o.has(d.cardId)){i.push({code:"duplicate_card_application",path:`${a}.cardId`,message:`${n} contains more than one entry for card '${d.cardId}'.`,inputId:e,cardId:d.cardId});return}if(o.add(d.cardId),s&&!r.has(d.cardId)){i.push({code:"unknown_card",path:`${a}.cardId`,message:`${a}.cardId '${d.cardId}' does not exist.`,inputId:e,cardId:d.cardId});return}d.kind==="bound"?Qe(e,d,a,r,i,s):d.kind!=="excluded"&&i.push({code:"invalid_application",path:a,message:`${a}.kind must be 'bound' or 'excluded'.`,inputId:e,cardId:d.cardId})})}function ue({inputs:e,dashboardFilters:t,cards:n=[],validateCardTargets:r=!1}){const i=[],s=new Map((t||[]).map(a=>[a.id,a])),o=new Map(r?n.map(a=>[a.id,a]):[]),d=[],c=new Map;return e!=null&&!Array.isArray(e)?(i.push({code:"invalid_input",path:"dashboard.inputs",message:"dashboard.inputs must be an array when present."}),{ok:!1,inputs:d,issues:i}):((Array.isArray(e)?e:[]).forEach((a,h)=>{const f=`dashboard.inputs[${h}]`;if(!p(a)||a.kind!=="filter"&&a.kind!=="control"||!b(a.id)||!b(a.label)||!b(a.variableName)||!We(a.scope)||!Ge(a.runtimeScope)){i.push({code:"invalid_input",path:f,message:`${f} must be a complete filter or control Dashboard Input envelope.`,inputId:p(a)&&typeof a.id=="string"?a.id:void 0});return}if(a.kind==="control"&&!p(a.control)){i.push({code:"invalid_input",path:`${f}.control`,message:`${f}.control must be a control definition.`,inputId:a.id});return}const l=a;if(l.kind==="control"){d.push(l);return}const g=l.filter,y=l.filterReference,T=g!==void 0,j=!!y;if(T&&j){i.push({code:"both_filter_definitions",path:f,message:`${f} must contain either filter or filterReference, not both.`,inputId:l.id});return}if(!T&&!j){i.push({code:"missing_filter_definition",path:f,message:`${f} must contain filter or filterReference.`,inputId:l.id});return}if(T&&!Ue(g)){i.push({code:"invalid_input",path:`${f}.filter`,message:`${f}.filter must be a complete dashboard filter definition.`,inputId:l.id});return}let I,E;if(T)I=g,E="embedded";else{if((y==null?void 0:y.kind)!=="dashboardFilter"){i.push({code:"invalid_filter_reference",path:`${f}.filterReference.kind`,message:`${f}.filterReference.kind must be 'dashboardFilter'.`,inputId:l.id});return}const k=typeof(y==null?void 0:y.filterId)=="string"?y.filterId:void 0;if(I=k?s.get(k):void 0,E="dashboardFilter",!I){i.push({code:"orphaned_filter_reference",path:`${f}.filterReference.filterId`,message:`${f}.filterReference cannot resolve dashboard filter '${k||""}'.`,inputId:l.id});return}if(I.kind==="global-date"){i.push({code:"global_date_reference",path:`${f}.filterReference`,message:`${f}.filterReference cannot reference the Global Date filter.`,inputId:l.id});return}const J=c.get(I.id);if(J){i.push({code:"duplicate_filter_reference",path:`${f}.filterReference.filterId`,message:`${f}.filterReference duplicates dashboard filter '${I.id}' already owned by Dashboard Input '${J}'.`,inputId:l.id});return}c.set(I.id,l.id)}if(!I)return;if(l.forceSelection!==void 0&&typeof l.forceSelection!="boolean"&&i.push({code:"invalid_input",path:`${f}.forceSelection`,message:`${f}.forceSelection must be a boolean.`,inputId:l.id}),l.optionSource!==void 0&&Ke(l.id,l.optionSource,`${f}.optionSource`,i),l.application&&I.kind==="global-date"){i.push({code:"global_date_reference",path:`${f}.application`,message:`${f}.application cannot map the Global Date filter.`,inputId:l.id});return}l.application&&l.scope.kind!=="allSheets"&&l.scope.kind!=="sheets"&&i.push({code:"unsupported_mapped_scope",path:`${f}.scope`,message:`${f}.scope must be allSheets or sheets when cardMappings are present.`,inputId:l.id}),Ye(l.id,l.application,`${f}.application`,o,i,r);const{filter:tt,filterReference:nt,compatibility:L,...he}=l;d.push({...he,filter:I,...T&&L?{compatibility:L}:{},...l.optionSource?{optionSource:l.optionSource}:{},definitionOrigin:E})}),i.length?{ok:!1,inputs:d,issues:i}:{ok:!0,inputs:d})}function Ve(e){const t=ue(e);if(!t.ok)throw new fe(t.issues);return t.inputs}function Xe(e=()=>globalThis.crypto.randomUUID()){return e()}const Ze={date:new Set(["between","not between","=","!=",">",">=","<","<=","is null","is not null"]),number:new Set(["between","not between","=","!=",">",">=","<","<=","in","not in","is null","is not null"]),string:new Set(["=","!=","in","not in","like","not like","is null","is not null"]),boolean:new Set(["=","!=","in","not in","is null","is not null"])};function me(e){const t=m.normalizeAnalyticsCatalogDataType(e);return t==="number"||t==="boolean"?t:t==="date"||t==="datetime"?"date":"string"}function et(e,t){return typeof t!="string"?!1:Ze[me(e)].has(t)}exports.DashboardFilterMappingContractError=fe;exports.applyCardReferenceRemapping=De;exports.buildDashboardCardSourceIndex=oe;exports.cloneDeep=_;exports.composeCardReferenceRemapping=Te;exports.createDashboardFilterBindingId=Xe;exports.dashboardCardFilterSourceInventoryContains=ae;exports.dashboardFilterTargetMatchesLogicalValue=ce;exports.dashboardFilterValueTypeForDataType=me;exports.extractParamControlIdsFromSql=M;exports.extractReferencedControlIds=Ie;exports.extractSqlParamReferences=te;exports.findDashboardCardExecutableSource=we;exports.findDashboardCardPinnedCatalogSource=Oe;exports.findDashboardSqlPinnedCatalogSource=B;exports.findOrphanedJoinPlanEntities=Re;exports.getDashboardFilterSubscriptionHint=je;exports.getObjectDiff=ee;exports.hasDashboardFilterSubscription=le;exports.isDashboardFilterOperationCompatible=et;exports.materializeFilterDefinitionNativeDataType=$e;exports.materializeFilterValueNativeDataType=ie;exports.materializeFilterValuesNativeDataType=_e;exports.normalizeDashboardInputs=ue;exports.normalizeJoinPlanEntityReferences=Ce;exports.requireNormalizedDashboardInputs=Ve;exports.resolveDashboardFilterAutomaticTarget=Se;exports.resolveDashboardFilterInheritedTarget=qe;exports.resolveDashboardSqlFilterTarget=Je;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var de = Object.defineProperty;
|
|
2
2
|
var ce = (e, t, n) => t in e ? de(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
-
var
|
|
3
|
+
var W = (e, t, n) => ce(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import { ai as I, ak as le, j, C as T, F as x } from "./validators-D3AarM2T.js";
|
|
5
5
|
import "./analyze-result-contract-DsiAzCYn.js";
|
|
6
6
|
import "../value-format-preferences/index.js";
|
|
@@ -23,7 +23,7 @@ const ue = (e, t) => {
|
|
|
23
23
|
if (!w(r, o))
|
|
24
24
|
if (Array.isArray(r) && Array.isArray(o))
|
|
25
25
|
n[i] = o;
|
|
26
|
-
else if (
|
|
26
|
+
else if (G(r) && G(o)) {
|
|
27
27
|
const d = ue(r, o);
|
|
28
28
|
Object.keys(d).length > 0 && (n[i] = d);
|
|
29
29
|
} else
|
|
@@ -39,7 +39,7 @@ const ue = (e, t) => {
|
|
|
39
39
|
return n.length !== s.length ? !1 : n.every((i) => w(e[i], t[i]));
|
|
40
40
|
}
|
|
41
41
|
return !1;
|
|
42
|
-
},
|
|
42
|
+
}, G = (e) => e !== null && typeof e == "object" && !Array.isArray(e), O = (e) => {
|
|
43
43
|
if (e === null || typeof e != "object")
|
|
44
44
|
return e;
|
|
45
45
|
if (e instanceof Date)
|
|
@@ -52,7 +52,7 @@ const ue = (e, t) => {
|
|
|
52
52
|
for (const n in e)
|
|
53
53
|
Object.prototype.hasOwnProperty.call(e, n) && (t[n] = O(e[n]));
|
|
54
54
|
return t;
|
|
55
|
-
},
|
|
55
|
+
}, U = /\[\[\s*param\.([A-Za-z0-9_.-]+)\s*\]\]/g, K = /\bparam\s*\(\s*(['"])([^'"]+)\1/g;
|
|
56
56
|
function me(e) {
|
|
57
57
|
const t = [];
|
|
58
58
|
let n = 0;
|
|
@@ -76,18 +76,18 @@ function te(e) {
|
|
|
76
76
|
return [];
|
|
77
77
|
const t = /* @__PURE__ */ new Set();
|
|
78
78
|
let n;
|
|
79
|
-
for (
|
|
79
|
+
for (U.lastIndex = 0; (n = U.exec(e)) !== null; ) {
|
|
80
80
|
const r = (s = n[1]) == null ? void 0 : s.trim();
|
|
81
81
|
r && t.add(r);
|
|
82
82
|
}
|
|
83
83
|
for (const r of me(e))
|
|
84
|
-
for (
|
|
84
|
+
for (K.lastIndex = 0; (n = K.exec(r)) !== null; ) {
|
|
85
85
|
const o = (i = n[2]) == null ? void 0 : i.trim();
|
|
86
86
|
o && t.add(o);
|
|
87
87
|
}
|
|
88
88
|
return Array.from(t);
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function Ye(e) {
|
|
91
91
|
const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map();
|
|
92
92
|
for (const s of e.controlBindings || [])
|
|
93
93
|
t.add(s.controlId), s.target === "sql_param" && n.set(s.paramId, s.controlId);
|
|
@@ -162,7 +162,7 @@ function Ze(e, t) {
|
|
|
162
162
|
for (const c of n.inlineFilters ?? [])
|
|
163
163
|
c.id = ((r = t.filterIds) == null ? void 0 : r[c.id]) ?? c.id;
|
|
164
164
|
const s = (c) => {
|
|
165
|
-
var m, f,
|
|
165
|
+
var m, f, l;
|
|
166
166
|
if (!c || typeof c != "object") return;
|
|
167
167
|
if (Array.isArray(c)) {
|
|
168
168
|
c.forEach(s);
|
|
@@ -175,7 +175,7 @@ function Ze(e, t) {
|
|
|
175
175
|
}
|
|
176
176
|
if (typeof a.entityId == "string") {
|
|
177
177
|
const g = a.entityId;
|
|
178
|
-
a.fieldScope === "card" && (a.entityId = ((f = t.cardIds) == null ? void 0 : f[g]) ?? g), a.fieldScope === "sheet" && (a.entityId = ((
|
|
178
|
+
a.fieldScope === "card" && (a.entityId = ((f = t.cardIds) == null ? void 0 : f[g]) ?? g), a.fieldScope === "sheet" && (a.entityId = ((l = t.sheetIds) == null ? void 0 : l[g]) ?? g);
|
|
179
179
|
}
|
|
180
180
|
for (const [g, b] of Object.entries(a))
|
|
181
181
|
g !== "linkedReferenceOverrides" && s(b);
|
|
@@ -190,20 +190,20 @@ function Ze(e, t) {
|
|
|
190
190
|
function R(e) {
|
|
191
191
|
return (e == null ? void 0 : e.trim()) || void 0;
|
|
192
192
|
}
|
|
193
|
-
function
|
|
193
|
+
function Q(e) {
|
|
194
194
|
return e.split(".").at(-1) || e;
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function Y(e, t) {
|
|
197
197
|
var c, a;
|
|
198
198
|
const n = R(t);
|
|
199
199
|
if (!n) return;
|
|
200
|
-
const s =
|
|
200
|
+
const s = Q(n), i = R((c = e.fieldMeta) == null ? void 0 : c.name);
|
|
201
201
|
if (i && i !== n && i !== s)
|
|
202
202
|
return;
|
|
203
203
|
const r = R(
|
|
204
204
|
(a = e.fieldMeta) == null ? void 0 : a.qualifiedFieldName
|
|
205
205
|
);
|
|
206
|
-
if (r &&
|
|
206
|
+
if (r && Q(r) !== s)
|
|
207
207
|
return;
|
|
208
208
|
const o = n.includes(".") ? n : void 0, d = r != null && r.includes(".") ? r : void 0;
|
|
209
209
|
if (!(o && d && o !== d))
|
|
@@ -215,7 +215,7 @@ function S(e, t) {
|
|
|
215
215
|
};
|
|
216
216
|
}
|
|
217
217
|
function X(e, t) {
|
|
218
|
-
return
|
|
218
|
+
return Y(e, t) || Y({}, t);
|
|
219
219
|
}
|
|
220
220
|
function Z({
|
|
221
221
|
source: e,
|
|
@@ -364,14 +364,14 @@ function ie({
|
|
|
364
364
|
...r ? { fieldMeta: c } : {}
|
|
365
365
|
};
|
|
366
366
|
}
|
|
367
|
-
function
|
|
367
|
+
function u(e) {
|
|
368
368
|
return typeof e == "string" && e.trim().length > 0 ? e.trim() : null;
|
|
369
369
|
}
|
|
370
370
|
function se(e) {
|
|
371
371
|
return Array.from(new Set(e.filter((t) => !!t)));
|
|
372
372
|
}
|
|
373
373
|
function Ie(e) {
|
|
374
|
-
const t =
|
|
374
|
+
const t = u(e.table), n = u(e.schema), s = u(e.catalog) || u(e.database);
|
|
375
375
|
return t ? se([
|
|
376
376
|
t,
|
|
377
377
|
n ? `${n}.${t}` : null,
|
|
@@ -380,38 +380,38 @@ function Ie(e) {
|
|
|
380
380
|
]) : [];
|
|
381
381
|
}
|
|
382
382
|
function V(e) {
|
|
383
|
-
const t =
|
|
383
|
+
const t = u(e.table) || u(e.tableName);
|
|
384
384
|
return se([
|
|
385
|
-
|
|
386
|
-
|
|
385
|
+
u(e.name),
|
|
386
|
+
u(e.alias),
|
|
387
387
|
...Ie({
|
|
388
388
|
table: t,
|
|
389
|
-
schema:
|
|
390
|
-
catalog:
|
|
391
|
-
database:
|
|
389
|
+
schema: u(e.schema) || u(e.schemaName),
|
|
390
|
+
catalog: u(e.catalog),
|
|
391
|
+
database: u(e.database) || u(e.databaseName)
|
|
392
392
|
})
|
|
393
393
|
]);
|
|
394
394
|
}
|
|
395
395
|
function Fe(e, t) {
|
|
396
|
-
const n =
|
|
396
|
+
const n = u(e.domainId), s = u(t.domainId);
|
|
397
397
|
if (n && s && n !== s)
|
|
398
398
|
return !0;
|
|
399
399
|
if (e.type === "dataset")
|
|
400
400
|
return !1;
|
|
401
|
-
const i =
|
|
401
|
+
const i = u(e.id), r = u(t.id);
|
|
402
402
|
if (i && r && i !== r)
|
|
403
403
|
return !0;
|
|
404
|
-
const o =
|
|
404
|
+
const o = u(e.connectionId), d = u(t.connectionId);
|
|
405
405
|
return !!(o && d && o !== d);
|
|
406
406
|
}
|
|
407
407
|
function B(e, t = !1) {
|
|
408
|
-
return
|
|
408
|
+
return u(e.table) || u(e.tableName) || (e.type !== "dataset" || t ? u(e.name) : null);
|
|
409
409
|
}
|
|
410
410
|
function M(e) {
|
|
411
|
-
return
|
|
411
|
+
return u(e.catalog) || u(e.database) || u(e.databaseName);
|
|
412
412
|
}
|
|
413
413
|
function P(e) {
|
|
414
|
-
return
|
|
414
|
+
return u(e.schema) || u(e.schemaName);
|
|
415
415
|
}
|
|
416
416
|
function v(e) {
|
|
417
417
|
return e.length === 1 ? e[0] : void 0;
|
|
@@ -433,27 +433,27 @@ function E(e, t) {
|
|
|
433
433
|
(d) => !Fe(d, t)
|
|
434
434
|
);
|
|
435
435
|
if (t.type === "dataset") {
|
|
436
|
-
const d =
|
|
436
|
+
const d = u(t.id);
|
|
437
437
|
if (d)
|
|
438
438
|
return v(
|
|
439
439
|
n.filter(
|
|
440
|
-
(a) => a.type === "dataset" &&
|
|
440
|
+
(a) => a.type === "dataset" && u(a.id) === d
|
|
441
441
|
)
|
|
442
442
|
);
|
|
443
|
-
if (
|
|
444
|
-
const a =
|
|
443
|
+
if (u(t.domainId)) {
|
|
444
|
+
const a = u(t.name);
|
|
445
445
|
return v(
|
|
446
446
|
n.filter(
|
|
447
|
-
(m) => m.type === "dataset" &&
|
|
447
|
+
(m) => m.type === "dataset" && u(m.name) === a
|
|
448
448
|
)
|
|
449
449
|
);
|
|
450
450
|
}
|
|
451
451
|
}
|
|
452
452
|
let s = [];
|
|
453
453
|
if (t.type === "dataset") {
|
|
454
|
-
const d =
|
|
454
|
+
const d = u(t.name);
|
|
455
455
|
if (s = n.filter(
|
|
456
|
-
(c) => c.type === "dataset" &&
|
|
456
|
+
(c) => c.type === "dataset" && u(c.name) === d
|
|
457
457
|
), s.length === 1)
|
|
458
458
|
return s[0];
|
|
459
459
|
}
|
|
@@ -527,10 +527,10 @@ function z(e, t) {
|
|
|
527
527
|
{ includePhysicalDatasets: !0 }
|
|
528
528
|
);
|
|
529
529
|
if (f.kind === "resolved") {
|
|
530
|
-
const
|
|
530
|
+
const l = "label" in i && typeof i.label == "string" ? i.label : void 0;
|
|
531
531
|
return {
|
|
532
532
|
...f.source,
|
|
533
|
-
...
|
|
533
|
+
...l ? { label: l } : {}
|
|
534
534
|
};
|
|
535
535
|
}
|
|
536
536
|
}
|
|
@@ -740,7 +740,7 @@ function dt(e) {
|
|
|
740
740
|
class xe extends Error {
|
|
741
741
|
constructor(n) {
|
|
742
742
|
super(n.map((s) => s.message).join(" "));
|
|
743
|
-
|
|
743
|
+
W(this, "issues");
|
|
744
744
|
this.name = "DashboardFilterMappingContractError", this.issues = n;
|
|
745
745
|
}
|
|
746
746
|
}
|
|
@@ -1003,18 +1003,18 @@ function je({
|
|
|
1003
1003
|
});
|
|
1004
1004
|
return;
|
|
1005
1005
|
}
|
|
1006
|
-
const
|
|
1007
|
-
if (
|
|
1008
|
-
d.push(
|
|
1006
|
+
const l = a;
|
|
1007
|
+
if (l.kind === "control") {
|
|
1008
|
+
d.push(l);
|
|
1009
1009
|
return;
|
|
1010
1010
|
}
|
|
1011
|
-
const g =
|
|
1011
|
+
const g = l.filter, b = l.filterReference, N = g !== void 0, J = !!b;
|
|
1012
1012
|
if (N && J) {
|
|
1013
1013
|
i.push({
|
|
1014
1014
|
code: "both_filter_definitions",
|
|
1015
1015
|
path: f,
|
|
1016
1016
|
message: `${f} must contain either filter or filterReference, not both.`,
|
|
1017
|
-
inputId:
|
|
1017
|
+
inputId: l.id
|
|
1018
1018
|
});
|
|
1019
1019
|
return;
|
|
1020
1020
|
}
|
|
@@ -1023,7 +1023,7 @@ function je({
|
|
|
1023
1023
|
code: "missing_filter_definition",
|
|
1024
1024
|
path: f,
|
|
1025
1025
|
message: `${f} must contain filter or filterReference.`,
|
|
1026
|
-
inputId:
|
|
1026
|
+
inputId: l.id
|
|
1027
1027
|
});
|
|
1028
1028
|
return;
|
|
1029
1029
|
}
|
|
@@ -1032,7 +1032,7 @@ function je({
|
|
|
1032
1032
|
code: "invalid_input",
|
|
1033
1033
|
path: `${f}.filter`,
|
|
1034
1034
|
message: `${f}.filter must be a complete dashboard filter definition.`,
|
|
1035
|
-
inputId:
|
|
1035
|
+
inputId: l.id
|
|
1036
1036
|
});
|
|
1037
1037
|
return;
|
|
1038
1038
|
}
|
|
@@ -1045,7 +1045,7 @@ function je({
|
|
|
1045
1045
|
code: "invalid_filter_reference",
|
|
1046
1046
|
path: `${f}.filterReference.kind`,
|
|
1047
1047
|
message: `${f}.filterReference.kind must be 'dashboardFilter'.`,
|
|
1048
|
-
inputId:
|
|
1048
|
+
inputId: l.id
|
|
1049
1049
|
});
|
|
1050
1050
|
return;
|
|
1051
1051
|
}
|
|
@@ -1055,7 +1055,7 @@ function je({
|
|
|
1055
1055
|
code: "orphaned_filter_reference",
|
|
1056
1056
|
path: `${f}.filterReference.filterId`,
|
|
1057
1057
|
message: `${f}.filterReference cannot resolve dashboard filter '${A || ""}'.`,
|
|
1058
|
-
inputId:
|
|
1058
|
+
inputId: l.id
|
|
1059
1059
|
});
|
|
1060
1060
|
return;
|
|
1061
1061
|
}
|
|
@@ -1064,45 +1064,50 @@ function je({
|
|
|
1064
1064
|
code: "global_date_reference",
|
|
1065
1065
|
path: `${f}.filterReference`,
|
|
1066
1066
|
message: `${f}.filterReference cannot reference the Global Date filter.`,
|
|
1067
|
-
inputId:
|
|
1067
|
+
inputId: l.id
|
|
1068
1068
|
});
|
|
1069
1069
|
return;
|
|
1070
1070
|
}
|
|
1071
|
-
const
|
|
1072
|
-
if (
|
|
1071
|
+
const S = c.get(y.id);
|
|
1072
|
+
if (S) {
|
|
1073
1073
|
i.push({
|
|
1074
1074
|
code: "duplicate_filter_reference",
|
|
1075
1075
|
path: `${f}.filterReference.filterId`,
|
|
1076
|
-
message: `${f}.filterReference duplicates dashboard filter '${y.id}' already owned by Dashboard Input '${
|
|
1077
|
-
inputId:
|
|
1076
|
+
message: `${f}.filterReference duplicates dashboard filter '${y.id}' already owned by Dashboard Input '${S}'.`,
|
|
1077
|
+
inputId: l.id
|
|
1078
1078
|
});
|
|
1079
1079
|
return;
|
|
1080
1080
|
}
|
|
1081
|
-
c.set(y.id,
|
|
1081
|
+
c.set(y.id, l.id);
|
|
1082
1082
|
}
|
|
1083
1083
|
if (!y) return;
|
|
1084
|
-
if (
|
|
1085
|
-
|
|
1086
|
-
|
|
1084
|
+
if (l.forceSelection !== void 0 && typeof l.forceSelection != "boolean" && i.push({
|
|
1085
|
+
code: "invalid_input",
|
|
1086
|
+
path: `${f}.forceSelection`,
|
|
1087
|
+
message: `${f}.forceSelection must be a boolean.`,
|
|
1088
|
+
inputId: l.id
|
|
1089
|
+
}), l.optionSource !== void 0 && Pe(
|
|
1090
|
+
l.id,
|
|
1091
|
+
l.optionSource,
|
|
1087
1092
|
`${f}.optionSource`,
|
|
1088
1093
|
i
|
|
1089
|
-
),
|
|
1094
|
+
), l.application && y.kind === "global-date") {
|
|
1090
1095
|
i.push({
|
|
1091
1096
|
code: "global_date_reference",
|
|
1092
1097
|
path: `${f}.application`,
|
|
1093
1098
|
message: `${f}.application cannot map the Global Date filter.`,
|
|
1094
|
-
inputId:
|
|
1099
|
+
inputId: l.id
|
|
1095
1100
|
});
|
|
1096
1101
|
return;
|
|
1097
1102
|
}
|
|
1098
|
-
|
|
1103
|
+
l.application && l.scope.kind !== "allSheets" && l.scope.kind !== "sheets" && i.push({
|
|
1099
1104
|
code: "unsupported_mapped_scope",
|
|
1100
1105
|
path: `${f}.scope`,
|
|
1101
1106
|
message: `${f}.scope must be allSheets or sheets when cardMappings are present.`,
|
|
1102
|
-
inputId:
|
|
1107
|
+
inputId: l.id
|
|
1103
1108
|
}), ze(
|
|
1104
|
-
|
|
1105
|
-
|
|
1109
|
+
l.id,
|
|
1110
|
+
l.application,
|
|
1106
1111
|
`${f}.application`,
|
|
1107
1112
|
o,
|
|
1108
1113
|
i,
|
|
@@ -1110,19 +1115,19 @@ function je({
|
|
|
1110
1115
|
);
|
|
1111
1116
|
const {
|
|
1112
1117
|
filter: He,
|
|
1113
|
-
filterReference:
|
|
1118
|
+
filterReference: Se,
|
|
1114
1119
|
// A reference-backed authored input must shadow the generated
|
|
1115
1120
|
// dashboard-filter compatibility input. Older writers may have copied
|
|
1116
1121
|
// the compatibility marker onto the reference; never preserve it.
|
|
1117
1122
|
compatibility: H,
|
|
1118
1123
|
...ae
|
|
1119
|
-
} =
|
|
1124
|
+
} = l;
|
|
1120
1125
|
d.push({
|
|
1121
1126
|
...ae,
|
|
1122
1127
|
filter: y,
|
|
1123
1128
|
...N && H ? { compatibility: H } : {},
|
|
1124
|
-
...
|
|
1125
|
-
optionSource:
|
|
1129
|
+
...l.optionSource ? {
|
|
1130
|
+
optionSource: l.optionSource
|
|
1126
1131
|
} : {},
|
|
1127
1132
|
definitionOrigin: D
|
|
1128
1133
|
});
|
|
@@ -1211,5 +1216,5 @@ export {
|
|
|
1211
1216
|
ue as w,
|
|
1212
1217
|
ge as x,
|
|
1213
1218
|
et as y,
|
|
1214
|
-
|
|
1219
|
+
Ye as z
|
|
1215
1220
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),o=require("react"),b=require("./x-B6ghREd2.cjs"),r=require("./switch-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),o=require("react"),b=require("./x-B6ghREd2.cjs"),r=require("./switch-D12C40LN.cjs");require("./card-config-utils-D3Xuu0ub.cjs");require("./validators-DqIM0B3C.cjs");require("./analyze-result-contract-BX_nQmPN.cjs");require("../value-format-preferences/index.cjs");require("./index-DhDfPZUu.cjs");require("./appearance-runtime-provider-BgNYdUYH.cjs");require("./appearance-context-DhyjbQk1.cjs");require("./index-ByFbacH7.cjs");require("./temporal-bucket-authoring-DueSgLJU.cjs");require("./color-CyB5o13F.cjs");require("react-dom");require("./index-CXeIDdjd.cjs");function S(){const t=r.useDashboardStore(e=>e.dashboard),d=r.useDashboardStore(e=>e.actions.setDashboard),c=r.useDashboardStore(e=>e.showDashboardJSON),h=r.useDashboardStore(e=>e.actions.setShowDashboardJSON),s=o.useMemo(()=>t?JSON.stringify(t,null,2):"",[t]),[l,n]=o.useState(s),i=o.useRef(s);return o.useEffect(()=>{s!==i.current&&(n(s),i.current=s)},[s]),a.jsxs("div",{className:r.cn("relative p-2",{hidden:!c}),children:[a.jsxs(r.Button,{variant:"secondary",size:"sm",className:"absolute right-2 top-2 z-10 h-8",onClick:()=>h(!1),children:[a.jsx(b.X,{className:"mr-2 h-4 w-4"}),"Close"]}),a.jsx("div",{className:"h-[550px] overflow-hidden",children:a.jsx(r.CodeEditor,{value:l,onValueChange:e=>{n(e);try{const u=JSON.parse(e);i.current=JSON.stringify(u,null,2),d(u)}catch{}},language:"json"})})]})}exports.default=S;
|