@rubytech/create-maxy-code 0.1.358 → 0.1.359
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/__tests__/neo4j-pidfile-scrub.test.js +103 -0
- package/dist/index.js +42 -7
- package/dist/neo4j-pidfile-scrub.js +90 -0
- package/package.json +1 -1
- package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +3 -1
- package/payload/platform/plugins/docs/references/admin-ui.md +2 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/email-status.test.d.ts +2 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/email-status.test.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/email-status.test.js +58 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/email-status.test.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/imap-probe.test.js +109 -1
- package/payload/platform/plugins/email/mcp/dist/__tests__/imap-probe.test.js.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/lib/credentials.d.ts +13 -0
- package/payload/platform/plugins/email/mcp/dist/lib/credentials.d.ts.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/lib/credentials.js +35 -0
- package/payload/platform/plugins/email/mcp/dist/lib/credentials.js.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/lib/imap.d.ts +18 -0
- package/payload/platform/plugins/email/mcp/dist/lib/imap.d.ts.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/lib/imap.js +79 -20
- package/payload/platform/plugins/email/mcp/dist/lib/imap.js.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/lib/setup-probe.d.ts +19 -0
- package/payload/platform/plugins/email/mcp/dist/lib/setup-probe.d.ts.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/lib/setup-probe.js +33 -0
- package/payload/platform/plugins/email/mcp/dist/lib/setup-probe.js.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/tools/email-setup.d.ts.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/tools/email-setup.js +11 -1
- package/payload/platform/plugins/email/mcp/dist/tools/email-setup.js.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/tools/email-status.d.ts.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/tools/email-status.js +24 -1
- package/payload/platform/plugins/email/mcp/dist/tools/email-status.js.map +1 -1
- package/payload/platform/plugins/email/references/email-reference.md +9 -2
- package/payload/platform/services/claude-session-manager/dist/rc-daemon.d.ts +11 -4
- package/payload/platform/services/claude-session-manager/dist/rc-daemon.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/rc-daemon.js +22 -7
- package/payload/platform/services/claude-session-manager/dist/rc-daemon.js.map +1 -1
- package/payload/server/public/assets/{AdminLoginScreens-Ro_RUTDh.js → AdminLoginScreens-tHyAPNnQ.js} +1 -1
- package/payload/server/public/assets/AdminShell-Ce9izNVZ.js +1 -0
- package/payload/server/public/assets/{Checkbox-dYLaMEdh.js → Checkbox-Cq6SJJlX.js} +1 -1
- package/payload/server/public/assets/OperatorConversations-BERW_hUa.css +1 -0
- package/payload/server/public/assets/OperatorConversations-m2lz6Ss7.js +9 -0
- package/payload/server/public/assets/admin-D9iMgdbN.js +1 -0
- package/payload/server/public/assets/{browser-DrXZ4wpy.js → browser-CZWi0EAP.js} +1 -1
- package/payload/server/public/assets/calendar-DUAh-_kx.js +1 -0
- package/payload/server/public/assets/chat-DHuibPfc.js +1 -0
- package/payload/server/public/assets/data-CoOcAR_2.js +1 -0
- package/payload/server/public/assets/{graph-l_3_j3I9.js → graph-Dc_votDd.js} +3 -3
- package/payload/server/public/assets/{graph-labels-CJj55nHk.js → graph-labels-jqagxwhW.js} +1 -1
- package/payload/server/public/assets/operator-KYXcuQ4Y.js +1 -0
- package/payload/server/public/assets/page-Cfsv97nq.js +32 -0
- package/payload/server/public/assets/{public-smrhkkxD.js → public-49guEjCh.js} +1 -1
- package/payload/server/public/assets/{rotate-ccw-Dd8aAvU7.js → rotate-ccw-CyR5o3Nq.js} +1 -1
- package/payload/server/public/browser.html +4 -4
- package/payload/server/public/calendar.html +4 -4
- package/payload/server/public/chat.html +6 -6
- package/payload/server/public/data.html +4 -4
- package/payload/server/public/graph.html +7 -7
- package/payload/server/public/index.html +6 -6
- package/payload/server/public/operator.html +8 -8
- package/payload/server/public/public.html +6 -6
- package/payload/server/public/assets/AdminShell-CmqhpAPU.js +0 -1
- package/payload/server/public/assets/OperatorConversations-2zJh7qnO.css +0 -1
- package/payload/server/public/assets/OperatorConversations-Cei12sSK.js +0 -9
- package/payload/server/public/assets/admin-BldZQrJF.js +0 -1
- package/payload/server/public/assets/calendar-CQ4TCbO7.js +0 -1
- package/payload/server/public/assets/chat-D7w6_NE1.js +0 -1
- package/payload/server/public/assets/data-Dc5XNWgF.js +0 -1
- package/payload/server/public/assets/operator-CKmOgXNa.js +0 -1
- package/payload/server/public/assets/page-hG7xTrcO.js +0 -32
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CAM3fms7.js";import{A as t,B as n,C as r,F as i,I as a,N as o,O as s,R as c,T as l,U as u,V as d,v as f,w as p}from"./OperatorConversations-Cei12sSK.js";import{_ as m,d as h,t as g}from"./AdminShell-CmqhpAPU.js";var _=c(`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`}]]),v=c(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),y=c(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),b=c(`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=c(`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`}]]),ee=c(`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`}]]),S=d(),C=e(u(),1);function w(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function T(e,t){let n=new Date(e);return n.setDate(n.getDate()+t),n}function E(e){let t=w(e),n=t.getDay();return T(t,n===0?-6:1-n)}function D(e){let t=E(e);return Array.from({length:7},(e,n)=>T(t,n))}function O(e){let t=E(new Date(e.getFullYear(),e.getMonth(),1));return Array.from({length:42},(e,n)=>T(t,n))}function k(){return Array.from({length:24},(e,t)=>t)}function A(e){let t=e.getFullYear();return Array.from({length:12},(e,n)=>new Date(t,n,1))}function j(e,t){switch(e){case`day`:{let e=w(t);return{from:e,to:T(e,1)}}case`week`:{let e=E(t);return{from:e,to:T(e,7)}}case`month`:{let e=E(new Date(t.getFullYear(),t.getMonth(),1));return{from:e,to:T(e,42)}}case`year`:return{from:new Date(t.getFullYear(),0,1),to:new Date(t.getFullYear()+1,0,1)}}}function M(e,t,n){switch(e){case`day`:return T(t,n);case`week`:return T(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 N(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function P(e,t){return{role:`button`,tabIndex:0,onClick:()=>t(e),onKeyDown:n=>{(n.key===`Enter`||n.key===` `)&&(n.preventDefault(),t(e))}}}var F=r(),I=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],L=3;function R(e){return e.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function z({anchor:e,meetings:t,onSelect:n}){let r=O(e),i=e.getMonth(),a=new Date;return(0,F.jsxs)(`div`,{className:`cal-month`,children:[(0,F.jsx)(`div`,{className:`cal-weekday-row`,children:I.map(e=>(0,F.jsx)(`div`,{className:`cal-weekday`,children:e},e))}),(0,F.jsx)(`div`,{className:`cal-month-grid`,children:r.map(e=>{let r=t.filter(t=>N(new Date(t.startsAt),e)).sort((e,t)=>e.startsAt.localeCompare(t.startsAt)),o=e.getMonth()!==i,s=N(e,a);return(0,F.jsxs)(`div`,{className:`cal-cell${o?` cal-cell-out`:``}${s?` cal-cell-today`:``}`,children:[(0,F.jsx)(`div`,{className:`cal-cell-num`,children:e.getDate()}),r.slice(0,L).map(e=>(0,F.jsxs)(`div`,{className:`cal-chip`,title:e.title??`Untitled`,...P(e,n),children:[!e.isAllDay&&(0,F.jsx)(`span`,{className:`cal-chip-time`,children:R(new Date(e.startsAt))}),e.title??`Untitled`]},e.meetingId)),r.length>L&&(0,F.jsxs)(`div`,{className:`cal-more`,children:[`+`,r.length-L,` more`]})]},e.toISOString())})})]})}var B=1440,V=1.8;function H(e){return e.getHours()*60+e.getMinutes()}function U(e){return e.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function W({day:e,meetings:t,hourHeight:n,onSelect:r}){let i=n*24,a=t.filter(t=>!t.isAllDay&&N(new Date(t.startsAt),e));return(0,F.jsx)(`div`,{className:`cal-day-col`,children:(0,F.jsxs)(`div`,{className:`cal-hours`,style:{height:`${i}px`},children:[Array.from({length:24},(e,t)=>(0,F.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=H(n),o=N(i,e)?H(i):B,s=a/B*100,c=Math.max((o-a)/B*100,V);return(0,F.jsxs)(`div`,{className:`cal-event`,style:{top:`${s}%`,height:`${c}%`},title:t.title??`Untitled`,...P(t,r),children:[(0,F.jsx)(`span`,{className:`cal-event-time`,children:U(n)}),(0,F.jsx)(`span`,{className:`cal-event-title`,children:t.title??`Untitled`})]},t.meetingId)})]})})}var G=44;function K(e){let t=new Date;return t.setHours(e,0,0,0),t.toLocaleTimeString([],{hour:`numeric`})}function q({anchor:e,meetings:t,onSelect:n}){let r=D(e),i=new Date;return(0,F.jsxs)(`div`,{className:`cal-timed`,children:[(0,F.jsxs)(`div`,{className:`cal-day-headrow`,children:[(0,F.jsx)(`div`,{className:`cal-timed-gutter`}),r.map(e=>(0,F.jsxs)(`div`,{className:`cal-day-head${N(e,i)?` cal-day-head-today`:``}`,children:[(0,F.jsx)(`span`,{className:`cal-day-head-name`,children:e.toLocaleDateString([],{weekday:`short`})}),(0,F.jsx)(`span`,{className:`cal-day-head-num`,children:e.getDate()})]},e.toISOString()))]}),(0,F.jsxs)(`div`,{className:`cal-allday-band`,children:[(0,F.jsx)(`div`,{className:`cal-timed-gutter`,children:`All-day`}),r.map(e=>(0,F.jsx)(`div`,{className:`cal-allday-cell`,children:t.filter(t=>t.isAllDay&&N(new Date(t.startsAt),e)).map(e=>(0,F.jsx)(`div`,{className:`cal-allday-chip`,title:e.title??`Untitled`,...P(e,n),children:e.title??`Untitled`},e.meetingId))},e.toISOString()))]}),(0,F.jsxs)(`div`,{className:`cal-timed-cols`,children:[(0,F.jsx)(`div`,{className:`cal-timed-gutter`,children:k().map(e=>(0,F.jsx)(`div`,{className:`cal-hour-label`,style:{height:`${G}px`},children:e===0?``:K(e)},e))}),r.map(e=>(0,F.jsx)(W,{day:e,meetings:t,hourHeight:G,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&&N(new Date(t.startsAt),e));return(0,F.jsxs)(`div`,{className:`cal-timed cal-timed-single`,children:[(0,F.jsxs)(`div`,{className:`cal-allday-band`,children:[(0,F.jsx)(`div`,{className:`cal-timed-gutter`,children:`All-day`}),(0,F.jsx)(`div`,{className:`cal-allday-cell`,children:r.map(e=>(0,F.jsx)(`div`,{className:`cal-allday-chip`,title:e.title??`Untitled`,...P(e,n),children:e.title??`Untitled`},e.meetingId))})]}),(0,F.jsxs)(`div`,{className:`cal-timed-cols`,children:[(0,F.jsx)(`div`,{className:`cal-timed-gutter`,children:k().map(e=>(0,F.jsx)(`div`,{className:`cal-hour-label`,style:{height:`${J}px`},children:e===0?``:Y(e)},e))}),(0,F.jsx)(W,{day:e,meetings:t,hourHeight:J,onSelect:n})]})]})}var Z=[`M`,`T`,`W`,`T`,`F`,`S`,`S`];function te(e){return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`}function ne({anchor:e,meetings:t,onPickMonth:n}){let r=new Date,i=new Set(t.map(e=>te(new Date(e.startsAt))));return(0,F.jsx)(`div`,{className:`cal-year`,children:(0,F.jsx)(`div`,{className:`cal-year-grid`,children:A(e).map(e=>{let t=O(e),a=e.getMonth();return(0,F.jsxs)(`button`,{type:`button`,className:`cal-mini`,onClick:()=>n(e),title:e.toLocaleDateString([],{month:`long`,year:`numeric`}),children:[(0,F.jsx)(`div`,{className:`cal-mini-title`,children:e.toLocaleDateString([],{month:`long`})}),(0,F.jsx)(`div`,{className:`cal-mini-weekrow`,children:Z.map((e,t)=>(0,F.jsx)(`span`,{className:`cal-mini-weekday`,children:e},t))}),(0,F.jsx)(`div`,{className:`cal-mini-grid`,children:t.map(e=>{let t=e.getMonth()!==a,n=N(e,r),o=!t&&i.has(te(e));return(0,F.jsxs)(`span`,{className:`cal-mini-day${t?` cal-mini-day-out`:``}${n?` cal-mini-day-today`:``}`,children:[e.getDate(),o&&(0,F.jsx)(`span`,{className:`cal-mini-dot`})]},e.toISOString())})})]},a)})})})}var re={meeting:`Meeting`,event:`Event`,task:`Task`};function ie(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 ae(e){return new Date(e).toISOString()}function Q(e){return Math.floor(new Date(e).getTime()/6e4)}function oe(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 se(e){if(!e)return null;let t=e.match(/filename="([^"]+)"/);return t?t[1]:null}function ce(e,t){return e.email??`${e.name??`unknown`}-${t}`}function le({a:e}){let t=e.name||e.email||`Unknown`,n=e.name&&e.email?e.email:null;return(0,F.jsxs)(`span`,{className:`cal-attendee-lines`,children:[(0,F.jsx)(`span`,{className:`cal-attendee-name`,children:t}),n&&(0,F.jsx)(`span`,{className:`cal-attendee-email`,children:n})]})}function ue({meeting:e,adminFetch:n,onClose:r,onSaved:a,onDeleted:o}){let c=e.kind===`meeting`,[u,d]=(0,C.useState)(!1),[f,m]=(0,C.useState)(!1),[g,v]=(0,C.useState)(!1),[S,w]=(0,C.useState)(!1),[T,E]=(0,C.useState)(null),[D,O]=(0,C.useState)(e),[k,A]=(0,C.useState)(e.title??``),[j,M]=(0,C.useState)(ie(e.startsAt)),[N,P]=(0,C.useState)(e.endsAt?ie(e.endsAt):``),[I,L]=(0,C.useState)(e.location??``),[R,z]=(0,C.useState)(e.privateNote??``),[B,V]=(0,C.useState)(``),[H,U]=(0,C.useState)(``);(0,C.useEffect)(()=>{let e=e=>{e.key===`Escape`&&!S&&r()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[S,r]);let W=(0,C.useCallback)(()=>{let e={},t=k.trim();t!==(D.title??``)&&(e.title=t);let n=ae(j);Q(n)!==Q(D.startsAt)&&(e.startsAt=n);let r=N?ae(N):null;(r===null?D.endsAt!==null:D.endsAt===null||Q(r)!==Q(D.endsAt))&&(e.endsAt=r);let i=I.trim()||null;i!==(D.location??null)&&(e.location=i);let a=R.trim()||null;return a!==(D.privateNote??null)&&(e.privateNote=a),e},[k,j,N,I,R,D]),G=(0,C.useCallback)(async()=>{let t=W();if(Object.keys(t).length===0){d(!1);return}w(!0),E(null);try{let r=await n(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(t)});if(!r.ok)throw Error(`HTTP ${r.status}`);let i=await r.json();O(i.meeting),a(i.meeting),d(!1)}catch(e){E(e instanceof Error?e.message:`Save failed`)}finally{w(!1)}},[n,W,e.meetingId,a]),K=(0,C.useCallback)(async()=>{let t=B.trim(),r=H.trim();if(!(!t&&!r)){w(!0),E(null);try{let i=await n(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}/attendees`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({name:t||void 0,email:r||void 0})});if(!i.ok)throw Error(`HTTP ${i.status}`);let o=await i.json();O(o.meeting),a(o.meeting),V(``),U(``)}catch(e){E(e instanceof Error?e.message:`Add failed`)}finally{w(!1)}}},[n,B,H,e.meetingId,a]),q=(0,C.useCallback)(async t=>{let r=t.email?{email:t.email}:{name:t.name};w(!0),E(null);try{let t=await n(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}/attendees`,{method:`DELETE`,headers:{"content-type":`application/json`},body:JSON.stringify(r)});if(!t.ok)throw Error(`HTTP ${t.status}`);let i=await t.json();O(i.meeting),a(i.meeting)}catch(e){E(e instanceof Error?e.message:`Remove failed`)}finally{w(!1)}},[n,e.meetingId,a]),J=(0,C.useCallback)(async()=>{w(!0),E(null);try{let t=await n(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}`,{method:`DELETE`});if(!t.ok)throw Error(`HTTP ${t.status}`);o(e.meetingId)}catch(e){E(e instanceof Error?e.message:`Delete failed`),w(!1)}},[n,e.meetingId,o]),Y=(0,C.useCallback)(async t=>{v(!1),w(!0),E(null);try{let r=await n(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}/ics?attendees=${t?`1`:`0`}`);if(!r.ok)throw Error(`HTTP ${r.status}`);let i=await r.blob(),a=se(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){E(e instanceof Error?e.message:`Download failed`)}finally{w(!1)}},[n,e.meetingId]),X=re[e.kind??`meeting`],Z=B.trim().length>0||H.trim().length>0;return(0,F.jsx)(`div`,{className:`cal-modal-overlay`,onClick:()=>{S||r()},children:(0,F.jsxs)(`div`,{className:`cal-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":u?`Edit meeting`:`Meeting detail`,onClick:e=>e.stopPropagation(),children:[(0,F.jsxs)(`div`,{className:`cal-modal-header`,children:[(0,F.jsx)(`span`,{className:`cal-modal-kind`,children:X}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-close`,onClick:r,"aria-label":`Close`,autoFocus:!0,disabled:S,children:(0,F.jsx)(p,{size:16})})]}),!u&&(0,F.jsxs)(`div`,{className:`cal-modal-body`,children:[(0,F.jsx)(`div`,{className:`cal-modal-title`,children:D.title??`Untitled`}),(0,F.jsxs)(`div`,{className:`cal-modal-row`,children:[(0,F.jsx)(y,{size:14}),(0,F.jsx)(`span`,{children:oe(D)})]}),D.location&&(0,F.jsxs)(`div`,{className:`cal-modal-row`,children:[(0,F.jsx)(b,{size:14}),(0,F.jsx)(`span`,{children:D.location})]}),D.attendees.length>0&&(0,F.jsxs)(`div`,{className:`cal-modal-row cal-modal-row-top`,children:[(0,F.jsx)(h,{size:14}),(0,F.jsx)(`div`,{className:`cal-modal-attendees`,children:D.attendees.map((e,t)=>(0,F.jsx)(`div`,{className:`cal-attendee-row`,children:(0,F.jsx)(le,{a:e})},ce(e,t)))})]}),D.privateNote&&(0,F.jsxs)(`div`,{className:`cal-modal-row cal-modal-row-top`,children:[(0,F.jsx)(x,{size:14}),(0,F.jsx)(`span`,{className:`cal-modal-note`,children:D.privateNote})]}),(0,F.jsxs)(`div`,{className:`cal-modal-row cal-modal-meta`,children:[(0,F.jsx)(_,{size:14}),(0,F.jsx)(`span`,{children:X})]})]}),u&&(0,F.jsxs)(`div`,{className:`cal-modal-body`,children:[(0,F.jsxs)(`label`,{className:`cal-modal-field`,children:[(0,F.jsx)(`span`,{children:`Title`}),(0,F.jsx)(`input`,{type:`text`,value:k,onChange:e=>A(e.target.value),disabled:S})]}),(0,F.jsxs)(`label`,{className:`cal-modal-field`,children:[(0,F.jsx)(`span`,{children:`Start`}),(0,F.jsx)(`input`,{type:`datetime-local`,value:j,onChange:e=>M(e.target.value),disabled:S})]}),(0,F.jsxs)(`label`,{className:`cal-modal-field`,children:[(0,F.jsx)(`span`,{children:`End`}),(0,F.jsx)(`input`,{type:`datetime-local`,value:N,onChange:e=>P(e.target.value),disabled:S})]}),(0,F.jsxs)(`label`,{className:`cal-modal-field`,children:[(0,F.jsx)(`span`,{children:`Location`}),(0,F.jsx)(`input`,{type:`text`,value:I,onChange:e=>L(e.target.value),disabled:S})]}),(0,F.jsxs)(`div`,{className:`cal-modal-field`,children:[(0,F.jsx)(`span`,{children:`Attendees`}),(0,F.jsxs)(`div`,{className:`cal-modal-attendees cal-modal-attendees-edit`,children:[D.attendees.length===0&&(0,F.jsx)(`div`,{className:`cal-attendee-empty`,children:`No attendees yet.`}),D.attendees.map((e,t)=>(0,F.jsxs)(`div`,{className:`cal-attendee-row cal-attendee-row-edit`,children:[(0,F.jsx)(le,{a:e}),(0,F.jsx)(`button`,{type:`button`,className:`cal-attendee-remove`,onClick:()=>q(e),disabled:S,"aria-label":`Remove ${e.name||e.email||`attendee`}`,children:(0,F.jsx)(p,{size:13})})]},ce(e,t)))]}),(0,F.jsxs)(`div`,{className:`cal-attendee-add`,children:[(0,F.jsx)(`input`,{type:`text`,placeholder:`Name`,value:B,onChange:e=>V(e.target.value),disabled:S,"aria-label":`Attendee name`}),(0,F.jsx)(`input`,{type:`email`,placeholder:`Email`,value:H,onChange:e=>U(e.target.value),disabled:S,"aria-label":`Attendee email`}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-btn cal-attendee-add-btn`,onClick:K,disabled:S||!Z,"aria-label":`Add attendee`,children:S?(0,F.jsx)(t,{size:13,className:`spin`}):(0,F.jsx)(ee,{size:13})})]})]}),(0,F.jsxs)(`label`,{className:`cal-modal-field`,children:[(0,F.jsx)(`span`,{children:`Private note`}),(0,F.jsx)(`textarea`,{className:`cal-modal-textarea`,value:R,onChange:e=>z(e.target.value),disabled:S,rows:3,placeholder:`Only you and your team can see this.`})]})]}),T&&(0,F.jsx)(`div`,{className:`cal-modal-error`,children:T}),c&&(0,F.jsxs)(`div`,{className:`cal-modal-actions`,children:[!u&&!f&&!g&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>d(!0),disabled:S,children:[(0,F.jsx)(s,{size:14}),` Edit`]}),(0,F.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-danger`,onClick:()=>m(!0),disabled:S,children:[(0,F.jsx)(l,{size:14}),` Delete`]}),(0,F.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-download`,onClick:()=>{D.attendees.length>0?v(!0):Y(!1)},disabled:S,children:[S?(0,F.jsx)(t,{size:14,className:`spin`}):(0,F.jsx)(i,{size:14}),` Download`]})]}),g&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{className:`cal-modal-confirm-text`,children:`Include attendees in the file?`}),(0,F.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-primary`,onClick:()=>Y(!0),disabled:S,children:[S?(0,F.jsx)(t,{size:14,className:`spin`}):null,` Yes`]}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>Y(!1),disabled:S,children:`No`}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>v(!1),disabled:S,children:`Cancel`})]}),u&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-primary`,onClick:G,disabled:S,children:[S?(0,F.jsx)(t,{size:14,className:`spin`}):null,` Save`]}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>{d(!1),E(null)},disabled:S,children:`Cancel`})]}),f&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{className:`cal-modal-confirm-text`,children:`Delete this meeting?`}),(0,F.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-danger`,onClick:J,disabled:S,children:[S?(0,F.jsx)(t,{size:14,className:`spin`}):null,` Delete`]}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>m(!1),disabled:S,children:`Cancel`})]})]})]})})}var $=`maxy-admin-session-key`,de=[`day`,`week`,`month`,`year`];function fe(e,t){switch(e){case`day`:return t.toLocaleDateString([],{weekday:`long`,day:`numeric`,month:`long`,year:`numeric`});case`week`:{let{from:e,to:n}=j(`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 pe(){let[e,n]=(0,C.useState)(null),[r,i]=(0,C.useState)(!1),[a,o]=(0,C.useState)(void 0),[s,c]=(0,C.useState)(null),[l,u]=(0,C.useState)(void 0),[d,p]=(0,C.useState)(null),[h,_]=(0,C.useState)(null);(0,C.useEffect)(()=>{let e=!1,t=null;try{t=sessionStorage.getItem($)}catch{}if(!t){i(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(t)}`).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),p(e.avatar??null)}catch{}n(t),i(!0)}}).catch(()=>{e||(n(t),i(!0))}),()=>{e=!0}},[]);let v=(0,C.useCallback)(()=>{try{sessionStorage.removeItem($)}catch{}window.location.href=`/`},[]),[y,b]=(0,C.useState)(!1),x=(0,C.useCallback)(async()=>{b(!0);try{let e=await m();if(e){try{sessionStorage.removeItem($)}catch{}window.location.href=`/`}return e}finally{b(!1)}},[]);return r?e?(0,F.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,F.jsx)(g,{cacheKey:e,businessName:a,sessionId:s,onLogout:v,onDisconnect:x,disconnecting:y,userName:l,userAvatar:d,role:h,children:(0,F.jsx)(me,{cacheKey:e})})}):(0,F.jsx)(`div`,{className:`cal-page`,children:(0,F.jsxs)(`div`,{className:`cal-empty`,children:[(0,F.jsx)(`p`,{children:`You are not signed in.`}),(0,F.jsxs)(`p`,{children:[`Open the `,(0,F.jsx)(`a`,{href:`/`,className:`cal-link`,children:`main admin page`}),` and log in, then return here.`]})]})}):(0,F.jsx)(`div`,{className:`cal-page`,children:(0,F.jsxs)(`div`,{className:`cal-loading`,children:[(0,F.jsx)(t,{size:18,className:`spin`}),` Loading…`]})})}function me({cacheKey:e}){let{adminFetch:r,sessionRefetchNonce:i}=n({initialCacheKey:e,surface:`calendar`}),[s,c]=(0,C.useState)(`month`),[l,u]=(0,C.useState)(()=>new Date),[d,f]=(0,C.useState)([]),[p,m]=(0,C.useState)(!1),[h,g]=(0,C.useState)(null),[y,b]=(0,C.useState)(null),[x,ee]=(0,C.useState)(null);(0,C.useEffect)(()=>{let e=!1;return r(`/api/admin/calendar/booking-link`).then(async t=>{if(e||!t.ok)return;let n=await t.json();typeof n.bookingDomain==`string`&&n.bookingDomain&&ee(n.bookingDomain)}).catch(()=>{}),()=>{e=!0}},[r]),(0,C.useEffect)(()=>{let e=!1,{from:t,to:n}=j(s,l);return m(!0),g(null),r(`/api/admin/calendar/meetings?from=${encodeURIComponent(t.toISOString())}&to=${encodeURIComponent(n.toISOString())}`).then(async t=>{if(e)return;if(!t.ok)throw Error(`HTTP ${t.status}`);let n=await t.json();f(Array.isArray(n.meetings)?n.meetings:[])}).catch(t=>{e||(g(t instanceof Error?t.message:`Failed to load`),f([]))}).finally(()=>{e||m(!1)}),()=>{e=!0}},[s,l,i,r]);let S=(0,C.useCallback)(()=>u(new Date),[]),w=(0,C.useCallback)(()=>u(e=>M(s,e,-1)),[s]),T=(0,C.useCallback)(()=>u(e=>M(s,e,1)),[s]),E=(0,C.useCallback)(e=>{u(e),c(`month`)},[]);(0,C.useEffect)(()=>{b(null)},[s,l]);let D=(0,C.useCallback)(e=>{f(t=>t.map(t=>t.meetingId===e.meetingId?e:t)),b(e)},[]),O=(0,C.useCallback)(e=>{f(t=>t.filter(t=>t.meetingId!==e)),b(null)},[]);return(0,F.jsxs)(`div`,{className:`cal-page`,children:[(0,F.jsxs)(`header`,{className:`cal-header`,children:[(0,F.jsxs)(`div`,{className:`cal-title`,children:[(0,F.jsx)(_,{size:20}),` Calendar`]}),(0,F.jsxs)(`div`,{className:`cal-nav`,children:[(0,F.jsx)(`button`,{type:`button`,className:`cal-today-btn`,onClick:S,children:`Today`}),(0,F.jsx)(`button`,{type:`button`,className:`cal-nav-btn`,onClick:w,"aria-label":`Previous`,children:(0,F.jsx)(a,{size:18})}),(0,F.jsx)(`button`,{type:`button`,className:`cal-nav-btn`,onClick:T,"aria-label":`Next`,children:(0,F.jsx)(v,{size:18})}),(0,F.jsx)(`span`,{className:`cal-range-label`,children:fe(s,l)}),p&&(0,F.jsx)(t,{size:16,className:`spin`})]}),(0,F.jsx)(`div`,{className:`cal-views`,children:de.map(e=>(0,F.jsx)(`button`,{type:`button`,className:`cal-view-btn${e===s?` cal-view-btn-active`:``}`,onClick:()=>c(e),children:e.charAt(0).toUpperCase()+e.slice(1)},e))}),x&&(0,F.jsxs)(`a`,{className:`cal-booking-link`,href:`https://${x}`,target:`_blank`,rel:`noopener noreferrer`,children:[(0,F.jsx)(o,{size:14}),` Booking page`]})]}),(0,F.jsxs)(`div`,{className:`cal-body`,children:[h&&(0,F.jsxs)(`div`,{className:`cal-error`,children:[`Could not load the calendar: `,h]}),s===`day`&&(0,F.jsx)(X,{anchor:l,meetings:d,onSelect:b}),s===`week`&&(0,F.jsx)(q,{anchor:l,meetings:d,onSelect:b}),s===`month`&&(0,F.jsx)(z,{anchor:l,meetings:d,onSelect:b}),s===`year`&&(0,F.jsx)(ne,{anchor:l,meetings:d,onPickMonth:E})]}),y&&(0,F.jsx)(ue,{meeting:y,adminFetch:r,onClose:()=>b(null),onSaved:D,onDeleted:O})]})}(0,S.createRoot)(document.getElementById(`root`)).render((0,F.jsx)(pe,{}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as e,V as t}from"./OperatorConversations-Cei12sSK.js";import"./admin-types-DJoj6VJv.js";import"./AdminShell-CmqhpAPU.js";import{n}from"./page-hG7xTrcO.js";var r=t(),i=e();(0,r.createRoot)(document.getElementById(`root`)).render((0,i.jsx)(n,{}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CAM3fms7.js";import{A as t,B as n,C as r,D as i,E as a,F as o,M as s,O as c,P as ee,R as l,T as te,U as u,V as d,_ as ne,d as f,f as p,p as re,t as ie,v as m,w as ae}from"./OperatorConversations-Cei12sSK.js";import{i as oe,t as se}from"./graph-labels-CJj55nHk.js";var ce=l(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),le=l(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),ue=l(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),de=l(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),fe=l(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),pe=l(`mouse-pointer-click`,[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]),me=l(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),h=d(),g=e(u(),1);function he(e){let t=new Set,n=[];for(let r of e)for(let e of r.labels)e&&(t.has(e)||se.has(e)&&(t.add(e),n.push(e)));return n}var _=r(),ge=/\.(png|jpe?g|gif|webp|svg)$/i;function _e(e){return ge.test(e)}var ve=`maxy-data-view`,ye=95*1024*1024,be=48*1024*1024;function xe(){return typeof window>`u`?`list`:window.localStorage.getItem(ve)===`grid`?`grid`:`list`}function Se(){let[e,n]=(0,g.useState)(null),[r,i]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{let e=!1,t=null;try{t=sessionStorage.getItem(`maxy-admin-session-key`)}catch{}if(!t){n(null),i(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(t)}`).then(r=>{if(!e){if(r.status===401){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`;return}n(t),i(!0)}}).catch(()=>{e||(n(t),i(!0))}),()=>{e=!0}},[]),r?e?(0,_.jsx)(m,{cacheKey:e,surface:`data`,onSessionExpired:({code:e,path:t})=>{console.warn(`[admin-auth] outcome=session-expired-redirect code=${e} path=${t} surface=data`);try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},children:(0,_.jsx)(`div`,{className:`data-page data-page-full`,children:(0,_.jsx)(Ce,{cacheKey:e})})}):(0,_.jsx)(`div`,{className:`data-page`,children:(0,_.jsxs)(`div`,{className:`data-empty`,children:[(0,_.jsx)(`p`,{children:`You are not signed in.`}),(0,_.jsxs)(`p`,{children:[`Open the `,(0,_.jsx)(`a`,{href:`/`,className:`data-link`,children:`main admin page`}),` and log in, then return here.`]})]})}):(0,_.jsx)(`div`,{className:`data-page`,children:(0,_.jsxs)(`div`,{className:`data-loading`,children:[(0,_.jsx)(t,{size:18,className:`spin`}),` Loading…`]})})}function Ce({cacheKey:e}){let{adminFetch:t,cacheKey:r,sessionRefetchNonce:i}=n({initialCacheKey:e,surface:`data`});return(0,_.jsx)(b,{adminFetch:t,cacheKey:r,sessionRefetchNonce:i})}function we(){if(typeof window>`u`)return`.`;let e=new URLSearchParams(window.location.hash.replace(/^#/,``)).get(`path`);return e&&e.length>0?e:`.`}function Te(e){if(typeof window>`u`)return;let t=new URL(window.location.href);t.hash=e===`.`?``:`path=${encodeURIComponent(e)}`,window.history.replaceState(window.history.state,``,t.toString())}function v(e){return new Promise((t,n)=>{let r=[],i=()=>e.readEntries(e=>{e.length===0?t(r):(r.push(...e),i())},n);i()})}function y(e){return new Promise((t,n)=>e.file(t,n))}async function Ee(e,t=``){let n=[];for(let r of e){if(!r)continue;let e=t?`${t}/${r.name}`:r.name;if(r.isFile)n.push({file:await y(r),relpath:e});else if(r.isDirectory){let t=await v(r.createReader());n.push(...await Ee(t,e))}}return n}function De(e,t){if(e===422&&typeof t==`string`){if(/exceeds the .* limit/i.test(t))return`size`;if(/unsupported file type/i.test(t))return`mime`}return`http=${e}`}function b({adminFetch:e,cacheKey:n,sessionRefetchNonce:r}){let[l,u]=(0,g.useState)(``),d=(0,g.useRef)(null),[m,se]=(0,g.useState)(``),[h,ge]=(0,g.useState)(null),[Se,Ce]=(0,g.useState)(`hybrid`),[v,y]=(0,g.useState)(!1),[b,x]=(0,g.useState)(null),[S,Ae]=(0,g.useState)(null),[Ne,Pe]=(0,g.useState)(0),[C,Fe]=(0,g.useState)(!1),[w,Ie]=(0,g.useState)(()=>we()),[T,Le]=(0,g.useState)(null),[E,Re]=(0,g.useState)(()=>xe()),[D,ze]=(0,g.useState)(null),[O,Be]=(0,g.useState)([]),[k,Ve]=(0,g.useState)(!1),[He,Ue]=(0,g.useState)(null),[We,A]=(0,g.useState)(!1),[j,M]=(0,g.useState)(null),[Ge,N]=(0,g.useState)(null),[Ke,qe]=(0,g.useState)(null),[Je,Ye]=(0,g.useState)(!1),[Xe,Ze]=(0,g.useState)(null),P=(0,g.useRef)(null),[Qe,F]=(0,g.useState)(0),[$e,I]=(0,g.useState)(!1),[et,tt]=(0,g.useState)(``),[L,R]=(0,g.useState)(null),[nt,rt]=(0,g.useState)(``),[it,z]=(0,g.useState)(null),B=(()=>{let e=w===`.`?[]:w.split(`/`).filter(Boolean);return e.length>=2&&e[0]===`accounts`})();(0,g.useEffect)(()=>{console.info(`[data-ui] op=mount header=operator home=absent`)},[]);let at=(0,g.useCallback)(()=>{try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},[]),ot=(0,g.useCallback)(e=>{e===`chat`&&(window.location.href=`/`)},[]),[V,st]=(0,g.useState)([]),[ct,lt]=(0,g.useState)(`files`);(0,g.useEffect)(()=>{if(!n)return;let e=!1;return fetch(`/api/whatsapp-reader/conversations?session_key=${encodeURIComponent(n)}`).then(e=>e.ok?e.json():{conversations:[]}).then(t=>{e||st(t.conversations??[])}).catch(()=>{}),()=>{e=!0}},[n]);let ut=(0,g.useMemo)(()=>[...new Set(V.map(e=>e.channel))],[V]),[H,dt]=(0,g.useState)(!1),ft=(0,g.useRef)(null),[pt,U]=(0,g.useState)(!1),mt=(0,g.useRef)(null);(0,g.useEffect)(()=>{let e=l.trim();if(!e){se(``),ge(null),x(null);return}Fe(!1);let t=setTimeout(()=>se(e),300);return()=>clearTimeout(t)},[l]),(0,g.useEffect)(()=>{if(!m){y(!1);return}let t=!1;return y(!0),x(null),e(`/api/admin/graph-search?q=${encodeURIComponent(m)}&labels=FileArtifact&limit=20${C?`&threshold=0`:``}`).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(e=>{t||(ge(e.results),Ce(e.mode??`hybrid`),Pe(typeof e.suppressed==`number`?e.suppressed:0))}).catch(e=>{t||x(e instanceof Error?e.message:String(e))}).finally(()=>{t||y(!1)}),()=>{t=!0}},[m,e,r,C]);let ht=(0,g.useMemo)(()=>h?he(h):[],[h]),W=S&&ht.includes(S)?S:null,gt=(0,g.useMemo)(()=>h?W?h.filter(e=>e.labels.includes(W)):h:null,[h,W]),_t=(0,g.useCallback)(e=>{let t=e.properties.relativePath;if(typeof t!=`string`||t.length===0)return;let r=`/api/admin/files/download?session_key=${encodeURIComponent(n)}&path=${encodeURIComponent(t)}`,i=document.createElement(`a`);i.href=r,i.rel=`noopener noreferrer`,document.body.appendChild(i),i.click(),i.remove()},[n]);(0,g.useEffect)(()=>{if(!h)return;let e=h.filter(e=>{let t=e.properties.relativePath;return typeof t!=`string`||t.length===0});e.length>0&&console.warn(`[data-search] op=locate-link-missing nodeId=${e.map(e=>e.nodeId).join(`,`)}`)},[h]),(0,g.useEffect)(()=>{let t=!1;return Ve(!0),Ue(null),e(`/api/admin/files?path=${encodeURIComponent(w===`.`?``:w)}`).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(e=>{t||(Le(e.entries),Be(e.displayPath??[]))}).catch(e=>{t||(Le([]),Be([]),Ue(e instanceof Error?e.message:String(e)))}).finally(()=>{t||Ve(!1)}),()=>{t=!0}},[e,w,Qe,r]),(0,g.useEffect)(()=>{Te(w)},[w]);let vt=(0,g.useCallback)(()=>{F(e=>e+1)},[]),G=(0,g.useCallback)(e=>{dt(!1),Ie(e)},[]),yt=(0,g.useCallback)(e=>{let t=e.properties.relativePath;if(typeof t!=`string`||t.length===0)return;let n=t.lastIndexOf(`/`),r=n===-1?`.`:t.slice(0,n);console.log(`[data-search] op=locate nodeId=${e.nodeId} folder=${r}`),u(``),x(null),Ae(null),G(r)},[G]),bt=(0,g.useCallback)(()=>{if(w===`.`||w===``)return;let e=w.split(`/`).filter(Boolean);e.pop(),Ie(e.length===0?`.`:e.join(`/`))},[w]),xt=(0,g.useCallback)(e=>{p(n,w===`.`?e.name:`${w}/${e.name}`)},[w,n]),[K,St]=(0,g.useState)(!1),[q,Ct]=(0,g.useState)(new Set),wt=(0,g.useRef)(null),J=(0,g.useRef)(!1),Y=typeof navigator<`u`&&typeof navigator.share==`function`&&typeof navigator.canShare==`function`,Tt=(0,g.useCallback)(e=>{St(!0),Ct(new Set([e])),console.info(`[data-ui] op=select-enter count=1`)},[]),X=(0,g.useCallback)(e=>{St(!1),Ct(new Set),console.info(`[data-ui] op=select-exit reason=${e}`)},[]),Z=(0,g.useCallback)(e=>{Ct(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),Et=(0,g.useCallback)(e=>{J.current=!1,wt.current=setTimeout(()=>{J.current=!0,Tt(e)},500)},[Tt]),Q=(0,g.useCallback)(()=>{wt.current&&=(clearTimeout(wt.current),null)},[]),Dt=(0,g.useCallback)(e=>{if(J.current){J.current=!1;return}if(K){Z(e.name);return}xt(e)},[K,Z,xt]),Ot=(0,g.useCallback)(e=>{Re(e),typeof window<`u`&&window.localStorage.setItem(ve,e),console.info(`[data] op=view-mode mode=${e}`)},[]),kt=(0,g.useCallback)(e=>{if(J.current){J.current=!1;return}if(K){Z(e.name);return}ze({src:f(n,w===`.`?e.name:`${w}/${e.name}`),alt:e.displayName??e.name})},[K,Z,w,n]),At=(0,g.useCallback)(()=>(T??[]).filter(e=>e.kind===`file`&&q.has(e.name)),[T,q]),jt=(0,g.useCallback)(()=>(T??[]).filter(e=>(e.kind===`file`||e.kind===`directory`)&&q.has(e.name)),[T,q]),Mt=(0,g.useCallback)(()=>{let e=jt(),t=e.some(e=>e.kind===`directory`);e.length===1&&!t?xt(e[0]):e.length>=1&&re(n,e.map(e=>w===`.`?e.name:`${w}/${e.name}`)),X(`action`)},[jt,xt,w,n,X]),Nt=(0,g.useCallback)(async()=>{let t=At(),n=t.filter(e=>!e.protected),r=t.length-n.length;Ze(r>0?`${r} protected file(s) kept`:null);for(let t of n){let n=w===`.`?t.name:`${w}/${t.name}`;try{let t=await e(`/api/admin/files?path=${encodeURIComponent(n)}`,{method:`DELETE`}),r=await t.json().catch(()=>({error:`HTTP ${t.status}`}));if(!t.ok)throw Error(r.error??`HTTP ${t.status}`)}catch(e){Ze(e instanceof Error?e.message:String(e))}}F(e=>e+1),X(`action`)},[At,w,e,X]),Pt=(0,g.useCallback)(async()=>{let e=At();if(console.info(`[data-ui] op=share supported=${Y} count=${e.length}`),Y)try{let t=await Promise.all(e.map(async e=>{let t=w===`.`?e.name:`${w}/${e.name}`,r=`/api/admin/files/download?session_key=${encodeURIComponent(n)}&path=${encodeURIComponent(t)}`,i=await(await fetch(r)).blob();return new File([i],e.name,{type:i.type||`application/octet-stream`})}));navigator.canShare({files:t})&&await navigator.share({files:t})}catch(e){console.warn(`[data-ui] op=share-failed err=${e instanceof Error?e.message:String(e)}`)}},[At,Y,w,n]),Ft=(0,g.useCallback)(()=>{P.current?.click()},[]),It=(0,g.useCallback)((e,t={})=>{let r=(r,i,a)=>{let o=new URLSearchParams({session_key:n,path:w===`.`?``:w,filename:e.name});t.relpath&&o.set(`relpath`,t.relpath),t.token&&o.set(`token`,t.token);for(let[e,t]of Object.entries(i))o.set(e,t);return new Promise(t=>{let n=new XMLHttpRequest;n.open(`POST`,`/api/admin/files/upload?${o.toString()}`),n.setRequestHeader(`Content-Type`,e.type||`application/octet-stream`),a&&(n.upload.onprogress=e=>{e.lengthComputable&&a(e.loaded)}),n.onload=()=>{let e={};try{e=JSON.parse(n.responseText)}catch{}t({status:n.status,data:e})},n.onerror=()=>t({status:0,data:{}}),n.onabort=()=>t({status:0,data:{error:`aborted`}}),n.send(r)})};if(e.size<=ye)return r(e,{},n=>t.onProgress?.(n,e.size));let i=`${Date.now().toString(36)}-${Math.random().toString(16).slice(2,10)}`,a=Math.ceil(e.size/be);return(async()=>{let n={status:0,data:{}};for(let o=0;o<a;o++){let s=o*be;if(n=await r(e.slice(s,Math.min(s+be,e.size)),{uploadId:i,seq:String(o),total:String(a)},n=>t.onProgress?.(s+n,e.size)),!(n.status>=200&&n.status<300))return n}return n})()},[n,w]),Lt=(0,g.useCallback)(async e=>{N(null),A(!0),M({loaded:0,total:e.size});try{let{status:t,data:n}=await It(e,{onProgress:(e,t)=>M({loaded:e,total:t})});t>=200&&t<300&&n.path?(Ie(n.path.split(`/`).slice(0,-1).join(`/`)||`.`),F(e=>e+1)):N(t===0?`Network error during upload — the connection failed before the server responded.`:n.error??`Upload failed (HTTP ${t}).`)}finally{A(!1),M(null),P.current&&(P.current.value=``)}},[It]),Rt=(0,g.useCallback)(e=>{B&&Array.from(e.dataTransfer.types).includes(`Files`)&&(e.preventDefault(),Ye(!0))},[B]),zt=(0,g.useCallback)(e=>{e.currentTarget.contains(e.relatedTarget)||Ye(!1)},[]),Bt=(0,g.useCallback)(async e=>{e.preventDefault(),Ye(!1);let t=Math.random().toString(16).slice(2,10),n=Array.from(e.dataTransfer.items);if(console.info(`[data-ui] op=drop-received token=${t} items=${n.length}`),n.length===0)return;if(!B){console.info(`[data-ui] op=drop-rejected token=${t} reason=no-write`),N(`Open a folder inside your account to upload`);return}let r=n.map(e=>e.webkitGetAsEntry?.()).filter(e=>!!e);A(!0),N(null),qe(null);let i=performance.now();try{let e=await Ee(r),n=e.reduce((e,t)=>e+t.file.size,0),a=new Set(e.map(e=>e.relpath.split(`/`).slice(0,-1).join(`/`)).filter(Boolean)).size;console.info(`[data-ui] op=drop-walk token=${t} files=${e.length} dirs=${a} bytes=${n}`);let o=0,s=[];for(let n=0;n<e.length;n++){let{file:r,relpath:i}=e[n];console.info(`[data-ui] op=drop-file token=${t} rel="${i}" i=${n+1}/${e.length}`),M({loaded:0,total:r.size});let{status:a,data:c}=await It(r,{relpath:i,token:t,onProgress:(e,t)=>M({loaded:e,total:t})});if(a>=200&&a<300)o++,console.info(`[data-ui] op=drop-file-ok token=${t} rel="${i}"`);else{let e=a===0?`http=0`:De(a,c.error);s.push(`${i} (${e})`),console.info(`[data-ui] op=drop-file-skip token=${t} rel="${i}" reason=${e}`)}}let c=Math.round(performance.now()-i);console.info(`[data-ui] op=drop-done token=${t} uploaded=${o} skipped=${s.length} ms=${c}`),qe(`Uploaded ${o}, skipped ${s.length}${s.length?`: ${s.join(`, `)}`:``}`),F(e=>e+1)}catch(e){N(e instanceof Error?e.message:String(e))}finally{A(!1),M(null)}},[B,It]),Vt=(0,g.useCallback)(async()=>{let t=et.trim();if(t){z(null);try{let n=await e(`/api/admin/files/folder`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({path:w===`.`?``:w,name:t})}),r=await n.json().catch(()=>({error:`HTTP ${n.status}`}));if(!n.ok)throw Error(r.error??`HTTP ${n.status}`);I(!1),tt(``),F(e=>e+1)}catch(e){z(e instanceof Error?e.message:String(e))}}},[e,et,w]),Ht=(0,g.useCallback)(async()=>{if(!L)return;let t=nt.trim();if(!t)return;z(null);let n=w===`.`?L:`${w}/${L}`;try{let r=await e(`/api/admin/files/rename`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({path:n,newName:t})}),i=await r.json().catch(()=>({error:`HTTP ${r.status}`}));if(!r.ok)throw Error(i.error??`HTTP ${r.status}`);R(null),rt(``),X(`action`),F(e=>e+1)}catch(e){z(e instanceof Error?e.message:String(e))}},[e,nt,L,w,X]);(0,g.useEffect)(()=>{if(!H)return;let e=e=>{ft.current&&!ft.current.contains(e.target)&&dt(!1)},t=e=>{e.key===`Escape`&&dt(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[H]),(0,g.useEffect)(()=>{if(!pt)return;let e=e=>{mt.current&&!mt.current.contains(e.target)&&U(!1)},t=e=>{e.key===`Escape`&&U(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[pt]);let $=(0,g.useCallback)(e=>O.slice(0,e+1).map(e=>e.name).join(`/`),[O]),Ut=O.length>=2,Wt=Ut?[{name:`.`,label:`data`},...O.slice(0,O.length-2).map((e,t)=>({name:$(t),label:e.displayName??e.name}))]:[];return(0,_.jsxs)(`main`,{className:`data-main`,children:[(0,_.jsx)(ne,{variant:`operator`,onNavigate:ot,conversationsCount:V.length,conversationsChannels:ut,onOpenConversations:()=>lt(`conversations`),onToggleSidebar:()=>{},sidebarOpen:!1,onLogout:at,onDisconnect:async()=>!0,disconnecting:!1}),ct===`conversations`?(0,_.jsx)(ie,{conversations:V,sessionKey:n,onBack:()=>lt(`files`)}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(`div`,{className:`data-toolbar`,children:[K?(0,_.jsxs)(`button`,{type:`button`,className:`data-select-cancel`,onClick:()=>X(`cancel`),"aria-label":`Cancel selection`,children:[(0,_.jsx)(ae,{size:14}),` Cancel`]}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(`div`,{className:`data-search-input`,children:[l===``&&(0,_.jsx)(oe,{size:14}),(0,_.jsx)(`input`,{ref:d,type:`text`,value:l,onChange:e=>u(e.target.value),autoFocus:!0,autoComplete:`off`,spellCheck:!1}),v&&(0,_.jsx)(t,{size:14,className:`spin`}),l!==``&&(0,_.jsx)(`button`,{type:`button`,className:`data-search-inline-btn`,onClick:()=>{u(``),d.current?.focus()},title:`Clear search`,"aria-label":`Clear search`,children:(0,_.jsx)(ae,{size:14})})]}),(0,_.jsxs)(`div`,{className:`data-toolbar-actions`,ref:mt,children:[(0,_.jsx)(`button`,{type:`button`,className:`data-action-overflow`,onClick:()=>U(e=>!e),"aria-haspopup":`menu`,"aria-expanded":pt,"aria-label":`File actions`,title:`File actions`,children:(0,_.jsx)(ee,{size:16})}),(0,_.jsxs)(`div`,{className:`data-action-group`,role:`group`,"aria-label":`File actions`,"data-open":pt?`true`:void 0,children:[(0,_.jsxs)(`button`,{type:`button`,className:`data-action-btn`,onClick:()=>{vt(),U(!1)},disabled:k,title:`Refresh this folder`,"aria-label":`Refresh this folder`,children:[k?(0,_.jsx)(t,{size:16,className:`spin`}):(0,_.jsx)(i,{size:16}),(0,_.jsx)(`span`,{className:`data-action-label`,children:`Refresh`})]}),(0,_.jsxs)(`button`,{type:`button`,className:`data-action-btn`,onClick:()=>{Ft(),U(!1)},disabled:We||!B,title:B?`Upload a file`:`Open a folder inside your account to upload`,"aria-label":`Upload a file`,children:[We?j&&j.total>0?(0,_.jsxs)(`span`,{className:`data-upload-pct`,children:[Math.round(j.loaded/j.total*100),`%`]}):(0,_.jsx)(t,{size:16,className:`spin`}):(0,_.jsx)(me,{size:16}),(0,_.jsx)(`span`,{className:`data-action-label`,children:`Upload`})]}),(0,_.jsxs)(`button`,{type:`button`,className:`data-action-btn`,onClick:()=>{I(e=>!e),tt(``),z(null),U(!1)},disabled:We||!B,title:B?`New folder`:`Open a folder inside your account to create one`,"aria-label":`New folder`,children:[(0,_.jsx)(le,{size:16}),(0,_.jsx)(`span`,{className:`data-action-label`,children:`New folder`})]}),(0,_.jsxs)(`button`,{type:`button`,className:`data-action-btn`,onClick:()=>{Ot(E===`grid`?`list`:`grid`),U(!1)},title:E===`grid`?`List view`:`Grid view`,"aria-label":E===`grid`?`Switch to list view`:`Switch to grid view`,"aria-pressed":E===`grid`,children:[E===`grid`?(0,_.jsx)(fe,{size:16}):(0,_.jsx)(de,{size:16}),(0,_.jsx)(`span`,{className:`data-action-label`,children:E===`grid`?`List view`:`Grid view`})]})]})]})]}),(0,_.jsxs)(`div`,{className:`data-breadcrumbs`,children:[w!==`.`&&(0,_.jsx)(`button`,{type:`button`,className:`data-btn data-btn-ghost data-back-btn`,onClick:bt,title:`Up one level`,"aria-label":`Up one level`,children:(0,_.jsx)(ce,{size:14})}),Ut?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(`span`,{className:`data-crumb-wrap`,ref:ft,children:[(0,_.jsx)(`button`,{type:`button`,className:`data-crumb data-crumb-ellipsis`,onClick:()=>dt(e=>!e),"aria-haspopup":`menu`,"aria-expanded":H,"aria-label":`Show parent folders`,title:`Show parent folders`,children:`…`}),H&&(0,_.jsx)(`div`,{className:`data-crumb-menu`,role:`menu`,children:Wt.map(e=>(0,_.jsx)(`button`,{type:`button`,role:`menuitem`,className:`data-crumb-menu-item`,onClick:()=>G(e.name),title:e.label,children:e.label},e.name))})]}),[O.length-2,O.length-1].map(e=>{let t=O[e];return(0,_.jsxs)(`span`,{className:`data-crumb-wrap`,children:[(0,_.jsx)(`span`,{className:`data-crumb-sep`,children:`/`}),(0,_.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>G($(e)),title:t.name,children:t.displayName??t.name})]},$(e))})]}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>G(`.`),children:`data`}),O.map((e,t)=>(0,_.jsxs)(`span`,{className:`data-crumb-wrap`,children:[(0,_.jsx)(`span`,{className:`data-crumb-sep`,children:`/`}),(0,_.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>G($(t)),title:e.name,children:e.displayName??e.name})]},$(t)))]})]}),$e&&(0,_.jsxs)(`div`,{className:`data-inline-form`,children:[(0,_.jsx)(`input`,{type:`text`,className:`data-inline-input`,placeholder:`Folder name`,value:et,autoFocus:!0,onChange:e=>tt(e.target.value),onKeyDown:e=>{e.key===`Enter`&&Vt(),e.key===`Escape`&&I(!1)}}),(0,_.jsx)(`button`,{type:`button`,className:`data-btn`,onClick:Vt,children:`Create`}),(0,_.jsx)(`button`,{type:`button`,className:`data-btn data-btn-ghost`,onClick:()=>I(!1),children:`Cancel`})]}),L&&(0,_.jsxs)(`div`,{className:`data-inline-form`,children:[(0,_.jsx)(`input`,{type:`text`,className:`data-inline-input`,placeholder:`New name`,value:nt,autoFocus:!0,onChange:e=>rt(e.target.value),onKeyDown:e=>{e.key===`Enter`&&Ht(),e.key===`Escape`&&R(null)}}),(0,_.jsx)(`button`,{type:`button`,className:`data-btn`,onClick:Ht,children:`Rename`}),(0,_.jsx)(`button`,{type:`button`,className:`data-btn data-btn-ghost`,onClick:()=>R(null),children:`Cancel`})]}),it&&(0,_.jsx)(`div`,{className:`data-error`,children:it}),(0,_.jsx)(`input`,{type:`file`,ref:P,hidden:!0,onChange:e=>{let t=e.target.files?.[0];t&&Lt(t)}})]}),(0,_.jsxs)(`div`,{className:`data-body`,"data-drag-active":Je?`true`:void 0,onDragEnter:Rt,onDragOver:Rt,onDragLeave:zt,onDrop:Bt,children:[(b!==null||h!==null)&&(0,_.jsxs)(`section`,{className:`data-panel`,children:[b&&(0,_.jsxs)(`div`,{className:`data-error`,children:[`Search failed: `,b]}),ht.length>0&&(0,_.jsx)(`div`,{className:`data-chip-row`,role:`group`,"aria-label":`Filter by type`,children:ht.map(e=>{let t=e===W;return(0,_.jsx)(`button`,{type:`button`,className:`data-chip`,"data-active":t,onClick:()=>Ae(t?null:e),children:ke([e])??e},e)})}),h&&!v&&(0,_.jsxs)(`div`,{className:`data-results-meta`,children:[gt.length,` of `,h.length,` result`,h.length===1?``:`s`]}),h&&!v&&!W&&Ne>0&&!C&&(0,_.jsxs)(`button`,{type:`button`,className:`data-suppressed-banner`,onClick:()=>Fe(!0),children:[Ne,` low-confidence result`,Ne===1?``:`s`,` hidden — show all`]}),h&&!v&&!W&&C&&(0,_.jsx)(`button`,{type:`button`,className:`data-suppressed-banner`,onClick:()=>Fe(!1),children:`Showing all results — hide low-confidence`}),h&&h.length===0&&!v&&(0,_.jsx)(`div`,{className:`data-empty-results`,children:`No matches. Try a different keyword.`}),gt&>.length>0&&(0,_.jsx)(`ul`,{className:`data-results`,children:gt.map(e=>(0,_.jsx)(Oe,{hit:e,mode:Se,onDownload:_t,onLocate:yt},e.nodeId))})]}),(0,_.jsxs)(`section`,{className:`data-panel`,children:[j&&(0,_.jsxs)(`div`,{className:`data-upload-progress`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":j.total>0?Math.round(j.loaded/j.total*100):void 0,children:[(0,_.jsx)(`div`,{className:`data-upload-progress-track`,children:(0,_.jsx)(`div`,{className:`data-upload-progress-fill`,style:{width:`${j.total>0?Math.round(j.loaded/j.total*100):0}%`}})}),(0,_.jsxs)(`span`,{className:`data-upload-progress-label`,children:[`Uploading… `,j.total>0?`${Math.round(j.loaded/j.total*100)}%`:``]})]}),Ge&&(0,_.jsxs)(`div`,{className:`data-error`,children:[`Upload failed: `,Ge]}),Ke&&(0,_.jsx)(`div`,{className:`data-status`,children:Ke}),Xe&&(0,_.jsxs)(`div`,{className:`data-error`,children:[`Delete failed: `,Xe]}),He&&(0,_.jsx)(`div`,{className:`data-error`,children:He}),k&&(0,_.jsxs)(`div`,{className:`data-loading`,children:[(0,_.jsx)(t,{size:14,className:`spin`}),` Loading…`]}),!K&&!k&&T&&T.length>0&&(0,_.jsxs)(`div`,{className:`data-select-hint`,children:[(0,_.jsx)(pe,{size:13}),(0,_.jsx)(`span`,{children:`Press and hold a file to select, rename, or delete it.`})]}),!k&&T&&T.length===0&&!He&&(0,_.jsx)(`div`,{className:`data-empty-results`,children:`Empty directory.`}),!k&&T&&T.length>0&&E===`grid`&&(0,_.jsx)(`ul`,{className:`data-grid`,children:T.map(e=>{let t=e.displayName??e.name,r=K&&q.has(e.name);if(e.kind===`directory`)return(0,_.jsx)(`li`,{className:`data-grid-cell`,"data-selected":r?`true`:void 0,children:(0,_.jsxs)(`button`,{type:`button`,className:`data-grid-tile`,onPointerDown:()=>Et(e.name),onPointerUp:Q,onPointerMove:Q,onPointerLeave:Q,onPointerCancel:Q,onClick:()=>{if(J.current){J.current=!1;return}if(K){Z(e.name);return}G(w===`.`?e.name:`${w}/${e.name}`)},children:[K&&(0,_.jsx)(`span`,{className:`data-entry-select-indicator`,"aria-hidden":`true`}),(0,_.jsx)(ue,{size:28,className:`data-grid-glyph`}),(0,_.jsx)(`span`,{className:`data-grid-label`,title:e.name,children:t})]})},e.name);if(e.kind===`file`){let i=_e(e.name),a=w===`.`?e.name:`${w}/${e.name}`;return(0,_.jsx)(`li`,{className:`data-grid-cell`,"data-selected":r?`true`:void 0,children:(0,_.jsxs)(`button`,{type:`button`,className:`data-grid-tile${i?` data-grid-tile-image`:``}`,onPointerDown:()=>Et(e.name),onPointerUp:Q,onPointerMove:Q,onPointerLeave:Q,onPointerCancel:Q,onClick:()=>i?kt(e):Dt(e),title:K?void 0:i?`Preview ${t}`:`Download ${t}`,children:[K&&(0,_.jsx)(`span`,{className:`data-entry-select-indicator`,"aria-hidden":`true`}),i?(0,_.jsx)(`img`,{className:`data-grid-thumb`,src:f(n,a),alt:t,loading:`lazy`,onError:()=>console.warn(`[data] op=thumb-error path=${a}`)}):(0,_.jsx)(s,{size:28,className:`data-grid-glyph`}),(0,_.jsx)(`span`,{className:`data-grid-label`,title:e.name,children:t}),!i&&(0,_.jsx)(`span`,{className:`data-grid-sub`,children:je(e.sizeBytes)})]})},e.name)}return(0,_.jsx)(`li`,{className:`data-grid-cell`,children:(0,_.jsxs)(`div`,{className:`data-grid-tile data-entry-disabled`,children:[(0,_.jsx)(s,{size:28,className:`data-grid-glyph`}),(0,_.jsx)(`span`,{className:`data-grid-label`,children:t}),(0,_.jsx)(`span`,{className:`data-grid-sub`,children:`special`})]})},e.name)})}),!k&&T&&T.length>0&&E===`list`&&(0,_.jsx)(`ul`,{className:`data-entries`,children:T.map(e=>{let t=e.displayName??e.name;if(e.kind===`directory`){let n=K&&q.has(e.name);return(0,_.jsx)(`li`,{className:`data-entry`,"data-selected":n?`true`:void 0,children:(0,_.jsxs)(`button`,{type:`button`,className:`data-entry-btn`,onPointerDown:()=>Et(e.name),onPointerUp:Q,onPointerMove:Q,onPointerLeave:Q,onPointerCancel:Q,onClick:()=>{if(J.current){J.current=!1;return}if(K){Z(e.name);return}G(w===`.`?e.name:`${w}/${e.name}`)},children:[K&&(0,_.jsx)(`span`,{className:`data-entry-select-indicator`,"aria-hidden":`true`}),(0,_.jsx)(ue,{size:14}),(0,_.jsx)(`span`,{className:`data-entry-name`,title:e.name,children:t})]})},e.name)}if(e.kind===`file`){let n=K&&q.has(e.name);return(0,_.jsx)(`li`,{className:`data-entry`,"data-selected":n?`true`:void 0,children:(0,_.jsxs)(`button`,{type:`button`,className:`data-entry-btn data-entry-file`,onPointerDown:()=>Et(e.name),onPointerUp:Q,onPointerMove:Q,onPointerLeave:Q,onPointerCancel:Q,onClick:()=>Dt(e),title:K?void 0:`Download ${t}`,children:[K&&(0,_.jsx)(`span`,{className:`data-entry-select-indicator`,"aria-hidden":`true`}),(0,_.jsxs)(`span`,{className:`data-entry-text`,children:[(0,_.jsx)(`span`,{className:`data-entry-name`,title:e.name,children:t}),(0,_.jsxs)(`span`,{className:`data-entry-meta`,title:`Modified ${Me(e.modifiedAt)}`,children:[je(e.sizeBytes),` · `,Me(e.modifiedAt)]})]})]})},e.name)}return(0,_.jsx)(`li`,{className:`data-entry`,children:(0,_.jsx)(`div`,{className:`data-entry-btn data-entry-file data-entry-disabled`,children:(0,_.jsxs)(`span`,{className:`data-entry-text`,children:[(0,_.jsx)(`span`,{className:`data-entry-name`,children:t}),(0,_.jsx)(`span`,{className:`data-entry-meta`,children:`special`})]})})},e.name)})})]})]}),K&&(0,_.jsx)(`div`,{className:`data-select-bar`,role:`toolbar`,"aria-label":`Selection actions`,children:(0,_.jsxs)(`div`,{className:`data-select-bar-inner`,children:[(0,_.jsxs)(`button`,{type:`button`,className:`data-select-action`,onClick:Pt,disabled:!Y||q.size===0,title:Y?`Share selected files`:`Sharing is not supported on this device`,children:[(0,_.jsx)(a,{size:16}),` Share`]}),(0,_.jsxs)(`button`,{type:`button`,className:`data-select-action`,onClick:Mt,disabled:q.size===0,children:[(0,_.jsx)(o,{size:16}),` Download`]}),(0,_.jsxs)(`button`,{type:`button`,className:`data-select-action`,onClick:()=>{let e=[...q][0];e&&(R(e),rt(e))},disabled:q.size!==1,children:[(0,_.jsx)(c,{size:16}),` Rename`]}),(0,_.jsxs)(`button`,{type:`button`,className:`data-select-action data-select-delete`,onClick:Nt,disabled:q.size===0,children:[(0,_.jsx)(te,{size:16}),` Delete`]})]})})]}),D&&(0,_.jsx)(`div`,{className:`chat-attachment-overlay`,role:`dialog`,"aria-label":D.alt,onClick:()=>ze(null),children:(0,_.jsx)(`img`,{className:`chat-attachment-overlay-image`,src:D.src,alt:D.alt})})]})}function Oe({hit:e,mode:t,onDownload:n,onLocate:r}){let i=x(e.properties),a=S(e.properties),o=ke(e.labels),s=Ae(e.properties),[c,ee]=(0,g.useState)(!1),l=a&&a.length>280,te=c||!l?a:a?.slice(0,280)+`…`,u=t===`bm25`?`bm25 ${e.bm25Score.toFixed(2)}`:`vector ${e.vectorScore.toFixed(2)} · bm25 ${e.bm25Score.toFixed(2)} · combined ${e.score.toFixed(2)}`,d=e.properties.relativePath,ne=typeof d==`string`&&d.length>0,f=ne?d.lastIndexOf(`/`):-1,p=ne?f===-1?`data`:d.slice(0,f):null;return(0,_.jsxs)(`li`,{className:`data-result`,children:[(0,_.jsxs)(`div`,{role:`button`,tabIndex:0,className:`data-result-open`,onClick:()=>n(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),n(e))},"aria-label":`Download ${i??o??`file`}`,children:[o&&(0,_.jsx)(`div`,{className:`data-result-header`,children:(0,_.jsx)(`span`,{className:`data-result-labels`,children:o})}),i&&(0,_.jsx)(`div`,{className:`data-result-title`,children:i}),a&&(0,_.jsx)(`pre`,{className:`data-result-body`,children:te}),(0,_.jsxs)(`div`,{className:`data-result-scores`,children:[s&&(0,_.jsxs)(`span`,{className:`data-result-updated`,children:[`Updated `,Me(s),` · `]}),u]})]}),ne&&(0,_.jsxs)(`button`,{type:`button`,className:`data-result-locate`,onClick:()=>r(e),title:`Locate in ${p}`,"aria-label":`Locate in ${p}`,children:[(0,_.jsx)(ue,{size:12}),p]}),l&&(0,_.jsx)(`button`,{type:`button`,className:`data-result-toggle`,onClick:()=>ee(e=>!e),children:c?`Show less`:`Show more`})]})}function ke(e){if(e.length===0)return null;let t=e[0].replace(/([a-z])([A-Z])/g,`$1 $2`);return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}function x(e){for(let t of[`title`,`name`,`summary`,`headline`]){let n=e[t];if(typeof n==`string`&&n.length>0)return n.length>140?n.slice(0,140)+`…`:n}return null}function S(e){for(let t of[`content`,`summary`,`body`,`description`,`text`]){let n=e[t];if(typeof n==`string`&&n.length>0)return n}return null}function Ae(e){for(let t of[`updatedAt`,`modifiedAt`,`fetchedAt`,`createdAt`,`lastModified`]){let n=e[t];if(typeof n==`string`&&n.length>0)return n}return null}function je(e){return e==null?``:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/1024/1024).toFixed(1)} MB`:`${(e/1024/1024/1024).toFixed(1)} GB`}function Me(e){try{let t=new Date(e);if(isNaN(t.getTime()))return`—`;let n=typeof navigator<`u`?navigator.languages&&navigator.languages.length>0?[...navigator.languages]:[navigator.language]:void 0;return t.toLocaleString(n,{dateStyle:`medium`,timeStyle:`short`})}catch{return`—`}}(0,h.createRoot)(document.getElementById(`root`)).render((0,_.jsx)(Se,{}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CAM3fms7.js";import{C as t,U as n,V as r}from"./OperatorConversations-Cei12sSK.js";import{n as i,t as a}from"./AdminLoginScreens-Ro_RUTDh.js";import"./admin-types-DJoj6VJv.js";import"./AdminShell-CmqhpAPU.js";import{t as o}from"./page-hG7xTrcO.js";import"./Checkbox-dYLaMEdh.js";var s=r(),c=e(n(),1),l=t();function u(){let e=i(`operator`),t=(0,c.useRef)(null);return(0,c.useEffect)(()=>{e.appState!==`chat`&&t.current!==e.appState&&(t.current=e.appState,console.info(`[operator-ui] op=auth-gate state=${e.appState}`))},[e.appState]),e.appState===`chat`?(0,l.jsx)(o,{variant:`operator`}):(0,l.jsx)(a,{auth:e})}(0,s.createRoot)(document.getElementById(`root`)).render((0,l.jsx)(u,{}));
|