@restio/ui 0.2.1-20261007123729 → 0.2.1-20261117141230

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/core.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./src-kY7g6XFo.cjs");exports.AnchoredOverlay=e.AnchoredOverlay;exports.Banner=e.Banner;exports.Button=e.Button;exports.ButtonDropdown=e.ButtonDropdown;exports.ButtonGroup=e.ButtonGroup;exports.CellType=e.CellType;exports.Checkbox=e.Checkbox;exports.CheckboxGroup=e.CheckboxGroup;exports.DatePicker=e.DatePicker;exports.DateRangePicker=e.DateRangePicker;exports.FileUpload=e.FileUpload;exports.Icon=e.Icon;exports.Input=e.Input;exports.Kbd=e.Kbd;exports.Label=e.Label;exports.Menu=e.Menu;exports.NumberInput=e.NumberInput;exports.OTP=e.OTPComponent;exports.OverlayPanel=e.OverlayPanel;exports.ProgressBar=e.ProgressBar;exports.Radio=e.Radio;exports.RadioGroup=e.RadioGroup;exports.Select=e.Select;exports.SelectionGrid=e.SelectionGrid;exports.ShortcutProvider=e.ShortcutProvider;exports.Stack=e.Stack;exports.Tag=e.Tag;exports.TextInput=e.TextInput;exports.Textarea=e.Textarea;exports.Typography=e.Typography;exports.useDynamicVirtualList=e.useDynamicVirtualList;exports.useShortcut=e.useShortcut;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./src-Deyw30nR.cjs");exports.AnchoredOverlay=e.AnchoredOverlay;exports.Banner=e.Banner;exports.Button=e.Button;exports.ButtonDropdown=e.ButtonDropdown;exports.ButtonGroup=e.ButtonGroup;exports.CellType=e.CellType;exports.Checkbox=e.Checkbox;exports.CheckboxGroup=e.CheckboxGroup;exports.DatePicker=e.DatePicker;exports.DateRangePicker=e.DateRangePicker;exports.FileUpload=e.FileUpload;exports.Icon=e.Icon;exports.Input=e.Input;exports.Kbd=e.Kbd;exports.Label=e.Label;exports.Menu=e.Menu;exports.NumberInput=e.NumberInput;exports.OTP=e.OTPComponent;exports.OverlayPanel=e.OverlayPanel;exports.ProgressBar=e.ProgressBar;exports.Radio=e.Radio;exports.RadioGroup=e.RadioGroup;exports.Select=e.Select;exports.SelectionGrid=e.SelectionGrid;exports.ShortcutProvider=e.ShortcutProvider;exports.Stack=e.Stack;exports.Tag=e.Tag;exports.TextInput=e.TextInput;exports.Textarea=e.Textarea;exports.Typography=e.Typography;exports.useDynamicVirtualList=e.useDynamicVirtualList;exports.useShortcut=e.useShortcut;
package/dist/core.js CHANGED
@@ -1,4 +1,4 @@
1
- import { At as a, Bt as s, Ct as e, Dt as o, Et as r, Ft as n, Gt as u, Ht as p, It as c, Kt as i, Mt as l, Nt as d, Ot as P, Pt as T, Rt as h, St as y, Tt as b, Ut as k, Vt as x, Wt as B, _t as S, bt as g, gt as m, ht as C, jt as D, kt as G, qt as I, vt as O, wt as v, xt as R, yt as w, zt as A } from "./src-Bzrq1hWW.js";
1
+ import { At as a, Bt as s, Ct as e, Dt as o, Et as r, Ft as n, Gt as u, Ht as p, It as c, Kt as i, Mt as l, Nt as d, Ot as P, Pt as T, Rt as h, St as y, Tt as b, Ut as k, Vt as x, Wt as B, _t as S, bt as g, gt as m, ht as C, jt as D, kt as G, qt as I, vt as O, wt as v, xt as R, yt as w, zt as A } from "./src-C5tNrBNS.js";
2
2
  export {
3
3
  A as AnchoredOverlay,
4
4
  x as Banner,
package/dist/data.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./src-kY7g6XFo.cjs");exports.Calendar=e.Calendar;exports.Card=e.Card;exports.CardList=e.CardList;exports.Cell=e.Cell;exports.Chart=e.Chart;exports.DataComponentConfigurator=e.DataComponentConfigurator;exports.Form=e.Form;exports.Gantt=e.Gantt;exports.KPI=e.KPI;exports.Switcher=e.Switcher;exports.TableGrid=e.TableGrid;exports.Tree=e.Tree;exports.TreeCard=e.TreeCard;exports.cardLayoutPresetOptions=e.cardLayoutPresetOptions;exports.cardLayoutWithIcon=e.cardLayoutWithIcon;exports.createDataStructureFromFile=e.createDataStructureFromFile;exports.financeKpiLayout=e.financeKpiLayout;exports.financeKpiLayoutWithIcon=e.financeKpiLayoutWithIcon;exports.kpiLayoutPresetOptions=e.kpiLayoutPresetOptions;exports.resolveCardLayoutPreset=e.resolveCardLayoutPreset;exports.resolveKpiLayoutPreset=e.resolveKpiLayoutPreset;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./src-Deyw30nR.cjs");exports.Calendar=e.Calendar;exports.Card=e.Card;exports.CardList=e.CardList;exports.Cell=e.Cell;exports.Chart=e.Chart;exports.DataComponentConfigurator=e.DataComponentConfigurator;exports.Form=e.Form;exports.Gantt=e.Gantt;exports.KPI=e.KPI;exports.Switcher=e.Switcher;exports.TableGrid=e.TableGrid;exports.Tree=e.Tree;exports.TreeCard=e.TreeCard;exports.cardLayoutPresetOptions=e.cardLayoutPresetOptions;exports.cardLayoutWithIcon=e.cardLayoutWithIcon;exports.createDataStructureFromFile=e.createDataStructureFromFile;exports.financeKpiLayout=e.financeKpiLayout;exports.financeKpiLayoutWithIcon=e.financeKpiLayoutWithIcon;exports.kpiLayoutPresetOptions=e.kpiLayoutPresetOptions;exports.resolveCardLayoutPreset=e.resolveCardLayoutPreset;exports.resolveKpiLayoutPreset=e.resolveKpiLayoutPreset;
package/dist/data.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as s, B as t, F as e, H as r, I as o, K as i, L as n, M as p, N as u, P as c, R as C, T as L, U as d, V as l, W as y, j as P, k as m, pt as K, q as f, w as h, z as F } from "./src-Bzrq1hWW.js";
1
+ import { A as s, B as t, F as e, H as r, I as o, K as i, L as n, M as p, N as u, P as c, R as C, T as L, U as d, V as l, W as y, j as P, k as m, pt as K, q as f, w as h, z as F } from "./src-C5tNrBNS.js";
2
2
  export {
3
3
  l as Calendar,
4
4
  y as Card,
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./src-kY7g6XFo.cjs");let r=require("react");r=n.__toESM(r,1);let ve=require("react-dom");var ye={"rst-pip-container":"_rst-pip-container_63eby_1"},e=n.require_jsx_runtime(),Ce=({pipWindow:a,className:t,children:o,...l})=>a?(0,ve.createPortal)((0,e.jsx)("div",{className:[ye["rst-pip-container"],t].filter(Boolean).join(" "),...l,children:o}),a.document.body):null;function be(){return globalThis.documentPictureInPicture}function ke(){return be()!==void 0}function je(a,t=document){for(const o of Array.from(t.querySelectorAll('style, link[rel="stylesheet"]')))a.head.appendChild(o.cloneNode(!0));for(const{name:o,value:l}of Array.from(t.documentElement.attributes))a.documentElement.setAttribute(o,l);for(const{name:o,value:l}of Array.from(t.body.attributes))a.body.setAttribute(o,l)}function we(a){const t=a.createElement("style");t.textContent=["html, body { height: 100%; margin: 0; }","body {"," background-color: var(--rst-backgroundColor-default);"," color: var(--rst-fontColor-main);"," font: var(--rst-font-body);","}"].join(`
2
- `),a.head.appendChild(t)}function Se({width:a,height:t,copyStyles:o=!0}={}){const[l,p]=(0,r.useState)(null),[m,g]=(0,r.useState)(null),k=(0,r.useRef)(null),S=(0,r.useCallback)(async()=>{const _=be();if(!(!_||k.current)){g(null);try{const v=await _.requestWindow({width:a,height:t});k.current=v,o&&je(v.document),we(v.document),v.addEventListener("pagehide",()=>{k.current=null,p(null)}),p(v)}catch(v){g(v instanceof Error?`${v.name}: ${v.message}`:String(v))}}},[a,t,o]),b=(0,r.useCallback)(()=>{k.current?.close()},[]);return(0,r.useEffect)(()=>()=>k.current?.close(),[]),{pipWindow:l,error:m,isOpen:l!==null,isSupported:ke(),open:S,close:b}}var Me=1;function Ne(a,t){const o=a.col+a.w,l=a.row+a.h,p=t.col+t.w,m=t.row+t.h;return a.col<p&&o>t.col&&a.row<m&&l>t.row}function ie(a){return a.col>=1&&a.col+a.w-1<=12&&a.row>=1&&a.row+a.h-1<=30}function oe(a,t,o){for(const l of t)if(l.id!==o&&Ne(a,l.position))return l.id;return null}function he(a,t,o){for(let m=1;m<=30-t+1;m++)for(let g=1;g<=12-a+1;g++){const k={col:g,row:m,w:a,h:t};if(!oe(k,o))return k}return{col:1,row:o.reduce((m,g)=>Math.max(m,g.position.row+g.position.h),1),w:a,h:t}}function De(a,t){const o={};for(const l of a){const p=t[l.dataSourceId];if(!p)continue;const m=p.data??[],g=n.generateColumnsFromSchema(m.length>0?Object.keys(m[0]):[]),k=n.fieldOptionsFromColumns(l.columns??g),S=new Set,b=[];for(const _ of k)S.has(_.id)||(S.add(_.id),b.push(_));o[l.dataSourceId]=b}return o}var ne=0;function ce(){return ne+=1,`widget-${Date.now()}-${ne}`}function ue(){return{version:1,name:"Untitled Dashboard",filters:null,widgets:[]}}function ze(a,t){const[o,l]=(0,r.useState)(a??ue),[p,m]=(0,r.useState)(null),[g,k]=(0,r.useState)(t?"view":"edit"),S=(0,r.useRef)(!1),b=(0,r.useCallback)(()=>{S.current=!0},[]),_=(0,r.useCallback)((h,f,I)=>{l(d=>{const w={id:ce(),title:`New ${h}`,componentType:h,dataSourceId:f,position:I};return{...d,widgets:[...d.widgets,w]}}),b()},[b]),v=(0,r.useCallback)(h=>{l(f=>{const I=he(6,3,f.widgets),d={id:ce(),position:I,...h.widget};return{...f,widgets:[...f.widgets,d]}}),b()},[b]),j=(0,r.useCallback)(h=>{l(f=>({...f,widgets:f.widgets.filter(I=>I.id!==h)})),m(f=>f===h?null:f),b()},[b]),R=(0,r.useCallback)((h,f)=>{l(I=>({...I,widgets:I.widgets.map(d=>{if(d.id!==h)return d;const w={...d,...f};if(f.dataSourceId&&f.dataSourceId!==d.dataSourceId){const W=n.propSchemaRegistry[d.componentType]??[];w.columns=void 0,w.componentProps=n.buildDefaultPropsFromSchema(W),w.filters=void 0,w.uiConfig=void 0}return w})})),b()},[b]),c=(0,r.useCallback)((h,f)=>{R(h,{position:f})},[R]),P=(0,r.useCallback)(h=>{m(h)},[]),G=o.widgets.find(h=>h.id===p)??null,O=(0,r.useCallback)(h=>{l(f=>({...f,name:h})),b()},[b]),s=(0,r.useCallback)(h=>{l(f=>({...f,filters:typeof h=="function"?h(f.filters):h})),b()},[b]),u=(0,r.useCallback)(h=>{l(h??ue()),m(null),S.current=!1},[]),B=(0,r.useCallback)(h=>{l(h),m(null),S.current=!1},[]);return{state:{config:o,selectedWidgetId:p,isDirty:S.current},mode:g,setMode:k,addWidget:_,addPrebuiltWidget:v,removeWidget:j,updateWidget:R,moveWidget:c,selectWidget:P,selectedWidget:G,setName:O,setFilters:s,resetConfig:u,loadConfig:B}}var i={"rst-dashboard-builder":"_rst-dashboard-builder_ukxxh_2","rst-dashboard-builder-sidebar":"_rst-dashboard-builder-sidebar_ukxxh_18","rst-dashboard-builder-sidebar-header":"_rst-dashboard-builder-sidebar-header_ukxxh_28","rst-dashboard-builder-sidebar-list":"_rst-dashboard-builder-sidebar-list_ukxxh_33","rst-dashboard-builder-widget-type-item":"_rst-dashboard-builder-widget-type-item_ukxxh_40","rst-dashboard-builder-widget-type-label":"_rst-dashboard-builder-widget-type-label_ukxxh_59","rst-dashboard-builder-widget-type-desc":"_rst-dashboard-builder-widget-type-desc_ukxxh_63","rst-dashboard-builder-main":"_rst-dashboard-builder-main_ukxxh_69","rst-dashboard-builder-toolbar":"_rst-dashboard-builder-toolbar_ukxxh_77","rst-dashboard-builder-toolbar-left":"_rst-dashboard-builder-toolbar-left_ukxxh_87","rst-dashboard-builder-toolbar-right":"_rst-dashboard-builder-toolbar-right_ukxxh_93","rst-dashboard-builder-name-input":"_rst-dashboard-builder-name-input_ukxxh_99","rst-dashboard-builder-name-display":"_rst-dashboard-builder-name-display_ukxxh_115","rst-dashboard-builder-view":"_rst-dashboard-builder-view_ukxxh_122","rst-dashboard-widget":"_rst-dashboard-widget_ukxxh_146","rst-switcher":"_rst-switcher_ukxxh_170","rst-dashboard-builder-canvas":"_rst-dashboard-builder-canvas_ukxxh_183","rst-dashboard-builder-grid":"_rst-dashboard-builder-grid_ukxxh_191","rst-dashboard-builder-grid-cell":"_rst-dashboard-builder-grid-cell_ukxxh_201","rst-dashboard-builder-grid-cell-view":"_rst-dashboard-builder-grid-cell-view_ukxxh_213","rst-dashboard-builder-grid-empty":"_rst-dashboard-builder-grid-empty_ukxxh_219","rst-dashboard-builder-widget":"_rst-dashboard-builder-widget_ukxxh_40","rst-dashboard-builder-widget-view":"_rst-dashboard-builder-widget-view_ukxxh_290","rst-dashboard-builder-widget-selected":"_rst-dashboard-builder-widget-selected_ukxxh_298","rst-dashboard-builder-widget-dragging":"_rst-dashboard-builder-widget-dragging_ukxxh_304","rst-dashboard-builder-widget-collision":"_rst-dashboard-builder-widget-collision_ukxxh_310","rst-dashboard-builder-resize-handle-n":"_rst-dashboard-builder-resize-handle-n_ukxxh_317","rst-dashboard-builder-resize-handle-s":"_rst-dashboard-builder-resize-handle-s_ukxxh_318","rst-dashboard-builder-resize-handle-e":"_rst-dashboard-builder-resize-handle-e_ukxxh_319","rst-dashboard-builder-resize-handle-w":"_rst-dashboard-builder-resize-handle-w_ukxxh_320","rst-dashboard-builder-resize-handle-ne":"_rst-dashboard-builder-resize-handle-ne_ukxxh_321","rst-dashboard-builder-resize-handle-nw":"_rst-dashboard-builder-resize-handle-nw_ukxxh_322","rst-dashboard-builder-resize-handle-se":"_rst-dashboard-builder-resize-handle-se_ukxxh_323","rst-dashboard-builder-resize-handle-sw":"_rst-dashboard-builder-resize-handle-sw_ukxxh_324","rst-dashboard-builder-filter-body":"_rst-dashboard-builder-filter-body_ukxxh_540","rst-dashboard-builder-filter-tabs":"_rst-dashboard-builder-filter-tabs_ukxxh_548","rst-dashboard-builder-configurator":"_rst-dashboard-builder-configurator_ukxxh_557","rst-dashboard-builder-configurator-header":"_rst-dashboard-builder-configurator-header_ukxxh_567","rst-dashboard-builder-configurator-body":"_rst-dashboard-builder-configurator-body_ukxxh_575","rst-dashboard-builder-configurator-empty":"_rst-dashboard-builder-configurator-empty_ukxxh_582","rst-dashboard-builder-configurator-divider":"_rst-dashboard-builder-configurator-divider_ukxxh_593","rst-dashboard-builder-field":"_rst-dashboard-builder-field_ukxxh_599","rst-dashboard-builder-field-label":"_rst-dashboard-builder-field-label_ukxxh_605","rst-dashboard-builder-checkbox-row":"_rst-dashboard-builder-checkbox-row_ukxxh_611","rst-dashboard-builder-checkbox-label":"_rst-dashboard-builder-checkbox-label_ukxxh_618","rst-dashboard-builder-drag-ghost":"_rst-dashboard-builder-drag-ghost_ukxxh_624","rst-dashboard-builder-drop-zone":"_rst-dashboard-builder-drop-zone_ukxxh_638","rst-dashboard-builder-add-widget-item":"_rst-dashboard-builder-add-widget-item_ukxxh_646","rst-dashboard-builder-add-widget-item-label":"_rst-dashboard-builder-add-widget-item-label_ukxxh_667","rst-dashboard-builder-add-widget-item-desc":"_rst-dashboard-builder-add-widget-item-desc_ukxxh_673","rst-dashboard-builder-template-wrapper":"_rst-dashboard-builder-template-wrapper_ukxxh_679","rst-dashboard-builder-template-picker":"_rst-dashboard-builder-template-picker_ukxxh_683","rst-dashboard-builder-template-picker-header":"_rst-dashboard-builder-template-picker-header_ukxxh_697","rst-dashboard-builder-template-item":"_rst-dashboard-builder-template-item_ukxxh_705","rst-dashboard-builder-template-item-name":"_rst-dashboard-builder-template-item-name_ukxxh_727","rst-dashboard-builder-template-item-desc":"_rst-dashboard-builder-template-item-desc_ukxxh_733"},J=12,ae=30,te=12;function Re({widgets:a,onMoveWidget:t,onAddWidget:o,onChange:l}){const p=(0,r.useRef)(null),[m,g]=(0,r.useState)(null),[k,S]=(0,r.useState)(null),[b,_]=(0,r.useState)(null),[v,j]=(0,r.useState)(null),[R,c]=(0,r.useState)(!1),[P,G]=(0,r.useState)(null),[O,s]=(0,r.useState)(null),[u,B]=(0,r.useState)(null),[h,f]=(0,r.useState)(null),[I,d]=(0,r.useState)(!1),w=(0,r.useCallback)(()=>p.current?{colWidth:(p.current.getBoundingClientRect().width-te*(J-1))/J,rowHeight:92}:null,[]),W=(0,r.useCallback)((C,M)=>{if(!p.current)return{col:1,row:1};const z=p.current.getBoundingClientRect(),D=(z.width-te*(J-1))/J;return{col:Math.max(1,Math.min(J,Math.round((C-z.left)/(D+te))+1)),row:Math.max(1,Math.min(ae,Math.round((M-z.top)/92)+1))}},[]),Q=(0,r.useCallback)(C=>{if(C.preventDefault(),C.dataTransfer.types.includes("application/widget-type")){C.dataTransfer.dropEffect="copy";return}if(C.dataTransfer.types.includes("application/move-widget")&&m&&k&&b){C.dataTransfer.dropEffect="move";const M=a.find(E=>E.id===m);if(!M)return;const z=w();if(!z)return;const D=C.clientX-k.x,L=C.clientY-k.y,re=Math.round(D/(z.colWidth+te)),q=Math.round(L/z.rowHeight),H={col:Math.max(1,Math.min(J-M.position.w+1,b.col+re)),row:Math.max(1,Math.min(ae-M.position.h+1,b.row+q)),w:M.position.w,h:M.position.h};j(H);const T=oe(H,a,m);c(T!==null)}},[m,k,b,w,a]),Z=(0,r.useCallback)(C=>{C.preventDefault();const M=C.dataTransfer.getData("application/widget-type");if(M){const{col:z,row:D}=W(C.clientX,C.clientY),L={col:z,row:D,w:4,h:3};if(z+4-1>J&&(L.col=9),D+3-1>ae&&(L.row=28),oe(L,a))return;o(M,"",L),l();return}m&&v&&(!R&&ie(v)&&(t(m,v),l()),g(null),S(null),_(null),j(null),c(!1))},[W,a,o,l,m,v,R,t]),U=(0,r.useCallback)((C,M)=>{C.stopPropagation(),C.dataTransfer.setData("application/move-widget",M.id),C.dataTransfer.effectAllowed="move",g(M.id),S({x:C.clientX,y:C.clientY}),_({...M.position}),j({...M.position}),c(!1)},[]),y=(0,r.useCallback)(()=>{g(null),S(null),_(null),j(null),c(!1)},[]),se=(0,r.useCallback)((C,M,z)=>{C.stopPropagation(),C.preventDefault(),G(M.id),s(z),B({...M.position}),f({x:C.clientX,y:C.clientY}),d(!1)},[]);return(0,r.useEffect)(()=>{if(!P||!O||!u||!h)return;const C=z=>{if(!a.find(N=>N.id===P))return;const D=w();if(!D)return;const L=z.clientX-h.x,re=z.clientY-h.y,q=Math.round(L/(D.colWidth+te)),H=Math.round(re/D.rowHeight),T=u.col,E=u.row,Y=u.w,K=u.h;let F={...u};switch(O){case"e":{const N=Math.max(1,Math.min(J-T+1,Y+q));F={...F,w:N};break}case"w":{const N=Math.max(1,Math.min(T+Y-1,T+q)),A=T+Y-N;F={...u,col:N,w:Math.max(1,A)};break}case"s":{const N=Math.max(1,Math.min(ae-E+1,K+H));F={...u,h:N};break}case"n":{const N=Math.max(1,Math.min(E+K-1,E+H)),A=E+K-N;F={...u,row:N,h:Math.max(1,A)};break}case"se":{const N=Math.max(1,Math.min(J-T+1,Y+q)),A=Math.max(1,Math.min(ae-E+1,K+H));F={...u,w:N,h:A};break}case"sw":{const N=Math.max(1,Math.min(T+Y-1,T+q)),A=T+Y-N,x=Math.max(1,Math.min(ae-E+1,K+H));F={...u,col:N,w:Math.max(1,A),h:x};break}case"ne":{const N=Math.max(1,Math.min(E+K-1,E+H)),A=E+K-N,x=Math.max(1,Math.min(J-T+1,Y+q));F={...u,row:N,h:Math.max(1,A),w:x};break}case"nw":{const N=Math.max(1,Math.min(T+Y-1,T+q)),A=Math.max(1,Math.min(E+K-1,E+H)),x=T+Y-N,$=E+K-A;F={col:N,row:A,w:Math.max(1,x),h:Math.max(1,$)};break}}j(F),g(P);const le=oe(F,a,P);d(le!==null),c(le!==null)},M=()=>{a.find(z=>z.id===P)&&v&&!I&&ie(v)&&(t(P,v),l()),G(null),s(null),B(null),f(null),d(!1),g(null),S(null),_(null),j(null),c(!1)};return document.addEventListener("mousemove",C),document.addEventListener("mouseup",M),()=>{document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",M)}},[P,O,u,h,a,v,I,w,t,l]),{gridRef:p,draggingWidgetId:m,dragPreviewPos:v,hasCollision:R,resizeCollision:I,handleDragOver:Q,handleDrop:Z,handleWidgetDragStart:U,handleWidgetDragEnd:y,handleResizeStart:se,pixelToGrid:W}}var Ie=12,Ee=20,me=({widgets:a,selectedWidgetId:t,dataSources:o,onSelectWidget:l,onMoveWidget:p,onRemoveWidget:m,onAddWidget:g,onChange:k,getWidgetActions:S,mode:b="edit"})=>{const _=b==="view",{gridRef:v,draggingWidgetId:j,dragPreviewPos:R,hasCollision:c,handleDragOver:P,handleDrop:G,handleWidgetDragStart:O,handleWidgetDragEnd:s,handleResizeStart:u}=Re({widgets:a,onMoveWidget:p,onAddWidget:g,onChange:k}),B=(0,r.useCallback)((d,w)=>{d.stopPropagation(),l(w)},[l]),h=(0,r.useCallback)(()=>{l(null)},[l]),f=(0,r.useCallback)(d=>{const w=o[d.dataSourceId]?.data??[],W=w.length>0?Object.keys(w[0]):[];return{data:w,columns:d.columns??n.generateColumnsFromSchema(W)}},[o]),I=[];for(let d=1;d<=Ee;d++)for(let w=1;w<=Ie;w++){const W=_?i["rst-dashboard-builder-grid-cell-view"]:i["rst-dashboard-builder-grid-cell"];I.push((0,e.jsx)("div",{className:W,style:{gridColumn:w,gridRow:d}},`cell-${d}-${w}`))}return(0,e.jsx)("div",{className:i["rst-dashboard-builder-canvas"],onClick:h,children:(0,e.jsxs)("div",{ref:v,className:i["rst-dashboard-builder-grid"],onDragOver:P,onDrop:G,children:[I,a.length===0&&(0,e.jsx)("div",{className:i["rst-dashboard-builder-grid-empty"],children:"Drag a widget from the palette to get started"}),a.map(d=>{const w=!_&&d.id===t,W=!_&&d.id===j,Q=f(d),Z=W&&R?R:d.position,U=W&&c;return(0,e.jsxs)("div",{className:[i["rst-dashboard-builder-widget"],_?i["rst-dashboard-builder-widget-view"]:"",w?i["rst-dashboard-builder-widget-selected"]:"",W?i["rst-dashboard-builder-widget-dragging"]:"",U?i["rst-dashboard-builder-widget-collision"]:""].filter(Boolean).join(" "),style:{gridColumn:`${Z.col} / span ${Z.w}`,gridRow:`${Z.row} / span ${Z.h}`},draggable:!_,..._?{}:{onDragStart:y=>O(y,d),onDragEnd:s,onClick:y=>B(y,d.id),role:"button",tabIndex:0,"aria-label":`Widget: ${d.title}`,onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),l(d.id)),(y.key==="Delete"||y.key==="Backspace")&&(y.preventDefault(),m(d.id),k())}},children:[(0,e.jsx)(n.DashboardWidget,{id:d.id,dataSourceId:d.dataSourceId,title:d.title,subtitle:d.subtitle,icon:d.icon,data:Q.data,columns:Q.columns,enableExport:S?.(d).enableExport??!0,enableScreenshot:S?.(d).enableScreenshot??!1,enableExpand:S?.(d).enableExpand??!0,enableFilter:S?.(d).enableFilter??!1,fieldOptions:n.fieldOptionsFromColumns(Q.columns),children:({data:y})=>(0,e.jsx)(n.Switcher,{data:y,columns:Q.columns,activeComponent:d.componentType,componentProps:d.componentProps,showConfigurator:!1})}),!_&&w&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:i["rst-dashboard-builder-resize-handle-n"],onMouseDown:y=>u(y,d,"n")}),(0,e.jsx)("div",{className:i["rst-dashboard-builder-resize-handle-s"],onMouseDown:y=>u(y,d,"s")}),(0,e.jsx)("div",{className:i["rst-dashboard-builder-resize-handle-e"],onMouseDown:y=>u(y,d,"e")}),(0,e.jsx)("div",{className:i["rst-dashboard-builder-resize-handle-w"],onMouseDown:y=>u(y,d,"w")}),(0,e.jsx)("div",{className:i["rst-dashboard-builder-resize-handle-ne"],onMouseDown:y=>u(y,d,"ne")}),(0,e.jsx)("div",{className:i["rst-dashboard-builder-resize-handle-nw"],onMouseDown:y=>u(y,d,"nw")}),(0,e.jsx)("div",{className:i["rst-dashboard-builder-resize-handle-se"],onMouseDown:y=>u(y,d,"se")}),(0,e.jsx)("div",{className:i["rst-dashboard-builder-resize-handle-sw"],onMouseDown:y=>u(y,d,"sw")})]})]},`${d.id}::${d.dataSourceId}`)})]})})};me.displayName="BuilderCanvas";var Pe=[{type:"table-grid",label:"Table",icon:"table",description:"Sortable, filterable data table"},{type:"chart",label:"Chart",icon:"chart",description:"Bar, line, pie charts"},{type:"calendar",label:"Calendar",icon:"calendar",description:"Calendar view of events"},{type:"card-list",label:"Card List",icon:"list",description:"Visual card layout"},{type:"form",label:"Form",icon:"form",description:"Editable form from schema"},{type:"gantt",label:"Gantt",icon:"chart-gantt",description:"Project timeline view"},{type:"kpi",label:"KPI",icon:"chart",description:"Single-metric KPI card"}],pe=({widget:a,dataSources:t,onUpdate:o,onRemove:l,onClose:p,onAddWidget:m,prebuiltSections:g,onAddPrebuiltSection:k})=>{const S=Object.values(t).map(s=>({value:s.id,label:s.name})),b=(0,r.useMemo)(()=>[{value:"",id:"none"},...Object.keys(n.svgAssets).map(s=>({value:s,leadingVisual:s}))],[]),_=a?.dataSourceId,v=(0,r.useMemo)(()=>{if(!_)return[];const s=t[_];return s?s.fields.map(u=>({id:u.id,header:u.name,accessorKey:u.id})):[]},[_,t]),j=(0,r.useMemo)(()=>n.propSchemaRegistry[a?.componentType??"table-grid"]??[],[a?.componentType]),R=(0,r.useMemo)(()=>a?.componentProps??n.buildDefaultPropsFromSchema(j),[a?.componentProps,j]),c=(0,r.useCallback)((s,u)=>{o({[s]:u})},[o]),P=(0,r.useCallback)(s=>{o({componentType:s,componentProps:n.buildDefaultPropsFromSchema(n.propSchemaRegistry[s]??[])})},[o]),G=(0,r.useCallback)((s,u)=>{o({componentProps:{...R,[s]:u}})},[R,o]),O=(0,r.useMemo)(()=>!g||g.length===0?[]:g.filter(s=>s.version===1),[g]);return a?(0,e.jsxs)("aside",{className:i["rst-dashboard-builder-configurator"],"aria-label":"Widget configurator",children:[(0,e.jsxs)("div",{className:i["rst-dashboard-builder-configurator-header"],children:[(0,e.jsx)(n.Typography,{variant:"heading",children:"Configure"}),(0,e.jsx)(n.Button,{variant:"invisible",size:"small",leadingVisual:"close",onClick:p,"aria-label":"Close configurator"})]}),(0,e.jsxs)("div",{className:i["rst-dashboard-builder-configurator-body"],children:[(0,e.jsxs)("div",{className:i["rst-dashboard-builder-field"],children:[(0,e.jsx)("label",{className:i["rst-dashboard-builder-field-label"],children:"Title"}),(0,e.jsx)(n.TextInput,{value:a.title,onChange:s=>c("title",s??""),placeholder:"Widget title"})]}),(0,e.jsxs)("div",{className:i["rst-dashboard-builder-field"],children:[(0,e.jsx)("label",{className:i["rst-dashboard-builder-field-label"],children:"Subtitle"}),(0,e.jsx)(n.TextInput,{value:a.subtitle??"",onChange:s=>c("subtitle",s||void 0),placeholder:"Optional subtitle"})]}),(0,e.jsxs)("div",{className:i["rst-dashboard-builder-field"],children:[(0,e.jsx)("label",{className:i["rst-dashboard-builder-field-label"],children:"Icon"}),(0,e.jsx)(n.Select,{value:a.icon??"",onChange:s=>c("icon",s||void 0),options:b,renderList:({options:s,value:u,onChange:B,onClose:h})=>(0,e.jsx)(n.List,{options:s,activeIndex:[typeof u=="string"?u:""],onClick:f=>{B(f.value),h()},showFilter:!0})})]}),(0,e.jsxs)("div",{className:i["rst-dashboard-builder-field"],children:[(0,e.jsx)("label",{className:i["rst-dashboard-builder-field-label"],children:"Data Source"}),(0,e.jsx)(n.Select,{value:a.dataSourceId,onChange:s=>c("dataSourceId",s),options:S})]}),a.dataSourceId&&t[a.dataSourceId]&&(0,e.jsxs)("div",{className:i["rst-dashboard-builder-field"],children:[(0,e.jsx)("label",{className:i["rst-dashboard-builder-field-label"],children:"Columns"}),(0,e.jsx)(n.CheckboxGroup,{options:t[a.dataSourceId].fields.map(s=>({value:s.id,label:s.name})),value:a.columns?.map(s=>s.id).filter(Boolean)??t[a.dataSourceId].fields.map(s=>s.id),onChange:s=>{const u=t[a.dataSourceId],B=s.map(h=>u.fields.find(f=>f.id===h)).filter(Boolean).map(h=>({id:h.id,header:h.name,accessorKey:h.id}));o({columns:B.length===u.fields.length?void 0:B})}})]}),(0,e.jsxs)("div",{className:i["rst-dashboard-builder-field"],children:[(0,e.jsx)("label",{className:i["rst-dashboard-builder-field-label"],children:"Actions"}),(0,e.jsxs)("div",{className:i["rst-dashboard-builder-checkbox-row"],children:[(0,e.jsx)(n.Checkbox,{checked:a.enableExport??!0,onChange:s=>c("enableExport",s)}),(0,e.jsx)("span",{className:i["rst-dashboard-builder-checkbox-label"],children:"Export CSV"})]}),(0,e.jsxs)("div",{className:i["rst-dashboard-builder-checkbox-row"],children:[(0,e.jsx)(n.Checkbox,{checked:a.enableScreenshot??!1,onChange:s=>c("enableScreenshot",s)}),(0,e.jsx)("span",{className:i["rst-dashboard-builder-checkbox-label"],children:"Screenshot"})]}),(0,e.jsxs)("div",{className:i["rst-dashboard-builder-checkbox-row"],children:[(0,e.jsx)(n.Checkbox,{checked:a.enableExpand??!0,onChange:s=>c("enableExpand",s)}),(0,e.jsx)("span",{className:i["rst-dashboard-builder-checkbox-label"],children:"Expand"})]}),(0,e.jsxs)("div",{className:i["rst-dashboard-builder-checkbox-row"],children:[(0,e.jsx)(n.Checkbox,{checked:a.enableFilter??!0,onChange:s=>c("enableFilter",s)}),(0,e.jsx)("span",{className:i["rst-dashboard-builder-checkbox-label"],children:"Filter"})]})]}),(0,e.jsx)("div",{className:i["rst-dashboard-builder-configurator-divider"]}),(0,e.jsx)(n.DataComponentConfigurator,{schema:j,values:R,onChange:G,columns:v,scope:"all",componentId:a.componentType,onComponentChange:P,componentMetaList:n.dataComponentMetaList},a.dataSourceId??"no-ds"),(0,e.jsx)("div",{className:i["rst-dashboard-builder-configurator-divider"]}),(0,e.jsx)(n.Button,{variant:"danger",size:"small",value:"Remove widget",leadingVisual:"trash",onClick:l})]})]}):(0,e.jsxs)("aside",{className:i["rst-dashboard-builder-configurator"],"aria-label":"Add widget",children:[(0,e.jsx)("div",{className:i["rst-dashboard-builder-configurator-header"],children:(0,e.jsx)(n.Typography,{variant:"heading",children:"Add Widget"})}),(0,e.jsxs)("div",{className:i["rst-dashboard-builder-configurator-body"],children:[Pe.map(s=>(0,e.jsxs)("button",{className:i["rst-dashboard-builder-add-widget-item"],onClick:()=>m(s.type),children:[(0,e.jsx)(n.Icon,{src:s.icon}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:i["rst-dashboard-builder-add-widget-item-label"],children:s.label}),(0,e.jsx)("div",{className:i["rst-dashboard-builder-add-widget-item-desc"],children:s.description})]})]},s.type)),O.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:i["rst-dashboard-builder-configurator-divider"]}),(0,e.jsx)(n.Typography,{variant:"heading",children:"Pre-built Sections"}),O.map(s=>(0,e.jsxs)("button",{className:i["rst-dashboard-builder-add-widget-item"],onClick:()=>k?.(s),children:[(0,e.jsx)(n.Icon,{src:"layout"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:i["rst-dashboard-builder-add-widget-item-label"],children:s.name}),(0,e.jsx)("div",{className:i["rst-dashboard-builder-add-widget-item-desc"],children:s.description})]})]},s.name))]})]})]})};pe.displayName="WidgetConfigurator";var xe=({dataSources:a,initialConfig:t,templates:o,prebuiltSections:l,onSave:p,onChange:m,widgetActionDefaults:g,readOnly:k,className:S})=>{const{state:b,mode:_,setMode:v,addWidget:j,addPrebuiltWidget:R,removeWidget:c,updateWidget:P,moveWidget:G,selectWidget:O,selectedWidget:s,setName:u,setFilters:B,loadConfig:h}=ze(t,k),[f,I]=(0,r.useState)(!1),[d,w]=(0,r.useState)("dialog"),[W,Q]=(0,r.useState)(null),[Z,U]=(0,r.useState)(null),[y,se]=(0,r.useState)(!1),[C,M]=(0,r.useState)(null),z=(0,r.useMemo)(()=>De(b.config.widgets,a),[b.config.widgets,a]),D=_==="view",L=D?Z:b.config.filters;(0,r.useEffect)(()=>{f&&M(L)},[f]);const re=(0,r.useCallback)(()=>{D?U(C):B(C),I(!1)},[C,D,B]);(0,r.useEffect)(()=>{D&&!y&&(U(b.config.filters),se(!0)),D||se(!1)},[D,y,b.config.filters]);const q=(0,r.useRef)(m);q.current=m;const H=(0,r.useCallback)((x,$)=>{(D?U:B)(ee=>({...ee??{},[x]:$}))},[D,B]),T=(0,r.useMemo)(()=>({filters:L,onFilterChange:H}),[L,H]),E=(0,r.useMemo)(()=>!o||o.length===0?[]:o.filter(x=>x.version===1),[o]),Y=(0,r.useMemo)(()=>E.map(x=>({value:x.name,id:x.name,description:x.description})),[E]),K=(0,r.useCallback)(x=>{const $=E.find(X=>X.name===x);if(!$)return;const ee={version:1,...$.config};h(ee)},[E,h]),F=(0,r.useMemo)(()=>({enableExport:g?.enableExport??!0,enableScreenshot:g?.enableScreenshot??!1,enableExpand:g?.enableExpand??!0,enableFilter:g?.enableFilter??!0}),[g]),le=(0,r.useCallback)(x=>({enableExport:x.enableExport??F.enableExport,enableScreenshot:x.enableScreenshot??F.enableScreenshot,enableExpand:x.enableExpand??F.enableExpand,enableFilter:x.enableFilter??F.enableFilter}),[F]);(0,r.useEffect)(()=>{q.current?.(b.config)},[b.config]);const N=[i["rst-dashboard-builder"],S].filter(Boolean).join(" "),A=(0,r.useCallback)(()=>{p(b.config)},[b.config,p]);return(0,e.jsx)("div",{className:N,children:(0,e.jsxs)("div",{className:i["rst-dashboard-builder-main"],children:[(0,e.jsxs)("div",{className:i["rst-dashboard-builder-toolbar"],children:[(0,e.jsxs)("div",{className:i["rst-dashboard-builder-toolbar-left"],children:[D?(0,e.jsx)("span",{className:i["rst-dashboard-builder-name-display"],children:b.config.name}):(0,e.jsx)("input",{className:i["rst-dashboard-builder-name-input"],type:"text",value:b.config.name,onChange:x=>u(x.target.value),placeholder:"Dashboard name","aria-label":"Dashboard name"}),Object.keys(z).length>0&&(0,e.jsx)(n.Button,{variant:"invisible",size:"small",leadingVisual:"filter",onClick:()=>I(x=>!x),"aria-label":"Toggle filter panel","aria-pressed":f})]}),(0,e.jsxs)("div",{className:i["rst-dashboard-builder-toolbar-right"],children:[E.length>0&&!D&&(0,e.jsx)(n.ButtonDropdown,{options:Y,onChange:K,placeholder:"Load Template",size:"small"}),!k&&(0,e.jsx)(n.ButtonGroup,{value:_,options:[{value:"edit"},{value:"view"}],onChange:x=>v(x)}),!D&&(0,e.jsx)(n.Button,{variant:"primary",size:"small",value:"Save",onClick:A})]})]}),(0,e.jsx)(n.DashboardContext,{value:T,children:(0,e.jsxs)("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[(0,e.jsx)(me,{mode:_,widgets:b.config.widgets,selectedWidgetId:b.selectedWidgetId,dataSources:a,onSelectWidget:O,onMoveWidget:G,onRemoveWidget:c,onAddWidget:j,onChange:()=>{},getWidgetActions:le}),f&&Object.keys(z).length>0&&(0,e.jsxs)(n.OverlayPanel,{open:f,variant:d,position:d==="dialog"?"center":"right",onClose:()=>I(!1),closeOnEscape:!0,closeOnClickOutside:d==="dialog",width:d==="sidepanel"?360:void 0,maxWidth:d==="dialog"?640:void 0,maxHeight:d==="dialog"?"80vh":void 0,"aria-label":"Dashboard filters",children:[(0,e.jsx)(n.OverlayPanel.Header,{title:"Filters",onClose:()=>I(!1),actions:(0,e.jsx)(n.Button,{variant:"invisible",size:"small",leadingVisual:d==="dialog"?"square-half":"open-center",onClick:()=>w(x=>x==="dialog"?"sidepanel":"dialog"),"aria-label":d==="dialog"?"Switch to side panel":"Switch to dialog"})}),(0,e.jsx)("div",{className:i["rst-dashboard-builder-filter-body"],children:(()=>{const x=Object.keys(z);if(x.length===0)return(0,e.jsx)("div",{style:{padding:"var(--rst-space-default)"},children:"No data sources to filter."});const $=W&&x.includes(W)?W:x[0],ee=C?.[$]??n.emptyFilterGroup();return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:i["rst-dashboard-builder-filter-tabs"],children:x.map(X=>(0,e.jsx)(n.Button,{value:X,variant:X===$?"base":"invisible",size:"small",onClick:()=>Q(X),children:X},X))}),(0,e.jsx)(n.FilterBuilder,{filters:ee,onChange:X=>M(_e=>({..._e??{},[$]:X.filters.length===0?null:X})),fieldOptions:z[$]})]})})()}),(0,e.jsxs)(n.OverlayPanel.Footer,{children:[(0,e.jsx)(n.Button,{variant:"invisible",size:"small",value:"Clear",onClick:()=>M({})}),(0,e.jsx)(n.Button,{variant:"primary",size:"small",value:"Apply",onClick:re})]})]}),!D&&(0,e.jsx)(pe,{widget:s,dataSources:a,onUpdate:x=>{s&&P(s.id,x)},onRemove:()=>{s&&c(s.id)},onClose:()=>O(null),onAddWidget:x=>{const $=Object.values(a)[0],ee=he(6,3,b.config.widgets);j(x,$?.id??"",ee)},prebuiltSections:l,onAddPrebuiltSection:x=>{R(x)}})]})})]})})};xe.displayName="DashboardBuilder";var de={"rst-border-beam":"_rst-border-beam_4g5sg_1","rst-border-beam-effect":"_rst-border-beam-effect_4g5sg_7","rst-border-beam-ring":"_rst-border-beam-ring_4g5sg_15","rst-border-beam-spin":"_rst-border-beam-spin_4g5sg_27","rst-border-beam-travel":"_rst-border-beam-travel_4g5sg_1"};function We(a){return[...a].filter(t=>t.color).map(t=>({...t,percent:Math.min(100,Math.max(0,t.percent))})).sort((t,o)=>t.percent-o.percent)}function Fe(a,t,o,l){const p=360/Math.max(1,l),m=2*(t+o);return m<=0||a<=0?Math.min(90,p):Math.min(a/m*360,p)}function Oe(a,t){const o=Math.max(0,Math.min(t,360)),l=We(a);return`conic-gradient(from 0deg, ${l.length?l.map(p=>`${p.color} ${p.percent/100*o}deg`).join(", "):"var(--rst-borderColor-focus) 0deg"}, transparent ${o}deg, transparent 360deg)`}var Be=[{color:"transparent",percent:0},{color:"var(--rst-borderColor-primary-default)",percent:70},{color:"var(--rst-borderColor-focus)",percent:100}],fe=({children:a,color:t=Be,count:o=1,duration:l=6,lineWidth:p=1,outset:m=0,inset:g=0,size:k=120,className:S,style:b,..._})=>{const v=(0,r.useRef)(null),[j,R]=(0,r.useState)({radius:"",width:0,height:0});(0,r.useEffect)(()=>{const s=v.current?.firstElementChild;if(!s||typeof ResizeObserver>"u")return;const u=new ResizeObserver(()=>{R({radius:getComputedStyle(s).borderTopLeftRadius,width:s.clientWidth,height:s.clientHeight})});return u.observe(s),()=>u.disconnect()},[]);const c=Math.max(1,Math.floor(o)),P=(0,r.useMemo)(()=>Oe(t,Fe(k,j.width,j.height,c)),[t,k,j.width,j.height,c]),G=360/c,O=Math.hypot(j.width+2*m,j.height+2*m);return(0,e.jsxs)("div",{ref:v,className:[de["rst-border-beam"],S].filter(Boolean).join(" "),style:{"--rst-border-beam-gradient":P,"--rst-border-beam-duration":`${l}s`,"--rst-border-beam-line-width":`${p}px`,"--rst-border-beam-outset":`${m}px`,"--rst-border-beam-inset":`${g}px`,...O>0?{"--rst-border-beam-diagonal":`${O}px`}:{},...j.radius?{"--rst-border-beam-radius":j.radius}:{},...b},..._,children:[a,(0,e.jsx)("span",{className:de["rst-border-beam-effect"],"aria-hidden":"true",children:(0,e.jsx)("span",{className:de["rst-border-beam-ring"],children:Array.from({length:c},(s,u)=>(0,e.jsx)("span",{className:de["rst-border-beam-spin"],style:{"--rst-border-beam-offset":`${u*G}deg`}},u))})})]})};fe.displayName="BorderBeam";function Te(a){return a.filter(t=>t.type==="text").map(t=>t.text).join(" ").trim()}function Ae(a){return a.data??[]}function ge(a,t){return a.events?.includes(t)??!1}function $e({block:a,onBlockEvent:t}){const o=Ae(a),l=a.props??{};if(a.component==="form")return(0,e.jsx)(Ge,{block:a,onBlockEvent:t});if(a.component==="chart"){const p=l.height??16;return(0,e.jsx)(n.Chart,{data:o,columns:a.columns,type:l.type??"bar",xAxisColumn:l.xAxisColumn,yAxisColumns:l.yAxisColumns,series:l.series,title:l.title,subtitle:l.subtitle,showLegend:l.showLegend,showGrid:l.showGrid,height:p})}return a.component==="kpi"?(0,e.jsx)(n.KPI,{data:o[0]??{},columns:a.columns,layout:n.resolveKpiLayoutPreset(l.layout)}):a.component==="card-list"?(0,e.jsx)(n.CardList,{data:o,columns:a.columns,layout:n.resolveCardLayoutPreset(l.layout),onCardClick:ge(a,"action")?p=>t?.({blockId:a.id,component:"card-list",event:"action",handler:a.handler,values:p}):void 0}):(0,e.jsx)(n.TableGrid,{data:o,columns:a.columns,enableSorting:l.enableSorting!==!1,enableSelection:l.enableSelection===!0,showGrid:l.showGrid??"horizontal",columnSizing:"fixed",enableVirtualization:l.enableVirtualization!==!1})}function Ge({block:a,onBlockEvent:t}){const[o,l]=(0,r.useState)(!1);return ge(a,"submit")?(0,e.jsx)(n.Form,{data:a.data??[{}],columns:a.columns,labelAlign:"top",onSubmit:async p=>{l(!0);try{await t?.({blockId:a.id,component:"form",event:"submit",handler:a.handler,values:p})}finally{l(!1)}},actions:[{type:"submit",variant:"primary",value:"Submit",loading:o,disabled:o},{type:"reset",variant:"invisible",value:"Reset",disabled:o}]}):(0,e.jsx)(n.Form,{data:a.data??[{}],columns:a.columns})}var V={"rst-chat":"_rst-chat_12syz_1","rst-chat-empty":"_rst-chat-empty_12syz_9","rst-chat-messages":"_rst-chat-messages_12syz_19","rst-chat-message":"_rst-chat-message_12syz_19","rst-chat-message-user":"_rst-chat-message-user_12syz_33","rst-chat-message-assistant":"_rst-chat-message-assistant_12syz_37","rst-chat-bubble":"_rst-chat-bubble_12syz_41","rst-chat-bubble-user":"_rst-chat-bubble-user_12syz_51","rst-chat-bubble-assistant":"_rst-chat-bubble-assistant_12syz_56","rst-chat-text":"_rst-chat-text_12syz_63","rst-chat-block":"_rst-chat-block_12syz_68","rst-chat-block-title":"_rst-chat-block-title_12syz_76","rst-chat-processing":"_rst-chat-processing_12syz_80","rst-chat-composer":"_rst-chat-composer_12syz_84"};function Le({messages:a,isProcessing:t=!1,inputValue:o,onInputChange:l,onSubmit:p,onKeyDown:m,onBlockEvent:g,emptyStateText:k="Ask a question to get started.",inputPlaceholder:S="Ask something...",className:b,renderBlock:_}){const v=(0,r.useRef)(null);(0,r.useEffect)(()=>{const c=v.current;c&&(c.scrollTop=c.scrollHeight)},[a,t]);const j=t||o.trim().length===0,R=(c,P)=>c.type==="text"?(0,e.jsx)(n.Typography,{variant:"body",className:V["rst-chat-text"],children:c.text},P):(0,e.jsxs)("div",{className:V["rst-chat-block"],children:[c.block.meta?.title&&(0,e.jsx)(n.Typography,{variant:"label",className:V["rst-chat-block-title"],children:c.block.meta.title}),_?_(c.block):(0,e.jsx)($e,{block:c.block,onBlockEvent:g})]},c.block.id);return(0,e.jsxs)("div",{className:[V["rst-chat"],b].filter(Boolean).join(" "),children:[a.length===0?(0,e.jsx)("div",{className:V["rst-chat-empty"],children:(0,e.jsx)(n.Typography,{variant:"body",children:k})}):(0,e.jsxs)("div",{ref:v,className:V["rst-chat-messages"],role:"log","aria-live":"polite",children:[a.map(c=>(0,e.jsx)("article",{className:[V["rst-chat-message"],V[`rst-chat-message-${c.role}`]].join(" "),"aria-label":`${c.role==="user"?"You":"Assistant"}: ${Te(c.parts)}`,children:(0,e.jsx)("div",{className:[V["rst-chat-bubble"],V[`rst-chat-bubble-${c.role}`]].join(" "),children:c.parts.map(R)})},c.id)),t&&(0,e.jsx)("div",{className:V["rst-chat-processing"],children:(0,e.jsx)(n.Typography,{variant:"caption",children:"Working..."})})]}),(0,e.jsxs)("form",{className:V["rst-chat-composer"],onSubmit:c=>{c.preventDefault(),j||p()},children:[(0,e.jsx)(n.Textarea,{value:o,onChange:l,onKeyDown:m,placeholder:S,ariaLabel:"Message",rows:1,disabled:t}),(0,e.jsx)(n.Button,{type:"submit",variant:"primary",value:"Send",leadingVisual:"send",disabled:j})]})]})}exports.BorderBeam=fe;exports.ChatSurface=Le;exports.DASHBOARD_CONFIG_VERSION=Me;exports.DashboardBuilder=xe;exports.PipContainer=Ce;exports.usePip=Se;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./src-Deyw30nR.cjs");let r=require("react");r=n.__toESM(r,1);let ve=require("react-dom");var ye={"rst-pip-container":"_rst-pip-container_63eby_1"},e=n.require_jsx_runtime(),Ce=({pipWindow:a,className:t,children:d,...s})=>{if(!a)return null;const m=[ye["rst-pip-container"],t].filter(Boolean).join(" ");return(0,ve.createPortal)((0,e.jsx)("div",{className:m,...s,children:d}),a.document.body)};function be(){return globalThis.documentPictureInPicture}function ke(){return be()!==void 0}function je(a,t=document){for(const d of Array.from(t.querySelectorAll('style, link[rel="stylesheet"]')))a.head.appendChild(d.cloneNode(!0));for(const{name:d,value:s}of Array.from(t.documentElement.attributes))a.documentElement.setAttribute(d,s);for(const{name:d,value:s}of Array.from(t.body.attributes))a.body.setAttribute(d,s)}function we(a){const t=a.createElement("style");t.textContent=["html, body { height: 100%; margin: 0; }","body {"," background-color: var(--rst-backgroundColor-default);"," color: var(--rst-fontColor-main);"," font: var(--rst-font-body);","}"].join(`
2
+ `),a.head.appendChild(t)}function Se({width:a,height:t,copyStyles:d=!0}={}){const[s,m]=(0,r.useState)(null),[p,_]=(0,r.useState)(null),j=(0,r.useRef)(null),S=(0,r.useCallback)(async()=>{const v=be();if(!(!v||j.current)){_(null);try{const f=await v.requestWindow({width:a,height:t});j.current=f,d&&je(f.document),we(f.document),f.addEventListener("pagehide",()=>{j.current=null,m(null)}),m(f)}catch(f){_(f instanceof Error?`${f.name}: ${f.message}`:String(f))}}},[a,t,d]),b=(0,r.useCallback)(()=>{j.current?.close()},[]);return(0,r.useEffect)(()=>()=>j.current?.close(),[]),{pipWindow:s,error:p,isOpen:s!==null,isSupported:ke(),open:S,close:b}}var Me=1;function Ne(a,t){const d=a.col+a.w,s=a.row+a.h,m=t.col+t.w,p=t.row+t.h;return a.col<m&&d>t.col&&a.row<p&&s>t.row}function ie(a){return a.col>=1&&a.col+a.w-1<=12&&a.row>=1&&a.row+a.h-1<=30}function oe(a,t,d){for(const s of t)if(s.id!==d&&Ne(a,s.position))return s.id;return null}function he(a,t,d){for(let p=1;p<=30-t+1;p++)for(let _=1;_<=12-a+1;_++){const j={col:_,row:p,w:a,h:t};if(!oe(j,d))return j}return{col:1,row:d.reduce((p,_)=>Math.max(p,_.position.row+_.position.h),1),w:a,h:t}}function De(a,t){const d={};for(const s of a){const m=t[s.dataSourceId];if(!m)continue;const p=m.data??[],_=p.length>0?Object.keys(p[0]):[],j=n.generateColumnsFromSchema(_),S=s.columns??j,b=n.fieldOptionsFromColumns(S),v=new Set,f=[];for(const y of b)v.has(y.id)||(v.add(y.id),f.push(y));d[s.dataSourceId]=f}return d}var ne=0;function ce(){return ne+=1,`widget-${Date.now()}-${ne}`}function ue(){return{version:1,name:"Untitled Dashboard",filters:null,widgets:[]}}function ze(a,t){const[d,s]=(0,r.useState)(a??ue),[m,p]=(0,r.useState)(null),[_,j]=(0,r.useState)(t?"view":"edit"),S=(0,r.useRef)(!1),b=(0,r.useCallback)(()=>{S.current=!0},[]),v=(0,r.useCallback)((c,g,E)=>{s(o=>{const w={id:ce(),title:`New ${c}`,componentType:c,dataSourceId:g,position:E};return{...o,widgets:[...o.widgets,w]}}),b()},[b]),f=(0,r.useCallback)(c=>{s(g=>{const E=he(6,3,g.widgets),o={id:ce(),position:E,...c.widget};return{...g,widgets:[...g.widgets,o]}}),b()},[b]),y=(0,r.useCallback)(c=>{s(g=>({...g,widgets:g.widgets.filter(E=>E.id!==c)})),p(g=>g===c?null:g),b()},[b]),I=(0,r.useCallback)((c,g)=>{s(E=>({...E,widgets:E.widgets.map(o=>{if(o.id!==c)return o;const w={...o,...g};if(g.dataSourceId&&g.dataSourceId!==o.dataSourceId){const F=n.propSchemaRegistry[o.componentType]??[];w.columns=void 0,w.componentProps=n.buildDefaultPropsFromSchema(F),w.filters=void 0,w.uiConfig=void 0}return w})})),b()},[b]),u=(0,r.useCallback)((c,g)=>{I(c,{position:g})},[I]),W=(0,r.useCallback)(c=>{p(c)},[]),G=d.widgets.find(c=>c.id===m)??null,B=(0,r.useCallback)(c=>{s(g=>({...g,name:c})),b()},[b]),l=(0,r.useCallback)(c=>{s(g=>({...g,filters:typeof c=="function"?c(g.filters):c})),b()},[b]),h=(0,r.useCallback)(c=>{s(c??ue()),p(null),S.current=!1},[]),D=(0,r.useCallback)(c=>{s(c),p(null),S.current=!1},[]);return{state:{config:d,selectedWidgetId:m,isDirty:S.current},mode:_,setMode:j,addWidget:v,addPrebuiltWidget:f,removeWidget:y,updateWidget:I,moveWidget:u,selectWidget:W,selectedWidget:G,setName:B,setFilters:l,resetConfig:h,loadConfig:D}}var i={"rst-dashboard-builder":"_rst-dashboard-builder_ukxxh_2","rst-dashboard-builder-sidebar":"_rst-dashboard-builder-sidebar_ukxxh_18","rst-dashboard-builder-sidebar-header":"_rst-dashboard-builder-sidebar-header_ukxxh_28","rst-dashboard-builder-sidebar-list":"_rst-dashboard-builder-sidebar-list_ukxxh_33","rst-dashboard-builder-widget-type-item":"_rst-dashboard-builder-widget-type-item_ukxxh_40","rst-dashboard-builder-widget-type-label":"_rst-dashboard-builder-widget-type-label_ukxxh_59","rst-dashboard-builder-widget-type-desc":"_rst-dashboard-builder-widget-type-desc_ukxxh_63","rst-dashboard-builder-main":"_rst-dashboard-builder-main_ukxxh_69","rst-dashboard-builder-toolbar":"_rst-dashboard-builder-toolbar_ukxxh_77","rst-dashboard-builder-toolbar-left":"_rst-dashboard-builder-toolbar-left_ukxxh_87","rst-dashboard-builder-toolbar-right":"_rst-dashboard-builder-toolbar-right_ukxxh_93","rst-dashboard-builder-name-input":"_rst-dashboard-builder-name-input_ukxxh_99","rst-dashboard-builder-name-display":"_rst-dashboard-builder-name-display_ukxxh_115","rst-dashboard-builder-view":"_rst-dashboard-builder-view_ukxxh_122","rst-dashboard-widget":"_rst-dashboard-widget_ukxxh_146","rst-switcher":"_rst-switcher_ukxxh_170","rst-dashboard-builder-canvas":"_rst-dashboard-builder-canvas_ukxxh_183","rst-dashboard-builder-grid":"_rst-dashboard-builder-grid_ukxxh_191","rst-dashboard-builder-grid-cell":"_rst-dashboard-builder-grid-cell_ukxxh_201","rst-dashboard-builder-grid-cell-view":"_rst-dashboard-builder-grid-cell-view_ukxxh_213","rst-dashboard-builder-grid-empty":"_rst-dashboard-builder-grid-empty_ukxxh_219","rst-dashboard-builder-widget":"_rst-dashboard-builder-widget_ukxxh_40","rst-dashboard-builder-widget-view":"_rst-dashboard-builder-widget-view_ukxxh_290","rst-dashboard-builder-widget-selected":"_rst-dashboard-builder-widget-selected_ukxxh_298","rst-dashboard-builder-widget-dragging":"_rst-dashboard-builder-widget-dragging_ukxxh_304","rst-dashboard-builder-widget-collision":"_rst-dashboard-builder-widget-collision_ukxxh_310","rst-dashboard-builder-resize-handle-n":"_rst-dashboard-builder-resize-handle-n_ukxxh_317","rst-dashboard-builder-resize-handle-s":"_rst-dashboard-builder-resize-handle-s_ukxxh_318","rst-dashboard-builder-resize-handle-e":"_rst-dashboard-builder-resize-handle-e_ukxxh_319","rst-dashboard-builder-resize-handle-w":"_rst-dashboard-builder-resize-handle-w_ukxxh_320","rst-dashboard-builder-resize-handle-ne":"_rst-dashboard-builder-resize-handle-ne_ukxxh_321","rst-dashboard-builder-resize-handle-nw":"_rst-dashboard-builder-resize-handle-nw_ukxxh_322","rst-dashboard-builder-resize-handle-se":"_rst-dashboard-builder-resize-handle-se_ukxxh_323","rst-dashboard-builder-resize-handle-sw":"_rst-dashboard-builder-resize-handle-sw_ukxxh_324","rst-dashboard-builder-filter-body":"_rst-dashboard-builder-filter-body_ukxxh_540","rst-dashboard-builder-filter-tabs":"_rst-dashboard-builder-filter-tabs_ukxxh_548","rst-dashboard-builder-configurator":"_rst-dashboard-builder-configurator_ukxxh_557","rst-dashboard-builder-configurator-header":"_rst-dashboard-builder-configurator-header_ukxxh_567","rst-dashboard-builder-configurator-body":"_rst-dashboard-builder-configurator-body_ukxxh_575","rst-dashboard-builder-configurator-empty":"_rst-dashboard-builder-configurator-empty_ukxxh_582","rst-dashboard-builder-configurator-divider":"_rst-dashboard-builder-configurator-divider_ukxxh_593","rst-dashboard-builder-field":"_rst-dashboard-builder-field_ukxxh_599","rst-dashboard-builder-field-label":"_rst-dashboard-builder-field-label_ukxxh_605","rst-dashboard-builder-checkbox-row":"_rst-dashboard-builder-checkbox-row_ukxxh_611","rst-dashboard-builder-checkbox-label":"_rst-dashboard-builder-checkbox-label_ukxxh_618","rst-dashboard-builder-drag-ghost":"_rst-dashboard-builder-drag-ghost_ukxxh_624","rst-dashboard-builder-drop-zone":"_rst-dashboard-builder-drop-zone_ukxxh_638","rst-dashboard-builder-add-widget-item":"_rst-dashboard-builder-add-widget-item_ukxxh_646","rst-dashboard-builder-add-widget-item-label":"_rst-dashboard-builder-add-widget-item-label_ukxxh_667","rst-dashboard-builder-add-widget-item-desc":"_rst-dashboard-builder-add-widget-item-desc_ukxxh_673","rst-dashboard-builder-template-wrapper":"_rst-dashboard-builder-template-wrapper_ukxxh_679","rst-dashboard-builder-template-picker":"_rst-dashboard-builder-template-picker_ukxxh_683","rst-dashboard-builder-template-picker-header":"_rst-dashboard-builder-template-picker-header_ukxxh_697","rst-dashboard-builder-template-item":"_rst-dashboard-builder-template-item_ukxxh_705","rst-dashboard-builder-template-item-name":"_rst-dashboard-builder-template-item-name_ukxxh_727","rst-dashboard-builder-template-item-desc":"_rst-dashboard-builder-template-item-desc_ukxxh_733"},Z=12,re=30,de=12;function Re({widgets:a,onMoveWidget:t,onAddWidget:d,onChange:s}){const m=(0,r.useRef)(null),[p,_]=(0,r.useState)(null),[j,S]=(0,r.useState)(null),[b,v]=(0,r.useState)(null),[f,y]=(0,r.useState)(null),[I,u]=(0,r.useState)(!1),[W,G]=(0,r.useState)(null),[B,l]=(0,r.useState)(null),[h,D]=(0,r.useState)(null),[c,g]=(0,r.useState)(null),[E,o]=(0,r.useState)(!1),w=(0,r.useCallback)(()=>m.current?{colWidth:(m.current.getBoundingClientRect().width-132)/Z,rowHeight:92}:null,[]),F=(0,r.useCallback)((k,M)=>{if(!m.current)return{col:1,row:1};const R=m.current.getBoundingClientRect(),z=(R.width-132)/Z;return{col:Math.max(1,Math.min(Z,Math.round((k-R.left)/(z+de))+1)),row:Math.max(1,Math.min(re,Math.round((M-R.top)/92)+1))}},[]),J=(0,r.useCallback)(k=>{if(k.preventDefault(),k.dataTransfer.types.includes("application/widget-type")){k.dataTransfer.dropEffect="copy";return}if(k.dataTransfer.types.includes("application/move-widget")&&p&&j&&b){k.dataTransfer.dropEffect="move";const M=a.find(P=>P.id===p);if(!M)return;const R=w();if(!R)return;const z=k.clientX-j.x,L=k.clientY-j.y,te=Math.round(z/(R.colWidth+de)),q=Math.round(L/R.rowHeight),H={col:Math.max(1,Math.min(Z-M.position.w+1,b.col+te)),row:Math.max(1,Math.min(re-M.position.h+1,b.row+q)),w:M.position.w,h:M.position.h};y(H);const T=oe(H,a,p);u(T!==null)}},[p,j,b,w,a]),Q=(0,r.useCallback)(k=>{k.preventDefault();const M=k.dataTransfer.getData("application/widget-type");if(M){const{col:R,row:z}=F(k.clientX,k.clientY),L={col:R,row:z,w:4,h:3};if(R+4-1>Z&&(L.col=9),z+3-1>re&&(L.row=28),oe(L,a))return;d(M,"",L),s();return}p&&f&&(!I&&ie(f)&&(t(p,f),s()),_(null),S(null),v(null),y(null),u(!1))},[F,a,d,s,p,f,I,t]),U=(0,r.useCallback)((k,M)=>{k.stopPropagation(),k.dataTransfer.setData("application/move-widget",M.id),k.dataTransfer.effectAllowed="move",_(M.id),S({x:k.clientX,y:k.clientY}),v({...M.position}),y({...M.position}),u(!1)},[]),ae=(0,r.useCallback)(()=>{_(null),S(null),v(null),y(null),u(!1)},[]),C=(0,r.useCallback)((k,M,R)=>{k.stopPropagation(),k.preventDefault(),G(M.id),l(R),D({...M.position}),g({x:k.clientX,y:k.clientY}),o(!1)},[]);return(0,r.useEffect)(()=>{if(!W||!B||!h||!c)return;const k=R=>{if(!a.find(N=>N.id===W))return;const z=w();if(!z)return;const L=R.clientX-c.x,te=R.clientY-c.y,q=Math.round(L/(z.colWidth+de)),H=Math.round(te/z.rowHeight),T=h.col,P=h.row,Y=h.w,K=h.h;let O={...h};switch(B){case"e":{const N=Math.max(1,Math.min(Z-T+1,Y+q));O={...O,w:N};break}case"w":{const N=Math.max(1,Math.min(T+Y-1,T+q)),A=T+Y-N;O={...h,col:N,w:Math.max(1,A)};break}case"s":{const N=Math.max(1,Math.min(re-P+1,K+H));O={...h,h:N};break}case"n":{const N=Math.max(1,Math.min(P+K-1,P+H)),A=P+K-N;O={...h,row:N,h:Math.max(1,A)};break}case"se":{const N=Math.max(1,Math.min(Z-T+1,Y+q)),A=Math.max(1,Math.min(re-P+1,K+H));O={...h,w:N,h:A};break}case"sw":{const N=Math.max(1,Math.min(T+Y-1,T+q)),A=T+Y-N,x=Math.max(1,Math.min(re-P+1,K+H));O={...h,col:N,w:Math.max(1,A),h:x};break}case"ne":{const N=Math.max(1,Math.min(P+K-1,P+H)),A=P+K-N,x=Math.max(1,Math.min(Z-T+1,Y+q));O={...h,row:N,h:Math.max(1,A),w:x};break}case"nw":{const N=Math.max(1,Math.min(T+Y-1,T+q)),A=Math.max(1,Math.min(P+K-1,P+H)),x=T+Y-N,$=P+K-A;O={col:N,row:A,w:Math.max(1,x),h:Math.max(1,$)};break}}y(O),_(W);const se=oe(O,a,W);o(se!==null),u(se!==null)},M=()=>{a.find(R=>R.id===W)&&f&&!E&&ie(f)&&(t(W,f),s()),G(null),l(null),D(null),g(null),o(!1),_(null),S(null),v(null),y(null),u(!1)};return document.addEventListener("mousemove",k),document.addEventListener("mouseup",M),()=>{document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",M)}},[W,B,h,c,a,f,E,w,t,s]),{gridRef:m,draggingWidgetId:p,dragPreviewPos:f,hasCollision:I,resizeCollision:E,handleDragOver:J,handleDrop:Q,handleWidgetDragStart:U,handleWidgetDragEnd:ae,handleResizeStart:C,pixelToGrid:F}}var Ie=12,Ee=20,me=({widgets:a,selectedWidgetId:t,dataSources:d,onSelectWidget:s,onMoveWidget:m,onRemoveWidget:p,onAddWidget:_,onChange:j,getWidgetActions:S,mode:b="edit"})=>{const v=b==="view",{gridRef:f,draggingWidgetId:y,dragPreviewPos:I,hasCollision:u,handleDragOver:W,handleDrop:G,handleWidgetDragStart:B,handleWidgetDragEnd:l,handleResizeStart:h}=Re({widgets:a,onMoveWidget:m,onAddWidget:_,onChange:j}),D=(0,r.useCallback)((o,w)=>{o.stopPropagation(),s(w)},[s]),c=(0,r.useCallback)(()=>{s(null)},[s]),g=(0,r.useCallback)(o=>{const w=d[o.dataSourceId]?.data??[],F=w.length>0?Object.keys(w[0]):[];return{data:w,columns:o.columns??n.generateColumnsFromSchema(F)}},[d]),E=[];for(let o=1;o<=Ee;o++)for(let w=1;w<=Ie;w++){const F=v?i["rst-dashboard-builder-grid-cell-view"]:i["rst-dashboard-builder-grid-cell"];E.push((0,e.jsx)("div",{className:F,style:{gridColumn:w,gridRow:o}},`cell-${o}-${w}`))}return(0,e.jsx)("div",{className:i["rst-dashboard-builder-canvas"],onClick:c,children:(0,e.jsxs)("div",{ref:f,className:i["rst-dashboard-builder-grid"],onDragOver:W,onDrop:G,children:[E,a.length===0&&(0,e.jsx)("div",{className:i["rst-dashboard-builder-grid-empty"],children:"Drag a widget from the palette to get started"}),a.map(o=>{const w=!v&&o.id===t,F=!v&&o.id===y,J=g(o),Q=F&&I?I:o.position,U=F&&u,ae=[i["rst-dashboard-builder-widget"],v?i["rst-dashboard-builder-widget-view"]:"",w?i["rst-dashboard-builder-widget-selected"]:"",F?i["rst-dashboard-builder-widget-dragging"]:"",U?i["rst-dashboard-builder-widget-collision"]:""].filter(Boolean).join(" ");return(0,e.jsxs)("div",{className:ae,style:{gridColumn:`${Q.col} / span ${Q.w}`,gridRow:`${Q.row} / span ${Q.h}`},draggable:!v,...v?{}:{onDragStart:C=>B(C,o),onDragEnd:l,onClick:C=>D(C,o.id),role:"button",tabIndex:0,"aria-label":`Widget: ${o.title}`,onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),s(o.id)),(C.key==="Delete"||C.key==="Backspace")&&(C.preventDefault(),p(o.id),j())}},children:[(0,e.jsx)(n.DashboardWidget,{id:o.id,dataSourceId:o.dataSourceId,title:o.title,subtitle:o.subtitle,icon:o.icon,data:J.data,columns:J.columns,enableExport:S?.(o).enableExport??!0,enableScreenshot:S?.(o).enableScreenshot??!1,enableExpand:S?.(o).enableExpand??!0,enableFilter:S?.(o).enableFilter??!1,fieldOptions:n.fieldOptionsFromColumns(J.columns),children:({data:C})=>(0,e.jsx)(n.Switcher,{data:C,columns:J.columns,activeComponent:o.componentType,componentProps:o.componentProps,showConfigurator:!1})}),!v&&w&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:i["rst-dashboard-builder-resize-handle-n"],onMouseDown:C=>h(C,o,"n")}),(0,e.jsx)("div",{className:i["rst-dashboard-builder-resize-handle-s"],onMouseDown:C=>h(C,o,"s")}),(0,e.jsx)("div",{className:i["rst-dashboard-builder-resize-handle-e"],onMouseDown:C=>h(C,o,"e")}),(0,e.jsx)("div",{className:i["rst-dashboard-builder-resize-handle-w"],onMouseDown:C=>h(C,o,"w")}),(0,e.jsx)("div",{className:i["rst-dashboard-builder-resize-handle-ne"],onMouseDown:C=>h(C,o,"ne")}),(0,e.jsx)("div",{className:i["rst-dashboard-builder-resize-handle-nw"],onMouseDown:C=>h(C,o,"nw")}),(0,e.jsx)("div",{className:i["rst-dashboard-builder-resize-handle-se"],onMouseDown:C=>h(C,o,"se")}),(0,e.jsx)("div",{className:i["rst-dashboard-builder-resize-handle-sw"],onMouseDown:C=>h(C,o,"sw")})]})]},`${o.id}::${o.dataSourceId}`)})]})})};me.displayName="BuilderCanvas";var Pe=[{type:"table-grid",label:"Table",icon:"table",description:"Sortable, filterable data table"},{type:"chart",label:"Chart",icon:"chart",description:"Bar, line, pie charts"},{type:"calendar",label:"Calendar",icon:"calendar",description:"Calendar view of events"},{type:"card-list",label:"Card List",icon:"list",description:"Visual card layout"},{type:"form",label:"Form",icon:"form",description:"Editable form from schema"},{type:"gantt",label:"Gantt",icon:"chart-gantt",description:"Project timeline view"},{type:"kpi",label:"KPI",icon:"chart",description:"Single-metric KPI card"}],pe=({widget:a,dataSources:t,onUpdate:d,onRemove:s,onClose:m,onAddWidget:p,prebuiltSections:_,onAddPrebuiltSection:j})=>{const S=Object.values(t).map(l=>({value:l.id,label:l.name})),b=(0,r.useMemo)(()=>[{value:"",id:"none"},...Object.keys(n.svgAssets).map(l=>({value:l,leadingVisual:l}))],[]),v=a?.dataSourceId,f=(0,r.useMemo)(()=>{if(!v)return[];const l=t[v];return l?l.fields.map(h=>({id:h.id,header:h.name,accessorKey:h.id})):[]},[v,t]),y=(0,r.useMemo)(()=>n.propSchemaRegistry[a?.componentType??"table-grid"]??[],[a?.componentType]),I=(0,r.useMemo)(()=>a?.componentProps??n.buildDefaultPropsFromSchema(y),[a?.componentProps,y]),u=(0,r.useCallback)((l,h)=>{d({[l]:h})},[d]),W=(0,r.useCallback)(l=>{const h=n.propSchemaRegistry[l]??[];d({componentType:l,componentProps:n.buildDefaultPropsFromSchema(h)})},[d]),G=(0,r.useCallback)((l,h)=>{d({componentProps:{...I,[l]:h}})},[I,d]),B=(0,r.useMemo)(()=>!_||_.length===0?[]:_.filter(l=>l.version===1),[_]);return a?(0,e.jsxs)("aside",{className:i["rst-dashboard-builder-configurator"],"aria-label":"Widget configurator",children:[(0,e.jsxs)("div",{className:i["rst-dashboard-builder-configurator-header"],children:[(0,e.jsx)(n.Typography,{variant:"heading",children:"Configure"}),(0,e.jsx)(n.Button,{variant:"invisible",size:"small",leadingVisual:"close",onClick:m,"aria-label":"Close configurator"})]}),(0,e.jsxs)("div",{className:i["rst-dashboard-builder-configurator-body"],children:[(0,e.jsxs)("div",{className:i["rst-dashboard-builder-field"],children:[(0,e.jsx)("label",{className:i["rst-dashboard-builder-field-label"],children:"Title"}),(0,e.jsx)(n.TextInput,{value:a.title,onChange:l=>u("title",l??""),placeholder:"Widget title"})]}),(0,e.jsxs)("div",{className:i["rst-dashboard-builder-field"],children:[(0,e.jsx)("label",{className:i["rst-dashboard-builder-field-label"],children:"Subtitle"}),(0,e.jsx)(n.TextInput,{value:a.subtitle??"",onChange:l=>u("subtitle",l||void 0),placeholder:"Optional subtitle"})]}),(0,e.jsxs)("div",{className:i["rst-dashboard-builder-field"],children:[(0,e.jsx)("label",{className:i["rst-dashboard-builder-field-label"],children:"Icon"}),(0,e.jsx)(n.Select,{value:a.icon??"",onChange:l=>u("icon",l||void 0),options:b,renderList:({options:l,value:h,onChange:D,onClose:c})=>(0,e.jsx)(n.List,{options:l,activeIndex:[typeof h=="string"?h:""],onClick:g=>{D(g.value),c()},showFilter:!0})})]}),(0,e.jsxs)("div",{className:i["rst-dashboard-builder-field"],children:[(0,e.jsx)("label",{className:i["rst-dashboard-builder-field-label"],children:"Data Source"}),(0,e.jsx)(n.Select,{value:a.dataSourceId,onChange:l=>u("dataSourceId",l),options:S})]}),a.dataSourceId&&t[a.dataSourceId]&&(0,e.jsxs)("div",{className:i["rst-dashboard-builder-field"],children:[(0,e.jsx)("label",{className:i["rst-dashboard-builder-field-label"],children:"Columns"}),(0,e.jsx)(n.CheckboxGroup,{options:t[a.dataSourceId].fields.map(l=>({value:l.id,label:l.name})),value:a.columns?.map(l=>l.id).filter(Boolean)??t[a.dataSourceId].fields.map(l=>l.id),onChange:l=>{const h=t[a.dataSourceId],D=l.map(c=>h.fields.find(g=>g.id===c)).filter(Boolean).map(c=>({id:c.id,header:c.name,accessorKey:c.id}));d({columns:D.length===h.fields.length?void 0:D})}})]}),(0,e.jsxs)("div",{className:i["rst-dashboard-builder-field"],children:[(0,e.jsx)("label",{className:i["rst-dashboard-builder-field-label"],children:"Actions"}),(0,e.jsxs)("div",{className:i["rst-dashboard-builder-checkbox-row"],children:[(0,e.jsx)(n.Checkbox,{checked:a.enableExport??!0,onChange:l=>u("enableExport",l)}),(0,e.jsx)("span",{className:i["rst-dashboard-builder-checkbox-label"],children:"Export CSV"})]}),(0,e.jsxs)("div",{className:i["rst-dashboard-builder-checkbox-row"],children:[(0,e.jsx)(n.Checkbox,{checked:a.enableScreenshot??!1,onChange:l=>u("enableScreenshot",l)}),(0,e.jsx)("span",{className:i["rst-dashboard-builder-checkbox-label"],children:"Screenshot"})]}),(0,e.jsxs)("div",{className:i["rst-dashboard-builder-checkbox-row"],children:[(0,e.jsx)(n.Checkbox,{checked:a.enableExpand??!0,onChange:l=>u("enableExpand",l)}),(0,e.jsx)("span",{className:i["rst-dashboard-builder-checkbox-label"],children:"Expand"})]}),(0,e.jsxs)("div",{className:i["rst-dashboard-builder-checkbox-row"],children:[(0,e.jsx)(n.Checkbox,{checked:a.enableFilter??!0,onChange:l=>u("enableFilter",l)}),(0,e.jsx)("span",{className:i["rst-dashboard-builder-checkbox-label"],children:"Filter"})]})]}),(0,e.jsx)("div",{className:i["rst-dashboard-builder-configurator-divider"]}),(0,e.jsx)(n.DataComponentConfigurator,{schema:y,values:I,onChange:G,columns:f,scope:"all",componentId:a.componentType,onComponentChange:W,componentMetaList:n.dataComponentMetaList},a.dataSourceId??"no-ds"),(0,e.jsx)("div",{className:i["rst-dashboard-builder-configurator-divider"]}),(0,e.jsx)(n.Button,{variant:"danger",size:"small",value:"Remove widget",leadingVisual:"trash",onClick:s})]})]}):(0,e.jsxs)("aside",{className:i["rst-dashboard-builder-configurator"],"aria-label":"Add widget",children:[(0,e.jsx)("div",{className:i["rst-dashboard-builder-configurator-header"],children:(0,e.jsx)(n.Typography,{variant:"heading",children:"Add Widget"})}),(0,e.jsxs)("div",{className:i["rst-dashboard-builder-configurator-body"],children:[Pe.map(l=>(0,e.jsxs)("button",{className:i["rst-dashboard-builder-add-widget-item"],onClick:()=>p(l.type),children:[(0,e.jsx)(n.Icon,{src:l.icon}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:i["rst-dashboard-builder-add-widget-item-label"],children:l.label}),(0,e.jsx)("div",{className:i["rst-dashboard-builder-add-widget-item-desc"],children:l.description})]})]},l.type)),B.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:i["rst-dashboard-builder-configurator-divider"]}),(0,e.jsx)(n.Typography,{variant:"heading",children:"Pre-built Sections"}),B.map(l=>(0,e.jsxs)("button",{className:i["rst-dashboard-builder-add-widget-item"],onClick:()=>j?.(l),children:[(0,e.jsx)(n.Icon,{src:"layout"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:i["rst-dashboard-builder-add-widget-item-label"],children:l.name}),(0,e.jsx)("div",{className:i["rst-dashboard-builder-add-widget-item-desc"],children:l.description})]})]},l.name))]})]})]})};pe.displayName="WidgetConfigurator";var xe=({dataSources:a,initialConfig:t,templates:d,prebuiltSections:s,onSave:m,onChange:p,widgetActionDefaults:_,readOnly:j,className:S})=>{const{state:b,mode:v,setMode:f,addWidget:y,addPrebuiltWidget:I,removeWidget:u,updateWidget:W,moveWidget:G,selectWidget:B,selectedWidget:l,setName:h,setFilters:D,loadConfig:c}=ze(t,j),[g,E]=(0,r.useState)(!1),[o,w]=(0,r.useState)("dialog"),[F,J]=(0,r.useState)(null),[Q,U]=(0,r.useState)(null),[ae,C]=(0,r.useState)(!1),[k,M]=(0,r.useState)(null),R=(0,r.useMemo)(()=>De(b.config.widgets,a),[b.config.widgets,a]),z=v==="view",L=z?Q:b.config.filters;(0,r.useEffect)(()=>{g&&M(L)},[g]);const te=(0,r.useCallback)(()=>{z?U(k):D(k),E(!1)},[k,z,D]);(0,r.useEffect)(()=>{z&&!ae&&(U(b.config.filters),C(!0)),z||C(!1)},[z,ae,b.config.filters]);const q=(0,r.useRef)(p);q.current=p;const H=(0,r.useCallback)((x,$)=>{(z?U:D)(ee=>({...ee??{},[x]:$}))},[z,D]),T=(0,r.useMemo)(()=>({filters:L,onFilterChange:H}),[L,H]),P=(0,r.useMemo)(()=>!d||d.length===0?[]:d.filter(x=>x.version===1),[d]),Y=(0,r.useMemo)(()=>P.map(x=>({value:x.name,id:x.name,description:x.description})),[P]),K=(0,r.useCallback)(x=>{const $=P.find(X=>X.name===x);if(!$)return;const ee={version:1,...$.config};c(ee)},[P,c]),O=(0,r.useMemo)(()=>({enableExport:_?.enableExport??!0,enableScreenshot:_?.enableScreenshot??!1,enableExpand:_?.enableExpand??!0,enableFilter:_?.enableFilter??!0}),[_]),se=(0,r.useCallback)(x=>({enableExport:x.enableExport??O.enableExport,enableScreenshot:x.enableScreenshot??O.enableScreenshot,enableExpand:x.enableExpand??O.enableExpand,enableFilter:x.enableFilter??O.enableFilter}),[O]);(0,r.useEffect)(()=>{q.current?.(b.config)},[b.config]);const N=[i["rst-dashboard-builder"],S].filter(Boolean).join(" "),A=(0,r.useCallback)(()=>{m(b.config)},[b.config,m]);return(0,e.jsx)("div",{className:N,children:(0,e.jsxs)("div",{className:i["rst-dashboard-builder-main"],children:[(0,e.jsxs)("div",{className:i["rst-dashboard-builder-toolbar"],children:[(0,e.jsxs)("div",{className:i["rst-dashboard-builder-toolbar-left"],children:[z?(0,e.jsx)("span",{className:i["rst-dashboard-builder-name-display"],children:b.config.name}):(0,e.jsx)("input",{className:i["rst-dashboard-builder-name-input"],type:"text",value:b.config.name,onChange:x=>h(x.target.value),placeholder:"Dashboard name","aria-label":"Dashboard name"}),Object.keys(R).length>0&&(0,e.jsx)(n.Button,{variant:"invisible",size:"small",leadingVisual:"filter",onClick:()=>E(x=>!x),"aria-label":"Toggle filter panel","aria-pressed":g})]}),(0,e.jsxs)("div",{className:i["rst-dashboard-builder-toolbar-right"],children:[P.length>0&&!z&&(0,e.jsx)(n.ButtonDropdown,{options:Y,onChange:K,placeholder:"Load Template",size:"small"}),!j&&(0,e.jsx)(n.ButtonGroup,{value:v,options:[{value:"edit"},{value:"view"}],onChange:x=>f(x)}),!z&&(0,e.jsx)(n.Button,{variant:"primary",size:"small",value:"Save",onClick:A})]})]}),(0,e.jsx)(n.DashboardContext,{value:T,children:(0,e.jsxs)("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[(0,e.jsx)(me,{mode:v,widgets:b.config.widgets,selectedWidgetId:b.selectedWidgetId,dataSources:a,onSelectWidget:B,onMoveWidget:G,onRemoveWidget:u,onAddWidget:y,onChange:()=>{},getWidgetActions:se}),g&&Object.keys(R).length>0&&(0,e.jsxs)(n.OverlayPanel,{open:g,variant:o,position:o==="dialog"?"center":"right",onClose:()=>E(!1),closeOnEscape:!0,closeOnClickOutside:o==="dialog",width:o==="sidepanel"?360:void 0,maxWidth:o==="dialog"?640:void 0,maxHeight:o==="dialog"?"80vh":void 0,"aria-label":"Dashboard filters",children:[(0,e.jsx)(n.OverlayPanel.Header,{title:"Filters",onClose:()=>E(!1),actions:(0,e.jsx)(n.Button,{variant:"invisible",size:"small",leadingVisual:o==="dialog"?"square-half":"open-center",onClick:()=>w(x=>x==="dialog"?"sidepanel":"dialog"),"aria-label":o==="dialog"?"Switch to side panel":"Switch to dialog"})}),(0,e.jsx)("div",{className:i["rst-dashboard-builder-filter-body"],children:(()=>{const x=Object.keys(R);if(x.length===0)return(0,e.jsx)("div",{style:{padding:"var(--rst-space-default)"},children:"No data sources to filter."});const $=F&&x.includes(F)?F:x[0],ee=k?.[$]??n.emptyFilterGroup();return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:i["rst-dashboard-builder-filter-tabs"],children:x.map(X=>(0,e.jsx)(n.Button,{value:X,variant:X===$?"base":"invisible",size:"small",onClick:()=>J(X),children:X},X))}),(0,e.jsx)(n.FilterBuilder,{filters:ee,onChange:X=>M(_e=>({..._e??{},[$]:X.filters.length===0?null:X})),fieldOptions:R[$]})]})})()}),(0,e.jsxs)(n.OverlayPanel.Footer,{children:[(0,e.jsx)(n.Button,{variant:"invisible",size:"small",value:"Clear",onClick:()=>M({})}),(0,e.jsx)(n.Button,{variant:"primary",size:"small",value:"Apply",onClick:te})]})]}),!z&&(0,e.jsx)(pe,{widget:l,dataSources:a,onUpdate:x=>{l&&W(l.id,x)},onRemove:()=>{l&&u(l.id)},onClose:()=>B(null),onAddWidget:x=>{const $=Object.values(a)[0],ee=he(6,3,b.config.widgets);y(x,$?.id??"",ee)},prebuiltSections:s,onAddPrebuiltSection:x=>{I(x)}})]})})]})})};xe.displayName="DashboardBuilder";var le={"rst-border-beam":"_rst-border-beam_4g5sg_1","rst-border-beam-effect":"_rst-border-beam-effect_4g5sg_7","rst-border-beam-ring":"_rst-border-beam-ring_4g5sg_15","rst-border-beam-spin":"_rst-border-beam-spin_4g5sg_27","rst-border-beam-travel":"_rst-border-beam-travel_4g5sg_1"};function We(a){return[...a].filter(t=>t.color).map(t=>({...t,percent:Math.min(100,Math.max(0,t.percent))})).sort((t,d)=>t.percent-d.percent)}function Fe(a,t,d,s){const m=360/Math.max(1,s),p=2*(t+d);return p<=0||a<=0?Math.min(90,m):Math.min(a/p*360,m)}function Oe(a,t){const d=Math.max(0,Math.min(t,360)),s=We(a);return`conic-gradient(from 0deg, ${s.length?s.map(m=>`${m.color} ${m.percent/100*d}deg`).join(", "):"var(--rst-borderColor-focus) 0deg"}, transparent ${d}deg, transparent 360deg)`}var Be=[{color:"transparent",percent:0},{color:"var(--rst-borderColor-primary-default)",percent:70},{color:"var(--rst-borderColor-focus)",percent:100}],fe=({children:a,color:t=Be,count:d=1,duration:s=6,lineWidth:m=1,outset:p=0,inset:_=0,size:j=120,className:S,style:b,...v})=>{const f=(0,r.useRef)(null),[y,I]=(0,r.useState)({radius:"",width:0,height:0});(0,r.useEffect)(()=>{const D=f.current?.firstElementChild;if(!D||typeof ResizeObserver>"u")return;const c=new ResizeObserver(()=>{I({radius:getComputedStyle(D).borderTopLeftRadius,width:D.clientWidth,height:D.clientHeight})});return c.observe(D),()=>c.disconnect()},[]);const u=Math.max(1,Math.floor(d)),W=(0,r.useMemo)(()=>Oe(t,Fe(j,y.width,y.height,u)),[t,j,y.width,y.height,u]),G=360/u,B=Math.hypot(y.width+2*p,y.height+2*p),l=[le["rst-border-beam"],S].filter(Boolean).join(" "),h={"--rst-border-beam-gradient":W,"--rst-border-beam-duration":`${s}s`,"--rst-border-beam-line-width":`${m}px`,"--rst-border-beam-outset":`${p}px`,"--rst-border-beam-inset":`${_}px`,...B>0?{"--rst-border-beam-diagonal":`${B}px`}:{},...y.radius?{"--rst-border-beam-radius":y.radius}:{},...b};return(0,e.jsxs)("div",{ref:f,className:l,style:h,...v,children:[a,(0,e.jsx)("span",{className:le["rst-border-beam-effect"],"aria-hidden":"true",children:(0,e.jsx)("span",{className:le["rst-border-beam-ring"],children:Array.from({length:u},(D,c)=>(0,e.jsx)("span",{className:le["rst-border-beam-spin"],style:{"--rst-border-beam-offset":`${c*G}deg`}},c))})})]})};fe.displayName="BorderBeam";function Te(a){return a.filter(t=>t.type==="text").map(t=>t.text).join(" ").trim()}function Ae(a){return a.data??[]}function ge(a,t){return a.events?.includes(t)??!1}function $e({block:a,onBlockEvent:t}){const d=Ae(a),s=a.props??{};if(a.component==="form")return(0,e.jsx)(Ge,{block:a,onBlockEvent:t});if(a.component==="chart"){const m=s.height??16;return(0,e.jsx)(n.Chart,{data:d,columns:a.columns,type:s.type??"bar",xAxisColumn:s.xAxisColumn,yAxisColumns:s.yAxisColumns,series:s.series,title:s.title,subtitle:s.subtitle,showLegend:s.showLegend,showGrid:s.showGrid,height:m})}return a.component==="kpi"?(0,e.jsx)(n.KPI,{data:d[0]??{},columns:a.columns,layout:n.resolveKpiLayoutPreset(s.layout)}):a.component==="card-list"?(0,e.jsx)(n.CardList,{data:d,columns:a.columns,layout:n.resolveCardLayoutPreset(s.layout),onCardClick:ge(a,"action")?m=>t?.({blockId:a.id,component:"card-list",event:"action",handler:a.handler,values:m}):void 0}):(0,e.jsx)(n.TableGrid,{data:d,columns:a.columns,enableSorting:s.enableSorting!==!1,enableSelection:s.enableSelection===!0,showGrid:s.showGrid??"horizontal",columnSizing:"fixed",enableVirtualization:s.enableVirtualization!==!1})}function Ge({block:a,onBlockEvent:t}){const[d,s]=(0,r.useState)(!1);return ge(a,"submit")?(0,e.jsx)(n.Form,{data:a.data??[{}],columns:a.columns,labelAlign:"top",onSubmit:async m=>{s(!0);try{await t?.({blockId:a.id,component:"form",event:"submit",handler:a.handler,values:m})}finally{s(!1)}},actions:[{type:"submit",variant:"primary",value:"Submit",loading:d,disabled:d},{type:"reset",variant:"invisible",value:"Reset",disabled:d}]}):(0,e.jsx)(n.Form,{data:a.data??[{}],columns:a.columns})}var V={"rst-chat":"_rst-chat_12syz_1","rst-chat-empty":"_rst-chat-empty_12syz_9","rst-chat-messages":"_rst-chat-messages_12syz_19","rst-chat-message":"_rst-chat-message_12syz_19","rst-chat-message-user":"_rst-chat-message-user_12syz_33","rst-chat-message-assistant":"_rst-chat-message-assistant_12syz_37","rst-chat-bubble":"_rst-chat-bubble_12syz_41","rst-chat-bubble-user":"_rst-chat-bubble-user_12syz_51","rst-chat-bubble-assistant":"_rst-chat-bubble-assistant_12syz_56","rst-chat-text":"_rst-chat-text_12syz_63","rst-chat-block":"_rst-chat-block_12syz_68","rst-chat-block-title":"_rst-chat-block-title_12syz_76","rst-chat-processing":"_rst-chat-processing_12syz_80","rst-chat-composer":"_rst-chat-composer_12syz_84"};function Le({messages:a,isProcessing:t=!1,inputValue:d,onInputChange:s,onSubmit:m,onKeyDown:p,onBlockEvent:_,emptyStateText:j="Ask a question to get started.",inputPlaceholder:S="Ask something...",className:b,renderBlock:v}){const f=(0,r.useRef)(null);(0,r.useEffect)(()=>{const u=f.current;u&&(u.scrollTop=u.scrollHeight)},[a,t]);const y=t||d.trim().length===0,I=(u,W)=>u.type==="text"?(0,e.jsx)(n.Typography,{variant:"body",className:V["rst-chat-text"],children:u.text},W):(0,e.jsxs)("div",{className:V["rst-chat-block"],children:[u.block.meta?.title&&(0,e.jsx)(n.Typography,{variant:"label",className:V["rst-chat-block-title"],children:u.block.meta.title}),v?v(u.block):(0,e.jsx)($e,{block:u.block,onBlockEvent:_})]},u.block.id);return(0,e.jsxs)("div",{className:[V["rst-chat"],b].filter(Boolean).join(" "),children:[a.length===0?(0,e.jsx)("div",{className:V["rst-chat-empty"],children:(0,e.jsx)(n.Typography,{variant:"body",children:j})}):(0,e.jsxs)("div",{ref:f,className:V["rst-chat-messages"],role:"log","aria-live":"polite",children:[a.map(u=>(0,e.jsx)("article",{className:[V["rst-chat-message"],V[`rst-chat-message-${u.role}`]].join(" "),"aria-label":`${u.role==="user"?"You":"Assistant"}: ${Te(u.parts)}`,children:(0,e.jsx)("div",{className:[V["rst-chat-bubble"],V[`rst-chat-bubble-${u.role}`]].join(" "),children:u.parts.map(I)})},u.id)),t&&(0,e.jsx)("div",{className:V["rst-chat-processing"],children:(0,e.jsx)(n.Typography,{variant:"caption",children:"Working..."})})]}),(0,e.jsxs)("form",{className:V["rst-chat-composer"],onSubmit:u=>{u.preventDefault(),y||m()},children:[(0,e.jsx)(n.Textarea,{value:d,onChange:s,onKeyDown:p,placeholder:S,ariaLabel:"Message",rows:1,disabled:t}),(0,e.jsx)(n.Button,{type:"submit",variant:"primary",value:"Send",leadingVisual:"send",disabled:y})]})]})}exports.BorderBeam=fe;exports.ChatSurface=Le;exports.DASHBOARD_CONFIG_VERSION=Me;exports.DashboardBuilder=xe;exports.PipContainer=Ce;exports.usePip=Se;