@baasix/baasix 0.1.61 → 0.1.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/404/index.html +1 -1
- package/dist/app/404.html +1 -1
- package/dist/app/_next/static/chunks/2667-7993936698bf75a9.js +1 -0
- package/dist/app/_next/static/chunks/3233-ae028c73c510ebea.js +1 -0
- package/dist/app/_next/static/chunks/4033-ea89dd457b87cead.js +1 -0
- package/dist/app/_next/static/chunks/799-d4372ad380b0dec6.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/all-activity/{page-a7e9f0b39624b489.js → page-8e1f084e807ff5ee.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/email-log/{page-40f2b9ecf73e74b5.js → page-4e08df2865fe9d0f.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/notifications/{page-21fcdd2f0b3549db.js → page-3a5070a5088835ae.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/sessions/{page-82662735f1ec476a.js → page-edfa379cab0d3ccb.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/workflow-executions/{page-4a781c95e5fb25f0.js → page-d007890f17b60862.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/workflow-logs/{page-70bf8d31074dcba0.js → page-976e9829706ac8f2.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/dashboard/page-6bff6e8911fc5036.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/data-browser/{page-d5715b9743d8dba4.js → page-fbb7a4d4f2a4353d.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/file-manager/{page-c008de2bcf6811b9.js → page-cea6a2c1670d4ef5.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/layout-b7f18737e4c308a4.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/migrations/page-505c3389890685b9.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/permissions/{page-2d3043500adcdb12.js → page-ed80f4bd5d81df95.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/project/{page-6a58f15efb013e17.js → page-310b8ce72d0516ea.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/roles/{page-00cf3e4483986407.js → page-fd62dc19ac88dd64.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/schema/page-3d91124704c2e853.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/schema-diff/page-cae8772a7ae93b9a.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/tasks/{page-fa3c401992a2fb8f.js → page-1479604bbfc53a83.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/templates/edit/{page-4ce715d527c717a8.js → page-a611195661ce22bd.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/templates/{page-aafbfd4f12875738.js → page-6787b62a4960304f.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/tenants/{page-f34d97ce6f68183b.js → page-856d4af5fbd76c8e.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/users/invites/{page-20dd05a8745b6283.js → page-ed5493d55f6c1db8.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/users/list/{page-479a164304f4de3f.js → page-02e6ef533bdc3bbc.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/users/{page-909d7be1b8d9800c.js → page-faf321b61a6fdeef.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/users/preferences/{page-e3fbcc425e1710e5.js → page-2116015e962a2ecc.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/users/user-roles/{page-3f654c69d79269f7.js → page-7d1bcbbfc8f0694b.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/workflows/edit/{page-753cf274fd329860.js → page-45c465caaa5679bd.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/workflows/{page-33c1c69678122839.js → page-7f9cb24aaa798f42.js} +1 -1
- package/dist/app/_next/static/chunks/{main-324e91f5a430cddf.js → main-8ffa7219a08e42cf.js} +1 -1
- package/dist/app/_next/static/chunks/{webpack-b29732cfe967a5f5.js → webpack-7a100cbf9402e7ea.js} +1 -1
- package/dist/app/_next/static/css/45276c37be155f45.css +3 -0
- package/dist/app/activity-log/all-activity/index.html +1 -1
- package/dist/app/activity-log/all-activity/index.txt +3 -3
- package/dist/app/activity-log/email-log/index.html +1 -1
- package/dist/app/activity-log/email-log/index.txt +3 -3
- package/dist/app/activity-log/index.html +1 -1
- package/dist/app/activity-log/index.txt +2 -2
- package/dist/app/activity-log/notifications/index.html +1 -1
- package/dist/app/activity-log/notifications/index.txt +3 -3
- package/dist/app/activity-log/sessions/index.html +1 -1
- package/dist/app/activity-log/sessions/index.txt +3 -3
- package/dist/app/activity-log/workflow-executions/index.html +1 -1
- package/dist/app/activity-log/workflow-executions/index.txt +3 -3
- package/dist/app/activity-log/workflow-logs/index.html +1 -1
- package/dist/app/activity-log/workflow-logs/index.txt +3 -3
- package/dist/app/change-password/index.html +1 -1
- package/dist/app/change-password/index.txt +2 -2
- package/dist/app/dashboard/index.html +1 -1
- package/dist/app/dashboard/index.txt +3 -3
- package/dist/app/data-browser/index.html +1 -1
- package/dist/app/data-browser/index.txt +3 -3
- package/dist/app/file-manager/index.html +1 -1
- package/dist/app/file-manager/index.txt +3 -3
- package/dist/app/forgot-password/index.html +1 -1
- package/dist/app/forgot-password/index.txt +1 -1
- package/dist/app/index.html +1 -1
- package/dist/app/index.txt +1 -1
- package/dist/app/login/index.html +1 -1
- package/dist/app/login/index.txt +1 -1
- package/dist/app/register/index.html +1 -1
- package/dist/app/register/index.txt +1 -1
- package/dist/app/settings/migrations/index.html +1 -1
- package/dist/app/settings/migrations/index.txt +3 -3
- package/dist/app/settings/permissions/index.html +1 -1
- package/dist/app/settings/permissions/index.txt +3 -3
- package/dist/app/settings/project/index.html +1 -1
- package/dist/app/settings/project/index.txt +3 -3
- package/dist/app/settings/roles/index.html +1 -1
- package/dist/app/settings/roles/index.txt +3 -3
- package/dist/app/settings/schema/index.html +1 -1
- package/dist/app/settings/schema/index.txt +3 -3
- package/dist/app/settings/schema-diff/index.html +1 -0
- package/dist/app/settings/schema-diff/index.txt +14 -0
- package/dist/app/settings/tasks/index.html +1 -1
- package/dist/app/settings/tasks/index.txt +3 -3
- package/dist/app/settings/templates/edit/index.html +1 -1
- package/dist/app/settings/templates/edit/index.txt +3 -3
- package/dist/app/settings/templates/index.html +1 -1
- package/dist/app/settings/templates/index.txt +3 -3
- package/dist/app/settings/tenants/index.html +1 -1
- package/dist/app/settings/tenants/index.txt +3 -3
- package/dist/app/users/index.html +1 -1
- package/dist/app/users/index.txt +3 -3
- package/dist/app/users/invites/index.html +1 -1
- package/dist/app/users/invites/index.txt +3 -3
- package/dist/app/users/list/index.html +1 -1
- package/dist/app/users/list/index.txt +3 -3
- package/dist/app/users/preferences/index.html +1 -1
- package/dist/app/users/preferences/index.txt +3 -3
- package/dist/app/users/user-roles/index.html +1 -1
- package/dist/app/users/user-roles/index.txt +3 -3
- package/dist/app/workflows/detail/index.html +1 -1
- package/dist/app/workflows/detail/index.txt +2 -2
- package/dist/app/workflows/edit/index.html +1 -1
- package/dist/app/workflows/edit/index.txt +3 -3
- package/dist/app/workflows/execution/index.html +1 -1
- package/dist/app/workflows/execution/index.txt +2 -2
- package/dist/app/workflows/index.html +1 -1
- package/dist/app/workflows/index.txt +3 -3
- package/dist/routes/mcp.route.d.ts.map +1 -1
- package/dist/routes/mcp.route.js +283 -2
- package/dist/routes/mcp.route.js.map +1 -1
- package/dist/routes/schema-diff.route.d.ts +7 -0
- package/dist/routes/schema-diff.route.d.ts.map +1 -0
- package/dist/routes/schema-diff.route.js +320 -0
- package/dist/routes/schema-diff.route.js.map +1 -0
- package/dist/services/ItemsService.d.ts +5 -4
- package/dist/services/ItemsService.d.ts.map +1 -1
- package/dist/services/ItemsService.js +30 -26
- package/dist/services/ItemsService.js.map +1 -1
- package/package.json +1 -1
- package/dist/app/_next/static/chunks/2033-8355304f13887db5.js +0 -1
- package/dist/app/_next/static/chunks/4952-1b97320cf61f3f21.js +0 -1
- package/dist/app/_next/static/chunks/6547-1aaab011e6089042.js +0 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/dashboard/page-1ceeac9e72997a8a.js +0 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/layout-2a4b221af5cbbade.js +0 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/migrations/page-6681c14dd478cc9a.js +0 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/schema/page-e7f836d3a7f7c5d0.js +0 -1
- package/dist/app/_next/static/css/17a2e01c4184b106.css +0 -3
- /package/dist/app/_next/static/{ORfvBD2VaKIB_8_7O9AgQ → O6PA41CeUjDJQ4sma7vMH}/_buildManifest.js +0 -0
- /package/dist/app/_next/static/{ORfvBD2VaKIB_8_7O9AgQ → O6PA41CeUjDJQ4sma7vMH}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2033],{79622:function(e,t,a){a.d(t,{OF:function(){return W},o_:function(){return F},Zl:function(){return eK},XG:function(){return eo},mq:function(){return Z},sU:function(){return em}});var s=a(57437),r=a(2265),l=a(40279),n=a(71096),i=a.n(n),o=a(45721),c=a.n(o),d=a(13257),u=a.n(d);i().extend(c()),i().extend(u());let m=function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null==e)return"";if(Array.isArray(e)){if("count"===t)return e.length.toString();if("list"===t){let t=a.separator||", ",s=a.limit,r=(s?e.slice(0,s):e).map(e=>"object"==typeof e&&null!==e?e.name||e.title||e.label||e.id||JSON.stringify(e):String(e)).join(t),l=s&&e.length>s?e.length-s:0;return l>0?"".concat(r," (+").concat(l," more)"):r}return"".concat(e.length," item").concat(1!==e.length?"s":"")}switch(t){case"raw":case"badge":case"color":case"image":case"file":default:return String(e);case"email":case"url":case"phone":return e;case"truncate":let s=String(e),r=a.maxLength||50;return s.length>r?"".concat(s.substring(0,r),"..."):s;case"uppercase":return String(e).toUpperCase();case"lowercase":return String(e).toLowerCase();case"capitalize":return String(e).charAt(0).toUpperCase()+String(e).slice(1).toLowerCase();case"currency":let l=a.currency||"USD";return new Intl.NumberFormat("en-US",{style:"currency",currency:l,minimumFractionDigits:a.decimals||2,maximumFractionDigits:a.decimals||2}).format(Number(e));case"percentage":return"".concat((100*Number(e)).toFixed(a.decimals||1),"%");case"decimal":return Number(e).toFixed(a.decimals||2);case"integer":return Math.round(Number(e)).toString();case"filesize":return h(Number(e));case"date":return i()(e).format(a.format||"YYYY-MM-DD");case"datetime":let n=a.format||(a.use24Hour?"YYYY-MM-DD HH:mm":"YYYY-MM-DD h:mm A");return i()(e).format(a.showSeconds?n+":ss":n);case"time":let o=a.use24Hour?"HH:mm":"h:mm A";return i()(e).format(a.showSeconds?o+":ss":o);case"relative":return i()(e).fromNow();case"age":let c=i()().diff(i()(e),"years");return"".concat(c," year").concat(1!==c?"s":"");case"duration":let d=i().duration(Number(e),"milliseconds");if(d.asHours()>=1)return"".concat(Math.floor(d.asHours()),"h ").concat(d.minutes(),"m");if(d.asMinutes()>=1)return"".concat(Math.floor(d.asMinutes()),"m ").concat(d.seconds(),"s");return"".concat(d.seconds(),"s");case"iso":return i()(e).toISOString();case"timestamp":return i()(e).unix().toString();case"boolean":case"check":return e?"✓":"✗";case"yesno":return e?a.trueText||"Yes":a.falseText||"No";case"truefalse":return e?a.trueText||"True":a.falseText||"False";case"list":if(!Array.isArray(e))return String(e);let u=a.separator||", ",m=a.limit,x=(m?e.slice(0,m):e).join(u);return m&&e.length>m?"".concat(x,"... (+").concat(e.length-m," more)"):x;case"count":return Array.isArray(e)?e.length.toString():"0";case"json":return JSON.stringify(e,null,2)}},h=e=>{if(0===e)return"0 Bytes";let t=Math.floor(Math.log(e)/Math.log(1024));return"".concat(parseFloat((e/Math.pow(1024,t)).toFixed(2))," ").concat(["Bytes","KB","MB","GB","TB"][t])};var x=e=>{let{value:t,format:a,options:r}=e,l=m(t,a,r);switch(a){case"email":return(0,s.jsx)("a",{href:"mailto:".concat(t),className:"text-primary hover:underline",children:l});case"url":return(0,s.jsx)("a",{href:t,target:(null==r?void 0:r.target)||"_blank",rel:(null==r?void 0:r.rel)||"noopener noreferrer",className:"text-primary hover:underline",children:l});case"phone":return(0,s.jsx)("a",{href:"tel:".concat(t),className:"text-primary hover:underline",children:l});case"color":return(0,s.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,s.jsx)("span",{className:"h-4 w-4 rounded border border-border",style:{backgroundColor:t}}),(0,s.jsx)("span",{children:t})]});case"check":return(0,s.jsx)("span",{className:t?"text-green-600":"text-red-600",children:l});case"badge":return(0,s.jsx)("span",{className:"inline-flex items-center rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:l});default:return(0,s.jsx)("span",{children:l})}};let p=r.memo(e=>{let{value:t,onChange:a,placeholder:r,disabled:n,readOnly:i,maxLength:o,showCount:c,size:d,displayFormat:u,displayOptions:m}=e;return i?u&&"raw"!==u?(0,s.jsx)(x,{value:t,format:u,options:m}):(0,s.jsx)("span",{className:"text-sm",children:t||""}):(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(l.I,{value:t||"",onChange:e=>null==a?void 0:a(e.target.value),placeholder:r,disabled:n,maxLength:o,className:d?({small:"h-8 text-sm",middle:"h-10",large:"h-12 text-lg"})[d]:""}),c&&o&&(0,s.jsxs)("span",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-muted-foreground",children:[(null==t?void 0:t.length)||0,"/",o]})]})});p.displayName="TextField";let f=r.memo(e=>{let{value:t,onChange:a,placeholder:r,disabled:n,readOnly:i,size:o,min:c,max:d,step:u,precision:m}=e;if(i){let e=(null==t?void 0:t.toString())||"";return void 0!==m&&null!=t&&(e=t.toFixed(m)),(0,s.jsx)("span",{className:"text-sm",children:e})}return(0,s.jsx)(l.I,{type:"number",value:null!=t?t:"",onChange:e=>{let t=e.target.value;if(""===t)null==a||a(null);else{let e=parseFloat(t);isNaN(e)||(void 0!==m?null==a||a(parseFloat(e.toFixed(m))):null==a||a(e))}},placeholder:r,disabled:n,min:c,max:d,step:u,className:o?({small:"h-8 text-sm",middle:"h-10",large:"h-12 text-lg"})[o]:""})});f.displayName="NumberField";var g=a(94589),v=a(69174),y=e=>{let{value:t,onChange:a,disabled:r,size:l,readOnly:n}=e;return n?(0,s.jsx)(v.C,{variant:t?"default":"destructive",children:t?"Yes":"No"}):(0,s.jsx)(g.r,{checked:t||!1,onCheckedChange:a,disabled:r,className:"small"===l?"h-4 w-7":""})},j=a(12381),N=a(46291),b=a(12749),w=a(31047),C=a(60936),k=a(27107),S=a(93448),A=e=>{let{value:t,onChange:a,placeholder:r,disabled:l,readOnly:n,size:i,displayFormat:o,displayOptions:c}=e,d=t?"string"==typeof t?(0,C.D)(t):t:void 0;return n?d&&o&&"raw"!==o?(0,s.jsx)(x,{value:d,format:o,options:c}):(0,s.jsx)("span",{className:"text-sm",children:d?(0,k.WU)(d,"PPP"):""}):(0,s.jsxs)(b.J2,{children:[(0,s.jsx)(b.xo,{asChild:!0,children:(0,s.jsxs)(j.z,{variant:"outline",disabled:l,className:(0,S.cn)("w-full justify-start text-left font-normal",!d&&"text-muted-foreground",i?({small:"h-8 text-sm",middle:"h-10",large:"h-12 text-lg"})[i]:""),children:[(0,s.jsx)(w.Z,{className:"mr-2 h-4 w-4"}),d?(0,k.WU)(d,"PPP"):r||"Pick a date"]})}),(0,s.jsx)(b.yk,{className:"w-auto p-0",align:"start",children:(0,s.jsx)(N.f,{mode:"single",selected:d,onSelect:e=>null==a?void 0:a(e?e.toISOString():null),initialFocus:!0})})]})},O=e=>{let{value:t,onChange:a,placeholder:n,disabled:i,readOnly:o,size:c,displayFormat:d,displayOptions:u}=e,m=t?"string"==typeof t?(0,C.D)(t):t:void 0,[h,p]=r.useState(m?(0,k.WU)(m,"HH:mm"):"");if(r.useEffect(()=>{m&&p((0,k.WU)(m,"HH:mm"))},[t]),o)return m&&d&&"raw"!==d?(0,s.jsx)(x,{value:m,format:d,options:u}):(0,s.jsx)("span",{className:"text-sm",children:m?(0,k.WU)(m,"PPP HH:mm"):""});let f={small:"h-8 text-sm",middle:"h-10",large:"h-12 text-lg"};return(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)(b.J2,{children:[(0,s.jsx)(b.xo,{asChild:!0,children:(0,s.jsxs)(j.z,{variant:"outline",disabled:i,className:(0,S.cn)("flex-1 justify-start text-left font-normal",!m&&"text-muted-foreground",c?f[c]:""),children:[(0,s.jsx)(w.Z,{className:"mr-2 h-4 w-4"}),m?(0,k.WU)(m,"PPP"):n||"Pick a date"]})}),(0,s.jsx)(b.yk,{className:"w-auto p-0",align:"start",children:(0,s.jsx)(N.f,{mode:"single",selected:m,onSelect:e=>{if(e){let[t,s]=h.split(":").map(Number);e.setHours(t||0,s||0,0,0),null==a||a(e.toISOString())}else null==a||a(null)},initialFocus:!0})})]}),(0,s.jsx)("div",{className:"relative",children:(0,s.jsx)(l.I,{type:"time",value:h,onChange:e=>{let t=e.target.value;if(p(t),m&&t){let[e,s]=t.split(":").map(Number),r=new Date(m);r.setHours(e,s,0,0),null==a||a(r.toISOString())}},disabled:i,className:(0,S.cn)("w-32",c?f[c]:"")})})]})},z=e=>{let{value:t,onChange:a,placeholder:r,disabled:n,readOnly:i,size:o}=e;return i?(0,s.jsx)("span",{className:"text-sm",children:t||""}):(0,s.jsx)(l.I,{type:"time",value:t||"",onChange:e=>null==a?void 0:a(e.target.value||null),placeholder:r,disabled:n,className:(0,S.cn)(o?({small:"h-8 text-sm",middle:"h-10",large:"h-12 text-lg"})[o]:"")})},I=a(23675),T=a(47416),_=a(74440),L=a(74291),Z=e=>{let{value:t,onChange:a,placeholder:l,disabled:n,readOnly:i}=e,[o,c]=(0,r.useState)(""),[d,u]=(0,r.useState)(null),[m,h]=(0,r.useState)(!1);(0,r.useEffect)(()=>{try{c(t?JSON.stringify(t,null,2):""),u(null)}catch(e){c(String(t))}},[t]);let x=e=>{if(c(e),!e.trim()){null==a||a(null),u(null);return}try{let t=JSON.parse(e);null==a||a(t),u(null)}catch(e){u("Invalid JSON")}};if(i)return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"relative group",children:[(0,s.jsx)("pre",{className:"rounded bg-muted p-2 pr-7 text-xs overflow-auto max-h-32 max-w-[400px] whitespace-pre-wrap break-all",children:o||"-"}),o&&(0,s.jsx)(j.z,{type:"button",variant:"ghost",size:"sm",className:"absolute right-1 top-1 h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>h(!0),children:(0,s.jsx)(T.Z,{className:"h-3 w-3"})})]}),(0,s.jsx)(L.Vq,{open:m,onOpenChange:h,children:(0,s.jsxs)(L.cZ,{className:"max-w-3xl",children:[(0,s.jsx)(L.fK,{children:(0,s.jsx)(L.$N,{children:"View JSON"})}),(0,s.jsx)("pre",{className:"rounded bg-muted p-4 text-sm font-mono overflow-auto max-h-[60vh] whitespace-pre-wrap",children:o||"-"})]})})]});let p=(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(I.g,{value:o,onChange:e=>x(e.target.value),placeholder:l||'{"key": "value"}',disabled:n,className:"min-h-[120px] font-mono text-sm ".concat(d?"border-destructive":"")}),d&&(0,s.jsx)("p",{className:"mt-1 text-xs text-destructive",children:d}),(0,s.jsx)(j.z,{type:"button",variant:"ghost",size:"sm",className:"absolute right-1 top-1 h-6 w-6 p-0",onClick:()=>h(!m),children:m?(0,s.jsx)(_.Z,{className:"h-3 w-3"}):(0,s.jsx)(T.Z,{className:"h-3 w-3"})})]});return m?(0,s.jsx)(L.Vq,{open:m,onOpenChange:h,children:(0,s.jsxs)(L.cZ,{className:"max-w-3xl",children:[(0,s.jsx)(L.fK,{children:(0,s.jsx)(L.$N,{children:"Edit JSON"})}),(0,s.jsx)(I.g,{value:o,onChange:e=>x(e.target.value),placeholder:l||'{"key": "value"}',disabled:n,className:"min-h-[400px] font-mono text-sm ".concat(d?"border-destructive":"")}),d&&(0,s.jsx)("p",{className:"text-xs text-destructive",children:d})]})}):p},R=e=>{let{value:t,onChange:a,placeholder:r,disabled:l,readOnly:n,autoSize:i}=e;if(n)return(0,s.jsx)("div",{className:"whitespace-pre-wrap text-sm rounded bg-muted p-2",children:t||""});let o=(null==i?void 0:i.minRows)?24*i.minRows:72,c=(null==i?void 0:i.maxRows)?24*i.maxRows:200;return(0,s.jsx)(I.g,{value:t||"",onChange:e=>null==a?void 0:a(e.target.value),placeholder:r,disabled:l,style:{minHeight:o,maxHeight:c},className:"resize-y"})},E=a(24156),M=a(99397),P=a(30401),D=a(2596),F=e=>{let{value:t,onChange:a,options:l=[],disabled:n,readOnly:i,size:o,placeholder:c,allowCustom:d=!0,allowNull:u=!1}=e,[m,h]=(0,r.useState)(!1),[x,p]=(0,r.useState)("");if((0,r.useEffect)(()=>{m||p("")},[m]),i)return t?(0,s.jsx)(v.C,{variant:"secondary",children:t}):(0,s.jsx)("span",{className:"text-muted-foreground",children:"-"});let f=e=>{null==a||a(e),h(!1),p("")},g=()=>{x.trim()&&(null==a||a(x.trim()),h(!1),p(""))},y=Array.isArray(l)?l:[],N=x.trim()&&!y.some(e=>e.toLowerCase()===x.trim().toLowerCase()),w=x.trim()?y.filter(e=>e.toLowerCase().includes(x.toLowerCase())):y;return(0,s.jsxs)(b.J2,{open:m,onOpenChange:h,children:[(0,s.jsx)(b.xo,{asChild:!0,children:(0,s.jsxs)(j.z,{variant:"outline",role:"combobox","aria-expanded":m,disabled:n,className:(0,S.cn)("w-full justify-between font-normal","small"===o?"h-8 text-sm":"h-10",!t&&"text-muted-foreground"),children:[t||c||"Select an option...",(0,s.jsx)(E.Z,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,s.jsx)(b.yk,{className:"w-[--radix-popover-trigger-width] p-0",align:"start",children:(0,s.jsxs)(D.mY,{shouldFilter:!1,children:[(0,s.jsx)(D.sZ,{placeholder:"Search or type custom value...",value:x,onValueChange:p}),(0,s.jsxs)(D.e8,{children:[(0,s.jsx)(D.rb,{children:d&&x.trim()?(0,s.jsxs)("button",{onClick:g,className:"flex w-full items-center gap-2 px-2 py-1.5 text-sm hover:bg-accent rounded cursor-pointer",children:[(0,s.jsx)(M.Z,{className:"h-4 w-4"}),'Add "',x.trim(),'"']}):"No options found."}),(0,s.jsxs)(D.fu,{children:[u&&(0,s.jsxs)(D.di,{value:"",onSelect:()=>f(""),children:[(0,s.jsx)(P.Z,{className:(0,S.cn)("mr-2 h-4 w-4",""!==t&&t?"opacity-0":"opacity-100")}),(0,s.jsx)("span",{className:"text-muted-foreground italic",children:"None"})]}),w.map(e=>(0,s.jsxs)(D.di,{value:e,onSelect:()=>f(e),children:[(0,s.jsx)(P.Z,{className:(0,S.cn)("mr-2 h-4 w-4",t===e?"opacity-100":"opacity-0")}),e]},e))]}),d&&N&&w.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(D.zz,{}),(0,s.jsx)(D.fu,{children:(0,s.jsxs)(D.di,{value:"add-custom-".concat(x),onSelect:g,children:[(0,s.jsx)(M.Z,{className:"mr-2 h-4 w-4"}),'Add "',x.trim(),'"']})})]})]})]})})]})},U=a(69658),Y=a(96362),H=e=>{let{value:t,onChange:a,disabled:r,readOnly:l}=e,n=t?"string"==typeof t?t:t.url:null,i=(()=>{if(!t)return null;if("string"==typeof t){let e=t.split("/");return e[e.length-1]}return t.name||"File"})();return l?n?(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(U.Z,{className:"h-4 w-4 text-muted-foreground"}),(0,s.jsx)("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-primary hover:underline truncate max-w-[200px]",children:i}),(0,s.jsx)(j.z,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>window.open(n,"_blank"),children:(0,s.jsx)(Y.Z,{className:"h-3 w-3"})})]}):(0,s.jsx)("span",{className:"text-muted-foreground",children:"-"}):(0,s.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-input p-2",children:[(0,s.jsx)(U.Z,{className:"h-4 w-4 text-muted-foreground"}),(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:i||"No file selected"}),(0,s.jsx)(j.z,{type:"button",variant:"outline",size:"sm",disabled:r,children:"Upload"})]})},J=a(53113),B=e=>{let{value:t,onChange:a,disabled:r,readOnly:l}=e,n=t?"string"==typeof t?t:t.url:null;return l?n?(0,s.jsx)("div",{className:"relative inline-block",children:(0,s.jsx)("img",{src:n,alt:"Preview",className:"h-12 w-12 rounded object-cover border border-border",onError:e=>{e.target.src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Crect fill='%23eee' width='48' height='48'/%3E%3Ctext x='50%25' y='50%25' dominant-baseline='middle' text-anchor='middle' fill='%23999' font-size='12'%3E?%3C/text%3E%3C/svg%3E"}})}):(0,s.jsx)("span",{className:"text-muted-foreground",children:"-"}):(0,s.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-input p-2",children:[n?(0,s.jsx)("img",{src:n,alt:"Preview",className:"h-10 w-10 rounded object-cover"}):(0,s.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded bg-muted",children:(0,s.jsx)(J.Z,{className:"h-5 w-5 text-muted-foreground"})}),(0,s.jsx)("span",{className:"flex-1 text-sm text-muted-foreground truncate",children:n?"Image uploaded":"No image selected"}),(0,s.jsx)(j.z,{type:"button",variant:"outline",size:"sm",disabled:r,children:"Upload"})]})},V=e=>{let{value:t,onChange:a,disabled:r,readOnly:n}=e;return n?(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"h-6 w-6 rounded border border-border",style:{backgroundColor:t||"transparent"}}),(0,s.jsx)("span",{className:"text-sm font-mono",children:t||"-"})]}):(0,s.jsxs)(b.J2,{children:[(0,s.jsx)(b.xo,{asChild:!0,children:(0,s.jsxs)(j.z,{variant:"outline",className:"w-full justify-start gap-2",disabled:r,children:[(0,s.jsx)("div",{className:"h-4 w-4 rounded border border-border",style:{backgroundColor:t||"transparent"}}),(0,s.jsx)("span",{className:"font-mono text-sm",children:t||"Select color"})]})}),(0,s.jsx)(b.yk,{className:"w-auto p-3",children:(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(l.I,{type:"color",value:t||"#000000",onChange:e=>null==a?void 0:a(e.target.value),className:"h-10 w-full cursor-pointer"}),(0,s.jsx)(l.I,{value:t||"",onChange:e=>null==a?void 0:a(e.target.value),placeholder:"#000000",className:"font-mono"})]})})]})},G=e=>{let{value:t,onChange:a,disabled:r,readOnly:n,size:i}=e;return n?(0,s.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:t||"-"}):(0,s.jsx)(l.I,{value:t||"",onChange:e=>null==a?void 0:a(e.target.value),disabled:r,className:(0,S.cn)("font-mono",i?({small:"h-8 text-sm",middle:"h-10",large:"h-12 text-lg"})[i]:""),placeholder:"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"})},q=a(32489),W=e=>{let{value:t=[],onChange:a,itemType:n="string",disabled:i,readOnly:o,size:c,placeholder:d}=e,[u,m]=(0,r.useState)(""),h=e=>{if(null==e)return"";if("date"===n||"datetime"===n){let t=new Date(e);return isNaN(t.getTime())?String(e):"datetime"===n?t.toLocaleString():t.toLocaleDateString()}return"boolean"===n?e?"true":"false":String(e)};if(o){let e=Array.isArray(t)?t:[];return(0,s.jsxs)("div",{className:"flex flex-wrap gap-1 max-w-[250px] overflow-hidden",children:[e.length>0?e.slice(0,5).map((e,t)=>(0,s.jsx)(v.C,{variant:"secondary",className:"truncate max-w-[120px]",children:h(e)},t)):(0,s.jsx)("span",{className:"text-muted-foreground",children:"-"}),e.length>5&&(0,s.jsxs)(v.C,{variant:"outline",children:["+",e.length-5]})]})}let x=()=>{let e;if("date"===n||"datetime"===n||"time"===n){if(!u)return}else if("boolean"!==n&&!u.trim())return;switch(n){case"number":if(isNaN(e=parseFloat(u.trim())))return;break;case"boolean":e="true"===u.trim().toLowerCase();break;case"date":case"time":if(!u)return;e=u;break;case"datetime":if(!u)return;e=new Date(u).toISOString();break;default:e=u.trim()}null==a||a([...Array.isArray(t)?t:[],e]),m("")},p=e=>{let s=[...Array.isArray(t)?t:[]];s.splice(e,1),null==a||a(s)};return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.I,{type:(()=>{switch(n){case"number":return"number";case"date":return"date";case"datetime":return"datetime-local";case"time":return"time";default:return"text"}})(),value:u,onChange:e=>{m(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),x())},placeholder:(()=>{if(d)return d;switch(n){case"number":return"Enter a number";case"date":return"Select a date";case"datetime":return"Select date and time";case"time":return"Select a time";case"boolean":return"Enter true or false";default:return"Enter a value"}})(),disabled:i,className:(0,S.cn)(c?({small:"h-8 text-sm",middle:"h-10",large:"h-12 text-lg"})[c]:"")}),(0,s.jsx)(j.z,{type:"button",variant:"outline",size:"icon",onClick:()=>{x()},disabled:i||!u,className:(0,S.cn)("small"===c?"h-8 w-8":""),children:(0,s.jsx)(M.Z,{className:"h-4 w-4"})})]}),Array.isArray(t)&&t.length>0&&(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:t.map((e,t)=>(0,s.jsxs)(v.C,{variant:"secondary",className:"gap-1 pr-1",children:[h(e),(0,s.jsx)("button",{type:"button",onClick:()=>p(t),className:"ml-1 rounded-full hover:bg-muted",disabled:i,children:(0,s.jsx)(q.Z,{className:"h-3 w-3"})})]},t))})]})},K=a(71488),X=a(49322),$=e=>{let{value:t,onChange:a,field:l,disabled:n,readOnly:i,size:o,displayFormat:c,displayOptions:d}=e,u=r.useMemo(()=>{if(!t)return(null==l?void 0:l.showAs)&&(Array.isArray(l.showAs)?l.showAs.length>0:l.showAs)?null:"not-configured";if(Array.isArray(t))return{isArray:!0,items:t,field:l};if("object"==typeof t&&null!==t){if(null==l?void 0:l.showAs){if(Array.isArray(l.showAs)){let e=[" - "," ",", ","_"," & "," | "," (",") ","(",")"],a=[];l.showAs.forEach(s=>{if(e.includes(s))a.push(s);else{let e;if(s.includes(".")){let a=s.split("."),r=t;for(let e of a)if(null==(r=null==r?void 0:r[e]))break;e=r}else e=t[s];null!=e&&""!==e&&a.push(String(e))}});let s=a.filter((t,s)=>{let r=e.includes(t),l=s>0&&e.includes(a[s-1]),n=s===a.length-1;return!r||0!==s&&!n&&!l});return s.length>0?s.join(""):null}if("string"==typeof l.showAs){let e=l.showAs.split(",").map(e=>e.trim()).map(e=>t[e]).filter(Boolean);return e.length>0?e.join("-"):null}}return t.id||t.name||t.title||(Object.keys(t)[0]?t[Object.keys(t)[0]]:null)}return String(t)},[t,l]);if(i){if(u&&"object"==typeof u&&u.isArray){let{items:e,field:t}=u;if(!e||0===e.length)return(0,s.jsxs)(K.u,{children:[(0,s.jsx)(K.aJ,{children:(0,s.jsx)(v.C,{variant:"secondary",children:"Empty"})}),(0,s.jsx)(K._v,{children:"No related items"})]});let a=e.slice(0,3),r=e.length-3;return(0,s.jsxs)("div",{className:"flex flex-wrap gap-1",children:[a.map((e,a)=>{let r="";if((null==t?void 0:t.showAs)&&Array.isArray(t.showAs)){let a=[" - "," ",", ","_"," & "," | "," (",") ","(",")"],s=[];t.showAs.forEach(t=>{if(a.includes(t))s.push(t);else{let a;if(t.includes(".")){let s=t.split("."),r=e;for(let e of s)if(null==(r=null==r?void 0:r[e]))break;a=r}else a=e[t];null!=a&&""!==a&&s.push(String(a))}}),r=s.filter((e,t)=>{let r=a.includes(e),l=t>0&&a.includes(s[t-1]),n=t===s.length-1;return!r||0!==t&&!n&&!l}).join("")}else r=(null==t?void 0:t.showAs)&&"string"==typeof t.showAs?e[t.showAs]||e.name||e.title||e.id||"Item":e.name||e.title||e.id||"Item ".concat(a+1);return(0,s.jsx)(v.C,{variant:"default",children:r||"Item ".concat(a+1)},e.id||a)}),r>0&&(0,s.jsxs)(v.C,{variant:"secondary",children:["+",r," more"]})]})}return"not-configured"===u?(0,s.jsxs)(K.u,{children:[(0,s.jsxs)(K.aJ,{className:"flex items-center gap-1",children:[(0,s.jsx)(X.Z,{className:"h-4 w-4 text-yellow-500"}),(0,s.jsx)(v.C,{variant:"outline",className:"text-yellow-600",children:"Not Configured"})]}),(0,s.jsxs)(K._v,{children:["Display format not configured for relation '",null==l?void 0:l.name,"'. Configure 'showAs' field in schema management."]})]}):u&&""!==u?(0,s.jsx)("span",{className:"text-sm",children:u}):(0,s.jsxs)(K.u,{children:[(0,s.jsx)(K.aJ,{children:(0,s.jsx)(v.C,{variant:"secondary",children:"No Data"})}),(0,s.jsx)(K._v,{children:"Related data not found or not loaded"})]})}return(0,s.jsx)(p,{value:"not-configured"!==u&&u?String(u):"",onChange:a,disabled:n,readOnly:i,size:o,placeholder:"Select ".concat((null==l?void 0:l.name)||"relation"),displayFormat:c,displayOptions:d})},Q=a(89345),ee=e=>{let{value:t,onChange:a,disabled:r,readOnly:n,size:i,displayFormat:o,displayOptions:c}=e;return n?o&&"raw"!==o?(0,s.jsx)(x,{value:t,format:o,options:c}):t?(0,s.jsx)("a",{href:"mailto:".concat(t),className:"text-primary hover:underline",children:t}):(0,s.jsx)("span",{className:"text-muted-foreground",children:"-"}):(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(Q.Z,{className:"absolute left-2 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,s.jsx)(l.I,{type:"email",value:t||"",onChange:e=>null==a?void 0:a(e.target.value),disabled:r,className:(0,S.cn)("pl-8",i?({small:"h-8 text-sm pl-8",middle:"h-10 pl-9",large:"h-12 text-lg pl-10"})[i]:""),placeholder:"email@example.com"})]})},et=a(98335),ea=e=>{let{value:t,onChange:a,disabled:r,readOnly:n,size:i,displayFormat:o,displayOptions:c}=e;return n?o&&"raw"!==o?(0,s.jsx)(x,{value:t,format:o,options:c}):t?(0,s.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:t}):(0,s.jsx)("span",{className:"text-muted-foreground",children:"-"}):(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(et.Z,{className:"absolute left-2 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,s.jsx)(l.I,{type:"url",value:t||"",onChange:e=>null==a?void 0:a(e.target.value),disabled:r,className:(0,S.cn)("pl-8",i?({small:"h-8 text-sm pl-8",middle:"h-10 pl-9",large:"h-12 text-lg pl-10"})[i]:""),placeholder:"https://example.com"})]})},es=a(13041),er=e=>{let{value:t,onChange:a,disabled:r,readOnly:n,size:i,displayFormat:o,displayOptions:c}=e;return n?o&&"raw"!==o?(0,s.jsx)(x,{value:t,format:o,options:c}):t?(0,s.jsx)("a",{href:"tel:".concat(t),className:"text-primary hover:underline",children:t}):(0,s.jsx)("span",{className:"text-muted-foreground",children:"-"}):(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(es.Z,{className:"absolute left-2 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,s.jsx)(l.I,{type:"tel",value:t||"",onChange:e=>null==a?void 0:a(e.target.value),disabled:r,className:(0,S.cn)("pl-8",i?({small:"h-8 text-sm pl-8",middle:"h-10 pl-9",large:"h-12 text-lg pl-10"})[i]:""),placeholder:"+1 (555) 123-4567"})]})},el=e=>{let{value:t,onChange:a,disabled:r,readOnly:l,language:n="javascript"}=e;return l?(0,s.jsx)("pre",{className:"rounded bg-muted p-3 font-mono text-xs overflow-auto max-h-48",children:(0,s.jsx)("code",{children:t||""})}):(0,s.jsx)(I.g,{value:t||"",onChange:e=>null==a?void 0:a(e.target.value),disabled:r,className:"font-mono text-sm min-h-[120px]",placeholder:"// Enter ".concat(n," code here")})},en=a(83774),ei=a(83724),eo=e=>{let{value:t,onChange:a,disabled:l,readOnly:n,geometryType:i="Point",fieldName:o="Location"}=e,[c,d]=(0,r.useState)(!1),u=t?JSON.stringify(t,null,2):"",m=()=>{t&&d(!0)};if(n)return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("pre",{className:"rounded bg-muted p-2 text-xs overflow-auto max-h-32 max-w-[250px] whitespace-pre-wrap break-all flex-1",children:u||"-"}),t&&(0,s.jsxs)(j.z,{variant:"ghost",size:"sm",className:"ml-2 h-8 text-xs gap-1",onClick:m,children:[(0,s.jsx)(en.Z,{className:"h-3 w-3"}),"Map"]})]}),(0,s.jsx)(ei.Z,{open:c,onOpenChange:d,value:t,fieldName:o,fieldType:i})]});let h=e=>{if(!e.trim()){null==a||a(null);return}try{let t=JSON.parse(e);null==a||a(t)}catch(e){}},x=r.useMemo(()=>{switch(i){case"Point":return'{"type": "Point", "coordinates": [longitude, latitude]}';case"Polygon":return'{"type": "Polygon", "coordinates": [[[lng1, lat1], [lng2, lat2], ...]]}';case"LineString":return'{"type": "LineString", "coordinates": [[lng1, lat1], [lng2, lat2]]}';default:return'{"type": "'.concat(i,'", "coordinates": [...]}')}},[i]);return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)(I.g,{value:u,onChange:e=>h(e.target.value),disabled:l,className:"font-mono text-sm min-h-[100px] flex-1",placeholder:x}),t&&(0,s.jsxs)(j.z,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs gap-1 shrink-0",onClick:m,children:[(0,s.jsx)(en.Z,{className:"h-3 w-3"}),"Map"]})]}),(0,s.jsx)(ei.Z,{open:c,onOpenChange:d,value:t,fieldName:o,fieldType:i})]})},ec=a(75060),ed=a(68245);let eu=r.memo(e=>{let{value:t,onChange:a,disabled:r,readOnly:n,size:i,rangeType:o="integer"}=e,c=e=>{if(null==e)return"";if("date"===o||"datetime"===o){if(e instanceof Date)return"datetime"===o?e.toLocaleString():e.toLocaleDateString();if("string"==typeof e){let t=new Date(e);return"datetime"===o?t.toLocaleString():t.toLocaleDateString()}}return String(e)};if(n){if(!t)return(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:"-"});let e=!1!==t.lowerInclusive?"[":"(",a=!1!==t.upperInclusive?"]":")";return(0,s.jsxs)(v.C,{variant:"secondary",className:"font-mono text-xs",children:[e,c(t.lower)," – ",c(t.upper),a]})}let d={small:"h-8 text-sm",middle:"h-10",large:"h-12 text-lg"},u=()=>{switch(o){case"date":return"date";case"datetime":return"datetime-local";case"time":return"time";default:return"number"}},m=e=>{if(!e)return null;switch(o){case"integer":return parseInt(e,10);case"double":case"decimal":return parseFloat(e);case"date":case"datetime":return new Date(e).toISOString();default:return e}},h=e=>null==e?"":"date"===o&&e?new Date(e).toISOString().split("T")[0]:"datetime"===o&&e?new Date(e).toISOString().slice(0,16):String(e);return(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,s.jsx)(ec._,{className:"text-xs text-muted-foreground",children:"Lower"}),(0,s.jsx)(l.I,{type:u(),value:h(null==t?void 0:t.lower),onChange:e=>{var s,r,l;let n=m(e.target.value);null==a||a({lower:n,upper:null!==(s=null==t?void 0:t.upper)&&void 0!==s?s:null,lowerInclusive:null===(r=null==t?void 0:t.lowerInclusive)||void 0===r||r,upperInclusive:null===(l=null==t?void 0:t.upperInclusive)||void 0===l||l})},disabled:r,className:i?d[i]:"",placeholder:"Lower bound"})]}),(0,s.jsx)("span",{className:"text-muted-foreground pt-5",children:"–"}),(0,s.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,s.jsx)(ec._,{className:"text-xs text-muted-foreground",children:"Upper"}),(0,s.jsx)(l.I,{type:u(),value:h(null==t?void 0:t.upper),onChange:e=>{var s,r,l;let n=m(e.target.value);null==a||a({lower:null!==(s=null==t?void 0:t.lower)&&void 0!==s?s:null,upper:n,lowerInclusive:null===(r=null==t?void 0:t.lowerInclusive)||void 0===r||r,upperInclusive:null===(l=null==t?void 0:t.upperInclusive)||void 0===l||l})},disabled:r,className:i?d[i]:"",placeholder:"Upper bound"})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(ed.X,{id:"lowerInclusive",checked:(null==t?void 0:t.lowerInclusive)!==!1,onCheckedChange:e=>{var s,r,l;return null==a?void 0:a({lower:null!==(s=null==t?void 0:t.lower)&&void 0!==s?s:null,upper:null!==(r=null==t?void 0:t.upper)&&void 0!==r?r:null,lowerInclusive:!0===e,upperInclusive:null===(l=null==t?void 0:t.upperInclusive)||void 0===l||l})},disabled:r}),(0,s.jsx)(ec._,{htmlFor:"lowerInclusive",className:"text-xs",children:"Lower inclusive"})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(ed.X,{id:"upperInclusive",checked:(null==t?void 0:t.upperInclusive)!==!1,onCheckedChange:e=>{var s,r,l;return null==a?void 0:a({lower:null!==(s=null==t?void 0:t.lower)&&void 0!==s?s:null,upper:null!==(r=null==t?void 0:t.upper)&&void 0!==r?r:null,lowerInclusive:null===(l=null==t?void 0:t.lowerInclusive)||void 0===l||l,upperInclusive:!0===e})},disabled:r}),(0,s.jsx)(ec._,{htmlFor:"upperInclusive",className:"text-xs",children:"Upper inclusive"})]})]})]})});eu.displayName="RangeField";var em=eu,eh=a(46938),ex=a(78302),ep=a(54816),ef=a(63676),eg=a(65318),ev=a(78234),ey=a(13694),ej=a(24475),eN=a(71190),eb=a(5172),ew=a(75965),eC=a(44353),ek=a(84519),eS=a(29747),eA=a(79022),eO=a(81328),ez=a(19680),eI=a(17494),eT=a(18778),e_=a(64935),eL=a(12805),eZ=a(6387),eR=a(31734),eE=a(58310),eM=a(17881),eP=a(13720),eD=a(7586),eF=a(28645),eU=a(74656),eY=a(21047),eH=a(25330);let eJ=["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#efefef","#f3f3f3","#ffffff","#980000","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#4a86e8","#0000ff","#9900ff","#ff00ff","#e6b8af","#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#c9daf8","#cfe2f3","#d9d2e9","#ead1dc"],eB=e=>{let{onClick:t,isActive:a,disabled:r,children:l,title:n}=e;return(0,s.jsx)(j.z,{type:"button",variant:"ghost",size:"sm",onClick:t,disabled:r,className:(0,S.cn)("h-8 w-8 p-0",a&&"bg-muted text-foreground"),title:n,children:l})},eV=()=>(0,s.jsx)("div",{className:"w-px h-6 bg-border mx-1"}),eG=e=>{let{editor:t,onSourceToggle:a,isSourceMode:n,onFullscreenToggle:i,isFullscreen:o}=e,[c,d]=(0,r.useState)(""),[u,m]=(0,r.useState)(!1),[h,x]=(0,r.useState)(""),[p,f]=(0,r.useState)(!1),g=(0,r.useCallback)(()=>{t&&(c?t.chain().focus().extendMarkRange("link").setLink({href:c}).run():t.chain().focus().extendMarkRange("link").unsetLink().run(),m(!1),d(""))},[t,c]),v=(0,r.useCallback)(()=>{t&&(h&&t.chain().focus().setImage({src:h}).run(),f(!1),x(""))},[t,h]);return t?(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-0.5 p-1 border-b bg-muted/30",children:[(0,s.jsx)(eB,{onClick:()=>t.chain().focus().undo().run(),disabled:!t.can().undo(),title:"Undo",children:(0,s.jsx)(ew.Z,{className:"h-4 w-4"})}),(0,s.jsx)(eB,{onClick:()=>t.chain().focus().redo().run(),disabled:!t.can().redo(),title:"Redo",children:(0,s.jsx)(eC.Z,{className:"h-4 w-4"})}),(0,s.jsx)(eV,{}),(0,s.jsx)(eB,{onClick:()=>t.chain().focus().toggleHeading({level:1}).run(),isActive:t.isActive("heading",{level:1}),title:"Heading 1",children:(0,s.jsx)(ek.Z,{className:"h-4 w-4"})}),(0,s.jsx)(eB,{onClick:()=>t.chain().focus().toggleHeading({level:2}).run(),isActive:t.isActive("heading",{level:2}),title:"Heading 2",children:(0,s.jsx)(eS.Z,{className:"h-4 w-4"})}),(0,s.jsx)(eB,{onClick:()=>t.chain().focus().toggleHeading({level:3}).run(),isActive:t.isActive("heading",{level:3}),title:"Heading 3",children:(0,s.jsx)(eA.Z,{className:"h-4 w-4"})}),(0,s.jsx)(eV,{}),(0,s.jsx)(eB,{onClick:()=>t.chain().focus().toggleBold().run(),isActive:t.isActive("bold"),title:"Bold",children:(0,s.jsx)(eO.Z,{className:"h-4 w-4"})}),(0,s.jsx)(eB,{onClick:()=>t.chain().focus().toggleItalic().run(),isActive:t.isActive("italic"),title:"Italic",children:(0,s.jsx)(ez.Z,{className:"h-4 w-4"})}),(0,s.jsx)(eB,{onClick:()=>t.chain().focus().toggleUnderline().run(),isActive:t.isActive("underline"),title:"Underline",children:(0,s.jsx)(eI.Z,{className:"h-4 w-4"})}),(0,s.jsx)(eB,{onClick:()=>t.chain().focus().toggleStrike().run(),isActive:t.isActive("strike"),title:"Strikethrough",children:(0,s.jsx)(eT.Z,{className:"h-4 w-4"})}),(0,s.jsx)(eB,{onClick:()=>t.chain().focus().toggleCode().run(),isActive:t.isActive("code"),title:"Inline Code",children:(0,s.jsx)(e_.Z,{className:"h-4 w-4"})}),(0,s.jsx)(eV,{}),(0,s.jsxs)(b.J2,{children:[(0,s.jsx)(b.xo,{asChild:!0,children:(0,s.jsx)(j.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",title:"Text Color",children:(0,s.jsx)(eL.Z,{className:"h-4 w-4"})})}),(0,s.jsxs)(b.yk,{className:"w-auto p-2",children:[(0,s.jsx)("div",{className:"grid grid-cols-10 gap-1",children:eJ.map(e=>(0,s.jsx)("button",{className:"w-5 h-5 rounded border border-border hover:scale-110 transition-transform",style:{backgroundColor:e},onClick:()=>t.chain().focus().setColor(e).run()},e))}),(0,s.jsx)(j.z,{variant:"ghost",size:"sm",className:"w-full mt-2",onClick:()=>t.chain().focus().unsetColor().run(),children:"Remove color"})]})]}),(0,s.jsxs)(b.J2,{children:[(0,s.jsx)(b.xo,{asChild:!0,children:(0,s.jsx)(j.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",title:"Highlight",children:(0,s.jsx)(eZ.Z,{className:"h-4 w-4"})})}),(0,s.jsxs)(b.yk,{className:"w-auto p-2",children:[(0,s.jsx)("div",{className:"grid grid-cols-10 gap-1",children:eJ.slice(10).map(e=>(0,s.jsx)("button",{className:"w-5 h-5 rounded border border-border hover:scale-110 transition-transform",style:{backgroundColor:e},onClick:()=>t.chain().focus().toggleHighlight({color:e}).run()},e))}),(0,s.jsx)(j.z,{variant:"ghost",size:"sm",className:"w-full mt-2",onClick:()=>t.chain().focus().unsetHighlight().run(),children:"Remove highlight"})]})]}),(0,s.jsx)(eV,{}),(0,s.jsx)(eB,{onClick:()=>t.chain().focus().setTextAlign("left").run(),isActive:t.isActive({textAlign:"left"}),title:"Align Left",children:(0,s.jsx)(eR.Z,{className:"h-4 w-4"})}),(0,s.jsx)(eB,{onClick:()=>t.chain().focus().setTextAlign("center").run(),isActive:t.isActive({textAlign:"center"}),title:"Align Center",children:(0,s.jsx)(eE.Z,{className:"h-4 w-4"})}),(0,s.jsx)(eB,{onClick:()=>t.chain().focus().setTextAlign("right").run(),isActive:t.isActive({textAlign:"right"}),title:"Align Right",children:(0,s.jsx)(eM.Z,{className:"h-4 w-4"})}),(0,s.jsx)(eB,{onClick:()=>t.chain().focus().setTextAlign("justify").run(),isActive:t.isActive({textAlign:"justify"}),title:"Justify",children:(0,s.jsx)(eP.Z,{className:"h-4 w-4"})}),(0,s.jsx)(eV,{}),(0,s.jsx)(eB,{onClick:()=>t.chain().focus().toggleBulletList().run(),isActive:t.isActive("bulletList"),title:"Bullet List",children:(0,s.jsx)(eD.Z,{className:"h-4 w-4"})}),(0,s.jsx)(eB,{onClick:()=>t.chain().focus().toggleOrderedList().run(),isActive:t.isActive("orderedList"),title:"Ordered List",children:(0,s.jsx)(eF.Z,{className:"h-4 w-4"})}),(0,s.jsx)(eB,{onClick:()=>t.chain().focus().toggleBlockquote().run(),isActive:t.isActive("blockquote"),title:"Blockquote",children:(0,s.jsx)(eU.Z,{className:"h-4 w-4"})}),(0,s.jsx)(eB,{onClick:()=>t.chain().focus().setHorizontalRule().run(),title:"Horizontal Rule",children:(0,s.jsx)(eY.Z,{className:"h-4 w-4"})}),(0,s.jsx)(eV,{}),(0,s.jsxs)(b.J2,{open:u,onOpenChange:m,children:[(0,s.jsx)(b.xo,{asChild:!0,children:(0,s.jsx)(j.z,{variant:"ghost",size:"sm",className:(0,S.cn)("h-8 w-8 p-0",t.isActive("link")&&"bg-muted"),title:"Link",children:(0,s.jsx)(et.Z,{className:"h-4 w-4"})})}),(0,s.jsx)(b.yk,{className:"w-80",children:(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(ec._,{children:"URL"}),(0,s.jsx)(l.I,{value:c,onChange:e=>d(e.target.value),placeholder:"https://example.com",onKeyDown:e=>"Enter"===e.key&&g()}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)(j.z,{size:"sm",onClick:g,children:[t.isActive("link")?"Update":"Add"," Link"]}),t.isActive("link")&&(0,s.jsx)(j.z,{size:"sm",variant:"outline",onClick:()=>{t.chain().focus().unsetLink().run(),m(!1)},children:"Remove"})]})]})})]}),(0,s.jsxs)(b.J2,{open:p,onOpenChange:f,children:[(0,s.jsx)(b.xo,{asChild:!0,children:(0,s.jsx)(j.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",title:"Image",children:(0,s.jsx)(J.Z,{className:"h-4 w-4"})})}),(0,s.jsx)(b.yk,{className:"w-80",children:(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(ec._,{children:"Image URL"}),(0,s.jsx)(l.I,{value:h,onChange:e=>x(e.target.value),placeholder:"https://example.com/image.jpg",onKeyDown:e=>"Enter"===e.key&&v()}),(0,s.jsx)(j.z,{size:"sm",onClick:v,children:"Add Image"})]})})]}),(0,s.jsx)("div",{className:"flex-1"}),(0,s.jsx)(eB,{onClick:a,isActive:n,title:"Source Code",children:(0,s.jsx)(eH.Z,{className:"h-4 w-4"})}),(0,s.jsx)(eB,{onClick:i,title:o?"Exit Fullscreen":"Fullscreen",children:o?(0,s.jsx)(_.Z,{className:"h-4 w-4"}):(0,s.jsx)(T.Z,{className:"h-4 w-4"})})]}):null};var eq=e=>{let{value:t,onChange:a,disabled:l,readOnly:n,placeholder:i="Enter content...",className:o,minHeight:c=300}=e,[d,u]=(0,r.useState)(!1),[m,h]=(0,r.useState)(t||""),[x,p]=(0,r.useState)(!1),[f,g]=(0,r.useState)(!1),v=(0,eh.jE)({immediatelyRender:!1,extensions:[ex.Z.configure({heading:{levels:[1,2,3,4,5,6]}}),ep.ZP.configure({openOnClick:!1,HTMLAttributes:{rel:"noopener noreferrer"}}),ef.ZP.configure({HTMLAttributes:{style:"max-width: 100%; height: auto;"}}),eg.Z.configure({types:["heading","paragraph"]}),ev.Z,ey.pn,ej.Z,eN.ZP.configure({multicolor:!0}),eb.Z.configure({placeholder:i})],content:t||"",editable:!l&&!n,onUpdate:e=>{let{editor:t}=e,s=t.getHTML();null==a||a(s)}});(0,r.useEffect)(()=>{v&&t!==v.getHTML()&&!d&&v.commands.setContent(t||"")},[t,v,d]),(0,r.useEffect)(()=>{d&&h(t||"")},[d,t]),(0,r.useEffect)(()=>{g(!0)},[]),(0,r.useEffect)(()=>{let e=e=>{"Escape"===e.key&&x&&p(!1)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[x]);let y=()=>{null==a||a(m),null==v||v.commands.setContent(m),u(!1)};return n?(0,s.jsx)("div",{className:(0,S.cn)("prose prose-sm dark:prose-invert max-w-none","border rounded-md p-3 bg-muted/30","overflow-auto",o),style:{minHeight:c/2},dangerouslySetInnerHTML:{__html:t||"<em>No content</em>"}}):f?(0,s.jsxs)("div",{className:(0,S.cn)("html-field border rounded-md overflow-hidden flex flex-col bg-background",x&&"fixed inset-0 z-50 rounded-none",o),style:{height:x?"100vh":c},children:[(0,s.jsx)(eG,{editor:v,onSourceToggle:()=>{d?y():(h((null==v?void 0:v.getHTML())||""),u(!0))},isSourceMode:d,onFullscreenToggle:()=>p(!x),isFullscreen:x}),d?(0,s.jsxs)("div",{className:"flex-1 flex flex-col",children:[(0,s.jsx)(I.g,{value:m,onChange:e=>{h(e.target.value)},className:"flex-1 font-mono text-sm resize-none rounded-none border-0 focus-visible:ring-0",placeholder:"Enter HTML source code..."}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 p-2 border-t bg-muted/30",children:[(0,s.jsx)(j.z,{variant:"outline",size:"sm",onClick:()=>u(!1),children:"Cancel"}),(0,s.jsx)(j.z,{size:"sm",onClick:y,children:"Apply"})]})]}):(0,s.jsx)(eh.kg,{editor:v,className:(0,S.cn)("flex-1 overflow-auto","[&_.tiptap]:outline-none [&_.tiptap]:p-3 [&_.tiptap]:min-h-full","[&_.tiptap_p.is-editor-empty:first-child::before]:text-muted-foreground","[&_.tiptap_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]","[&_.tiptap_p.is-editor-empty:first-child::before]:float-left","[&_.tiptap_p.is-editor-empty:first-child::before]:h-0","[&_.tiptap_p.is-editor-empty:first-child::before]:pointer-events-none")})]}):(0,s.jsx)("div",{className:(0,S.cn)("animate-pulse bg-muted rounded border",o),style:{height:c}})};let eW=r.memo(e=>{let{field:t,value:a,onChange:r,disabled:l,readOnly:n,size:i,placeholder:o,displayFormat:c,displayOptions:d}=e,u=c||t.displayFormat,m=d||t.displayOptions;if(t.relType)return(0,s.jsx)($,{value:a,onChange:r,field:t,disabled:l,readOnly:n,size:i,displayFormat:u,displayOptions:m});switch(t.type){case"UUID":return(0,s.jsx)(G,{value:a,onChange:r,disabled:l,readOnly:n,size:i});case"String":case"VARCHAR":case"CHAR":return(0,s.jsx)(p,{value:a,onChange:r,disabled:l,readOnly:n,size:i,placeholder:o,maxLength:t.maxLength,showCount:!!t.maxLength,displayFormat:u,displayOptions:m});case"Text":case"LONGTEXT":case"MEDIUMTEXT":return(0,s.jsx)(R,{value:a,onChange:r,disabled:l,readOnly:n,placeholder:o,autoSize:{minRows:3,maxRows:8}});case"HTML":return(0,s.jsx)(eq,{value:a,onChange:r,disabled:l,readOnly:n,placeholder:o});case"Number":case"INTEGER":case"INT":case"BIGINT":case"SMALLINT":case"TINYINT":return(0,s.jsx)(f,{value:a,onChange:r,disabled:l,readOnly:n,size:i,placeholder:o,precision:0});case"Float":case"DOUBLE":case"REAL":return(0,s.jsx)(f,{value:a,onChange:r,disabled:l,readOnly:n,size:i,placeholder:o,step:.1});case"Decimal":case"NUMERIC":return(0,s.jsx)(f,{value:a,onChange:r,disabled:l,readOnly:n,size:i,placeholder:o,precision:t.scale,step:t.scale?Math.pow(10,-t.scale):.01});case"Boolean":case"BOOLEAN":return(0,s.jsx)(y,{value:a,onChange:r,disabled:l,readOnly:n,size:"small"===i?"small":"default"});case"Date":return(0,s.jsx)(A,{value:a,onChange:r,disabled:l,readOnly:n,size:i,placeholder:o,displayFormat:u,displayOptions:m});case"DateTime":case"DateTime_NO_TZ":case"DATETIME":case"TIMESTAMP":return(0,s.jsx)(O,{value:a,onChange:r,disabled:l,readOnly:n,size:i,placeholder:o,displayFormat:u,displayOptions:m});case"Time":case"Time_NO_TZ":return(0,s.jsx)(z,{value:a,onChange:r,disabled:l,readOnly:n,size:i,placeholder:o});case"JSON":case"JSONB":return(0,s.jsx)(Z,{value:a,onChange:r,disabled:l,readOnly:n,placeholder:o});case"ENUM":case"Enum":return(0,s.jsx)(F,{value:a,onChange:r,options:t.values||[],disabled:l,readOnly:n,size:i,placeholder:o,allowNull:t.allowNull});case"File":return(0,s.jsx)(H,{value:a,onChange:r,disabled:l,readOnly:n});case"Image":return(0,s.jsx)(B,{value:a,onChange:r,disabled:l,readOnly:n});case"Color":return(0,s.jsx)(V,{value:a,onChange:r,disabled:l,readOnly:n});case"Array_String":return(0,s.jsx)(W,{value:a,onChange:r,itemType:"string",disabled:l,readOnly:n,size:i,placeholder:o||"Enter string values"});case"Array_Integer":case"Array_Number":case"Array_Double":case"Array_Decimal":return(0,s.jsx)(W,{value:a,onChange:r,itemType:"number",disabled:l,readOnly:n,size:i,placeholder:o||"Enter number values"});case"Array_UUID":return(0,s.jsx)(W,{value:a,onChange:r,itemType:"string",disabled:l,readOnly:n,size:i,placeholder:o||"Enter UUID values"});case"Array_Boolean":return(0,s.jsx)(W,{value:a,onChange:r,itemType:"boolean",disabled:l,readOnly:n,size:i,placeholder:o||"Enter true or false"});case"Array_Date":return(0,s.jsx)(W,{value:a,onChange:r,itemType:"date",disabled:l,readOnly:n,size:i,placeholder:o||"Select dates"});case"Array_DateTime":case"Array_DateTime_NO_TZ":return(0,s.jsx)(W,{value:a,onChange:r,itemType:"datetime",disabled:l,readOnly:n,size:i,placeholder:o||"Select date and time"});case"Array_Time":case"Array_Time_NO_TZ":return(0,s.jsx)(W,{value:a,onChange:r,itemType:"time",disabled:l,readOnly:n,size:i,placeholder:o||"Select times"});case"Email":return(0,s.jsx)(ee,{value:a,onChange:r,disabled:l,readOnly:n,size:i,displayFormat:u,displayOptions:m});case"URL":return(0,s.jsx)(ea,{value:a,onChange:r,disabled:l,readOnly:n,size:i,displayFormat:u,displayOptions:m});case"Phone":return(0,s.jsx)(er,{value:a,onChange:r,disabled:l,readOnly:n,size:i,displayFormat:u,displayOptions:m});case"Code":return(0,s.jsx)(el,{value:a,onChange:r,disabled:l,readOnly:n,language:t.language||"javascript"});case"Point":case"Polygon":case"LineString":case"MultiPoint":case"MultiPolygon":case"MultiLineString":case"GeometryCollection":return(0,s.jsx)(eo,{value:a,onChange:r,disabled:l,readOnly:n,geometryType:t.type});case"Range_Integer":return(0,s.jsx)(em,{value:a,onChange:r,disabled:l,readOnly:n,size:i,rangeType:"integer"});case"Range_Double":return(0,s.jsx)(em,{value:a,onChange:r,disabled:l,readOnly:n,size:i,rangeType:"double"});case"Range_Decimal":return(0,s.jsx)(em,{value:a,onChange:r,disabled:l,readOnly:n,size:i,rangeType:"decimal"});case"Range_Date":return(0,s.jsx)(em,{value:a,onChange:r,disabled:l,readOnly:n,size:i,rangeType:"date"});case"Range_DateTime":case"Range_DateTime_NO_TZ":return(0,s.jsx)(em,{value:a,onChange:r,disabled:l,readOnly:n,size:i,rangeType:"datetime"});case"Range_Time":case"Range_Time_NO_TZ":return(0,s.jsx)(em,{value:a,onChange:r,disabled:l,readOnly:n,size:i,rangeType:"time"});default:return(0,s.jsx)(p,{value:a,onChange:r,disabled:l,readOnly:n,size:i,placeholder:o,displayFormat:u,displayOptions:m})}});eW.displayName="FieldRenderer";var eK=eW},95937:function(e,t,a){a.d(t,{Cd:function(){return c},X:function(){return d},bZ:function(){return o}});var s=a(57437),r=a(2265),l=a(90535),n=a(93448);let i=(0,l.j)("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),o=r.forwardRef((e,t)=>{let{className:a,variant:r,...l}=e;return(0,s.jsx)("div",{ref:t,role:"alert",className:(0,n.cn)(i({variant:r}),a),...l})});o.displayName="Alert";let c=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("h5",{ref:t,className:(0,n.cn)("mb-1 font-medium leading-none tracking-tight",a),...r})});c.displayName="AlertTitle";let d=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("div",{ref:t,className:(0,n.cn)("text-sm [&_p]:leading-relaxed",a),...r})});d.displayName="AlertDescription"},46291:function(e,t,a){a.d(t,{f:function(){return c}});var s=a(57437);a(2265);var r=a(92451),l=a(10407),n=a(61013),i=a(93448),o=a(12381);function c(e){let{className:t,classNames:a,showOutsideDays:c=!0,...d}=e;return(0,s.jsx)(n._W,{showOutsideDays:c,className:(0,i.cn)("p-3",t),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:(0,i.cn)((0,o.d)({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:(0,i.cn)("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md","range"===d.mode?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:(0,i.cn)((0,o.d)({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...a},components:{IconLeft:()=>(0,s.jsx)(r.Z,{className:"h-4 w-4"}),IconRight:()=>(0,s.jsx)(l.Z,{className:"h-4 w-4"})},...d})}c.displayName="Calendar"},68245:function(e,t,a){a.d(t,{X:function(){return o}});var s=a(57437),r=a(2265),l=a(9270),n=a(30401),i=a(93448);let o=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(l.fC,{ref:t,className:(0,i.cn)("peer h-4 w-4 shrink-0 rounded-sm border border-primary 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-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",a),...r,children:(0,s.jsx)(l.z$,{className:(0,i.cn)("flex items-center justify-center text-current"),children:(0,s.jsx)(n.Z,{className:"h-4 w-4"})})})});o.displayName=l.fC.displayName},2596:function(e,t,a){a.d(t,{di:function(){return x},e8:function(){return d},fu:function(){return m},mY:function(){return o},rb:function(){return u},sZ:function(){return c},zz:function(){return h}});var s=a(57437),r=a(2265),l=a(46343),n=a(73247),i=a(93448);a(74291);let o=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(l.mY,{ref:t,className:(0,i.cn)("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",a),...r})});o.displayName=l.mY.displayName;let c=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsxs)("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[(0,s.jsx)(n.Z,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),(0,s.jsx)(l.mY.Input,{ref:t,className:(0,i.cn)("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",a),...r})]})});c.displayName=l.mY.Input.displayName;let d=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(l.mY.List,{ref:t,className:(0,i.cn)("max-h-[300px] overflow-y-auto overflow-x-hidden",a),...r})});d.displayName=l.mY.List.displayName;let u=r.forwardRef((e,t)=>(0,s.jsx)(l.mY.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));u.displayName=l.mY.Empty.displayName;let m=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(l.mY.Group,{ref:t,className:(0,i.cn)("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",a),...r})});m.displayName=l.mY.Group.displayName;let h=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(l.mY.Separator,{ref:t,className:(0,i.cn)("-mx-1 h-px bg-border",a),...r})});h.displayName=l.mY.Separator.displayName;let x=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(l.mY.Item,{ref:t,className:(0,i.cn)("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",a),...r})});x.displayName=l.mY.Item.displayName},83724:function(e,t,a){var s=a(57437),r=a(2265),l=a(74291),n=a(12381),i=a(83774),o=a(78406),c=a(50417),d=a(51817),u=a(3609);let m=null,h=e=>{try{let t=e.replace(/^SRID=\d+;/i,"").trim().match(/^(\w+)\s*\((.+)\)$/i);if(!t)return null;let[,a,s]=t,r=a.toUpperCase();if("POINT"===r){let e=s.trim().split(/\s+/).map(Number);if(e.length>=2&&!e.some(isNaN))return{type:"Point",coordinates:e.slice(0,2)}}if("LINESTRING"===r){let e=s.split(",").map(e=>e.trim().split(/\s+/).map(Number).slice(0,2));if(e.every(e=>2===e.length&&!e.some(isNaN)))return{type:"LineString",coordinates:e}}if("POLYGON"===r){let e=[],t=s.match(/\(([^()]+)\)/g);if(t)for(let a of t){let t=a.replace(/[()]/g,"").split(",").map(e=>e.trim().split(/\s+/).map(Number).slice(0,2));t.every(e=>2===e.length&&!e.some(isNaN))&&e.push(t)}if(e.length>0)return{type:"Polygon",coordinates:e}}if("MULTIPOINT"===r){let e=[],t=s.match(/\(([^()]+)\)/g);if(t)for(let a of t){let t=a.replace(/[()]/g,"").trim().split(/\s+/).map(Number);t.length>=2&&!t.some(isNaN)&&e.push(t.slice(0,2))}else{let t=s.split(",").map(e=>e.trim().split(/\s+/).map(Number).slice(0,2));e.push(...t.filter(e=>2===e.length&&!e.some(isNaN)))}if(e.length>0)return{type:"MultiPoint",coordinates:e}}if("MULTILINESTRING"===r){let e=[],t=s.match(/\(([^()]+)\)/g);if(t)for(let a of t){let t=a.replace(/[()]/g,"").split(",").map(e=>e.trim().split(/\s+/).map(Number).slice(0,2));t.every(e=>2===e.length&&!e.some(isNaN))&&e.push(t)}if(e.length>0)return{type:"MultiLineString",coordinates:e}}if("MULTIPOLYGON"===r){let e=[];for(let t of s.split(/\)\s*,\s*\(/)){let a=[],s=t.replace(/^\(+|\)+$/g,"").match(/\(([^()]+)\)|[^,()]+(?:,[^,()]+)*/g);if(s)for(let e of s){let t=e.replace(/[()]/g,"").split(",").map(e=>e.trim().split(/\s+/).map(Number).slice(0,2)).filter(e=>2===e.length&&!e.some(isNaN));t.length>0&&a.push(t)}a.length>0&&e.push(a)}if(e.length>0)return{type:"MultiPolygon",coordinates:e}}return null}catch(e){return console.error("Error parsing WKT:",e),null}},x=(e,t)=>{if(!e)return null;if(e&&"object"==typeof e&&e.type&&e.coordinates)return e;if("string"==typeof e){if(e.trim().startsWith("{"))try{let t=JSON.parse(e);if(t.type&&t.coordinates)return t}catch(e){}if(/^(SRID=\d+;)?(POINT|LINESTRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON)/i.test(e))return h(e);if(/^[0-9A-Fa-f]+$/.test(e))return console.warn("Received WKB hex format - cannot parse client-side. API should return GeoJSON."),null}if("object"==typeof e&&"x"in e&&"y"in e)return{type:"Point",coordinates:[e.x,e.y]};if(Array.isArray(e)){if(2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1])return{type:t||"Point",coordinates:e};if(Array.isArray(e[0])&&"number"==typeof e[0][0]){let a=t||"LineString";return"Polygon"===a?{type:"Polygon",coordinates:[e]}:{type:a,coordinates:e}}if(Array.isArray(e[0])&&Array.isArray(e[0][0]))return{type:t||"Polygon",coordinates:e}}return null};t.Z=e=>{let{open:t,onOpenChange:h,value:p,fieldName:f="Location",fieldType:g}=e,v=(0,r.useRef)(null),y=(0,r.useRef)(null),j=(0,r.useRef)(null),[N,b]=(0,r.useState)(!0),w=(0,r.useMemo)(()=>x(p,g),[p,g]),{icon:C,title:k}=(0,r.useMemo)(()=>{let e=(null==w?void 0:w.type)||g,t=(0,s.jsx)(i.Z,{className:"h-4 w-4"});switch(e){case"Point":case"MultiPoint":t=(0,s.jsx)(i.Z,{className:"h-4 w-4"});break;case"LineString":case"MultiLineString":t=(0,s.jsx)(o.Z,{className:"h-4 w-4"});break;case"Polygon":case"MultiPolygon":t=(0,s.jsx)(c.Z,{className:"h-4 w-4"})}return{icon:t,title:"".concat(f," (").concat(e||"Geometry",")")}},[w,f,g]);(0,r.useEffect)(()=>{if(!t)return;let e=!0;return b(!0),(async()=>{try{if(await new Promise(e=>requestAnimationFrame(e)),!e||!v.current){b(!1);return}if(!document.querySelector('link[href*="leaflet.css"]')){let e=document.createElement("link");e.rel="stylesheet",e.href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css",document.head.appendChild(e),await new Promise(t=>{e.onload=()=>t(),e.onerror=()=>t(),setTimeout(t,1e3)})}if(m||(m=await a.e(4212).then(a.t.bind(a,60759,23)),delete m.Icon.Default.prototype._getIconUrl,m.Icon.Default.mergeOptions({iconRetinaUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/images/marker-icon-2x.png",iconUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/images/marker-icon.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/images/marker-shadow.png"})),!e||!v.current){b(!1);return}let t=m;y.current&&(y.current.remove(),y.current=null);let s=t.map(v.current,{zoomControl:!0,scrollWheelZoom:!0});if(y.current=s,t.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',maxZoom:19}).addTo(s),w){let e=t.geoJSON({type:"Feature",geometry:w,properties:{}},{style:{color:"#3b82f6",weight:3,opacity:.8,fillColor:"#3b82f6",fillOpacity:.3},pointToLayer:(e,a)=>t.circleMarker(a,{radius:10,fillColor:"#3b82f6",color:"#1e40af",weight:2,opacity:1,fillOpacity:.8})}).addTo(s).getBounds();e.isValid()?(j.current=e,s.fitBounds(e,{padding:[50,50],maxZoom:16})):(j.current=null,s.setView([0,0],2))}else j.current=null,s.setView([0,0],2);requestAnimationFrame(()=>{y.current&&e&&y.current.invalidateSize(),b(!1)})}catch(e){console.error("Error initializing map:",e),b(!1)}})(),()=>{e=!1,y.current&&(y.current.remove(),y.current=null)}},[t,w]);let S=(0,r.useMemo)(()=>{if(!w)return"";let e=w.coordinates;if(!e)return"";try{switch(w.type){case"Point":return"[".concat(Number(e[0]).toFixed(6),", ").concat(Number(e[1]).toFixed(6),"]");case"LineString":case"MultiPoint":return"".concat(e.length," points");case"Polygon":var t;let a=e.length,s=(null===(t=e[0])||void 0===t?void 0:t.length)||0;return a>1?"".concat(s," points, ").concat(a-1," hole(s)"):"".concat(s," points");case"MultiLineString":return"".concat(e.length," lines");case"MultiPolygon":return"".concat(e.length," polygons");default:return""}}catch(e){return""}},[w]);return(0,s.jsx)(l.Vq,{open:t,onOpenChange:h,children:(0,s.jsxs)(l.cZ,{className:"max-w-3xl max-h-[85vh]",children:[(0,s.jsx)(l.fK,{children:(0,s.jsxs)(l.$N,{className:"flex items-center gap-2",children:[C,k]})}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"relative",children:[N&&(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-muted rounded-md z-10",children:(0,s.jsx)(d.Z,{className:"h-8 w-8 animate-spin text-muted-foreground"})}),(0,s.jsx)("div",{ref:v,className:"w-full h-[400px] rounded-md border overflow-hidden bg-muted",style:{minHeight:"400px"}}),!N&&(0,s.jsx)(n.z,{variant:"secondary",size:"icon",className:"absolute top-2 right-2 z-[1000] shadow-md",onClick:()=>{y.current&&(j.current?y.current.fitBounds(j.current,{padding:[50,50],maxZoom:16}):y.current.setView([0,0],2))},title:"Reset to initial view",children:(0,s.jsx)(u.Z,{className:"h-4 w-4"})})]}),S&&(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,s.jsx)("span",{className:"font-medium",children:"Details:"}),(0,s.jsx)("span",{children:S})]}),(0,s.jsxs)("details",{className:"text-sm",children:[(0,s.jsx)("summary",{className:"cursor-pointer text-muted-foreground hover:text-foreground",children:"View raw GeoJSON"}),(0,s.jsx)("pre",{className:"mt-2 p-3 bg-muted rounded-md overflow-auto max-h-[200px] text-xs",children:JSON.stringify(w||p,null,2)})]})]})]})})}},12749:function(e,t,a){a.d(t,{J2:function(){return i},xo:function(){return o},yk:function(){return c}});var s=a(57437),r=a(2265),l=a(51777),n=a(93448);let i=l.fC,o=l.xz;l.ee;let c=r.forwardRef((e,t)=>{let{className:a,align:r="center",sideOffset:i=4,...o}=e;return(0,s.jsx)(l.h_,{children:(0,s.jsx)(l.VY,{ref:t,align:r,sideOffset:i,className:(0,n.cn)("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...o})})});c.displayName=l.VY.displayName},91032:function(e,t,a){a.d(t,{Ei:function(){return v},FF:function(){return f},Tu:function(){return p},bC:function(){return g},sw:function(){return d},ue:function(){return x},yo:function(){return c}});var s=a(57437),r=a(2265),l=a(70001),n=a(90535),i=a(32489),o=a(93448);let c=l.fC;l.xz;let d=l.x8,u=l.h_,m=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(l.aV,{className:(0,o.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...r,ref:t})});m.displayName=l.aV.displayName;let h=(0,n.j)("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out overflow-hidden",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-full sm:w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-full sm:w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right"}},defaultVariants:{side:"right"}}),x=r.forwardRef((e,t)=>{let{side:a="right",className:r,children:n,hideDefaultClose:c=!1,...d}=e;return(0,s.jsxs)(u,{children:[(0,s.jsx)(m,{}),(0,s.jsxs)(l.VY,{ref:t,className:(0,o.cn)(h({side:a}),r),...d,children:[!c&&(0,s.jsxs)(l.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,s.jsx)(i.Z,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]}),n]})]})});x.displayName=l.VY.displayName;let p=e=>{let{className:t,...a}=e;return(0,s.jsx)("div",{className:(0,o.cn)("flex flex-col space-y-2 text-center sm:text-left",t),...a})};p.displayName="SheetHeader";let f=e=>{let{className:t,...a}=e;return(0,s.jsx)("div",{className:(0,o.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a})};f.displayName="SheetFooter";let g=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(l.Dx,{ref:t,className:(0,o.cn)("text-lg font-semibold text-foreground",a),...r})});g.displayName=l.Dx.displayName;let v=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(l.dk,{ref:t,className:(0,o.cn)("text-sm text-muted-foreground",a),...r})});v.displayName=l.dk.displayName},94589:function(e,t,a){a.d(t,{r:function(){return i}});var s=a(57437),r=a(2265),l=a(50721),n=a(93448);let i=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(l.fC,{className:(0,n.cn)("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",a),...r,ref:t,children:(0,s.jsx)(l.bU,{className:(0,n.cn)("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})})});i.displayName=l.fC.displayName},71488:function(e,t,a){a.d(t,{_v:function(){return d},aJ:function(){return c},pn:function(){return i},u:function(){return o}});var s=a(57437),r=a(2265),l=a(91668),n=a(93448);let i=l.zt,o=l.fC,c=l.xz,d=r.forwardRef((e,t)=>{let{className:a,sideOffset:r=4,...i}=e;return(0,s.jsx)(l.VY,{ref:t,sideOffset:r,className:(0,n.cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...i})});d.displayName=l.VY.displayName},29696:function(e,t,a){a.d(t,{A1:function(){return o},I_:function(){return i}});var s=a(57437),r=a(2265),l=a(72135);let n=(0,r.createContext)(void 0),i=()=>{let e=(0,r.useContext)(n);if(!e)throw Error("useSchema must be used within a SchemaProvider");return e};function o(e){let{children:t}=e,{data:a,isLoading:r,refetch:i}=(0,l.sm)({resource:"collections",queryOptions:{enabled:!0},sorters:[{field:"collectionName",order:"asc"}],pagination:{pageSize:500}}),o=(null==a?void 0:a.data)||[],c=e=>o.find(t=>t.collectionName===e),d=e=>{let t=c(e),a=null==t?void 0:t.schema.fields;if(a){let t={...a};for(let[e,a]of Object.entries(t))a.hidden&&delete t[e];return"baasix_Account"===e&&(delete t.password,delete t.accessToken,delete t.refreshToken,delete t.idToken),"baasix_Verification"===e&&delete t.value,"baasix_Sessions"===e&&delete t.token,t}return a},u=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(0===a)return[];let r=d(e);return r?Object.entries(r).map(e=>{let[r,l]=e,n=t?"".concat(t,".").concat(r):r,i=s?{title:l.relType?n+".*":n,value:l.relType?n+".*":n,key:l.relType?n+".*":n,isLeaf:!l.relType}:{title:n,value:n,key:n,isLeaf:!l.relType};return l.relType&&l.target&&(i.children=u(l.target,n,a-1,s)),i}):[]};return(0,s.jsx)(n.Provider,{value:{schemas:o,isLoading:r,refetch:i,getSchemaByName:c,getFieldsByCollection:d,getCollectionChoices:()=>o.map(e=>({label:e.schema.name,value:e.collectionName})),getTargetFields:e=>{let t=d(e);return t?Object.entries(t).map(e=>{let[t]=e;return{label:t,value:t}}):[]},formatRelationshipDisplay:(e,t)=>e&&t?null==t?void 0:t.split(",").map(t=>{let a=t.trim();return e[a]||a}).join(""):"",getNestedFields:e=>u(e),getPermissionFields:e=>[{title:"*",value:"*",key:"*",isLeaf:!0},...u(e,"",6,!0),{title:"*.*",value:"*.*",key:"*.*",isLeaf:!0},{title:"*.*.*",value:"*.*.*",key:"*.*.*",isLeaf:!0},{title:"*.*.*.*",value:"*.*.*.*",key:"*.*.*.*",isLeaf:!0}],isSortEnabled:e=>{var t;let a=c(e);return(null==a?void 0:null===(t=a.schema)||void 0===t?void 0:t.sortEnabled)===!0}},children:t})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4952],{79205:function(e,t,n){n.d(t,{Z:function(){return l}});var r=n(2265);let a=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),o=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((e,t,n)=>!!e&&n.indexOf(e)===t).join(" ")};var i={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let u=(0,r.forwardRef)((e,t)=>{let{color:n="currentColor",size:a=24,strokeWidth:u=2,absoluteStrokeWidth:l,className:c="",children:s,iconNode:f,...d}=e;return(0,r.createElement)("svg",{ref:t,...i,width:a,height:a,stroke:n,strokeWidth:l?24*Number(u)/Number(a):u,className:o("lucide",c),...d},[...f.map(e=>{let[t,n]=e;return(0,r.createElement)(t,n)}),...Array.isArray(s)?s:[s]])}),l=(e,t)=>{let n=(0,r.forwardRef)((n,i)=>{let{className:l,...c}=n;return(0,r.createElement)(u,{ref:i,iconNode:t,className:o("lucide-".concat(a(e)),l),...c})});return n.displayName="".concat(e),n}},16066:function(e,t,n){n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]])},92934:function(e,t,n){n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},99388:function(e,t,n){n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},91723:function(e,t,n){n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},71947:function(e,t,n){n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]])},65621:function(e,t,n){n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]])},51817:function(e,t,n){n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},33276:function(e,t,n){n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},69076:function(e,t,n){n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]])},10866:function(e,t,n){n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]])},76865:function(e,t,n){n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},370:function(e,t,n){n.d(t,{f:function(){return l}});var r=n(2265);n(54887);var a=n(37053),o=n(57437),i=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=(0,a.Z8)(`Primitive.${t}`),i=r.forwardRef((e,r)=>{let{asChild:a,...i}=e,u=a?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,o.jsx)(u,{...i,ref:r})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),u=r.forwardRef((e,t)=>(0,o.jsx)(i.label,{...e,ref:t,onMouseDown:t=>{var n;t.target.closest("button, input, select, textarea")||(null===(n=e.onMouseDown)||void 0===n||n.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));u.displayName="Label";var l=u},1353:function(e,t,n){n.d(t,{Pc:function(){return M},ck:function(){return F},fC:function(){return A}});var r=n(2265),a=n(6741),o=n(9923),i=n(98575),u=n(73966),l=n(99255),c=n(82912),s=n(26606),f=n(80886),d=n(29114),h=n(57437),v="rovingFocusGroup.onEntryFocus",m={bubbles:!1,cancelable:!0},p="RovingFocusGroup",[y,b,g]=(0,o.B)(p),[w,M]=(0,u.b)(p,[g]),[k,x]=w(p),D=r.forwardRef((e,t)=>(0,h.jsx)(y.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,h.jsx)(y.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,h.jsx)(j,{...e,ref:t})})}));D.displayName=p;var j=r.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:o,loop:u=!1,dir:l,currentTabStopId:y,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:w,onEntryFocus:M,preventScrollOnEntryFocus:x=!1,...D}=e,j=r.useRef(null),C=(0,i.e)(t,j),T=(0,d.gm)(l),[R,A]=(0,f.T)({prop:y,defaultProp:null!=g?g:null,onChange:w,caller:p}),[F,I]=r.useState(!1),E=(0,s.W)(M),N=b(n),S=r.useRef(!1),[L,V]=r.useState(0);return r.useEffect(()=>{let e=j.current;if(e)return e.addEventListener(v,E),()=>e.removeEventListener(v,E)},[E]),(0,h.jsx)(k,{scope:n,orientation:o,dir:T,loop:u,currentTabStopId:R,onItemFocus:r.useCallback(e=>A(e),[A]),onItemShiftTab:r.useCallback(()=>I(!0),[]),onFocusableItemAdd:r.useCallback(()=>V(e=>e+1),[]),onFocusableItemRemove:r.useCallback(()=>V(e=>e-1),[]),children:(0,h.jsx)(c.WV.div,{tabIndex:F||0===L?-1:0,"data-orientation":o,...D,ref:C,style:{outline:"none",...e.style},onMouseDown:(0,a.Mj)(e.onMouseDown,()=>{S.current=!0}),onFocus:(0,a.Mj)(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!F){let t=new CustomEvent(v,m);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=N().filter(e=>e.focusable);Z([e.find(e=>e.active),e.find(e=>e.id===R),...e].filter(Boolean).map(e=>e.ref.current),x)}}S.current=!1}),onBlur:(0,a.Mj)(e.onBlur,()=>I(!1))})})}),C="RovingFocusGroupItem",T=r.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:o=!0,active:i=!1,tabStopId:u,children:s,...f}=e,d=(0,l.M)(),v=u||d,m=x(C,n),p=m.currentTabStopId===v,g=b(n),{onFocusableItemAdd:w,onFocusableItemRemove:M,currentTabStopId:k}=m;return r.useEffect(()=>{if(o)return w(),()=>M()},[o,w,M]),(0,h.jsx)(y.ItemSlot,{scope:n,id:v,focusable:o,active:i,children:(0,h.jsx)(c.WV.span,{tabIndex:p?0:-1,"data-orientation":m.orientation,...f,ref:t,onMouseDown:(0,a.Mj)(e.onMouseDown,e=>{o?m.onItemFocus(v):e.preventDefault()}),onFocus:(0,a.Mj)(e.onFocus,()=>m.onItemFocus(v)),onKeyDown:(0,a.Mj)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey){m.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=function(e,t,n){var r;let a=(r=e.key,"rtl"!==n?r:"ArrowLeft"===r?"ArrowRight":"ArrowRight"===r?"ArrowLeft":r);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(a))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(a)))return R[a]}(e,m.orientation,m.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let a=g().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)a.reverse();else if("prev"===t||"next"===t){var n,r;"prev"===t&&a.reverse();let o=a.indexOf(e.currentTarget);a=m.loop?(n=a,r=o+1,n.map((e,t)=>n[(r+t)%n.length])):a.slice(o+1)}setTimeout(()=>Z(a))}}),children:"function"==typeof s?s({isCurrentTabStop:p,hasTabStop:null!=k}):s})})});T.displayName=C;var R={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Z(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}var A=D,F=T},20271:function(e,t,n){n.d(t,{VY:function(){return F},aV:function(){return Z},fC:function(){return R},xz:function(){return A}});var r=n(2265),a=n(6741),o=n(73966),i=n(1353),u=n(71599),l=n(82912),c=n(29114),s=n(80886),f=n(99255),d=n(57437),h="Tabs",[v,m]=(0,o.b)(h,[i.Pc]),p=(0,i.Pc)(),[y,b]=v(h),g=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:a,defaultValue:o,orientation:i="horizontal",dir:u,activationMode:v="automatic",...m}=e,p=(0,c.gm)(u),[b,g]=(0,s.T)({prop:r,onChange:a,defaultProp:null!=o?o:"",caller:h});return(0,d.jsx)(y,{scope:n,baseId:(0,f.M)(),value:b,onValueChange:g,orientation:i,dir:p,activationMode:v,children:(0,d.jsx)(l.WV.div,{dir:p,"data-orientation":i,...m,ref:t})})});g.displayName=h;var w="TabsList",M=r.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...a}=e,o=b(w,n),u=p(n);return(0,d.jsx)(i.fC,{asChild:!0,...u,orientation:o.orientation,dir:o.dir,loop:r,children:(0,d.jsx)(l.WV.div,{role:"tablist","aria-orientation":o.orientation,...a,ref:t})})});M.displayName=w;var k="TabsTrigger",x=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:o=!1,...u}=e,c=b(k,n),s=p(n),f=C(c.baseId,r),h=T(c.baseId,r),v=r===c.value;return(0,d.jsx)(i.ck,{asChild:!0,...s,focusable:!o,active:v,children:(0,d.jsx)(l.WV.button,{type:"button",role:"tab","aria-selected":v,"aria-controls":h,"data-state":v?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:f,...u,ref:t,onMouseDown:(0,a.Mj)(e.onMouseDown,e=>{o||0!==e.button||!1!==e.ctrlKey?e.preventDefault():c.onValueChange(r)}),onKeyDown:(0,a.Mj)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&c.onValueChange(r)}),onFocus:(0,a.Mj)(e.onFocus,()=>{let e="manual"!==c.activationMode;v||o||!e||c.onValueChange(r)})})})});x.displayName=k;var D="TabsContent",j=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:a,forceMount:o,children:i,...c}=e,s=b(D,n),f=C(s.baseId,a),h=T(s.baseId,a),v=a===s.value,m=r.useRef(v);return r.useEffect(()=>{let e=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,d.jsx)(u.z,{present:o||v,children:n=>{let{present:r}=n;return(0,d.jsx)(l.WV.div,{"data-state":v?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":f,hidden:!r,id:h,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:m.current?"0s":void 0},children:r&&i})}})});function C(e,t){return"".concat(e,"-trigger-").concat(t)}function T(e,t){return"".concat(e,"-content-").concat(t)}j.displayName=D;var R=g,Z=M,A=x,F=j},7598:function(e,t,n){n.d(t,{Q:function(){return d}});var r=n(63497),a=n(99649);function o(e,t){let n=(0,a.Q)(e),r=(0,a.Q)(t),o=n.getTime()-r.getTime();return o<0?-1:o>0?1:o}var i=n(78198),u=n(81363),l=n(27742),c=n(5654),s=n(55528),f=n(9340);function d(e,t){return function(e,t,n){var r,d,h,v,m,p;let y,b,g;let w=(0,s.j)(),M=null!==(d=null!==(r=null==n?void 0:n.locale)&&void 0!==r?r:w.locale)&&void 0!==d?d:c._,k=o(e,t);if(isNaN(k))throw RangeError("Invalid time value");let x=Object.assign({},n,{addSuffix:null==n?void 0:n.addSuffix,comparison:k});k>0?(y=(0,a.Q)(t),b=(0,a.Q)(e)):(y=(0,a.Q)(e),b=(0,a.Q)(t));let D=(h=b,v=y,(p=null==void 0?void 0:(void 0).roundingMethod,e=>{let t=(p?Math[p]:Math.trunc)(e);return 0===t?0:t})((+(0,a.Q)(h)-+(0,a.Q)(v))/1e3)),j=Math.round((D-((0,f.D)(b)-(0,f.D)(y))/1e3)/60);if(j<2){if(null==n?void 0:n.includeSeconds){if(D<5)return M.formatDistance("lessThanXSeconds",5,x);if(D<10)return M.formatDistance("lessThanXSeconds",10,x);if(D<20)return M.formatDistance("lessThanXSeconds",20,x);if(D<40)return M.formatDistance("halfAMinute",0,x);else if(D<60)return M.formatDistance("lessThanXMinutes",1,x);else return M.formatDistance("xMinutes",1,x)}return 0===j?M.formatDistance("lessThanXMinutes",1,x):M.formatDistance("xMinutes",j,x)}if(j<45)return M.formatDistance("xMinutes",j,x);if(j<90)return M.formatDistance("aboutXHours",1,x);if(j<i.H_)return M.formatDistance("aboutXHours",Math.round(j/60),x);if(j<2520)return M.formatDistance("xDays",1,x);if(j<i.fH){let e=Math.round(j/i.H_);return M.formatDistance("xDays",e,x)}if(j<2*i.fH)return g=Math.round(j/i.fH),M.formatDistance("aboutXMonths",g,x);if((g=function(e,t){let n;let r=(0,a.Q)(e),i=(0,a.Q)(t),c=o(r,i),s=Math.abs((0,u.T)(r,i));if(s<1)n=0;else{1===r.getMonth()&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-c*s);let t=o(r,i)===-c;(function(e){let t=(0,a.Q)(e);return+function(e){let t=(0,a.Q)(e);return t.setHours(23,59,59,999),t}(t)==+(0,l.V)(t)})((0,a.Q)(e))&&1===s&&1===o(e,i)&&(t=!1),n=c*(s-Number(t))}return 0===n?0:n}(b,y))<12){let e=Math.round(j/i.fH);return M.formatDistance("xMonths",e,x)}{let e=g%12,t=Math.trunc(g/12);return e<3?M.formatDistance("aboutXYears",t,x):e<9?M.formatDistance("overXYears",t,x):M.formatDistance("almostXYears",t+1,x)}}(e,(0,r.L)(e,Date.now()),t)}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6547],{24654:function(){},69174:function(e,t,r){"use strict";r.d(t,{C:function(){return l}});var a=r(57437);r(2265);var n=r(90535),s=r(93448);let o=(0,n.j)("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function l(e){let{className:t,variant:r,...n}=e;return(0,a.jsx)("div",{className:(0,s.cn)(o({variant:r}),t),...n})}},12381:function(e,t,r){"use strict";r.d(t,{d:function(){return i},z:function(){return d}});var a=r(57437),n=r(2265),s=r(37053),o=r(90535),l=r(93448);let i=(0,o.j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),d=n.forwardRef((e,t)=>{let{className:r,variant:n,size:o,asChild:d=!1,...c}=e,u=d?s.g7:"button";return(0,a.jsx)(u,{className:(0,l.cn)(i({variant:n,size:o,className:r})),ref:t,...c})});d.displayName="Button"},79820:function(e,t,r){"use strict";r.d(t,{Ol:function(){return l},SZ:function(){return d},Zb:function(){return o},aY:function(){return c},eW:function(){return u},ll:function(){return i}});var a=r(57437),n=r(2265),s=r(93448);let o=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)("div",{ref:t,className:(0,s.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",r),...n})});o.displayName="Card";let l=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)("div",{ref:t,className:(0,s.cn)("flex flex-col space-y-1 p-4",r),...n})});l.displayName="CardHeader";let i=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)("h3",{ref:t,className:(0,s.cn)("text-lg font-semibold leading-none tracking-tight",r),...n})});i.displayName="CardTitle";let d=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)("p",{ref:t,className:(0,s.cn)("text-sm text-muted-foreground",r),...n})});d.displayName="CardDescription";let c=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)("div",{ref:t,className:(0,s.cn)("p-4 pt-0",r),...n})});c.displayName="CardContent";let u=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)("div",{ref:t,className:(0,s.cn)("flex items-center p-4 pt-0",r),...n})});u.displayName="CardFooter"},74291:function(e,t,r){"use strict";r.d(t,{$N:function(){return x},Be:function(){return g},Vq:function(){return i},cN:function(){return p},cZ:function(){return f},fK:function(){return m},hg:function(){return d}});var a=r(57437),n=r(2265),s=r(70001),o=r(32489),l=r(93448);let i=s.fC,d=s.xz,c=s.h_;s.x8;let u=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)(s.aV,{ref:t,className:(0,l.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...n})});u.displayName=s.aV.displayName;let f=n.forwardRef((e,t)=>{let{className:r,children:n,...i}=e;return(0,a.jsxs)(c,{children:[(0,a.jsx)(u,{}),(0,a.jsxs)(s.VY,{ref:t,className:(0,l.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",r),...i,children:[n,(0,a.jsxs)(s.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,a.jsx)(o.Z,{className:"h-4 w-4"}),(0,a.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});f.displayName=s.VY.displayName;let m=e=>{let{className:t,...r}=e;return(0,a.jsx)("div",{className:(0,l.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...r})};m.displayName="DialogHeader";let p=e=>{let{className:t,...r}=e;return(0,a.jsx)("div",{className:(0,l.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...r})};p.displayName="DialogFooter";let x=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)(s.Dx,{ref:t,className:(0,l.cn)("text-lg font-semibold leading-none tracking-tight",r),...n})});x.displayName=s.Dx.displayName;let g=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)(s.dk,{ref:t,className:(0,l.cn)("text-sm text-muted-foreground",r),...n})});g.displayName=s.dk.displayName},43368:function(e,t,r){"use strict";r.d(t,{t:function(){return u}});var a=r(57437),n=r(2265),s=r(73247),o=r(32489),l=r(93448),i=r(40279),d=r(12381),c=r(74291);let u=e=>{let{value:t,onChange:r,placeholder:u="Search...",className:f,expandedWidth:m="w-64"}=e,[p,x]=n.useState(!1),g=n.useRef(null),b=()=>{r("")};return n.useEffect(()=>{p&&setTimeout(()=>{var e;return null===(e=g.current)||void 0===e?void 0:e.focus()},100)},[p]),(0,a.jsxs)("div",{className:(0,l.cn)("relative",f),children:[(0,a.jsxs)("div",{className:"sm:hidden",children:[(0,a.jsxs)(d.z,{variant:t?"default":"outline",size:"icon",onClick:()=>{x(!0)},className:"relative",children:[(0,a.jsx)(s.Z,{className:"h-4 w-4"}),t&&(0,a.jsx)("span",{className:"absolute -top-1 -right-1 h-2 w-2 bg-primary rounded-full border-2 border-background"})]}),(0,a.jsx)(c.Vq,{open:p,onOpenChange:x,children:(0,a.jsxs)(c.cZ,{className:"sm:max-w-md top-[10%] translate-y-0",children:[(0,a.jsx)(c.fK,{children:(0,a.jsx)(c.$N,{children:"Search"})}),(0,a.jsx)("div",{className:"flex items-center gap-2",children:(0,a.jsxs)("div",{className:"relative flex-1",children:[(0,a.jsx)(s.Z,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,a.jsx)(i.I,{ref:g,placeholder:u,value:t,onChange:e=>r(e.target.value),className:"pl-9 pr-9 h-10"}),t&&(0,a.jsx)(d.z,{variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-10 w-10",onClick:b,children:(0,a.jsx)(o.Z,{className:"h-4 w-4"})})]})}),(0,a.jsxs)("div",{className:"flex justify-end gap-2 mt-2",children:[t&&(0,a.jsx)(d.z,{variant:"outline",size:"sm",onClick:b,children:"Clear"}),(0,a.jsx)(d.z,{size:"sm",onClick:()=>{x(!1)},children:"Done"})]})]})})]}),(0,a.jsxs)("div",{className:(0,l.cn)("hidden sm:block relative",m),children:[(0,a.jsx)(s.Z,{className:"absolute left-2 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,a.jsx)(i.I,{placeholder:u,value:t,onChange:e=>r(e.target.value),className:"pl-8 h-9"}),t&&(0,a.jsx)(d.z,{variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-9 w-9",onClick:b,children:(0,a.jsx)(o.Z,{className:"h-4 w-4"})})]})]})}},40279:function(e,t,r){"use strict";r.d(t,{I:function(){return o}});var a=r(57437),n=r(2265),s=r(93448);let o=n.forwardRef((e,t)=>{let{className:r,type:n,...o}=e;return(0,a.jsx)("input",{type:n,className:(0,s.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),ref:t,...o})});o.displayName="Input"},75060:function(e,t,r){"use strict";r.d(t,{_:function(){return d}});var a=r(57437),n=r(2265),s=r(370),o=r(90535),l=r(93448);let i=(0,o.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)(s.f,{ref:t,className:(0,l.cn)(i(),r),...n})});d.displayName=s.f.displayName},90641:function(e,t,r){"use strict";r.d(t,{x:function(){return l}});var a=r(57437),n=r(2265),s=r(43643),o=r(93448);let l=n.forwardRef((e,t)=>{let{className:r,children:n,...l}=e;return(0,a.jsxs)(s.fC,{ref:t,className:(0,o.cn)("relative overflow-hidden",r),...l,children:[(0,a.jsx)(s.l_,{className:"h-full w-full rounded-[inherit]",children:n}),(0,a.jsx)(i,{}),(0,a.jsx)(s.Ns,{})]})});l.displayName=s.fC.displayName;let i=n.forwardRef((e,t)=>{let{className:r,orientation:n="vertical",...l}=e;return(0,a.jsx)(s.gb,{ref:t,orientation:n,className:(0,o.cn)("flex touch-none select-none transition-colors","vertical"===n&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===n&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",r),...l,children:(0,a.jsx)(s.q4,{className:"relative flex-1 rounded-full bg-border"})})});i.displayName=s.gb.displayName},15291:function(e,t,r){"use strict";r.d(t,{Bw:function(){return g},DI:function(){return u},Ph:function(){return c},Ql:function(){return h},i4:function(){return m},ki:function(){return f},n5:function(){return b}});var a=r(57437),n=r(2265),s=r(74797),o=r(40875),l=r(22135),i=r(30401),d=r(93448);let c=s.fC,u=s.ZA,f=s.B4,m=n.forwardRef((e,t)=>{let{className:r,children:n,...l}=e;return(0,a.jsxs)(s.xz,{ref:t,className:(0,d.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",r),...l,children:[n,(0,a.jsx)(s.JO,{asChild:!0,children:(0,a.jsx)(o.Z,{className:"h-4 w-4 opacity-50"})})]})});m.displayName=s.xz.displayName;let p=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)(s.u_,{ref:t,className:(0,d.cn)("flex cursor-default items-center justify-center py-1",r),...n,children:(0,a.jsx)(l.Z,{className:"h-4 w-4"})})});p.displayName=s.u_.displayName;let x=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)(s.$G,{ref:t,className:(0,d.cn)("flex cursor-default items-center justify-center py-1",r),...n,children:(0,a.jsx)(o.Z,{className:"h-4 w-4"})})});x.displayName=s.$G.displayName;let g=n.forwardRef((e,t)=>{let{className:r,children:n,position:o="popper",...l}=e;return(0,a.jsx)(s.h_,{children:(0,a.jsxs)(s.VY,{ref:t,className:(0,d.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===o&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",r),position:o,...l,children:[(0,a.jsx)(p,{}),(0,a.jsx)(s.l_,{className:(0,d.cn)("p-1 max-h-[300px] overflow-y-auto","popper"===o&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),style:{overscrollBehavior:"contain",touchAction:"pan-y",WebkitOverflowScrolling:"touch",willChange:"scroll-position",pointerEvents:"auto"},children:n}),(0,a.jsx)(x,{})]})})});g.displayName=s.VY.displayName;let b=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)(s.__,{ref:t,className:(0,d.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",r),...n})});b.displayName=s.__.displayName;let h=n.forwardRef((e,t)=>{let{className:r,children:n,...o}=e;return(0,a.jsxs)(s.ck,{ref:t,className:(0,d.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),...o,children:[(0,a.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(s.wU,{children:(0,a.jsx)(i.Z,{className:"h-4 w-4"})})}),(0,a.jsx)(s.eT,{children:n})]})});h.displayName=s.ck.displayName,n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)(s.Z0,{ref:t,className:(0,d.cn)("-mx-1 my-1 h-px bg-muted",r),...n})}).displayName=s.Z0.displayName},33804:function(e,t,r){"use strict";r.d(t,{RM:function(){return i},SC:function(){return d},iA:function(){return o},pj:function(){return u},ss:function(){return c},xD:function(){return l}});var a=r(57437),n=r(2265),s=r(93448);let o=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)("div",{className:"relative w-full overflow-auto",children:(0,a.jsx)("table",{ref:t,className:(0,s.cn)("w-full caption-bottom text-sm",r),...n})})});o.displayName="Table";let l=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)("thead",{ref:t,className:(0,s.cn)("[&_tr]:border-b",r),...n})});l.displayName="TableHeader";let i=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)("tbody",{ref:t,className:(0,s.cn)("[&_tr:last-child]:border-0",r),...n})});i.displayName="TableBody",n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)("tfoot",{ref:t,className:(0,s.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",r),...n})}).displayName="TableFooter";let d=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)("tr",{ref:t,className:(0,s.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",r),...n})});d.displayName="TableRow";let c=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)("th",{ref:t,className:(0,s.cn)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",r),...n})});c.displayName="TableHead";let u=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)("td",{ref:t,className:(0,s.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",r),...n})});u.displayName="TableCell",n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)("caption",{ref:t,className:(0,s.cn)("mt-4 text-sm text-muted-foreground",r),...n})}).displayName="TableCaption"},23675:function(e,t,r){"use strict";r.d(t,{g:function(){return o}});var a=r(57437),n=r(2265),s=r(93448);let o=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)("textarea",{className:(0,s.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),ref:t,...n})});o.displayName="Textarea"},93448:function(e,t,r){"use strict";r.d(t,{cn:function(){return s}});var a=r(61994),n=r(53335);function s(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,n.m6)((0,a.W)(t))}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7598],{24654:function(){},79728:function(e,t,r){Promise.resolve().then(r.bind(r,97222))},97222:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return Z}});var o=r(57437),l=r(2265),n=r(72135),a=r(29696),i=r(79820),s=r(95805),c=r(14924),d=r(68113),u=r(84428),v=r(42488),h=r(70525),f=r(14438),m=r(12438),g=r(91436),p=r(14565),x=r(56933),b=r(93448);let y={light:"",dark:".dark"},j=l.createContext(null);function N(){let e=l.useContext(j);if(!e)throw Error("useChart must be used within a <ChartContainer />");return e}let k=l.forwardRef((e,t)=>{let{id:r,className:n,children:a,config:i,...s}=e,c=l.useId(),d="chart-".concat(r||c.replace(/:/g,""));return(0,o.jsx)(j.Provider,{value:{config:i},children:(0,o.jsxs)("div",{"data-chart":d,ref:t,className:(0,b.cn)("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",n),...s,children:[(0,o.jsx)(_,{id:d,config:i}),(0,o.jsx)(g.h,{children:a})]})})});k.displayName="Chart";let _=e=>{let{id:t,config:r}=e,l=Object.entries(r).filter(e=>{let[,t]=e;return t.theme||t.color});return l.length?(0,o.jsx)("style",{dangerouslySetInnerHTML:{__html:Object.entries(y).map(e=>{let[r,o]=e;return"\n".concat(o," [data-chart=").concat(t,"] {\n").concat(l.map(e=>{var t;let[o,l]=e,n=(null===(t=l.theme)||void 0===t?void 0:t[r])||l.color;return n?" --color-".concat(o,": ").concat(n,";"):null}).join("\n"),"\n}\n")}).join("\n")}}):null},w=p.u,C=l.forwardRef((e,t)=>{let{active:r,payload:n,className:a,indicator:i="dot",hideLabel:s=!1,hideIndicator:c=!1,label:d,labelFormatter:u,labelClassName:v,formatter:h,color:f,nameKey:m,labelKey:g}=e,{config:p}=N(),x=l.useMemo(()=>{var e;if(s||!(null==n?void 0:n.length))return null;let[t]=n,r="".concat(g||t.dataKey||t.name||"value"),l=L(p,t,r),a=g||"string"!=typeof d?null==l?void 0:l.label:(null===(e=p[d])||void 0===e?void 0:e.label)||d;return u?(0,o.jsx)("div",{className:(0,b.cn)("font-medium",v),children:u(a,n)}):a?(0,o.jsx)("div",{className:(0,b.cn)("font-medium",v),children:a}):null},[d,u,n,s,v,p,g]);if(!r||!(null==n?void 0:n.length))return null;let y=1===n.length&&"dot"!==i;return(0,o.jsxs)("div",{ref:t,className:(0,b.cn)("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",a),children:[y?null:x,(0,o.jsx)("div",{className:"grid gap-1.5",children:n.map((e,t)=>{var r;let l="".concat(m||e.name||e.dataKey||"value"),n=L(p,e,l),a=f||(null===(r=e.payload)||void 0===r?void 0:r.fill)||e.color;return(0,o.jsx)("div",{className:(0,b.cn)("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground","dot"===i&&"items-center"),children:h&&(null==e?void 0:e.value)!==void 0&&e.name?h(e.value,e.name,e,t,e.payload):(0,o.jsxs)(o.Fragment,{children:[(null==n?void 0:n.icon)?(0,o.jsx)(n.icon,{}):!c&&(0,o.jsx)("div",{className:(0,b.cn)("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":"dot"===i,"w-1":"line"===i,"w-0 border-[1.5px] border-dashed bg-transparent":"dashed"===i,"my-0.5":y&&"dashed"===i}),style:{"--color-bg":a,"--color-border":a}}),(0,o.jsxs)("div",{className:(0,b.cn)("flex flex-1 justify-between leading-none",y?"items-end":"items-center"),children:[(0,o.jsxs)("div",{className:"grid gap-1.5",children:[y?x:null,(0,o.jsx)("span",{className:"text-muted-foreground",children:(null==n?void 0:n.label)||e.name})]}),e.value&&(0,o.jsx)("span",{className:"font-mono font-medium tabular-nums text-foreground",children:e.value.toLocaleString()})]})]})},String(e.dataKey))})})]})});C.displayName="ChartTooltip";let A=x.D,S=l.forwardRef((e,t)=>{let{className:r,hideIcon:l=!1,payload:n,verticalAlign:a="bottom",nameKey:i}=e,{config:s}=N();return(null==n?void 0:n.length)?(0,o.jsx)("div",{ref:t,className:(0,b.cn)("flex items-center justify-center gap-4","top"===a?"pb-3":"pt-3",r),children:n.map(e=>{let t="".concat(i||e.dataKey||"value"),r=L(s,e,t);return(0,o.jsxs)("div",{className:(0,b.cn)("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[(null==r?void 0:r.icon)&&!l?(0,o.jsx)(r.icon,{}):(0,o.jsx)("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:e.color}}),null==r?void 0:r.label]},e.value)})}):null});function L(e,t,r){if("object"!=typeof t||null===t)return;let o="payload"in t&&"object"==typeof t.payload&&null!==t.payload?t.payload:void 0,l=r;return r in t&&"string"==typeof t[r]?l=t[r]:o&&r in o&&"string"==typeof o[r]&&(l=o[r]),l in e?e[l]:e[r]}S.displayName="ChartLegend";var T=r(31031),E=r(56940),M=r(97059),H=r(62994),O=r(9234);let D=e=>{let{title:t,value:r,icon:l,description:n}=e;return(0,o.jsxs)(i.Zb,{children:[(0,o.jsxs)(i.Ol,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,o.jsx)(i.ll,{className:"text-sm font-medium",children:t}),(0,o.jsx)("div",{className:"h-4 w-4 text-muted-foreground",children:l})]}),(0,o.jsxs)(i.aY,{children:[(0,o.jsx)("div",{className:"text-2xl font-bold",children:"number"==typeof r?r.toLocaleString():r}),n&&(0,o.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:n})]})]})},F={create:"hsl(var(--chart-1))",update:"hsl(var(--chart-2))",delete:"hsl(var(--chart-3))",read:"hsl(var(--chart-4))",login:"hsl(var(--chart-5))",logout:"hsl(142, 76%, 36%)",upload:"hsl(262, 83%, 58%)",download:"hsl(24, 95%, 53%)"},R=e=>{if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,t)).toFixed(2))+" "+["B","KB","MB","GB","TB"][t]};var Z=()=>{var e,t,r,g;let p=(0,n.Ji)(),{schemas:x}=(0,a.I_)(),b=(0,l.useMemo)(()=>{let e=new Date;return e.setHours(e.getHours()-72),e.toISOString()},[]),{data:y,isLoading:j}=(0,n.EV)({url:"".concat(p,"/reports/stats"),method:"post",config:{payload:{stats:[{name:"total_users",collection:"baasix_User",query:{aggregate:{count:{function:"count",field:"id"}}}},{name:"total_files",collection:"baasix_File",query:{aggregate:{count:{function:"count",field:"id"}}}},{name:"total_storage",collection:"baasix_File",query:{aggregate:{totalSize:{function:"sum",field:"size"}}}},{name:"total_activities",collection:"baasix_AuditLog",query:{aggregate:{count:{function:"count",field:"id"}}}},{name:"activities_by_action",collection:"baasix_AuditLog",query:{groupBy:["action"],aggregate:{count:{function:"count",field:"id"}},filter:{createdAt:{gte:b}}}},{name:"activities_by_hour",collection:"baasix_AuditLog",query:{groupBy:["date:year:createdAt","date:month:createdAt","date:day:createdAt","date:hour:createdAt","action"],aggregate:{count:{function:"count",field:"id"}},filter:{createdAt:{gte:b}}}}]}}}),N=(0,l.useMemo)(()=>{var e,t,r,o,l,n,a,i,s,c,d,u,v,h,f;let m=null==y?void 0:null===(e=y.data)||void 0===e?void 0:e.data;if(!m)return null;let g=Number(null===(o=m.total_users)||void 0===o?void 0:null===(r=o.data)||void 0===r?void 0:null===(t=r[0])||void 0===t?void 0:t.count)||0,p=Number(null===(a=m.total_files)||void 0===a?void 0:null===(n=a.data)||void 0===n?void 0:null===(l=n[0])||void 0===l?void 0:l.count)||0,x=Number(null===(c=m.total_storage)||void 0===c?void 0:null===(s=c.data)||void 0===s?void 0:null===(i=s[0])||void 0===i?void 0:i.totalSize)||0,b=Number(null===(v=m.total_activities)||void 0===v?void 0:null===(u=v.data)||void 0===u?void 0:null===(d=u[0])||void 0===d?void 0:d.count)||0,j={};return null===(f=m.activities_by_action)||void 0===f||null===(h=f.data)||void 0===h||h.forEach(e=>{var t;let r=null===(t=e.action)||void 0===t?void 0:t.toLowerCase();r&&(j[r]=Number(e.count)||0)}),{totalUsers:g,totalFiles:p,totalStorage:x,totalActivities:b,actionBreakdown:j}},[y]),{chartConfig:_,uniqueActions:L}=(0,l.useMemo)(()=>{var e,t,r;let o=null==y?void 0:null===(r=y.data)||void 0===r?void 0:null===(t=r.data)||void 0===t?void 0:null===(e=t.activities_by_action)||void 0===e?void 0:e.data;if(!o)return{chartConfig:{},uniqueActions:[]};let l=o.map(e=>{var t;return null===(t=e.action)||void 0===t?void 0:t.toLowerCase()}).filter(Boolean),n={};return l.forEach((e,t)=>{n[e]={label:e.charAt(0).toUpperCase()+e.slice(1),color:F[e]||"hsl(".concat(47*t%360,", 70%, 50%)")}}),{chartConfig:n,uniqueActions:l}},[y]),Z=(0,l.useMemo)(()=>{var e,t,r;let o=null==y?void 0:null===(r=y.data)||void 0===r?void 0:null===(t=r.data)||void 0===t?void 0:null===(e=t.activities_by_hour)||void 0===e?void 0:e.data;if(!o||0===o.length)return[];let l=new Date;l.setMinutes(0,0,0);let n=[];for(let e=71;e>=0;e--){let t=new Date(l);t.setHours(t.getHours()-e);let r="";if(0===e)r="Now";else if(e<24)r="".concat(e,"h ago");else{let t=Math.floor(e/24),o=e%24;r=0===o?"".concat(t,"d ago"):"".concat(t,"d ").concat(o,"h")}n.push({hour:r,timestamp:t.getTime(),_year:t.getFullYear(),_month:t.getMonth()+1,_day:t.getDate(),_hour:t.getHours()})}return o.forEach(e=>{var t;let r=Number(e["date:year:createdAt"]),o=Number(e["date:month:createdAt"]),l=Number(e["date:day:createdAt"]),a=Number(e["date:hour:createdAt"]),i=null===(t=e.action)||void 0===t?void 0:t.toLowerCase(),s=Number(e.count)||0;if(!i)return;let c=n.find(e=>e._year===r&&e._month===o&&e._day===l&&e._hour===a);c&&(c[i]=(c[i]||0)+s)}),n.map(e=>{let{_year:t,_month:r,_day:o,_hour:l,...n}=e;return n})},[y]),q=(0,l.useMemo)(()=>(null==x?void 0:x.filter(e=>{var t;return!(null===(t=e.collectionName)||void 0===t?void 0:t.startsWith("baasix_"))}).length)||0,[x]);return(0,l.useEffect)(()=>{let e=window.localStorage.getItem("token");if(e){let t=new m.$;return t.connect("/",e),t.subscribe("baasix_Notification",{create:e=>{var t,r;f.Am.success(null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.title,{description:null==e?void 0:null===(r=e.data)||void 0===r?void 0:r.message})},update:e=>{var t,r;f.Am.info(null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.title,{description:null==e?void 0:null===(r=e.data)||void 0===r?void 0:r.message})},delete:e=>{var t,r;f.Am.error(null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.title,{description:null==e?void 0:null===(r=e.data)||void 0===r?void 0:r.message})}}).catch(e=>{console.error("Error subscribing to notification:",e)}),()=>{t.disconnect()}}},[]),(0,o.jsx)("div",{className:"flex-1 overflow-auto",children:(0,o.jsxs)("div",{className:"space-y-6 pb-6",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h1",{className:"text-2xl font-bold",children:"Dashboard"}),(0,o.jsx)("p",{className:"text-muted-foreground",children:"Overview of your application"})]}),(0,o.jsxs)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-5",children:[(0,o.jsx)(D,{title:"Total Users",value:null!==(e=null==N?void 0:N.totalUsers)&&void 0!==e?e:0,icon:(0,o.jsx)(s.Z,{className:"h-4 w-4"}),description:"Registered users"}),(0,o.jsx)(D,{title:"Collections",value:q,icon:(0,o.jsx)(c.Z,{className:"h-4 w-4"}),description:"".concat((null==x?void 0:x.length)||0," total (incl. system)")}),(0,o.jsx)(D,{title:"Total Files",value:null!==(t=null==N?void 0:N.totalFiles)&&void 0!==t?t:0,icon:(0,o.jsx)(d.Z,{className:"h-4 w-4"}),description:"Uploaded files"}),(0,o.jsx)(D,{title:"Storage Used",value:R(null!==(r=null==N?void 0:N.totalStorage)&&void 0!==r?r:0),icon:(0,o.jsx)(u.Z,{className:"h-4 w-4"}),description:"Total file storage"}),(0,o.jsx)(D,{title:"Total Activities",value:null!==(g=null==N?void 0:N.totalActivities)&&void 0!==g?g:0,icon:(0,o.jsx)(v.Z,{className:"h-4 w-4"}),description:"All time activities"})]}),(0,o.jsxs)(i.Zb,{children:[(0,o.jsxs)(i.Ol,{children:[(0,o.jsxs)(i.ll,{className:"flex items-center gap-2",children:[(0,o.jsx)(h.Z,{className:"h-5 w-5"}),"Activity Timeline"]}),(0,o.jsx)(i.SZ,{children:"Activity breakdown over the last 72 hours"})]}),(0,o.jsx)(i.aY,{children:!j&&L.length>0?(0,o.jsx)(k,{config:_,className:"h-[300px] w-full",children:(0,o.jsxs)(T.T,{data:Z,margin:{top:10,right:10,left:0,bottom:0},children:[(0,o.jsx)("defs",{children:L.map(e=>(0,o.jsxs)("linearGradient",{id:"fill-".concat(e),x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,o.jsx)("stop",{offset:"5%",stopColor:"var(--color-".concat(e,")"),stopOpacity:.8}),(0,o.jsx)("stop",{offset:"95%",stopColor:"var(--color-".concat(e,")"),stopOpacity:.1})]},e))}),(0,o.jsx)(E.q,{strokeDasharray:"3 3",vertical:!1}),(0,o.jsx)(M.K,{dataKey:"hour",tickLine:!1,axisLine:!1,tickMargin:8,interval:"preserveStartEnd",minTickGap:50}),(0,o.jsx)(H.B,{tickLine:!1,axisLine:!1,tickMargin:8,allowDecimals:!1}),(0,o.jsx)(w,{content:(0,o.jsx)(C,{})}),(0,o.jsx)(A,{content:(0,o.jsx)(S,{})}),L.map(e=>(0,o.jsx)(O.uN,{type:"monotone",dataKey:e,stackId:"1",stroke:"var(--color-".concat(e,")"),fill:"url(#fill-".concat(e,")")},e))]})}):(0,o.jsx)("div",{className:"flex items-center justify-center h-[300px] text-muted-foreground",children:j?"Loading activity data...":"No activity data available"})})]})]})})}},12438:function(e,t,r){"use strict";r.d(t,{$:function(){return l}});var o=r(68680);class l{connect(e,t){return this.socket=(0,o.io)(e,{auth:{token:t},path:"/realtime",reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3,reconnectionDelayMax:5e3,transports:["websocket","polling"]}),this._setupListeners(),this}_setupListeners(){this.socket&&(this.socket.on("connect",()=>{console.log("Connected to socket server"),this.subscriptions.forEach(e=>{this._subscribe(e)})}),this.socket.on("connected",e=>{console.log("Socket authenticated:",e)}),this.socket.on("disconnect",e=>{console.log("Disconnected from socket server:",e)}),this.socket.on("connect_error",e=>{console.error("Socket connection error:",e)}))}_subscribe(e){this.socket&&this.socket.emit("subscribe",{collection:e})}async subscribe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((r,o)=>{if(!this.socket){o(Error("Socket not connected"));return}this.socket.emit("subscribe",{collection:e},l=>{"success"===l.status?(this.subscriptions.add(e),["create","update","delete"].forEach(r=>{let o="".concat(e,":").concat(r),l=t[r];l&&(this.eventHandlers.has(o)&&this.socket.off(o,this.eventHandlers.get(o)),this.socket.on(o,l),this.eventHandlers.set(o,l))}),r()):o(Error(l.message))})})}async unsubscribe(e){return new Promise((t,r)=>{if(!this.socket){r(Error("Socket not connected"));return}this.socket.emit("unsubscribe",{collection:e},o=>{"success"===o.status?(this.subscriptions.delete(e),["create","update","delete"].forEach(t=>{let r="".concat(e,":").concat(t);this.eventHandlers.has(r)&&(this.socket.off(r,this.eventHandlers.get(r)),this.eventHandlers.delete(r))}),t()):r(Error(o.message))})})}disconnect(){this.socket&&(this.socket.disconnect(),this.subscriptions.clear(),this.eventHandlers.clear())}constructor(){this.socket=null,this.subscriptions=new Set,this.eventHandlers=new Map}}},79820:function(e,t,r){"use strict";r.d(t,{Ol:function(){return i},SZ:function(){return c},Zb:function(){return a},aY:function(){return d},eW:function(){return u},ll:function(){return s}});var o=r(57437),l=r(2265),n=r(93448);let a=l.forwardRef((e,t)=>{let{className:r,...l}=e;return(0,o.jsx)("div",{ref:t,className:(0,n.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",r),...l})});a.displayName="Card";let i=l.forwardRef((e,t)=>{let{className:r,...l}=e;return(0,o.jsx)("div",{ref:t,className:(0,n.cn)("flex flex-col space-y-1 p-4",r),...l})});i.displayName="CardHeader";let s=l.forwardRef((e,t)=>{let{className:r,...l}=e;return(0,o.jsx)("h3",{ref:t,className:(0,n.cn)("text-lg font-semibold leading-none tracking-tight",r),...l})});s.displayName="CardTitle";let c=l.forwardRef((e,t)=>{let{className:r,...l}=e;return(0,o.jsx)("p",{ref:t,className:(0,n.cn)("text-sm text-muted-foreground",r),...l})});c.displayName="CardDescription";let d=l.forwardRef((e,t)=>{let{className:r,...l}=e;return(0,o.jsx)("div",{ref:t,className:(0,n.cn)("p-4 pt-0",r),...l})});d.displayName="CardContent";let u=l.forwardRef((e,t)=>{let{className:r,...l}=e;return(0,o.jsx)("div",{ref:t,className:(0,n.cn)("flex items-center p-4 pt-0",r),...l})});u.displayName="CardFooter"},93448:function(e,t,r){"use strict";r.d(t,{cn:function(){return n}});var o=r(61994),l=r(53335);function n(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,l.m6)((0,o.W)(t))}},29696:function(e,t,r){"use strict";r.d(t,{A1:function(){return s},I_:function(){return i}});var o=r(57437),l=r(2265),n=r(72135);let a=(0,l.createContext)(void 0),i=()=>{let e=(0,l.useContext)(a);if(!e)throw Error("useSchema must be used within a SchemaProvider");return e};function s(e){let{children:t}=e,{data:r,isLoading:l,refetch:i}=(0,n.sm)({resource:"collections",queryOptions:{enabled:!0},sorters:[{field:"collectionName",order:"asc"}],pagination:{pageSize:500}}),s=(null==r?void 0:r.data)||[],c=e=>s.find(t=>t.collectionName===e),d=e=>{let t=c(e),r=null==t?void 0:t.schema.fields;if(r){let t={...r};for(let[e,r]of Object.entries(t))r.hidden&&delete t[e];return"baasix_Account"===e&&(delete t.password,delete t.accessToken,delete t.refreshToken,delete t.idToken),"baasix_Verification"===e&&delete t.value,"baasix_Sessions"===e&&delete t.token,t}return r},u=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(0===r)return[];let l=d(e);return l?Object.entries(l).map(e=>{let[l,n]=e,a=t?"".concat(t,".").concat(l):l,i=o?{title:n.relType?a+".*":a,value:n.relType?a+".*":a,key:n.relType?a+".*":a,isLeaf:!n.relType}:{title:a,value:a,key:a,isLeaf:!n.relType};return n.relType&&n.target&&(i.children=u(n.target,a,r-1,o)),i}):[]};return(0,o.jsx)(a.Provider,{value:{schemas:s,isLoading:l,refetch:i,getSchemaByName:c,getFieldsByCollection:d,getCollectionChoices:()=>s.map(e=>({label:e.schema.name,value:e.collectionName})),getTargetFields:e=>{let t=d(e);return t?Object.entries(t).map(e=>{let[t]=e;return{label:t,value:t}}):[]},formatRelationshipDisplay:(e,t)=>e&&t?null==t?void 0:t.split(",").map(t=>{let r=t.trim();return e[r]||r}).join(""):"",getNestedFields:e=>u(e),getPermissionFields:e=>[{title:"*",value:"*",key:"*",isLeaf:!0},...u(e,"",6,!0),{title:"*.*",value:"*.*",key:"*.*",isLeaf:!0},{title:"*.*.*",value:"*.*.*",key:"*.*.*",isLeaf:!0},{title:"*.*.*.*",value:"*.*.*.*",key:"*.*.*.*",isLeaf:!0}],isSortEnabled:e=>{var t;let r=c(e);return(null==r?void 0:null===(t=r.schema)||void 0===t?void 0:t.sortEnabled)===!0}},children:t})}}},function(e){e.O(0,[7999,5094,4438,4458,9090,2971,2117,1744],function(){return e(e.s=79728)}),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2760],{24654:function(){},57166:function(e,t,r){Promise.resolve().then(r.bind(r,7915))},7915:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return en}});var s=r(57437),a=r(2265),n=r(72135),l=r(99376),i=r(12381),o=r(90641),d=r(96246),c=r(32060),u=r(71488),f=r(27648),m=r(45114),x=r(81853),p=r(25466),h=r(50091),g=r(95805),b=r(48736),y=r(13781),v=r(98728),j=r(65621),N=r(30755),w=r(54001),k=r(85929),P=r(97226),C=r(47692);let S=[{key:"dashboard",icon:p.Z,href:"/dashboard",label:"Dashboard"},{key:"data-browser",icon:h.Z,href:"/data-browser",label:"Data Browser"},{key:"users",icon:g.Z,href:"/users/list",label:"Users"},{key:"file-manager",icon:b.Z,href:"/file-manager",label:"File Manager"},{key:"workflows",icon:y.Z,href:"/workflows",label:"Workflows"},{key:"settings",icon:v.Z,href:"/settings/roles",label:"Settings"},{key:"activity-log",icon:j.Z,href:"/activity-log/all-activity",label:"Activity Log"}],D=e=>{var t,r,a,p,h,g;let{selectedMenu:b,setSelectedMenu:y,onToggleSidebarSheet:v,showSidebarToggle:j}=e,D=(0,l.useRouter)(),{data:R}=(0,n.kS)(),{mutate:E}=(0,n.aU)(),{setMode:z,mode:T}=(0,m.Fg)(),{projectSettings:A}=(0,x.PY)(),_=(0,n.Ji)(),M="".concat("/admin","/logo-icon.svg"),Z=(null==A?void 0:null===(t=A.branding)||void 0===t?void 0:t.icon)||(null==A?void 0:null===(r=A.branding)||void 0===r?void 0:r["logo-light"]),L=Z&&_&&"/"!==_?"".concat(_,"/assets/").concat(Z):_&&"/"!==_?"".concat(_,"/assets/project_icon"):M,F=(null==A?void 0:A.color)||"#663399",O=function(e){let t=e.replace("#",""),r=parseInt(t.substring(0,2),16);return(.299*r+.587*parseInt(t.substring(2,4),16)+.114*parseInt(t.substring(4,6),16))/255>.5}(F),V=O?"#1a1a2e":"#ffffff",I=O?"rgba(0, 0, 0, 0.1)":"rgba(255, 255, 255, 0.1)",Y=O?"rgba(0, 0, 0, 0.15)":"rgba(255, 255, 255, 0.2)",U=O?"rgba(0, 0, 0, 0.1)":"rgba(255, 255, 255, 0.1)";return(0,s.jsxs)("div",{className:"flex flex-col h-screen w-[60px] border-r fixed left-0 top-0 z-50",style:{backgroundColor:F,borderColor:U,color:V},children:[(0,s.jsx)("div",{className:"p-2 flex justify-center border-b",style:{borderColor:U},children:(0,s.jsx)(f.default,{href:"/",children:(0,s.jsx)("img",{alt:"logo",src:L,className:"w-10 h-10 object-contain",onError:e=>{e.target.src=M}})})}),j&&(0,s.jsx)("div",{className:"p-2 flex justify-center border-b md:hidden",style:{borderColor:U},children:(0,s.jsxs)(u.u,{children:[(0,s.jsx)(u.aJ,{asChild:!0,children:(0,s.jsx)(i.z,{variant:"ghost",size:"icon",className:"w-10 h-10",style:{color:V},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=I},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent"},onClick:v,children:(0,s.jsx)(N.Z,{className:"h-5 w-5"})})}),(0,s.jsx)(u._v,{side:"right",children:(0,s.jsx)("p",{children:"Toggle Menu"})})]})}),(0,s.jsx)(o.x,{className:"flex-1 py-2",children:(0,s.jsx)("div",{className:"flex flex-col items-center gap-1",children:S.map(e=>(0,s.jsxs)(u.u,{children:[(0,s.jsx)(u.aJ,{asChild:!0,children:(0,s.jsx)(i.z,{variant:"ghost",size:"icon",className:"w-10 h-10",style:{color:V,backgroundColor:b===e.key?Y:"transparent"},onMouseEnter:t=>{b!==e.key&&(t.currentTarget.style.backgroundColor=I)},onMouseLeave:t=>{b!==e.key&&(t.currentTarget.style.backgroundColor="transparent")},onClick:()=>{y(e.key),D.push(e.href)},children:(0,s.jsx)(e.icon,{className:"h-5 w-5"})})}),(0,s.jsx)(u._v,{side:"right",children:(0,s.jsx)("p",{children:e.label})})]},e.key))})}),(0,s.jsx)("div",{className:"p-2 border-t flex justify-center",style:{borderColor:U},children:(0,s.jsxs)(c.h_,{children:[(0,s.jsx)(c.$F,{asChild:!0,children:(0,s.jsx)(i.z,{variant:"ghost",size:"icon",className:"rounded-full",style:{color:V},children:(0,s.jsxs)(d.qE,{className:"h-8 w-8",children:[(0,s.jsx)(d.F$,{src:null==R?void 0:R.avatar}),(0,s.jsxs)(d.Q5,{style:{backgroundColor:I,color:V},children:[null==R?void 0:null===(p=R.firstName)||void 0===p?void 0:null===(a=p.charAt(0))||void 0===a?void 0:a.toUpperCase(),null==R?void 0:null===(g=R.lastName)||void 0===g?void 0:null===(h=g.charAt(0))||void 0===h?void 0:h.toUpperCase()]})]})})}),(0,s.jsxs)(c.AW,{align:"end",side:"right",className:"w-56",children:[(0,s.jsx)(c.Ju,{children:(null==R?void 0:R.fullName)||"".concat((null==R?void 0:R.firstName)||""," ").concat((null==R?void 0:R.lastName)||"").trim()}),(0,s.jsx)(c.VD,{}),(0,s.jsx)(c.Xi,{asChild:!0,children:(0,s.jsxs)(f.default,{href:"/change-password",children:[(0,s.jsx)(w.Z,{className:"mr-2 h-4 w-4"}),"Change Password"]})}),(0,s.jsx)(c.Xi,{onClick:()=>z(),children:"dark"===T?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(k.Z,{className:"mr-2 h-4 w-4"}),"Light Mode"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(P.Z,{className:"mr-2 h-4 w-4"}),"Dark Mode"]})}),(0,s.jsx)(c.VD,{}),(0,s.jsxs)(c.Xi,{onClick:()=>E(),children:[(0,s.jsx)(C.Z,{className:"mr-2 h-4 w-4"}),"Logout"]})]})]})})]})};var R=r(93448),E=r(40279),z=r(29696),T=r(73247);let A=e=>{let{selectedMenu:t,selectedSubMenu:r,onSelectSubMenu:n}=e,d=(0,l.useRouter)(),{schemas:c}=(0,z.I_)(),{isMultiTenant:u}=(0,x.PY)(),[f,m]=(0,a.useState)("");a.useEffect(()=>{m("")},[t]);let p=(0,a.useMemo)(()=>{let e=c||[],t=f.toLowerCase().trim();return e.filter(e=>{var t;return!(null===(t=e.collectionName)||void 0===t?void 0:t.startsWith("baasix_"))}).filter(e=>{var r,s,a;if(!t)return!0;let n=(null==e?void 0:null===(s=e.schema)||void 0===s?void 0:null===(r=s.name)||void 0===r?void 0:r.toLowerCase())||"",l=(null==e?void 0:null===(a=e.collectionName)||void 0===a?void 0:a.toLowerCase())||"";return n.includes(t)||l.includes(t)})},[c,f]),h=(e,r)=>{switch(n(e),t){case"data-browser":d.push("/data-browser/?collection=".concat(e,"&schema=").concat(encodeURIComponent(r||"")));break;case"users":d.push("/users/".concat(e,"/"));break;case"file-manager":d.push("/file-manager/".concat(e,"/"));break;case"settings":d.push("/settings/".concat(e,"/"));break;case"activity-log":d.push("/activity-log/".concat(e,"/"))}},g=e=>(0,s.jsx)(i.z,{variant:r===e.collectionName?"secondary":"ghost",className:(0,R.cn)("w-full justify-start text-sm",r===e.collectionName&&"bg-accent"),onClick:()=>{var t;return h(e.collectionName,null===(t=e.schema)||void 0===t?void 0:t.name)},children:e.collectionName},e.collectionName);return(0,s.jsx)("div",{className:"flex flex-col h-full w-full border-r bg-sidebar overflow-hidden",children:(()=>{switch(t){case"data-browser":return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"p-2 border-b",children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(T.Z,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),(0,s.jsx)(E.I,{placeholder:"Search collections...",value:f,onChange:e=>m(e.target.value),className:"pl-8"})]})}),(0,s.jsx)(o.x,{className:"flex-1",children:(0,s.jsx)("div",{className:"p-2 space-y-1",children:p.length>0?p.map(g):(0,s.jsx)("p",{className:"text-sm text-muted-foreground px-2 py-1",children:"No collections found"})})})]});case"users":return(0,s.jsx)(o.x,{className:"flex-1",children:(0,s.jsx)("div",{className:"p-2 space-y-1",children:[{key:"list",label:"Users List"},{key:"invites",label:"Invites"},{key:"user-roles",label:"User Roles"},{key:"preferences",label:"Preferences"}].map(e=>(0,s.jsx)(i.z,{variant:r===e.key?"secondary":"ghost",className:(0,R.cn)("w-full justify-start text-sm",r===e.key&&"bg-accent"),onClick:()=>h(e.key),children:e.label},e.key))})});case"settings":let e=[{key:"roles",label:"Roles"},{key:"permissions",label:"Permissions"},{key:"schema",label:"Collections"},{key:"tasks",label:"Tasks"},{key:"migrations",label:"Migrations"},{key:"templates",label:"Email Templates"}];return u&&e.push({key:"tenants",label:"Tenants"}),e.push({key:"project",label:"Project Settings"}),(0,s.jsx)(o.x,{className:"flex-1",children:(0,s.jsx)("div",{className:"p-2 space-y-1",children:e.map(e=>(0,s.jsx)(i.z,{variant:r===e.key?"secondary":"ghost",className:(0,R.cn)("w-full justify-start text-sm",r===e.key&&"bg-accent"),onClick:()=>h(e.key),children:e.label},e.key))})});case"activity-log":return(0,s.jsx)(o.x,{className:"flex-1",children:(0,s.jsx)("div",{className:"p-2 space-y-1",children:[{key:"all-activity",label:"All Activity"},{key:"email-log",label:"Email Log"},{key:"notifications",label:"Notifications"},{key:"sessions",label:"Sessions"},{key:"workflow-executions",label:"Workflow Executions"},{key:"workflow-logs",label:"Workflow Logs"}].map(e=>(0,s.jsx)(i.z,{variant:r===e.key?"secondary":"ghost",className:(0,R.cn)("w-full justify-start text-sm",r===e.key&&"bg-accent"),onClick:()=>h(e.key),children:e.label},e.key))})});default:return null}})()})};var _=r(82809),M=r(91032);let Z=e=>{let{children:t}=e,r=(0,l.usePathname)(),n=(0,l.useSearchParams)(),[i,o]=(0,a.useState)("data-browser"),[d,c]=(0,a.useState)(""),[u,f]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=r.split("/").filter(Boolean);if(e.length>0){if(o(e[0]),"data-browser"===e[0]){let e=n.get("collection");e?c(e):c("")}else e.length>1?c(e[1]):c("")}},[r,n]);let m=e=>{c(e),f(!1)},x=r.startsWith("/settings/templates/edit"),p="file-manager"!==i&&"dashboard"!==i&&"workflows"!==i&&"change-password"!==i&&!x;return(0,s.jsxs)("div",{className:"h-screen flex flex-col",children:[(0,s.jsx)(D,{selectedMenu:i,setSelectedMenu:e=>{o(e),c("")},onToggleSidebarSheet:()=>f(!0),showSidebarToggle:p}),(0,s.jsx)("div",{className:"ml-[60px] flex-1 flex flex-col overflow-hidden",children:p?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"hidden md:flex flex-1 overflow-hidden",children:(0,s.jsxs)(_.pO,{direction:"horizontal",className:"flex-1",children:[(0,s.jsx)(_.ee,{defaultSize:15,minSize:10,maxSize:25,className:"flex flex-col",children:(0,s.jsx)(A,{selectedMenu:i,selectedSubMenu:d,onSelectSubMenu:m})}),(0,s.jsx)(_.Dp,{withHandle:!0}),(0,s.jsx)(_.ee,{defaultSize:85,className:"flex flex-col",children:(0,s.jsx)("main",{className:"p-4 flex-1 overflow-hidden flex flex-col",children:t})})]})}),(0,s.jsx)(M.yo,{open:u,onOpenChange:f,children:(0,s.jsxs)(M.ue,{side:"left",className:"w-[280px] p-0 left-[60px]",children:[(0,s.jsx)(M.bC,{className:"sr-only",children:"Navigation Menu"}),(0,s.jsx)(A,{selectedMenu:i,selectedSubMenu:d,onSelectSubMenu:m})]})}),(0,s.jsx)("main",{className:"p-4 flex-1 overflow-hidden flex flex-col md:hidden",children:t})]}):(0,s.jsx)("main",{className:"p-4 flex-1 overflow-hidden flex flex-col",children:t})})]})};var L=r(63751);let F=String.fromCharCode(104,116,116,112,115,58,47,47,119,119,119,46,98,97,97,115,105,120,46,99,111,109,47,97,112,105,47,118,101,114,105,102,121,45,108,105,99,101,110,115,101),O=(0,a.createContext)({status:"loading",subscriptionData:null,error:null,isLoading:!0,isValid:!1,refetch:async()=>{}}),V=()=>a.useContext(O)||(console.warn("useSubscription used outside of SubscriptionProvider, using defaults"),{status:"loading",subscriptionData:null,error:null,isLoading:!0,isValid:!1,refetch:async()=>{}}),I=e=>{let{children:t}=e,[r,n]=(0,a.useState)("loading"),[l,i]=(0,a.useState)(null),[o,d]=(0,a.useState)(null),c=(0,a.useCallback)(async()=>{var e,t,r,s,a;let l=window.location.hostname;"localhost"===l||"127.0.0.1"===l||"0.0.0.0"===l||l.endsWith(".local")||l.endsWith(".localhost"),n("loading"),d(null);try{let r=new AbortController,s=setTimeout(()=>r.abort(),15e3),a=await fetch(F,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({domain:l}),signal:r.signal});if(clearTimeout(s),!a.ok){let e="Failed to verify subscription";try{e=(await a.json()).error||e}catch(e){}n("error"),d({type:"unknown",message:"Subscription verification failed",details:"Server responded with status ".concat(a.status,": ").concat(e)}),i(null);return}let o=await a.json();if(o.subscribed)n("valid"),i({subscribed:!0,domain:o.domain,plan:o.plan,expiresAt:o.expiresAt,inGracePeriod:o.inGracePeriod,gracePeriodDaysRemaining:o.gracePeriodDaysRemaining,message:o.message}),d(null);else{n("invalid"),i({subscribed:!1,domain:o.domain,plan:o.plan,expiresAt:o.expiresAt,message:o.message});let r="not_found";((null===(e=o.message)||void 0===e?void 0:e.toLowerCase().includes("expired"))||(null===(t=o.message)||void 0===t?void 0:t.toLowerCase().includes("grace period ended")))&&(r="expired"),d({type:r,message:o.message||"No active subscription found for this domain"})}}catch(e){n("error"),"AbortError"===e.name?d({type:"network",message:"Connection timed out",details:"The subscription verification request took too long to complete. Please check your internet connection and try again."}):(null===(r=e.message)||void 0===r?void 0:r.includes("Failed to fetch"))||(null===(s=e.message)||void 0===s?void 0:s.includes("NetworkError"))||(null===(a=e.message)||void 0===a?void 0:a.includes("Network request failed"))?d({type:"network",message:"Network error",details:"Unable to connect to the Baasix license server. Please check your internet connection and try again."}):d({type:"unknown",message:"Verification failed",details:e.message||"An unexpected error occurred while verifying the subscription."}),i(null)}},[]);return(0,a.useEffect)(()=>{c()},[c]),(0,s.jsx)(O.Provider,{value:{status:r,subscriptionData:l,error:o,isLoading:"loading"===r,isValid:"valid"===r,refetch:c},children:t})};var Y=r(75395),U=r(49322),q=r(91723),W=r(83578),B=r(99388),$=r(82431),G=r(96362);function J(e){let{status:t,error:r,subscriptionData:n,onRetry:l}=e,[i,o]=a.useState(!1),d=async()=>{o(!0),await l(),o(!1)};return(0,s.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-slate-900 via-slate-800 to-slate-900 flex items-center justify-center p-4",children:(0,s.jsxs)("div",{className:"max-w-md w-full",children:[(0,s.jsxs)("div",{className:"bg-white dark:bg-slate-800 rounded-2xl shadow-2xl overflow-hidden",children:[(0,s.jsxs)("div",{className:"bg-gradient-to-r from-indigo-600 to-blue-600 px-6 py-8 text-center",children:[(0,s.jsx)("div",{className:"inline-flex items-center justify-center w-20 h-20 bg-white/20 rounded-full mb-4",children:(()=>{if("error"===t)return(null==r?void 0:r.type)==="network"?(0,s.jsx)(Y.Z,{className:"h-16 w-16 text-orange-500"}):(0,s.jsx)(U.Z,{className:"h-16 w-16 text-red-500"});switch(null==r?void 0:r.type){case"expired":return(0,s.jsx)(q.Z,{className:"h-16 w-16 text-amber-500"});case"not_found":return(0,s.jsx)(W.Z,{className:"h-16 w-16 text-red-500"});default:return(0,s.jsx)(B.Z,{className:"h-16 w-16 text-red-500"})}})()}),(0,s.jsx)("h1",{className:"text-2xl font-bold text-white",children:(()=>{if("error"===t)return(null==r?void 0:r.type)==="network"?"Connection Error":"Verification Error";switch(null==r?void 0:r.type){case"expired":return"Subscription Expired";case"not_found":return"No Active Subscription";default:return"Subscription Required"}})()})]}),(0,s.jsxs)("div",{className:"px-6 py-8",children:[(0,s.jsx)("p",{className:"text-slate-600 dark:text-slate-300 text-center mb-6",children:"error"===t&&(null==r?void 0:r.type)==="network"?"We couldn't connect to the Baasix license server to verify your subscription.":(null==r?void 0:r.type)==="expired"?"Your Baasix subscription has expired. Please renew to continue using the admin panel.":"A valid Baasix subscription is required to use this admin panel."}),r&&(0,s.jsxs)("div",{className:"bg-slate-100 dark:bg-slate-700/50 rounded-lg p-4 mb-6",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold text-slate-700 dark:text-slate-300 mb-2",children:"Error Details"}),(0,s.jsx)("p",{className:"text-sm text-slate-600 dark:text-slate-400",children:r.message}),r.details&&(0,s.jsx)("p",{className:"text-xs text-slate-500 dark:text-slate-500 mt-2",children:r.details})]}),(null==n?void 0:n.domain)&&(0,s.jsxs)("div",{className:"bg-slate-100 dark:bg-slate-700/50 rounded-lg p-4 mb-6",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)("span",{className:"text-sm text-slate-500 dark:text-slate-400",children:"Domain"}),(0,s.jsx)("span",{className:"text-sm font-mono text-slate-700 dark:text-slate-300",children:n.domain})]}),n.plan&&(0,s.jsxs)("div",{className:"flex justify-between items-center mt-2",children:[(0,s.jsx)("span",{className:"text-sm text-slate-500 dark:text-slate-400",children:"Previous Plan"}),(0,s.jsx)("span",{className:"text-sm font-medium text-slate-700 dark:text-slate-300 capitalize",children:n.plan})]}),n.expiresAt&&(0,s.jsxs)("div",{className:"flex justify-between items-center mt-2",children:[(0,s.jsx)("span",{className:"text-sm text-slate-500 dark:text-slate-400",children:"Expired On"}),(0,s.jsx)("span",{className:"text-sm text-slate-700 dark:text-slate-300",children:new Date(n.expiresAt).toLocaleDateString()})]})]}),(0,s.jsxs)("div",{className:"space-y-3",children:["error"===t&&(0,s.jsxs)("button",{onClick:d,disabled:i,className:"w-full flex items-center justify-center gap-2 bg-slate-100 dark:bg-slate-700 hover:bg-slate-200 dark:hover:bg-slate-600 text-slate-700 dark:text-slate-300 font-medium py-3 px-4 rounded-lg transition-colors disabled:opacity-50",children:[(0,s.jsx)($.Z,{className:"h-4 w-4 ".concat(i?"animate-spin":"")}),i?"Retrying...":"Try Again"]}),(0,s.jsxs)("a",{href:"https://www.baasix.com/#pricing",target:"_blank",rel:"noopener noreferrer",className:"w-full flex items-center justify-center gap-2 bg-gradient-to-r from-indigo-600 to-blue-600 hover:from-indigo-700 hover:to-blue-700 text-white font-medium py-3 px-4 rounded-lg transition-all shadow-lg shadow-indigo-500/25",children:[(null==r?void 0:r.type)==="expired"?"Renew Subscription":"Get Subscription",(0,s.jsx)(G.Z,{className:"h-4 w-4"})]}),(0,s.jsxs)("a",{href:"https://www.baasix.com",target:"_blank",rel:"noopener noreferrer",className:"w-full flex items-center justify-center gap-2 text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-300 font-medium py-2 px-4 rounded-lg transition-colors",children:["Visit baasix.com",(0,s.jsx)(G.Z,{className:"h-4 w-4"})]})]})]}),(0,s.jsx)("div",{className:"bg-slate-50 dark:bg-slate-900/50 px-6 py-4 text-center border-t border-slate-200 dark:border-slate-700",children:(0,s.jsxs)("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:["Need help?"," ",(0,s.jsx)("a",{href:"mailto:support@baasix.com",className:"text-indigo-600 dark:text-indigo-400 hover:underline",children:"Contact support"})]})})]}),(0,s.jsx)("div",{className:"mt-6 text-center",children:(0,s.jsxs)("p",{className:"text-slate-400 text-sm",children:["Starting at just"," ",(0,s.jsx)("span",{className:"text-white font-semibold",children:"$9.99/year"})," per domain"]})})]})})}var X=r(76865),H=r(30767);function Q(e){if(!e)return null;let t=new Date(e),r=new Date;return Math.ceil((t.getTime()-r.getTime())/864e5)}function K(){let e=new Date().toISOString().split("T")[0];return"".concat("baasix_subscription_warning_dismissed","_").concat(e)}function ee(e){let{subscriptionData:t}=e,[r,n]=(0,a.useState)(!1),[l,i]=(0,a.useState)(null);(0,a.useEffect)(()=>{if(!t||"development"===t.plan||"lifetime"===t.plan)return;let e=K();if("true"===sessionStorage.getItem(e))return;if(t.inGracePeriod){i("grace"),n(!0);return}let r=Q(t.expiresAt);null!==r&&r<=14&&(i("expiring"),n(!0))},[t]);let o=()=>{let e=K();sessionStorage.setItem(e,"true"),n(!1)};if(!t||!l)return null;let d=Q(t.expiresAt),c=t.gracePeriodDaysRemaining;return(0,s.jsx)(H.aR,{open:r,onOpenChange:n,children:(0,s.jsxs)(H._T,{className:"max-w-md",children:[(0,s.jsx)(H.fY,{children:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:["grace"===l?(0,s.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-red-100 dark:bg-red-900/30",children:(0,s.jsx)(X.Z,{className:"h-5 w-5 text-red-600 dark:text-red-400"})}):(0,s.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-amber-100 dark:bg-amber-900/30",children:(0,s.jsx)(q.Z,{className:"h-5 w-5 text-amber-600 dark:text-amber-400"})}),(0,s.jsx)(H.f$,{className:"text-left",children:"grace"===l?"Subscription Expired - Grace Period ends in "+(c?" ".concat(c," ").concat(1===c?"day":"days"):""):"Subscription Expiring On"+(t.expiresAt?" ".concat(new Date(t.expiresAt).toLocaleDateString()):"")})]})}),(0,s.jsxs)("div",{className:"space-y-4 text-sm text-muted-foreground",children:["grace"===l?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{children:["Your Baasix subscription has expired. You are currently in the"," ",(0,s.jsx)("strong",{children:"grace period"}),"."]}),(0,s.jsxs)("div",{className:"rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 p-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm text-red-700 dark:text-red-300",children:"Grace period remaining"}),(0,s.jsxs)("span",{className:"text-lg font-bold text-red-600 dark:text-red-400",children:[c," ",1===c?"day":"days"]})]}),(0,s.jsx)("p",{className:"mt-2 text-xs text-red-600 dark:text-red-400",children:"After the grace period ends, you will lose access to the admin panel."})]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{children:"Your Baasix subscription will expire soon. Renew now to avoid any interruption in service."}),(0,s.jsxs)("div",{className:"rounded-lg bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800 p-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm text-amber-700 dark:text-amber-300",children:"Days until expiry"}),(0,s.jsxs)("span",{className:"text-lg font-bold text-amber-600 dark:text-amber-400",children:[d," ",1===d?"day":"days"]})]}),t.expiresAt&&(0,s.jsxs)("p",{className:"mt-2 text-xs text-amber-600 dark:text-amber-400",children:["Expires on"," ",new Date(t.expiresAt).toLocaleDateString(void 0,{weekday:"long",year:"numeric",month:"long",day:"numeric"})]})]})]}),(0,s.jsxs)("div",{className:"text-xs text-muted-foreground",children:["Domain: ",(0,s.jsx)("span",{className:"font-mono",children:t.domain})]})]}),(0,s.jsxs)(H.xo,{className:"flex-col sm:flex-row gap-2",children:[(0,s.jsx)(H.le,{onClick:o,className:"sm:order-1",children:"Remind Me Later"}),(0,s.jsxs)(H.OL,{onClick:()=>{window.open("https://www.baasix.com/#pricing","_blank"),o()},className:"grace"===l?"bg-red-600 hover:bg-red-700 sm:order-2":"bg-amber-600 hover:bg-amber-700 sm:order-2",children:["Renew Now",(0,s.jsx)(G.Z,{className:"ml-2 h-4 w-4"})]})]})]})})}function et(e){let{children:t}=e,{status:r,error:a,subscriptionData:n,isLoading:l,refetch:i}=V();return l?(0,s.jsx)("div",{className:"flex h-screen w-screen items-center justify-center bg-background",children:(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("div",{className:"h-8 w-8 mx-auto animate-spin rounded-full border-4 border-primary border-t-transparent"}),(0,s.jsx)("p",{className:"mt-4 text-muted-foreground",children:"Verifying setup..."})]})}):"invalid"===r||"error"===r?(0,s.jsx)(J,{status:r,error:a,subscriptionData:n,onRetry:i}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ee,{subscriptionData:n}),t]})}function er(e){let{children:t}=e;return(0,s.jsx)(I,{children:(0,s.jsx)(et,{children:t})})}function es(){return(0,s.jsx)("div",{className:"flex h-screen w-screen items-center justify-center",children:(0,s.jsx)("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})})}function ea(e){let{children:t}=e,r=(0,l.useRouter)(),{data:i,isLoading:o}=(0,n.kq)();return((0,a.useEffect)(()=>{o||(null==i?void 0:i.authenticated)!==!1||r.replace("/login")},[o,i,r]),!o&&(null==i?void 0:i.authenticated))?(0,s.jsx)(er,{children:(0,s.jsx)(z.A1,{children:(0,s.jsx)(L.CE,{children:(0,s.jsx)(Z,{children:t})})})}):(0,s.jsx)(es,{})}function en(e){let{children:t}=e;return(0,s.jsx)(a.Suspense,{fallback:(0,s.jsx)(es,{}),children:(0,s.jsx)(ea,{children:t})})}},30767:function(e,t,r){"use strict";r.d(t,{OL:function(){return g},_T:function(){return f},aR:function(){return o},f$:function(){return p},fY:function(){return m},le:function(){return b},vW:function(){return d},xo:function(){return x},yT:function(){return h}});var s=r(57437),a=r(2265),n=r(16720),l=r(93448),i=r(12381);let o=n.fC,d=n.xz,c=n.h_,u=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(n.aV,{className:(0,l.cn)("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...a,ref:t})});u.displayName="AlertDialogOverlay";let f=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsxs)(c,{children:[(0,s.jsx)(u,{}),(0,s.jsx)(n.VY,{ref:t,className:(0,l.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg",r),...a})]})});f.displayName="AlertDialogContent";let m=e=>{let{className:t,...r}=e;return(0,s.jsx)("div",{className:(0,l.cn)("flex flex-col space-y-2 text-center sm:text-left",t),...r})};m.displayName="AlertDialogHeader";let x=e=>{let{className:t,...r}=e;return(0,s.jsx)("div",{className:(0,l.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...r})};x.displayName="AlertDialogFooter";let p=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(n.Dx,{ref:t,className:(0,l.cn)("text-lg font-semibold",r),...a})});p.displayName="AlertDialogTitle";let h=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(n.dk,{ref:t,className:(0,l.cn)("text-sm text-muted-foreground",r),...a})});h.displayName="AlertDialogDescription";let g=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(n.aU,{ref:t,className:(0,l.cn)((0,i.d)(),r),...a})});g.displayName="AlertDialogAction";let b=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(n.$j,{ref:t,className:(0,l.cn)((0,i.d)({variant:"outline"}),"mt-2 sm:mt-0",r),...a})});b.displayName="AlertDialogCancel"},96246:function(e,t,r){"use strict";r.d(t,{F$:function(){return o},Q5:function(){return d},qE:function(){return i}});var s=r(57437),a=r(2265),n=r(27954),l=r(93448);let i=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(n.fC,{ref:t,className:(0,l.cn)("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",r),...a})});i.displayName=n.fC.displayName;let o=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(n.Ee,{ref:t,className:(0,l.cn)("aspect-square h-full w-full",r),...a})});o.displayName=n.Ee.displayName;let d=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(n.NY,{ref:t,className:(0,l.cn)("flex h-full w-full items-center justify-center rounded-full bg-muted",r),...a})});d.displayName=n.NY.displayName},12381:function(e,t,r){"use strict";r.d(t,{d:function(){return o},z:function(){return d}});var s=r(57437),a=r(2265),n=r(37053),l=r(90535),i=r(93448);let o=(0,l.j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),d=a.forwardRef((e,t)=>{let{className:r,variant:a,size:l,asChild:d=!1,...c}=e,u=d?n.g7:"button";return(0,s.jsx)(u,{className:(0,i.cn)(o({variant:a,size:l,className:r})),ref:t,...c})});d.displayName="Button"},32060:function(e,t,r){"use strict";r.d(t,{$F:function(){return u},AW:function(){return f},Ju:function(){return x},VD:function(){return p},Xi:function(){return m},h_:function(){return c}});var s=r(57437),a=r(2265),n=r(28119),l=r(10407),i=r(30401),o=r(40519),d=r(93448);let c=n.fC,u=n.xz;n.ZA,n.Uv,n.Tr,n.Ee,a.forwardRef((e,t)=>{let{className:r,inset:a,children:i,...o}=e;return(0,s.jsxs)(n.fF,{ref:t,className:(0,d.cn)("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",a&&"pl-8",r),...o,children:[i,(0,s.jsx)(l.Z,{className:"ml-auto h-4 w-4"})]})}).displayName=n.fF.displayName,a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(n.tu,{ref:t,className:(0,d.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r),...a})}).displayName=n.tu.displayName;let f=a.forwardRef((e,t)=>{let{className:r,sideOffset:a=4,...l}=e;return(0,s.jsx)(n.Uv,{children:(0,s.jsx)(n.VY,{ref:t,sideOffset:a,className:(0,d.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r),...l})})});f.displayName=n.VY.displayName;let m=a.forwardRef((e,t)=>{let{className:r,inset:a,...l}=e;return(0,s.jsx)(n.ck,{ref:t,className:(0,d.cn)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a&&"pl-8",r),...l})});m.displayName=n.ck.displayName,a.forwardRef((e,t)=>{let{className:r,children:a,checked:l,...o}=e;return(0,s.jsxs)(n.oC,{ref:t,className:(0,d.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),checked:l,...o,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(n.wU,{children:(0,s.jsx)(i.Z,{className:"h-4 w-4"})})}),a]})}).displayName=n.oC.displayName,a.forwardRef((e,t)=>{let{className:r,children:a,...l}=e;return(0,s.jsxs)(n.Rk,{ref:t,className:(0,d.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),...l,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(n.wU,{children:(0,s.jsx)(o.Z,{className:"h-2 w-2 fill-current"})})}),a]})}).displayName=n.Rk.displayName;let x=a.forwardRef((e,t)=>{let{className:r,inset:a,...l}=e;return(0,s.jsx)(n.__,{ref:t,className:(0,d.cn)("px-2 py-1.5 text-sm font-semibold",a&&"pl-8",r),...l})});x.displayName=n.__.displayName;let p=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(n.Z0,{ref:t,className:(0,d.cn)("-mx-1 my-1 h-px bg-muted",r),...a})});p.displayName=n.Z0.displayName},40279:function(e,t,r){"use strict";r.d(t,{I:function(){return l}});var s=r(57437),a=r(2265),n=r(93448);let l=a.forwardRef((e,t)=>{let{className:r,type:a,...l}=e;return(0,s.jsx)("input",{type:a,className:(0,n.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),ref:t,...l})});l.displayName="Input"},82809:function(e,t,r){"use strict";r.d(t,{Dp:function(){return d},ee:function(){return o},pO:function(){return i}});var s=r(57437),a=r(41905),n=r(23374),l=r(93448);let i=e=>{let{className:t,...r}=e;return(0,s.jsx)(n.eh,{className:(0,l.cn)("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),...r})},o=n.s_,d=e=>{let{withHandle:t,className:r,...i}=e;return(0,s.jsx)(n.OT,{className:(0,l.cn)("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",r),...i,children:t&&(0,s.jsx)("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:(0,s.jsx)(a.Z,{className:"h-2.5 w-2.5"})})})}},90641:function(e,t,r){"use strict";r.d(t,{x:function(){return i}});var s=r(57437),a=r(2265),n=r(43643),l=r(93448);let i=a.forwardRef((e,t)=>{let{className:r,children:a,...i}=e;return(0,s.jsxs)(n.fC,{ref:t,className:(0,l.cn)("relative overflow-hidden",r),...i,children:[(0,s.jsx)(n.l_,{className:"h-full w-full rounded-[inherit]",children:a}),(0,s.jsx)(o,{}),(0,s.jsx)(n.Ns,{})]})});i.displayName=n.fC.displayName;let o=a.forwardRef((e,t)=>{let{className:r,orientation:a="vertical",...i}=e;return(0,s.jsx)(n.gb,{ref:t,orientation:a,className:(0,l.cn)("flex touch-none select-none transition-colors","vertical"===a&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===a&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",r),...i,children:(0,s.jsx)(n.q4,{className:"relative flex-1 rounded-full bg-border"})})});o.displayName=n.gb.displayName},91032:function(e,t,r){"use strict";r.d(t,{Ei:function(){return b},FF:function(){return h},Tu:function(){return p},bC:function(){return g},sw:function(){return c},ue:function(){return x},yo:function(){return d}});var s=r(57437),a=r(2265),n=r(70001),l=r(90535),i=r(32489),o=r(93448);let d=n.fC;n.xz;let c=n.x8,u=n.h_,f=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(n.aV,{className:(0,o.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...a,ref:t})});f.displayName=n.aV.displayName;let m=(0,l.j)("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out overflow-hidden",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-full sm:w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-full sm:w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right"}},defaultVariants:{side:"right"}}),x=a.forwardRef((e,t)=>{let{side:r="right",className:a,children:l,hideDefaultClose:d=!1,...c}=e;return(0,s.jsxs)(u,{children:[(0,s.jsx)(f,{}),(0,s.jsxs)(n.VY,{ref:t,className:(0,o.cn)(m({side:r}),a),...c,children:[!d&&(0,s.jsxs)(n.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,s.jsx)(i.Z,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]}),l]})]})});x.displayName=n.VY.displayName;let p=e=>{let{className:t,...r}=e;return(0,s.jsx)("div",{className:(0,o.cn)("flex flex-col space-y-2 text-center sm:text-left",t),...r})};p.displayName="SheetHeader";let h=e=>{let{className:t,...r}=e;return(0,s.jsx)("div",{className:(0,o.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...r})};h.displayName="SheetFooter";let g=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(n.Dx,{ref:t,className:(0,o.cn)("text-lg font-semibold text-foreground",r),...a})});g.displayName=n.Dx.displayName;let b=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(n.dk,{ref:t,className:(0,o.cn)("text-sm text-muted-foreground",r),...a})});b.displayName=n.dk.displayName},71488:function(e,t,r){"use strict";r.d(t,{_v:function(){return c},aJ:function(){return d},pn:function(){return i},u:function(){return o}});var s=r(57437),a=r(2265),n=r(91668),l=r(93448);let i=n.zt,o=n.fC,d=n.xz,c=a.forwardRef((e,t)=>{let{className:r,sideOffset:a=4,...i}=e;return(0,s.jsx)(n.VY,{ref:t,sideOffset:a,className:(0,l.cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r),...i})});c.displayName=n.VY.displayName},93448:function(e,t,r){"use strict";r.d(t,{cn:function(){return n}});var s=r(61994),a=r(53335);function n(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,a.m6)((0,s.W)(t))}},63751:function(e,t,r){"use strict";r.d(t,{CE:function(){return d},Gn:function(){return o}});var s=r(57437),a=r(2265),n=r(72135),l=r(14438);let i=(0,a.createContext)(void 0),o=()=>{let e=(0,a.useContext)(i);if(!e)throw Error("usePreferences must be used within a PreferencesProvider");return e};function d(e){var t;let{children:r}=e,[o,d]=(0,a.useState)([]),[c,u]=(0,a.useState)(!1),{data:f}=(0,n.kS)(),m=(null==f?void 0:f.id)||(null==f?void 0:null===(t=f.user)||void 0===t?void 0:t.id)||null,{data:x,isLoading:p,refetch:h}=(0,n.sm)({resource:"baasix_UserPreference",queryOptions:{enabled:!!m},filters:m?[{field:"userId",operator:"eq",value:m}]:[],pagination:{pageSize:-1,mode:"off"}}),{mutate:g}=(0,n.RO)({resource:"baasix_UserPreference"}),{mutate:b}=(0,n.PQ)({resource:"baasix_UserPreference"});(0,a.useEffect)(()=>{(null==x?void 0:x.data)?(d(x.data),u(!0)):m&&!p&&(d([]),u(!0))},[x,m,p]);let y=(0,a.useMemo)(()=>{let e={};return o.forEach(t=>{t.isDefault&&(e[t.collectionName]||(e[t.collectionName]={}),e[t.collectionName][t.preferenceType]=t)}),e},[o]),v=(0,a.useCallback)((e,t)=>{var r;return(null===(r=y[e])||void 0===r?void 0:r[t])||null},[y]),j=(0,a.useCallback)(async(e,t,r)=>{if(!m){console.warn("No user ID available for saving preferences");return}let s=v(e,t),a={userId:m,collectionName:e,preferenceType:t,preferenceData:r,isDefault:!0};try{(null==s?void 0:s.id)?await new Promise((e,t)=>{b({id:s.id,values:a,successNotification:!1},{onSuccess:()=>{h(),e()},onError:e=>{console.error("Error updating preference:",e),t(e)}})}):await new Promise((e,t)=>{g({values:a,successNotification:!1},{onSuccess:()=>{h(),e()},onError:e=>{console.error("Error creating preference:",e),t(e)}})})}catch(e){throw l.Am.error("Failed to save preferences"),e}},[m,v,g,b,h]),N=(0,a.useCallback)(e=>{var t;let r=null===(t=y[e])||void 0===t?void 0:t.columns;return r?r.preferenceData:null},[y]),w=(0,a.useCallback)(async(e,t)=>{await j(e,"columns",t)},[j]),k=(0,a.useCallback)(e=>{var t;let r=null===(t=y[e])||void 0===t?void 0:t.filters;return r?r.preferenceData:null},[y]),P=(0,a.useCallback)(async(e,t)=>{await j(e,"filters",t)},[j]),C=(0,a.useCallback)(e=>{var t;let r=null===(t=y[e])||void 0===t?void 0:t.sorting;return r?r.preferenceData:null},[y]),S=(0,a.useCallback)(async(e,t)=>{await j(e,"sorting",t)},[j]),D=(0,a.useCallback)(e=>{var t;let r=null===(t=y[e])||void 0===t?void 0:t.pagination;return r?r.preferenceData:null},[y]),R=(0,a.useCallback)(async(e,t)=>{await j(e,"pagination",t)},[j]);return(0,s.jsx)(i.Provider,{value:{getColumnPreferences:N,saveColumnPreferences:w,getFilterPreferences:k,saveFilterPreferences:P,getSortingPreferences:C,saveSortingPreferences:S,getPaginationPreferences:D,savePaginationPreferences:R,isLoading:p,isInitialized:c,refetchPreferences:h},children:r})}},81853:function(e,t,r){"use strict";r.d(t,{Ml:function(){return i},PY:function(){return l}});var s=r(57437),a=r(2265);let n=(0,a.createContext)({projectSettings:null,isMultiTenant:!1,isLoading:!0,refetch:()=>{}}),l=()=>a.useContext(n)||(console.warn("useProject used outside of ProjectContextProvider, using defaults"),{projectSettings:null,isMultiTenant:!1,isLoading:!1,refetch:()=>{}}),i=e=>{let{children:t,baasixClient:r}=e,[l,i]=(0,a.useState)(null),[o,d]=(0,a.useState)(!0),c=(0,a.useCallback)(async()=>{try{d(!0);let e=await r.server.info();i(null==e?void 0:e.project)}catch(e){console.error("Failed to fetch project settings",e)}finally{d(!1)}},[r]);(0,a.useEffect)(()=>{c()},[c]);let u=(null==l?void 0:l.multitenant)===!0||(null==l?void 0:l.multitenant)==="true";return(0,s.jsx)(n.Provider,{value:{projectSettings:l,isMultiTenant:u,isLoading:o,refetch:c},children:t})}},29696:function(e,t,r){"use strict";r.d(t,{A1:function(){return o},I_:function(){return i}});var s=r(57437),a=r(2265),n=r(72135);let l=(0,a.createContext)(void 0),i=()=>{let e=(0,a.useContext)(l);if(!e)throw Error("useSchema must be used within a SchemaProvider");return e};function o(e){let{children:t}=e,{data:r,isLoading:a,refetch:i}=(0,n.sm)({resource:"collections",queryOptions:{enabled:!0},sorters:[{field:"collectionName",order:"asc"}],pagination:{pageSize:500}}),o=(null==r?void 0:r.data)||[],d=e=>o.find(t=>t.collectionName===e),c=e=>{let t=d(e),r=null==t?void 0:t.schema.fields;if(r){let t={...r};for(let[e,r]of Object.entries(t))r.hidden&&delete t[e];return"baasix_Account"===e&&(delete t.password,delete t.accessToken,delete t.refreshToken,delete t.idToken),"baasix_Verification"===e&&delete t.value,"baasix_Sessions"===e&&delete t.token,t}return r},u=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(0===r)return[];let a=c(e);return a?Object.entries(a).map(e=>{let[a,n]=e,l=t?"".concat(t,".").concat(a):a,i=s?{title:n.relType?l+".*":l,value:n.relType?l+".*":l,key:n.relType?l+".*":l,isLeaf:!n.relType}:{title:l,value:l,key:l,isLeaf:!n.relType};return n.relType&&n.target&&(i.children=u(n.target,l,r-1,s)),i}):[]};return(0,s.jsx)(l.Provider,{value:{schemas:o,isLoading:a,refetch:i,getSchemaByName:d,getFieldsByCollection:c,getCollectionChoices:()=>o.map(e=>({label:e.schema.name,value:e.collectionName})),getTargetFields:e=>{let t=c(e);return t?Object.entries(t).map(e=>{let[t]=e;return{label:t,value:t}}):[]},formatRelationshipDisplay:(e,t)=>e&&t?null==t?void 0:t.split(",").map(t=>{let r=t.trim();return e[r]||r}).join(""):"",getNestedFields:e=>u(e),getPermissionFields:e=>[{title:"*",value:"*",key:"*",isLeaf:!0},...u(e,"",6,!0),{title:"*.*",value:"*.*",key:"*.*",isLeaf:!0},{title:"*.*.*",value:"*.*.*",key:"*.*.*",isLeaf:!0},{title:"*.*.*.*",value:"*.*.*.*",key:"*.*.*.*",isLeaf:!0}],isSortEnabled:e=>{var t;let r=d(e);return(null==r?void 0:null===(t=r.schema)||void 0===t?void 0:t.sortEnabled)===!0}},children:t})}},45114:function(e,t,r){"use strict";r.d(t,{Fg:function(){return o},ze:function(){return f}});var s=r(57437),a=r(2265),n=r(25922),l=r(81853);let i=(0,a.createContext)({}),o=()=>{let e=a.useContext(i);if(!e)throw Error("useTheme must be used within a ThemeContextProvider");return e};function d(e,t,r){return"".concat(e," ").concat(t,"% ").concat(r,"%")}function c(e,t,r){return Math.min(Math.max(e,t),r)}let u=e=>{let{children:t,defaultMode:r="dark"}=e,{setTheme:o,resolvedTheme:u}=(0,n.F)(),{projectSettings:f}=(0,l.PY)(),[m,x]=(0,a.useState)(!1);return((0,a.useEffect)(()=>{x(!0)},[]),(0,a.useEffect)(()=>{m&&(null==f?void 0:f.color)&&function(e,t){let r=function(e){if(6!==(e=e.replace(/^#/,"")).length)return null;let t=parseInt(e.substring(0,2),16)/255,r=parseInt(e.substring(2,4),16)/255,s=parseInt(e.substring(4,6),16)/255,a=Math.max(t,r,s),n=Math.min(t,r,s),l=0,i=0,o=(a+n)/2;if(a!==n){let e=a-n;switch(i=o>.5?e/(2-a-n):e/(a+n),a){case t:l=((r-s)/e+(r<s?6:0))/6;break;case r:l=((s-t)/e+2)/6;break;case s:l=((t-r)/e+4)/6}}return{h:Math.round(360*l),s:Math.round(100*i),l:Math.round(100*o)}}(e);if(!r)return;let s=document.documentElement,{h:a,s:n,l}=r,i=d(a,n,l);s.style.setProperty("--primary",i);let o=l>50?d(a,c(n-10,0,100),10):d(a,c(n-10,0,100),98);if(s.style.setProperty("--primary-foreground",o),s.style.setProperty("--ring",i),t){let e=d(a,c(n-20,10,40),c(l-5,15,25));s.style.setProperty("--accent",e),s.style.setProperty("--accent-foreground",d(a,c(n-30,0,30),95));let t=d(a,c(n-25,5,35),c(l-10,15,22));s.style.setProperty("--muted",t),s.style.setProperty("--muted-foreground",d(a,c(n-30,5,25),65)),s.style.setProperty("--secondary",d(a,c(n-20,10,35),c(l-8,15,22))),s.style.setProperty("--secondary-foreground",d(a,c(n-30,0,30),95)),s.style.setProperty("--border",d(a,c(n-25,5,35),c(l-10,18,28))),s.style.setProperty("--input",d(a,c(n-25,5,35),c(l-10,18,28))),s.style.setProperty("--sidebar-background",d(a,c(n-30,5,20),8)),s.style.setProperty("--sidebar-foreground",d(a,c(n-30,5,20),92)),s.style.setProperty("--sidebar-primary",i),s.style.setProperty("--sidebar-primary-foreground",o),s.style.setProperty("--sidebar-accent",d(a,c(n-25,5,25),15)),s.style.setProperty("--sidebar-accent-foreground",d(a,c(n-30,5,20),92)),s.style.setProperty("--sidebar-border",d(a,c(n-30,5,20),15)),s.style.setProperty("--sidebar-ring",i),s.style.setProperty("--chart-1",d(a,70,50)),s.style.setProperty("--chart-2",d((a+60)%360,60,45)),s.style.setProperty("--chart-3",d((a+120)%360,80,55)),s.style.setProperty("--chart-4",d((a+180)%360,65,60)),s.style.setProperty("--chart-5",d((a+240)%360,75,55))}else{let e=d(a,c(n-10,20,50),c(l+30,90,97));s.style.setProperty("--accent",e),s.style.setProperty("--accent-foreground",d(a,c(n,30,60),15));let t=d(a,c(n-20,10,45),c(l+35,94,98));s.style.setProperty("--muted",t),s.style.setProperty("--muted-foreground",d(a,c(n-20,10,30),45)),s.style.setProperty("--secondary",d(a,c(n-15,15,45),c(l+32,92,97))),s.style.setProperty("--secondary-foreground",d(a,c(n,30,60),15)),s.style.setProperty("--border",d(a,c(n-20,10,35),88)),s.style.setProperty("--input",d(a,c(n-20,10,35),88)),s.style.setProperty("--sidebar-background",d(a,c(n-25,5,25),97)),s.style.setProperty("--sidebar-foreground",d(a,c(n-20,10,30),25)),s.style.setProperty("--sidebar-primary",i),s.style.setProperty("--sidebar-primary-foreground",o),s.style.setProperty("--sidebar-accent",d(a,c(n-15,10,40),93)),s.style.setProperty("--sidebar-accent-foreground",d(a,c(n-20,10,30),20)),s.style.setProperty("--sidebar-border",d(a,c(n-25,5,25),90)),s.style.setProperty("--sidebar-ring",i),s.style.setProperty("--chart-1",d(a,76,61)),s.style.setProperty("--chart-2",d((a+60)%360,58,39)),s.style.setProperty("--chart-3",d((a+120)%360,37,24)),s.style.setProperty("--chart-4",d((a+180)%360,74,66)),s.style.setProperty("--chart-5",d((a+240)%360,87,67))}}(f.color,"dark"===u)},[m,null==f?void 0:f.color,u]),m)?(0,s.jsx)(i.Provider,{value:{setMode:()=>{o("light"===u?"dark":"light")},mode:u||r,primaryColor:(null==f?void 0:f.color)||"#644152"},children:t}):null},f=e=>{let{children:t,defaultMode:r="dark"}=e;return(0,s.jsx)(n.f,{attribute:"class",defaultTheme:r,enableSystem:!0,children:(0,s.jsx)(u,{defaultMode:r,children:t})})}}},function(e){e.O(0,[7999,5094,4438,6530,6241,4475,926,600,1668,9124,8473,3563,478,6599,2971,2117,1744],function(){return e(e.s=57166)}),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3753],{55203:function(e,s,a){Promise.resolve().then(a.bind(a,36818))},36818:function(e,s,a){"use strict";a.r(s),a.d(s,{default:function(){return F}});var l=a(57437),t=a(2265),n=a(72135),r=a(14438),i=a(79820),c=a(12381),d=a(69174),o=a(40279),m=a(43368),x=a(75060),u=a(23675),h=a(17168),j=a(90641),g=a(69140),p=a(33804),f=a(30767),v=a(74291),N=a(15291),b=a(92934),w=a(91723),y=a(51817),k=a(99388),C=a(69076),Z=a(76865),S=a(16066),M=a(49322),A=a(50091),z=a(71947),R=a(82431),O=a(99397),_=a(33276),D=a(10866),T=a(65621),L=a(22135),E=a(40875),V=a(7598),U=a(27107);let B=e=>{let{status:s}=e,a={completed:{variant:"default",icon:(0,l.jsx)(b.Z,{className:"h-3 w-3 mr-1"}),label:"Completed"},pending:{variant:"secondary",icon:(0,l.jsx)(w.Z,{className:"h-3 w-3 mr-1"}),label:"Pending"},running:{variant:"outline",icon:(0,l.jsx)(y.Z,{className:"h-3 w-3 mr-1 animate-spin"}),label:"Running"},failed:{variant:"destructive",icon:(0,l.jsx)(k.Z,{className:"h-3 w-3 mr-1"}),label:"Failed"},rolled_back:{variant:"outline",icon:(0,l.jsx)(C.Z,{className:"h-3 w-3 mr-1"}),label:"Rolled Back"},skipped:{variant:"secondary",icon:(0,l.jsx)(Z.Z,{className:"h-3 w-3 mr-1"}),label:"Skipped"}}[s]||{variant:"secondary",icon:null,label:s};return(0,l.jsxs)(d.C,{variant:a.variant,className:"flex items-center",children:[a.icon,a.label]})},Y=e=>{let{type:s}=e,a={upgrade:{color:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",icon:(0,l.jsx)(S.Z,{className:"h-3 w-3 mr-1"})},hotfix:{color:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",icon:(0,l.jsx)(M.Z,{className:"h-3 w-3 mr-1"})},rollback:{color:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",icon:(0,l.jsx)(C.Z,{className:"h-3 w-3 mr-1"})},data:{color:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",icon:(0,l.jsx)(A.Z,{className:"h-3 w-3 mr-1"})},schema:{color:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",icon:(0,l.jsx)(z.Z,{className:"h-3 w-3 mr-1"})}}[s]||{color:"bg-gray-100 text-gray-800",icon:null};return(0,l.jsxs)(d.C,{variant:"outline",className:"flex items-center ".concat(a.color),children:[a.icon,s]})},P=()=>{var e,s,a;let k=(0,n.Ji)(),[S,M]=(0,t.useState)("status"),[z,P]=(0,t.useState)(""),[F,H]=(0,t.useState)([]),[Q,q]=(0,t.useState)(new Set),[$,I]=(0,t.useState)(!1),[W,J]=(0,t.useState)(!1),[K,G]=(0,t.useState)(!1),[X,ee]=(0,t.useState)(!1),[es,ea]=(0,t.useState)(!1),[el,et]=(0,t.useState)(null),[en,er]=(0,t.useState)({name:"",description:"",type:"upgrade"}),{data:ei,isLoading:ec,refetch:ed}=(0,n.EV)({url:"".concat(k,"/migrations/status"),method:"get",queryOptions:{refetchInterval:5e3}}),{data:eo,isLoading:em,refetch:ex}=(0,n.EV)({url:"".concat(k,"/migrations"),method:"get"}),{data:eu,isLoading:eh,refetch:ej}=(0,n.EV)({url:"".concat(k,"/migrations/pending"),method:"get"}),{mutate:eg,isLoading:ep}=(0,n.uC)(),{mutate:ef,isLoading:ev}=(0,n.uC)(),{mutate:eN,isLoading:eb}=(0,n.uC)(),{mutate:ew,isLoading:ey}=(0,n.uC)(),{mutate:ek,isLoading:eC}=(0,n.uC)(),{mutate:eZ,isLoading:eS}=(0,n.uC)(),eM=null==ei?void 0:null===(e=ei.data)||void 0===e?void 0:e.data,eA=(null==eo?void 0:null===(s=eo.data)||void 0===s?void 0:s.data)||[],ez=(null==eu?void 0:null===(a=eu.data)||void 0===a?void 0:a.data)||[],eR=(0,t.useMemo)(()=>{if(!z.trim())return eA;let e=z.toLowerCase();return eA.filter(s=>{var a;return s.version.toLowerCase().includes(e)||s.name.toLowerCase().includes(e)||(null===(a=s.description)||void 0===a?void 0:a.toLowerCase().includes(e))})},[eA,z]),eO=()=>{ed(),ex(),ej()},e_=e=>{ef({url:"".concat(k,"/migrations/rollback/").concat(encodeURIComponent(e)),method:"post",values:{}},{onSuccess:()=>{r.Am.success("Successfully rolled back migration ".concat(e)),J(!1),et(null),eO()},onError:e=>{r.Am.error("Failed to rollback: ".concat(e.message))}})},eD=e=>{eZ({url:"".concat(k,"/migrations/rollback-batch"),method:"post",values:{batch:e}},{onSuccess:s=>{var a,l;let t=null==s?void 0:null===(a=s.data)||void 0===a?void 0:a.data;r.Am.success("Successfully rolled back ".concat((null==t?void 0:null===(l=t.rolledBack)||void 0===l?void 0:l.length)||0," migration(s) from batch ").concat(e)),eO()},onError:e=>{r.Am.error("Failed to rollback batch: ".concat(e.message))}})},eT=e=>{eN({url:"".concat(k,"/migrations/mark-completed/").concat(encodeURIComponent(e)),method:"post",values:{}},{onSuccess:()=>{r.Am.success("Marked migration ".concat(e," as completed")),G(!1),eO()},onError:e=>{r.Am.error("Failed to mark as completed: ".concat(e.message))}})},eL=e=>{q(s=>{let a=new Set(s);return a.has(e)?a.delete(e):a.add(e),a})},eE=e=>{et(e),ea(!0)};return ec?(0,l.jsxs)("div",{className:"flex flex-col h-full overflow-hidden gap-4",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)(g.O,{className:"h-8 w-48"}),(0,l.jsx)(g.O,{className:"h-10 w-32"})]}),(0,l.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[1,2,3,4].map(e=>(0,l.jsx)(g.O,{className:"h-24"},e))}),(0,l.jsx)(g.O,{className:"h-96"})]}):(0,l.jsxs)("div",{className:"flex flex-col h-full overflow-hidden gap-4",children:[(0,l.jsxs)("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-2 flex-shrink-0",children:[(0,l.jsx)("h1",{className:"text-lg font-semibold",children:"Database Migrations"}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)(c.z,{variant:"outline",size:"icon",onClick:eO,children:(0,l.jsx)(R.Z,{className:"h-4 w-4"})}),(0,l.jsxs)(c.z,{variant:"outline",onClick:()=>ee(!0),children:[(0,l.jsx)(O.Z,{className:"mr-2 h-4 w-4"}),"Create Migration"]}),(0,l.jsxs)(c.z,{onClick:()=>I(!0),disabled:!ez.length||ep,children:[ep?(0,l.jsx)(y.Z,{className:"mr-2 h-4 w-4 animate-spin"}):(0,l.jsx)(_.Z,{className:"mr-2 h-4 w-4"}),"Run Migrations"]})]})]}),(null==eM?void 0:eM.isSequelizeUpgrade)&&(0,l.jsx)(i.Zb,{className:"border-amber-500 bg-amber-50 dark:bg-amber-950",children:(0,l.jsx)(i.aY,{className:"py-4",children:(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)(Z.Z,{className:"h-5 w-5 text-amber-600"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"font-medium text-amber-800 dark:text-amber-200",children:"Sequelize to Drizzle Upgrade Detected"}),(0,l.jsx)("p",{className:"text-sm text-amber-700 dark:text-amber-300",children:"Your database appears to be from an older Sequelize-based version. Please run the pending migrations to complete the upgrade."})]})]})})}),(0,l.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4 flex-shrink-0",children:[(0,l.jsx)(i.Zb,{children:(0,l.jsxs)(i.Ol,{className:"pb-2",children:[(0,l.jsx)(i.SZ,{children:"Current Version"}),(0,l.jsx)(i.ll,{className:"text-2xl font-mono",children:(null==eM?void 0:eM.currentVersion)||"No migrations"})]})}),(0,l.jsx)(i.Zb,{children:(0,l.jsxs)(i.Ol,{className:"pb-2",children:[(0,l.jsx)(i.SZ,{children:"Applied Migrations"}),(0,l.jsx)(i.ll,{className:"text-2xl",children:(null==eM?void 0:eM.appliedCount)||0})]})}),(0,l.jsx)(i.Zb,{className:(null==eM?void 0:eM.pendingCount)?"border-amber-500":"",children:(0,l.jsxs)(i.Ol,{className:"pb-2",children:[(0,l.jsx)(i.SZ,{children:"Pending Migrations"}),(0,l.jsxs)(i.ll,{className:"text-2xl flex items-center gap-2",children:[(null==eM?void 0:eM.pendingCount)||0,(null==eM?void 0:eM.pendingCount)?(0,l.jsx)(Z.Z,{className:"h-5 w-5 text-amber-500"}):(0,l.jsx)(b.Z,{className:"h-5 w-5 text-green-500"})]})]})}),(0,l.jsx)(i.Zb,{children:(0,l.jsxs)(i.Ol,{className:"pb-2",children:[(0,l.jsx)(i.SZ,{children:"Last Batch"}),(0,l.jsxs)(i.ll,{className:"text-2xl",children:["#",(null==eM?void 0:eM.lastBatch)||0]})]})})]}),(0,l.jsxs)(h.mQ,{value:S,onValueChange:M,className:"flex-1 flex flex-col min-h-0",children:[(0,l.jsxs)(h.dr,{className:"grid w-full max-w-md grid-cols-3",children:[(0,l.jsxs)(h.SP,{value:"status",children:[(0,l.jsx)(D.Z,{className:"h-4 w-4 mr-2"}),"Status"]}),(0,l.jsxs)(h.SP,{value:"pending",children:[(0,l.jsx)(w.Z,{className:"h-4 w-4 mr-2"}),"Pending (",ez.length,")"]}),(0,l.jsxs)(h.SP,{value:"history",children:[(0,l.jsx)(T.Z,{className:"h-4 w-4 mr-2"}),"History"]})]}),(0,l.jsx)(h.nU,{value:"status",className:"flex-1 overflow-hidden",children:(0,l.jsxs)(i.Zb,{className:"h-full",children:[(0,l.jsxs)(i.Ol,{children:[(0,l.jsx)(i.ll,{children:"Migration Status"}),(0,l.jsx)(i.SZ,{children:"Overview of your database migration state"})]}),(0,l.jsxs)(i.aY,{className:"space-y-6",children:[(null==eM?void 0:eM.lastMigration)&&(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("h3",{className:"text-sm font-medium text-muted-foreground",children:"Last Applied Migration"}),(0,l.jsx)(i.Zb,{children:(0,l.jsx)(i.aY,{className:"py-4",children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"font-mono font-medium",children:eM.lastMigration.version}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:eM.lastMigration.name})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(B,{status:eM.lastMigration.status}),eM.lastMigration.executedAt&&(0,l.jsx)("span",{className:"text-sm text-muted-foreground",children:(0,V.Q)(new Date(eM.lastMigration.executedAt),{addSuffix:!0})})]})]})})})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("h3",{className:"text-sm font-medium text-muted-foreground",children:"Quick Actions"}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,l.jsxs)(c.z,{variant:"outline",onClick:()=>I(!0),disabled:!ez.length,children:[(0,l.jsx)(_.Z,{className:"h-4 w-4 mr-2"}),"Run All Pending"]}),(0,l.jsxs)(c.z,{variant:"outline",onClick:()=>{ew({url:"".concat(k,"/migrations/mark-all-completed"),method:"post",values:{}},{onSuccess:e=>{var s,a;let l=(null==e?void 0:null===(a=e.data)||void 0===a?void 0:null===(s=a.data)||void 0===s?void 0:s.markedCount)||0;r.Am.success("Marked ".concat(l," migration(s) as completed")),eO()},onError:e=>{r.Am.error("Failed to mark all as completed: ".concat(e.message))}})},disabled:ey||!ez.length,children:[ey?(0,l.jsx)(y.Z,{className:"h-4 w-4 mr-2 animate-spin"}):(0,l.jsx)(b.Z,{className:"h-4 w-4 mr-2"}),"Mark All as Completed"]}),(null==eM?void 0:eM.lastBatch)&&eM.lastBatch>0&&(0,l.jsxs)(c.z,{variant:"outline",onClick:()=>eD(eM.lastBatch),disabled:eS,children:[eS?(0,l.jsx)(y.Z,{className:"h-4 w-4 mr-2 animate-spin"}):(0,l.jsx)(C.Z,{className:"h-4 w-4 mr-2"}),"Rollback Batch #",eM.lastBatch]})]})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("h3",{className:"text-sm font-medium text-muted-foreground",children:"System Information"}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{className:"text-muted-foreground",children:"Total Migrations:"}),(0,l.jsx)("span",{className:"ml-2 font-medium",children:(null==eM?void 0:eM.totalMigrations)||0})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{className:"text-muted-foreground",children:"Status:"}),(0,l.jsx)("span",{className:"ml-2",children:(null==eM?void 0:eM.isUpToDate)?(0,l.jsxs)(d.C,{variant:"default",children:[(0,l.jsx)(b.Z,{className:"h-3 w-3 mr-1"}),"Up to Date"]}):(0,l.jsxs)(d.C,{variant:"secondary",children:[(0,l.jsx)(Z.Z,{className:"h-3 w-3 mr-1"}),"Updates Available"]})})]})]})]})]})]})}),(0,l.jsx)(h.nU,{value:"pending",className:"flex-1 overflow-hidden",children:(0,l.jsxs)(i.Zb,{className:"h-full flex flex-col",children:[(0,l.jsxs)(i.Ol,{children:[(0,l.jsx)(i.ll,{children:"Pending Migrations"}),(0,l.jsx)(i.SZ,{children:"Migrations waiting to be applied"})]}),(0,l.jsx)(i.aY,{className:"flex-1 overflow-hidden",children:eh?(0,l.jsx)("div",{className:"space-y-2",children:[1,2,3].map(e=>(0,l.jsx)(g.O,{className:"h-16"},e))}):0===ez.length?(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground",children:[(0,l.jsx)(b.Z,{className:"h-12 w-12 mb-4 text-green-500"}),(0,l.jsx)("p",{className:"text-lg font-medium",children:"All migrations are up to date!"}),(0,l.jsx)("p",{className:"text-sm",children:"No pending migrations to run."})]}):(0,l.jsx)(j.x,{className:"h-full",children:(0,l.jsx)("div",{className:"space-y-2",children:ez.map((e,s)=>(0,l.jsx)(i.Zb,{children:(0,l.jsx)(i.aY,{className:"py-4",children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center gap-4",children:[(0,l.jsxs)("span",{className:"text-muted-foreground w-6",children:[s+1,"."]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"font-mono font-medium",children:e.version}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:e.name}),e.description&&(0,l.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:e.description})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(Y,{type:e.type}),e.canRollback&&(0,l.jsx)(d.C,{variant:"outline",className:"text-xs",children:"Reversible"}),(0,l.jsx)(c.z,{size:"sm",variant:"outline",onClick:()=>eT(e.version),children:"Mark Done"})]})]})})},e.version))})})})]})}),(0,l.jsx)(h.nU,{value:"history",className:"flex-1 overflow-hidden",children:(0,l.jsxs)(i.Zb,{className:"h-full flex flex-col",children:[(0,l.jsx)(i.Ol,{className:"flex-shrink-0",children:(0,l.jsxs)("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-2",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(i.ll,{children:"Migration History"}),(0,l.jsx)(i.SZ,{children:"All applied migrations"})]}),(0,l.jsx)(m.t,{value:z,onChange:P,placeholder:"Search migrations...",expandedWidth:"w-64"})]})}),(0,l.jsx)(i.aY,{className:"flex-1 overflow-hidden p-0",children:em?(0,l.jsx)("div",{className:"p-6 space-y-2",children:[1,2,3,4,5].map(e=>(0,l.jsx)(g.O,{className:"h-12"},e))}):0===eR.length?(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground",children:[(0,l.jsx)(A.Z,{className:"h-12 w-12 mb-4"}),(0,l.jsx)("p",{className:"text-lg font-medium",children:"No migrations found"}),(0,l.jsx)("p",{className:"text-sm",children:z?"Try a different search term":"No migrations have been run yet"})]}):(0,l.jsx)(j.x,{className:"h-full",children:(0,l.jsxs)(p.iA,{children:[(0,l.jsx)(p.xD,{className:"sticky top-0 bg-background",children:(0,l.jsxs)(p.SC,{children:[(0,l.jsx)(p.ss,{className:"w-8"}),(0,l.jsx)(p.ss,{children:"Version"}),(0,l.jsx)(p.ss,{children:"Name"}),(0,l.jsx)(p.ss,{children:"Type"}),(0,l.jsx)(p.ss,{children:"Status"}),(0,l.jsx)(p.ss,{children:"Batch"}),(0,l.jsx)(p.ss,{children:"Executed"}),(0,l.jsx)(p.ss,{children:"Duration"}),(0,l.jsx)(p.ss,{className:"w-24",children:"Actions"})]})}),(0,l.jsx)(p.RM,{children:eR.map(e=>(0,l.jsxs)(t.Fragment,{children:[(0,l.jsxs)(p.SC,{className:"failed"===e.status?"bg-red-50 dark:bg-red-950":"",children:[(0,l.jsx)(p.pj,{children:(e.errorMessage||e.description)&&(0,l.jsx)(c.z,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>eL(e.id),children:Q.has(e.id)?(0,l.jsx)(L.Z,{className:"h-4 w-4"}):(0,l.jsx)(E.Z,{className:"h-4 w-4"})})}),(0,l.jsx)(p.pj,{className:"font-mono text-sm",children:e.version}),(0,l.jsx)(p.pj,{children:e.name}),(0,l.jsx)(p.pj,{children:(0,l.jsx)(Y,{type:e.type})}),(0,l.jsx)(p.pj,{children:(0,l.jsx)(B,{status:e.status})}),(0,l.jsxs)(p.pj,{children:["#",e.batch||"-"]}),(0,l.jsx)(p.pj,{children:e.executedAt?(0,U.WU)(new Date(e.executedAt),"MMM d, yyyy HH:mm"):"-"}),(0,l.jsx)(p.pj,{children:e.executionTimeMs?"".concat(e.executionTimeMs,"ms"):"-"}),(0,l.jsx)(p.pj,{children:(0,l.jsxs)("div",{className:"flex items-center gap-1",children:[(0,l.jsx)(c.z,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>eE(e),children:(0,l.jsx)(D.Z,{className:"h-4 w-4"})}),e.canRollback&&"completed"===e.status&&(0,l.jsx)(c.z,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>{et(e),J(!0)},children:(0,l.jsx)(C.Z,{className:"h-4 w-4"})})]})})]}),Q.has(e.id)&&(0,l.jsx)(p.SC,{children:(0,l.jsxs)(p.pj,{colSpan:9,className:"bg-muted/50 p-4",children:[e.description&&(0,l.jsxs)("p",{className:"text-sm mb-2",children:[(0,l.jsx)("strong",{children:"Description:"})," ",e.description]}),e.errorMessage&&(0,l.jsxs)("div",{className:"text-sm text-red-600 dark:text-red-400",children:[(0,l.jsx)("strong",{children:"Error:"}),(0,l.jsx)("pre",{className:"mt-1 p-2 bg-red-100 dark:bg-red-900 rounded text-xs overflow-x-auto",children:e.errorMessage}),e.errorStack&&(0,l.jsxs)("details",{className:"mt-2",children:[(0,l.jsx)("summary",{className:"cursor-pointer text-xs",children:"Stack trace"}),(0,l.jsx)("pre",{className:"mt-1 p-2 bg-red-100 dark:bg-red-900 rounded text-xs overflow-x-auto",children:e.errorStack})]})]})]})})]},e.id))})]})})})]})})]}),(0,l.jsx)(f.aR,{open:$,onOpenChange:I,children:(0,l.jsxs)(f._T,{children:[(0,l.jsxs)(f.fY,{children:[(0,l.jsx)(f.f$,{children:"Run Pending Migrations?"}),(0,l.jsxs)(f.yT,{children:["This will execute ",ez.length," pending migration(s). Make sure you have a database backup before proceeding."]})]}),(0,l.jsx)("div",{className:"max-h-48 overflow-y-auto my-4",children:(0,l.jsx)("div",{className:"space-y-2",children:ez.map(e=>(0,l.jsxs)("div",{className:"text-sm p-2 bg-muted rounded flex items-center justify-between",children:[(0,l.jsx)("span",{className:"font-mono",children:e.version}),(0,l.jsx)(Y,{type:e.type})]},e.version))})}),(0,l.jsxs)(f.xo,{children:[(0,l.jsx)(f.le,{children:"Cancel"}),(0,l.jsxs)(f.OL,{onClick:()=>{eg({url:"".concat(k,"/migrations/run"),method:"post",values:{}},{onSuccess:e=>{var s,a,l;let t=null==e?void 0:null===(s=e.data)||void 0===s?void 0:s.data;(null==t?void 0:null===(a=t.applied)||void 0===a?void 0:a.length)>0?r.Am.success("Successfully ran ".concat(t.applied.length," migration(s)")):r.Am.info("No pending migrations to run"),(null==t?void 0:null===(l=t.failed)||void 0===l?void 0:l.length)>0&&r.Am.error("".concat(t.failed.length," migration(s) failed")),I(!1),eO()},onError:e=>{r.Am.error("Failed to run migrations: ".concat(e.message))}})},disabled:ep,className:"bg-primary",children:[ep?(0,l.jsx)(y.Z,{className:"mr-2 h-4 w-4 animate-spin"}):(0,l.jsx)(_.Z,{className:"mr-2 h-4 w-4"}),"Run Migrations"]})]})]})}),(0,l.jsx)(f.aR,{open:W,onOpenChange:J,children:(0,l.jsxs)(f._T,{children:[(0,l.jsxs)(f.fY,{children:[(0,l.jsx)(f.f$,{children:"Rollback Migration?"}),(0,l.jsxs)(f.yT,{children:["This will rollback migration"," ",(0,l.jsx)("span",{className:"font-mono font-medium",children:null==el?void 0:el.version}),". This action may cause data loss. Are you sure?"]})]}),(0,l.jsxs)(f.xo,{children:[(0,l.jsx)(f.le,{children:"Cancel"}),(0,l.jsxs)(f.OL,{onClick:()=>el&&e_(el.version),disabled:ev,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[ev?(0,l.jsx)(y.Z,{className:"mr-2 h-4 w-4 animate-spin"}):(0,l.jsx)(C.Z,{className:"mr-2 h-4 w-4"}),"Rollback"]})]})]})}),(0,l.jsx)(v.Vq,{open:X,onOpenChange:ee,children:(0,l.jsxs)(v.cZ,{children:[(0,l.jsxs)(v.fK,{children:[(0,l.jsx)(v.$N,{children:"Create New Migration"}),(0,l.jsx)(v.Be,{children:"Generate a new migration file in the migrations directory"})]}),(0,l.jsxs)("div",{className:"space-y-4 py-4",children:[(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(x._,{htmlFor:"name",children:"Migration Name"}),(0,l.jsx)(o.I,{id:"name",placeholder:"e.g., add_user_preferences",value:en.name,onChange:e=>er({...en,name:e.target.value})})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(x._,{htmlFor:"type",children:"Type"}),(0,l.jsxs)(N.Ph,{value:en.type,onValueChange:e=>er({...en,type:e}),children:[(0,l.jsx)(N.i4,{children:(0,l.jsx)(N.ki,{})}),(0,l.jsxs)(N.Bw,{children:[(0,l.jsx)(N.Ql,{value:"upgrade",children:"Upgrade"}),(0,l.jsx)(N.Ql,{value:"hotfix",children:"Hotfix"}),(0,l.jsx)(N.Ql,{value:"data",children:"Data Migration"}),(0,l.jsx)(N.Ql,{value:"schema",children:"Schema Change"})]})]})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(x._,{htmlFor:"description",children:"Description (optional)"}),(0,l.jsx)(u.g,{id:"description",placeholder:"Describe what this migration does...",value:en.description,onChange:e=>er({...en,description:e.target.value})})]})]}),(0,l.jsxs)(v.cN,{children:[(0,l.jsx)(c.z,{variant:"outline",onClick:()=>ee(!1),children:"Cancel"}),(0,l.jsxs)(c.z,{onClick:()=>{if(!en.name.trim()){r.Am.error("Migration name is required");return}ek({url:"".concat(k,"/migrations/create"),method:"post",values:en},{onSuccess:e=>{var s,a;r.Am.success("Created migration: ".concat(null==e?void 0:null===(a=e.data)||void 0===a?void 0:null===(s=a.data)||void 0===s?void 0:s.filename)),ee(!1),er({name:"",description:"",type:"upgrade"}),eO()},onError:e=>{r.Am.error("Failed to create migration: ".concat(e.message))}})},disabled:eC,children:[eC?(0,l.jsx)(y.Z,{className:"mr-2 h-4 w-4 animate-spin"}):(0,l.jsx)(O.Z,{className:"mr-2 h-4 w-4"}),"Create Migration"]})]})]})}),(0,l.jsx)(v.Vq,{open:es,onOpenChange:ea,children:(0,l.jsxs)(v.cZ,{className:"max-w-2xl",children:[(0,l.jsxs)(v.fK,{children:[(0,l.jsx)(v.$N,{children:"Migration Details"}),(0,l.jsxs)(v.Be,{children:[null==el?void 0:el.version," - ",null==el?void 0:el.name]})]}),el&&(0,l.jsx)("div",{className:"max-h-[60vh] overflow-y-auto pr-2",children:(0,l.jsxs)("div",{className:"space-y-4 py-4",children:[(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(x._,{className:"text-muted-foreground",children:"Version"}),(0,l.jsx)("p",{className:"font-mono",children:el.version})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(x._,{className:"text-muted-foreground",children:"Name"}),(0,l.jsx)("p",{children:el.name})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(x._,{className:"text-muted-foreground",children:"Type"}),(0,l.jsx)("div",{className:"mt-1",children:(0,l.jsx)(Y,{type:el.type})})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(x._,{className:"text-muted-foreground",children:"Status"}),(0,l.jsx)("div",{className:"mt-1",children:(0,l.jsx)(B,{status:el.status})})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(x._,{className:"text-muted-foreground",children:"Batch"}),(0,l.jsxs)("p",{children:["#",el.batch||"-"]})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(x._,{className:"text-muted-foreground",children:"Execution Time"}),(0,l.jsxs)("p",{children:[el.executionTimeMs,"ms"]})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(x._,{className:"text-muted-foreground",children:"Executed At"}),(0,l.jsx)("p",{children:el.executedAt?(0,U.WU)(new Date(el.executedAt),"MMM d, yyyy HH:mm:ss"):"-"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(x._,{className:"text-muted-foreground",children:"Can Rollback"}),(0,l.jsx)("p",{children:el.canRollback?"Yes":"No"})]})]}),el.description&&(0,l.jsxs)("div",{children:[(0,l.jsx)(x._,{className:"text-muted-foreground",children:"Description"}),(0,l.jsx)("p",{className:"mt-1",children:el.description})]}),el.checksum&&(0,l.jsxs)("div",{children:[(0,l.jsx)(x._,{className:"text-muted-foreground",children:"Checksum"}),(0,l.jsx)("p",{className:"mt-1 font-mono text-xs break-all",children:el.checksum})]}),el.errorMessage&&(0,l.jsxs)("div",{children:[(0,l.jsx)(x._,{className:"text-muted-foreground text-red-600",children:"Error"}),(0,l.jsx)("pre",{className:"mt-1 p-3 bg-red-100 dark:bg-red-900 rounded text-sm whitespace-pre-wrap break-words text-red-700 dark:text-red-300",children:el.errorMessage})]}),el.metadata&&Object.keys(el.metadata).length>0&&(0,l.jsxs)("div",{children:[(0,l.jsx)(x._,{className:"text-muted-foreground",children:"Metadata"}),(0,l.jsx)("pre",{className:"mt-1 p-3 bg-muted rounded text-sm whitespace-pre-wrap break-words",children:JSON.stringify(el.metadata,null,2)})]})]})}),(0,l.jsxs)(v.cN,{children:[(0,l.jsx)(c.z,{variant:"outline",onClick:()=>ea(!1),children:"Close"}),(null==el?void 0:el.canRollback)&&(null==el?void 0:el.status)==="completed"&&(0,l.jsxs)(c.z,{variant:"destructive",onClick:()=>{ea(!1),J(!0)},children:[(0,l.jsx)(C.Z,{className:"mr-2 h-4 w-4"}),"Rollback"]})]})]})})]})};var F=()=>(0,l.jsx)(P,{})},30767:function(e,s,a){"use strict";a.d(s,{OL:function(){return p},_T:function(){return x},aR:function(){return c},f$:function(){return j},fY:function(){return u},le:function(){return f},vW:function(){return d},xo:function(){return h},yT:function(){return g}});var l=a(57437),t=a(2265),n=a(16720),r=a(93448),i=a(12381);let c=n.fC,d=n.xz,o=n.h_,m=t.forwardRef((e,s)=>{let{className:a,...t}=e;return(0,l.jsx)(n.aV,{className:(0,r.cn)("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...t,ref:s})});m.displayName="AlertDialogOverlay";let x=t.forwardRef((e,s)=>{let{className:a,...t}=e;return(0,l.jsxs)(o,{children:[(0,l.jsx)(m,{}),(0,l.jsx)(n.VY,{ref:s,className:(0,r.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg",a),...t})]})});x.displayName="AlertDialogContent";let u=e=>{let{className:s,...a}=e;return(0,l.jsx)("div",{className:(0,r.cn)("flex flex-col space-y-2 text-center sm:text-left",s),...a})};u.displayName="AlertDialogHeader";let h=e=>{let{className:s,...a}=e;return(0,l.jsx)("div",{className:(0,r.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...a})};h.displayName="AlertDialogFooter";let j=t.forwardRef((e,s)=>{let{className:a,...t}=e;return(0,l.jsx)(n.Dx,{ref:s,className:(0,r.cn)("text-lg font-semibold",a),...t})});j.displayName="AlertDialogTitle";let g=t.forwardRef((e,s)=>{let{className:a,...t}=e;return(0,l.jsx)(n.dk,{ref:s,className:(0,r.cn)("text-sm text-muted-foreground",a),...t})});g.displayName="AlertDialogDescription";let p=t.forwardRef((e,s)=>{let{className:a,...t}=e;return(0,l.jsx)(n.aU,{ref:s,className:(0,r.cn)((0,i.d)(),a),...t})});p.displayName="AlertDialogAction";let f=t.forwardRef((e,s)=>{let{className:a,...t}=e;return(0,l.jsx)(n.$j,{ref:s,className:(0,r.cn)((0,i.d)({variant:"outline"}),"mt-2 sm:mt-0",a),...t})});f.displayName="AlertDialogCancel"},69140:function(e,s,a){"use strict";a.d(s,{O:function(){return n}});var l=a(57437),t=a(93448);function n(e){let{className:s,...a}=e;return(0,l.jsx)("div",{className:(0,t.cn)("animate-pulse rounded-md bg-muted",s),...a})}},17168:function(e,s,a){"use strict";a.d(s,{SP:function(){return d},dr:function(){return c},mQ:function(){return i},nU:function(){return o}});var l=a(57437),t=a(2265),n=a(20271),r=a(93448);let i=n.fC,c=t.forwardRef((e,s)=>{let{className:a,...t}=e;return(0,l.jsx)(n.aV,{ref:s,className:(0,r.cn)("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",a),...t})});c.displayName=n.aV.displayName;let d=t.forwardRef((e,s)=>{let{className:a,...t}=e;return(0,l.jsx)(n.xz,{ref:s,className:(0,r.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",a),...t})});d.displayName=n.xz.displayName;let o=t.forwardRef((e,s)=>{let{className:a,...t}=e;return(0,l.jsx)(n.VY,{ref:s,className:(0,r.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a),...t})});o.displayName=n.VY.displayName}},function(e){e.O(0,[7999,5094,4438,6530,6241,4475,926,600,1509,9487,3563,4952,6547,2971,2117,1744],function(){return e(e.s=55203)}),_N_E=e.O()}]);
|