@rubytech/create-maxy-code 0.1.505 → 0.1.506

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/lib/account-schema-regions/dist/index.d.ts +60 -0
  3. package/payload/platform/lib/account-schema-regions/dist/index.d.ts.map +1 -0
  4. package/payload/platform/lib/account-schema-regions/dist/index.js +101 -0
  5. package/payload/platform/lib/account-schema-regions/dist/index.js.map +1 -0
  6. package/payload/platform/lib/account-schema-regions/package.json +7 -0
  7. package/payload/platform/lib/account-schema-regions/src/index.ts +121 -0
  8. package/payload/platform/lib/account-schema-regions/tsconfig.json +9 -0
  9. package/payload/platform/package.json +3 -3
  10. package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +59 -17
  11. package/payload/platform/plugins/admin/skills/public-agent-manager/SKILL.md +3 -3
  12. package/payload/platform/plugins/admin/skills/whats-new/SKILL.md +6 -0
  13. package/payload/platform/plugins/docs/references/admin-ui.md +58 -16
  14. package/payload/platform/scripts/check-no-esm-require.mjs +5 -0
  15. package/payload/platform/services/claude-session-manager/dist/account-dir-schema-reconcile.d.ts +1 -1
  16. package/payload/platform/services/claude-session-manager/dist/account-dir-schema-reconcile.d.ts.map +1 -1
  17. package/payload/platform/services/claude-session-manager/dist/account-dir-schema-reconcile.js +50 -3
  18. package/payload/platform/services/claude-session-manager/dist/account-dir-schema-reconcile.js.map +1 -1
  19. package/payload/server/{chunk-HN4HFTXE.js → chunk-5ADBNEJA.js} +1410 -1409
  20. package/payload/server/maxy-edge.js +1 -1
  21. package/payload/server/public/activity.html +5 -5
  22. package/payload/server/public/agents.html +4 -4
  23. package/payload/server/public/assets/{AdminLoginScreens-DeWt3H7l.js → AdminLoginScreens-D5KOQA8S.js} +1 -1
  24. package/payload/server/public/assets/{AdminShell-u32d8puE.js → AdminShell-C8wazpnz.js} +2 -2
  25. package/payload/server/public/assets/{activity-DjP45-DD.js → activity-CFqkDhTs.js} +1 -1
  26. package/payload/server/public/assets/admin-B-EGUWS4.js +1 -0
  27. package/payload/server/public/assets/agents-DPulfmrd.js +1 -0
  28. package/payload/server/public/assets/{browser-ULvl_K5x.js → browser-T_5xbnJh.js} +1 -1
  29. package/payload/server/public/assets/{calendar-CGMrT6WZ.js → calendar-CKjuiG8c.js} +1 -1
  30. package/payload/server/public/assets/chat-DWLYAA70.js +1 -0
  31. package/payload/server/public/assets/chevron-left-DBMCTKlT.js +1 -0
  32. package/payload/server/public/assets/chevron-right-SBAr6zzc.js +1 -0
  33. package/payload/server/public/assets/clock-kkzt7Scf.js +1 -0
  34. package/payload/server/public/assets/data-CV8N9qcy.js +1 -0
  35. package/payload/server/public/assets/{file-text-C5K6DMcK.js → file-text-c6cA4Evd.js} +1 -1
  36. package/payload/server/public/assets/{graph-CO6e1bgD.js → graph-DIk-o45J.js} +2 -2
  37. package/payload/server/public/assets/{graph-labels-iliQjlfE.js → graph-labels-5bjxhC_p.js} +1 -1
  38. package/payload/server/public/assets/{maximize-2-D-64XK6V.js → maximize-2-BCQkFb1_.js} +1 -1
  39. package/payload/server/public/assets/{operator-DyXgogJ1.js → operator-0UnNo2ms.js} +1 -1
  40. package/payload/server/public/assets/page-HVtUfub2.js +32 -0
  41. package/payload/server/public/assets/page-JJa2xdzf.js +1 -0
  42. package/payload/server/public/assets/{public-B9NVDBxW.js → public-CKEYyIPn.js} +1 -1
  43. package/payload/server/public/assets/{rotate-ccw-P35h7ogS.js → rotate-ccw-dTpO5dhL.js} +1 -1
  44. package/payload/server/public/assets/{routines-BeiynLF7.js → routines-C6P1-Dto.js} +1 -1
  45. package/payload/server/public/assets/{skills-C5H7ohLp.js → skills-ClrpVqlz.js} +1 -1
  46. package/payload/server/public/assets/tasks-C8SNhSFC.js +1 -0
  47. package/payload/server/public/assets/{time-entry-format-CDhHCMrW.js → time-entry-format-CCO6N6XZ.js} +1 -1
  48. package/payload/server/public/assets/{triangle-alert-OgY71rDV.js → triangle-alert-CHjdKpag.js} +1 -1
  49. package/payload/server/public/assets/{useCopyFeedback-jOGmWwa3.js → useCopyFeedback-BTUu3-l8.js} +1 -1
  50. package/payload/server/public/assets/{useSubAccountSwitcher-6AFuRawP.js → useSubAccountSwitcher-DSW9vDi2.js} +1 -1
  51. package/payload/server/public/assets/{useSubAccountSwitcher-AFSwtthL.css → useSubAccountSwitcher-DyrH8DA8.css} +1 -1
  52. package/payload/server/public/assets/{useVoiceRecorder-CnE3fhfV.js → useVoiceRecorder-BeNqxmm2.js} +1 -1
  53. package/payload/server/public/assets/{wrench-B1hsCj0R.js → wrench-CeNnc7oO.js} +1 -1
  54. package/payload/server/public/browser.html +4 -4
  55. package/payload/server/public/calendar.html +7 -7
  56. package/payload/server/public/chat.html +13 -13
  57. package/payload/server/public/data.html +11 -11
  58. package/payload/server/public/graph.html +9 -9
  59. package/payload/server/public/index.html +14 -14
  60. package/payload/server/public/operator.html +14 -14
  61. package/payload/server/public/public.html +13 -13
  62. package/payload/server/public/routines.html +6 -6
  63. package/payload/server/public/skills.html +5 -5
  64. package/payload/server/public/tasks.html +6 -6
  65. package/payload/server/server.js +1329 -826
  66. package/payload/server/public/assets/admin-Bo-Y6Vjx.js +0 -1
  67. package/payload/server/public/assets/agents-C80aCXd8.js +0 -1
  68. package/payload/server/public/assets/chat-DnWXaWD4.js +0 -1
  69. package/payload/server/public/assets/chevron-left-BB5Iljw-.js +0 -1
  70. package/payload/server/public/assets/chevron-right-DijU96_j.js +0 -1
  71. package/payload/server/public/assets/clock-DsmnhhJh.js +0 -1
  72. package/payload/server/public/assets/data-JPlhOLGC.js +0 -1
  73. package/payload/server/public/assets/page-DrbiAFS-.js +0 -32
  74. package/payload/server/public/assets/page-WeM2ry61.js +0 -1
  75. package/payload/server/public/assets/tasks-CI74_b6H.js +0 -1
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-CltuBf4Z.js";import{B as t,F as n,K as r,T as i,U as a,W as o,_ as s,g as c,p as l}from"./useSubAccountSwitcher-DSW9vDi2.js";import{T as u,_ as d,b as f,t as p}from"./AdminShell-C8wazpnz.js";var m=o(),h=e(r(),1),g=t();function _({label:e,body:t}){return(0,g.jsxs)(`div`,{className:`agent-doc`,children:[(0,g.jsx)(`span`,{className:`agent-doc-label`,children:e}),(0,g.jsx)(`pre`,{className:`skill-body`,children:t.trim()||`Empty.`})]})}function v({summary:e,publicBaseUrl:t,accountId:n,adminFetch:r,onClose:a,onDeleted:o}){let l=e.kind===`specialist`,[u]=(0,h.useState)(n),[p,m]=(0,h.useState)(null),[v,y]=(0,h.useState)(!0),[b,x]=(0,h.useState)(null),[S,C]=(0,h.useState)(!1),[w,T]=(0,h.useState)(!1);(0,h.useEffect)(()=>{let t=!1;y(!0),x(null);let n=e.kind===`specialist`&&e.plugin?`?plugin=${encodeURIComponent(e.plugin)}`:``;return r(`/api/admin/agents/${encodeURIComponent(e.slug)}${n}`).then(async e=>{if(!t){if(!e.ok)throw Error(`HTTP ${e.status}`);m((await e.json()).agent)}}).catch(e=>{t||x(e instanceof Error?e.message:`Failed to load`)}).finally(()=>{t||y(!1)}),()=>{t=!0}},[r,e.slug]),(0,h.useEffect)(()=>{let e=e=>{e.key===`Escape`&&!w&&a()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[w,a]);let E=(0,h.useCallback)(async()=>{T(!0),x(null);try{let t=await r(`/api/admin/agents/${encodeURIComponent(e.slug)}?accountId=${encodeURIComponent(u??``)}`,{method:`DELETE`,headers:{"content-type":`application/json`}});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??`HTTP ${t.status}`)}o(e)}catch(e){x(e instanceof Error?e.message:`Delete failed`),T(!1),C(!1)}},[r,e,u,o]),D=l?null:p,O=l?p:null;return(0,g.jsx)(`div`,{className:`cal-modal-overlay`,onClick:()=>{w||a()},children:(0,g.jsxs)(`div`,{className:`cal-modal cal-modal-wide`,role:`dialog`,"aria-modal":`true`,"aria-label":`Agent detail`,onClick:e=>e.stopPropagation(),children:[(0,g.jsxs)(`div`,{className:`cal-modal-header`,children:[(0,g.jsxs)(`span`,{className:`cal-modal-kind`,children:[(0,g.jsx)(f,{size:13}),` `,l?`Specialist`:`Agent`]}),(0,g.jsx)(`button`,{type:`button`,className:`cal-modal-close`,onClick:a,"aria-label":`Close`,autoFocus:!0,disabled:w,children:(0,g.jsx)(c,{size:16})})]}),(0,g.jsxs)(`div`,{className:`cal-modal-body`,children:[(0,g.jsx)(`div`,{className:`cal-modal-title`,children:e.displayName}),(0,g.jsxs)(`div`,{className:`cal-modal-row cal-modal-meta`,children:[!l&&(0,g.jsx)(`span`,{className:`agent-status-dot ${e.status}`}),(0,g.jsxs)(`span`,{children:[`/`,e.slug]})]}),v&&(0,g.jsxs)(`div`,{className:`cal-modal-row cal-modal-meta`,children:[(0,g.jsx)(i,{size:14,className:`spin`}),(0,g.jsx)(`span`,{children:`Loading…`})]}),D&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`div`,{className:`cal-modal-row cal-modal-meta`,children:(0,g.jsxs)(`span`,{children:[D.status,D.model?` · ${D.model}`:``]})}),(0,g.jsx)(`div`,{className:`cal-modal-row cal-modal-meta`,children:(0,g.jsxs)(`a`,{href:`${t}/${e.slug}`,target:`_blank`,rel:`noopener noreferrer`,className:`cal-link`,children:[(0,g.jsx)(d,{size:13}),` Open agent`]})}),D.present.identity&&(0,g.jsx)(_,{label:`Identity`,body:D.identity}),D.present.soul&&(0,g.jsx)(_,{label:`Soul`,body:D.soul}),D.present.knowledge&&(0,g.jsx)(_,{label:`Knowledge`,body:D.knowledge}),D.present.knowledgeSummary&&(0,g.jsx)(_,{label:`Knowledge summary`,body:D.knowledgeSummary}),D.knowledgeKeywords.length>0&&(0,g.jsxs)(`div`,{className:`skill-refs`,children:[(0,g.jsx)(`span`,{className:`skill-refs-label`,children:`Knowledge keywords`}),D.knowledgeKeywords.map(e=>(0,g.jsx)(`span`,{className:`skill-ref`,children:e},e))]})]}),O&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`div`,{className:`cal-modal-row cal-modal-meta`,children:(0,g.jsxs)(`span`,{children:[e.plugin,O.model?` · ${O.model}`:``]})}),O.description&&(0,g.jsx)(`div`,{className:`cal-modal-row cal-modal-meta`,children:(0,g.jsx)(`span`,{children:O.description})}),O.tools.length>0&&(0,g.jsxs)(`div`,{className:`skill-refs`,children:[(0,g.jsx)(`span`,{className:`skill-refs-label`,children:`Tools`}),O.tools.map(e=>(0,g.jsx)(`span`,{className:`skill-ref`,children:e},e))]}),O.skills.length>0&&(0,g.jsxs)(`div`,{className:`skill-refs`,children:[(0,g.jsx)(`span`,{className:`skill-refs-label`,children:`Skills`}),O.skills.map(e=>(0,g.jsx)(`span`,{className:`skill-ref`,children:e},e))]}),(0,g.jsx)(_,{label:`System prompt`,body:O.systemPrompt})]})]}),b&&(0,g.jsx)(`div`,{className:`cal-modal-error`,children:b}),(0,g.jsx)(`div`,{className:`cal-modal-actions`,children:l?(0,g.jsx)(`span`,{className:`cal-modal-confirm-text`,children:`Edit in chat via agent-builder.`}):(0,g.jsxs)(g.Fragment,{children:[!S&&(0,g.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-danger`,onClick:()=>C(!0),disabled:w||v||!u,children:[(0,g.jsx)(s,{size:14}),` Delete`]}),S&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`span`,{className:`cal-modal-confirm-text`,children:`Delete this agent?`}),(0,g.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-danger`,onClick:E,disabled:w,children:[w?(0,g.jsx)(i,{size:14,className:`spin`}):(0,g.jsx)(s,{size:14}),` Delete`]}),(0,g.jsx)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>C(!1),disabled:w,children:`Cancel`})]})]})})]})})}var y=`maxy-admin-session-key`;function b(){let[e,t]=(0,h.useState)(null),[r,i]=(0,h.useState)(!1),[a,o]=(0,h.useState)(void 0),[s,c]=(0,h.useState)(null),[d,f]=(0,h.useState)(void 0),[m,_]=(0,h.useState)(null),[v,b]=(0,h.useState)(null);(0,h.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem(y)}catch{}if(!n){i(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(async r=>{if(!e){if(r.status===401){try{sessionStorage.removeItem(y)}catch{}window.location.href=`/`;return}if(r.ok)try{let e=await r.json();typeof e.businessName==`string`&&o(e.businessName),e.sessionId!==void 0&&c(e.sessionId??null),b(e.role??null),f(e.userName===void 0?null:e.userName),_(e.avatar??null)}catch{}t(n),i(!0)}}).catch(()=>{e||(t(n),i(!0))}),()=>{e=!0}},[]);let S=(0,h.useCallback)(()=>{try{sessionStorage.removeItem(y)}catch{}window.location.href=`/`},[]),[C,w]=(0,h.useState)(!1),T=(0,h.useCallback)(async()=>{w(!0);try{let e=await u();if(e){try{sessionStorage.removeItem(y)}catch{}window.location.href=`/`}return e}finally{w(!1)}},[]);return r?e?(0,g.jsx)(l,{cacheKey:e,surface:`agents`,onSessionExpired:({code:e,path:t})=>{console.warn(`[admin-auth] outcome=session-expired-redirect code=${e} path=${t} surface=agents`);try{sessionStorage.removeItem(y)}catch{}window.location.href=`/`},children:(0,g.jsx)(p,{cacheKey:e,businessName:a,sessionId:s,onLogout:S,onDisconnect:T,disconnecting:C,userName:d,userAvatar:m,role:v,children:(0,g.jsx)(x,{cacheKey:e})})}):(0,g.jsx)(`div`,{className:`cal-page`,children:(0,g.jsxs)(`div`,{className:`cal-empty`,children:[(0,g.jsx)(`p`,{children:`You are not signed in.`}),(0,g.jsxs)(`p`,{children:[`Open the `,(0,g.jsx)(`a`,{href:`/`,className:`cal-link`,children:`main admin page`}),` and log in, then return here.`]})]})}):(0,g.jsx)(n,{surface:`gate`})}function x({cacheKey:e}){let{adminFetch:t,sessionRefetchNonce:r}=a({initialCacheKey:e,surface:`agents`}),[o,s]=(0,h.useState)([]),[c,l]=(0,h.useState)(0),[u,d]=(0,h.useState)(0),[p,m]=(0,h.useState)(null),[_,y]=(0,h.useState)(!1),[b,x]=(0,h.useState)(!1),[S,C]=(0,h.useState)(null),[w,T]=(0,h.useState)(null),[E,D]=(0,h.useState)(``);(0,h.useEffect)(()=>{D(window.location.hostname.startsWith(`admin.`)?window.location.origin.replace(`admin.`,`public.`):window.location.origin)},[]);let O=(0,h.useCallback)(()=>{let e=!1;return y(!0),C(null),t(`/api/admin/agents`).then(async t=>{if(e)return;if(!t.ok)throw Error(`HTTP ${t.status}`);let n=await t.json();s(Array.isArray(n.agents)?n.agents:[]),l(typeof n.skipped==`number`?n.skipped:0),d(typeof n.specialistsSkipped==`number`?n.specialistsSkipped:0),m(typeof n.accountId==`string`?n.accountId:null)}).catch(t=>{e||(C(t instanceof Error?t.message:`Failed to load`),s([]))}).finally(()=>{e||(y(!1),x(!0))}),()=>{e=!0}},[t]);(0,h.useEffect)(()=>O(),[O,r]);let k=(0,h.useCallback)(e=>{s(t=>t.filter(t=>t.slug!==e.slug)),T(null),O()},[O]);return b?(0,g.jsxs)(`div`,{className:`cal-page`,children:[(0,g.jsx)(`header`,{className:`cal-header`,children:(0,g.jsxs)(`div`,{className:`cal-nav`,children:[(0,g.jsxs)(`span`,{className:`cal-range-label`,children:[(0,g.jsx)(f,{size:16}),` Agents`]}),_&&(0,g.jsx)(i,{size:16,className:`spin`})]})}),(0,g.jsxs)(`div`,{className:`cal-body`,children:[S&&(0,g.jsxs)(`div`,{className:`cal-error`,children:[`Could not load agents: `,S]}),c+u>0&&(0,g.jsxs)(`div`,{className:`cal-error`,children:[c+u,` agent`,c+u===1?``:`s`,` could not be read (malformed config or frontmatter).`]}),!S&&!_&&o.length===0&&(0,g.jsx)(`div`,{className:`cal-empty`,children:(0,g.jsx)(`p`,{children:`No agents yet. Ask in chat to create one.`})}),o.length>0&&(0,g.jsx)(`div`,{className:`routine-list`,children:o.map(e=>(0,g.jsxs)(`button`,{type:`button`,className:`routine-card`,onClick:()=>T(e),children:[(0,g.jsxs)(`span`,{className:`routine-card-title`,children:[e.displayName,(0,g.jsx)(`span`,{className:`agent-kind-pill agent-kind-${e.kind}`,children:e.kind===`specialist`?`Specialist`:`Public`})]}),e.kind===`specialist`?(0,g.jsxs)(`span`,{className:`routine-card-sched`,children:[`/`,e.slug]}):(0,g.jsxs)(`span`,{className:`routine-card-sched`,children:[(0,g.jsx)(`span`,{className:`agent-status-dot ${e.status}`}),` /`,e.slug]}),(0,g.jsx)(`span`,{className:`routine-card-meta`,children:e.kind===`specialist`?e.plugin:e.status})]},e.slug))})]}),w&&(0,g.jsx)(v,{summary:w,publicBaseUrl:E,accountId:p,adminFetch:t,onClose:()=>T(null),onDeleted:k})]}):(0,g.jsx)(n,{surface:`gate`})}(0,m.createRoot)(document.getElementById(`root`)).render((0,g.jsx)(b,{}));
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CltuBf4Z.js";import{B as t,D as n,G as r,I as i,T as a,U as o,m as s,p as c}from"./useSubAccountSwitcher-6AFuRawP.js";import{T as l,_ as u,t as d}from"./AdminShell-u32d8puE.js";var f=o(),p=e(r(),1),m=t(),h=`maxy-vnc-popout`;function g(){let[e,t]=(0,p.useState)(null),[r,o]=(0,p.useState)(!1),[c,l]=(0,p.useState)(null),d=s(null);(0,p.useEffect)(()=>{let e=!1;return fetch(`/vnc-viewer.html`,{method:`HEAD`}).then(n=>{e||(console.info(`[browser-page] op=viewer-probe available=${n.ok}`),t(n.ok))}).catch(()=>{e||(console.info(`[browser-page] op=viewer-probe available=false`),t(!1))}),()=>{e=!0}},[]);let f=(0,p.useCallback)(()=>{window.open(`/vnc-popout.html?title=${encodeURIComponent(i.productName)}`,h,`width=1024,height=768`)},[]),g=(0,p.useCallback)(async()=>{o(!0),l(null);try{let e=await d(`/api/admin/browser/launch`,{method:`POST`});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error||`Launch failed (${e.status})`)}}catch(e){l(e instanceof Error?e.message:String(e))}finally{o(!1)}},[d]);return e===null?(0,m.jsx)(`div`,{className:`vnc-surface`,children:(0,m.jsxs)(`div`,{className:`data-loading`,children:[(0,m.jsx)(a,{size:18,className:`spin`}),` Checking viewer…`]})}):e?(0,m.jsxs)(`div`,{className:`vnc-surface`,children:[(0,m.jsxs)(`div`,{className:`vnc-surface__toolbar`,children:[(0,m.jsxs)(`button`,{type:`button`,className:`vnc-surface__btn`,onClick:g,disabled:r,children:[r?(0,m.jsx)(a,{size:14,className:`spin`}):(0,m.jsx)(n,{size:14}),` Launch browser`]}),(0,m.jsxs)(`button`,{type:`button`,className:`vnc-surface__btn`,onClick:f,children:[(0,m.jsx)(u,{size:14}),` Pop out`]}),c&&(0,m.jsx)(`span`,{className:`vnc-surface__error`,children:c})]}),(0,m.jsx)(`div`,{className:`vnc-surface__viewport`,children:(0,m.jsx)(`iframe`,{className:`vnc-surface__iframe`,src:`/vnc-viewer.html`,title:`VNC viewer`})})]}):(0,m.jsx)(`div`,{className:`vnc-surface`,children:(0,m.jsxs)(`div`,{className:`vnc-surface__unavailable`,children:[(0,m.jsx)(n,{size:28,strokeWidth:1.75}),(0,m.jsx)(`p`,{children:`VNC surface not available on this platform.`})]})})}function _(){let[e,t]=(0,p.useState)(null),[r,i]=(0,p.useState)(!1),[o,s]=(0,p.useState)(void 0),[u,f]=(0,p.useState)(null),[h,_]=(0,p.useState)(void 0),[v,y]=(0,p.useState)(null),[b,x]=(0,p.useState)(null);(0,p.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem(`maxy-admin-session-key`)}catch{}if(!n){t(null),i(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(async r=>{if(!e){if(r.status===401){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`;return}if(r.ok)try{let e=await r.json();typeof e.businessName==`string`&&s(e.businessName),e.sessionId!==void 0&&f(e.sessionId??null),x(e.role??null),_(e.userName===void 0?null:e.userName),y(e.avatar??null)}catch{}t(n),i(!0)}}).catch(()=>{e||(t(n),i(!0))}),()=>{e=!0}},[]);let S=(0,p.useCallback)(()=>{try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},[]),[C,w]=(0,p.useState)(!1),T=(0,p.useCallback)(async()=>{w(!0);try{let e=await l();if(e){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`}return e}finally{w(!1)}},[]);return r?e?(0,m.jsx)(c,{cacheKey:e,surface:`browser`,onSessionExpired:({code:e,path:t})=>{console.warn(`[admin-auth] outcome=session-expired-redirect code=${e} path=${t} surface=browser`);try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},children:(0,m.jsx)(d,{cacheKey:e,businessName:o,sessionId:u,onLogout:S,onDisconnect:T,disconnecting:C,userName:h,userAvatar:v,role:b,children:(0,m.jsxs)(`div`,{className:`data-page`,children:[(0,m.jsx)(`header`,{className:`data-header`,children:(0,m.jsxs)(`h1`,{className:`data-title`,children:[(0,m.jsx)(n,{size:18}),` Browser`]})}),(0,m.jsx)(g,{})]})})}):(0,m.jsxs)(`div`,{className:`data-page`,children:[(0,m.jsx)(`header`,{className:`data-header`,children:(0,m.jsxs)(`h1`,{className:`data-title`,children:[(0,m.jsx)(n,{size:18}),` Browser`]})}),(0,m.jsxs)(`div`,{className:`data-empty`,children:[(0,m.jsx)(`p`,{children:`You are not signed in.`}),(0,m.jsxs)(`p`,{children:[`Open the `,(0,m.jsx)(`a`,{href:`/`,className:`data-link`,children:`main admin page`}),` and log in, then return here.`]})]})]}):(0,m.jsx)(`div`,{className:`data-page`,children:(0,m.jsxs)(`div`,{className:`data-loading`,children:[(0,m.jsx)(a,{size:18,className:`spin`}),` Loading…`]})})}(0,f.createRoot)(document.getElementById(`root`)).render((0,m.jsx)(_,{}));
1
+ import{o as e}from"./chunk-CltuBf4Z.js";import{B as t,D as n,I as r,K as i,T as a,W as o,m as s,p as c}from"./useSubAccountSwitcher-DSW9vDi2.js";import{T as l,_ as u,t as d}from"./AdminShell-C8wazpnz.js";var f=o(),p=e(i(),1),m=t(),h=`maxy-vnc-popout`;function g(){let[e,t]=(0,p.useState)(null),[i,o]=(0,p.useState)(!1),[c,l]=(0,p.useState)(null),d=s(null);(0,p.useEffect)(()=>{let e=!1;return fetch(`/vnc-viewer.html`,{method:`HEAD`}).then(n=>{e||(console.info(`[browser-page] op=viewer-probe available=${n.ok}`),t(n.ok))}).catch(()=>{e||(console.info(`[browser-page] op=viewer-probe available=false`),t(!1))}),()=>{e=!0}},[]);let f=(0,p.useCallback)(()=>{window.open(`/vnc-popout.html?title=${encodeURIComponent(r.productName)}`,h,`width=1024,height=768`)},[]),g=(0,p.useCallback)(async()=>{o(!0),l(null);try{let e=await d(`/api/admin/browser/launch`,{method:`POST`});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error||`Launch failed (${e.status})`)}}catch(e){l(e instanceof Error?e.message:String(e))}finally{o(!1)}},[d]);return e===null?(0,m.jsx)(`div`,{className:`vnc-surface`,children:(0,m.jsxs)(`div`,{className:`data-loading`,children:[(0,m.jsx)(a,{size:18,className:`spin`}),` Checking viewer…`]})}):e?(0,m.jsxs)(`div`,{className:`vnc-surface`,children:[(0,m.jsxs)(`div`,{className:`vnc-surface__toolbar`,children:[(0,m.jsxs)(`button`,{type:`button`,className:`vnc-surface__btn`,onClick:g,disabled:i,children:[i?(0,m.jsx)(a,{size:14,className:`spin`}):(0,m.jsx)(n,{size:14}),` Launch browser`]}),(0,m.jsxs)(`button`,{type:`button`,className:`vnc-surface__btn`,onClick:f,children:[(0,m.jsx)(u,{size:14}),` Pop out`]}),c&&(0,m.jsx)(`span`,{className:`vnc-surface__error`,children:c})]}),(0,m.jsx)(`div`,{className:`vnc-surface__viewport`,children:(0,m.jsx)(`iframe`,{className:`vnc-surface__iframe`,src:`/vnc-viewer.html`,title:`VNC viewer`})})]}):(0,m.jsx)(`div`,{className:`vnc-surface`,children:(0,m.jsxs)(`div`,{className:`vnc-surface__unavailable`,children:[(0,m.jsx)(n,{size:28,strokeWidth:1.75}),(0,m.jsx)(`p`,{children:`VNC surface not available on this platform.`})]})})}function _(){let[e,t]=(0,p.useState)(null),[r,i]=(0,p.useState)(!1),[o,s]=(0,p.useState)(void 0),[u,f]=(0,p.useState)(null),[h,_]=(0,p.useState)(void 0),[v,y]=(0,p.useState)(null),[b,x]=(0,p.useState)(null);(0,p.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem(`maxy-admin-session-key`)}catch{}if(!n){t(null),i(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(async r=>{if(!e){if(r.status===401){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`;return}if(r.ok)try{let e=await r.json();typeof e.businessName==`string`&&s(e.businessName),e.sessionId!==void 0&&f(e.sessionId??null),x(e.role??null),_(e.userName===void 0?null:e.userName),y(e.avatar??null)}catch{}t(n),i(!0)}}).catch(()=>{e||(t(n),i(!0))}),()=>{e=!0}},[]);let S=(0,p.useCallback)(()=>{try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},[]),[C,w]=(0,p.useState)(!1),T=(0,p.useCallback)(async()=>{w(!0);try{let e=await l();if(e){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`}return e}finally{w(!1)}},[]);return r?e?(0,m.jsx)(c,{cacheKey:e,surface:`browser`,onSessionExpired:({code:e,path:t})=>{console.warn(`[admin-auth] outcome=session-expired-redirect code=${e} path=${t} surface=browser`);try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},children:(0,m.jsx)(d,{cacheKey:e,businessName:o,sessionId:u,onLogout:S,onDisconnect:T,disconnecting:C,userName:h,userAvatar:v,role:b,children:(0,m.jsxs)(`div`,{className:`data-page`,children:[(0,m.jsx)(`header`,{className:`data-header`,children:(0,m.jsxs)(`h1`,{className:`data-title`,children:[(0,m.jsx)(n,{size:18}),` Browser`]})}),(0,m.jsx)(g,{})]})})}):(0,m.jsxs)(`div`,{className:`data-page`,children:[(0,m.jsx)(`header`,{className:`data-header`,children:(0,m.jsxs)(`h1`,{className:`data-title`,children:[(0,m.jsx)(n,{size:18}),` Browser`]})}),(0,m.jsxs)(`div`,{className:`data-empty`,children:[(0,m.jsx)(`p`,{children:`You are not signed in.`}),(0,m.jsxs)(`p`,{children:[`Open the `,(0,m.jsx)(`a`,{href:`/`,className:`data-link`,children:`main admin page`}),` and log in, then return here.`]})]})]}):(0,m.jsx)(`div`,{className:`data-page`,children:(0,m.jsxs)(`div`,{className:`data-loading`,children:[(0,m.jsx)(a,{size:18,className:`spin`}),` Loading…`]})})}(0,f.createRoot)(document.getElementById(`root`)).render((0,m.jsx)(_,{}));
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CltuBf4Z.js";import{B as t,F as n,G as r,H as i,P as a,S as o,T as s,U as c,_ as l,g as u,k as d,p as f}from"./useSubAccountSwitcher-6AFuRawP.js";import{T as p,_ as m,t as h}from"./AdminShell-u32d8puE.js";import{t as g}from"./chevron-left-BB5Iljw-.js";import{t as _}from"./chevron-right-DijU96_j.js";import{t as v}from"./clock-DsmnhhJh.js";var y=a(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),b=a(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),x=a(`sticky-note`,[[`path`,{d:`M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z`,key:`1dfntj`}],[`path`,{d:`M15 3v5a1 1 0 0 0 1 1h5`,key:`6s6qgf`}]]),S=a(`user-plus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]),C=a(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),w=c(),T=e(r(),1);function E(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function D(e,t){let n=new Date(e);return n.setDate(n.getDate()+t),n}function O(e){let t=E(e),n=t.getDay();return D(t,n===0?-6:1-n)}function k(e){let t=O(e);return Array.from({length:7},(e,n)=>D(t,n))}function A(e){let t=O(new Date(e.getFullYear(),e.getMonth(),1));return Array.from({length:42},(e,n)=>D(t,n))}function j(){return Array.from({length:24},(e,t)=>t)}function M(e){let t=e.getFullYear();return Array.from({length:12},(e,n)=>new Date(t,n,1))}function N(e,t){switch(e){case`day`:{let e=E(t);return{from:e,to:D(e,1)}}case`week`:{let e=O(t);return{from:e,to:D(e,7)}}case`month`:{let e=O(new Date(t.getFullYear(),t.getMonth(),1));return{from:e,to:D(e,42)}}case`year`:return{from:new Date(t.getFullYear(),0,1),to:new Date(t.getFullYear()+1,0,1)}}}function P(e,t,n){switch(e){case`day`:return D(t,n);case`week`:return D(t,n*7);case`month`:return new Date(t.getFullYear(),t.getMonth()+n,1);case`year`:return new Date(t.getFullYear()+n,t.getMonth(),1)}}function F(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function I(e,t){return{role:`button`,tabIndex:0,onClick:()=>t(e),onKeyDown:n=>{(n.key===`Enter`||n.key===` `)&&(n.preventDefault(),t(e))}}}var L=t(),R=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],z=3;function ee(e){return e.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function B({anchor:e,meetings:t,onSelect:n}){let r=A(e),i=e.getMonth(),a=new Date;return(0,L.jsxs)(`div`,{className:`cal-month`,children:[(0,L.jsx)(`div`,{className:`cal-weekday-row`,children:R.map(e=>(0,L.jsx)(`div`,{className:`cal-weekday`,children:e},e))}),(0,L.jsx)(`div`,{className:`cal-month-grid`,children:r.map(e=>{let r=t.filter(t=>F(new Date(t.startsAt),e)).sort((e,t)=>e.startsAt.localeCompare(t.startsAt)),o=e.getMonth()!==i,s=F(e,a);return(0,L.jsxs)(`div`,{className:`cal-cell${o?` cal-cell-out`:``}${s?` cal-cell-today`:``}`,children:[(0,L.jsx)(`div`,{className:`cal-cell-num`,children:e.getDate()}),r.slice(0,z).map(e=>(0,L.jsxs)(`div`,{className:`cal-chip`,title:e.title??`Untitled`,...I(e,n),children:[!e.isAllDay&&(0,L.jsx)(`span`,{className:`cal-chip-time`,children:ee(new Date(e.startsAt))}),e.title??`Untitled`]},e.meetingId)),r.length>z&&(0,L.jsxs)(`div`,{className:`cal-more`,children:[`+`,r.length-z,` more`]})]},e.toISOString())})})]})}var V=1440,H=1.8;function U(e){return e.getHours()*60+e.getMinutes()}function W(e){return e.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function G({day:e,meetings:t,hourHeight:n,onSelect:r}){let i=n*24,a=t.filter(t=>!t.isAllDay&&F(new Date(t.startsAt),e));return(0,L.jsx)(`div`,{className:`cal-day-col`,children:(0,L.jsxs)(`div`,{className:`cal-hours`,style:{height:`${i}px`},children:[Array.from({length:24},(e,t)=>(0,L.jsx)(`div`,{className:`cal-hour-line`,style:{top:`${t*n}px`}},t)),a.map(t=>{let n=new Date(t.startsAt),i=t.endsAt?new Date(t.endsAt):new Date(n.getTime()+30*6e4),a=U(n),o=F(i,e)?U(i):V,s=a/V*100,c=Math.max((o-a)/V*100,H);return(0,L.jsxs)(`div`,{className:`cal-event`,style:{top:`${s}%`,height:`${c}%`},title:t.title??`Untitled`,...I(t,r),children:[(0,L.jsx)(`span`,{className:`cal-event-time`,children:W(n)}),(0,L.jsx)(`span`,{className:`cal-event-title`,children:t.title??`Untitled`})]},t.meetingId)})]})})}var K=44;function q(e){let t=new Date;return t.setHours(e,0,0,0),t.toLocaleTimeString([],{hour:`numeric`})}function te({anchor:e,meetings:t,onSelect:n}){let r=k(e),i=new Date;return(0,L.jsxs)(`div`,{className:`cal-timed`,children:[(0,L.jsxs)(`div`,{className:`cal-day-headrow`,children:[(0,L.jsx)(`div`,{className:`cal-timed-gutter`}),r.map(e=>(0,L.jsxs)(`div`,{className:`cal-day-head${F(e,i)?` cal-day-head-today`:``}`,children:[(0,L.jsx)(`span`,{className:`cal-day-head-name`,children:e.toLocaleDateString([],{weekday:`short`})}),(0,L.jsx)(`span`,{className:`cal-day-head-num`,children:e.getDate()})]},e.toISOString()))]}),(0,L.jsxs)(`div`,{className:`cal-allday-band`,children:[(0,L.jsx)(`div`,{className:`cal-timed-gutter`,children:`All-day`}),r.map(e=>(0,L.jsx)(`div`,{className:`cal-allday-cell`,children:t.filter(t=>t.isAllDay&&F(new Date(t.startsAt),e)).map(e=>(0,L.jsx)(`div`,{className:`cal-allday-chip`,title:e.title??`Untitled`,...I(e,n),children:e.title??`Untitled`},e.meetingId))},e.toISOString()))]}),(0,L.jsxs)(`div`,{className:`cal-timed-cols`,children:[(0,L.jsx)(`div`,{className:`cal-timed-gutter`,children:j().map(e=>(0,L.jsx)(`div`,{className:`cal-hour-label`,style:{height:`${K}px`},children:e===0?``:q(e)},e))}),r.map(e=>(0,L.jsx)(G,{day:e,meetings:t,hourHeight:K,onSelect:n},e.toISOString()))]})]})}var J=52;function Y(e){let t=new Date;return t.setHours(e,0,0,0),t.toLocaleTimeString([],{hour:`numeric`})}function X({anchor:e,meetings:t,onSelect:n}){let r=t.filter(t=>t.isAllDay&&F(new Date(t.startsAt),e));return(0,L.jsxs)(`div`,{className:`cal-timed cal-timed-single`,children:[(0,L.jsxs)(`div`,{className:`cal-allday-band`,children:[(0,L.jsx)(`div`,{className:`cal-timed-gutter`,children:`All-day`}),(0,L.jsx)(`div`,{className:`cal-allday-cell`,children:r.map(e=>(0,L.jsx)(`div`,{className:`cal-allday-chip`,title:e.title??`Untitled`,...I(e,n),children:e.title??`Untitled`},e.meetingId))})]}),(0,L.jsxs)(`div`,{className:`cal-timed-cols`,children:[(0,L.jsx)(`div`,{className:`cal-timed-gutter`,children:j().map(e=>(0,L.jsx)(`div`,{className:`cal-hour-label`,style:{height:`${J}px`},children:e===0?``:Y(e)},e))}),(0,L.jsx)(G,{day:e,meetings:t,hourHeight:J,onSelect:n})]})]})}var ne=[`M`,`T`,`W`,`T`,`F`,`S`,`S`];function Z(e){return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`}function re({anchor:e,meetings:t,onPickMonth:n}){let r=new Date,i=new Set(t.map(e=>Z(new Date(e.startsAt))));return(0,L.jsx)(`div`,{className:`cal-year`,children:(0,L.jsx)(`div`,{className:`cal-year-grid`,children:M(e).map(e=>{let t=A(e),a=e.getMonth();return(0,L.jsxs)(`button`,{type:`button`,className:`cal-mini`,onClick:()=>n(e),title:e.toLocaleDateString([],{month:`long`,year:`numeric`}),children:[(0,L.jsx)(`div`,{className:`cal-mini-title`,children:e.toLocaleDateString([],{month:`long`})}),(0,L.jsx)(`div`,{className:`cal-mini-weekrow`,children:ne.map((e,t)=>(0,L.jsx)(`span`,{className:`cal-mini-weekday`,children:e},t))}),(0,L.jsx)(`div`,{className:`cal-mini-grid`,children:t.map(e=>{let t=e.getMonth()!==a,n=F(e,r),o=!t&&i.has(Z(e));return(0,L.jsxs)(`span`,{className:`cal-mini-day${t?` cal-mini-day-out`:``}${n?` cal-mini-day-today`:``}`,children:[e.getDate(),o&&(0,L.jsx)(`span`,{className:`cal-mini-dot`})]},e.toISOString())})})]},a)})})})}var ie={meeting:`Meeting`,event:`Event`,task:`Task`};function ae(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}function oe(e){return new Date(e).toISOString()}function Q(e){return Math.floor(new Date(e).getTime()/6e4)}function se(e){let t=new Date(e.startsAt);if(e.isAllDay)return t.toLocaleDateString([],{weekday:`long`,day:`numeric`,month:`long`,year:`numeric`});let n=t.toLocaleDateString([],{weekday:`long`,day:`numeric`,month:`long`,year:`numeric`}),r=t.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`});return e.endsAt?`${n} · ${r} – ${new Date(e.endsAt).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}`:`${n} · ${r}`}function ce(e){if(!e)return null;let t=e.match(/filename="([^"]+)"/);return t?t[1]:null}function le(e,t){return e.email??`${e.name??`unknown`}-${t}`}function ue({a:e}){let t=e.name||e.email||`Unknown`,n=e.name&&e.email?e.email:null;return(0,L.jsxs)(`span`,{className:`cal-attendee-lines`,children:[(0,L.jsx)(`span`,{className:`cal-attendee-name`,children:t}),n&&(0,L.jsx)(`span`,{className:`cal-attendee-email`,children:n})]})}function de({meeting:e,adminFetch:t,onClose:n,onSaved:r,onDeleted:i}){let a=e.kind===`meeting`,[c,f]=(0,T.useState)(!1),[p,m]=(0,T.useState)(!1),[h,g]=(0,T.useState)(!1),[_,w]=(0,T.useState)(!1),[E,D]=(0,T.useState)(null),[O,k]=(0,T.useState)(e),[A,j]=(0,T.useState)(e.title??``),[M,N]=(0,T.useState)(ae(e.startsAt)),[P,F]=(0,T.useState)(e.endsAt?ae(e.endsAt):``),[I,R]=(0,T.useState)(e.location??``),[z,ee]=(0,T.useState)(e.privateNote??``),[B,V]=(0,T.useState)(``),[H,U]=(0,T.useState)(``);(0,T.useEffect)(()=>{let e=e=>{e.key===`Escape`&&!_&&n()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[_,n]);let W=(0,T.useCallback)(()=>{let e={},t=A.trim();t!==(O.title??``)&&(e.title=t);let n=oe(M);Q(n)!==Q(O.startsAt)&&(e.startsAt=n);let r=P?oe(P):null;(r===null?O.endsAt!==null:O.endsAt===null||Q(r)!==Q(O.endsAt))&&(e.endsAt=r);let i=I.trim()||null;i!==(O.location??null)&&(e.location=i);let a=z.trim()||null;return a!==(O.privateNote??null)&&(e.privateNote=a),e},[A,M,P,I,z,O]),G=(0,T.useCallback)(async()=>{let n=W();if(Object.keys(n).length===0){f(!1);return}w(!0),D(null);try{let i=await t(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(n)});if(!i.ok)throw Error(`HTTP ${i.status}`);let a=await i.json();k(a.meeting),r(a.meeting),f(!1)}catch(e){D(e instanceof Error?e.message:`Save failed`)}finally{w(!1)}},[t,W,e.meetingId,r]),K=(0,T.useCallback)(async()=>{let n=B.trim(),i=H.trim();if(!(!n&&!i)){w(!0),D(null);try{let a=await t(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}/attendees`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({name:n||void 0,email:i||void 0})});if(!a.ok)throw Error(`HTTP ${a.status}`);let o=await a.json();k(o.meeting),r(o.meeting),V(``),U(``)}catch(e){D(e instanceof Error?e.message:`Add failed`)}finally{w(!1)}}},[t,B,H,e.meetingId,r]),q=(0,T.useCallback)(async n=>{let i=n.email?{email:n.email}:{name:n.name};w(!0),D(null);try{let n=await t(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}/attendees`,{method:`DELETE`,headers:{"content-type":`application/json`},body:JSON.stringify(i)});if(!n.ok)throw Error(`HTTP ${n.status}`);let a=await n.json();k(a.meeting),r(a.meeting)}catch(e){D(e instanceof Error?e.message:`Remove failed`)}finally{w(!1)}},[t,e.meetingId,r]),te=(0,T.useCallback)(async()=>{w(!0),D(null);try{let n=await t(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}`,{method:`DELETE`});if(!n.ok)throw Error(`HTTP ${n.status}`);i(e.meetingId)}catch(e){D(e instanceof Error?e.message:`Delete failed`),w(!1)}},[t,e.meetingId,i]),J=(0,T.useCallback)(async n=>{g(!1),w(!0),D(null);try{let r=await t(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}/ics?attendees=${n?`1`:`0`}`);if(!r.ok)throw Error(`HTTP ${r.status}`);let i=await r.blob(),a=ce(r.headers.get(`content-disposition`))??`meeting.ics`,o=URL.createObjectURL(i),s=document.createElement(`a`);s.href=o,s.download=a,document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(o)}catch(e){D(e instanceof Error?e.message:`Download failed`)}finally{w(!1)}},[t,e.meetingId]),Y=ie[e.kind??`meeting`],X=B.trim().length>0||H.trim().length>0;return(0,L.jsx)(`div`,{className:`cal-modal-overlay`,onClick:()=>{_||n()},children:(0,L.jsxs)(`div`,{className:`cal-modal cal-modal-wide`,role:`dialog`,"aria-modal":`true`,"aria-label":c?`Edit meeting`:`Meeting detail`,onClick:e=>e.stopPropagation(),children:[(0,L.jsxs)(`div`,{className:`cal-modal-header`,children:[(0,L.jsx)(`span`,{className:`cal-modal-kind`,children:Y}),(0,L.jsx)(`button`,{type:`button`,className:`cal-modal-close`,onClick:n,"aria-label":`Close`,autoFocus:!0,disabled:_,children:(0,L.jsx)(u,{size:16})})]}),!c&&(0,L.jsxs)(`div`,{className:`cal-modal-body`,children:[(0,L.jsx)(`div`,{className:`cal-modal-title`,children:O.title??`Untitled`}),(0,L.jsxs)(`div`,{className:`cal-modal-row`,children:[(0,L.jsx)(v,{size:14}),(0,L.jsx)(`span`,{children:se(O)})]}),O.location&&(0,L.jsxs)(`div`,{className:`cal-modal-row`,children:[(0,L.jsx)(b,{size:14}),(0,L.jsx)(`span`,{children:O.location})]}),O.attendees.length>0&&(0,L.jsxs)(`div`,{className:`cal-modal-row cal-modal-row-top`,children:[(0,L.jsx)(C,{size:14}),(0,L.jsx)(`div`,{className:`cal-modal-attendees`,children:O.attendees.map((e,t)=>(0,L.jsx)(`div`,{className:`cal-attendee-row`,children:(0,L.jsx)(ue,{a:e})},le(e,t)))})]}),O.privateNote&&(0,L.jsxs)(`div`,{className:`cal-modal-row cal-modal-row-top`,children:[(0,L.jsx)(x,{size:14}),(0,L.jsx)(`span`,{className:`cal-modal-note`,children:O.privateNote})]}),(0,L.jsxs)(`div`,{className:`cal-modal-row cal-modal-meta`,children:[(0,L.jsx)(y,{size:14}),(0,L.jsx)(`span`,{children:Y})]})]}),c&&(0,L.jsxs)(`div`,{className:`cal-modal-body`,children:[(0,L.jsxs)(`label`,{className:`cal-modal-field`,children:[(0,L.jsx)(`span`,{children:`Title`}),(0,L.jsx)(`input`,{type:`text`,value:A,onChange:e=>j(e.target.value),disabled:_})]}),(0,L.jsxs)(`label`,{className:`cal-modal-field`,children:[(0,L.jsx)(`span`,{children:`Start`}),(0,L.jsx)(`input`,{type:`datetime-local`,value:M,onChange:e=>N(e.target.value),disabled:_})]}),(0,L.jsxs)(`label`,{className:`cal-modal-field`,children:[(0,L.jsx)(`span`,{children:`End`}),(0,L.jsx)(`input`,{type:`datetime-local`,value:P,onChange:e=>F(e.target.value),disabled:_})]}),(0,L.jsxs)(`label`,{className:`cal-modal-field`,children:[(0,L.jsx)(`span`,{children:`Location`}),(0,L.jsx)(`input`,{type:`text`,value:I,onChange:e=>R(e.target.value),disabled:_})]}),(0,L.jsxs)(`div`,{className:`cal-modal-field`,children:[(0,L.jsx)(`span`,{children:`Attendees`}),(0,L.jsxs)(`div`,{className:`cal-modal-attendees cal-modal-attendees-edit`,children:[O.attendees.length===0&&(0,L.jsx)(`div`,{className:`cal-attendee-empty`,children:`No attendees yet.`}),O.attendees.map((e,t)=>(0,L.jsxs)(`div`,{className:`cal-attendee-row cal-attendee-row-edit`,children:[(0,L.jsx)(ue,{a:e}),(0,L.jsx)(`button`,{type:`button`,className:`cal-attendee-remove`,onClick:()=>q(e),disabled:_,"aria-label":`Remove ${e.name||e.email||`attendee`}`,children:(0,L.jsx)(u,{size:13})})]},le(e,t)))]}),(0,L.jsxs)(`div`,{className:`cal-attendee-add`,children:[(0,L.jsx)(`input`,{type:`text`,placeholder:`Name`,value:B,onChange:e=>V(e.target.value),disabled:_,"aria-label":`Attendee name`}),(0,L.jsx)(`input`,{type:`email`,placeholder:`Email`,value:H,onChange:e=>U(e.target.value),disabled:_,"aria-label":`Attendee email`}),(0,L.jsx)(`button`,{type:`button`,className:`cal-modal-btn cal-attendee-add-btn`,onClick:K,disabled:_||!X,"aria-label":`Add attendee`,children:_?(0,L.jsx)(s,{size:13,className:`spin`}):(0,L.jsx)(S,{size:13})})]})]}),(0,L.jsxs)(`label`,{className:`cal-modal-field`,children:[(0,L.jsx)(`span`,{children:`Private note`}),(0,L.jsx)(`textarea`,{className:`cal-modal-textarea`,value:z,onChange:e=>ee(e.target.value),disabled:_,rows:3,placeholder:`Only you and your team can see this.`})]})]}),E&&(0,L.jsx)(`div`,{className:`cal-modal-error`,children:E}),a&&(0,L.jsxs)(`div`,{className:`cal-modal-actions`,children:[!c&&!p&&!h&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>f(!0),disabled:_,children:[(0,L.jsx)(o,{size:14}),` Edit`]}),(0,L.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-danger`,onClick:()=>m(!0),disabled:_,children:[(0,L.jsx)(l,{size:14}),` Delete`]}),(0,L.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-download`,onClick:()=>{O.attendees.length>0?g(!0):J(!1)},disabled:_,children:[_?(0,L.jsx)(s,{size:14,className:`spin`}):(0,L.jsx)(d,{size:14}),` Download`]})]}),h&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{className:`cal-modal-confirm-text`,children:`Include attendees in the file?`}),(0,L.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-primary`,onClick:()=>J(!0),disabled:_,children:[_?(0,L.jsx)(s,{size:14,className:`spin`}):null,` Yes`]}),(0,L.jsx)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>J(!1),disabled:_,children:`No`}),(0,L.jsx)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>g(!1),disabled:_,children:`Cancel`})]}),c&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-primary`,onClick:G,disabled:_,children:[_?(0,L.jsx)(s,{size:14,className:`spin`}):null,` Save`]}),(0,L.jsx)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>{f(!1),D(null)},disabled:_,children:`Cancel`})]}),p&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{className:`cal-modal-confirm-text`,children:`Delete this meeting?`}),(0,L.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-danger`,onClick:te,disabled:_,children:[_?(0,L.jsx)(s,{size:14,className:`spin`}):null,` Delete`]}),(0,L.jsx)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>m(!1),disabled:_,children:`Cancel`})]})]})]})})}var $=`maxy-admin-session-key`,fe=[`day`,`week`,`month`,`year`];function pe(e,t){switch(e){case`day`:return t.toLocaleDateString([],{weekday:`long`,day:`numeric`,month:`long`,year:`numeric`});case`week`:{let{from:e,to:n}=N(`week`,t),r=new Date(n.getTime()-1);return`${e.toLocaleDateString([],{day:`numeric`,month:`short`})} – ${r.toLocaleDateString([],{day:`numeric`,month:`short`,year:`numeric`})}`}case`month`:return t.toLocaleDateString([],{month:`long`,year:`numeric`});case`year`:return String(t.getFullYear())}}function me(){let[e,t]=(0,T.useState)(null),[r,i]=(0,T.useState)(!1),[a,o]=(0,T.useState)(void 0),[s,c]=(0,T.useState)(null),[l,u]=(0,T.useState)(void 0),[d,m]=(0,T.useState)(null),[g,_]=(0,T.useState)(null);(0,T.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem($)}catch{}if(!n){i(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(async r=>{if(!e){if(r.status===401){try{sessionStorage.removeItem($)}catch{}window.location.href=`/`;return}if(r.ok)try{let e=await r.json();typeof e.businessName==`string`&&o(e.businessName),e.sessionId!==void 0&&c(e.sessionId??null),_(e.role??null),u(e.userName===void 0?null:e.userName),m(e.avatar??null)}catch{}t(n),i(!0)}}).catch(()=>{e||(t(n),i(!0))}),()=>{e=!0}},[]);let v=(0,T.useCallback)(()=>{try{sessionStorage.removeItem($)}catch{}window.location.href=`/`},[]),[y,b]=(0,T.useState)(!1),x=(0,T.useCallback)(async()=>{b(!0);try{let e=await p();if(e){try{sessionStorage.removeItem($)}catch{}window.location.href=`/`}return e}finally{b(!1)}},[]);return r?e?(0,L.jsx)(f,{cacheKey:e,surface:`calendar`,onSessionExpired:({code:e,path:t})=>{console.warn(`[admin-auth] outcome=session-expired-redirect code=${e} path=${t} surface=calendar`);try{sessionStorage.removeItem($)}catch{}window.location.href=`/`},children:(0,L.jsx)(h,{cacheKey:e,businessName:a,sessionId:s,onLogout:v,onDisconnect:x,disconnecting:y,userName:l,userAvatar:d,role:g,children:(0,L.jsx)(he,{cacheKey:e})})}):(0,L.jsx)(`div`,{className:`cal-page`,children:(0,L.jsxs)(`div`,{className:`cal-empty`,children:[(0,L.jsx)(`p`,{children:`You are not signed in.`}),(0,L.jsxs)(`p`,{children:[`Open the `,(0,L.jsx)(`a`,{href:`/`,className:`cal-link`,children:`main admin page`}),` and log in, then return here.`]})]})}):(0,L.jsx)(n,{surface:`gate`})}function he({cacheKey:e}){let{adminFetch:t,sessionRefetchNonce:r}=i({initialCacheKey:e,surface:`calendar`}),[a,o]=(0,T.useState)(`month`),[c,l]=(0,T.useState)(()=>new Date),[u,d]=(0,T.useState)([]),[f,p]=(0,T.useState)(!1),[h,v]=(0,T.useState)(!1),[y,b]=(0,T.useState)(null),[x,S]=(0,T.useState)(null),[C,w]=(0,T.useState)(null);(0,T.useEffect)(()=>{let e=!1;return t(`/api/admin/calendar/booking-link`).then(async t=>{if(e||!t.ok)return;let n=await t.json();typeof n.bookingDomain==`string`&&n.bookingDomain&&w(n.bookingDomain)}).catch(()=>{}),()=>{e=!0}},[t]),(0,T.useEffect)(()=>{let e=!1,{from:n,to:r}=N(a,c);return p(!0),b(null),t(`/api/admin/calendar/meetings?from=${encodeURIComponent(n.toISOString())}&to=${encodeURIComponent(r.toISOString())}`).then(async t=>{if(e)return;if(!t.ok)throw Error(`HTTP ${t.status}`);let n=await t.json();d(Array.isArray(n.meetings)?n.meetings:[])}).catch(t=>{e||(b(t instanceof Error?t.message:`Failed to load`),d([]))}).finally(()=>{e||(p(!1),v(!0))}),()=>{e=!0}},[a,c,r,t]);let E=(0,T.useCallback)(()=>l(new Date),[]),D=(0,T.useCallback)(()=>l(e=>P(a,e,-1)),[a]),O=(0,T.useCallback)(()=>l(e=>P(a,e,1)),[a]),k=(0,T.useCallback)(e=>{l(e),o(`month`)},[]);(0,T.useEffect)(()=>{S(null)},[a,c]);let A=(0,T.useCallback)(e=>{d(t=>t.map(t=>t.meetingId===e.meetingId?e:t)),S(e)},[]),j=(0,T.useCallback)(e=>{d(t=>t.filter(t=>t.meetingId!==e)),S(null)},[]);return h?(0,L.jsxs)(`div`,{className:`cal-page`,children:[(0,L.jsxs)(`header`,{className:`cal-header`,children:[(0,L.jsxs)(`div`,{className:`cal-nav`,children:[(0,L.jsx)(`span`,{className:`cal-range-label`,children:pe(a,c)}),(0,L.jsx)(`button`,{type:`button`,className:`cal-nav-btn`,onClick:D,"aria-label":`Previous`,children:(0,L.jsx)(g,{size:18})}),(0,L.jsx)(`button`,{type:`button`,className:`cal-nav-btn`,onClick:O,"aria-label":`Next`,children:(0,L.jsx)(_,{size:18})}),(0,L.jsx)(`button`,{type:`button`,className:`cal-today-btn`,onClick:E,children:`Today`}),f&&(0,L.jsx)(s,{size:16,className:`spin`})]}),(0,L.jsx)(`div`,{className:`cal-views`,children:fe.map(e=>(0,L.jsx)(`button`,{type:`button`,className:`cal-view-btn${e===a?` cal-view-btn-active`:``}`,onClick:()=>o(e),children:e.charAt(0).toUpperCase()+e.slice(1)},e))}),C&&(0,L.jsxs)(`a`,{className:`cal-booking-link`,href:`https://${C}`,target:`_blank`,rel:`noopener noreferrer`,children:[(0,L.jsx)(m,{size:14}),` Booking page`]})]}),(0,L.jsxs)(`div`,{className:`cal-body`,children:[y&&(0,L.jsxs)(`div`,{className:`cal-error`,children:[`Could not load the calendar: `,y]}),a===`day`&&(0,L.jsx)(X,{anchor:c,meetings:u,onSelect:S}),a===`week`&&(0,L.jsx)(te,{anchor:c,meetings:u,onSelect:S}),a===`month`&&(0,L.jsx)(B,{anchor:c,meetings:u,onSelect:S}),a===`year`&&(0,L.jsx)(re,{anchor:c,meetings:u,onPickMonth:k})]}),x&&(0,L.jsx)(de,{meeting:x,adminFetch:t,onClose:()=>S(null),onSaved:A,onDeleted:j})]}):(0,L.jsx)(n,{surface:`gate`})}(0,w.createRoot)(document.getElementById(`root`)).render((0,L.jsx)(me,{}));
1
+ import{o as e}from"./chunk-CltuBf4Z.js";import{B as t,F as n,K as r,P as i,S as a,T as o,U as s,W as c,_ as l,g as u,k as d,p as f}from"./useSubAccountSwitcher-DSW9vDi2.js";import{T as p,_ as m,t as h}from"./AdminShell-C8wazpnz.js";import{t as g}from"./chevron-left-DBMCTKlT.js";import{t as _}from"./chevron-right-SBAr6zzc.js";import{t as v}from"./clock-kkzt7Scf.js";var y=i(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),b=i(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),x=i(`sticky-note`,[[`path`,{d:`M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z`,key:`1dfntj`}],[`path`,{d:`M15 3v5a1 1 0 0 0 1 1h5`,key:`6s6qgf`}]]),S=i(`user-plus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]),C=i(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),w=c(),T=e(r(),1);function E(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function D(e,t){let n=new Date(e);return n.setDate(n.getDate()+t),n}function O(e){let t=E(e),n=t.getDay();return D(t,n===0?-6:1-n)}function k(e){let t=O(e);return Array.from({length:7},(e,n)=>D(t,n))}function A(e){let t=O(new Date(e.getFullYear(),e.getMonth(),1));return Array.from({length:42},(e,n)=>D(t,n))}function j(){return Array.from({length:24},(e,t)=>t)}function M(e){let t=e.getFullYear();return Array.from({length:12},(e,n)=>new Date(t,n,1))}function N(e,t){switch(e){case`day`:{let e=E(t);return{from:e,to:D(e,1)}}case`week`:{let e=O(t);return{from:e,to:D(e,7)}}case`month`:{let e=O(new Date(t.getFullYear(),t.getMonth(),1));return{from:e,to:D(e,42)}}case`year`:return{from:new Date(t.getFullYear(),0,1),to:new Date(t.getFullYear()+1,0,1)}}}function P(e,t,n){switch(e){case`day`:return D(t,n);case`week`:return D(t,n*7);case`month`:return new Date(t.getFullYear(),t.getMonth()+n,1);case`year`:return new Date(t.getFullYear()+n,t.getMonth(),1)}}function F(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function I(e,t){return{role:`button`,tabIndex:0,onClick:()=>t(e),onKeyDown:n=>{(n.key===`Enter`||n.key===` `)&&(n.preventDefault(),t(e))}}}var L=t(),R=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],z=3;function ee(e){return e.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function B({anchor:e,meetings:t,onSelect:n}){let r=A(e),i=e.getMonth(),a=new Date;return(0,L.jsxs)(`div`,{className:`cal-month`,children:[(0,L.jsx)(`div`,{className:`cal-weekday-row`,children:R.map(e=>(0,L.jsx)(`div`,{className:`cal-weekday`,children:e},e))}),(0,L.jsx)(`div`,{className:`cal-month-grid`,children:r.map(e=>{let r=t.filter(t=>F(new Date(t.startsAt),e)).sort((e,t)=>e.startsAt.localeCompare(t.startsAt)),o=e.getMonth()!==i,s=F(e,a);return(0,L.jsxs)(`div`,{className:`cal-cell${o?` cal-cell-out`:``}${s?` cal-cell-today`:``}`,children:[(0,L.jsx)(`div`,{className:`cal-cell-num`,children:e.getDate()}),r.slice(0,z).map(e=>(0,L.jsxs)(`div`,{className:`cal-chip`,title:e.title??`Untitled`,...I(e,n),children:[!e.isAllDay&&(0,L.jsx)(`span`,{className:`cal-chip-time`,children:ee(new Date(e.startsAt))}),e.title??`Untitled`]},e.meetingId)),r.length>z&&(0,L.jsxs)(`div`,{className:`cal-more`,children:[`+`,r.length-z,` more`]})]},e.toISOString())})})]})}var V=1440,H=1.8;function U(e){return e.getHours()*60+e.getMinutes()}function W(e){return e.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function G({day:e,meetings:t,hourHeight:n,onSelect:r}){let i=n*24,a=t.filter(t=>!t.isAllDay&&F(new Date(t.startsAt),e));return(0,L.jsx)(`div`,{className:`cal-day-col`,children:(0,L.jsxs)(`div`,{className:`cal-hours`,style:{height:`${i}px`},children:[Array.from({length:24},(e,t)=>(0,L.jsx)(`div`,{className:`cal-hour-line`,style:{top:`${t*n}px`}},t)),a.map(t=>{let n=new Date(t.startsAt),i=t.endsAt?new Date(t.endsAt):new Date(n.getTime()+30*6e4),a=U(n),o=F(i,e)?U(i):V,s=a/V*100,c=Math.max((o-a)/V*100,H);return(0,L.jsxs)(`div`,{className:`cal-event`,style:{top:`${s}%`,height:`${c}%`},title:t.title??`Untitled`,...I(t,r),children:[(0,L.jsx)(`span`,{className:`cal-event-time`,children:W(n)}),(0,L.jsx)(`span`,{className:`cal-event-title`,children:t.title??`Untitled`})]},t.meetingId)})]})})}var K=44;function q(e){let t=new Date;return t.setHours(e,0,0,0),t.toLocaleTimeString([],{hour:`numeric`})}function te({anchor:e,meetings:t,onSelect:n}){let r=k(e),i=new Date;return(0,L.jsxs)(`div`,{className:`cal-timed`,children:[(0,L.jsxs)(`div`,{className:`cal-day-headrow`,children:[(0,L.jsx)(`div`,{className:`cal-timed-gutter`}),r.map(e=>(0,L.jsxs)(`div`,{className:`cal-day-head${F(e,i)?` cal-day-head-today`:``}`,children:[(0,L.jsx)(`span`,{className:`cal-day-head-name`,children:e.toLocaleDateString([],{weekday:`short`})}),(0,L.jsx)(`span`,{className:`cal-day-head-num`,children:e.getDate()})]},e.toISOString()))]}),(0,L.jsxs)(`div`,{className:`cal-allday-band`,children:[(0,L.jsx)(`div`,{className:`cal-timed-gutter`,children:`All-day`}),r.map(e=>(0,L.jsx)(`div`,{className:`cal-allday-cell`,children:t.filter(t=>t.isAllDay&&F(new Date(t.startsAt),e)).map(e=>(0,L.jsx)(`div`,{className:`cal-allday-chip`,title:e.title??`Untitled`,...I(e,n),children:e.title??`Untitled`},e.meetingId))},e.toISOString()))]}),(0,L.jsxs)(`div`,{className:`cal-timed-cols`,children:[(0,L.jsx)(`div`,{className:`cal-timed-gutter`,children:j().map(e=>(0,L.jsx)(`div`,{className:`cal-hour-label`,style:{height:`${K}px`},children:e===0?``:q(e)},e))}),r.map(e=>(0,L.jsx)(G,{day:e,meetings:t,hourHeight:K,onSelect:n},e.toISOString()))]})]})}var J=52;function Y(e){let t=new Date;return t.setHours(e,0,0,0),t.toLocaleTimeString([],{hour:`numeric`})}function X({anchor:e,meetings:t,onSelect:n}){let r=t.filter(t=>t.isAllDay&&F(new Date(t.startsAt),e));return(0,L.jsxs)(`div`,{className:`cal-timed cal-timed-single`,children:[(0,L.jsxs)(`div`,{className:`cal-allday-band`,children:[(0,L.jsx)(`div`,{className:`cal-timed-gutter`,children:`All-day`}),(0,L.jsx)(`div`,{className:`cal-allday-cell`,children:r.map(e=>(0,L.jsx)(`div`,{className:`cal-allday-chip`,title:e.title??`Untitled`,...I(e,n),children:e.title??`Untitled`},e.meetingId))})]}),(0,L.jsxs)(`div`,{className:`cal-timed-cols`,children:[(0,L.jsx)(`div`,{className:`cal-timed-gutter`,children:j().map(e=>(0,L.jsx)(`div`,{className:`cal-hour-label`,style:{height:`${J}px`},children:e===0?``:Y(e)},e))}),(0,L.jsx)(G,{day:e,meetings:t,hourHeight:J,onSelect:n})]})]})}var ne=[`M`,`T`,`W`,`T`,`F`,`S`,`S`];function Z(e){return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`}function re({anchor:e,meetings:t,onPickMonth:n}){let r=new Date,i=new Set(t.map(e=>Z(new Date(e.startsAt))));return(0,L.jsx)(`div`,{className:`cal-year`,children:(0,L.jsx)(`div`,{className:`cal-year-grid`,children:M(e).map(e=>{let t=A(e),a=e.getMonth();return(0,L.jsxs)(`button`,{type:`button`,className:`cal-mini`,onClick:()=>n(e),title:e.toLocaleDateString([],{month:`long`,year:`numeric`}),children:[(0,L.jsx)(`div`,{className:`cal-mini-title`,children:e.toLocaleDateString([],{month:`long`})}),(0,L.jsx)(`div`,{className:`cal-mini-weekrow`,children:ne.map((e,t)=>(0,L.jsx)(`span`,{className:`cal-mini-weekday`,children:e},t))}),(0,L.jsx)(`div`,{className:`cal-mini-grid`,children:t.map(e=>{let t=e.getMonth()!==a,n=F(e,r),o=!t&&i.has(Z(e));return(0,L.jsxs)(`span`,{className:`cal-mini-day${t?` cal-mini-day-out`:``}${n?` cal-mini-day-today`:``}`,children:[e.getDate(),o&&(0,L.jsx)(`span`,{className:`cal-mini-dot`})]},e.toISOString())})})]},a)})})})}var ie={meeting:`Meeting`,event:`Event`,task:`Task`};function ae(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}function oe(e){return new Date(e).toISOString()}function Q(e){return Math.floor(new Date(e).getTime()/6e4)}function se(e){let t=new Date(e.startsAt);if(e.isAllDay)return t.toLocaleDateString([],{weekday:`long`,day:`numeric`,month:`long`,year:`numeric`});let n=t.toLocaleDateString([],{weekday:`long`,day:`numeric`,month:`long`,year:`numeric`}),r=t.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`});return e.endsAt?`${n} · ${r} – ${new Date(e.endsAt).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}`:`${n} · ${r}`}function ce(e){if(!e)return null;let t=e.match(/filename="([^"]+)"/);return t?t[1]:null}function le(e,t){return e.email??`${e.name??`unknown`}-${t}`}function ue({a:e}){let t=e.name||e.email||`Unknown`,n=e.name&&e.email?e.email:null;return(0,L.jsxs)(`span`,{className:`cal-attendee-lines`,children:[(0,L.jsx)(`span`,{className:`cal-attendee-name`,children:t}),n&&(0,L.jsx)(`span`,{className:`cal-attendee-email`,children:n})]})}function de({meeting:e,adminFetch:t,onClose:n,onSaved:r,onDeleted:i}){let s=e.kind===`meeting`,[c,f]=(0,T.useState)(!1),[p,m]=(0,T.useState)(!1),[h,g]=(0,T.useState)(!1),[_,w]=(0,T.useState)(!1),[E,D]=(0,T.useState)(null),[O,k]=(0,T.useState)(e),[A,j]=(0,T.useState)(e.title??``),[M,N]=(0,T.useState)(ae(e.startsAt)),[P,F]=(0,T.useState)(e.endsAt?ae(e.endsAt):``),[I,R]=(0,T.useState)(e.location??``),[z,ee]=(0,T.useState)(e.privateNote??``),[B,V]=(0,T.useState)(``),[H,U]=(0,T.useState)(``);(0,T.useEffect)(()=>{let e=e=>{e.key===`Escape`&&!_&&n()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[_,n]);let W=(0,T.useCallback)(()=>{let e={},t=A.trim();t!==(O.title??``)&&(e.title=t);let n=oe(M);Q(n)!==Q(O.startsAt)&&(e.startsAt=n);let r=P?oe(P):null;(r===null?O.endsAt!==null:O.endsAt===null||Q(r)!==Q(O.endsAt))&&(e.endsAt=r);let i=I.trim()||null;i!==(O.location??null)&&(e.location=i);let a=z.trim()||null;return a!==(O.privateNote??null)&&(e.privateNote=a),e},[A,M,P,I,z,O]),G=(0,T.useCallback)(async()=>{let n=W();if(Object.keys(n).length===0){f(!1);return}w(!0),D(null);try{let i=await t(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(n)});if(!i.ok)throw Error(`HTTP ${i.status}`);let a=await i.json();k(a.meeting),r(a.meeting),f(!1)}catch(e){D(e instanceof Error?e.message:`Save failed`)}finally{w(!1)}},[t,W,e.meetingId,r]),K=(0,T.useCallback)(async()=>{let n=B.trim(),i=H.trim();if(!(!n&&!i)){w(!0),D(null);try{let a=await t(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}/attendees`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({name:n||void 0,email:i||void 0})});if(!a.ok)throw Error(`HTTP ${a.status}`);let o=await a.json();k(o.meeting),r(o.meeting),V(``),U(``)}catch(e){D(e instanceof Error?e.message:`Add failed`)}finally{w(!1)}}},[t,B,H,e.meetingId,r]),q=(0,T.useCallback)(async n=>{let i=n.email?{email:n.email}:{name:n.name};w(!0),D(null);try{let n=await t(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}/attendees`,{method:`DELETE`,headers:{"content-type":`application/json`},body:JSON.stringify(i)});if(!n.ok)throw Error(`HTTP ${n.status}`);let a=await n.json();k(a.meeting),r(a.meeting)}catch(e){D(e instanceof Error?e.message:`Remove failed`)}finally{w(!1)}},[t,e.meetingId,r]),te=(0,T.useCallback)(async()=>{w(!0),D(null);try{let n=await t(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}`,{method:`DELETE`});if(!n.ok)throw Error(`HTTP ${n.status}`);i(e.meetingId)}catch(e){D(e instanceof Error?e.message:`Delete failed`),w(!1)}},[t,e.meetingId,i]),J=(0,T.useCallback)(async n=>{g(!1),w(!0),D(null);try{let r=await t(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}/ics?attendees=${n?`1`:`0`}`);if(!r.ok)throw Error(`HTTP ${r.status}`);let i=await r.blob(),a=ce(r.headers.get(`content-disposition`))??`meeting.ics`,o=URL.createObjectURL(i),s=document.createElement(`a`);s.href=o,s.download=a,document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(o)}catch(e){D(e instanceof Error?e.message:`Download failed`)}finally{w(!1)}},[t,e.meetingId]),Y=ie[e.kind??`meeting`],X=B.trim().length>0||H.trim().length>0;return(0,L.jsx)(`div`,{className:`cal-modal-overlay`,onClick:()=>{_||n()},children:(0,L.jsxs)(`div`,{className:`cal-modal cal-modal-wide`,role:`dialog`,"aria-modal":`true`,"aria-label":c?`Edit meeting`:`Meeting detail`,onClick:e=>e.stopPropagation(),children:[(0,L.jsxs)(`div`,{className:`cal-modal-header`,children:[(0,L.jsx)(`span`,{className:`cal-modal-kind`,children:Y}),(0,L.jsx)(`button`,{type:`button`,className:`cal-modal-close`,onClick:n,"aria-label":`Close`,autoFocus:!0,disabled:_,children:(0,L.jsx)(u,{size:16})})]}),!c&&(0,L.jsxs)(`div`,{className:`cal-modal-body`,children:[(0,L.jsx)(`div`,{className:`cal-modal-title`,children:O.title??`Untitled`}),(0,L.jsxs)(`div`,{className:`cal-modal-row`,children:[(0,L.jsx)(v,{size:14}),(0,L.jsx)(`span`,{children:se(O)})]}),O.location&&(0,L.jsxs)(`div`,{className:`cal-modal-row`,children:[(0,L.jsx)(b,{size:14}),(0,L.jsx)(`span`,{children:O.location})]}),O.attendees.length>0&&(0,L.jsxs)(`div`,{className:`cal-modal-row cal-modal-row-top`,children:[(0,L.jsx)(C,{size:14}),(0,L.jsx)(`div`,{className:`cal-modal-attendees`,children:O.attendees.map((e,t)=>(0,L.jsx)(`div`,{className:`cal-attendee-row`,children:(0,L.jsx)(ue,{a:e})},le(e,t)))})]}),O.privateNote&&(0,L.jsxs)(`div`,{className:`cal-modal-row cal-modal-row-top`,children:[(0,L.jsx)(x,{size:14}),(0,L.jsx)(`span`,{className:`cal-modal-note`,children:O.privateNote})]}),(0,L.jsxs)(`div`,{className:`cal-modal-row cal-modal-meta`,children:[(0,L.jsx)(y,{size:14}),(0,L.jsx)(`span`,{children:Y})]})]}),c&&(0,L.jsxs)(`div`,{className:`cal-modal-body`,children:[(0,L.jsxs)(`label`,{className:`cal-modal-field`,children:[(0,L.jsx)(`span`,{children:`Title`}),(0,L.jsx)(`input`,{type:`text`,value:A,onChange:e=>j(e.target.value),disabled:_})]}),(0,L.jsxs)(`label`,{className:`cal-modal-field`,children:[(0,L.jsx)(`span`,{children:`Start`}),(0,L.jsx)(`input`,{type:`datetime-local`,value:M,onChange:e=>N(e.target.value),disabled:_})]}),(0,L.jsxs)(`label`,{className:`cal-modal-field`,children:[(0,L.jsx)(`span`,{children:`End`}),(0,L.jsx)(`input`,{type:`datetime-local`,value:P,onChange:e=>F(e.target.value),disabled:_})]}),(0,L.jsxs)(`label`,{className:`cal-modal-field`,children:[(0,L.jsx)(`span`,{children:`Location`}),(0,L.jsx)(`input`,{type:`text`,value:I,onChange:e=>R(e.target.value),disabled:_})]}),(0,L.jsxs)(`div`,{className:`cal-modal-field`,children:[(0,L.jsx)(`span`,{children:`Attendees`}),(0,L.jsxs)(`div`,{className:`cal-modal-attendees cal-modal-attendees-edit`,children:[O.attendees.length===0&&(0,L.jsx)(`div`,{className:`cal-attendee-empty`,children:`No attendees yet.`}),O.attendees.map((e,t)=>(0,L.jsxs)(`div`,{className:`cal-attendee-row cal-attendee-row-edit`,children:[(0,L.jsx)(ue,{a:e}),(0,L.jsx)(`button`,{type:`button`,className:`cal-attendee-remove`,onClick:()=>q(e),disabled:_,"aria-label":`Remove ${e.name||e.email||`attendee`}`,children:(0,L.jsx)(u,{size:13})})]},le(e,t)))]}),(0,L.jsxs)(`div`,{className:`cal-attendee-add`,children:[(0,L.jsx)(`input`,{type:`text`,placeholder:`Name`,value:B,onChange:e=>V(e.target.value),disabled:_,"aria-label":`Attendee name`}),(0,L.jsx)(`input`,{type:`email`,placeholder:`Email`,value:H,onChange:e=>U(e.target.value),disabled:_,"aria-label":`Attendee email`}),(0,L.jsx)(`button`,{type:`button`,className:`cal-modal-btn cal-attendee-add-btn`,onClick:K,disabled:_||!X,"aria-label":`Add attendee`,children:_?(0,L.jsx)(o,{size:13,className:`spin`}):(0,L.jsx)(S,{size:13})})]})]}),(0,L.jsxs)(`label`,{className:`cal-modal-field`,children:[(0,L.jsx)(`span`,{children:`Private note`}),(0,L.jsx)(`textarea`,{className:`cal-modal-textarea`,value:z,onChange:e=>ee(e.target.value),disabled:_,rows:3,placeholder:`Only you and your team can see this.`})]})]}),E&&(0,L.jsx)(`div`,{className:`cal-modal-error`,children:E}),s&&(0,L.jsxs)(`div`,{className:`cal-modal-actions`,children:[!c&&!p&&!h&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>f(!0),disabled:_,children:[(0,L.jsx)(a,{size:14}),` Edit`]}),(0,L.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-danger`,onClick:()=>m(!0),disabled:_,children:[(0,L.jsx)(l,{size:14}),` Delete`]}),(0,L.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-download`,onClick:()=>{O.attendees.length>0?g(!0):J(!1)},disabled:_,children:[_?(0,L.jsx)(o,{size:14,className:`spin`}):(0,L.jsx)(d,{size:14}),` Download`]})]}),h&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{className:`cal-modal-confirm-text`,children:`Include attendees in the file?`}),(0,L.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-primary`,onClick:()=>J(!0),disabled:_,children:[_?(0,L.jsx)(o,{size:14,className:`spin`}):null,` Yes`]}),(0,L.jsx)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>J(!1),disabled:_,children:`No`}),(0,L.jsx)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>g(!1),disabled:_,children:`Cancel`})]}),c&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-primary`,onClick:G,disabled:_,children:[_?(0,L.jsx)(o,{size:14,className:`spin`}):null,` Save`]}),(0,L.jsx)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>{f(!1),D(null)},disabled:_,children:`Cancel`})]}),p&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{className:`cal-modal-confirm-text`,children:`Delete this meeting?`}),(0,L.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-danger`,onClick:te,disabled:_,children:[_?(0,L.jsx)(o,{size:14,className:`spin`}):null,` Delete`]}),(0,L.jsx)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>m(!1),disabled:_,children:`Cancel`})]})]})]})})}var $=`maxy-admin-session-key`,fe=[`day`,`week`,`month`,`year`];function pe(e,t){switch(e){case`day`:return t.toLocaleDateString([],{weekday:`long`,day:`numeric`,month:`long`,year:`numeric`});case`week`:{let{from:e,to:n}=N(`week`,t),r=new Date(n.getTime()-1);return`${e.toLocaleDateString([],{day:`numeric`,month:`short`})} – ${r.toLocaleDateString([],{day:`numeric`,month:`short`,year:`numeric`})}`}case`month`:return t.toLocaleDateString([],{month:`long`,year:`numeric`});case`year`:return String(t.getFullYear())}}function me(){let[e,t]=(0,T.useState)(null),[r,i]=(0,T.useState)(!1),[a,o]=(0,T.useState)(void 0),[s,c]=(0,T.useState)(null),[l,u]=(0,T.useState)(void 0),[d,m]=(0,T.useState)(null),[g,_]=(0,T.useState)(null);(0,T.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem($)}catch{}if(!n){i(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(async r=>{if(!e){if(r.status===401){try{sessionStorage.removeItem($)}catch{}window.location.href=`/`;return}if(r.ok)try{let e=await r.json();typeof e.businessName==`string`&&o(e.businessName),e.sessionId!==void 0&&c(e.sessionId??null),_(e.role??null),u(e.userName===void 0?null:e.userName),m(e.avatar??null)}catch{}t(n),i(!0)}}).catch(()=>{e||(t(n),i(!0))}),()=>{e=!0}},[]);let v=(0,T.useCallback)(()=>{try{sessionStorage.removeItem($)}catch{}window.location.href=`/`},[]),[y,b]=(0,T.useState)(!1),x=(0,T.useCallback)(async()=>{b(!0);try{let e=await p();if(e){try{sessionStorage.removeItem($)}catch{}window.location.href=`/`}return e}finally{b(!1)}},[]);return r?e?(0,L.jsx)(f,{cacheKey:e,surface:`calendar`,onSessionExpired:({code:e,path:t})=>{console.warn(`[admin-auth] outcome=session-expired-redirect code=${e} path=${t} surface=calendar`);try{sessionStorage.removeItem($)}catch{}window.location.href=`/`},children:(0,L.jsx)(h,{cacheKey:e,businessName:a,sessionId:s,onLogout:v,onDisconnect:x,disconnecting:y,userName:l,userAvatar:d,role:g,children:(0,L.jsx)(he,{cacheKey:e})})}):(0,L.jsx)(`div`,{className:`cal-page`,children:(0,L.jsxs)(`div`,{className:`cal-empty`,children:[(0,L.jsx)(`p`,{children:`You are not signed in.`}),(0,L.jsxs)(`p`,{children:[`Open the `,(0,L.jsx)(`a`,{href:`/`,className:`cal-link`,children:`main admin page`}),` and log in, then return here.`]})]})}):(0,L.jsx)(n,{surface:`gate`})}function he({cacheKey:e}){let{adminFetch:t,sessionRefetchNonce:r}=s({initialCacheKey:e,surface:`calendar`}),[i,a]=(0,T.useState)(`month`),[c,l]=(0,T.useState)(()=>new Date),[u,d]=(0,T.useState)([]),[f,p]=(0,T.useState)(!1),[h,v]=(0,T.useState)(!1),[y,b]=(0,T.useState)(null),[x,S]=(0,T.useState)(null),[C,w]=(0,T.useState)(null);(0,T.useEffect)(()=>{let e=!1;return t(`/api/admin/calendar/booking-link`).then(async t=>{if(e||!t.ok)return;let n=await t.json();typeof n.bookingDomain==`string`&&n.bookingDomain&&w(n.bookingDomain)}).catch(()=>{}),()=>{e=!0}},[t]),(0,T.useEffect)(()=>{let e=!1,{from:n,to:r}=N(i,c);return p(!0),b(null),t(`/api/admin/calendar/meetings?from=${encodeURIComponent(n.toISOString())}&to=${encodeURIComponent(r.toISOString())}`).then(async t=>{if(e)return;if(!t.ok)throw Error(`HTTP ${t.status}`);let n=await t.json();d(Array.isArray(n.meetings)?n.meetings:[])}).catch(t=>{e||(b(t instanceof Error?t.message:`Failed to load`),d([]))}).finally(()=>{e||(p(!1),v(!0))}),()=>{e=!0}},[i,c,r,t]);let E=(0,T.useCallback)(()=>l(new Date),[]),D=(0,T.useCallback)(()=>l(e=>P(i,e,-1)),[i]),O=(0,T.useCallback)(()=>l(e=>P(i,e,1)),[i]),k=(0,T.useCallback)(e=>{l(e),a(`month`)},[]);(0,T.useEffect)(()=>{S(null)},[i,c]);let A=(0,T.useCallback)(e=>{d(t=>t.map(t=>t.meetingId===e.meetingId?e:t)),S(e)},[]),j=(0,T.useCallback)(e=>{d(t=>t.filter(t=>t.meetingId!==e)),S(null)},[]);return h?(0,L.jsxs)(`div`,{className:`cal-page`,children:[(0,L.jsxs)(`header`,{className:`cal-header`,children:[(0,L.jsxs)(`div`,{className:`cal-nav`,children:[(0,L.jsx)(`span`,{className:`cal-range-label`,children:pe(i,c)}),(0,L.jsx)(`button`,{type:`button`,className:`cal-nav-btn`,onClick:D,"aria-label":`Previous`,children:(0,L.jsx)(g,{size:18})}),(0,L.jsx)(`button`,{type:`button`,className:`cal-nav-btn`,onClick:O,"aria-label":`Next`,children:(0,L.jsx)(_,{size:18})}),(0,L.jsx)(`button`,{type:`button`,className:`cal-today-btn`,onClick:E,children:`Today`}),f&&(0,L.jsx)(o,{size:16,className:`spin`})]}),(0,L.jsx)(`div`,{className:`cal-views`,children:fe.map(e=>(0,L.jsx)(`button`,{type:`button`,className:`cal-view-btn${e===i?` cal-view-btn-active`:``}`,onClick:()=>a(e),children:e.charAt(0).toUpperCase()+e.slice(1)},e))}),C&&(0,L.jsxs)(`a`,{className:`cal-booking-link`,href:`https://${C}`,target:`_blank`,rel:`noopener noreferrer`,children:[(0,L.jsx)(m,{size:14}),` Booking page`]})]}),(0,L.jsxs)(`div`,{className:`cal-body`,children:[y&&(0,L.jsxs)(`div`,{className:`cal-error`,children:[`Could not load the calendar: `,y]}),i===`day`&&(0,L.jsx)(X,{anchor:c,meetings:u,onSelect:S}),i===`week`&&(0,L.jsx)(te,{anchor:c,meetings:u,onSelect:S}),i===`month`&&(0,L.jsx)(B,{anchor:c,meetings:u,onSelect:S}),i===`year`&&(0,L.jsx)(re,{anchor:c,meetings:u,onPickMonth:k})]}),x&&(0,L.jsx)(de,{meeting:x,adminFetch:t,onClose:()=>S(null),onSaved:A,onDeleted:j})]}):(0,L.jsx)(n,{surface:`gate`})}(0,w.createRoot)(document.getElementById(`root`)).render((0,L.jsx)(me,{}));
@@ -0,0 +1 @@
1
+ import{B as e,W as t}from"./useSubAccountSwitcher-DSW9vDi2.js";import"./useVoiceRecorder-BeNqxmm2.js";import"./AdminShell-C8wazpnz.js";import{n}from"./page-HVtUfub2.js";import"./useCopyFeedback-BTUu3-l8.js";var r=t(),i=e();(0,r.createRoot)(document.getElementById(`root`)).render((0,i.jsx)(n,{}));
@@ -0,0 +1 @@
1
+ import{P as e}from"./useSubAccountSwitcher-DSW9vDi2.js";var t=e(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{P as e}from"./useSubAccountSwitcher-DSW9vDi2.js";var t=e(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{P as e}from"./useSubAccountSwitcher-DSW9vDi2.js";var t=e(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{B as e,W as t}from"./useSubAccountSwitcher-DSW9vDi2.js";import"./useVoiceRecorder-BeNqxmm2.js";import{t as n}from"./page-JJa2xdzf.js";import"./graph-labels-5bjxhC_p.js";var r=t(),i=e();(0,r.createRoot)(document.getElementById(`root`)).render((0,i.jsx)(n,{}));
@@ -1 +1 @@
1
- import{P as e}from"./useSubAccountSwitcher-6AFuRawP.js";var t=e(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]);export{t};
1
+ import{P as e}from"./useSubAccountSwitcher-DSW9vDi2.js";var t=e(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]);export{t};