@object-ui/console 3.3.1 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/assets/AppManagementPage-CLr3paaF.js +1 -0
  2. package/dist/assets/ConsoleFloatingChatbot-C_ClJ2NU.js +1 -0
  3. package/dist/assets/DashboardView-CODdYLuL.js +1 -0
  4. package/dist/assets/MetadataDetailPage-C1sWJhl2.js +1 -0
  5. package/dist/assets/MetadataFormDialog-Cje6P_Wf.js +1 -0
  6. package/dist/assets/MetadataManagerPage-DobP393N.js +1 -0
  7. package/dist/assets/PageView-DZHuurne.js +2 -0
  8. package/dist/assets/ProfilePage-6u6k00rh.js +1 -0
  9. package/dist/assets/RecordDetailView-cFSCvmx3.js +1 -0
  10. package/dist/assets/ReportView-oYVEbfYq.js +2 -0
  11. package/dist/assets/SearchResultsPage-BjAVc5rm.js +1 -0
  12. package/dist/assets/SystemHubPage-D08IDX3M.js +1 -0
  13. package/dist/assets/data-adapter-CleWpyQH.js +1 -0
  14. package/dist/assets/framework-CoXA0nY6.js +2 -0
  15. package/dist/assets/getIcon-vBP44wSb.js +1 -0
  16. package/dist/assets/index-98Lfd5ty.js +2 -0
  17. package/dist/assets/index-C162ArSl.css +2 -0
  18. package/dist/assets/{infrastructure-94fpO8jL.js → infrastructure-Djv3I7gr.js} +2 -2
  19. package/dist/assets/plugin-calendar-DX_UWouT.js +1 -0
  20. package/dist/assets/plugin-charts-BvZ1cSiZ.js +7 -0
  21. package/dist/assets/plugin-chatbot-DeSEtutf.js +24 -0
  22. package/dist/assets/plugin-form-BhbVu8jO.js +1 -0
  23. package/dist/assets/plugin-gantt-BG1WaV_b.js +1 -0
  24. package/dist/assets/plugin-grid-DwpWK0E8.js +8 -0
  25. package/dist/assets/plugin-kanban-Dzjqra5U.js +1 -0
  26. package/dist/assets/plugin-map-B7EfyDsf.js +1 -0
  27. package/dist/assets/plugin-map-CsMXqW6n.css +1 -0
  28. package/dist/assets/plugin-markdown-CiHluuxA.js +7 -0
  29. package/dist/assets/plugin-timeline-D8_YFDQQ.js +1 -0
  30. package/dist/assets/plugin-view-CXAFUa14.js +1 -0
  31. package/dist/assets/plugins-views-C5gstDGy.js +63 -0
  32. package/dist/assets/src-iMF4J4F7.js +1 -0
  33. package/dist/assets/ui-components-BCmPcwhR.js +36 -0
  34. package/dist/assets/ui-layout-BLl7ARoe.js +1 -0
  35. package/dist/assets/vendor-charts-DHZsyaJw.js +36 -0
  36. package/dist/assets/vendor-dndkit-BGB4qgc3.js +5 -0
  37. package/dist/assets/vendor-i18n-D3W5EAHR.js +1 -0
  38. package/dist/assets/vendor-icons-core-s9WPLoP3.js +1 -0
  39. package/dist/assets/vendor-markdown-D-LpQJes.js +29 -0
  40. package/dist/assets/vendor-objectstack-CBpPY_xk.js +39 -0
  41. package/dist/assets/vendor-radix-Bj7uHNWN.js +56 -0
  42. package/dist/assets/vendor-react-B1k2FF9f.js +11 -0
  43. package/dist/assets/vendor-ui-utils-AywTz3cM.js +1 -0
  44. package/dist/index.html +7 -26
  45. package/package.json +33 -33
  46. package/dist/assets/AdapterProvider-Cd4HYb7q.js +0 -1
  47. package/dist/assets/AdvancedChartImpl-AY6sVw1n.js +0 -7
  48. package/dist/assets/AppManagementPage-6l5ZKnv5.js +0 -1
  49. package/dist/assets/ChartImpl-DiKY5voi.js +0 -1
  50. package/dist/assets/DashboardView-BnX2k5Kx.js +0 -1
  51. package/dist/assets/KanbanEnhanced-BKCx2XIr.js +0 -1
  52. package/dist/assets/KanbanImpl-e9jzV-UD.js +0 -1
  53. package/dist/assets/MarkdownImpl-B-r7jSIS.js +0 -1
  54. package/dist/assets/MetadataDetailPage--3o8VI1T.js +0 -1
  55. package/dist/assets/MetadataFormDialog-Cy7k0Y55.js +0 -1
  56. package/dist/assets/MetadataInspector-DVtCDQtx.js +0 -1
  57. package/dist/assets/MetadataManagerPage-CYfvXG6X.js +0 -1
  58. package/dist/assets/MetadataProvider-Dvc9BxbC.js +0 -1
  59. package/dist/assets/PageView-CUDEz8Xo.js +0 -2
  60. package/dist/assets/ProfilePage-B0BXoAus.js +0 -1
  61. package/dist/assets/RecordDetailView-CYgcTNQp.js +0 -1
  62. package/dist/assets/ReportView-ovWyjJsZ.js +0 -1
  63. package/dist/assets/SearchResultsPage-B-NchFoJ.js +0 -1
  64. package/dist/assets/SystemHubPage-D8S1hN1a.js +0 -1
  65. package/dist/assets/data-adapter-v22lWuhc.js +0 -39
  66. package/dist/assets/framework-BW6KsEI0.js +0 -2
  67. package/dist/assets/getIcon-N5xWCMJy.js +0 -1
  68. package/dist/assets/index-DATdOX6r.js +0 -59
  69. package/dist/assets/index-nwlbpqhl.css +0 -2
  70. package/dist/assets/plugins-core-Ccvbi6db.js +0 -105
  71. package/dist/assets/plugins-views-CbLIJkBs.js +0 -62
  72. package/dist/assets/skeletons-CIQE_YYE.js +0 -1
  73. package/dist/assets/src-BGoL_8qF.js +0 -1
  74. package/dist/assets/ui-layout-CYz0tyDf.js +0 -3
  75. package/dist/assets/vendor-charts-D1AP0-EV.js +0 -33
  76. package/dist/assets/vendor-icons-CrSf7tAH.js +0 -1
  77. package/dist/assets/vendor-objectstack-Dhrq31KF.js +0 -1
  78. package/dist/assets/vendor-react-ryfytPb-.js +0 -9
  79. /package/dist/assets/{maplibre-gl-BR3qC6SX.js → maplibre-gl-ChgVR8ni.js} +0 -0
  80. /package/dist/assets/{plugins-core-B5ROGaJH.css → ui-components-B5ROGaJH.css} +0 -0
@@ -0,0 +1 @@
1
+ import{r as e,t}from"./rolldown-runtime-S-ySWqyJ.js";import{_ as n,g as r}from"./vendor-react-B1k2FF9f.js";var i=e(n(),1),a=e(r(),1);function o(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var s=e=>{switch(e){case`success`:return u;case`info`:return f;case`warning`:return d;case`error`:return p;default:return null}},c=Array(12).fill(0),l=({visible:e,className:t})=>i.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},i.createElement(`div`,{className:`sonner-spinner`},c.map((e,t)=>i.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),u=i.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},i.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),d=i.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},i.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),f=i.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},i.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),p=i.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},i.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),m=i.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},i.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),i.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),h=()=>{let[e,t]=i.useState(document.hidden);return i.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},g=1,_=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:g++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),a=n!==void 0,o,s=r.then(async e=>{if(o=[`resolve`,e],i.isValidElement(e))a=!1,this.create({id:n,type:`default`,message:e});else if(v(e)&&!e.ok){a=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,o=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,s=typeof r==`object`&&!i.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:o,...s})}else if(e instanceof Error){a=!1;let r=typeof t.error==`function`?await t.error(e):t.error,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof r==`object`&&!i.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:o,...s})}else if(t.success!==void 0){a=!1;let r=typeof t.success==`function`?await t.success(e):t.success,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof r==`object`&&!i.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:o,...s})}}).catch(async e=>{if(o=[`reject`,e],t.error!==void 0){a=!1;let r=typeof t.error==`function`?await t.error(e):t.error,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof r==`object`&&!i.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:o,...s})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),c=()=>new Promise((e,t)=>s.then(()=>o[0]===`reject`?t(o[1]):e(o[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(e,t)=>{let n=t?.id||g++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ee=(e,t)=>{let n=t?.id||g++;return _.addToast({title:e,...t,id:n}),n},v=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,y=Object.assign(ee,{success:_.success,info:_.info,warning:_.warning,error:_.error,custom:_.custom,message:_.message,promise:_.promise,dismiss:_.dismiss,loading:_.loading},{getHistory:()=>_.toasts,getToasts:()=>_.getActiveToasts()});o(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function b(e){return e.label!==void 0}var te=3,ne=`24px`,x=`16px`,S=4e3,re=356,ie=14,C=45,w=200;function T(...e){return e.filter(Boolean).join(` `)}function E(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var D=e=>{let{invert:t,toast:n,unstyled:r,interacting:a,setHeights:o,visibleToasts:c,heights:u,index:d,toasts:f,expanded:p,removeToast:g,defaultRichColors:_,closeButton:ee,style:v,cancelButtonStyle:y,actionButtonStyle:te,className:ne=``,descriptionClassName:x=``,duration:re,position:ie,gap:D,expandByDefault:O,classNames:k,icons:A,closeButtonAriaLabel:j=`Close toast`}=e,[M,N]=i.useState(null),[ae,P]=i.useState(null),[F,I]=i.useState(!1),[L,R]=i.useState(!1),[z,oe]=i.useState(!1),[se,ce]=i.useState(!1),[le,B]=i.useState(!1),[ue,de]=i.useState(0),[fe,pe]=i.useState(0),me=i.useRef(n.duration||re||S),he=i.useRef(null),V=i.useRef(null),ge=d===0,_e=d+1<=c,H=n.type,U=n.dismissible!==!1,ve=n.className||``,ye=n.descriptionClassName||``,be=i.useMemo(()=>u.findIndex(e=>e.toastId===n.id)||0,[u,n.id]),xe=i.useMemo(()=>n.closeButton??ee,[n.closeButton,ee]),Se=i.useMemo(()=>n.duration||re||S,[n.duration,re]),Ce=i.useRef(0),W=i.useRef(0),we=i.useRef(0),G=i.useRef(null),[Te,Ee]=ie.split(`-`),De=i.useMemo(()=>u.reduce((e,t,n)=>n>=be?e:e+t.height,0),[u,be]),Oe=h(),ke=n.invert||t,Ae=H===`loading`;W.current=i.useMemo(()=>be*D+De,[be,De]),i.useEffect(()=>{me.current=Se},[Se]),i.useEffect(()=>{I(!0)},[]),i.useEffect(()=>{let e=V.current;if(e){let t=e.getBoundingClientRect().height;return pe(t),o(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>o(e=>e.filter(e=>e.toastId!==n.id))}},[o,n.id]),i.useLayoutEffect(()=>{if(!F)return;let e=V.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,pe(r),o(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[F,n.title,n.description,o,n.id,n.jsx,n.action,n.cancel]);let K=i.useCallback(()=>{R(!0),de(W.current),o(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{g(n)},w)},[n,g,o,W]);i.useEffect(()=>{if(n.promise&&H===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return p||a||Oe?(()=>{if(we.current<Ce.current){let e=new Date().getTime()-Ce.current;me.current-=e}we.current=new Date().getTime()})():me.current!==1/0&&(Ce.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),K()},me.current)),()=>clearTimeout(e)},[p,a,n,H,Oe,K]),i.useEffect(()=>{n.delete&&(K(),n.onDismiss==null||n.onDismiss.call(n,n))},[K,n.delete]);function je(){return A?.loading?i.createElement(`div`,{className:T(k?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":H===`loading`},A.loading):i.createElement(l,{className:T(k?.loader,n?.classNames?.loader),visible:H===`loading`})}let q=n.icon||A?.[H]||s(H);return i.createElement(`li`,{tabIndex:0,ref:V,className:T(ne,ve,k?.toast,n?.classNames?.toast,k?.default,k?.[H],n?.classNames?.[H]),"data-sonner-toast":``,"data-rich-colors":n.richColors??_,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":F,"data-promise":!!n.promise,"data-swiped":le,"data-removed":L,"data-visible":_e,"data-y-position":Te,"data-x-position":Ee,"data-index":d,"data-front":ge,"data-swiping":z,"data-dismissible":U,"data-type":H,"data-invert":ke,"data-swipe-out":se,"data-swipe-direction":ae,"data-expanded":!!(p||O&&F),"data-testid":n.testId,style:{"--index":d,"--toasts-before":d,"--z-index":f.length-d,"--offset":`${L?ue:W.current}px`,"--initial-height":O?`auto`:`${fe}px`,...v,...n.style},onDragEnd:()=>{oe(!1),N(null),G.current=null},onPointerDown:e=>{e.button!==2&&(Ae||!U||(he.current=new Date,de(W.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(oe(!0),G.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(se||!U)return;G.current=null;let e=Number(V.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(V.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-he.current?.getTime(),i=M===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=C||a>.11){de(W.current),n.onDismiss==null||n.onDismiss.call(n,n),P(M===`x`?e>0?`right`:`left`:t>0?`down`:`up`),K(),ce(!0);return}else{var o,s;(o=V.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=V.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}B(!1),oe(!1),N(null)},onPointerMove:t=>{var n,r;if(!G.current||!U||window.getSelection()?.toString().length>0)return;let i=t.clientY-G.current.y,a=t.clientX-G.current.x,o=e.swipeDirections??E(ie);!M&&(Math.abs(a)>1||Math.abs(i)>1)&&N(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(M===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(M===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&B(!0),(n=V.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=V.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},xe&&!n.jsx&&H!==`loading`?i.createElement(`button`,{"aria-label":j,"data-disabled":Ae,"data-close-button":!0,onClick:Ae||!U?()=>{}:()=>{K(),n.onDismiss==null||n.onDismiss.call(n,n)},className:T(k?.closeButton,n?.classNames?.closeButton)},A?.close??m):null,(H||n.icon||n.promise)&&n.icon!==null&&(A?.[H]!==null||n.icon)?i.createElement(`div`,{"data-icon":``,className:T(k?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||je():null,n.type===`loading`?null:q):null,i.createElement(`div`,{"data-content":``,className:T(k?.content,n?.classNames?.content)},i.createElement(`div`,{"data-title":``,className:T(k?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?i.createElement(`div`,{"data-description":``,className:T(x,ye,k?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),i.isValidElement(n.cancel)?n.cancel:n.cancel&&b(n.cancel)?i.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||y,onClick:e=>{b(n.cancel)&&U&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),K())},className:T(k?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,i.isValidElement(n.action)?n.action:n.action&&b(n.action)?i.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||te,onClick:e=>{b(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&K())},className:T(k?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function O(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function k(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?x:ne;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var A=i.forwardRef(function(e,t){let{id:n,invert:r,position:o=`bottom-right`,hotkey:s=[`altKey`,`KeyT`],expand:c,closeButton:l,className:u,offset:d,mobileOffset:f,theme:p=`light`,richColors:m,duration:h,style:g,visibleToasts:ee=te,toastOptions:v,dir:y=O(),gap:b=ie,icons:ne,containerAriaLabel:x=`Notifications`}=e,[S,C]=i.useState([]),w=i.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),T=i.useMemo(()=>Array.from(new Set([o].concat(w.filter(e=>e.position).map(e=>e.position)))),[w,o]),[E,A]=i.useState([]),[j,M]=i.useState(!1),[N,ae]=i.useState(!1),[P,F]=i.useState(p===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:p),I=i.useRef(null),L=s.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),R=i.useRef(null),z=i.useRef(!1),oe=i.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||_.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return i.useEffect(()=>_.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{a.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[S]),i.useEffect(()=>{if(p!==`system`){F(p);return}if(p===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?F(`dark`):F(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{F(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{F(e?`dark`:`light`)}catch(e){console.error(e)}})}},[p]),i.useEffect(()=>{S.length<=1&&M(!1)},[S]),i.useEffect(()=>{let e=e=>{if(s.every(t=>e[t]||e.code===t)){var t;M(!0),(t=I.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===I.current||I.current?.contains(document.activeElement))&&M(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[s]),i.useEffect(()=>{if(I.current)return()=>{R.current&&(R.current.focus({preventScroll:!0}),R.current=null,z.current=!1)}},[I.current]),i.createElement(`section`,{ref:t,"aria-label":`${x} ${L}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},T.map((t,n)=>{let[a,o]=t.split(`-`);return w.length?i.createElement(`ol`,{key:t,dir:y===`auto`?O():y,tabIndex:-1,ref:I,className:u,"data-sonner-toaster":!0,"data-sonner-theme":P,"data-y-position":a,"data-x-position":o,style:{"--front-toast-height":`${E[0]?.height||0}px`,"--width":`${re}px`,"--gap":`${b}px`,...g,...k(d,f)},onBlur:e=>{z.current&&!e.currentTarget.contains(e.relatedTarget)&&(z.current=!1,R.current&&=(R.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||z.current||(z.current=!0,R.current=e.relatedTarget)},onMouseEnter:()=>M(!0),onMouseMove:()=>M(!0),onMouseLeave:()=>{N||M(!1)},onDragEnd:()=>M(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||ae(!0)},onPointerUp:()=>ae(!1)},w.filter(e=>!e.position&&n===0||e.position===t).map((n,a)=>i.createElement(D,{key:n.id,icons:ne,index:a,toast:n,defaultRichColors:m,duration:v?.duration??h,className:v?.className,descriptionClassName:v?.descriptionClassName,invert:r,visibleToasts:ee,closeButton:v?.closeButton??l,interacting:N,position:t,style:v?.style,unstyled:v?.unstyled,classNames:v?.classNames,cancelButtonStyle:v?.cancelButtonStyle,actionButtonStyle:v?.actionButtonStyle,closeButtonAriaLabel:v?.closeButtonAriaLabel,removeToast:oe,toasts:w.filter(e=>e.position==n.position),heights:E.filter(e=>e.position==n.position),setHeights:A,expandByDefault:c,gap:b,expanded:j,swipeDirections:e.swipeDirections}))):null}))});function j(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=j(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function M(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=j(e))&&(r&&(r+=` `),r+=t);return r}var N=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},ae=(e,t)=>({classGroupId:e,validator:t}),P=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),F=`-`,I=[],L=`arbitrary..`,R=e=>{let t=se(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return oe(e);let n=e.split(F);return z(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?N(i,t):t:i||I}return n[e]||I}}},z=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=z(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(F):e.slice(t).join(F),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},oe=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?L+r:void 0})(),se=e=>{let{theme:t,classGroups:n}=e;return ce(n,t)},ce=(e,t)=>{let n=P();for(let r in e){let i=e[r];le(i,n,r,t)}return n},le=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];B(i,t,n,r)}},B=(e,t,n,r)=>{if(typeof e==`string`){ue(e,t,n);return}if(typeof e==`function`){de(e,t,n,r);return}fe(e,t,n,r)},ue=(e,t,n)=>{let r=e===``?t:pe(t,e);r.classGroupId=n},de=(e,t,n,r)=>{if(me(e)){le(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(ae(n,e))},fe=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];le(o,pe(t,a),n,r)}},pe=(e,t)=>{let n=e,r=t.split(F),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=P(),n.nextPart.set(t,i)),n=i}return n},me=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,he=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},V=`!`,ge=`:`,_e=[],H=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),U=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===ge){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(V)?(c=s.slice(0,-1),l=!0):s.startsWith(V)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return H(t,l,c,u)};if(t){let e=t+ge,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):H(_e,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},ve=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},ye=e=>({cache:he(e.cacheSize),parseClassName:U(e),sortModifiers:ve(e),...R(e)}),be=/\s+/,xe=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(be),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+V:g,ee=_+h;if(o.indexOf(ee)>-1)continue;o.push(ee);let v=i(h,m);for(let e=0;e<v.length;++e){let t=v[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},Se=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Ce(n))&&(i&&(i+=` `),i+=r);return i},Ce=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Ce(e[r]))&&(n&&(n+=` `),n+=t);return n},W=(e,...t)=>{let n,r,i,a,o=o=>(n=ye(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=xe(e,n);return i(e,a),a};return a=o,(...e)=>a(Se(...e))},we=[],G=e=>{let t=t=>t[e]||we;return t.isThemeGetter=!0,t},Te=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ee=/^\((?:(\w[\w-]*):)?(.+)\)$/i,De=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Oe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ke=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ae=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,K=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,je=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,q=e=>De.test(e),J=e=>!!e&&!Number.isNaN(Number(e)),Y=e=>!!e&&Number.isInteger(Number(e)),Me=e=>e.endsWith(`%`)&&J(e.slice(0,-1)),X=e=>Oe.test(e),Ne=()=>!0,Pe=e=>ke.test(e)&&!Ae.test(e),Fe=()=>!1,Ie=e=>K.test(e),Le=e=>je.test(e),Re=e=>!Z(e)&&!Q(e),ze=e=>$(e,rt,Fe),Z=e=>Te.test(e),Be=e=>$(e,it,Pe),Ve=e=>$(e,at,J),He=e=>$(e,st,Ne),Ue=e=>$(e,ot,Fe),We=e=>$(e,tt,Fe),Ge=e=>$(e,nt,Le),Ke=e=>$(e,ct,Ie),Q=e=>Ee.test(e),qe=e=>et(e,it),Je=e=>et(e,ot),Ye=e=>et(e,tt),Xe=e=>et(e,rt),Ze=e=>et(e,nt),Qe=e=>et(e,ct,!0),$e=e=>et(e,st,!0),$=(e,t,n)=>{let r=Te.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},et=(e,t,n=!1)=>{let r=Ee.exec(e);return r?r[1]?t(r[1]):n:!1},tt=e=>e===`position`||e===`percentage`,nt=e=>e===`image`||e===`url`,rt=e=>e===`length`||e===`size`||e===`bg-size`,it=e=>e===`length`,at=e=>e===`number`,ot=e=>e===`family-name`,st=e=>e===`number`||e===`weight`,ct=e=>e===`shadow`,lt=W(()=>{let e=G(`color`),t=G(`font`),n=G(`text`),r=G(`font-weight`),i=G(`tracking`),a=G(`leading`),o=G(`breakpoint`),s=G(`container`),c=G(`spacing`),l=G(`radius`),u=G(`shadow`),d=G(`inset-shadow`),f=G(`text-shadow`),p=G(`drop-shadow`),m=G(`blur`),h=G(`perspective`),g=G(`aspect`),_=G(`ease`),ee=G(`animate`),v=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],y=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],b=()=>[...y(),Q,Z],te=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],ne=()=>[`auto`,`contain`,`none`],x=()=>[Q,Z,c],S=()=>[q,`full`,`auto`,...x()],re=()=>[Y,`none`,`subgrid`,Q,Z],ie=()=>[`auto`,{span:[`full`,Y,Q,Z]},Y,Q,Z],C=()=>[Y,`auto`,Q,Z],w=()=>[`auto`,`min`,`max`,`fr`,Q,Z],T=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],E=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],D=()=>[`auto`,...x()],O=()=>[q,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...x()],k=()=>[q,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...x()],A=()=>[q,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...x()],j=()=>[e,Q,Z],M=()=>[...y(),Ye,We,{position:[Q,Z]}],N=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ae=()=>[`auto`,`cover`,`contain`,Xe,ze,{size:[Q,Z]}],P=()=>[Me,qe,Be],F=()=>[``,`none`,`full`,l,Q,Z],I=()=>[``,J,qe,Be],L=()=>[`solid`,`dashed`,`dotted`,`double`],R=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],z=()=>[J,Me,Ye,We],oe=()=>[``,`none`,m,Q,Z],se=()=>[`none`,J,Q,Z],ce=()=>[`none`,J,Q,Z],le=()=>[J,Q,Z],B=()=>[q,`full`,...x()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[X],breakpoint:[X],color:[Ne],container:[X],"drop-shadow":[X],ease:[`in`,`out`,`in-out`],font:[Re],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[X],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[X],shadow:[X],spacing:[`px`,J],text:[X],"text-shadow":[X],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,q,Z,Q,g]}],container:[`container`],columns:[{columns:[J,Z,Q,s]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:b()}],overflow:[{overflow:te()}],"overflow-x":[{"overflow-x":te()}],"overflow-y":[{"overflow-y":te()}],overscroll:[{overscroll:ne()}],"overscroll-x":[{"overscroll-x":ne()}],"overscroll-y":[{"overscroll-y":ne()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:S()}],"inset-x":[{"inset-x":S()}],"inset-y":[{"inset-y":S()}],start:[{"inset-s":S(),start:S()}],end:[{"inset-e":S(),end:S()}],"inset-bs":[{"inset-bs":S()}],"inset-be":[{"inset-be":S()}],top:[{top:S()}],right:[{right:S()}],bottom:[{bottom:S()}],left:[{left:S()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Y,`auto`,Q,Z]}],basis:[{basis:[q,`full`,`auto`,s,...x()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[J,q,`auto`,`initial`,`none`,Z]}],grow:[{grow:[``,J,Q,Z]}],shrink:[{shrink:[``,J,Q,Z]}],order:[{order:[Y,`first`,`last`,`none`,Q,Z]}],"grid-cols":[{"grid-cols":re()}],"col-start-end":[{col:ie()}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":re()}],"row-start-end":[{row:ie()}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":w()}],"auto-rows":[{"auto-rows":w()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"justify-content":[{justify:[...T(),`normal`]}],"justify-items":[{"justify-items":[...E(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...E()]}],"align-content":[{content:[`normal`,...T()]}],"align-items":[{items:[...E(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...E(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":T()}],"place-items":[{"place-items":[...E(),`baseline`]}],"place-self":[{"place-self":[`auto`,...E()]}],p:[{p:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pbs:[{pbs:x()}],pbe:[{pbe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mbs:[{mbs:D()}],mbe:[{mbe:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":x()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":x()}],"space-y-reverse":[`space-y-reverse`],size:[{size:O()}],"inline-size":[{inline:[`auto`,...k()]}],"min-inline-size":[{"min-inline":[`auto`,...k()]}],"max-inline-size":[{"max-inline":[`none`,...k()]}],"block-size":[{block:[`auto`,...A()]}],"min-block-size":[{"min-block":[`auto`,...A()]}],"max-block-size":[{"max-block":[`none`,...A()]}],w:[{w:[s,`screen`,...O()]}],"min-w":[{"min-w":[s,`screen`,`none`,...O()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...O()]}],h:[{h:[`screen`,`lh`,...O()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...O()]}],"max-h":[{"max-h":[`screen`,`lh`,...O()]}],"font-size":[{text:[`base`,n,qe,Be]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,$e,He]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Me,Z]}],"font-family":[{font:[Je,Ue,t]}],"font-features":[{"font-features":[Z]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Q,Z]}],"line-clamp":[{"line-clamp":[J,`none`,Q,Ve]}],leading:[{leading:[a,...x()]}],"list-image":[{"list-image":[`none`,Q,Z]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Q,Z]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...L(),`wavy`]}],"text-decoration-thickness":[{decoration:[J,`from-font`,`auto`,Q,Be]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[J,`auto`,Q,Z]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:x()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Q,Z]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Q,Z]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:M()}],"bg-repeat":[{bg:N()}],"bg-size":[{bg:ae()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Y,Q,Z],radial:[``,Q,Z],conic:[Y,Q,Z]},Ze,Ge]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:I()}],"border-w-x":[{"border-x":I()}],"border-w-y":[{"border-y":I()}],"border-w-s":[{"border-s":I()}],"border-w-e":[{"border-e":I()}],"border-w-bs":[{"border-bs":I()}],"border-w-be":[{"border-be":I()}],"border-w-t":[{"border-t":I()}],"border-w-r":[{"border-r":I()}],"border-w-b":[{"border-b":I()}],"border-w-l":[{"border-l":I()}],"divide-x":[{"divide-x":I()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":I()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...L(),`hidden`,`none`]}],"divide-style":[{divide:[...L(),`hidden`,`none`]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-bs":[{"border-bs":j()}],"border-color-be":[{"border-be":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:[...L(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[J,Q,Z]}],"outline-w":[{outline:[``,J,qe,Be]}],"outline-color":[{outline:j()}],shadow:[{shadow:[``,`none`,u,Qe,Ke]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":[`none`,d,Qe,Ke]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:I()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[J,Be]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":j()}],"text-shadow":[{"text-shadow":[`none`,f,Qe,Ke]}],"text-shadow-color":[{"text-shadow":j()}],opacity:[{opacity:[J,Q,Z]}],"mix-blend":[{"mix-blend":[...R(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":R()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[J]}],"mask-image-linear-from-pos":[{"mask-linear-from":z()}],"mask-image-linear-to-pos":[{"mask-linear-to":z()}],"mask-image-linear-from-color":[{"mask-linear-from":j()}],"mask-image-linear-to-color":[{"mask-linear-to":j()}],"mask-image-t-from-pos":[{"mask-t-from":z()}],"mask-image-t-to-pos":[{"mask-t-to":z()}],"mask-image-t-from-color":[{"mask-t-from":j()}],"mask-image-t-to-color":[{"mask-t-to":j()}],"mask-image-r-from-pos":[{"mask-r-from":z()}],"mask-image-r-to-pos":[{"mask-r-to":z()}],"mask-image-r-from-color":[{"mask-r-from":j()}],"mask-image-r-to-color":[{"mask-r-to":j()}],"mask-image-b-from-pos":[{"mask-b-from":z()}],"mask-image-b-to-pos":[{"mask-b-to":z()}],"mask-image-b-from-color":[{"mask-b-from":j()}],"mask-image-b-to-color":[{"mask-b-to":j()}],"mask-image-l-from-pos":[{"mask-l-from":z()}],"mask-image-l-to-pos":[{"mask-l-to":z()}],"mask-image-l-from-color":[{"mask-l-from":j()}],"mask-image-l-to-color":[{"mask-l-to":j()}],"mask-image-x-from-pos":[{"mask-x-from":z()}],"mask-image-x-to-pos":[{"mask-x-to":z()}],"mask-image-x-from-color":[{"mask-x-from":j()}],"mask-image-x-to-color":[{"mask-x-to":j()}],"mask-image-y-from-pos":[{"mask-y-from":z()}],"mask-image-y-to-pos":[{"mask-y-to":z()}],"mask-image-y-from-color":[{"mask-y-from":j()}],"mask-image-y-to-color":[{"mask-y-to":j()}],"mask-image-radial":[{"mask-radial":[Q,Z]}],"mask-image-radial-from-pos":[{"mask-radial-from":z()}],"mask-image-radial-to-pos":[{"mask-radial-to":z()}],"mask-image-radial-from-color":[{"mask-radial-from":j()}],"mask-image-radial-to-color":[{"mask-radial-to":j()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":y()}],"mask-image-conic-pos":[{"mask-conic":[J]}],"mask-image-conic-from-pos":[{"mask-conic-from":z()}],"mask-image-conic-to-pos":[{"mask-conic-to":z()}],"mask-image-conic-from-color":[{"mask-conic-from":j()}],"mask-image-conic-to-color":[{"mask-conic-to":j()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:M()}],"mask-repeat":[{mask:N()}],"mask-size":[{mask:ae()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Q,Z]}],filter:[{filter:[``,`none`,Q,Z]}],blur:[{blur:oe()}],brightness:[{brightness:[J,Q,Z]}],contrast:[{contrast:[J,Q,Z]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Qe,Ke]}],"drop-shadow-color":[{"drop-shadow":j()}],grayscale:[{grayscale:[``,J,Q,Z]}],"hue-rotate":[{"hue-rotate":[J,Q,Z]}],invert:[{invert:[``,J,Q,Z]}],saturate:[{saturate:[J,Q,Z]}],sepia:[{sepia:[``,J,Q,Z]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Q,Z]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[J,Q,Z]}],"backdrop-contrast":[{"backdrop-contrast":[J,Q,Z]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,J,Q,Z]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[J,Q,Z]}],"backdrop-invert":[{"backdrop-invert":[``,J,Q,Z]}],"backdrop-opacity":[{"backdrop-opacity":[J,Q,Z]}],"backdrop-saturate":[{"backdrop-saturate":[J,Q,Z]}],"backdrop-sepia":[{"backdrop-sepia":[``,J,Q,Z]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Q,Z]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[J,`initial`,Q,Z]}],ease:[{ease:[`linear`,`initial`,_,Q,Z]}],delay:[{delay:[J,Q,Z]}],animate:[{animate:[`none`,ee,Q,Z]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Q,Z]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:ce()}],"scale-x":[{"scale-x":ce()}],"scale-y":[{"scale-y":ce()}],"scale-z":[{"scale-z":ce()}],"scale-3d":[`scale-3d`],skew:[{skew:le()}],"skew-x":[{"skew-x":le()}],"skew-y":[{"skew-y":le()}],transform:[{transform:[Q,Z,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:B()}],"translate-x":[{"translate-x":B()}],"translate-y":[{"translate-y":B()}],"translate-z":[{"translate-z":B()}],"translate-none":[`translate-none`],accent:[{accent:j()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:j()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Q,Z]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mbs":[{"scroll-mbs":x()}],"scroll-mbe":[{"scroll-mbe":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pbs":[{"scroll-pbs":x()}],"scroll-pbe":[{"scroll-pbe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Q,Z]}],fill:[{fill:[`none`,...j()]}],"stroke-w":[{stroke:[J,qe,Be,Ve]}],stroke:[{stroke:[`none`,...j()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}}),ut=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,dt=M,ft=(e,t)=>n=>{if(t?.variants==null)return dt(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=ut(t)||ut(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return dt(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},pt=t(((e,t)=>{function n(e){var t,r,i=``;if(typeof e==`string`||typeof e==`number`)i+=e;else if(typeof e==`object`)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=n(e[t]))&&(i&&(i+=` `),i+=r)}else for(r in e)e[r]&&(i&&(i+=` `),i+=r);return i}function r(){for(var e,t,r=0,i=``,a=arguments.length;r<a;r++)(e=arguments[r])&&(t=n(e))&&(i&&(i+=` `),i+=t);return i}t.exports=r,t.exports.clsx=r}));export{A as a,M as i,ft as n,y as o,lt as r,pt as t};
package/dist/index.html CHANGED
@@ -18,33 +18,14 @@
18
18
  <script>
19
19
  window.process = window.process || { env: { NODE_ENV: 'development' }, version: '', platform: 'browser' };
20
20
  </script>
21
- <script type="module" crossorigin src="/console/assets/index-DATdOX6r.js"></script>
22
- <link rel="modulepreload" crossorigin href="/console/assets/rolldown-runtime-S-ySWqyJ.js">
23
- <link rel="modulepreload" crossorigin href="/console/assets/data-adapter-v22lWuhc.js">
24
- <link rel="modulepreload" crossorigin href="/console/assets/framework-BW6KsEI0.js">
25
- <link rel="modulepreload" crossorigin href="/console/assets/infrastructure-94fpO8jL.js">
26
- <link rel="modulepreload" crossorigin href="/console/assets/plugins-core-Ccvbi6db.js">
27
- <link rel="modulepreload" crossorigin href="/console/assets/vendor-objectstack-Dhrq31KF.js">
28
- <link rel="modulepreload" crossorigin href="/console/assets/plugins-views-CbLIJkBs.js">
29
- <link rel="modulepreload" crossorigin href="/console/assets/vendor-icons-CrSf7tAH.js">
30
- <link rel="modulepreload" crossorigin href="/console/assets/vendor-react-ryfytPb-.js">
31
- <link rel="modulepreload" crossorigin href="/console/assets/ui-layout-CYz0tyDf.js">
32
- <link rel="modulepreload" crossorigin href="/console/assets/vendor-zod-Dfb8LXKF.js">
33
- <link rel="modulepreload" crossorigin href="/console/assets/skeletons-CIQE_YYE.js">
34
- <link rel="modulepreload" crossorigin href="/console/assets/MetadataInspector-DVtCDQtx.js">
35
- <link rel="modulepreload" crossorigin href="/console/assets/RecordDetailView-CYgcTNQp.js">
36
- <link rel="modulepreload" crossorigin href="/console/assets/AdapterProvider-Cd4HYb7q.js">
37
- <link rel="modulepreload" crossorigin href="/console/assets/MetadataProvider-Dvc9BxbC.js">
38
- <link rel="modulepreload" crossorigin href="/console/assets/DashboardView-BnX2k5Kx.js">
39
- <link rel="modulepreload" crossorigin href="/console/assets/PageView-CUDEz8Xo.js">
40
- <link rel="modulepreload" crossorigin href="/console/assets/ReportView-ovWyjJsZ.js">
41
- <link rel="modulepreload" crossorigin href="/console/assets/SearchResultsPage-B-NchFoJ.js">
42
- <link rel="modulepreload" crossorigin href="/console/assets/src-BGoL_8qF.js">
43
- <link rel="stylesheet" crossorigin href="/console/assets/plugins-core-B5ROGaJH.css">
21
+ <script type="module" crossorigin src="/console/assets/index-98Lfd5ty.js"></script>
22
+ <link rel="stylesheet" crossorigin href="/console/assets/ui-components-B5ROGaJH.css">
44
23
  <link rel="stylesheet" crossorigin href="/console/assets/plugins-views-DnNKJB60.css">
45
- <link rel="stylesheet" crossorigin href="/console/assets/index-nwlbpqhl.css">
46
- <link rel="modulepreload" href="/console/assets/framework-BW6KsEI0.js" />
47
- <link rel="modulepreload" href="/console/assets/vendor-react-ryfytPb-.js" />
24
+ <link rel="stylesheet" crossorigin href="/console/assets/index-C162ArSl.css">
25
+ <link rel="modulepreload" href="/console/assets/framework-CoXA0nY6.js" />
26
+ <link rel="modulepreload" href="/console/assets/ui-components-BCmPcwhR.js" />
27
+ <link rel="modulepreload" href="/console/assets/vendor-radix-Bj7uHNWN.js" />
28
+ <link rel="modulepreload" href="/console/assets/vendor-react-B1k2FF9f.js" />
48
29
  </head>
49
30
  <body>
50
31
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@object-ui/console",
3
- "version": "3.3.1",
3
+ "version": "3.4.0",
4
4
  "description": "ObjectStack Console - The standard runtime UI for ObjectStack applications",
5
5
  "type": "module",
6
6
  "main": "./plugin.js",
@@ -35,45 +35,45 @@
35
35
  "@vitest/ui": "^4.1.5",
36
36
  "autoprefixer": "^10.5.0",
37
37
  "happy-dom": "^20.9.0",
38
- "lucide-react": "^1.8.0",
39
- "postcss": "^8.5.13",
38
+ "lucide-react": "^1.14.0",
39
+ "postcss": "^8.5.14",
40
40
  "react": "19.2.5",
41
41
  "react-dom": "19.2.5",
42
42
  "react-router-dom": "^7.14.2",
43
43
  "sonner": "^2.0.7",
44
44
  "tailwindcss": "^4.2.4",
45
45
  "typescript": "^6.0.3",
46
- "vite": "^8.0.9",
46
+ "vite": "^8.0.10",
47
47
  "vitest": "^4.1.5",
48
- "@object-ui/app-shell": "3.3.1",
49
- "@object-ui/auth": "3.3.1",
50
- "@object-ui/collaboration": "3.3.1",
51
- "@object-ui/components": "3.3.1",
52
- "@object-ui/core": "3.3.1",
53
- "@object-ui/data-objectstack": "3.3.1",
54
- "@object-ui/fields": "3.3.1",
55
- "@object-ui/i18n": "3.3.1",
56
- "@object-ui/layout": "3.3.1",
57
- "@object-ui/mobile": "3.3.1",
58
- "@object-ui/permissions": "3.3.1",
59
- "@object-ui/plugin-calendar": "3.3.1",
60
- "@object-ui/plugin-charts": "3.3.1",
61
- "@object-ui/plugin-chatbot": "3.3.1",
62
- "@object-ui/plugin-dashboard": "3.3.1",
63
- "@object-ui/plugin-designer": "3.3.1",
64
- "@object-ui/plugin-detail": "3.3.1",
65
- "@object-ui/plugin-form": "3.3.1",
66
- "@object-ui/plugin-gantt": "3.3.1",
67
- "@object-ui/plugin-grid": "3.3.1",
68
- "@object-ui/plugin-kanban": "3.3.1",
69
- "@object-ui/plugin-list": "3.3.1",
70
- "@object-ui/plugin-map": "3.3.1",
71
- "@object-ui/plugin-markdown": "3.3.1",
72
- "@object-ui/plugin-report": "3.3.1",
73
- "@object-ui/plugin-timeline": "3.3.1",
74
- "@object-ui/plugin-view": "3.3.1",
75
- "@object-ui/react": "3.3.1",
76
- "@object-ui/types": "3.3.1"
48
+ "@object-ui/app-shell": "4.0.0",
49
+ "@object-ui/auth": "3.4.0",
50
+ "@object-ui/collaboration": "3.4.0",
51
+ "@object-ui/components": "3.4.0",
52
+ "@object-ui/core": "3.4.0",
53
+ "@object-ui/data-objectstack": "3.4.0",
54
+ "@object-ui/fields": "3.4.0",
55
+ "@object-ui/i18n": "3.4.0",
56
+ "@object-ui/layout": "3.4.0",
57
+ "@object-ui/mobile": "3.4.0",
58
+ "@object-ui/permissions": "3.4.0",
59
+ "@object-ui/plugin-calendar": "3.4.0",
60
+ "@object-ui/plugin-charts": "3.4.0",
61
+ "@object-ui/plugin-chatbot": "3.4.0",
62
+ "@object-ui/plugin-dashboard": "3.4.0",
63
+ "@object-ui/plugin-designer": "3.4.0",
64
+ "@object-ui/plugin-detail": "3.4.0",
65
+ "@object-ui/plugin-form": "3.4.0",
66
+ "@object-ui/plugin-gantt": "3.4.0",
67
+ "@object-ui/plugin-grid": "3.4.0",
68
+ "@object-ui/plugin-kanban": "3.4.0",
69
+ "@object-ui/plugin-list": "3.4.0",
70
+ "@object-ui/plugin-map": "3.4.0",
71
+ "@object-ui/plugin-markdown": "3.4.0",
72
+ "@object-ui/plugin-report": "3.4.0",
73
+ "@object-ui/plugin-timeline": "3.4.0",
74
+ "@object-ui/plugin-view": "3.4.0",
75
+ "@object-ui/react": "3.4.0",
76
+ "@object-ui/types": "3.4.0"
77
77
  },
78
78
  "scripts": {
79
79
  "dev": "vite",
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{U as t,W as n,d as r}from"./framework-BW6KsEI0.js";import{t as i}from"./data-adapter-v22lWuhc.js";import{u as a}from"./infrastructure-94fpO8jL.js";var o=e(n(),1),s=t();function c({children:e,adapter:t}){let[n,c]=(0,o.useState)(t??null);return(0,o.useEffect)(()=>{if(t){c(t);return}let e=!1;async function n(){try{let t=new i({baseUrl:`https://demo.objectstack.ai`,fetch:a(),autoReconnect:!0,maxReconnectAttempts:5,reconnectDelay:1e3,cache:{maxSize:50,ttl:3e5}});await t.connect(),e||c(t)}catch(t){e||console.error(`[Console] Failed to initialize:`,t)}}return n(),()=>{e=!0}},[t]),(0,s.jsx)(r.Provider,{value:n,children:e})}export{c as t};
@@ -1,7 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{U as t,W as n}from"./framework-BW6KsEI0.js";import{Fn as r}from"./plugins-core-Ccvbi6db.js";import{S as i,_ as a,a as o,b as s,c,d as l,f as u,g as d,h as f,i as p,l as m,m as h,n as g,o as _,p as v,r as y,s as b,t as x,u as S,v as C,x as w,y as T}from"./vendor-charts-D1AP0-EV.js";var E=e(n(),1),D=t(),O=(...e)=>e.filter(Boolean).join(` `),k={light:``,dark:`.dark`},A=E.createContext(null);function j(){let e=E.useContext(A);if(!e)throw Error(`useChart must be used within a <ChartContainer />`);return e}function M({id:e,className:t,children:n,config:i,...a}){let o=E.useId(),s=`chart-${e||o.replace(/:/g,``)}`;return(0,D.jsx)(A.Provider,{value:{config:i},children:(0,D.jsxs)(`div`,{"data-slot":`chart`,"data-chart":s,className:O(`flex w-full h-[350px] justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground`,t),...a,children:[(0,D.jsx)(N,{id:s,config:i}),(0,D.jsx)(r,{width:`100%`,height:`100%`,children:n})]})})}var N=({id:e,config:t})=>{let n=Object.entries(t).filter(([,e])=>e.theme||e.color);return n.length?(0,D.jsx)(`style`,{dangerouslySetInnerHTML:{__html:Object.entries(k).map(([t,r])=>`
2
- ${r} [data-chart=${e}] {
3
- ${n.map(([e,n])=>{let r=n.theme?.[t]||n.color;return r?` --color-${e}: ${r};`:null}).join(`
4
- `)}
5
- }
6
- `).join(`
7
- `)}}):null},P=w;function F({active:e,payload:t,className:n,indicator:r=`dot`,hideLabel:i=!1,hideIndicator:a=!1,label:o,labelFormatter:s,labelClassName:c,formatter:l,color:u,nameKey:d,labelKey:f}){let{config:p}=j(),m=E.useMemo(()=>{if(i||!t?.length)return null;let[e]=t,n=R(p,e,`${f||e?.dataKey||e?.name||`value`}`),r=!f&&typeof o==`string`?p[o]?.label||o:n?.label;return s?(0,D.jsx)(`div`,{className:O(`font-medium`,c),children:s(r,t)}):r?(0,D.jsx)(`div`,{className:O(`font-medium`,c),children:r}):null},[o,s,t,i,c,p,f]);if(!e||!t?.length)return null;let h=t.length===1&&r!==`dot`;return(0,D.jsxs)(`div`,{className:O(`border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl`,n),children:[h?null:m,(0,D.jsx)(`div`,{className:`grid gap-1.5`,children:t.filter(e=>e.type!==`none`).map((e,t)=>{let n=R(p,e,`${d||e.name||e.dataKey||`value`}`),i=u||e.payload.fill||e.color;return(0,D.jsx)(`div`,{className:O(`[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5`,r===`dot`?`items-center`:``),children:l&&e?.value!==void 0&&e.name?l(e.value,e.name,e,t,e.payload):(0,D.jsxs)(D.Fragment,{children:[n?.icon?(0,D.jsx)(n.icon,{}):!a&&(0,D.jsx)(`div`,{className:O(`shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)`,r===`dot`?`h-2.5 w-2.5`:``,r===`line`?`w-1`:``,r===`dashed`?`w-0 border-[1.5px] border-dashed bg-transparent`:``,h&&r===`dashed`?`my-0.5`:``),style:{"--color-bg":i,"--color-border":i}}),(0,D.jsxs)(`div`,{className:O(`flex flex-1 justify-between leading-none`,h?`items-end`:`items-center`),children:[(0,D.jsxs)(`div`,{className:`grid gap-1.5`,children:[h?m:null,(0,D.jsx)(`span`,{className:`text-muted-foreground`,children:n?.label||e.name})]}),e.value&&(0,D.jsx)(`span`,{className:`text-foreground font-mono font-medium tabular-nums`,children:e.value.toLocaleString()})]})]})},e.dataKey)})})]})}var I=i;function L({className:e,hideIcon:t=!1,payload:n,verticalAlign:r=`bottom`,nameKey:i}){let{config:a}=j();return n?.length?(0,D.jsx)(`div`,{className:O(`flex items-center justify-center gap-4`,r===`top`?`pb-3`:`pt-3`,e),children:n.filter(e=>e.type!==`none`).map(e=>{let n=R(a,e,`${i||e.dataKey||`value`}`);return(0,D.jsxs)(`div`,{className:O(`[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3`),children:[n?.icon&&!t?(0,D.jsx)(n.icon,{}):(0,D.jsx)(`div`,{className:`h-2 w-2 shrink-0 rounded-[2px]`,style:{backgroundColor:e.color}}),n?.label]},e.value)})}):null}function R(e,t,n){if(typeof t!=`object`||!t)return;let r=`payload`in t&&typeof t.payload==`object`&&t.payload!==null?t.payload:void 0,i=n;return n in t&&typeof t[n]==`string`?i=t[n]:r&&n in r&&typeof r[n]==`string`&&(i=r[n]),i in e?e[i]:e[n]}var z=`hsl(var(--primary))`,B={slate:`#64748b`,gray:`#6b7280`,zinc:`#71717a`,neutral:`#737373`,stone:`#78716c`,red:`#ef4444`,orange:`#f97316`,amber:`#f59e0b`,yellow:`#eab308`,lime:`#84cc16`,green:`#22c55e`,emerald:`#10b981`,teal:`#14b8a6`,cyan:`#06b6d4`,sky:`#0ea5e9`,blue:`#3b82f6`,indigo:`#6366f1`,violet:`#8b5cf6`,purple:`#a855f7`,fuchsia:`#d946ef`,pink:`#ec4899`,rose:`#f43f5e`},V=e=>B[e]||e;function H({chartType:e=`bar`,data:t=[],config:n={},xAxisKey:r=`name`,series:i=[],className:w=``}){let O=Array.isArray(t)?t:[],[k,A]=E.useState(!1);E.useEffect(()=>{let e=()=>A(window.innerWidth<640);return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let j={bar:o,line:_,area:x,pie:p,donut:p,radar:y,scatter:g,combo:o}[e]||o,N=E.useMemo(()=>O.some(e=>String(e[r]||``).length>5),[O,r]),R=()=>[`hsl(var(--chart-1))`,`hsl(var(--chart-2))`,`hsl(var(--chart-3))`,`hsl(var(--chart-4))`,`hsl(var(--chart-5))`];if(e===`pie`||e===`donut`){let t=e===`donut`?60:0;return(0,D.jsx)(M,{config:n,className:w,children:(0,D.jsxs)(p,{children:[(0,D.jsx)(P,{cursor:!1,content:(0,D.jsx)(F,{hideLabel:!0})}),(0,D.jsx)(d,{data:O,dataKey:i[0]?.dataKey||`value`,nameKey:r||`name`,innerRadius:t,strokeWidth:5,paddingAngle:2,outerRadius:80,children:O.map((e,t)=>{let i=n[e[r]]?.color;if(!i){let e=R();i=e[t%e.length]}return(0,D.jsx)(s,{fill:V(i)},`cell-${t}`)})}),(0,D.jsx)(I,{content:(0,D.jsx)(L,{nameKey:r}),...k&&{verticalAlign:`bottom`,wrapperStyle:{fontSize:`11px`,paddingTop:`8px`}}})]})})}return e===`radar`?(0,D.jsx)(M,{config:n,className:w,children:(0,D.jsxs)(y,{data:O,children:[(0,D.jsx)(T,{}),(0,D.jsx)(a,{dataKey:r}),(0,D.jsx)(C,{}),(0,D.jsx)(P,{content:(0,D.jsx)(F,{})}),(0,D.jsx)(I,{content:(0,D.jsx)(L,{}),...k&&{verticalAlign:`bottom`,wrapperStyle:{fontSize:`11px`,paddingTop:`8px`}}}),i.map(e=>{let t=V(n[e.dataKey]?.color||z);return(0,D.jsx)(f,{dataKey:e.dataKey,stroke:t,fill:t,fillOpacity:.6},e.dataKey)})]})}):e===`scatter`?(0,D.jsx)(M,{config:n,className:w,children:(0,D.jsxs)(g,{children:[(0,D.jsx)(h,{vertical:!1}),(0,D.jsx)(m,{type:`number`,dataKey:r,name:String(n[r]?.label||r),tickLine:!1,axisLine:!1,interval:k?Math.ceil(O.length/5):0}),(0,D.jsx)(c,{type:`number`,dataKey:i[0]?.dataKey||`value`,name:String(n[i[0]?.dataKey]?.label||i[0]?.dataKey),tickLine:!1,axisLine:!1}),(0,D.jsx)(b,{type:`number`,range:[60,400]}),(0,D.jsx)(P,{content:(0,D.jsx)(F,{})}),(0,D.jsx)(I,{content:(0,D.jsx)(L,{}),...k&&{verticalAlign:`bottom`,wrapperStyle:{fontSize:`11px`,paddingTop:`8px`}}}),i.map((e,t)=>{let r=R(),i=V(n[e.dataKey]?.color||r[t%r.length]);return(0,D.jsx)(S,{name:n[e.dataKey]?.label||e.dataKey,data:O,fill:i},e.dataKey)})]})}):e===`combo`?(0,D.jsx)(M,{config:n,className:w,children:(0,D.jsxs)(o,{data:O,children:[(0,D.jsx)(h,{vertical:!1}),(0,D.jsx)(m,{dataKey:r,tickLine:!1,tickMargin:10,axisLine:!1,interval:k?Math.ceil(O.length/5):0,tickFormatter:e=>!e||typeof e!=`string`?e:k&&e.length>8?e.slice(0,8)+`…`:e,...!k&&N&&{angle:-35,textAnchor:`end`,height:60}}),(0,D.jsx)(c,{yAxisId:`left`,tickLine:!1,axisLine:!1}),(0,D.jsx)(c,{yAxisId:`right`,orientation:`right`,tickLine:!1,axisLine:!1}),(0,D.jsx)(P,{content:(0,D.jsx)(F,{})}),(0,D.jsx)(I,{content:(0,D.jsx)(L,{}),...k&&{verticalAlign:`bottom`,wrapperStyle:{fontSize:`11px`,paddingTop:`8px`}}}),i.map((e,t)=>{let r=V(n[e.dataKey]?.color||z),i=e.chartType||(t===0?`bar`:`line`),a=i===`bar`?`left`:`right`;return i===`line`?(0,D.jsx)(v,{yAxisId:a,type:`monotone`,dataKey:e.dataKey,stroke:r,strokeWidth:2,dot:!1},e.dataKey):i===`area`?(0,D.jsx)(u,{yAxisId:a,type:`monotone`,dataKey:e.dataKey,fill:r,stroke:r,fillOpacity:.4},e.dataKey):(0,D.jsx)(l,{yAxisId:a,dataKey:e.dataKey,fill:r,radius:4},e.dataKey)})]})}):(0,D.jsx)(M,{config:n,className:w,children:(0,D.jsxs)(j,{data:O,children:[(0,D.jsx)(h,{vertical:!1}),(0,D.jsx)(m,{dataKey:r,tickLine:!1,tickMargin:10,axisLine:!1,interval:k?Math.ceil(O.length/5):0,tickFormatter:e=>!e||typeof e!=`string`?e:k&&e.length>8?e.slice(0,8)+`…`:e,...!k&&N&&{angle:-35,textAnchor:`end`,height:60}}),(0,D.jsx)(P,{content:(0,D.jsx)(F,{})}),(0,D.jsx)(I,{content:(0,D.jsx)(L,{}),...k&&{verticalAlign:`bottom`,wrapperStyle:{fontSize:`11px`,paddingTop:`8px`}}}),i.map((t,r)=>{let a=R(),o=V(n[t.dataKey]?.color||a[r%a.length]||z);if(e===`bar`){let e=i.length===1&&O.length>1;return(0,D.jsx)(l,{dataKey:t.dataKey,fill:o,radius:4,children:e&&O.map((e,t)=>(0,D.jsx)(s,{fill:V(a[t%a.length])},`cell-${t}`))},t.dataKey)}return e===`line`?(0,D.jsx)(v,{type:`monotone`,dataKey:t.dataKey,stroke:o,strokeWidth:2,dot:!1},t.dataKey):e===`area`?(0,D.jsx)(u,{type:`monotone`,dataKey:t.dataKey,fill:o,stroke:o,fillOpacity:.4},t.dataKey):null})]})})}export{H as default};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{U as t,W as n,m as r}from"./framework-BW6KsEI0.js";import{Gr as i,Ji as a,Or as o,Pn as s,Ur as c,Wr as l,Xr as u,cr as d,eo as f,gi as p,ha as m,li as h,ln as g,lr as _,mr as v,xi as y}from"./plugins-core-Ccvbi6db.js";import{d as b,p as x}from"./ui-layout-CYz0tyDf.js";import"./index-DATdOX6r.js";var S=e(n(),1);function C(e,t){if(e!=null){if(typeof e==`string`)return e;if(t){let n=t(e.key,{defaultValue:e.defaultValue,...e.params});if(n&&n!==e.key)return n}return e.defaultValue||e.key}}var w=t();function T(){let e=b(),{appName:t}=x(),n=t?`/apps/${t}`:``,{apps:T,refresh:E}=r(),[D,O]=(0,S.useState)(``),[k,A]=(0,S.useState)(new Set),[j,M]=(0,S.useState)(null),[N,P]=(0,S.useState)(!1),F=(T||[]).filter(e=>{if(!D)return!0;let t=D.toLowerCase();return(e.name||``).toLowerCase().includes(t)||(e.label||``).toLowerCase().includes(t)||(e.description||``).toLowerCase().includes(t)}),I=(0,S.useCallback)(e=>{A(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),L=(0,S.useCallback)(()=>{k.size===F.length?A(new Set):A(new Set(F.map(e=>e.name)))},[k.size,F]),R=(0,S.useCallback)(async e=>{P(!0);try{let t=e.active===!1;f.success(`${e.label||e.name} ${t?`enabled`:`disabled`}`),await E()}catch{f.error(`Failed to toggle app status`)}finally{P(!1)}},[E]),z=(0,S.useCallback)(async e=>{P(!0);try{f.success(`${e.label||e.name} set as default`),await E()}catch{f.error(`Failed to set default app`)}finally{P(!1)}},[E]),B=(0,S.useCallback)(async e=>{if(j!==e.name){M(e.name);return}P(!0);try{f.success(`${e.label||e.name} deleted`),M(null),await E()}catch{f.error(`Failed to delete app`)}finally{P(!1)}},[j,E]),V=(0,S.useCallback)(async e=>{P(!0);try{f.success(`${k.size} apps ${e?`enabled`:`disabled`}`),A(new Set),await E()}catch{f.error(`Bulk operation failed`)}finally{P(!1)}},[k,E]);return(0,w.jsxs)(`div`,{className:`flex flex-col gap-4 p-4 sm:p-6`,children:[(0,w.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-3`,children:[(0,w.jsxs)(`div`,{className:`min-w-0`,children:[(0,w.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:`Applications`}),(0,w.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Manage all configured applications`})]}),(0,w.jsxs)(o,{onClick:()=>e(`${n}/create-app`),"data-testid":`create-app-btn`,children:[(0,w.jsx)(p,{className:`h-4 w-4 mr-2`}),`New App`]})]}),(0,w.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-start sm:items-center gap-2`,children:[(0,w.jsxs)(`div`,{className:`relative flex-1 max-w-sm`,children:[(0,w.jsx)(`label`,{htmlFor:`app-search`,className:`sr-only`,children:`Search apps`}),(0,w.jsx)(h,{className:`pointer-events-none absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground`,"aria-hidden":`true`}),(0,w.jsx)(g,{id:`app-search`,placeholder:`Search apps...`,value:D,onChange:e=>O(e.target.value),className:`pl-8`,"data-testid":`app-search-input`})]}),k.size>0&&(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsxs)(v,{variant:`secondary`,children:[k.size,` selected`]}),(0,w.jsx)(o,{variant:`outline`,size:`sm`,onClick:()=>V(!0),disabled:N,children:`Enable`}),(0,w.jsx)(o,{variant:`outline`,size:`sm`,onClick:()=>V(!1),disabled:N,children:`Disable`})]})]}),F.length>0&&(0,w.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,w.jsx)(s,{id:`select-all-apps`,checked:k.size===F.length&&F.length>0,onCheckedChange:()=>L()}),(0,w.jsxs)(`label`,{htmlFor:`select-all-apps`,className:`cursor-pointer`,children:[`Select all (`,F.length,`)`]})]}),F.length===0?(0,w.jsxs)(`div`,{className:`text-center py-12 text-muted-foreground`,"data-testid":`no-apps-message`,children:[(0,w.jsx)(a,{className:`h-12 w-12 mx-auto mb-3 opacity-30`}),(0,w.jsx)(`p`,{children:`No apps found.`})]}):(0,w.jsx)(`div`,{className:`grid gap-3`,children:F.map(t=>{let r=t.active!==!1,f=t.isDefault===!0,p=j===t.name;return(0,w.jsx)(d,{className:r?``:`opacity-60`,"data-testid":`app-card-${t.name}`,children:(0,w.jsxs)(_,{className:`flex items-center gap-3 py-3 px-4`,children:[(0,w.jsx)(s,{id:`select-app-${t.name}`,checked:k.has(t.name),onCheckedChange:()=>I(t.name),"aria-label":`Select ${t.label||t.name}`,className:`shrink-0`}),(0,w.jsx)(`div`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,w.jsx)(a,{className:`h-4 w-4`})}),(0,w.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(`span`,{className:`font-medium truncate`,children:C(t.label)||t.name}),f&&(0,w.jsx)(v,{variant:`default`,className:`text-xs`,children:`Default`}),(0,w.jsx)(v,{variant:r?`secondary`:`outline`,className:`text-xs`,children:r?`Active`:`Inactive`})]}),t.description&&(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground truncate`,children:C(t.description)})]}),(0,w.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[(0,w.jsx)(o,{variant:`ghost`,size:`icon`,title:`Open app`,"aria-label":`Open ${t.label||t.name}`,onClick:()=>e(`/apps/${t.name}`),children:(0,w.jsx)(m,{className:`h-4 w-4`})}),(0,w.jsx)(o,{variant:`ghost`,size:`icon`,title:`Edit app`,"aria-label":`Edit ${t.label||t.name}`,onClick:()=>e(`${n}/edit-app/${t.name}`),children:(0,w.jsx)(y,{className:`h-4 w-4`})}),(0,w.jsx)(o,{variant:`ghost`,size:`icon`,title:r?`Disable app`:`Enable app`,"aria-label":r?`Disable ${t.label||t.name}`:`Enable ${t.label||t.name}`,onClick:()=>R(t),disabled:N,children:r?(0,w.jsx)(l,{className:`h-4 w-4`}):(0,w.jsx)(i,{className:`h-4 w-4`})}),(0,w.jsx)(o,{variant:`ghost`,size:`icon`,title:`Set as default`,"aria-label":`Set ${t.label||t.name} as default`,onClick:()=>z(t),disabled:N||f,children:(0,w.jsx)(u,{className:`h-4 w-4 ${f?`fill-current text-yellow-500`:``}`})}),(0,w.jsx)(o,{variant:`ghost`,size:`icon`,title:p?`Click again to confirm delete`:`Delete app`,"aria-label":p?`Confirm delete ${t.label||t.name}`:`Delete ${t.label||t.name}`,onClick:()=>B(t),disabled:N,className:p?`text-destructive`:``,children:(0,w.jsx)(c,{className:`h-4 w-4`})})]})]})},t.name)})})]})}export{T as AppManagementPage};
@@ -1 +0,0 @@
1
- import{U as e}from"./framework-BW6KsEI0.js";import{Fn as t}from"./plugins-core-Ccvbi6db.js";import{S as n,a as r,c as i,d as a,l as o,m as s,x as c}from"./vendor-charts-D1AP0-EV.js";var l=e();function u({data:e=[],dataKey:u=`value`,xAxisKey:d=`name`,height:f=400,className:p=``,color:m=`hsl(var(--primary))`}){return(0,l.jsx)(`div`,{className:`p-2 sm:p-3 md:p-4 rounded-xl border border-border bg-card/40 backdrop-blur-sm shadow-lg shadow-background/5 ${p}`,children:(0,l.jsx)(t,{width:`100%`,height:f,children:(0,l.jsxs)(r,{data:e,margin:{top:10,right:10,left:10,bottom:5},children:[(0,l.jsxs)(`defs`,{children:[(0,l.jsxs)(`linearGradient`,{id:`barGradient`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,l.jsx)(`stop`,{offset:`0%`,stopColor:m,stopOpacity:1}),(0,l.jsx)(`stop`,{offset:`90%`,stopColor:m,stopOpacity:.6}),(0,l.jsx)(`stop`,{offset:`100%`,stopColor:m,stopOpacity:.3})]}),(0,l.jsxs)(`filter`,{id:`glow`,height:`130%`,children:[(0,l.jsx)(`feGaussianBlur`,{in:`SourceAlpha`,stdDeviation:`3`,result:`blur`}),(0,l.jsx)(`feOffset`,{in:`blur`,dx:`0`,dy:`0`,result:`offsetBlur`}),(0,l.jsx)(`feFlood`,{floodColor:m,floodOpacity:`0.5`,result:`offsetColor`}),(0,l.jsx)(`feComposite`,{in:`offsetColor`,in2:`offsetBlur`,operator:`in`,result:`offsetBlur`}),(0,l.jsxs)(`feMerge`,{children:[(0,l.jsx)(`feMergeNode`,{in:`offsetBlur`}),(0,l.jsx)(`feMergeNode`,{in:`SourceGraphic`})]})]})]}),(0,l.jsx)(s,{strokeDasharray:`3 3`,stroke:`hsl(var(--border))`,vertical:!1}),(0,l.jsx)(o,{dataKey:d,tick:{fill:`hsl(var(--muted-foreground))`,fontSize:12,fontFamily:`monospace`},tickLine:!1,axisLine:{stroke:`hsl(var(--border))`},dy:10}),(0,l.jsx)(i,{tick:{fill:`hsl(var(--muted-foreground))`,fontSize:12,fontFamily:`monospace`},tickLine:!1,axisLine:!1}),(0,l.jsx)(c,{cursor:{fill:`hsl(var(--muted))`,opacity:.2},contentStyle:{backgroundColor:`hsl(var(--popover))`,borderColor:`hsl(var(--border))`,color:`hsl(var(--popover-foreground))`,borderRadius:`8px`,fontFamily:`monospace`,boxShadow:`0 4px 6px -1px rgb(0 0 0 / 0.1)`},itemStyle:{color:`hsl(var(--primary))`}}),(0,l.jsx)(n,{wrapperStyle:{paddingTop:`20px`,fontFamily:`monospace`}}),(0,l.jsx)(a,{dataKey:u,fill:`url(#barGradient)`,radius:[4,4,0,0],filter:`url(#glow)`,animationDuration:1500})]})})})}export{u as default};
@@ -1 +0,0 @@
1
- import{n as e,r as t}from"./rolldown-runtime-S-ySWqyJ.js";import{U as n,W as r,a as i,m as a,p as ee}from"./framework-BW6KsEI0.js";import{An as o,Dn as te,En as s,On as c,Or as l,Tn as u,c as d,eo as f,gt as ne,ht as re,kn as ie,mt as ae}from"./plugins-core-Ccvbi6db.js";import{p as oe}from"./ui-layout-CYz0tyDf.js";import"./AdapterProvider-Cd4HYb7q.js";import"./MetadataProvider-Dvc9BxbC.js";import{C as p,N as m,P as h,et as g,f as _,l as v,nt as y,rt as b,u as x,w as S}from"./vendor-icons-CrSf7tAH.js";import{a as C,i as w,r as T}from"./plugins-views-CbLIJkBs.js";import{r as E,t as se}from"./MetadataInspector-DVtCDQtx.js";import{n as ce}from"./skeletons-CIQE_YYE.js";var D=t(r(),1);function O(e,t){if(e!=null){if(typeof e==`string`)return e;if(t){let n=t(e.key,{defaultValue:e.defaultValue,...e.params});if(n&&n!==e.key)return n}return e.defaultValue||e.key}}function k(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}var A=e({DashboardView:()=>B}),j=n(),M=[{type:`metric`,label:`KPI Metric`,Icon:v},{type:`bar`,label:`Bar Chart`,Icon:b},{type:`line`,label:`Line Chart`,Icon:y},{type:`pie`,label:`Pie Chart`,Icon:g},{type:`table`,label:`Table`,Icon:_},{type:`grid`,label:`Grid`,Icon:h}],N=0;function P(){return N+=1,`widget_${Date.now()}_${N}`}function F(e){return!e.widgets?.length||!e.widgets.some(e=>!e.id)?e:{...e,widgets:e.widgets.map(e=>e.id?e:{...e,id:P()})}}function I(e){let t=M.find(t=>t.type===e);return t?`New ${t.label}`:`New Widget`}function L(e){return{title:e.title??``,description:e.description??``,type:e.type??`metric`,object:e.object??``,categoryField:e.categoryField??``,valueField:e.valueField??``,aggregate:e.aggregate??`count`,layoutW:e.layout?.w??1,layoutH:e.layout?.h??1,colorVariant:e.colorVariant??`default`,actionUrl:e.actionUrl??``}}function R(e,t){return{title:e.title,description:e.description,type:e.type,object:e.object,categoryField:e.categoryField,valueField:e.valueField,aggregate:e.aggregate,layout:{...t.layout||{},w:e.layoutW,h:e.layoutH},colorVariant:e.colorVariant,actionUrl:e.actionUrl}}function z(e){return{columns:e.columns??3,gap:e.gap??4,rowHeight:String(e.rowHeight??`120`),refreshInterval:String(e.refreshInterval??`0`),title:e.title??``,showDescription:e.showDescription??!0,theme:e.theme??`auto`}}function B({dataSource:e}){let{dashboardName:t}=oe(),{showDebug:n}=E(),r=ee(),{t:h}=i(),[g,_]=(0,D.useState)(!0),[v,y]=(0,D.useState)(!1),[b,k]=(0,D.useState)(null),[A,N]=(0,D.useState)(0),[B,V]=(0,D.useState)(null),H=(0,D.useCallback)(e=>{V(t=>(t&&t.resolve(e),null))},[]),U=(0,D.useCallback)(e=>new Promise(t=>{V({schema:typeof e==`string`?{objectName:e,mode:`create`}:e,resolve:t})}),[]),le=(0,D.useMemo)(()=>({export_dashboard_pdf:async()=>{f.info(`Preparing PDF export…`);try{return window.print(),{success:!0}}catch(e){return f.error(`Export failed: ${e?.message||String(e)}`),{success:!1,error:e?.message||String(e)}}},forecast_dashboard:async()=>(f.info(`Forecast view coming soon`),{success:!0})}),[]);(0,D.useEffect)(()=>{_(!0),Y(null),y(!1),k(null),queueMicrotask(()=>_(!1))},[t]);let{dashboards:W,objects:G,refresh:K}=a(),q=W?.find(e=>e.name===t),[J,Y]=(0,D.useState)(null);(0,D.useEffect)(()=>{v||Y(null)},[q]);let X=(0,D.useCallback)(async e=>{try{r&&(await r.update(`sys_dashboard`,t,e),K().catch(()=>{}))}catch(e){console.warn(`[DashboardView] Auto-save failed:`,e)}},[r,t,K]),ue=(0,D.useCallback)(()=>{Y(F(q)),y(!0),N(e=>e+1)},[q]),Z=(0,D.useCallback)(()=>{y(!1),k(null)},[]),de=(0,D.useCallback)(e=>{if(!J)return;let t=P(),n={id:t,title:I(e),type:e,layout:{x:0,y:J.widgets?.length??0,w:J.columns??2,h:1}},r={...J,widgets:[...J.widgets||[],n]};Y(r),X(r),k(t),N(e=>e+1)},[J,X]),fe=(0,D.useCallback)(e=>{if(!J)return;let t={...J,widgets:J.widgets.filter(t=>t.id!==e)};Y(t),X(t),b===e&&k(null)},[J,b,X]),pe=(0,D.useMemo)(()=>z(J||q),[A]),me=(0,D.useCallback)(e=>{if(!J)return;let t={...J,columns:e.columns,gap:e.gap,rowHeight:e.rowHeight,refreshInterval:Number(e.refreshInterval)||0,title:e.title,showDescription:e.showDescription,theme:e.theme};Y(t),X(t),N(e=>e+1)},[J,X]),he=(0,D.useCallback)((e,t)=>{J&&Y(n=>n&&(e===`refreshInterval`?{...n,refreshInterval:Number(t)||0}:{...n,[e]:t}))},[J]),Q=J?.widgets?.find(e=>e.id===b),ge=(0,D.useMemo)(()=>Q?L(Q):{},[b,A]),_e=(0,D.useCallback)(e=>{if(!J||!b||!Q)return;let t=R(e,Q),n={...J,widgets:J.widgets.map(e=>e.id===b?{...e,...t}:e)};Y(n),X(n),N(e=>e+1)},[J,b,Q,X]),ve=(0,D.useCallback)((e,t)=>{b&&Y(n=>{if(!n)return n;let r=n.widgets?.find(e=>e.id===b);if(!r)return n;let i=L(r);i[e]=t;let a=R(i,r);return{...n,widgets:n.widgets.map(e=>e.id===b?{...e,...a}:e)}})},[b]),ye=(0,D.useMemo)(()=>{if(G?.length)return G.map(e=>({value:e.name,label:e.label||e.name}))},[G]),be=(0,D.useMemo)(()=>{let e=Q?.object;if(!e||!G?.length)return;let t=G.find(t=>t.name===e);if(!t?.fields)return;let n=t.fields;return Array.isArray(n)?n.filter(e=>e.name).map(e=>({value:e.name,label:e.label||e.name})):Object.entries(n).map(([e,t])=>({value:e,label:t.label||e}))},[Q?.object,G]);if(g)return(0,j.jsx)(ce,{});if(!q)return(0,j.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,children:(0,j.jsxs)(ae,{children:[(0,j.jsx)(`div`,{className:`mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted`,children:(0,j.jsx)(m,{className:`h-6 w-6 text-muted-foreground`})}),(0,j.jsx)(ne,{children:`Dashboard Not Found`}),(0,j.jsxs)(re,{children:[`The dashboard "`,t,`" could not be found. It may have been removed or renamed.`]})]})});let $=J||q;return(0,j.jsxs)(`div`,{className:`flex flex-col h-full overflow-hidden bg-background`,children:[(0,j.jsxs)(`div`,{className:`flex flex-col sm:flex-row justify-between sm:items-center gap-3 sm:gap-4 p-4 sm:p-6 border-b shrink-0`,children:[(0,j.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,j.jsx)(`h1`,{className:`text-lg sm:text-xl md:text-2xl font-bold tracking-tight truncate`,children:O(q.label,h)||q.name}),q.description&&(0,j.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1 line-clamp-2`,children:O(q.description,h)})]}),(0,j.jsxs)(`div`,{className:`shrink-0 flex items-center gap-1.5`,children:[v&&(0,j.jsx)(`div`,{className:`flex items-center gap-1 mr-2`,role:`toolbar`,"aria-label":`Add widgets`,"data-testid":`dashboard-widget-toolbar`,children:M.map(({type:e,label:t,Icon:n})=>(0,j.jsxs)(`button`,{type:`button`,"data-testid":`dashboard-add-${e}`,onClick:()=>de(e),className:`inline-flex items-center gap-1 rounded-md border border-input bg-background px-2 py-1.5 text-[11px] font-medium text-muted-foreground hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,title:`Add ${t}`,"aria-label":`Add ${t} widget`,children:[(0,j.jsx)(p,{className:`h-3 w-3`}),(0,j.jsx)(n,{className:`h-3 w-3`})]},e))}),(0,j.jsxs)(`button`,{type:`button`,onClick:ue,className:`inline-flex items-center gap-1.5 rounded-md border border-input bg-background px-2.5 py-1.5 text-xs font-medium text-muted-foreground shadow-sm hover:bg-accent hover:text-accent-foreground`,"data-testid":`dashboard-edit-button`,children:[(0,j.jsx)(S,{className:`h-3.5 w-3.5`}),`Edit`]})]})]}),(0,j.jsxs)(`div`,{className:`flex-1 overflow-hidden flex flex-col sm:flex-row relative`,children:[(0,j.jsx)(`div`,{className:`flex-1 min-w-0 overflow-auto p-2 sm:p-4 md:p-6`,children:(0,j.jsx)(C,{schema:$,dataSource:e,designMode:v,selectedWidgetId:b,onWidgetClick:k,modalHandler:U,scriptHandlers:le})}),Q?(0,j.jsx)(T,{open:v,onClose:Z,config:ge,onSave:_e,onFieldChange:ve,availableObjects:ye,availableFields:be,headerExtra:(0,j.jsx)(l,{size:`sm`,variant:`ghost`,onClick:()=>fe(b),className:`h-7 w-7 p-0 text-destructive hover:text-destructive`,"data-testid":`widget-delete-button`,title:`Delete widget`,children:(0,j.jsx)(x,{className:`h-3.5 w-3.5`})})},b):(0,j.jsx)(w,{open:v,onClose:Z,config:pe,onSave:me,onFieldChange:he}),(0,j.jsx)(se,{open:n,sections:[{title:`Dashboard Configuration`,data:$}]})]}),B&&B.schema?.objectName?(0,j.jsx)(d,{schema:{type:`object-form`,formType:`modal`,objectName:B.schema.objectName,mode:B.schema.mode||`create`,recordId:B.schema.recordId,title:B.schema.title,description:B.schema.description,fields:B.schema.fields,open:!0,onOpenChange:e=>{e||H({success:!1})},onSuccess:e=>{H({success:!0,reload:!0,data:e})},onCancel:()=>{H({success:!1})},showSubmit:!0,showCancel:!0},dataSource:r}):B?(0,j.jsx)(u,{open:!0,onOpenChange:e=>{e||H({success:!1})},children:(0,j.jsxs)(s,{children:[(0,j.jsxs)(ie,{children:[(0,j.jsx)(o,{children:B.schema?.title||`Action`}),B.schema?.description&&(0,j.jsx)(te,{children:B.schema.description})]}),(0,j.jsxs)(c,{children:[(0,j.jsx)(l,{variant:`outline`,onClick:()=>H({success:!1}),children:`Cancel`}),(0,j.jsx)(l,{onClick:()=>H({success:!0}),children:`OK`})]})]})}):null]})}export{k as n,O as r,A as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{U as t,W as n}from"./framework-BW6KsEI0.js";import{$ as r,Aa as i,Oa as a,Or as o,Q as s,Vr as c,Z as l,cr as u,ct as d,dr as f,et as p,fr as m,gi as h,it as g,ln as _,lr as v,lt as y,mr as b,nt as x,st as S,tt as C,u as w,ur as T,ut as E}from"./plugins-core-Ccvbi6db.js";var D=e(n(),1),O=t(),k=(...e)=>e.filter(Boolean).join(` `);function A(e,t){if(!t||t.length===0)return{};for(let n of t){let t=e[n.field];if(t==null)continue;let r=!1,i=String(t);switch(n.operator){case`equals`:r=i===String(n.value);break;case`not_equals`:r=i!==String(n.value);break;case`contains`:r=i.toLowerCase().includes(String(n.value).toLowerCase());break;case`in`:r=Array.isArray(n.value)&&n.value.includes(i);break}if(r)return{...n.backgroundColor?{backgroundColor:n.backgroundColor}:{},...n.borderColor?{borderColor:n.borderColor}:{}}}return{}}function j({card:e,conditionalFormatting:t}){let{attributes:n,listeners:i,setNodeRef:a,transform:o,transition:s,isDragging:c}=r({id:e.id}),l={transform:E.Transform.toString(o),transition:s,opacity:c?.5:void 0},d=A(e,t);return(0,O.jsx)(`div`,{ref:a,style:l,...n,...i,children:(0,O.jsxs)(u,{className:`mb-2 cursor-grab active:cursor-grabbing border-border bg-card/60 hover:border-primary/40 hover:shadow-lg hover:shadow-primary/10 transition-all duration-300 group`,style:d,children:[e.coverImage&&(0,O.jsx)(`div`,{className:`w-full h-32 overflow-hidden rounded-t-lg`,children:(0,O.jsx)(`img`,{src:e.coverImage,alt:``,className:`w-full h-full object-cover`,loading:`lazy`})}),(0,O.jsxs)(f,{className:`p-4`,children:[(0,O.jsx)(m,{className:`text-sm font-medium font-mono tracking-tight text-foreground group-hover:text-primary transition-colors`,children:e.title}),e.description&&(0,O.jsx)(T,{className:`text-xs text-muted-foreground font-mono`,children:e.description})]}),e.badges&&e.badges.length>0&&(0,O.jsx)(v,{className:`p-4 pt-0`,children:(0,O.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.badges.map((e,t)=>(0,O.jsx)(b,{variant:e.variant||`default`,className:`text-xs`,children:e.label},t))})})]})})}function M({cards:e,parentRef:t,conditionalFormatting:n}){let r=w({count:e.length,getScrollElement:()=>t.current,estimateSize:()=>120,overscan:5});return(0,O.jsx)(`div`,{style:{height:`${r.getTotalSize()}px`,width:`100%`,position:`relative`},children:r.getVirtualItems().map(t=>{let r=e[t.index];return(0,O.jsx)(`div`,{style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${t.start}px)`},children:(0,O.jsx)(j,{card:r,conditionalFormatting:n})},r.id)})})}function N({columnId:e,onAdd:t}){let[n,r]=D.useState(!1),[i,a]=D.useState(``),s=D.useRef(null),c=()=>{let n=i.trim();n&&(t(e,n),a(``)),r(!1)};return n?(0,O.jsx)(`div`,{className:`mt-2 space-y-2`,children:(0,O.jsx)(_,{ref:s,value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),c()):e.key===`Escape`&&(a(``),r(!1))},onBlur:c,placeholder:`Enter card title...`,className:`text-sm`,autoFocus:!0})}):(0,O.jsxs)(o,{variant:`ghost`,size:`sm`,className:`w-full mt-2 text-muted-foreground hover:text-foreground`,onClick:()=>{r(!0),setTimeout(()=>s.current?.focus(),0)},children:[(0,O.jsx)(h,{className:`h-4 w-4 mr-1`}),`Add Card`]})}function P({column:e,cards:t,onToggle:n,enableVirtual:s,quickAdd:u,onQuickAdd:d,conditionalFormatting:f}){let m=t||[],h=D.useRef(null),{setNodeRef:g}=r({id:e.id,data:{type:`column`}}),_=e.limit&&m.length>=e.limit,v=e.limit&&m.length>=e.limit*.8;return(0,O.jsxs)(`div`,{ref:g,className:k(`flex flex-col flex-shrink-0 rounded-lg border border-border bg-card/20 backdrop-blur-sm shadow-xl transition-all`,e.collapsed?`w-16`:`w-80`,e.className),children:[(0,O.jsxs)(`div`,{className:`p-4 border-b border-border/50 bg-muted/20 flex items-center justify-between`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0`,children:[(0,O.jsx)(o,{variant:`ghost`,size:`sm`,className:`h-6 w-6 p-0`,onClick:()=>n(!e.collapsed),children:e.collapsed?(0,O.jsx)(a,{className:`h-4 w-4`}):(0,O.jsx)(i,{className:`h-4 w-4`})}),!e.collapsed&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`h3`,{className:`font-mono text-sm font-semibold tracking-wider text-primary/90 uppercase truncate`,children:e.title}),(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsxs)(`span`,{className:k(`font-mono text-xs`,_?`text-destructive`:v?`text-yellow-500`:`text-muted-foreground`),children:[m.length,e.limit&&` / ${e.limit}`]}),_&&(0,O.jsx)(b,{variant:`destructive`,className:`text-xs`,children:`Full`}),v&&!_&&(0,O.jsx)(c,{className:`h-3 w-3 text-yellow-500`})]})]})]}),e.collapsed&&(0,O.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,O.jsx)(`span`,{className:`font-mono text-xs font-bold text-primary/90 [writing-mode:vertical-rl] rotate-180`,children:e.title}),(0,O.jsx)(b,{variant:`secondary`,className:`text-xs`,children:m.length})]})]}),!e.collapsed&&(0,O.jsxs)(`div`,{ref:h,className:`flex-1 p-4 overflow-y-auto`,style:{maxHeight:`600px`},children:[(0,O.jsx)(l,{items:m.map(e=>e.id),strategy:p,children:s?(0,O.jsx)(M,{cards:m,parentRef:h,conditionalFormatting:f}):(0,O.jsx)(`div`,{className:`space-y-2`,children:m.map(e=>(0,O.jsx)(j,{card:e,conditionalFormatting:f},e.id))})}),u&&d&&(0,O.jsx)(N,{columnId:e.id,onAdd:d})]})]})}function F({columns:e,onCardMove:t,onColumnToggle:n,enableVirtualScrolling:r=!1,virtualScrollThreshold:i=50,className:a,quickAdd:o,onQuickAdd:c,conditionalFormatting:l}){let[u,f]=D.useState(null),p=D.useMemo(()=>(e||[]).map(e=>({...e,cards:e.cards||[]})),[e]),[m,h]=D.useState(p);D.useEffect(()=>{h(p)},[p]);let _=y(d(g,{activationConstraint:{distance:8}})),v=e=>{let{active:t}=e;f(w(t.id))},b=e=>{let{active:n,over:r}=e;if(f(null),!r)return;let i=n.id,a=r.id;if(i===a)return;let o=T(i),c=T(a)||E(a);if(!(!o||!c))if(o.id===c.id){let e=[...o.cards],t=s(e,e.findIndex(e=>e.id===i),e.findIndex(e=>e.id===a));h(e=>e.map(e=>e.id===o.id?{...e,cards:t}:e))}else{let e=[...o.cards],n=[...c.cards],r=e.findIndex(e=>e.id===i),s=a===c.id?n.length:n.findIndex(e=>e.id===a),[l]=e.splice(r,1);n.splice(s,0,l),h(t=>t.map(t=>t.id===o.id?{...t,cards:e}:t.id===c.id?{...t,cards:n}:t)),t&&t(i,o.id,c.id,s)}},w=D.useCallback(e=>{for(let t of m){let n=t.cards.find(t=>t.id===e);if(n)return n}return null},[m]),T=D.useCallback(e=>m.find(t=>t.cards.some(t=>t.id===e))||null,[m]),E=D.useCallback(e=>m.find(t=>t.id===e)||null,[m]),A=D.useCallback((e,t)=>{h(n=>n.map(n=>n.id===e?{...n,collapsed:t}:n)),n?.(e,t)},[n]);return(0,O.jsxs)(C,{sensors:_,collisionDetection:S,onDragStart:v,onDragEnd:b,children:[(0,O.jsx)(`div`,{className:k(`flex gap-4 overflow-x-auto p-4`,a),children:m.map(e=>{let t=r&&e.cards.length>i;return(0,O.jsx)(P,{column:e,cards:e.cards,onToggle:t=>A(e.id,t),enableVirtual:t,quickAdd:o,onQuickAdd:c,conditionalFormatting:l},e.id)})}),(0,O.jsx)(x,{children:u?(0,O.jsx)(j,{card:u,conditionalFormatting:l}):null})]})}export{F as KanbanEnhanced,F as default};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{U as t,W as n,g as r,h as i}from"./framework-BW6KsEI0.js";import{$ as a,Or as o,Q as s,Z as c,an as l,at as u,cr as d,ct as f,dr as p,et as m,fr as h,gi as g,it as _,ln as v,lr as y,lt as b,mr as x,nt as S,st as C,tt as w,ur as T,ut as E}from"./plugins-core-Ccvbi6db.js";var D=e(n(),1),O=t(),k=(...e)=>e.filter(Boolean).join(` `),A=`Uncategorized`;function j(e,t){if(!t||t.length===0)return{};for(let n of t){let t=e[n.field];if(t==null)continue;let r=!1,i=String(t);switch(n.operator){case`equals`:r=i===String(n.value);break;case`not_equals`:r=i!==String(n.value);break;case`contains`:r=i.toLowerCase().includes(String(n.value).toLowerCase());break;case`in`:r=Array.isArray(n.value)&&n.value.includes(i);break}if(r)return{...n.backgroundColor?{backgroundColor:n.backgroundColor}:{},...n.borderColor?{borderColor:n.borderColor}:{}}}return{}}function M({card:e,onCardClick:t,conditionalFormatting:n}){let{attributes:r,listeners:i,setNodeRef:o,transform:s,transition:c,isDragging:l}=a({id:e.id}),u={transform:E.Transform.toString(s),transition:c,opacity:l?.5:void 0},f=j(e,n);return(0,O.jsx)(`div`,{ref:o,style:u,...r,...i,role:`listitem`,"aria-label":e.title,onClick:()=>t?.(e),children:(0,O.jsxs)(d,{className:`mb-2 cursor-grab active:cursor-grabbing border-border border-l-4 border-l-primary/40 bg-card/60 hover:border-primary/40 hover:shadow-lg hover:shadow-primary/10 transition-all duration-300 group touch-manipulation`,style:f,children:[e.coverImage&&(0,O.jsx)(`div`,{className:`w-full h-32 overflow-hidden rounded-t-lg`,children:(0,O.jsx)(`img`,{src:e.coverImage,alt:``,className:`w-full h-full object-cover`,loading:`lazy`})}),(0,O.jsxs)(p,{className:`p-2 sm:p-4`,children:[(0,O.jsx)(h,{className:`text-xs sm:text-sm font-medium font-mono tracking-tight text-foreground group-hover:text-primary transition-colors`,children:e.title}),e.description&&(0,O.jsx)(T,{className:`text-xs text-muted-foreground font-mono line-clamp-2 sm:line-clamp-none`,children:e.description})]}),e.badges&&e.badges.length>0&&(0,O.jsx)(y,{className:`p-2 sm:p-4 pt-0`,children:(0,O.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.badges.map((e,t)=>(0,O.jsx)(x,{variant:e.variant||`default`,className:`text-xs`,children:e.label},t))})})]})})}function N({columnId:e,onAdd:t}){let[n,r]=D.useState(!1),[i,a]=D.useState(``),s=D.useRef(null),c=()=>{let n=i.trim();n&&(t(e,n),a(``)),r(!1)};return n?(0,O.jsx)(`div`,{className:`mt-2 space-y-2`,children:(0,O.jsx)(v,{ref:s,value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),c()):e.key===`Escape`&&(a(``),r(!1))},onBlur:c,placeholder:`Enter card title...`,className:`text-sm`,autoFocus:!0})}):(0,O.jsxs)(o,{variant:`ghost`,size:`sm`,className:`w-full mt-2 text-muted-foreground hover:text-foreground`,onClick:()=>{r(!0),setTimeout(()=>s.current?.focus(),0)},children:[(0,O.jsx)(g,{className:`h-4 w-4 mr-1`}),`Add Card`]})}function P({column:e,cards:t,onCardClick:n,quickAdd:r,onQuickAdd:i,conditionalFormatting:o}){let s=t||[],{setNodeRef:u}=a({id:e.id,data:{type:`column`}}),d=e.limit&&s.length>=e.limit;return(0,O.jsxs)(`div`,{ref:u,role:`group`,"aria-label":e.title,className:k(`flex flex-col w-[85vw] sm:w-80 flex-shrink-0 rounded-lg border border-border bg-card/20 backdrop-blur-sm shadow-xl snap-start`,e.className),children:[(0,O.jsx)(`div`,{className:`p-3 sm:p-4 border-b border-border/50 bg-muted/30 rounded-t-lg`,children:(0,O.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,O.jsx)(`h3`,{id:`kanban-col-${e.id}`,className:`font-mono text-xs sm:text-sm font-semibold tracking-wider text-primary/90 uppercase truncate`,children:e.title}),(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsxs)(x,{variant:`secondary`,className:`text-xs font-mono tabular-nums`,children:[s.length,e.limit&&` / ${e.limit}`]}),d&&(0,O.jsx)(x,{variant:`destructive`,className:`text-xs`,children:`Full`})]})]})}),(0,O.jsxs)(l,{className:`flex-1 p-4`,children:[(0,O.jsx)(c,{items:s.map(e=>e.id),strategy:m,children:(0,O.jsxs)(`div`,{className:`space-y-2`,role:`list`,"aria-label":`${e.title} cards`,children:[s.length===0&&(0,O.jsx)(`div`,{className:`flex flex-col items-center justify-center py-8 text-muted-foreground/50`,children:(0,O.jsx)(`span`,{className:`text-xs font-mono`,children:`No cards`})}),s.map(e=>(0,O.jsx)(M,{card:e,onCardClick:n,conditionalFormatting:o},e.id))]})}),r&&i&&(0,O.jsx)(N,{columnId:e.id,onAdd:i})]})]})}function F({children:e}){return(0,O.jsx)(O.Fragment,{children:e(i())})}function I({columns:e,onCardMove:t,onCardClick:n,className:i,quickAdd:a,onQuickAdd:o,coverImageField:s,conditionalFormatting:c,swimlaneField:l}){return r()?(0,O.jsx)(F,{children:r=>(0,O.jsx)(L,{columns:e,onCardMove:t,onCardClick:n,className:i,dnd:r,quickAdd:a,onQuickAdd:o,coverImageField:s,conditionalFormatting:c,swimlaneField:l})}):(0,O.jsx)(L,{columns:e,onCardMove:t,onCardClick:n,className:i,dnd:null,quickAdd:a,onQuickAdd:o,coverImageField:s,conditionalFormatting:c,swimlaneField:l})}function L({columns:e,onCardMove:t,onCardClick:n,className:r,dnd:i,quickAdd:a,onQuickAdd:o,coverImageField:l,conditionalFormatting:d,swimlaneField:p}){let[h,g]=D.useState(null),v=p?`objectui:kanban-collapsed:${p}`:null,[y,x]=D.useState(()=>{if(!v)return new Set;try{let e=localStorage.getItem(v);if(e){let t=JSON.parse(e);if(Array.isArray(t))return new Set(t.filter(e=>typeof e==`string`))}}catch{}return new Set}),T=D.useMemo(()=>(e||[]).map(e=>({...e,cards:e.cards||[]})),[e]),[E,j]=D.useState(T);D.useEffect(()=>{j(T)},[T]);let N=D.useMemo(()=>{if(!p)return null;let e=E.flatMap(e=>e.cards),t=new Set;return e.forEach(e=>{let n=e[p];t.add(n==null?A:String(n))}),Array.from(t).sort()},[E,p]),F=D.useCallback(e=>{x(t=>{let n=new Set(t);if(n.has(e)?n.delete(e):n.add(e),v)try{localStorage.setItem(v,JSON.stringify([...n]))}catch{}return n})},[v]),I=b(f(_,{activationConstraint:{distance:5}}),f(u,{activationConstraint:{delay:200,tolerance:5}})),L=e=>{let{active:t}=e,n=z(t.id);if(g(n),i&&n){let e=B(n.id);e&&i.startDrag({id:n.id,type:`kanban-card`,data:n,sourceId:e.id})}},R=e=>{let{active:n,over:r}=e;if(g(null),!r){i&&i.endDrag();return}let a=n.id,o=r.id;if(a===o){i&&i.endDrag();return}let c=B(a),l=B(o)||V(o);if(!c||!l){i&&i.endDrag();return}if(c.id===l.id){let e=[...c.cards],t=s(e,e.findIndex(e=>e.id===a),e.findIndex(e=>e.id===o));j(e=>e.map(e=>e.id===c.id?{...e,cards:t}:e))}else{let e=[...c.cards],n=[...l.cards],r=e.findIndex(e=>e.id===a),i=o===l.id?n.length:n.findIndex(e=>e.id===o),[s]=e.splice(r,1);n.splice(i,0,s),j(t=>t.map(t=>t.id===c.id?{...t,cards:e}:t.id===l.id?{...t,cards:n}:t)),t&&t(a,c.id,l.id,i)}i&&i.endDrag(l.id)},z=D.useCallback(e=>{for(let t of E){let n=t.cards.find(t=>t.id===e);if(n)return n}return null},[E]),B=D.useCallback(e=>E.find(t=>t.cards.some(t=>t.id===e))||null,[E]),V=D.useCallback(e=>E.find(t=>t.id===e)||null,[E]);return(0,O.jsxs)(w,{sensors:I,collisionDetection:C,onDragStart:L,onDragEnd:R,children:[(0,O.jsxs)(`div`,{className:`flex sm:hidden items-center justify-between px-3 pb-2 text-xs text-muted-foreground`,children:[(0,O.jsxs)(`span`,{children:[E.length,` columns`]}),(0,O.jsx)(`span`,{children:`← Swipe to navigate →`})]}),N?(0,O.jsxs)(`div`,{className:k(`flex flex-col gap-1 p-2 sm:p-4 min-w-0 overflow-hidden`,r),role:`region`,"aria-label":`Kanban board with swimlanes`,children:[(0,O.jsx)(`div`,{className:`flex gap-3 sm:gap-4 pl-36 sm:pl-44 overflow-x-auto`,children:E.map(e=>(0,O.jsxs)(`div`,{className:`w-[85vw] sm:w-80 flex-shrink-0 text-center`,children:[(0,O.jsx)(`span`,{className:`font-mono text-xs sm:text-sm font-semibold tracking-wider text-primary/90 uppercase`,children:e.title}),(0,O.jsxs)(`span`,{className:`ml-2 font-mono text-xs text-muted-foreground`,children:[`(`,e.cards.length,`)`]})]},e.id))}),N.map(e=>{let t=y.has(e),r=E.reduce((t,n)=>t+n.cards.filter(t=>(t[p]==null?A:String(t[p]))===e).length,0);return(0,O.jsxs)(`div`,{className:`border rounded-lg bg-muted/10`,children:[(0,O.jsxs)(`button`,{className:`w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-muted/30 transition-colors`,onClick:()=>F(e),"aria-expanded":!t,children:[(0,O.jsx)(`span`,{className:k(`transition-transform text-xs`,t?``:`rotate-90`),children:`▶`}),(0,O.jsx)(`span`,{className:`font-mono text-xs font-semibold text-muted-foreground uppercase tracking-wider`,children:e}),(0,O.jsxs)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:[`(`,r,`)`]})]}),!t&&(0,O.jsx)(`div`,{className:`flex gap-3 sm:gap-4 overflow-x-auto px-2 pb-3 pl-36 sm:pl-44`,children:E.map(t=>{let r=t.cards.filter(t=>(t[p]==null?A:String(t[p]))===e);return(0,O.jsx)(`div`,{className:`w-[85vw] sm:w-80 flex-shrink-0 min-h-[60px] rounded-md bg-card/20 p-2`,children:(0,O.jsx)(c,{items:r.map(e=>e.id),strategy:m,children:(0,O.jsx)(`div`,{className:`space-y-2`,role:`list`,"aria-label":`${t.title} - ${e} cards`,children:r.map(e=>(0,O.jsx)(M,{card:e,onCardClick:n,conditionalFormatting:d},e.id))})})},t.id)})})]},e)})]}):(0,O.jsx)(`div`,{className:k(`flex gap-3 sm:gap-4 overflow-x-auto snap-x snap-mandatory p-2 sm:p-4 bg-muted/10 rounded-lg [-webkit-overflow-scrolling:touch] min-w-0`,r),role:`region`,"aria-label":`Kanban board`,children:E.map(e=>(0,O.jsx)(P,{column:e,cards:e.cards,onCardClick:n,quickAdd:a,onQuickAdd:o,conditionalFormatting:d},e.id))}),(0,O.jsx)(S,{children:(0,O.jsx)(`div`,{"aria-live":`assertive`,"aria-label":h?`Dragging ${h.title}`:void 0,children:h?(0,O.jsx)(M,{card:h,conditionalFormatting:d}):null})})]})}export{I as default};
@@ -1 +0,0 @@
1
- import"./rolldown-runtime-S-ySWqyJ.js";import{U as e,W as t}from"./framework-BW6KsEI0.js";import{a as n,i as r,o as i,s as a}from"./index-DATdOX6r.js";var o=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`],s={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...o,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...o],h2:[[`className`,`sr-only`]],img:[...o,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...o,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...o],table:[...o],ul:[...o,[`className`,`contains-task-list`]],"*":`abbr.accept.acceptCharset.accessKey.action.align.alt.axis.border.cellPadding.cellSpacing.char.charOff.charSet.checked.clear.colSpan.color.cols.compact.coords.dateTime.dir.encType.frame.hSpace.headers.height.hrefLang.htmlFor.id.isMap.itemProp.label.lang.maxLength.media.method.multiple.name.noHref.noShade.noWrap.open.prompt.readOnly.rev.rowSpan.rows.rules.scope.selected.shape.size.span.start.summary.tabIndex.title.useMap.vAlign.value.width`.split(`.`)},clobber:[`ariaDescribedBy`,`ariaLabelledBy`,`id`,`name`],clobberPrefix:`user-content-`,protocols:{cite:[`http`,`https`],href:[`http`,`https`,`irc`,`ircs`,`mailto`,`xmpp`],longDesc:[`http`,`https`],src:[`http`,`https`]},required:{input:{disabled:!0,type:`checkbox`}},strip:[`script`],tagNames:`a.b.blockquote.br.code.dd.del.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.li.ol.p.picture.pre.q.rp.rt.ruby.s.samp.section.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.tt.ul.var`.split(`.`)},c={}.hasOwnProperty;function l(e,t){let n={type:`root`,children:[]},r=u({schema:t?{...s,...t}:s,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function u(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return d(e,n);case`doctype`:return f(e,n);case`element`:return p(e,n);case`root`:return m(e,n);case`text`:return h(e,n);default:}}}function d(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return S(r,t),r}}function f(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return S(e,t),e}}function p(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=g(e,t.children),i=_(e,t.properties);e.stack.pop();let a=!1;if(n&&n!==`*`&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&c.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(a=!1;++r<t.length;)e.stack.includes(t[r])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let o={type:`element`,tagName:n,properties:i,children:r};return S(o,t),o}function m(e,t){let n={type:`root`,children:g(e,t.children)};return S(n,t),n}function h(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return S(n,t),n}function g(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=u(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function _(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&c.call(r,n)?r[n]:void 0,o=r&&c.call(r,`*`)?r[`*`]:void 0,s=t&&typeof t==`object`?t:{},l={},u;for(u in s)if(c.call(s,u)){let t=s[u],n=v(e,C(a,u),u,t);n??=v(e,C(o,u),u,t),n!=null&&(l[u]=n)}if(i&&c.call(i,n)){let e=i[n];for(u in e)c.call(e,u)&&!c.call(l,u)&&(l[u]=e[u])}return l}function v(e,t,n,r){return t?Array.isArray(r)?y(e,t,n,r):b(e,t,n,r):void 0}function y(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=b(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function b(e,t,n,r){if(!(typeof r!=`boolean`&&typeof r!=`number`&&typeof r!=`string`)&&x(e,n,r)){if(typeof t==`object`&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let i=t[n];if(i&&typeof i==`object`&&`flags`in i){if(i.test(String(r))){e=!0;break}}else if(i===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function x(e,t,n){let r=e.schema.protocols&&c.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;let i=String(n),a=i.indexOf(`:`),o=i.indexOf(`?`),s=i.indexOf(`#`),l=i.indexOf(`/`);if(a<0||l>-1&&a>l||o>-1&&a>o||s>-1&&a>s)return!0;let u=-1;for(;++u<r.length;){let e=r[u];if(a===e.length&&i.slice(0,e.length)===e)return!0}return!1}function S(e,t){let n=a(t);t.data&&(e.data=i(t.data)),n&&(e.position=n)}function C(e,t){let n,r=-1;if(e)for(;++r<e.length;){let i=e[r],a=typeof i==`string`?i:i[0];if(a===t)return i;a===`data*`&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()===`data`)return n}function w(e){return function(t){return l(t,e)}}t();var T=e();function E({content:e,className:t}){return(0,T.jsx)(`div`,{"data-slot":`markdown`,className:((...e)=>e.filter(Boolean).join(` `))(`prose prose-sm dark:prose-invert max-w-none`,`prose-headings:font-semibold prose-headings:tracking-tight`,`prose-h1:text-3xl prose-h2:text-2xl prose-h3:text-xl`,`prose-p:leading-relaxed prose-p:text-foreground`,`prose-a:text-primary prose-a:no-underline hover:prose-a:underline`,`prose-code:text-foreground prose-code:bg-muted prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-code:before:content-none prose-code:after:content-none`,`prose-pre:bg-muted prose-pre:text-foreground prose-pre:border`,`prose-blockquote:border-l-primary prose-blockquote:text-muted-foreground`,`prose-strong:text-foreground prose-strong:font-semibold`,`prose-ul:list-disc prose-ol:list-decimal`,`prose-li:text-foreground prose-li:marker:text-muted-foreground`,`prose-table:border prose-th:border prose-th:bg-muted prose-td:border`,`prose-img:rounded-md prose-img:border`,t),children:(0,T.jsx)(n,{remarkPlugins:[r],rehypePlugins:[w],disallowedElements:[`script`,`style`,`iframe`,`object`,`embed`],unwrapDisallowed:!0,children:e})})}export{E as default};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{O as t,U as n,W as r,m as i}from"./framework-BW6KsEI0.js";import{Hi as a,Ka as o,Or as s,Vr as c,cr as l,dr as u,eo as d,fr as f,lr as p,mr as m,xi as h}from"./plugins-core-Ccvbi6db.js";import{d as g,p as _}from"./ui-layout-CYz0tyDf.js";import{c as v}from"./infrastructure-94fpO8jL.js";import{r as y}from"./index-DATdOX6r.js";import{i as b,n as x,t as S}from"./getIcon-N5xWCMJy.js";import{t as C}from"./MetadataFormDialog-Cy7k0Y55.js";var w=e(r(),1),T=n(),E=class extends w.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(`[MetadataDetailPage] Schema rendering error:`,e,t.componentStack)}render(){return this.state.hasError?(0,T.jsxs)(`div`,{className:`rounded-lg border border-destructive/50 bg-destructive/5 p-6 text-center`,"data-testid":`schema-render-error`,children:[(0,T.jsx)(c,{className:`h-8 w-8 mx-auto mb-3 text-destructive`}),(0,T.jsxs)(`p`,{className:`text-sm font-medium text-destructive`,children:[`Failed to render `,this.props.fallbackLabel||`detail`,` page`]}),(0,T.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:this.state.error?.message||`An unexpected error occurred.`})]}):this.props.children}};function D({schema:e}){let n=e.body||[];return n.length===0?null:(0,T.jsx)(`div`,{className:`flex flex-col gap-6`,"data-testid":`schema-detail-content`,children:n.map((e,n)=>(0,T.jsx)(t,{schema:e},e?.id||n))})}function O(){let e=g(),{appName:t,metadataType:n,itemName:r}=_(),c=t?`/apps/${t}`:``,O=y(),{refresh:k}=i(),{user:A}=v(),j=A?.role===`admin`,M=n?b(n):void 0,[N,P]=(0,w.useState)(null),[F,I]=(0,w.useState)(!0),[L,R]=(0,w.useState)(!1),[z,B]=(0,w.useState)(!1),V=(0,w.useCallback)(async()=>{if(!(!O||!n||!r)){I(!0);try{P((await O.getItems(n)).find(e=>String(e.name)===r&&!e._deleted)??null)}catch{d.error(`Failed to load ${M?.label??n}`)}finally{I(!1)}}},[O,n,r,M?.label]);(0,w.useEffect)(()=>{V()},[V]);let H=(0,w.useCallback)(async e=>{if(!(!O||!n||!r)){B(!0);try{let t={...N,...e};await O.saveMetadataItem(n,r,t),await k(),await V(),d.success(`${M?.label??`Item`} "${r}" updated`)}catch{throw d.error(`Failed to update "${r}"`),Error(`Failed to save ${M?.label??`item`} "${r}"`)}finally{B(!1)}}},[O,n,r,N,M?.label,k,V]),U=M?.customRoute?`${c}${M.customRoute}`:`${c}/system/metadata/${n??``}`;if(!M)return(0,T.jsx)(`div`,{className:`flex flex-col gap-4 p-4 sm:p-6`,"data-testid":`metadata-detail-page`,children:(0,T.jsxs)(`div`,{className:`text-center text-muted-foreground py-12`,children:[(0,T.jsxs)(`p`,{className:`text-lg font-medium`,children:[`Unknown metadata type: `,n]}),(0,T.jsx)(s,{variant:`outline`,className:`mt-4`,onClick:()=>e(`${c}/system`),children:`Back to System Settings`})]})});if(M.pageSchemaFactory){let t=M.pageSchemaFactory(r,N),n=S(M.icon);return(0,T.jsxs)(`div`,{className:`flex flex-col gap-4 p-4 sm:p-6`,"data-testid":`metadata-detail-page`,children:[(0,T.jsx)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-3`,children:(0,T.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,T.jsx)(s,{variant:`ghost`,size:`icon`,onClick:()=>e(U),"data-testid":`back-to-list-btn`,children:(0,T.jsx)(o,{className:`h-4 w-4`})}),(0,T.jsx)(`div`,{className:`bg-primary/10 p-2 rounded-md shrink-0`,children:(0,T.jsx)(n,{className:`h-5 w-5 text-primary`})}),(0,T.jsxs)(`div`,{className:`min-w-0`,children:[(0,T.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:t.title||r}),(0,T.jsxs)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:[M.label,` · `,(0,T.jsx)(`span`,{className:`font-mono text-xs`,children:r})]})]})]})}),(0,T.jsx)(E,{fallbackLabel:M.label,children:(0,T.jsx)(D,{schema:t})})]})}let W=S(M.icon),G=M.editable!==!1&&j,K=M.formFields??x,q=M.detailComponent;return(0,T.jsxs)(`div`,{className:`flex flex-col gap-4 p-4 sm:p-6`,"data-testid":`metadata-detail-page`,children:[(0,T.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-3`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,T.jsx)(s,{variant:`ghost`,size:`icon`,onClick:()=>e(U),"data-testid":`back-to-list-btn`,children:(0,T.jsx)(o,{className:`h-4 w-4`})}),(0,T.jsx)(`div`,{className:`bg-primary/10 p-2 rounded-md shrink-0`,children:(0,T.jsx)(W,{className:`h-5 w-5 text-primary`})}),(0,T.jsxs)(`div`,{className:`min-w-0`,children:[(0,T.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:F?`Loading...`:String(N?.label??N?.name??r)}),(0,T.jsxs)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:[M.label,` Details`]})]})]}),G&&!F&&N&&(0,T.jsxs)(s,{variant:`outline`,onClick:()=>R(!0),disabled:z,"data-testid":`detail-edit-btn`,children:[(0,T.jsx)(h,{className:`mr-2 h-4 w-4`}),`Edit`]})]}),F&&(0,T.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,role:`status`,"aria-live":`polite`,"data-testid":`detail-loading`,children:[(0,T.jsx)(a,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),`Loading...`]}),!F&&!N&&(0,T.jsxs)(`div`,{className:`text-center text-muted-foreground py-12`,"data-testid":`detail-not-found`,children:[(0,T.jsxs)(`p`,{className:`text-lg font-medium`,children:[M.label,` "`,r,`" not found.`]}),(0,T.jsxs)(s,{variant:`outline`,className:`mt-4`,onClick:()=>e(U),children:[`Back to `,M.pluralLabel]})]}),!F&&N&&(0,T.jsx)(T.Fragment,{children:q?(0,T.jsx)(q,{item:N}):(0,T.jsxs)(l,{"data-testid":`detail-card`,children:[(0,T.jsx)(u,{children:(0,T.jsxs)(f,{className:`flex items-center gap-2`,children:[(0,T.jsx)(m,{variant:`secondary`,children:M.label}),String(N.name??``)]})}),(0,T.jsx)(p,{children:(0,T.jsx)(`dl`,{className:`grid gap-3 sm:grid-cols-2`,children:K.map(e=>(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{className:`text-sm font-medium text-muted-foreground`,children:e.label}),(0,T.jsx)(`dd`,{className:`mt-1 text-sm`,children:String(N[e.key]??`—`)})]},e.key))})})]})}),G&&N&&(0,T.jsx)(C,{open:L,onOpenChange:R,mode:`edit`,typeLabel:M.label,formFields:M.formFields,initialValues:N,onSubmit:H})]})}export{O as MetadataDetailPage};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{U as t,W as n}from"./framework-BW6KsEI0.js";import{An as r,Dn as i,Dt as a,En as o,Hi as s,On as c,Or as l,St as u,Tn as d,kn as f,ln as p,un as m}from"./plugins-core-Ccvbi6db.js";import{n as h}from"./getIcon-N5xWCMJy.js";var g=e(n(),1),_=t();function v({open:e,onOpenChange:t,mode:n,typeLabel:v,formFields:y,initialValues:b,onSubmit:x}){let S=y??h,C=n===`edit`,[w,T]=(0,g.useState)({}),[E,D]=(0,g.useState)(!1);(0,g.useEffect)(()=>{if(e){let e={};for(let t of S)e[t.key]=String(b?.[t.key]??``);T(e)}},[e,b,S]);let O=(0,g.useCallback)((e,t)=>{T(n=>({...n,[e]:t}))},[]),k=(0,g.useCallback)(async()=>{D(!0);try{await x(w),t(!1)}catch{}finally{D(!1)}},[w,x,t]),A=S.filter(e=>e.required).every(e=>(w[e.key]??``).trim().length>0);return(0,_.jsx)(d,{open:e,onOpenChange:t,children:(0,_.jsxs)(o,{className:`sm:max-w-[480px]`,"data-testid":`metadata-form-dialog`,children:[(0,_.jsxs)(f,{children:[(0,_.jsx)(r,{children:C?`Edit ${v}`:`New ${v}`}),(0,_.jsx)(i,{children:C?`Update the ${v.toLowerCase()} details below.`:`Fill in the details to create a new ${v.toLowerCase()}.`})]}),(0,_.jsx)(`div`,{className:`space-y-4 py-4`,children:S.map(e=>{let t=E||C&&e.disabledOnEdit===!0,n=w[e.key]??``,r=`metadata-field-${e.key}`;return(0,_.jsxs)(`div`,{className:`space-y-2`,children:[(0,_.jsxs)(m,{htmlFor:r,children:[e.label,e.required&&(0,_.jsx)(`span`,{className:`text-destructive ml-1`,"aria-hidden":`true`,children:`*`})]}),e.type===`textarea`?(0,_.jsx)(u,{id:r,value:n,onChange:t=>O(e.key,t.target.value),placeholder:e.placeholder,disabled:t,"data-testid":`metadata-field-${e.key}`}):e.type===`select`&&e.options?(0,_.jsxs)(`select`,{id:r,value:n,onChange:t=>O(e.key,t.target.value),disabled:t,"aria-required":e.required?!0:void 0,className:`flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,"data-testid":`metadata-field-${e.key}`,children:[(0,_.jsx)(`option`,{value:``,children:`Select...`}),e.options.map(e=>(0,_.jsx)(`option`,{value:e.value,children:e.label},e.value))]}):e.type===`number`?(0,_.jsx)(p,{id:r,type:`number`,value:n,onChange:t=>O(e.key,t.target.value),placeholder:e.placeholder,disabled:t,"data-testid":`metadata-field-${e.key}`}):e.type===`boolean`?(0,_.jsxs)(`div`,{className:`flex items-center gap-2 pt-1`,children:[(0,_.jsx)(a,{id:r,checked:n===`true`,onCheckedChange:t=>O(e.key,String(t)),disabled:t,"data-testid":`metadata-field-${e.key}`}),(0,_.jsx)(m,{htmlFor:r,className:`text-sm text-muted-foreground cursor-pointer`,children:n===`true`?`Yes`:`No`})]}):(0,_.jsx)(p,{id:r,value:n,onChange:t=>O(e.key,t.target.value),placeholder:e.placeholder,disabled:t,"data-testid":`metadata-field-${e.key}`})]},e.key)})}),(0,_.jsxs)(c,{children:[(0,_.jsx)(l,{variant:`outline`,onClick:()=>t(!1),disabled:E,"data-testid":`metadata-form-cancel-btn`,children:`Cancel`}),(0,_.jsxs)(l,{onClick:k,disabled:E||!A,"data-testid":`metadata-form-submit-btn`,children:[E&&(0,_.jsx)(s,{className:`mr-2 h-4 w-4 animate-spin`}),C?`Save`:`Create`]})]})]})})}export{v as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{P as t,U as n,W as r}from"./framework-BW6KsEI0.js";import{Or as i}from"./plugins-core-Ccvbi6db.js";import{$ as a,Q as o,U as s,W as c,Z as l}from"./vendor-icons-CrSf7tAH.js";var u=e(r(),1),d=n();function f({open:e,onToggle:t,className:n}){return(0,d.jsxs)(i,{size:`sm`,variant:e?`secondary`:`outline`,onClick:t,className:`shadow-none gap-2 ${n||``}`,title:`Toggle Metadata Inspector`,children:[(0,d.jsx)(c,{className:`h-4 w-4`}),(0,d.jsx)(`span`,{className:`hidden lg:inline`,children:`Metadata`})]})}function p({sections:e,open:t}){if(!t)return null;let[n,r]=(0,u.useState)([`0`]),[i,c]=(0,u.useState)(null),f=async(e,t)=>{try{await navigator.clipboard.writeText(JSON.stringify(e,null,2)),c(t),setTimeout(()=>c(null),2e3)}catch(e){console.error(`Failed to copy:`,e)}},p=e=>{r(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])};return(0,d.jsxs)(`div`,{className:`w-80 border-l bg-background p-0 overflow-hidden flex flex-col shrink-0 z-20 transition-all`,children:[(0,d.jsxs)(`div`,{className:`px-4 py-3 border-b bg-muted/5 flex items-center justify-between`,children:[(0,d.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Metadata Inspector`}),(0,d.jsx)(`span`,{className:`text-[10px] text-muted-foreground/60`,children:`JSON`})]}),(0,d.jsx)(`div`,{className:`flex-1 overflow-auto`,children:e.map((e,t)=>{let r=String(t),c=n.includes(r),u=i===t;return(0,d.jsxs)(`div`,{className:`border-b last:border-b-0`,children:[(0,d.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 hover:bg-muted/5 transition-colors`,children:[(0,d.jsxs)(`button`,{onClick:()=>p(r),className:`flex-1 flex items-center justify-between text-left`,children:[(0,d.jsx)(`h4`,{className:`text-xs font-semibold text-foreground`,children:e.title}),c?(0,d.jsx)(o,{className:`h-3 w-3 text-muted-foreground ml-2`}):(0,d.jsx)(l,{className:`h-3 w-3 text-muted-foreground ml-2`})]}),(0,d.jsx)(`button`,{onClick:()=>f(e.data,t),className:`p-1 hover:bg-muted rounded transition-colors ml-2`,title:`Copy JSON`,children:u?(0,d.jsx)(a,{className:`h-3 w-3 text-green-600`}):(0,d.jsx)(s,{className:`h-3 w-3 text-muted-foreground`})})]}),c&&(0,d.jsx)(`div`,{className:`px-4 pb-4`,children:(0,d.jsx)(`div`,{className:`relative rounded-md border border-border/50 bg-muted/5 overflow-hidden`,children:(0,d.jsx)(`pre`,{className:`text-[11px] leading-relaxed p-3 overflow-auto max-h-96 font-mono text-foreground/90`,children:JSON.stringify(e.data,null,2)})})})]},t)})})]})}function m(){let[e,n]=(0,u.useState)((0,u.useMemo)(()=>{try{return typeof window<`u`?t(window.location.search).enabled:!1}catch{return!1}},[]));return{showDebug:e,toggleDebug:()=>n(e=>!e)}}export{f as n,m as r,p as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{U as t,W as n,m as r}from"./framework-BW6KsEI0.js";import{Hi as i,Ka as a,Or as o,Ur as s,cr as c,eo as l,gi as u,li as d,ln as f,lr as p,mr as m,xi as h}from"./plugins-core-Ccvbi6db.js";import{d as ee,p as te}from"./ui-layout-CYz0tyDf.js";import{c as ne}from"./infrastructure-94fpO8jL.js";import{r as re}from"./index-DATdOX6r.js";import{i as g,t as _}from"./getIcon-N5xWCMJy.js";import{t as ie}from"./MetadataFormDialog-Cy7k0Y55.js";var v=e(n(),1),y=t();function ae({items:e,columns:t,editable:n=!1,saving:r=!1,deletingName:i=null,typeLabel:a=`item`,rowActions:c=[],onItemClick:l,onEdit:u,onDelete:d}){return(0,y.jsx)(`div`,{className:`rounded-lg border bg-card`,"data-testid":`metadata-grid`,children:(0,y.jsx)(`div`,{className:`overflow-x-auto`,children:(0,y.jsxs)(`table`,{className:`w-full text-sm`,"aria-label":`${a} list`,children:[(0,y.jsx)(`thead`,{children:(0,y.jsxs)(`tr`,{className:`border-b bg-muted/50`,children:[t.map(e=>(0,y.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-muted-foreground`,style:e.width?{width:e.width}:void 0,children:e.label},e.key)),n&&(0,y.jsx)(`th`,{className:`px-4 py-3 text-right font-medium text-muted-foreground w-24`,children:`Actions`})]})}),(0,y.jsx)(`tbody`,{children:e.map(e=>{let f=String(e.name??``);return(0,y.jsxs)(`tr`,{className:`border-b last:border-0 hover:bg-accent/50 cursor-pointer transition-colors`,"data-testid":`metadata-item-${f}`,onClick:()=>l?.(f),children:[t.map(t=>{let n=String(e[t.key]??`—`);return(0,y.jsx)(`td`,{className:`px-4 py-3 truncate max-w-[200px]`,title:n,children:n},t.key)}),n&&(0,y.jsx)(`td`,{className:`px-4 py-3 text-right`,children:(0,y.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,children:[c.map(t=>(0,y.jsx)(o,{variant:t.variant??`ghost`,size:`icon`,title:t.label,"aria-label":t.label,onClick:n=>{n.stopPropagation(),t.handler?.(e)},"data-testid":`row-action-${t.key}-${f}`,children:(0,y.jsx)(`span`,{className:`text-xs`,children:t.label.charAt(0)})},t.key)),(0,y.jsx)(o,{variant:`ghost`,size:`icon`,title:`Edit ${a}`,onClick:t=>{t.stopPropagation(),u?.(e)},disabled:r,"data-testid":`edit-${f}-btn`,children:(0,y.jsx)(h,{className:`h-4 w-4`})}),(0,y.jsx)(o,{variant:`ghost`,size:`icon`,title:i===f?`Click again to confirm`:`Delete ${a}`,onClick:e=>{e.stopPropagation(),d?.(f)},disabled:r,"data-testid":`delete-${f}-btn`,children:(0,y.jsx)(s,{className:`h-4 w-4 ${i===f?`text-destructive`:``}`})})]})})]},f)})})]})})})}function b(){let e=ee(),{appName:t,metadataType:n}=te(),b=t?`/apps/${t}`:``,x=re(),{refresh:S}=r(),{user:C}=ne(),w=C?.role===`admin`,T=n?g(n):void 0,[E,D]=(0,v.useState)([]),[O,k]=(0,v.useState)(!0),[A,j]=(0,v.useState)(``),[M,N]=(0,v.useState)(!1),[P,F]=(0,v.useState)(null),[oe,I]=(0,v.useState)(!1),[L,R]=(0,v.useState)(`create`),[z,B]=(0,v.useState)(null),V=(0,v.useCallback)(async()=>{if(!(!x||!n)){k(!0);try{D((await x.getItems(n)).filter(e=>!e._deleted))}catch{l.error(`Failed to load ${T?.pluralLabel??n}`)}finally{k(!1)}}},[x,n,T?.pluralLabel]);(0,v.useEffect)(()=>{V()},[V]);let H=(0,v.useMemo)(()=>{if(!A.trim())return E;let e=A.toLowerCase();return E.filter(t=>{let n=String(t.name??``).toLowerCase(),r=String(t.label??``).toLowerCase();return n.includes(e)||r.includes(e)})},[E,A]),U=(0,v.useCallback)(async e=>{if(!(!x||!n))if(P===e){N(!0);try{await x.deleteMetadataItem(n,e),D(t=>t.filter(t=>t.name!==e)),await S(),l.success(`${T?.label??`Item`} "${e}" deleted`)}catch{l.error(`Failed to delete "${e}"`)}finally{N(!1),F(null)}}else F(e)},[x,n,P,T?.label,S]),W=(0,v.useCallback)(()=>{B(null),R(`create`),I(!0)},[]),G=(0,v.useCallback)(e=>{B(e),R(`edit`),I(!0)},[]),K=(0,v.useCallback)(async e=>{if(!x||!n)return;let t=e.name??String(z?.name??``);if(t){N(!0);try{let r=L===`edit`?{...z,...e}:{...e};await x.saveMetadataItem(n,t,r),await S(),await V(),l.success(L===`edit`?`${T?.label??`Item`} "${t}" updated`:`${T?.label??`Item`} "${t}" created`)}catch{throw l.error(L===`edit`?`Failed to update "${t}"`:`Failed to create "${t}"`),Error(`Failed to save ${T?.label??`item`} "${t}"`)}finally{N(!1)}}},[x,n,z,L,T?.label,S,V]);if(!T)return(0,y.jsx)(`div`,{className:`flex flex-col gap-4 p-4 sm:p-6`,"data-testid":`metadata-manager-page`,children:(0,y.jsxs)(`div`,{className:`text-center text-muted-foreground py-12`,children:[(0,y.jsxs)(`p`,{className:`text-lg font-medium`,children:[`Unknown metadata type: `,n]}),(0,y.jsx)(o,{variant:`outline`,className:`mt-4`,onClick:()=>e(`${b}/system`),children:`Back to System Settings`})]})});let q=_(T.icon),J=T.editable!==!1&&w,Y=T.listComponent;if(Y)return(0,y.jsxs)(`div`,{className:`flex flex-col gap-4 p-4 sm:p-6`,"data-testid":`metadata-manager-page`,children:[(0,y.jsx)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-3`,children:(0,y.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,y.jsx)(o,{variant:`ghost`,size:`icon`,onClick:()=>e(`${b}/system`),"data-testid":`back-to-hub-btn`,children:(0,y.jsx)(a,{className:`h-4 w-4`})}),(0,y.jsx)(`div`,{className:`bg-primary/10 p-2 rounded-md shrink-0`,children:(0,y.jsx)(q,{className:`h-5 w-5 text-primary`})}),(0,y.jsxs)(`div`,{className:`min-w-0`,children:[(0,y.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:T.pluralLabel}),(0,y.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:T.description})]})]})}),(0,y.jsx)(Y,{config:T,basePath:b,metadataType:n,isAdmin:w})]});let X=(T.actions??[]).filter(e=>e.scope===`page`),Z=(T.actions??[]).filter(e=>e.scope===`row`),Q=T.listMode??`card`,$=Q===`grid`||Q===`table`,se=T.columns??[{key:`name`,label:`Name`},{key:`label`,label:`Label`}];return(0,y.jsxs)(`div`,{className:`flex flex-col gap-4 p-4 sm:p-6`,"data-testid":`metadata-manager-page`,children:[(0,y.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-3`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,y.jsx)(o,{variant:`ghost`,size:`icon`,onClick:()=>e(`${b}/system`),"data-testid":`back-to-hub-btn`,children:(0,y.jsx)(a,{className:`h-4 w-4`})}),(0,y.jsx)(`div`,{className:`bg-primary/10 p-2 rounded-md shrink-0`,children:(0,y.jsx)(q,{className:`h-5 w-5 text-primary`})}),(0,y.jsxs)(`div`,{className:`min-w-0`,children:[(0,y.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:T.pluralLabel}),(0,y.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:T.description})]})]}),J&&(0,y.jsxs)(o,{onClick:W,"data-testid":`create-metadata-btn`,children:[(0,y.jsx)(u,{className:`mr-2 h-4 w-4`}),`New `,T.label]}),X.length>0&&(0,y.jsx)(`div`,{className:`flex items-center gap-2`,children:X.map(e=>(0,y.jsx)(o,{variant:e.variant??`outline`,onClick:()=>e.handler?.(),"data-testid":`page-action-${e.key}`,children:e.label},e.key))})]}),(0,y.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-start sm:items-center gap-2`,children:[(0,y.jsxs)(`div`,{className:`relative flex-1 max-w-sm`,children:[(0,y.jsxs)(`label`,{htmlFor:`metadata-search`,className:`sr-only`,children:[`Search `,T.pluralLabel.toLowerCase()]}),(0,y.jsx)(d,{className:`pointer-events-none absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground`,"aria-hidden":`true`}),(0,y.jsx)(f,{id:`metadata-search`,placeholder:`Search ${T.pluralLabel.toLowerCase()}...`,value:A,onChange:e=>j(e.target.value),className:`pl-8`,"data-testid":`metadata-search-input`})]}),(0,y.jsxs)(m,{variant:`secondary`,"data-testid":`metadata-count-badge`,children:[H.length,` `,T.pluralLabel.toLowerCase()]})]}),O&&(0,y.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,role:`status`,"aria-live":`polite`,"data-testid":`metadata-loading`,children:[(0,y.jsx)(i,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),`Loading `,T.pluralLabel.toLowerCase(),`...`]}),M&&(0,y.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,role:`status`,"aria-live":`polite`,"data-testid":`metadata-saving`,children:[(0,y.jsx)(i,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),`Saving...`]}),!O&&H.length===0&&(0,y.jsx)(`div`,{className:`text-center text-muted-foreground py-12`,"data-testid":`metadata-empty`,children:(0,y.jsxs)(`p`,{children:[`No `,T.pluralLabel.toLowerCase(),` found.`]})}),!O&&H.length>0&&!$&&(0,y.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:H.map(t=>{let r=String(t.name??``),i=String(t.label??t.name??``),a=String(t.description??``);return(0,y.jsx)(c,{className:`transition-colors hover:bg-accent/50 cursor-pointer`,"data-testid":`metadata-item-${r}`,onClick:()=>e(`${b}/system/metadata/${n}/${r}`),children:(0,y.jsxs)(p,{className:`flex items-center justify-between p-4`,children:[(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsx)(`p`,{className:`font-medium truncate`,children:i}),(0,y.jsx)(`p`,{className:`text-xs text-muted-foreground truncate`,children:r}),a&&(0,y.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1 truncate`,children:a})]}),J&&(0,y.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0 ml-2`,children:[Z.map(e=>(0,y.jsx)(o,{variant:e.variant??`ghost`,size:`icon`,title:e.label,onClick:n=>{n.stopPropagation(),e.handler?.(t)},"data-testid":`row-action-${e.key}-${r}`,children:(0,y.jsx)(`span`,{className:`text-xs`,children:e.label.charAt(0)})},e.key)),(0,y.jsx)(o,{variant:`ghost`,size:`icon`,title:`Edit ${T.label.toLowerCase()}`,onClick:e=>{e.stopPropagation(),G(t)},disabled:M,"data-testid":`edit-${r}-btn`,children:(0,y.jsx)(h,{className:`h-4 w-4`})}),(0,y.jsx)(o,{variant:`ghost`,size:`icon`,title:P===r?`Click again to confirm`:`Delete ${T.label.toLowerCase()}`,onClick:e=>{e.stopPropagation(),U(r)},disabled:M,"data-testid":`delete-${r}-btn`,children:(0,y.jsx)(s,{className:`h-4 w-4 ${P===r?`text-destructive`:``}`})})]})]})},r)})}),!O&&H.length>0&&$&&(0,y.jsx)(ae,{items:H,columns:se,editable:J,saving:M,deletingName:P,typeLabel:T.label.toLowerCase(),rowActions:Z,onItemClick:t=>e(`${b}/system/metadata/${n}/${t}`),onEdit:G,onDelete:U}),J&&(0,y.jsx)(ie,{open:oe,onOpenChange:I,mode:L,typeLabel:T.label,formFields:T.formFields,initialValues:z??void 0,onSubmit:K})]})}export{b as MetadataManagerPage};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{U as t,W as n,f as r}from"./framework-BW6KsEI0.js";var i=e(n(),1),a=t(),o=300*1e3,s=[`app`],c={apps:`app`,objects:`object`,dashboards:`dashboard`,reports:`report`,pages:`page`},l=`objectui:metadata:`;function u(){try{let e=import.meta;if(e&&e.env&&typeof e.env.MODE==`string`)return e.env.MODE!==`production`}catch{}return!1}var d=u();function f(...e){d&&console.debug(`[MetadataProvider]`,...e)}function p(e){return e&&typeof e==`object`&&`items`in e&&Array.isArray(e.items)?e.items:[]}function m(e){return e==null?null:typeof e==`object`&&`item`in e?e.item??null:e}function h(e){return!!e&&typeof e==`object`&&`name`in e&&typeof e.name==`string`}function g(){return{status:`idle`,items:[],byName:new Map,error:null,fetchedAt:0,promise:null}}function _(e){if(typeof sessionStorage>`u`)return null;try{let t=sessionStorage.getItem(l+e);if(!t)return null;let n=JSON.parse(t);return Array.isArray(n)?n:null}catch{return null}}function v(e,t){if(!(typeof sessionStorage>`u`))try{sessionStorage.setItem(l+e,JSON.stringify(t))}catch{}}function y({children:e,adapter:t,ttlMs:n=o}){let l=(0,i.useRef)(new Map),u=(0,i.useRef)(new Map),d=(0,i.useRef)(t);d.current=t;let[y,b]=(0,i.useState)(0),x=(0,i.useCallback)(()=>{typeof queueMicrotask==`function`?queueMicrotask(()=>b(e=>e+1)):Promise.resolve().then(()=>b(e=>e+1))},[]),S=(0,i.useCallback)(e=>{let t=l.current.get(e);return t||(t=g(),l.current.set(e,t)),t},[]),C=(0,i.useCallback)(e=>{let t=S(e);if(t.promise)return t.promise;if(t.status===`ready`&&Date.now()-t.fetchedAt<n)return f(`cache hit (fresh) type=${e} items=${t.items.length}`),Promise.resolve(t.items);let r=Date.now();t.status=`loading`,t.error=null;let i=d.current.getClient().meta.getItems(e).then(n=>{let i=p(n);t.items=i,t.status=`ready`,t.error=null,t.fetchedAt=Date.now(),t.promise=null,t.byName.clear();for(let e of i)h(e)&&t.byName.set(e.name,e);return e===`app`&&v(e,i),f(`fetched type=${e} items=${i.length} in ${Date.now()-r}ms`),x(),i}).catch(n=>{let r=n instanceof Error?n:Error(String(n));return t.status=`error`,t.error=r,t.promise=null,f(`fetch failed type=${e}`,r),x(),[]});return t.promise=i,i},[x,S,n]),w=(0,i.useCallback)((e,t)=>{let n=S(e);if(n.byName.has(t))return f(`item cache hit type=${e} name=${t}`),Promise.resolve(n.byName.get(t)??null);let r=u.current.get(e);r||(r=new Map,u.current.set(e,r));let i=r.get(t);if(i)return i;let a=Date.now(),o=d.current.getClient().meta.getItem(e,t).then(i=>{let o=m(i);return o&&n.byName.set(t,o),f(`fetched item type=${e} name=${t} in ${Date.now()-a}ms`),r.delete(t),o}).catch(n=>(r.delete(t),f(`fetch item failed type=${e} name=${t}`,n),null));return r.set(t,o),o},[S]),T=(0,i.useCallback)(async e=>{if(e){let t=S(e);t.fetchedAt=0,t.byName.clear(),await C(e);return}let t=Array.from(l.current.keys()).filter(e=>l.current.get(e).status!==`idle`);await Promise.all(t.map(e=>{let t=l.current.get(e);return t.fetchedAt=0,t.byName.clear(),C(e)}))},[C,S]),E=(0,i.useCallback)((e,t)=>{let n=l.current.get(e);n&&(t?(n.byName.delete(t),n.items=n.items.filter(e=>e?.name!==t),f(`invalidated type=${e} name=${t}`)):(n.status=`idle`,n.items=[],n.byName.clear(),n.error=null,n.fetchedAt=0,f(`invalidated type=${e}`)),x())},[x]),[D,O]=(0,i.useState)(!0),[k,A]=(0,i.useState)(null);(0,i.useEffect)(()=>{let e=!1,t=_(`app`);if(t){let e=S(`app`);e.items=t,e.status=`ready`,e.fetchedAt=0;for(let n of t)h(n)&&e.byName.set(n.name,n);x(),O(!1)}return(async()=>{for(let t of s)try{await C(t),e||A(null)}catch(t){e||A(t instanceof Error?t:Error(String(t)))}e||O(!1)})(),()=>{e=!0}},[t,C,S,x]);let j=(0,i.useMemo)(()=>{let e=e=>{let t=S(e);return t.status===`idle`&&C(e),t.items};return{apps:S(`app`).items,get objects(){return e(c.objects)},get dashboards(){return e(c.dashboards)},get reports(){return e(c.reports)},get pages(){return e(c.pages)},loading:D,error:k??S(`app`).error,refresh:T,invalidate:E,ensureType:C,getItem:w,getItemsByType:t=>e(t)}},[y,D,k,C,w,S,T,E]);return(0,a.jsx)(r.Provider,{value:j,children:e})}export{y as t};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/src-BGoL_8qF.js","assets/rolldown-runtime-S-ySWqyJ.js","assets/plugins-core-Ccvbi6db.js","assets/data-adapter-v22lWuhc.js","assets/infrastructure-94fpO8jL.js","assets/framework-BW6KsEI0.js","assets/plugins-core-B5ROGaJH.css","assets/ui-layout-CYz0tyDf.js"])))=>i.map(i=>d[i]);
2
- import{n as e,r as t}from"./rolldown-runtime-S-ySWqyJ.js";import{O as n,U as r,W as i,m as a,p as o}from"./framework-BW6KsEI0.js";import{Jt as s,Xt as c,Yt as l,Zt as u,eo as d,gt as f,ht as p,mt as m,qt as h}from"./plugins-core-Ccvbi6db.js";import{C as g}from"./data-adapter-v22lWuhc.js";import{m as _,p as v}from"./ui-layout-CYz0tyDf.js";import"./AdapterProvider-Cd4HYb7q.js";import"./MetadataProvider-Dvc9BxbC.js";import{B as y,w as b}from"./vendor-icons-CrSf7tAH.js";import{r as x,t as S}from"./MetadataInspector-DVtCDQtx.js";var C=t(i(),1),w=r();function T({open:e,onOpenChange:t,title:n,description:r,schema:i,onSchemaChange:a,collection:f,recordName:p,children:m}){let g=o(),_=(0,C.useRef)(i);_.current=i;let v=(0,C.useCallback)(async e=>{try{if(g)return await g.update(f,p,e),!0}catch(e){console.warn(`[DesignDrawer] Auto-save failed:`,e)}return!1},[g,f,p]),y=(0,C.useCallback)(async e=>{a(e),await v(e)},[a,v]);return(0,C.useEffect)(()=>{if(!e)return;let t=e=>{(e.ctrlKey||e.metaKey)&&e.key===`s`&&(e.preventDefault(),v(_.current).then(e=>{e&&d.success(`${n} saved`)}))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,v,n]),(0,w.jsx)(h,{open:e,onOpenChange:t,modal:!1,children:(0,w.jsxs)(s,{side:`right`,hideOverlay:!0,className:`w-full sm:w-[540px] sm:max-w-[540px] lg:w-[640px] lg:max-w-[640px] p-0 flex flex-col`,"data-testid":`design-drawer`,children:[(0,w.jsxs)(c,{className:`px-4 py-3 border-b shrink-0`,children:[(0,w.jsx)(u,{children:n}),(0,w.jsx)(l,{className:r?``:`sr-only`,children:r||`Visual editor — configure and preview ${n}`})]}),(0,w.jsx)(`div`,{className:`flex-1 overflow-auto p-4`,children:m(i,y)})]})})}var E=e({PageView:()=>O}),D=(0,C.lazy)(()=>g(()=>import(`./src-BGoL_8qF.js`).then(e=>e.t).then(e=>({default:e.PageCanvasEditor})),__vite__mapDeps([0,1,2,3,4,5,6,7])));function O(){let{pageName:e}=v(),[t]=_(),{showDebug:r}=x(),[i,o]=(0,C.useState)(!1),{pages:s}=a(),c=s?.find(t=>t.name===e),[l,u]=(0,C.useState)(null),d=(0,C.useCallback)(()=>{u(c),o(!0)},[c]),h=(0,C.useCallback)(e=>{o(e)},[]);if(!c)return(0,w.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,children:(0,w.jsxs)(m,{children:[(0,w.jsx)(`div`,{className:`mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted`,children:(0,w.jsx)(y,{className:`h-6 w-6 text-muted-foreground`})}),(0,w.jsx)(f,{children:`Page Not Found`}),(0,w.jsxs)(p,{children:[`The page "`,e,`" could not be found. It may have been removed or renamed.`]})]})});let g=Object.fromEntries(t.entries()),E=i&&l?l:c;return(0,w.jsxs)(`div`,{className:`flex flex-row h-full w-full overflow-hidden relative`,children:[(0,w.jsxs)(`div`,{className:`flex-1 overflow-auto h-full relative group`,children:[(0,w.jsx)(`div`,{className:`absolute top-1.5 sm:top-2 right-1.5 sm:right-2 z-50 flex items-center gap-1.5 transition-opacity ${r?`opacity-100`:`opacity-0 group-hover:opacity-100`}`,children:(0,w.jsxs)(`button`,{type:`button`,onClick:d,className:`inline-flex items-center gap-1.5 rounded-md border border-input bg-background px-2.5 py-1.5 text-xs font-medium text-muted-foreground shadow-sm hover:bg-accent hover:text-accent-foreground`,"data-testid":`page-edit-button`,children:[(0,w.jsx)(b,{className:`h-3.5 w-3.5`}),`Edit`]})}),(0,w.jsx)(n,{schema:{...E,type:E.type||`page`,context:{...E.context,params:g}}})]}),(0,w.jsx)(S,{open:r,sections:[{title:`Page Configuration`,data:E}]}),(0,w.jsx)(T,{open:i,onOpenChange:h,title:`Edit Page: ${c.label||c.title||e}`,schema:l||c,onSchemaChange:u,collection:`sys_page`,recordName:e,children:(e,t)=>(0,w.jsx)(C.Suspense,{fallback:(0,w.jsx)(`div`,{className:`p-4 text-muted-foreground`,children:`Loading editor…`}),children:(0,w.jsx)(D,{schema:e,onChange:t})})})]})}export{E as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{U as t,W as n}from"./framework-BW6KsEI0.js";import{Ea as r,Lr as i,Or as a,Ta as o,Vi as s,_r as c,cr as l,dr as u,fr as d,gr as f,hr as p,ln as m,lr as h,mr as g,un as _,ur as v,vr as y,yr as b}from"./plugins-core-Ccvbi6db.js";import{c as x,r as S}from"./infrastructure-94fpO8jL.js";var C=e(n(),1),w=t();function T(){let{user:e,updateUser:t,isLoading:n}=x(),[T,E]=(0,C.useState)(e?.name??``),[D,O]=(0,C.useState)(!1),[k,A]=(0,C.useState)(null);return e?(0,w.jsxs)(`div`,{className:`flex flex-col gap-4 sm:gap-6 p-4 sm:p-6 max-w-2xl`,children:[(0,w.jsxs)(`div`,{className:`min-w-0`,children:[(0,w.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:`Profile`}),(0,w.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Manage your account settings`})]}),(0,w.jsx)(l,{children:(0,w.jsx)(h,{className:`pt-6`,children:(0,w.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,w.jsxs)(p,{className:`h-16 w-16`,children:[(0,w.jsx)(c,{src:e.image??void 0,alt:e.name??`User`}),(0,w.jsx)(f,{className:`text-lg bg-primary text-primary-foreground`,children:S(e)})]}),(0,w.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,w.jsx)(`p`,{className:`text-lg font-semibold truncate`,children:e.name??`User`}),(0,w.jsx)(`p`,{className:`text-sm text-muted-foreground truncate`,children:e.email}),(0,w.jsx)(g,{variant:`secondary`,className:`mt-1`,children:e.role??`member`})]})]})})}),(0,w.jsxs)(l,{children:[(0,w.jsxs)(u,{children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(i,{className:`h-4 w-4 text-muted-foreground`}),(0,w.jsx)(d,{className:`text-base sm:text-lg`,children:`Personal Information`})]}),(0,w.jsx)(v,{children:`Update your name and view account details`})]}),(0,w.jsx)(h,{children:(0,w.jsxs)(`form`,{onSubmit:async e=>{e.preventDefault(),A(null),O(!1);try{await t({name:T}),O(!0)}catch(e){A(e instanceof Error?e.message:String(e))}},className:`space-y-4`,children:[k&&(0,w.jsxs)(y,{variant:`destructive`,children:[(0,w.jsx)(r,{className:`h-4 w-4`}),(0,w.jsx)(b,{children:k})]}),D&&(0,w.jsxs)(y,{children:[(0,w.jsx)(o,{className:`h-4 w-4 text-green-600`}),(0,w.jsx)(b,{className:`text-green-800 dark:text-green-400`,children:`Profile updated successfully.`})]}),(0,w.jsxs)(`div`,{className:`space-y-2`,children:[(0,w.jsx)(_,{htmlFor:`profile-name`,children:`Name`}),(0,w.jsx)(m,{id:`profile-name`,type:`text`,value:T,onChange:e=>E(e.target.value),required:!0,"aria-required":`true`,disabled:n})]}),(0,w.jsxs)(`div`,{className:`space-y-2`,children:[(0,w.jsx)(_,{htmlFor:`profile-email`,children:`Email`}),(0,w.jsx)(m,{id:`profile-email`,type:`email`,value:e.email,disabled:!0,className:`bg-muted text-muted-foreground`}),(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Email cannot be changed.`})]}),(0,w.jsxs)(`div`,{className:`space-y-2`,children:[(0,w.jsx)(_,{children:`Role`}),(0,w.jsx)(m,{type:`text`,value:e.role??`member`,disabled:!0,className:`bg-muted text-muted-foreground`})]}),(0,w.jsx)(a,{type:`submit`,disabled:n,className:`w-full sm:w-auto`,children:n?`Saving...`:`Save Changes`})]})})]}),(0,w.jsx)(l,{children:(0,w.jsxs)(u,{children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(s,{className:`h-4 w-4 text-muted-foreground`}),(0,w.jsx)(d,{className:`text-base sm:text-lg`,children:`Change Password`})]}),(0,w.jsx)(v,{children:`To change your password, use the password reset flow from the login page.`})]})})]}):null}export{T as ProfilePage};
@@ -1 +0,0 @@
1
- import{n as e,r as t}from"./rolldown-runtime-S-ySWqyJ.js";import{U as n,W as r,_ as i,a}from"./framework-BW6KsEI0.js";import{An as o,Cr as s,Dn as c,Dr as l,En as u,Er as d,On as f,Or as p,Sr as m,St as h,Tn as g,Tr as _,br as v,en as y,eo as b,gt as x,ht as S,in as C,kn as w,ln as T,mt as E,nn as D,rn as O,tn as k,un as A,wr as j,xr as M}from"./plugins-core-Ccvbi6db.js";import{d as ee,p as te}from"./ui-layout-CYz0tyDf.js";import{c as ne,u as re}from"./infrastructure-94fpO8jL.js";import{H as ie,a as ae}from"./vendor-icons-CrSf7tAH.js";import{o as oe,s as se}from"./plugins-views-CbLIJkBs.js";import{r as ce,t as N}from"./MetadataInspector-DVtCDQtx.js";import{t as P}from"./skeletons-CIQE_YYE.js";var F=t(r(),1),I=n(),L=(0,F.createContext)(void 0);function R({children:e}){let[t,n]=(0,F.useState)(`home`),[r,i]=(0,F.useState)(),[a,o]=(0,F.useState)(),s=(0,F.useMemo)(()=>({context:t,setContext:n,currentAppName:r,setCurrentAppName:i,recordTitle:a,setRecordTitle:o}),[t,r,a]);return(0,I.jsx)(L.Provider,{value:s,children:e})}function z(){return(0,F.useContext)(L)||{context:`app`,setContext:()=>{},currentAppName:void 0,setCurrentAppName:()=>{},recordTitle:void 0,setRecordTitle:()=>{}}}function le(e){let{setRecordTitle:t}=z();(0,F.useEffect)(()=>(t(e),()=>t(void 0)),[e,t])}function B(e){let{url:t,channel:n,autoReconnect:r=!0,reconnectInterval:i=1e3,maxReconnectAttempts:a=10,authToken:o}=e,[s,c]=(0,F.useState)(`disconnected`),[l,u]=(0,F.useState)(null),[d,f]=(0,F.useState)([]),[p,m]=(0,F.useState)(null),h=(0,F.useRef)(null),g=(0,F.useRef)(0),_=(0,F.useRef)(null),v=(0,F.useRef)(new Map),y=(0,F.useRef)([]),b=(0,F.useRef)(!0),x=(0,F.useRef)(!1),S=(0,F.useCallback)(()=>{_.current!==null&&(clearTimeout(_.current),_.current=null)},[]),C=(0,F.useCallback)(e=>{for(;y.current.length>0;){let t=y.current.shift(),r={type:t.type,channel:n,data:t.data,timestamp:new Date().toISOString()};e.send(JSON.stringify(r))}},[n]),w=(0,F.useCallback)(()=>{if(typeof WebSocket>`u`){m(Error(`WebSocket is not available in this environment`)),c(`error`);return}if(!t){m(Error(`WebSocket URL is required`)),c(`error`);return}try{let e=new URL(t);if(e.protocol!==`ws:`&&e.protocol!==`wss:`){m(Error(`WebSocket URL must use ws: or wss: protocol`)),c(`error`);return}}catch{m(Error(`Invalid WebSocket URL`)),c(`error`);return}h.current&&=(x.current=!0,h.current.close(),null),x.current=!1,c(`connecting`),m(null);let e=o?`${t}?token=${encodeURIComponent(o)}&channel=${encodeURIComponent(n)}`:`${t}?channel=${encodeURIComponent(n)}`,s;try{s=new WebSocket(e)}catch(e){if(!b.current)return;m(e instanceof Error?e:Error(`Failed to create WebSocket connection`)),c(`error`);return}h.current=s,s.onopen=()=>{b.current&&(c(`connected`),m(null),g.current=0,C(s))},s.onmessage=e=>{if(b.current)try{let t=JSON.parse(String(e.data));if(t.channel!==n)return;u(t),f(e=>[...e,t]);let r=v.current.get(t.type);r&&r.forEach(e=>e(t.data))}catch{}},s.onerror=()=>{b.current&&(m(Error(`WebSocket connection error`)),c(`error`))},s.onclose=()=>{if(b.current){if(h.current=null,x.current){c(`disconnected`);return}if(r&&g.current<a){c(`reconnecting`);let e=Math.min(i*2**g.current,3e4);g.current+=1,_.current=setTimeout(()=>{b.current&&w()},e)}else c(`disconnected`)}}},[t,n,o,r,i,a,C]),T=(0,F.useCallback)(()=>{S(),x.current=!0,g.current=0,h.current&&=(h.current.close(),null),c(`disconnected`)},[S]),E=(0,F.useCallback)(()=>{S(),g.current=0,w()},[w,S]),D=(0,F.useCallback)((e,t)=>{let r=h.current;if(r&&r.readyState===WebSocket.OPEN){let i={type:e,channel:n,data:t,timestamp:new Date().toISOString()};r.send(JSON.stringify(i))}else y.current.push({type:e,data:t})},[n]),O=(0,F.useCallback)((e,t)=>(v.current.has(e)||v.current.set(e,new Set),v.current.get(e).add(t),()=>{let n=v.current.get(e);n&&(n.delete(t),n.size===0&&v.current.delete(e))}),[]);return(0,F.useEffect)(()=>(b.current=!0,t&&w(),()=>{b.current=!1,S(),x.current=!0,h.current&&=(h.current.close(),null)}),[t,n,o]),{connectionState:s,isConnected:s===`connected`,lastMessage:l,messages:d,send:D,subscribe:O,disconnect:T,reconnect:E,error:p}}var V=0;function H(){return V+=1,`conflict-${Date.now()}-${V}`}var U=0;function W(){return U+=1,`ver-${Date.now()}-${U}`}function G(e,t,n){let[r,i]=(0,F.useState)([]),[a,o]=(0,F.useState)([]);return{versions:r,currentVersion:(0,F.useMemo)(()=>r.length===0?0:r[r.length-1].version,[r]),conflicts:a,hasConflicts:a.length>0,recordVersion:(0,F.useCallback)((n,r)=>{i(i=>{let a=i.length===0?1:i[i.length-1].version+1,o={id:W(),version:a,timestamp:new Date().toISOString(),userId:e,userName:t,changes:n,message:r};return[...i,o]})},[e,t]),resolveConflict:(0,F.useCallback)((n,r,a)=>{o(o=>{let s=o.find(e=>e.id===n);if(!s)return o;let c;switch(r){case`local`:c=s.localValue;break;case`remote`:c=s.remoteValue;break;case`merge`:c=a??s.localValue;break}return i(n=>{let i=n.length===0?1:n[n.length-1].version+1,a={id:W(),version:i,timestamp:new Date().toISOString(),userId:e,userName:t,changes:{[s.field]:{before:s.baseValue,after:c}},message:`Resolved conflict on "${s.field}" using ${r} strategy`};return[...n,a]}),o.filter(e=>e.id!==n)})},[e,t]),resolveAllConflicts:(0,F.useCallback)(n=>{o(r=>{if(r.length===0)return r;let a={};for(let e of r)a[e.field]={before:e.baseValue,after:n===`local`?e.localValue:e.remoteValue};return i(r=>{let i=r.length===0?1:r[r.length-1].version+1,o={id:W(),version:i,timestamp:new Date().toISOString(),userId:e,userName:t,changes:a,message:`Resolved all conflicts using ${n} strategy`};return[...r,o]}),[]})},[e,t]),revertToVersion:(0,F.useCallback)(n=>{let a=r.findIndex(e=>e.id===n);if(a===-1)return null;let o={};for(let e=0;e<=a;e++){let t=r[e];for(let[e,n]of Object.entries(t.changes))o[e]=n.after}let s={},c={};for(let e of r)for(let[t,n]of Object.entries(e.changes))c[t]=n.after;for(let[e,t]of Object.entries(o))c[e]!==t&&(s[e]={before:c[e],after:t});return Object.keys(s).length>0&&i(n=>{let i=n.length===0?1:n[n.length-1].version+1,o={id:W(),version:i,timestamp:new Date().toISOString(),userId:e,userName:t,changes:s,message:`Reverted to version ${r[a].version}`};return[...n,o]}),o},[r,e,t]),compareVersions:(0,F.useCallback)((e,t)=>{let n=r.findIndex(t=>t.id===e),i=r.findIndex(e=>e.id===t);if(n===-1||i===-1)return null;let[a,o]=n<i?[n,i]:[i,n],s=e=>{let t={};for(let n=0;n<=e;n++)for(let[e,i]of Object.entries(r[n].changes))t[e]=i.after;return t},c=s(a),l=s(o),u=new Set([...Object.keys(c),...Object.keys(l)]),d={};for(let e of u){let t=c[e],n=l[e];t!==n&&(d[e]={before:t,after:n})}return d},[r]),addConflict:(0,F.useCallback)(e=>{let t={...e,id:H()};o(e=>[...e,t])},[]),clearHistory:(0,F.useCallback)(()=>{i([]),o([])},[])}}var K={sm:24,md:32,lg:40},q={active:`#22c55e`,idle:`#f59e0b`,away:`#94a3b8`};function J(e){return e.split(` `).map(e=>e[0]).join(``).toUpperCase().slice(0,2)}function Y({users:e,maxVisible:t=5,size:n=`md`,showStatus:r=!0,className:i}){let a=K[n],o=Math.round(a*.3),s=Math.round(a*.35),c=Math.max(8,Math.round(a*.28)),l=(0,F.useMemo)(()=>e.slice(0,t),[e,t]),u=Math.max(0,e.length-t),d={display:`inline-flex`,alignItems:`center`,flexDirection:`row-reverse`,fontFamily:`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif`},f={width:`${a}px`,height:`${a}px`,borderRadius:`50%`,border:`2px solid #fff`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:`${s}px`,fontWeight:600,color:`#fff`,position:`relative`,flexShrink:0,overflow:`hidden`,boxSizing:`border-box`},p={...f,backgroundColor:`#e2e8f0`,color:`#475569`,marginLeft:`-${o}px`},m={position:`absolute`,bottom:`-1px`,right:`-1px`,width:`${c}px`,height:`${c}px`,borderRadius:`50%`,border:`2px solid #fff`,boxSizing:`border-box`},h=(0,F.useMemo)(()=>[...l].reverse(),[l]);return F.createElement(`div`,{style:d,className:i,role:`group`,"aria-label":`${e.length} user${e.length===1?``:`s`} present`},u>0&&F.createElement(`div`,{key:`overflow`,style:p,title:`${u} more user${u===1?``:`s`}`},`+${u}`),h.map((e,t)=>F.createElement(`div`,{key:e.userId,style:{...f,backgroundColor:e.color,marginLeft:t>0||u>0?`-${o}px`:`0`},title:`${e.userName} (${e.status})`},e.avatar?F.createElement(`img`,{src:e.avatar,alt:e.userName,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):J(e.userName),r&&F.createElement(`span`,{style:{...m,backgroundColor:q[e.status]}}))))}function X({state:e,onOpenChange:t}){let n=()=>{e.resolve?.(!0),t(!1)},r=()=>{e.resolve?.(!1),t(!1)};return(0,I.jsx)(v,{open:e.open,onOpenChange:e=>{e||r()},children:(0,I.jsxs)(s,{children:[(0,I.jsxs)(d,{children:[(0,I.jsx)(l,{children:e.options?.title||`Confirm Action`}),(0,I.jsx)(j,{children:e.message})]}),(0,I.jsxs)(_,{children:[(0,I.jsx)(m,{onClick:r,children:e.options?.cancelText||`Cancel`}),(0,I.jsx)(M,{onClick:n,children:e.options?.confirmText||`Continue`})]})]})})}function Z({state:e,onOpenChange:t}){let[n,r]=(0,F.useState)({}),[i,a]=(0,F.useState)({});(0,F.useEffect)(()=>{if(e.open){let t={};for(let n of e.params)n.defaultValue!==void 0&&(t[n.name]=n.defaultValue);r(t),a({})}},[e.open,e.params]);let s=e=>e==null?!0:typeof e==`string`?e.trim()===``:Array.isArray(e)?e.length===0:!1,l=()=>{let r={};for(let t of e.params)t.required&&s(n[t.name])&&(r[t.name]=!0);if(Object.keys(r).length>0){a(r);return}e.resolve?.(n),t(!1)},d=()=>{e.resolve?.(null),t(!1)},m=(e,t)=>{r(n=>({...n,[e]:t})),a(t=>({...t,[e]:!1}))};return(0,I.jsx)(g,{open:e.open,onOpenChange:e=>{e||d()},children:(0,I.jsxs)(u,{children:[(0,I.jsxs)(w,{children:[(0,I.jsx)(o,{children:`Action Parameters`}),(0,I.jsx)(c,{children:`Please provide the required information to continue.`})]}),(0,I.jsx)(`div`,{className:`grid gap-4 py-4`,children:e.params.map(e=>(0,I.jsxs)(`div`,{className:`grid gap-2`,children:[(0,I.jsxs)(A,{htmlFor:e.name,children:[e.label,e.required&&(0,I.jsx)(`span`,{className:`text-destructive ml-1`,children:`*`})]}),e.type===`select`&&e.options?(0,I.jsxs)(y,{value:n[e.name]??``,onValueChange:t=>m(e.name,t),children:[(0,I.jsx)(O,{id:e.name,className:i[e.name]?`border-destructive`:``,children:(0,I.jsx)(C,{placeholder:e.placeholder||`Select ${e.label}`})}),(0,I.jsx)(k,{children:e.options.map(e=>(0,I.jsx)(D,{value:e.value,children:e.label},e.value))})]}):e.type===`textarea`?(0,I.jsx)(h,{id:e.name,value:n[e.name]??``,onChange:t=>m(e.name,t.target.value),placeholder:e.placeholder,className:i[e.name]?`border-destructive`:``}):e.type===`number`?(0,I.jsx)(T,{id:e.name,type:`number`,value:n[e.name]??``,onChange:t=>m(e.name,t.target.value===``?void 0:t.target.valueAsNumber),placeholder:e.placeholder,className:i[e.name]?`border-destructive`:``}):(0,I.jsx)(T,{id:e.name,type:[`email`,`url`,`date`,`datetime-local`,`time`,`password`].includes(e.type)?e.type:`text`,value:n[e.name]??``,onChange:t=>m(e.name,t.target.value),placeholder:e.placeholder,className:i[e.name]?`border-destructive`:``}),i[e.name]&&(0,I.jsxs)(`p`,{className:`text-xs text-destructive`,children:[e.label,` is required`]}),e.helpText&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.helpText})]},e.name))}),(0,I.jsxs)(f,{children:[(0,I.jsx)(p,{variant:`outline`,onClick:d,children:`Cancel`}),(0,I.jsx)(p,{onClick:l,children:`Confirm`})]})]})})}var Q=e({RecordDetailView:()=>$}),ue={id:`current-user`,name:`Demo User`};function $({dataSource:e,objects:t,onEdit:n}){let{objectName:r,recordId:o}=te(),{showDebug:s}=ce(),{user:c}=ne(),l=ee(),{t:u}=a(),[d,f]=(0,F.useState)(!0),[p,m]=(0,F.useState)([]),[h,g]=(0,F.useState)([]),[_,v]=(0,F.useState)(0),[y,C]=(0,F.useState)({}),[w,T]=(0,F.useState)(),D=t.find(e=>e.name===r);le(w);let O=o,[k,A]=(0,F.useState)({open:!1,message:``}),[j,M]=(0,F.useState)({open:!1,params:[]}),L=(0,F.useCallback)((e,t)=>new Promise(n=>{A({open:!0,message:e,options:t,resolve:n})}),[]),R=(0,F.useCallback)(e=>new Promise(t=>{M({open:!0,params:e,resolve:t})}),[]),z=(0,F.useCallback)((e,t)=>{t?.type===`error`?b.error(e):b.success(e)},[]),B=(0,F.useCallback)((e,t)=>{t?.external||t?.newTab?window.open(e,`_blank`,`noopener,noreferrer`):l(e)},[l]),V=(0,F.useCallback)(async t=>{try{let n=t.target||t.name,i=t.params||{};switch(n){case`opportunity_change_stage`:await e.update(r,O,{stage:i.new_stage});break;case`opportunity_mark_won`:await e.update(r,O,{stage:`closed_won`});break;case`opportunity_mark_lost`:await e.update(r,O,{stage:`closed_lost`,loss_reason:i.loss_reason});break;default:Object.keys(i).length>0&&await e.update(r,O,i);break}let a=t.refreshAfter===!0;return a&&v(e=>e+1),{success:!0,reload:a}}catch(e){return{success:!1,error:e.message}}},[e,r,O]),H=(0,F.useMemo)(()=>re(),[]),U=(0,F.useCallback)(async e=>{let t=e.target||e.name;if(!t)return{success:!1,error:`No flow target provided for flow action`};try{let n=await H(`https://demo.objectstack.ai/api/v1/automation/${encodeURIComponent(t)}/trigger`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({recordId:O,objectName:r,params:e.params??{}})}),i=await n.json().catch(()=>null);if(!n.ok||i&&i.success===!1)return{success:!1,error:i?.error||`Flow "${t}" failed (HTTP ${n.status})`};let a=e.refreshAfter!==!1;return a&&v(e=>e+1),{success:!0,data:i?.data,reload:a}}catch(e){return{success:!1,error:e.message}}},[H,O,r]),W=(0,F.useCallback)(async e=>{let t=e.target||e.name;if(!t)return{success:!1,error:`No action target provided`};let n=e.params&&!Array.isArray(e.params)?e.params:{};try{let i=e.objectName||r||`global`,a=await H(`https://demo.objectstack.ai/api/v1/actions/${encodeURIComponent(i)}/${encodeURIComponent(t)}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({recordId:O,params:n})}),o=await a.json().catch(()=>null);if(!a.ok||o&&o.success===!1)return{success:!1,error:o?.error||`Action "${t}" failed (HTTP ${a.status})`};let s=e.refreshAfter!==!1;return s&&v(e=>e+1),{success:!0,data:o?.data,reload:s}}catch(e){return{success:!1,error:e.message}}},[H,O,r]),G=(0,F.useMemo)(()=>{if(!D||!t)return[];let e=[];for(let n of t)if(n.name!==D.name)for(let[t,r]of Object.entries(n.fields||{}))r&&(r.type===`lookup`||r.type===`master_detail`)&&(r.reference_to||r.reference)===D.name&&e.push({childObject:n.name,childLabel:n.label||n.name,referenceField:t});return e},[D,t]);(0,F.useEffect)(()=>{if(!e||!O||G.length===0)return;let t=!1;return Promise.all(G.map(({childObject:t,referenceField:n})=>e.find(t,{$filter:{[n]:O}}).then(e=>({childObject:t,items:Array.isArray(e)?e:e?.data||[]})).catch(e=>(console.warn(`[RecordDetailView] Failed to fetch related ${t}:`,e),{childObject:t,items:[]})))).then(e=>{if(t)return;let n={};for(let{childObject:t,items:r}of e)n[t]=r;C(n)}),()=>{t=!0}},[e,O,G]);let K=c?{id:c.id,name:c.name,avatar:c.image}:ue;(0,F.useEffect)(()=>{if(!e||!r||!O)return;let t=`${r}:${O}`;e.find(`sys_presence`,{$filter:{recordId:O}}).then(e=>{e.data?.length&&g(e.data)}).catch(()=>{}),e.find(`sys_comment`,{$filter:{threadId:t},$orderby:{createdAt:`asc`}}).then(e=>{e.data?.length&&m(e.data.map(e=>({id:e.id,type:`comment`,actor:e.author?.name??`Unknown`,actorAvatarUrl:e.author?.avatar,body:e.content,createdAt:e.createdAt,updatedAt:e.updatedAt,parentId:e.parentId,reactions:e.reactions?Object.entries(e.reactions).map(([e,t])=>({emoji:e,count:t.length,reacted:t.includes(K.id)})):void 0})))}).catch(()=>{})},[e,r,O,K]);let q=(0,F.useCallback)(async t=>{let n={id:crypto.randomUUID(),type:`comment`,actor:K.name,actorAvatarUrl:`avatar`in K?K.avatar:void 0,body:t,createdAt:new Date().toISOString()};if(m(e=>[...e,n]),e){let i=`${r}:${O}`;e.create(`sys_comment`,{id:n.id,threadId:i,author:K,content:t,mentions:[],createdAt:n.createdAt}).catch(()=>{})}},[K,e,r,O]),J=(0,F.useCallback)(async(t,n)=>{let i={id:crypto.randomUUID(),type:`comment`,actor:K.name,actorAvatarUrl:`avatar`in K?K.avatar:void 0,body:n,createdAt:new Date().toISOString(),parentId:t};if(m(e=>[...e,i].map(e=>e.id===t?{...e,replyCount:(e.replyCount??0)+1}:e)),e){let a=`${r}:${O}`;e.create(`sys_comment`,{id:i.id,threadId:a,author:K,content:n,mentions:[],createdAt:i.createdAt,parentId:t}).catch(()=>{})}},[K,e,r,O]),Q=(0,F.useCallback)((t,n)=>{m(r=>r.map(r=>{if(r.id!==t)return r;let i=[...r.reactions??[]],a=i.findIndex(e=>e.emoji===n);if(a>=0){let e=i[a];e.reacted?e.count<=1?i.splice(a,1):i[a]={...e,count:e.count-1,reacted:!1}:i[a]={...e,count:e.count+1,reacted:!0}}else i.push({emoji:n,count:1,reacted:!0});let o={...r,reactions:i};return e&&e.update(`sys_comment`,String(t),{$toggleReaction:{emoji:n,userId:K.id}}).catch(()=>{}),o}))},[K.id,e]);(0,F.useEffect)(()=>{f(!0),queueMicrotask(()=>f(!1))},[r,o]);let $=(0,F.useMemo)(()=>{if(!D)return{type:`detail-view`};let e=D.primaryField||Object.keys(D.fields||{}).find(e=>e===`name`||e===`title`),n=D.views?.form?.sections,r=n&&n.length>0?n.map(e=>({title:e.title,collapsible:e.collapsible,defaultCollapsed:e.defaultCollapsed,fields:(e.fields||[]).map(e=>{let t=typeof e==`string`?e:e.name,n=D.fields[t];if(!n)return console.warn(`[RecordDetailView] Field "${t}" not found in ${D.name} definition`),{name:t,label:t};let r=n.reference_to||n.reference;return{name:t,label:n.label||t,type:n.type||`text`,...n.options&&{options:n.options},...r&&{reference_to:r},...n.reference_field&&{reference_field:n.reference_field},...n.currency&&{currency:n.currency}}})})):[{showBorder:!1,fields:Object.keys(D.fields||{}).map(e=>{let t=D.fields[e],n=t.reference_to||t.reference;return{name:e,label:t.label||e,type:t.type||`text`,...t.options&&{options:t.options},...n&&{reference_to:n},...t.reference_field&&{reference_field:t.reference_field},...t.currency&&{currency:t.currency}}})}],i=(()=>{let e=new Set;return(D.actions||[]).filter(t=>t.locations?.includes(`record_header`)?t.name?e.has(t.name)?!1:(e.add(t.name),!0):!0:!1)})(),a=D.views?.detail?.highlightFields??[],o=D.views?.detail?.sectionGroups??D.views?.form?.sectionGroups,s=G.map(({childObject:e,childLabel:n,referenceField:r})=>{let i=t.find(t=>t.name===e);return{title:n,type:`table`,api:e,data:y[e]||[],referenceField:r,icon:i?.icon}});return{type:`detail-view`,objectName:D.name,resourceId:O,showBack:!0,onBack:`history`,showEdit:!0,title:D.label,primaryField:e,sections:r,autoTabs:!0,autoDiscoverRelated:!0,...s.length>0&&{related:s},...a.length>0&&{highlightFields:a},...o&&o.length>0&&{sectionGroups:o},...i.length>0&&{actions:[{type:`action:bar`,location:`record_header`,actions:i}]}}},[D?.name,O,y,_]);return d?(0,I.jsx)(P,{}):D?(0,I.jsxs)(`div`,{className:`h-full bg-background overflow-hidden flex flex-col relative`,children:[(0,I.jsx)(`div`,{className:`absolute top-2 sm:top-4 right-2 sm:right-4 z-50 flex items-center gap-2`,children:h.length>0&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,title:`Users viewing this record`,children:[(0,I.jsx)(ae,{className:`h-3.5 w-3.5 text-muted-foreground`}),(0,I.jsx)(Y,{users:h,size:`sm`,maxVisible:4,showStatus:!0})]})}),(0,I.jsxs)(`div`,{className:`flex-1 overflow-hidden flex flex-row`,children:[(0,I.jsx)(`div`,{className:`flex-1 overflow-auto p-3 sm:p-4 lg:p-6 scroll-pb-48`,children:(0,I.jsx)(i,{context:{record:{},objectName:r,user:K},onConfirm:L,onToast:z,onNavigate:B,onParamCollection:R,handlers:{api:V,flow:U,script:W,modal:W},children:(0,I.jsx)(se,{schema:$,dataSource:e,objectLabel:D.label,onDataLoaded:e=>{if(!e||typeof e!=`object`)return;let t=$.primaryField,n=[t&&e[t],e.name,e.title,e.label,e.subject].find(e=>typeof e==`string`&&e.trim().length>0);n&&n!==w&&T(n)},onEdit:()=>{n({id:O})},discussionSlot:(0,I.jsx)(oe,{config:{position:`bottom`,collapsible:!1,feed:{enableReactions:!0,enableThreading:!0,showCommentInput:!0}},items:p,onAddComment:q,onAddReply:J,onToggleReaction:Q})},_)})}),(0,I.jsx)(N,{open:s,sections:[{title:`View Schema`,data:$}]})]}),(0,I.jsx)(X,{state:k,onOpenChange:e=>{e||A(e=>({...e,open:!1}))}}),(0,I.jsx)(Z,{state:j,onOpenChange:e=>{e||M(e=>({...e,open:!1}))}})]}):(0,I.jsx)(`div`,{className:`flex h-full items-center justify-center p-4`,children:(0,I.jsxs)(E,{children:[(0,I.jsx)(`div`,{className:`mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted`,children:(0,I.jsx)(ie,{className:`h-6 w-6 text-muted-foreground`})}),(0,I.jsx)(x,{children:`Object Not Found`}),(0,I.jsxs)(S,{children:[`Object "`,r,`" definition missing. Check your configuration or navigate back to select a valid object.`]})]})})}export{G as a,z as c,Y as i,Z as n,B as o,X as r,R as s,Q as t};