react-semaphor 0.1.260 → 0.1.262
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/chunks/dashboard-controls-AFlpiHtC.js +42 -0
- package/dist/chunks/dashboard-controls-Cq2fQ7bv.js +1979 -0
- package/dist/chunks/dashboard-filter-controls-button-Cedz-YZx.js +11 -0
- package/dist/chunks/dashboard-filter-controls-button-udrHABi3.js +1066 -0
- package/dist/chunks/{dashboard-json-BUrApiYl.js → dashboard-json-BU6cvmRP.js} +1 -1
- package/dist/chunks/{dashboard-json-U7VmojaR.js → dashboard-json-RKwWONKm.js} +1 -1
- package/dist/chunks/dashboard-summary-settings-dialog-Bl-XplTR.js +1 -0
- package/dist/chunks/dashboard-summary-settings-dialog-DDxHxKjp.js +535 -0
- package/dist/chunks/{edit-dashboard-visual-N2r5ObJ_.js → edit-dashboard-visual-B1r0Ho9B.js} +5970 -5492
- package/dist/chunks/edit-dashboard-visual-BwDFI3hI.js +188 -0
- package/dist/chunks/{index-BNdZjo5d.js → index-BtbNfaQD.js} +50751 -47206
- package/dist/chunks/index-DZ93VE76.js +1114 -0
- package/dist/chunks/{normalize-dashboard-for-dirty-check-Bn27S0PN.js → normalize-dashboard-for-dirty-check-5KpZN8xr.js} +20 -19
- package/dist/chunks/normalize-dashboard-for-dirty-check-BXRUMVb2.js +1 -0
- package/dist/chunks/{resource-management-panel-C_ZqsVMH.js → resource-management-panel-Cz7MYBC7.js} +1 -1
- package/dist/chunks/{resource-management-panel-zF23gLOJ.js → resource-management-panel-DxG6-naG.js} +70 -70
- package/dist/chunks/use-create-flow-overlay-state-BcMrPzMc.js +1445 -0
- package/dist/chunks/use-create-flow-overlay-state-D13D1vB_.js +21 -0
- package/dist/chunks/{use-visual-utils-BBTQGDdB.js → use-visual-utils-DScc5-p_.js} +1 -1
- package/dist/chunks/{use-visual-utils-K1k39w2U.js → use-visual-utils-DmxEKpor.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +5 -4
- package/dist/index.cjs +1 -1
- package/dist/index.js +102 -99
- package/dist/shared/index.cjs +1 -1
- package/dist/shared/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +5 -4
- package/dist/types/dashboard.d.ts +105 -0
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +4 -3
- package/dist/types/main.d.ts +175 -1
- package/dist/types/shared.d.ts +89 -0
- package/dist/types/surfboard.d.ts +105 -0
- package/dist/types/types.d.ts +113 -0
- package/package.json +1 -1
- package/dist/chunks/dashboard-controls-CIdYp98a.js +0 -47
- package/dist/chunks/dashboard-controls-DOqBYrkB.js +0 -1847
- package/dist/chunks/dashboard-summary-settings-dialog-CaxmCNyy.js +0 -1
- package/dist/chunks/dashboard-summary-settings-dialog-DlVBUQmC.js +0 -544
- package/dist/chunks/edit-dashboard-visual-uA-0wLnR.js +0 -193
- package/dist/chunks/editor-action-buttons-B6lABkRB.js +0 -412
- package/dist/chunks/editor-action-buttons-Dh7Xndgk.js +0 -21
- package/dist/chunks/index-DOeggx0V.js +0 -1109
- package/dist/chunks/normalize-dashboard-for-dirty-check-B7NQDI1H.js +0 -1
- package/dist/chunks/notification-bell-BxyeaeRc.js +0 -839
- package/dist/chunks/notification-bell-tJRds5JJ.js +0 -6
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";const e=require("./index-DZ93VE76.js"),t=require("react/jsx-runtime"),R=require("./use-visual-utils-DScc5-p_.js"),C=require("react");/**
|
|
2
|
+
* @license lucide-react v0.453.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const pe=e.createLucideIcon("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
7
|
+
* @license lucide-react v0.453.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const ne=e.createLucideIcon("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/**
|
|
12
|
+
* @license lucide-react v0.453.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const de=e.createLucideIcon("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
|
|
17
|
+
* @license lucide-react v0.453.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const W=e.createLucideIcon("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);function J(){var n,v;const l=e.useEditorStore(b=>b.card),r=e.useEditorStore(b=>b.frame),d=C.useMemo(()=>e.findCustomVisualConfigCard(r,l),[r,l]),{manifest:i}=e.useCustomVisual(((n=d==null?void 0:d.customCardPreferences)==null?void 0:n.url)||""),m=C.useMemo(()=>{var b;return(b=i==null?void 0:i.visuals)==null?void 0:b.find(h=>{var y;return h.name===((y=d==null?void 0:d.customCardPreferences)==null?void 0:y.componentName)})},[i,(v=d==null?void 0:d.customCardPreferences)==null?void 0:v.componentName]),f=e.resolveMultiInputType(d,m),p=C.useMemo(()=>e.getCustomVisualInputCards({frame:r,configCard:d,isMultiInputVisual:f==="multiple"}),[r,d,f]),x=C.useMemo(()=>{const b=p.findIndex(h=>(h==null?void 0:h.id)===l.id);return b<0?-1:e.getSlotIndexForCard(l,b)},[p,l]);return C.useMemo(()=>!d||f!=="multiple"||x<0?l.type:e.getEffectiveCardTypeForSlot(l,x,m==null?void 0:m.slots)??l.type,[d,f,x,l,m==null?void 0:m.slots])}function xe({type:l,isLinked:r,className:d,showLabel:i=!1,showLocal:m=!1}){const f=e.useDashboardStore(E=>E.selectedFrameId),p=e.useManagementStore(E=>E.selectedVisual),x=e.useEditorStore(E=>E.frame);let n;if(l)n=l;else if(r!==void 0)n=r?"linked":"library";else if(!!!(x!=null&&x.visualId||p!=null&&p.id)&&f)n="local";else if(p&&!f)n="library";else if(x!=null&&x.visualId&&f)n="linked";else if(p!=null&&p.id&&f)n="library";else return null;if(n==="local"&&!m)return null;const v={local:"border-slate-200/70 bg-slate-50/80 text-slate-700 shadow-sm hover:bg-slate-100/80 dark:border-slate-700 dark:bg-slate-900/70 dark:text-slate-200 dark:hover:bg-slate-800/80",linked:"border-purple-200/70 bg-gradient-to-r from-purple-50/50 to-purple-100/30 text-purple-900 shadow-sm hover:from-purple-100/60 hover:to-purple-100/50 hover:shadow-md dark:border-purple-800/50 dark:from-purple-950/40 dark:to-purple-900/30 dark:text-purple-100 dark:hover:from-purple-950/60 dark:hover:to-purple-900/50",library:"border-blue-200/70 bg-gradient-to-r from-blue-50/50 to-blue-100/30 text-blue-900 shadow-sm hover:from-blue-100/60 hover:to-blue-100/50 hover:shadow-md dark:border-blue-800/50 dark:from-blue-950/40 dark:to-blue-900/30 dark:text-blue-100 dark:hover:from-blue-950/60 dark:hover:to-blue-900/50"},b={local:"Local to this dashboard: Changes made here only affect this dashboard copy.",linked:"Linked to library: Changes made here update the library visual and all linked instances.",library:"Library visual: Share and reuse this visual across multiple dashboards."},h={local:"border-slate-200 bg-slate-50 text-slate-900 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-100",linked:"border-purple-200 bg-purple-50 text-purple-900 dark:border-purple-800 dark:bg-purple-950 dark:text-purple-100",library:"border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-100"},y={local:"fill-slate-50 dark:fill-slate-900",linked:"fill-purple-50 dark:fill-purple-950",library:"fill-blue-50 dark:fill-blue-950"},j={local:t.jsx("span",{className:"h-2 w-2 rounded-full bg-current/70"}),linked:t.jsx(de,{className:"h-3.5 w-3.5"}),library:t.jsx(ne,{className:"h-3.5 w-3.5"})},L={local:"Local",linked:"Linked",library:"Library"};return t.jsx(e.TooltipProvider,{children:t.jsxs(e.Tooltip,{delayDuration:300,children:[t.jsx(e.TooltipTrigger,{asChild:!0,children:t.jsxs(e.Badge,{variant:"outline",className:e.cn("cursor-help select-none transition-all",v[n],d),children:[j[n],i&&t.jsx("span",{className:"ml-1 text-xs font-medium leading-none",children:L[n]})]})}),t.jsxs(e.TooltipContent,{side:"bottom",className:e.cn("max-w-xs",h[n]),children:[t.jsx(e.TooltipArrow,{className:y[n]}),t.jsx("p",{children:b[n]})]})]})})}function he(l,r){return{...l,sql:"",python:"",config:void 0,customCfg:"",preferences:{},interactionConfig:void 0,linkedInteractionTargetOverrides:void 0,customCardPreferences:r?l.customCardPreferences:void 0,type:r?l.type:"bar"}}function fe({className:l,variant:r="outline"}){var x;const{setCardSql:d}=e.useEditorActions();e.useEditorStore(n=>n.frame);const i=e.useEditorStore(n=>n.card);R.useRemoteChartStore(((x=i.customCardPreferences)==null?void 0:x.url)||""),e.useEditorStore(n=>n.selectedSchemaName),e.useEditorStore(n=>n.selectedDatamodelId),e.useEditorStore(n=>n.selectedDatabaseName),e.useEditorStore(n=>n.selectedTableName),e.useEditorStore(n=>n.selectedConnectionId),e.useEditorStore(n=>n.isShowingVisual),i.sql;const m=e.useEditorStore(n=>n.onSave),{getUpdatedFrame:f}=R.useVisualUtils();function p(){const n=f();m==null||m(n)}return t.jsxs(e.Button,{onClick:p,className:e.cn("h-8",l),size:"sm",variant:r,children:[t.jsx(e.Check,{className:"mr-2 size-4 font-bold"}),"Accept"]})}function be({className:l,variant:r="default"}){const d=e.useQueryClient(),[i,m]=C.useState(!1),f=e.useDashboardStore(y=>y.actions.setIsDashboardPanelOpen),{setIsVisualEditing:p}=e.useDashboardActions(),{getUpdatedFrame:x}=R.useVisualUtils(),n=e.useSelectedVisual(),v=e.useEditorStore(y=>y.frame),b=e.useUpdateVisualMutation(),h=()=>{const y=x(),j=(v==null?void 0:v.visualId)||(n==null?void 0:n.id);if(!j){e.ue.error("No visual to save");return}m(!0),b.mutate({visualId:j,data:{frameObject:y}},{onSuccess:()=>{m(!1),f(!0),e.ue.success("Visual updated successfully"),d.invalidateQueries({queryKey:["resource-by-id","visual",j],exact:!0})},onError:()=>{m(!1),e.ue.error("Failed to update visual")}})};return t.jsxs(e.Button,{onClick:h,className:e.cn("h-8",l),size:"sm",variant:r,children:[i&&t.jsxs(t.Fragment,{children:[t.jsx(e.LoaderCircle,{className:"mr-2 size-4 animate-spin font-bold"})," Saving"]}),!i&&t.jsxs(t.Fragment,{children:[t.jsx(W,{className:"mr-2 size-4 font-bold"}),"Save to Library"]})]})}function ye({className:l}){const r=e.useQueryClient(),[d,i]=C.useState(!1),m=e.useSelectedVisual(),f=e.useEditorStore(y=>y.frame),p=e.useDashboardStore(y=>y.selectedSheetId),{updateFrame:x,setIsVisualEditing:n}=e.useDashboardActions(),{getUpdatedFrame:v}=R.useVisualUtils(),b=e.useUpdateVisualMutation(),h=async()=>{if(!p){e.ue.error("No sheet selected");return}const y=(f==null?void 0:f.visualId)||(m==null?void 0:m.id);if(!y){e.ue.error("No visual to update");return}i(!0);try{const j=v();await b.mutateAsync({visualId:y,data:{frameObject:j}});const L={...j,visualId:y};x(p,L),r.invalidateQueries({queryKey:["visuals"]}),r.invalidateQueries({queryKey:["visual",y]}),e.ue.success("Saved to library and applied locally"),setTimeout(()=>{n(!1)},300)}catch(j){console.error("Failed to save and apply:",j),e.ue.error("Failed to save and apply changes")}finally{i(!1)}};return t.jsx(e.Button,{onClick:h,className:e.cn("h-8",l),size:"sm",variant:"default",disabled:d,children:d?t.jsxs(t.Fragment,{children:[t.jsx(e.LoaderCircle,{className:"mr-2 size-4 animate-spin font-bold"})," Saving..."]}):t.jsxs(t.Fragment,{children:[t.jsx(W,{className:"mr-2 size-4 font-bold"}),"Save & Apply"]})})}function ge({className:l}){const{setTempQueryData:r,setSqlGen:d}=e.useEditorActions(),i=e.useQueryClient(),m=e.useEditorStore(h=>h.tempQueryData),f=e.useEditorStore(h=>h.onClose),p=e.useEditorStore(h=>h.card),x=J(),n=C.useMemo(()=>x!==p.type?{...p,type:x}:p,[p,x]),{queryKey:v}=e.useDashboardCardQuery(n);function b(){if(m){const{queryKey:h,queryData:y}=m;h&&y&&i.setQueryData(h,y)}d({}),f==null||f()}return t.jsxs(e.Button,{onClick:b,className:e.cn("h-8",l),size:"sm",variant:"outline",children:[t.jsx(e.X,{className:"mr-2 size-4"}),"Close"]})}function Ce({label:l="Clear",variant:r="secondary",className:d}={}){const{setTempQueryData:i}=e.useEditorActions(),m=e.useQueryClient(),f=e.useEditorStore(a=>a.tempQueryData),p=e.useEditorStore(a=>a.card),x=J(),n=C.useMemo(()=>x!==p.type?{...p,type:x}:p,[p,x]),{queryKey:v}=e.useDashboardCardQuery(n),{setCardSql:b,setSqlGen:h,setCardPython:y,setCardCustomCfg:j,setCardPreferences:L,clearQueryConfig:E,setCardConfig:K,setCardType:P,setFrame:z,setCard:M,setActiveTabCardId:H}=e.useEditorActions();function q(){var F,U,_,I;const a=m.getQueryData(v);f!=null&&f.queryData||i({queryKey:v,queryData:a}),m.setQueryData(v,null),m.removeQueries({queryKey:v,exact:!0}),b(""),h({}),E(),K(void 0),y(""),j(""),L({});const k=e.useEditorStore.getState().frame,O=e.useEditorStore.getState().card,T=e.findCustomVisualConfigCard(k,O),D=((F=T==null?void 0:T.customCardPreferences)==null?void 0:F.visualType)==="multiple"||!!((U=T==null?void 0:T.customCardPreferences)!=null&&U.dataInputCardIds)||(((_=T==null?void 0:T.customCardPreferences)==null?void 0:_.minInputs)||0)>1||(((I=T==null?void 0:T.customCardPreferences)==null?void 0:I.maxInputs)||0)>1,V=he(O,D);z({...k,cards:k.cards.map(B=>B.id===V.id?V:B)}),H(V.id),M(V),D||P("bar")}return t.jsxs(e.Button,{onClick:q,className:e.cn("h-8",d),size:"sm",variant:r,children:[t.jsx(e.X,{className:"mr-2 size-3.5"}),l]})}function oe(l){const{control:r,onChange:d}=l;return t.jsxs("div",{className:"space-y-1",children:[t.jsx(e.Label,{className:"text-xs",children:"Label"}),t.jsxs("div",{className:"relative",children:[t.jsx(e.Input,{className:"pr-40",value:r.label,placeholder:"Control label",onChange:i=>d(i.target.value)}),t.jsx(e.Badge,{variant:"outline",className:"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-xs",children:e.getFriendlyTypeOption(r.type).label})]})]})}function ve(l){const{currentStep:r,labels:d}=l;return t.jsx("div",{className:"sticky top-0 z-10 -mx-1 border-b bg-background/95 px-1 pb-2 pt-1 backdrop-blur supports-[backdrop-filter]:bg-background/85",children:t.jsx("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3",children:d.map((i,m)=>{const f=m+1,p=f===r,x=f<r;return t.jsxs(C.Fragment,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:e.cn("flex h-7 w-7 items-center justify-center rounded-full border text-[11px] font-semibold",p?"border-primary bg-primary text-primary-foreground":x?"border-primary/25 bg-primary/10 text-primary":"border-border bg-muted/30 text-muted-foreground"),children:f}),t.jsx("span",{className:e.cn("text-xs font-medium",p?"text-foreground":"text-muted-foreground"),children:i})]}),m<d.length-1?t.jsx("span",{className:"h-px w-5 bg-border/80 sm:w-8","aria-hidden":"true"}):null]},i)})})})}function Y(l){const{secondary:r,tertiary:d,primary:i}=l;return t.jsxs("div",{className:"sticky bottom-0 z-10 -mx-1 flex justify-end gap-2 border-t bg-background/95 px-1 pb-1 pt-3 backdrop-blur supports-[backdrop-filter]:bg-background/85",children:[r,d,i]})}function je(l){const{control:r,scope:d,detail:i}=l;return t.jsxs("div",{className:"flex items-start gap-3 rounded-xl border border-border/40 bg-muted/20 p-3",children:[t.jsx(e.CircleCheck,{className:"mt-0.5 h-4 w-4 text-emerald-600"}),t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{className:"text-sm font-medium",children:r.label}),t.jsxs("div",{className:"text-xs text-muted-foreground",children:[e.getFriendlyTypeOption(r.type).label," ·"," ",e.getControlOptionPreview(r)," ·"," ",e.getPlacementLabel(d,r.placement)]}),i?t.jsx("div",{className:"text-xs text-muted-foreground",children:i}):null]})]})}function G(l){const{title:r,children:d,className:i}=l;return t.jsxs("div",{className:e.cn("space-y-1 rounded-xl border border-border/40 bg-muted/20 p-3",i),children:[t.jsx("div",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:r}),d]})}function Se(l){const{createdReference:r,description:d}=l;return t.jsxs(G,{title:"SQL cards",className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border border-border/30 bg-muted/40 px-3 py-2",children:[t.jsx("code",{className:"min-w-0 truncate text-xs",children:r}),t.jsx(e.CopyButton,{text:r,ariaLabel:"Copy SQL control reference"})]}),t.jsx("p",{className:"text-[11px] text-muted-foreground",children:d})]})}function le(l){const{control:r,defaultValue:d,availableFieldChoices:i,availableMetricChoices:m,onControlChange:f,onLabelChange:p,onDefaultValueChange:x,onBack:n,onNext:v,nextDisabled:b}=l;return t.jsxs("div",{className:"space-y-3",children:[t.jsx(oe,{control:r,onChange:p}),t.jsx(e.ControlDefinitionOptionsEditor,{control:r,availableFieldChoices:i,availableMetricChoices:m,onChange:f}),t.jsx(e.ControlDefaultValueEditor,{control:r,value:d,onChange:x,allowCardDefault:!0,hint:"This is the value viewers will see first."}),t.jsx(Y,{secondary:t.jsx(e.Button,{type:"button",variant:"outline",onClick:n,children:"Back"}),primary:t.jsx(e.Button,{type:"button",onClick:v,disabled:b,children:"Next"})})]})}function re(l){const{control:r,scope:d,createdReference:i,explorerContent:m,sqlDescription:f,summaryDetail:p,onBack:x,onCancel:n,onDone:v}=l;return t.jsxs("div",{className:"space-y-4",children:[t.jsx(je,{control:r,scope:d,detail:p}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("p",{className:"text-sm font-medium",children:"How cards use this control"}),m,t.jsx(Se,{createdReference:i,description:f})]}),t.jsx(Y,{secondary:t.jsx(e.Button,{type:"button",variant:"outline",onClick:x,children:"Back"}),tertiary:t.jsx(e.Button,{type:"button",variant:"outline",onClick:n,children:"Cancel"}),primary:t.jsx(e.Button,{type:"button",onClick:v,children:"Done"})})]})}function Ne(l){const r=e.createBlankControl(l.scope,l.existingControls,l.reservedIds),d=l.type===r.type?{...r,label:e.DEFAULT_LABEL_BY_TYPE[l.type]}:{...e.applyControlTypeChange({controls:[{...r,label:e.DEFAULT_LABEL_BY_TYPE[l.type]}],controlId:r.id,nextType:l.type}).controls[0],label:e.DEFAULT_LABEL_BY_TYPE[l.type]};return{step:2,control:d,defaultValue:e.getDefaultValueForType(d,void 0)}}function ke({scope:l,controls:r,reservedControlIds:d,defaultValues:i,onChange:m,emptyMessage:f,initialCreateFlow:p=!1,usageByControlId:x,availableFieldChoices:n,availableMetricChoices:v,structuralParticipants:b,structuralParticipantIdsByControlId:h,card:y,onCreateFlowActiveChange:j,onCreateFlowComplete:L}){const E=C.useMemo(()=>new Set(d||[]),[d]),K=e.getPlacementOptionsForScope(l),P=e.getDefaultPlacement(l),[z,M]=C.useState(null),[H,q]=C.useState(null),[a,k]=C.useState(()=>p?{step:1,control:e.createBlankControl(l,r,Array.from(E))}:null),O=C.useRef(p),T=C.useMemo(()=>e.getFriendlyControlTypeOptions({scope:l,card:y}),[y,l]),D=C.useCallback(s=>l==="dashboard"&&(s==="field_selector"||s==="metric_selector"),[l]),V=C.useMemo(()=>a?e.getEligibleParticipantsForStructuralControl(b||[],a.control.type):[],[a,b]),F=C.useMemo(()=>{if(!a)return{fields:n||[],metrics:v||[]};if(!D(a.control.type))return{fields:n||[],metrics:v||[]};const s=a.selectedCardIds||[],u=e.getCompatibleStructuralChoiceCatalog({controlType:a.control.type,participants:b||[],selectedCardIds:s});return{fields:a.control.type==="field_selector"?u.choices.map(c=>({option:c,target:u.fieldTargetMap[c.value]})):[],metrics:a.control.type==="metric_selector"?u.choices.map(c=>({option:c,target:u.metricTargetMap[c.value]})):[]}},[n,v,a,D,b]);C.useEffect(()=>{j==null||j(!!a)},[a,j]),C.useEffect(()=>{const s=p&&!O.current;O.current=p,s&&(k({step:1,control:e.createBlankControl(l,r,Array.from(E))}),q(null),M(null))},[r,p,E,l]);const U=s=>{if(!D(s.type))return{fields:n||[],metrics:v||[]};const u=(h==null?void 0:h[s.id])||[];if(u.length===0)return{fields:n||[],metrics:v||[]};const c=e.getCompatibleStructuralChoiceCatalog({controlType:s.type,participants:b||[],selectedCardIds:u});return{fields:s.type==="field_selector"?c.choices.map(g=>({option:g,target:c.fieldTargetMap[g.value]})):[],metrics:s.type==="metric_selector"?c.choices.map(g=>({option:g,target:c.metricTargetMap[g.value]})):[]}},_=s=>{if(!D(s.control.type))return{nextControl:s.control,cardBindingsById:void 0};const u=(h==null?void 0:h[s.control.id])||[],c=e.getCompatibleStructuralChoiceCatalog({controlType:s.control.type,participants:b||[],selectedCardIds:s.nextSelectedCardIds}),g=e.reconcileStructuralControlChoices({control:s.control,choices:c.choices}),S=Object.fromEntries(u.filter(o=>!s.nextSelectedCardIds.includes(o)).map(o=>[o,void 0]));return s.nextSelectedCardIds.length>0&&g.source.kind==="manual"&&g.source.options.length>0&&Object.assign(S,e.buildStructuralControlBindingsForParticipants({control:g,participants:b||[],selectedCardIds:s.nextSelectedCardIds})),{nextControl:g,cardBindingsById:S}},I=C.useCallback((s,u=i,c={type:"update"})=>{m(s,u,c)},[i,m]),B=(s,u)=>{const c=r.find(w=>w.id===s);let g=r.map(w=>w.id!==s?w:u(w));const S=g.find(w=>w.id===s);let o,N;if(S&&l==="dashboard"&&(S.type==="field_selector"||S.type==="metric_selector")){const w=(h==null?void 0:h[S.id])||[],A=_({control:S,nextSelectedCardIds:w});g=g.map(ae=>ae.id===s?A.nextControl:ae),o=A.cardBindingsById,N=[S.id]}else if(c&&l==="dashboard"&&(c.type==="field_selector"||c.type==="metric_selector")){const w=(h==null?void 0:h[c.id])||[];o=Object.fromEntries(w.map(A=>[A,void 0])),N=[c.id]}I(g,i,{type:"update",cardBindingsById:o,affectedBindingControlIds:N})},ie=(s,u)=>{const c=u.trim();if(c.length===0||c===s||E.has(c)||r.some(o=>o.id===c&&o.id!==s))return;const g=r.map(o=>o.id===s?{...o,id:c}:o);if(!i){I(g,void 0,{type:"rename",oldId:s,newId:c});return}const S={...i};Object.prototype.hasOwnProperty.call(S,s)&&(S[c]=S[s],delete S[s]),I(g,S,{type:"rename",oldId:s,newId:c})},ce=s=>{const u=r.filter(g=>g.id!==s);if(!i){I(u,void 0,{type:"remove",controlId:s});return}const c={...i};delete c[s],I(u,c,{type:"remove",controlId:s})},ue=C.useCallback(()=>{k({step:1,control:e.createBlankControl(l,r,Array.from(E))}),q(null),M(null)},[r,E,l]),Q=s=>{k(u=>u&&{...u,control:s(u.control)})},Z=s=>{k(u=>u&&{...u,defaultValue:s})},X=(()=>{if(!a)return!1;if(a.step===2&&D(a.control.type))return(a.selectedCardIds||[]).length>0;if(a.step!==2&&a.step!==3||!a.control.label.trim())return!1;const u=e.ensureManualSource(a.control);return u.source.kind==="manual"&&(e.needsManualOptions(u)&&u.source.options.length===0||u.source.options.some(g=>g.label.trim().length===0||g.value.trim().length===0))?!1:e.hasConcreteDefaultValue(e.getDefaultValueForType(u,a.defaultValue))})(),ee=()=>{var o;if(!a)return;const s=e.ensureManualSource(a.control),u=e.deriveUniqueControlId({label:s.label,fallbackId:s.id,existingControls:r,reservedIds:Array.from(E)}),c={...s,id:u},g=l==="dashboard"&&(c.type==="field_selector"||c.type==="metric_selector")&&((o=a.selectedCardIds)!=null&&o.length)?e.buildStructuralControlBindingsForParticipants({control:c,participants:b||[],selectedCardIds:a.selectedCardIds}):void 0,S=e.getDefaultValueForType(c,a.defaultValue);k({step:l==="dashboard"&&(c.type==="field_selector"||c.type==="metric_selector")?4:3,control:c,defaultValue:S,createdControlId:u,selectedCardIds:a.selectedCardIds,cardBindingsById:g})},$=C.useCallback(()=>{k(null)},[]),te=C.useCallback(()=>{if(!(a!=null&&a.createdControlId)){k(null);return}const s=a.control,u=a.createdControlId,c=e.getDefaultValueForType(s,a.defaultValue);i?I([...r,s],{...i,[u]:c},{type:"add",cardBindingsById:a.cardBindingsById}):I([...r,{...s,defaultValue:c}],void 0,{type:"add",cardBindingsById:a.cardBindingsById}),q(u),k(null),L==null||L()},[r,a,i,I,L]),me=a?D(a.control.type)?["Choose type","Select cards","Configure","Finish"]:["Choose type","Configure","Finish"]:[],se=a!=null&&a.createdControlId?`[[param.${a.createdControlId}]]`:a?`[[param.${e.slugifyControlValue(a.control.label)||a.control.id}]]`:"";return t.jsxs("div",{className:"space-y-4",children:[a?t.jsxs("div",{className:"space-y-4 pb-1",children:[t.jsx(ve,{currentStep:a.step,labels:me}),a.step===1&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium",children:"What kind of input should viewers see?"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Choose the viewer experience first. You can fine-tune the details next."}),l==="card"&&(y==null?void 0:y.sql)==null?t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Explorer cards support displayed metric, group by field, aggregation, and time grain controls here."}):null]}),t.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:T.map(s=>t.jsxs("button",{type:"button",className:"rounded-xl border border-border/50 bg-muted/20 p-3 text-left transition-colors hover:border-border/70 hover:bg-muted/35",onClick:()=>k(Ne({scope:l,existingControls:r,reservedIds:Array.from(E),type:s.value})),children:[t.jsx("div",{className:"text-sm font-medium",children:s.label}),t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:s.description})]},s.value))}),t.jsx(Y,{secondary:t.jsx(e.Button,{type:"button",variant:"outline",onClick:$,children:"Back to controls"})})]}),a.step===2&&D(a.control.type)&&t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"space-y-3",children:[t.jsx(oe,{control:a.control,onChange:s=>Q(u=>({...u,label:s}))}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Choose which cards should respond to this shared control."})]}),V.length===0?t.jsx("div",{className:"rounded-xl bg-muted/20 p-3 text-xs text-muted-foreground",children:"No eligible cards are available yet. Add compatible metrics or group-by fields to cards first."}):t.jsx("div",{className:"space-y-2 rounded-xl bg-muted/20 p-3",children:V.map(s=>{const u=(a.selectedCardIds||[]).includes(s.cardId);return t.jsxs("label",{className:"flex items-start gap-2 text-sm",children:[t.jsx(e.Checkbox,{checked:u,onCheckedChange:c=>k(g=>g&&{...g,selectedCardIds:c===!0?[...g.selectedCardIds||[],s.cardId]:(g.selectedCardIds||[]).filter(S=>S!==s.cardId)})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"font-medium",children:s.title}),t.jsx("div",{className:"text-xs text-muted-foreground",children:a.control.type==="field_selector"?`${s.fieldChoices.length} compatible group-by fields`:`${s.metricChoices.length} compatible metrics`})]})]},s.cardId)})}),t.jsx(Y,{secondary:t.jsx(e.Button,{type:"button",variant:"outline",onClick:()=>k(s=>s&&{...s,step:1,selectedCardIds:[]}),children:"Back"}),primary:t.jsx(e.Button,{type:"button",onClick:()=>k(s=>s&&{...s,step:3}),disabled:!X,children:"Next"})})]}),a.step===2&&!D(a.control.type)&&t.jsx(le,{control:a.control,defaultValue:a.defaultValue,availableFieldChoices:F.fields,availableMetricChoices:F.metrics,onControlChange:s=>Q(()=>s),onLabelChange:s=>Q(u=>({...u,label:s})),onDefaultValueChange:Z,onBack:()=>k(s=>s&&{...s,step:1}),onNext:ee,nextDisabled:!X}),a.step===3&&D(a.control.type)&&t.jsx(le,{control:a.control,defaultValue:a.defaultValue,availableFieldChoices:F.fields,availableMetricChoices:F.metrics,onControlChange:s=>Q(()=>s),onLabelChange:s=>Q(u=>({...u,label:s})),onDefaultValueChange:Z,onBack:()=>k(s=>s&&{...s,step:2}),onNext:ee,nextDisabled:!X}),a.step===3&&!D(a.control.type)&&t.jsx(re,{control:a.control,scope:l,createdReference:se,explorerContent:t.jsx(G,{title:"Explorer cards",children:t.jsxs("p",{className:"text-sm",children:["Open the card and use"," ",t.jsx("span",{className:"font-medium",children:"Settings → Controls"})," ","to choose what this control changes."]})}),sqlDescription:"Reference this control directly in the SQL editor.",onBack:()=>k(s=>s&&{...s,step:2}),onCancel:$,onDone:te}),a.step===4&&D(a.control.type)&&t.jsx(re,{control:a.control,scope:l,createdReference:se,summaryDetail:t.jsxs(t.Fragment,{children:["Used by ",(a.selectedCardIds||[]).length," ","selected card",(a.selectedCardIds||[]).length===1?"":"s"]}),explorerContent:t.jsx(G,{title:"Explorer cards",children:t.jsx("p",{className:"text-sm",children:"Selected cards have been set up to respond to this control automatically."})}),sqlDescription:"SQL cards can still reference this control directly in the SQL editor.",onBack:()=>k(s=>s&&{...s,step:3}),onCancel:$,onDone:te})]}):null,!a&&r.length===0?t.jsx("div",{className:"rounded-md border border-dashed p-3 text-sm text-muted-foreground",children:f}):null,!a&&r.map(s=>{const u=U(s),c=x==null?void 0:x[s.id],g=i&&Object.prototype.hasOwnProperty.call(i,s.id)?i[s.id]:s.defaultValue,S=H===s.id;return t.jsxs("div",{className:"rounded-md border",children:[t.jsxs("div",{className:"flex items-center gap-2 px-3 py-3",children:[t.jsxs("button",{type:"button",className:"flex min-w-0 flex-1 items-start gap-2 text-left",onClick:()=>q(o=>o===s.id?null:s.id),children:[S?t.jsx(e.ChevronDown,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}):t.jsx(e.ChevronRight,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),t.jsxs("div",{className:"min-w-0",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:s.label||"Untitled control"}),t.jsx(e.Badge,{variant:"outline",className:"text-[11px]",children:e.getFriendlyTypeOption(s.type).label}),t.jsx(e.Badge,{variant:"secondary",className:"text-[11px]",children:e.getPlacementLabel(l,s.placement)})]}),t.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[e.getControlOptionPreview(s),c!=null&&c.status?` · ${c.status}`:""]})]})]}),t.jsx(e.Button,{type:"button",size:"icon",variant:"ghost",className:"h-8 w-8 shrink-0",onClick:()=>ce(s.id),"aria-label":`Remove ${s.label}`,children:t.jsx(e.Trash2,{className:"h-4 w-4"})})]}),S&&t.jsxs("div",{className:"space-y-4 border-t px-3 py-4",children:[c!=null&&c.helper?t.jsx("div",{className:"rounded-md bg-muted/30 px-3 py-2 text-xs text-muted-foreground",children:c.helper}):null,t.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(e.Label,{className:"text-xs",children:"Label"}),t.jsx(e.Input,{value:s.label,placeholder:"Control label",onChange:o=>B(s.id,N=>({...N,label:o.target.value}))})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(e.Label,{className:"text-xs",children:"Type"}),t.jsxs(e.Select,{value:s.type,onValueChange:o=>{const N=e.applyControlTypeChange({controls:r,controlId:s.id,nextType:o,defaultValues:i});I(N.controls,N.defaultValues)},children:[t.jsx(e.SelectTrigger,{children:t.jsx(e.SelectValue,{})}),t.jsx(e.SelectContent,{children:e.getFriendlyControlTypeOptions({scope:l,card:y,includeType:s.type}).map(o=>t.jsx(e.SelectItem,{value:o.value,children:o.label},o.value))})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(e.Label,{className:"text-xs",children:"Show in"}),t.jsxs(e.Select,{value:s.placement||P,onValueChange:o=>B(s.id,N=>({...N,placement:o})),children:[t.jsx(e.SelectTrigger,{children:t.jsx(e.SelectValue,{})}),t.jsx(e.SelectContent,{children:K.map(o=>t.jsx(e.SelectItem,{value:o.value,children:o.label},o.value))})]})]})]}),D(s.type)?t.jsx(e.StructuralParticipantSelector,{type:s.type,participants:e.getEligibleParticipantsForStructuralControl(b||[],s.type).map(o=>({cardId:o.cardId,title:o.title,choiceCount:s.type==="field_selector"?o.fieldChoices.length:o.metricChoices.length})),selectedCardIds:(h==null?void 0:h[s.id])||[],onChange:o=>{const N=_({control:s,nextSelectedCardIds:o}),w=r.map(A=>A.id===s.id?N.nextControl:A);I(w,i,{type:"update",cardBindingsById:N.cardBindingsById})}}):null,t.jsx(e.ControlDefinitionOptionsEditor,{control:s,availableFieldChoices:u.fields,availableMetricChoices:u.metrics,onChange:o=>B(s.id,()=>o)}),s.initialValueStrategy==="saved_default"&&t.jsx(e.ControlDefaultValueEditor,{control:s,value:g,allowNoDefault:!0,allowCardDefault:!0,onChange:o=>{if(i){const N={...i};o===void 0?delete N[s.id]:N[s.id]=o,I(r,N);return}B(s.id,N=>({...N,defaultValue:o}))}}),t.jsxs(e.Collapsible,{open:z===s.id,onOpenChange:o=>M(o?s.id:null),children:[t.jsx(e.CollapsibleTrigger,{asChild:!0,children:t.jsxs(e.Button,{type:"button",variant:"ghost",className:"h-auto px-0 text-xs text-muted-foreground hover:bg-transparent",children:[z===s.id?t.jsx(e.ChevronDown,{className:"mr-1 h-4 w-4"}):t.jsx(e.ChevronRight,{className:"mr-1 h-4 w-4"}),"Advanced"]})}),t.jsxs(e.CollapsibleContent,{className:"space-y-3 pt-2",children:[t.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(e.Label,{className:"text-xs",children:"Control ID"}),t.jsx(e.ControlIdInput,{controlId:s.id,onCommit:o=>ie(s.id,o)},s.id)]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(e.Label,{className:"text-xs",children:"Initial value"}),t.jsxs(e.Select,{value:s.initialValueStrategy,onValueChange:o=>B(s.id,N=>({...N,initialValueStrategy:o})),children:[t.jsx(e.SelectTrigger,{children:t.jsx(e.SelectValue,{})}),t.jsx(e.SelectContent,{children:e.INITIAL_VALUE_STRATEGY_OPTIONS.map(o=>t.jsx(e.SelectItem,{value:o.value,children:o.label},o.value))})]}),t.jsx("p",{className:"text-[11px] text-muted-foreground",children:e.getInitialValueStrategyHint(s.initialValueStrategy)})]})]}),t.jsx(e.ControlVisibilitySettings,{control:s,onChange:o=>B(s.id,()=>o)})]})]})]})]},s.id)}),!a&&t.jsxs(e.Button,{type:"button",variant:"outline",size:"sm",onClick:ue,children:[t.jsx(e.Plus,{className:"mr-2 h-4 w-4"}),"Add control"]})]})}function Ee(l){const{open:r,onOpenChange:d,initialCreateFlowActive:i=!1}=l,m=r!==void 0,[f,p]=C.useState(!1),[x,n]=C.useState(i),v=m?r:f,b=C.useCallback(j=>{!j&&x||(m||p(j),j||n(!1),d==null||d(j))},[m,x,d]),h=C.useCallback(()=>{m||p(!1),n(!1),d==null||d(!1)},[m,d]);C.useEffect(()=>{v||n(!1)},[v]);const y=C.useCallback(j=>{x&&j.preventDefault()},[x]);return{forceClose:h,handleOpenChange:b,isCreateFlowActive:x,preventPassiveDismissDuringCreate:y,resolvedOpen:v,setIsCreateFlowActive:n}}exports.CircleX=pe;exports.ControlDefinitionListEditor=ke;exports.EditorAcceptButton=fe;exports.EditorCancelButton=ge;exports.EditorClearButton=Ce;exports.Library=ne;exports.Link2=de;exports.Save=W;exports.VisualBadge=xe;exports.VisualSaveAndApplyButton=ye;exports.VisualSaveButton=be;exports.useCreateFlowOverlayState=Ee;exports.useEffectiveEditorCardType=J;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const o=require("./index-
|
|
1
|
+
"use strict";const o=require("./index-DZ93VE76.js"),b=require("react");function z(e){const n=e.toUpperCase().indexOf("WHERE"),t=e.toUpperCase().indexOf("GROUP BY"),r=e.toUpperCase().indexOf("LIMIT"),s=e.toUpperCase().indexOf("ORDER BY");let c=e.length;if(s!==-1&&(c=s),r!==-1&&r<c&&(c=r),n!==-1){const d=e.substring(0,n),a=e.substring(n);return`${d} {{ filters | where }} AND ${a.substring(6)}`}else if(t!==-1){const d=e.substring(0,t),a=e.substring(t);return`${d} {{ filters | where }} ${a}`}else{const d=e.substring(0,c),a=e.substring(c);return console.log("beforeClause",d),console.log("afterClause",a),a?`${d} {{ filters | where }} ${a}`:`${d.replace(/;$/,"")} {{ filters | where }}`}}function j(e){const[n,t]=b.useState(null),[r,s]=b.useState(null),c=o.useEnsureReactGlobals();return b.useEffect(()=>{if(!e||e.trim()===""){t(null),s(null);return}if(!c)return;(async()=>{try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error(`Invalid URL format: ${e}`);try{new URL(e)}catch{throw new Error(`Invalid URL: ${e}`)}const l=`${e.endsWith("/")?e:`${e}/`}index.js`;try{if(!(await fetch(l,{method:"HEAD"})).ok)throw new Error(`Module not found at ${l}`)}catch{}const h=await import(l);if(typeof h.useChartStore!="function")throw new Error("useChartStore is not a function");t(()=>h.useChartStore),s(null)}catch(a){const l=a instanceof Error?a.message:"Unknown error";console.error("Failed to load remote chart store:",l),s(l),t(null)}})()},[e,c]),n}function G(e,n){if(e.length===0)return"";const t=e.find(r=>{var s,c;return((s=r.customCardPreferences)==null?void 0:s.visualType)==="multiple"||!!((c=r.customCardPreferences)!=null&&c.dataInputCardIds)});if(t)return t.id;if(n){const r=e.find(s=>s.id===n);if(r){const s=r.tabTitle;if(s=="All__Header")return e[0].id;if(s&&s.endsWith("__Header")){const d=s.split("__")[0],a=e.find(l=>l.tabTitle===d);return a?a.id:e[0].id}return n}}return e[0].id}const Y=e=>{if(!e||!("detailTableBackup"in e))return e;const{detailTableBackup:n,...t}=e;return t};async function L(e,n,t,r){if(!n||!t)throw new Error("Missing auth token or visual ID");const s=["resource-by-id","visual",t],c=r.getQueryData(s);if(c)return console.log("Using cached visual data for:",t),{data:c,fromCache:!0};console.log("Fetching visual data from network for:",t);const d=o.ue.loading("Loading visual...",{position:"top-center"});try{const a=await fetch(`${e}/management/v1/visuals/${t}`,{headers:{Authorization:`Bearer ${n}`}});if(!a.ok)throw new Error("Failed to load visual");const l=await a.json();return r.setQueryData(s,l),o.ue.dismiss(d),{data:l,fromCache:!1}}catch(a){throw o.ue.dismiss(d),a}}function _(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw new Error("Invalid frame object format")}function J(e,n){var c,d;const t=(e==null?void 0:e.frameObject)??((c=e==null?void 0:e.visual)==null?void 0:c.frameObject);if(!t)return!1;const r=_(t);if(!(r!=null&&r.cards)||r.cards.length===0)return!1;const s=(d=r.cards)==null?void 0:d.find(a=>a.id===r.activeCardId);return s?(o.setupEditorWithCard({...n,frame:r,card:s,visualId:(e==null?void 0:e.id)||r.visualId}),!0):!1}function K(){var g;const{setCardSql:e}=o.useEditorActions(),n=o.useEditorStore(i=>i.frame),t=o.useEditorStore(i=>i.card),r=o.useEditorStore(i=>i.isDevMode),s=j(((g=t.customCardPreferences)==null?void 0:g.url)||""),c=o.useEditorStore(i=>i.selectedSchemaName),d=o.useEditorStore(i=>i.selectedDatamodelId),a=o.useEditorStore(i=>i.selectedDatabaseName),l=o.useEditorStore(i=>i.selectedTableName),h=o.useEditorStore(i=>i.selectedConnectionId),m=o.useEditorStore(i=>i.isShowingVisual),p=t.sql;return{getUpdatedFrame:b.useCallback(()=>{var w;let i=p;p&&!p.includes("{{")&&(i=z(p),e(i));const C=(w=s==null?void 0:s.getState())==null?void 0:w.settings,v={...t,dataSource:t.dataSource||{mode:"directSource"},lastSelectedSchema:c,lastSelectedDatamodelId:d,lastSelectedDatabase:a,lastSelectedTable:l,connectionId:h,sql:r?i:void 0,python:r?t.python:void 0,config:r?void 0:Y(t.config),customCfg:m?t.customCfg:null,preferences:t.preferences,...C&&{customCardPreferences:{...t.customCardPreferences,settings:C}}},E=n.cards.map(I=>I.id===t.id?v:I);return{...n,cards:E,activeCardId:G(E,n.activeCardId)}},[t,n,r,m,c,d,a,l,h,e,s,p])}}function X(){const{authToken:e,tokenProps:n}=o.useSemaphorContext(),t=o.useQueryClient(),r=o.useSelectedVisual(),{selectVisual:s}=o.useManagementActions(),{setFrame:c,setCard:d,setIsDevMode:a,initializeModeDrafts:l,setActiveTabCardId:h,updateDataSource:m,setQueryResultColumns:p,setSelectedConnectionId:D,setSelectedDatabaseName:g,setSelectedSchemaName:i,setSelectedTableName:C,setSelectedDatamodelId:v,setFilterValues:E,setInlineFilterValuesMap:w,setApplyFilters:I}=o.useEditorActions(),{setIsDashboardEditing:V,setIsVisualEditing:$,setSelectedFrameId:M,clearSelectedFrameId:A,addFrame:R,setIsDashboardPanelOpen:N}=o.useDashboardActions(),y=o.useDashboardStore(u=>u.selectedSheetId),O=o.useDashboardStore(u=>u.selectedFrameId),T=o.useDashboardStore(u=>u.dashboard),x=o.useDashboardStore(u=>u.filterValues),B=o.useDashboardStore(u=>u.inlineFilterValuesMap),F=o.useVisualById((r==null?void 0:r.id)||"",{enabled:!!(r!=null&&r.id)&&!!(e!=null&&e.accessToken)}),H=b.useCallback(async u=>{try{s(u),A();const{data:S,fromCache:f}=await L(n.apiServiceUrl,(e==null?void 0:e.accessToken)||"",u.id,t);if(!J(S,{setFrame:c,setCard:d,setIsDevMode:a,initializeModeDrafts:l,setActiveTabCardId:h,updateDataSource:m,setQueryResultColumns:p,setSelectedConnectionId:D,setSelectedDatabaseName:g,setSelectedSchemaName:i,setSelectedTableName:C,setSelectedDatamodelId:v,setFilterValues:E,setInlineFilterValuesMap:w,setApplyFilters:I,setIsDashboardEditing:V,setIsVisualEditing:$,dashboard:T,selectedSheetId:y,selectedFrameId:O,filterValues:x,inlineFilterValuesMap:B}))throw new Error("Failed to setup editor with visual data");return{success:!0,fromCache:f}}catch(S){return console.error("Error editing visual:",S),{success:!1,error:"Failed to load visual for editing"}}},[e==null?void 0:e.accessToken,n.apiServiceUrl,t,s,c,d,V,$,a,l,h,m,p,D,g,i,C,v,E,w,I,A,T,y,O,x,B]),Q=b.useCallback(async u=>{var S;try{if(s(u),!y)return{success:!1,error:"No sheet selected. Please select a sheet first."};const{data:f,fromCache:P}=await L(n.apiServiceUrl,(e==null?void 0:e.accessToken)||"",u.id,t),W=(f==null?void 0:f.frameObject)??((S=f==null?void 0:f.visual)==null?void 0:S.frameObject);if(!W)return{success:!1,error:"Visual has no frame data"};const U=_(W);if(!(U!=null&&U.cards)||U.cards.length===0)return{success:!1,error:"Visual frame is malformed"};const k={...o.cloneLinkedFrameWithSourceMapping(U),visualId:u.id};return R(y,k,"end"),V(!0),M(k.id),N(!1),{success:!0,fromCache:P}}catch(f){return console.error("Error adding visual:",f),{success:!1,error:"Failed to add visual to dashboard"}}},[e==null?void 0:e.accessToken,n.apiServiceUrl,t,s,y,R,V,M,N]);return{visual:F.data,isLoading:F.isLoading,isError:F.isError,error:F.error,handleEditLibraryVisual:H,handleAddLibraryVisual:Q,getUpdatedFrame:K().getUpdatedFrame,refetch:F.refetch}}exports.useRemoteChartStore=j;exports.useVisualUtils=X;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { G as K, b as Y, H as X, J as Z, K as q, M as _, N as ee, u as U, O as te, Q as re, x as M, T as se, U as f } from "./index-
|
|
1
|
+
import { G as K, b as Y, H as X, J as Z, K as q, M as _, N as ee, u as U, O as te, Q as re, x as M, T as se, U as f } from "./index-BtbNfaQD.js";
|
|
2
2
|
import { useState as H, useEffect as oe, useCallback as D } from "react";
|
|
3
3
|
function ae(e) {
|
|
4
4
|
const a = e.toUpperCase().indexOf("WHERE"), t = e.toUpperCase().indexOf("GROUP BY"), r = e.toUpperCase().indexOf("LIMIT"), s = e.toUpperCase().indexOf("ORDER BY");
|
package/dist/dashboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/index-DZ93VE76.js"),e=require("../types/index.cjs");exports.Dashboard=r.Dashboard;exports.CONTROL_CARD_DEFAULT_VALUE=e.CONTROL_CARD_DEFAULT_VALUE;exports.EMPTY_SELECTION=e.EMPTY_SELECTION;
|
package/dist/dashboard/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { D as
|
|
2
|
-
import { EMPTY_SELECTION as
|
|
1
|
+
import { D as E } from "../chunks/index-BtbNfaQD.js";
|
|
2
|
+
import { CONTROL_CARD_DEFAULT_VALUE as L, EMPTY_SELECTION as T } from "../types/index.js";
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
L as CONTROL_CARD_DEFAULT_VALUE,
|
|
5
|
+
E as Dashboard,
|
|
6
|
+
T as EMPTY_SELECTION
|
|
6
7
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-DOeggx0V.js"),w=require("./types/index.cjs"),F=require("./chunks/dashboard-summary-settings-dialog-CaxmCNyy.js"),t=require("react/jsx-runtime"),x=require("react"),z=require("./chunks/resource-management-panel-C_ZqsVMH.js"),O=require("./chunks/use-debounced-dirty-check-XHSwAefL.js");require("react-dom");const C=require("./chunks/notification-bell-tJRds5JJ.js"),L=require("./chunks/normalize-dashboard-for-dirty-check-B7NQDI1H.js");function Q(s){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const n in s)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(s,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:()=>s[n]})}}return r.default=s,Object.freeze(r)}const P=Q(x);function U(s){const{authToken:r,tokenProps:n}=e.useSemaphorContext();return e.useMutation({mutationFn:async o=>e.backtestAlert(n.apiServiceUrl,r.accessToken,s,o)})}function q(s){const{displayPreferences:r,...n}=s,o={...n,id:s.dashboardId};return t.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:t.jsxs(e.SemaphorContextProvider,{dashboardProps:o,children:[t.jsx(e.SemaphorReadyIndicator,{componentType:"visual",componentId:s.cardId}),t.jsx(e.UXProvider,{children:t.jsx(e.DisplayPreferencesProvider,{displayPreferences:r,children:t.jsx(e.Container,{type:"visual",...o,children:t.jsx(W,{cardId:s.cardId})})})})]})})}function W({cardId:s}){const r=e.useDashboardStore(l=>{var c;return(c=l.dashboard)==null?void 0:c.sheets}),{card:n,frame:o}=x.useMemo(()=>{const l=r==null?void 0:r.flatMap(i=>i.frames),c=l==null?void 0:l.flatMap(i=>i==null?void 0:i.cards),u=c==null?void 0:c.find(i=>(i==null?void 0:i.id)===s),a=l==null?void 0:l.find(i=>{var m;return(m=i==null?void 0:i.cards)==null?void 0:m.find(f=>(f==null?void 0:f.id)===s)});return{card:u,frame:a}},[r,s]);return!n||!o?t.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${s}`}):t.jsx("main",{className:"flex h-full grow flex-col",children:t.jsx(e.ErrorBoundary,{FallbackComponent:({error:l,resetErrorBoundary:c})=>t.jsx(e.FallbackVisual,{error:l,resetErrorBoundary:c,customerFacingMessage:"Error creating visual. Please try again."}),children:t.jsx(e.DashboardCard,{card:n,frame:o})})})}function V({name:s,items:r,value:n,onChange:o,isLoading:l,isError:c,refetch:u,className:a,icon:i,showNone:m=!1}){const f=P.useRef(null),[b,A]=P.useState(!1),[j,D]=P.useState("100%"),y=m?[...r||[],{id:"none",name:"None"}]:r;P.useLayoutEffect(()=>{f.current&&D(f.current.offsetWidth)},[]);function R(){var h;return l?"Loading...":c?"Error":n?(h=r==null?void 0:r.find(S=>S.id===n))==null?void 0:h.name:`Select ${s}`}function T(h,S){o(S),A(!1)}return t.jsxs(e.Popover,{open:b,onOpenChange:A,children:[t.jsx(e.PopoverTrigger,{asChild:!0,children:t.jsxs(e.Button,{ref:f,variant:"outline",role:"combobox","aria-expanded":b,className:e.cn("flex h-9 w-full justify-between",a),children:[t.jsxs("div",{className:"flex items-center gap-2",children:[i&&t.jsx("div",{className:"mr-2",children:i}),t.jsx("span",{className:"max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap",children:R()})]}),t.jsx(e.ChevronDown,{className:"size-4 opacity-50"})]})}),t.jsx(e.PopoverContent,{className:"w-full p-0",style:{minWidth:j},children:t.jsxs(e.Command,{children:[t.jsxs("div",{className:"flex h-9 items-center justify-between border-b pr-1",children:[t.jsx(e.CommandInput,{className:"h-9",placeholder:"Search..."}),t.jsx(e.IconButton,{className:"h-7",onClick:u,children:t.jsx(e.RefreshCw,{className:e.cn("size-3.5 opacity-50",l&&"animate-spin")})})]}),t.jsxs(e.CommandList,{children:[t.jsxs(e.CommandEmpty,{children:["No ",s==null?void 0:s.toLowerCase()," found."]}),t.jsx(e.CommandGroup,{children:y==null?void 0:y.map(h=>t.jsx(e.CommandItem,{className:"overflow-x-auto",value:h.name,onSelect:S=>T(S,h.id),children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(e.Check,{className:e.cn("size-4",n===h.id?"opacity-100":"opacity-0")}),t.jsx("div",{title:h.name,children:h.name})]})},h.id))})]})]})})]})}function H({triggerButtonClassName:s,variant:r="ghost"}){const[n,o]=x.useState(!1),l=e.useDashboardStore(u=>{var a;return(a=u.dashboard)==null?void 0:a.id}),c=e.useDashboardStore(u=>{var a;return(a=u.dashboard)==null?void 0:a.title});return l?t.jsxs(t.Fragment,{children:[t.jsx(e.IconButton,{tooltip:"Schedule Dashboard",className:e.cn("h-7 p-2",s),buttonProps:{variant:r},onClick:()=>o(!0),children:t.jsx(e.Clock,{className:"size-4"})}),t.jsx(e.EmailScheduleDialog,{open:n,onOpenChange:o,dashboardId:l,dashboardName:c})]}):null}function $(s,r){x.useEffect(()=>(s&&r&&(window.__SEMAPHOR_PRINT_STATE__={...r}),()=>{s&&window.__SEMAPHOR_PRINT_STATE__&&delete window.__SEMAPHOR_PRINT_STATE__}),[s,r])}function I(s){if(!s)return"--";const r=new Date(s);return Number.isNaN(r.getTime())?"--":r.toLocaleString()}function G(s){var r;return((r=s.alertState)==null?void 0:r.currentState)==="FIRING"?"Signal surfaced":s.status==="ACTIVE"?"Watching":s.status==="PAUSED"?"Paused":s.status}function K({alertId:s,onBack:r}){var h,S,k,M;const{authToken:n,tokenProps:o}=e.useSemaphorContext(),{data:l,isLoading:c,refetch:u}=e.useAlertDetail(s),a=(l==null?void 0:l.alert)??null,[i,m]=x.useState([]),[f,b]=x.useState([]),[A,j]=x.useState(null),D=x.useCallback(async()=>{var g;const d=o==null?void 0:o.apiServiceUrl,p=n==null?void 0:n.accessToken;if(!d||!p||!s)return null;try{const N=await fetch(`${d}/v1/alerts/${s}/runs?limit=20`,{headers:{Authorization:`Bearer ${p}`}});if(N.ok){const E=await N.json(),v=Array.isArray(E.runs)?E.runs:[],_=A&&v.some(B=>B.id===A)?A:((g=v[0])==null?void 0:g.id)??null;return b(v),j(_),_}b([]),j(null)}catch{return b([]),j(null),null}return null},[s,n,A,o]),y=x.useCallback(async d=>{const p=o==null?void 0:o.apiServiceUrl,g=n==null?void 0:n.accessToken,N=d??A;if(!p||!g||!s||!N){m([]);return}try{const E=await fetch(`${p}/v1/alerts/${s}/runs/${N}/deliveries`,{headers:{Authorization:`Bearer ${g}`}});if(E.ok){const v=await E.json();m(Array.isArray(v.attempts)?v.attempts:[])}else m([])}catch{m([])}},[s,n,A,o]),R=x.useCallback(async()=>{await u();const d=await D();await y(d)},[y,D,u]);x.useEffect(()=>{D().catch(()=>{})},[D]),x.useEffect(()=>{y().catch(()=>{})},[y]);const T=x.useMemo(()=>{const d={};for(const p of i)d[p.channel]||(d[p.channel]=[]),d[p.channel].push(p);return d},[i]);return c?t.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"Loading signal detail..."}):a?t.jsxs("div",{className:"space-y-4 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[r&&t.jsx(e.Button,{variant:"outline",size:"sm",onClick:r,children:"Back"}),t.jsx("h2",{className:"text-lg font-semibold",children:a.name}),t.jsx(e.Badge,{variant:a.status==="ACTIVE"?"default":"secondary",children:G(a)}),((h=a.alertState)==null?void 0:h.currentState)&&t.jsx(e.Badge,{variant:a.alertState.currentState==="FIRING"?"destructive":"outline",children:a.alertState.currentState==="FIRING"?"Signal surfaced":"Stable"})]}),t.jsx(e.Button,{variant:"outline",size:"sm",onClick:()=>void R(),children:"Refresh"})]}),a.description&&t.jsx("p",{className:"text-sm text-muted-foreground",children:a.description}),t.jsxs("div",{className:"rounded-md border bg-muted/30 p-4 text-sm",children:[t.jsx("p",{className:"font-medium",children:"What changed"}),t.jsx("p",{className:"mt-1 text-muted-foreground",children:"Review the latest signal activity, then investigate the underlying dashboard context if you need more detail."})]}),t.jsxs("div",{className:"rounded-md border bg-background p-4 space-y-2",children:[t.jsx("h3",{className:"text-sm font-semibold",children:"Signal Watch"}),t.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Watching for:"})," ",e.formatSignalCondition(a.jobConfig.operator,a.jobConfig.threshold)]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Severity:"})," ",a.jobConfig.severity]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Last Evaluated:"})," ",I((S=a.alertState)==null?void 0:S.lastEvaluatedAt)]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Last Surfaced:"})," ",I((k=a.alertState)==null?void 0:k.lastTriggeredAt)]})]})]}),((M=a.deliveryConfig)==null?void 0:M.channels)&&a.deliveryConfig.channels.length>0&&t.jsxs("div",{className:"rounded-md border bg-background p-4 space-y-2",children:[t.jsx("h3",{className:"text-sm font-semibold",children:"Where It Surfaces"}),t.jsx("div",{className:"flex flex-wrap gap-2",children:a.deliveryConfig.channels.map(d=>t.jsx(e.Badge,{variant:"outline",children:d},d))})]}),f.length>0&&t.jsxs("div",{className:"rounded-md border bg-background p-4 space-y-3",children:[t.jsx("h3",{className:"text-sm font-semibold",children:"Recent Delivery Activity"}),f.length>1&&t.jsx("div",{className:"flex flex-wrap gap-2",children:f.map(d=>t.jsx(e.Button,{variant:d.id===A?"default":"outline",size:"sm",onClick:()=>j(d.id),children:I(d.scheduledFor)},d.id))}),Object.keys(T).length===0?t.jsx("p",{className:"text-sm text-muted-foreground",children:"No delivery attempts were recorded for this run."}):Object.entries(T).map(([d,p])=>t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(e.Badge,{variant:"secondary",className:"text-xs",children:d})}),t.jsx("div",{className:"overflow-hidden rounded border",children:t.jsxs("table",{className:"w-full text-xs",children:[t.jsx("thead",{className:"bg-muted/40",children:t.jsxs("tr",{children:[t.jsx("th",{className:"px-2 py-1 text-left font-medium",children:"Recipient"}),t.jsx("th",{className:"px-2 py-1 text-left font-medium",children:"Status"}),t.jsx("th",{className:"px-2 py-1 text-left font-medium",children:"Time"}),t.jsx("th",{className:"px-2 py-1 text-left font-medium",children:"Error"})]})}),t.jsx("tbody",{children:p.map(g=>t.jsxs("tr",{className:"border-t",children:[t.jsx("td",{className:"px-2 py-1",children:g.recipient}),t.jsx("td",{className:"px-2 py-1",children:t.jsx(e.Badge,{variant:g.status==="SENT"?"default":"destructive",className:"text-[10px]",children:g.status})}),t.jsx("td",{className:"px-2 py-1",children:I(g.createdAt)}),t.jsx("td",{className:"px-2 py-1 text-muted-foreground",children:g.error||"--"})]},g.id))})]})})]},d))]})]}):t.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"Signal not found."})}function Y(){var c,u;const{quotasQuery:s,usageQuery:r}=e.useAlertQuotas(),n=((c=s.data)==null?void 0:c.quotas)||[],o=((u=r.data)==null?void 0:u.usage)||[],l=new Map(o.map(a=>[a.tenantId||"org",a]));return t.jsxs("div",{className:"space-y-4 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-xl font-semibold",children:"Alert Quotas"}),t.jsx(e.Button,{variant:"outline",size:"sm",onClick:()=>{s.refetch(),r.refetch()},children:"Refresh"})]}),s.isLoading||r.isLoading?t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading quota usage..."}):null,t.jsx("div",{className:"overflow-hidden rounded-lg border",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{className:"bg-muted/40",children:t.jsxs("tr",{children:[t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Tenant"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Active Alerts"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Max Active"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Min Cadence"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Max Context Sources"})]})}),t.jsx("tbody",{children:n.map(a=>{const i=a.tenantId||"org",m=l.get(i);return t.jsxs("tr",{className:"border-t",children:[t.jsx("td",{className:"px-3 py-2",children:i}),t.jsx("td",{className:"px-3 py-2",children:(m==null?void 0:m.activeAlerts)??0}),t.jsx("td",{className:"px-3 py-2",children:a.policy.maxActiveAlerts}),t.jsxs("td",{className:"px-3 py-2",children:[a.policy.minCadenceMinutes," min"]}),t.jsx("td",{className:"px-3 py-2",children:a.policy.maxContextSources})]},i)})})]})})]})}exports.AlertManagementPage=e.AlertManagementPage;exports.AlertWizardDialog=e.AlertWizardDialog;exports.AlertsApiError=e.AlertsApiError;exports.CALCULATED_FIELD_ENTITY_MARKER=e.CALCULATED_FIELD_ENTITY_MARKER;exports.CardAlertIndicator=e.CardAlertIndicator;exports.CardSummary=e.CardSummary;exports.DATE_FORMAT_VALUES=e.DATE_FORMAT_VALUES;exports.Dashboard=e.Dashboard;exports.DashboardExportDialog=e.DashboardExportDialog;exports.DashboardWC=e.DashboardWC;exports.EmailScheduleDialog=e.EmailScheduleDialog;exports.ExportError=e.ExportError;exports.PivotMarkerEnum=e.PivotMarkerEnum;exports.ResourceType=e.ResourceType;exports.SemaphorContextProvider=e.SemaphorContextProvider;exports.SemaphorDataProvider=e.SemaphorQueryClient;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.ShareDialog=e.ShareDialog;exports.SummaryCard=e.SummaryCard;exports.Surfboard=e.DashboardPlus;exports.backtestAlert=e.backtestAlert;exports.cancelExport=e.cancelExport;exports.cloneDeep=e.cloneDeep;exports.createAlert=e.createAlert;exports.createEmptyKpiConfig=e.createEmptyKpiConfig;exports.createExport=e.createExport;exports.createSqlGenConfig=e.createSqlGenConfig;exports.deleteAlert=e.deleteAlert;exports.downloadPdf=e.downloadPdf;exports.emitDashboardLoad=e.emitDashboardLoad;exports.emitDashboardUnload=e.emitDashboardUnload;exports.fmt=e.fmt;exports.formatFileSize=e.formatFileSize;exports.getAlert=e.getAlert;exports.getAlertContextSources=e.getAlertContextSources;exports.getAlertHistory=e.getAlertHistory;exports.getAlertQuotaUsage=e.getAlertQuotaUsage;exports.getAlertRunDeliveries=e.getAlertRunDeliveries;exports.getAlertRunSteps=e.getAlertRunSteps;exports.getAlertRuns=e.getAlertRuns;exports.getAlertState=e.getAlertState;exports.getColumnDataType=e.getColumnDataType;exports.getDownloadUrl=e.getDownloadUrl;exports.getExportStatus=e.getExportStatus;exports.getExports=e.getExports;exports.getFilterValueType=e.getFilterValueType;exports.getFormattedTableNameForQuery=e.getFormattedTableNameForQuery;exports.getQualifiedTableName=e.getQualifiedTableName;exports.getSql=e.getSql;exports.invalidateToken=e.invalidateToken;exports.isBooleanDataType=e.isBooleanDataType;exports.isCalculatedDimension=e.isCalculatedDimension;exports.isCalculatedField=e.isCalculatedField;exports.isCalculatedMetric=e.isCalculatedMetric;exports.isColumnInSqlGen=e.isColumnInSqlGen;exports.isDateDataType=e.isDateDataType;exports.isExportComplete=e.isExportComplete;exports.isExportInProgress=e.isExportInProgress;exports.isNumberDataType=e.isNumberDataType;exports.isTextDataType=e.isTextDataType;exports.listAlertQuotas=e.listAlertQuotas;exports.listAlerts=e.listAlerts;exports.previewAlertDeliverable=e.previewAlertDeliverable;exports.resolveDataType=e.resolveDataType;exports.resolveDatamodelName=e.resolveDatamodelName;exports.triggerAlertNow=e.triggerAlertNow;exports.updateAlert=e.updateAlert;exports.updateAlertContextSources=e.updateAlertContextSources;exports.updateAlertQuota=e.updateAlertQuota;exports.useActiveExports=e.useActiveExports;exports.useAddNewFrame=e.useAddNewFrame;exports.useAlertActions=e.useAlertActions;exports.useAlertDeliveries=e.useAlertDeliveries;exports.useAlertDetail=e.useAlertDetail;exports.useAlertDraft=e.useAlertDraft;exports.useAlertFilters=e.useAlertFilters;exports.useAlertHistory=e.useAlertHistory;exports.useAlertQuotas=e.useAlertQuotas;exports.useAlertRuns=e.useAlertRuns;exports.useAlertState=e.useAlertState;exports.useAlertStore=e.useAlertStore;exports.useAlertWizard=e.useAlertWizard;exports.useAlerts=e.useAlerts;exports.useAlertsBootstrap=e.useAlertsBootstrap;exports.useAlertsById=e.useAlertsById;exports.useAlertsForCard=e.useAlertsForCard;exports.useCard=e.useCard;exports.useCardAlertMap=e.useCardAlertMap;exports.useCardSummary=e.useCardSummary;exports.useCurrentActiveCard=e.useCurrentActiveCard;exports.useCurrentCardConfig=e.useCurrentCardConfig;exports.useCurrentSheetActiveCards=e.useCurrentSheetActiveCards;exports.useDashboardActions=e.useDashboardActions;exports.useDashboardById=e.useDashboardById;exports.useDashboardQuery=e.useDashboardQuery;exports.useDashboardStore=e.useDashboardStore;exports.useDashboardSummary=e.useDashboardSummary;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorActions=e.useEditorActions;exports.useEditorAside=e.useEditorAside;exports.useEditorStore=e.useEditorStore;exports.useExportActions=e.useExportActions;exports.useExportStore=e.useExportStore;exports.useInProgressExportsCount=e.useInProgressExportsCount;exports.useManagementStore=e.useManagementStore;exports.useResourceManagement=e.useResourceManagement;exports.useSelectedAlertId=e.useSelectedAlertId;exports.useTextFilterHook=e.useTextFilterHook;exports.DEFAULT_CALENDAR_CONTEXT=w.DEFAULT_CALENDAR_CONTEXT;exports.DEFAULT_SEMANTIC_DOMAIN_ACCESS=w.DEFAULT_SEMANTIC_DOMAIN_ACCESS;exports.EMPTY_SELECTION=w.EMPTY_SELECTION;exports.CalendarPreferencesDialog=F.CalendarPreferencesDialog;exports.DashboardSummarySettingsDialog=F.DashboardSummarySettingsDialog;exports.ResourceManagementPanel=z.ResourceManagementPanel;exports.useDebouncedDirtyCheck=O.useDebouncedDirtyCheck;exports.AdvancedModeToggle=C.AdvancedModeToggle;exports.ExportNotificationItem=C.ExportNotificationItem;exports.ExportNotificationList=C.ExportNotificationList;exports.NotificationBell=C.NotificationBell;exports.UnsavedChangesAlert=C.UnsavedChangesAlert;exports.VisualEditingControls=C.VisualEditingControls;exports.useExportPolling=C.useExportPolling;exports.useExportRecovery=C.useExportRecovery;exports.usePristineSnapshotInitializer=C.usePristineSnapshotInitializer;exports.normalizeDashboardForDirtyCheck=L.normalizeDashboardForDirtyCheck;exports.serializeDashboardForDirtyCheck=L.serializeDashboardForDirtyCheck;exports.AlertDetailPageEmbedded=K;exports.Combobox=V;exports.ScheduleDashboard=H;exports.TenantQuotaPage=Y;exports.Visual=q;exports.useAlertBacktest=U;exports.useExposePrintState=$;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-DZ93VE76.js"),_=require("./types/index.cjs"),M=require("./chunks/dashboard-summary-settings-dialog-Bl-XplTR.js"),t=require("react/jsx-runtime"),x=require("react"),O=require("./chunks/resource-management-panel-Cz7MYBC7.js"),U=require("./chunks/use-debounced-dirty-check-XHSwAefL.js");require("react-dom");const A=require("./chunks/dashboard-filter-controls-button-Cedz-YZx.js"),L=require("./chunks/normalize-dashboard-for-dirty-check-BXRUMVb2.js");function z(s){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const n in s)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(s,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:()=>s[n]})}}return r.default=s,Object.freeze(r)}const R=z(x);function Q(s){const{authToken:r,tokenProps:n}=e.useSemaphorContext();return e.useMutation({mutationFn:async o=>e.backtestAlert(n.apiServiceUrl,r.accessToken,s,o)})}function q(s){const{displayPreferences:r,cardId:n,...o}=s,l={...o,id:s.dashboardId};return t.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:t.jsxs(e.SemaphorContextProvider,{dashboardProps:l,children:[t.jsx(e.SemaphorReadyIndicator,{componentType:"visual",componentId:s.cardId}),t.jsx(e.UXProvider,{children:t.jsx(e.DisplayPreferencesProvider,{displayPreferences:r,children:t.jsx(e.Container,{type:"visual",cardId:n,...l,children:t.jsx(V,{cardId:n})})})})]})})}function V({cardId:s}){const r=e.useDashboardStore(l=>{var c;return(c=l.dashboard)==null?void 0:c.sheets}),{card:n,frame:o}=x.useMemo(()=>{const l=r==null?void 0:r.flatMap(i=>i.frames),c=l==null?void 0:l.flatMap(i=>i==null?void 0:i.cards),u=c==null?void 0:c.find(i=>(i==null?void 0:i.id)===s),a=l==null?void 0:l.find(i=>{var m;return(m=i==null?void 0:i.cards)==null?void 0:m.find(f=>(f==null?void 0:f.id)===s)});return{card:u,frame:a}},[r,s]);return!n||!o?t.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${s}`}):t.jsx("main",{className:"flex h-full grow flex-col",children:t.jsx(e.ErrorBoundary,{FallbackComponent:({error:l,resetErrorBoundary:c})=>t.jsx(e.FallbackVisual,{error:l,resetErrorBoundary:c,customerFacingMessage:"Error creating visual. Please try again."}),children:t.jsx(e.DashboardCard,{card:n,frame:o})})})}function W({name:s,items:r,value:n,onChange:o,isLoading:l,isError:c,refetch:u,className:a,icon:i,showNone:m=!1}){const f=R.useRef(null),[D,C]=R.useState(!1),[b,j]=R.useState("100%"),y=m?[...r||[],{id:"none",name:"None"}]:r;R.useLayoutEffect(()=>{f.current&&j(f.current.offsetWidth)},[]);function I(){var h;return l?"Loading...":c?"Error":n?(h=r==null?void 0:r.find(S=>S.id===n))==null?void 0:h.name:`Select ${s}`}function T(h,S){o(S),C(!1)}return t.jsxs(e.Popover,{open:D,onOpenChange:C,children:[t.jsx(e.PopoverTrigger,{asChild:!0,children:t.jsxs(e.Button,{ref:f,variant:"outline",role:"combobox","aria-expanded":D,className:e.cn("flex h-9 w-full justify-between",a),children:[t.jsxs("div",{className:"flex items-center gap-2",children:[i&&t.jsx("div",{className:"mr-2",children:i}),t.jsx("span",{className:"max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap",children:I()})]}),t.jsx(e.ChevronDown,{className:"size-4 opacity-50"})]})}),t.jsx(e.PopoverContent,{className:"w-full p-0",style:{minWidth:b},children:t.jsxs(e.Command,{children:[t.jsxs("div",{className:"flex h-9 items-center justify-between border-b pr-1",children:[t.jsx(e.CommandInput,{className:"h-9",placeholder:"Search..."}),t.jsx(e.IconButton,{className:"h-7",onClick:u,children:t.jsx(e.RefreshCw,{className:e.cn("size-3.5 opacity-50",l&&"animate-spin")})})]}),t.jsxs(e.CommandList,{children:[t.jsxs(e.CommandEmpty,{children:["No ",s==null?void 0:s.toLowerCase()," found."]}),t.jsx(e.CommandGroup,{children:y==null?void 0:y.map(h=>t.jsx(e.CommandItem,{className:"overflow-x-auto",value:h.name,onSelect:S=>T(S,h.id),children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(e.Check,{className:e.cn("size-4",n===h.id?"opacity-100":"opacity-0")}),t.jsx("div",{title:h.name,children:h.name})]})},h.id))})]})]})})]})}function H({triggerButtonClassName:s,variant:r="ghost"}){const[n,o]=x.useState(!1),l=e.useDashboardStore(u=>{var a;return(a=u.dashboard)==null?void 0:a.id}),c=e.useDashboardStore(u=>{var a;return(a=u.dashboard)==null?void 0:a.title});return l?t.jsxs(t.Fragment,{children:[t.jsx(e.IconButton,{tooltip:"Schedule Dashboard",className:e.cn("h-7 p-2",s),buttonProps:{variant:r},onClick:()=>o(!0),children:t.jsx(e.Clock,{className:"size-4"})}),t.jsx(e.EmailScheduleDialog,{open:n,onOpenChange:o,dashboardId:l,dashboardName:c})]}):null}function $(s,r){x.useEffect(()=>(s&&r&&(window.__SEMAPHOR_PRINT_STATE__={...r}),()=>{s&&window.__SEMAPHOR_PRINT_STATE__&&delete window.__SEMAPHOR_PRINT_STATE__}),[s,r])}function P(s){if(!s)return"--";const r=new Date(s);return Number.isNaN(r.getTime())?"--":r.toLocaleString()}function G(s){var r;return((r=s.alertState)==null?void 0:r.currentState)==="FIRING"?"Signal surfaced":s.status==="ACTIVE"?"Watching":s.status==="PAUSED"?"Paused":s.status}function K({alertId:s,onBack:r}){var h,S,F,w;const{authToken:n,tokenProps:o}=e.useSemaphorContext(),{data:l,isLoading:c,refetch:u}=e.useAlertDetail(s),a=(l==null?void 0:l.alert)??null,[i,m]=x.useState([]),[f,D]=x.useState([]),[C,b]=x.useState(null),j=x.useCallback(async()=>{var g;const d=o==null?void 0:o.apiServiceUrl,p=n==null?void 0:n.accessToken;if(!d||!p||!s)return null;try{const v=await fetch(`${d}/v1/alerts/${s}/runs?limit=20`,{headers:{Authorization:`Bearer ${p}`}});if(v.ok){const E=await v.json(),N=Array.isArray(E.runs)?E.runs:[],k=C&&N.some(B=>B.id===C)?C:((g=N[0])==null?void 0:g.id)??null;return D(N),b(k),k}D([]),b(null)}catch{return D([]),b(null),null}return null},[s,n,C,o]),y=x.useCallback(async d=>{const p=o==null?void 0:o.apiServiceUrl,g=n==null?void 0:n.accessToken,v=d??C;if(!p||!g||!s||!v){m([]);return}try{const E=await fetch(`${p}/v1/alerts/${s}/runs/${v}/deliveries`,{headers:{Authorization:`Bearer ${g}`}});if(E.ok){const N=await E.json();m(Array.isArray(N.attempts)?N.attempts:[])}else m([])}catch{m([])}},[s,n,C,o]),I=x.useCallback(async()=>{await u();const d=await j();await y(d)},[y,j,u]);x.useEffect(()=>{j().catch(()=>{})},[j]),x.useEffect(()=>{y().catch(()=>{})},[y]);const T=x.useMemo(()=>{const d={};for(const p of i)d[p.channel]||(d[p.channel]=[]),d[p.channel].push(p);return d},[i]);return c?t.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"Loading signal detail..."}):a?t.jsxs("div",{className:"space-y-4 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[r&&t.jsx(e.Button,{variant:"outline",size:"sm",onClick:r,children:"Back"}),t.jsx("h2",{className:"text-lg font-semibold",children:a.name}),t.jsx(e.Badge,{variant:a.status==="ACTIVE"?"default":"secondary",children:G(a)}),((h=a.alertState)==null?void 0:h.currentState)&&t.jsx(e.Badge,{variant:a.alertState.currentState==="FIRING"?"destructive":"outline",children:a.alertState.currentState==="FIRING"?"Signal surfaced":"Stable"})]}),t.jsx(e.Button,{variant:"outline",size:"sm",onClick:()=>void I(),children:"Refresh"})]}),a.description&&t.jsx("p",{className:"text-sm text-muted-foreground",children:a.description}),t.jsxs("div",{className:"rounded-md border bg-muted/30 p-4 text-sm",children:[t.jsx("p",{className:"font-medium",children:"What changed"}),t.jsx("p",{className:"mt-1 text-muted-foreground",children:"Review the latest signal activity, then investigate the underlying dashboard context if you need more detail."})]}),t.jsxs("div",{className:"rounded-md border bg-background p-4 space-y-2",children:[t.jsx("h3",{className:"text-sm font-semibold",children:"Signal Watch"}),t.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Watching for:"})," ",e.formatSignalCondition(a.jobConfig.operator,a.jobConfig.threshold)]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Severity:"})," ",a.jobConfig.severity]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Last Evaluated:"})," ",P((S=a.alertState)==null?void 0:S.lastEvaluatedAt)]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Last Surfaced:"})," ",P((F=a.alertState)==null?void 0:F.lastTriggeredAt)]})]})]}),((w=a.deliveryConfig)==null?void 0:w.channels)&&a.deliveryConfig.channels.length>0&&t.jsxs("div",{className:"rounded-md border bg-background p-4 space-y-2",children:[t.jsx("h3",{className:"text-sm font-semibold",children:"Where It Surfaces"}),t.jsx("div",{className:"flex flex-wrap gap-2",children:a.deliveryConfig.channels.map(d=>t.jsx(e.Badge,{variant:"outline",children:d},d))})]}),f.length>0&&t.jsxs("div",{className:"rounded-md border bg-background p-4 space-y-3",children:[t.jsx("h3",{className:"text-sm font-semibold",children:"Recent Delivery Activity"}),f.length>1&&t.jsx("div",{className:"flex flex-wrap gap-2",children:f.map(d=>t.jsx(e.Button,{variant:d.id===C?"default":"outline",size:"sm",onClick:()=>b(d.id),children:P(d.scheduledFor)},d.id))}),Object.keys(T).length===0?t.jsx("p",{className:"text-sm text-muted-foreground",children:"No delivery attempts were recorded for this run."}):Object.entries(T).map(([d,p])=>t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(e.Badge,{variant:"secondary",className:"text-xs",children:d})}),t.jsx("div",{className:"overflow-hidden rounded border",children:t.jsxs("table",{className:"w-full text-xs",children:[t.jsx("thead",{className:"bg-muted/40",children:t.jsxs("tr",{children:[t.jsx("th",{className:"px-2 py-1 text-left font-medium",children:"Recipient"}),t.jsx("th",{className:"px-2 py-1 text-left font-medium",children:"Status"}),t.jsx("th",{className:"px-2 py-1 text-left font-medium",children:"Time"}),t.jsx("th",{className:"px-2 py-1 text-left font-medium",children:"Error"})]})}),t.jsx("tbody",{children:p.map(g=>t.jsxs("tr",{className:"border-t",children:[t.jsx("td",{className:"px-2 py-1",children:g.recipient}),t.jsx("td",{className:"px-2 py-1",children:t.jsx(e.Badge,{variant:g.status==="SENT"?"default":"destructive",className:"text-[10px]",children:g.status})}),t.jsx("td",{className:"px-2 py-1",children:P(g.createdAt)}),t.jsx("td",{className:"px-2 py-1 text-muted-foreground",children:g.error||"--"})]},g.id))})]})})]},d))]})]}):t.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"Signal not found."})}function Y(){var c,u;const{quotasQuery:s,usageQuery:r}=e.useAlertQuotas(),n=((c=s.data)==null?void 0:c.quotas)||[],o=((u=r.data)==null?void 0:u.usage)||[],l=new Map(o.map(a=>[a.tenantId||"org",a]));return t.jsxs("div",{className:"space-y-4 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-xl font-semibold",children:"Alert Quotas"}),t.jsx(e.Button,{variant:"outline",size:"sm",onClick:()=>{s.refetch(),r.refetch()},children:"Refresh"})]}),s.isLoading||r.isLoading?t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading quota usage..."}):null,t.jsx("div",{className:"overflow-hidden rounded-lg border",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{className:"bg-muted/40",children:t.jsxs("tr",{children:[t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Tenant"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Active Alerts"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Max Active"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Min Cadence"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Max Context Sources"})]})}),t.jsx("tbody",{children:n.map(a=>{const i=a.tenantId||"org",m=l.get(i);return t.jsxs("tr",{className:"border-t",children:[t.jsx("td",{className:"px-3 py-2",children:i}),t.jsx("td",{className:"px-3 py-2",children:(m==null?void 0:m.activeAlerts)??0}),t.jsx("td",{className:"px-3 py-2",children:a.policy.maxActiveAlerts}),t.jsxs("td",{className:"px-3 py-2",children:[a.policy.minCadenceMinutes," min"]}),t.jsx("td",{className:"px-3 py-2",children:a.policy.maxContextSources})]},i)})})]})})]})}exports.AlertManagementPage=e.AlertManagementPage;exports.AlertWizardDialog=e.AlertWizardDialog;exports.AlertsApiError=e.AlertsApiError;exports.CALCULATED_FIELD_ENTITY_MARKER=e.CALCULATED_FIELD_ENTITY_MARKER;exports.CardAlertIndicator=e.CardAlertIndicator;exports.CardSummary=e.CardSummary;exports.DATE_FORMAT_VALUES=e.DATE_FORMAT_VALUES;exports.Dashboard=e.Dashboard;exports.DashboardExportDialog=e.DashboardExportDialog;exports.DashboardWC=e.DashboardWC;exports.EmailScheduleDialog=e.EmailScheduleDialog;exports.ExportError=e.ExportError;exports.PivotMarkerEnum=e.PivotMarkerEnum;exports.ResourceType=e.ResourceType;exports.SemaphorContextProvider=e.SemaphorContextProvider;exports.SemaphorDataProvider=e.SemaphorQueryClient;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.ShareDialog=e.ShareDialog;exports.SummaryCard=e.SummaryCard;exports.Surfboard=e.DashboardPlus;exports.backtestAlert=e.backtestAlert;exports.cancelExport=e.cancelExport;exports.cloneDeep=e.cloneDeep;exports.createAlert=e.createAlert;exports.createEmptyKpiConfig=e.createEmptyKpiConfig;exports.createExport=e.createExport;exports.createSqlGenConfig=e.createSqlGenConfig;exports.deleteAlert=e.deleteAlert;exports.downloadPdf=e.downloadPdf;exports.emitDashboardLoad=e.emitDashboardLoad;exports.emitDashboardUnload=e.emitDashboardUnload;exports.fmt=e.fmt;exports.formatFileSize=e.formatFileSize;exports.getAlert=e.getAlert;exports.getAlertContextSources=e.getAlertContextSources;exports.getAlertHistory=e.getAlertHistory;exports.getAlertQuotaUsage=e.getAlertQuotaUsage;exports.getAlertRunDeliveries=e.getAlertRunDeliveries;exports.getAlertRunSteps=e.getAlertRunSteps;exports.getAlertRuns=e.getAlertRuns;exports.getAlertState=e.getAlertState;exports.getColumnDataType=e.getColumnDataType;exports.getDownloadUrl=e.getDownloadUrl;exports.getExportStatus=e.getExportStatus;exports.getExports=e.getExports;exports.getFilterValueType=e.getFilterValueType;exports.getFormattedTableNameForQuery=e.getFormattedTableNameForQuery;exports.getQualifiedTableName=e.getQualifiedTableName;exports.getSql=e.getSql;exports.invalidateToken=e.invalidateToken;exports.isBooleanDataType=e.isBooleanDataType;exports.isCalculatedDimension=e.isCalculatedDimension;exports.isCalculatedField=e.isCalculatedField;exports.isCalculatedMetric=e.isCalculatedMetric;exports.isColumnInSqlGen=e.isColumnInSqlGen;exports.isDateDataType=e.isDateDataType;exports.isExportComplete=e.isExportComplete;exports.isExportInProgress=e.isExportInProgress;exports.isNumberDataType=e.isNumberDataType;exports.isTextDataType=e.isTextDataType;exports.listAlertQuotas=e.listAlertQuotas;exports.listAlerts=e.listAlerts;exports.previewAlertDeliverable=e.previewAlertDeliverable;exports.resolveDataType=e.resolveDataType;exports.resolveDatamodelName=e.resolveDatamodelName;exports.triggerAlertNow=e.triggerAlertNow;exports.updateAlert=e.updateAlert;exports.updateAlertContextSources=e.updateAlertContextSources;exports.updateAlertQuota=e.updateAlertQuota;exports.useActiveExports=e.useActiveExports;exports.useAddNewFrame=e.useAddNewFrame;exports.useAlertActions=e.useAlertActions;exports.useAlertDeliveries=e.useAlertDeliveries;exports.useAlertDetail=e.useAlertDetail;exports.useAlertDraft=e.useAlertDraft;exports.useAlertFilters=e.useAlertFilters;exports.useAlertHistory=e.useAlertHistory;exports.useAlertQuotas=e.useAlertQuotas;exports.useAlertRuns=e.useAlertRuns;exports.useAlertState=e.useAlertState;exports.useAlertStore=e.useAlertStore;exports.useAlertWizard=e.useAlertWizard;exports.useAlerts=e.useAlerts;exports.useAlertsBootstrap=e.useAlertsBootstrap;exports.useAlertsById=e.useAlertsById;exports.useAlertsForCard=e.useAlertsForCard;exports.useCard=e.useCard;exports.useCardAlertMap=e.useCardAlertMap;exports.useCardSummary=e.useCardSummary;exports.useCurrentActiveCard=e.useCurrentActiveCard;exports.useCurrentCardConfig=e.useCurrentCardConfig;exports.useCurrentSheetActiveCards=e.useCurrentSheetActiveCards;exports.useDashboardActions=e.useDashboardActions;exports.useDashboardById=e.useDashboardById;exports.useDashboardQuery=e.useDashboardQuery;exports.useDashboardStore=e.useDashboardStore;exports.useDashboardSummary=e.useDashboardSummary;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorActions=e.useEditorActions;exports.useEditorAside=e.useEditorAside;exports.useEditorStore=e.useEditorStore;exports.useExportActions=e.useExportActions;exports.useExportStore=e.useExportStore;exports.useInProgressExportsCount=e.useInProgressExportsCount;exports.useManagementStore=e.useManagementStore;exports.useResourceManagement=e.useResourceManagement;exports.useSelectedAlertId=e.useSelectedAlertId;exports.useTextFilterHook=e.useTextFilterHook;exports.CONTROL_CARD_DEFAULT_VALUE=_.CONTROL_CARD_DEFAULT_VALUE;exports.DEFAULT_CALENDAR_CONTEXT=_.DEFAULT_CALENDAR_CONTEXT;exports.DEFAULT_SEMANTIC_DOMAIN_ACCESS=_.DEFAULT_SEMANTIC_DOMAIN_ACCESS;exports.EMPTY_SELECTION=_.EMPTY_SELECTION;exports.CalendarPreferencesDialog=M.CalendarPreferencesDialog;exports.DashboardSummarySettingsDialog=M.DashboardSummarySettingsDialog;exports.ResourceManagementPanel=O.ResourceManagementPanel;exports.useDebouncedDirtyCheck=U.useDebouncedDirtyCheck;exports.AdvancedModeToggle=A.AdvancedModeToggle;exports.DashboardControlsSettings=A.DashboardControlsSettings;exports.DashboardFilterControlsButton=A.DashboardFilterControlsButton;exports.ExportNotificationItem=A.ExportNotificationItem;exports.ExportNotificationList=A.ExportNotificationList;exports.NotificationBell=A.NotificationBell;exports.UnsavedChangesAlert=A.UnsavedChangesAlert;exports.VisualEditingControls=A.VisualEditingControls;exports.useExportPolling=A.useExportPolling;exports.useExportRecovery=A.useExportRecovery;exports.usePristineSnapshotInitializer=A.usePristineSnapshotInitializer;exports.normalizeDashboardForDirtyCheck=L.normalizeDashboardForDirtyCheck;exports.serializeDashboardForDirtyCheck=L.serializeDashboardForDirtyCheck;exports.AlertDetailPageEmbedded=K;exports.Combobox=W;exports.ScheduleDashboard=H;exports.TenantQuotaPage=Y;exports.Visual=q;exports.useAlertBacktest=Q;exports.useExposePrintState=$;
|