@rubytech/create-realagent-code 0.1.16 → 0.1.17
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__/plugin-install.test.js +105 -0
- package/dist/index.js +133 -0
- package/dist/lib/plugin-install.js +108 -0
- package/package.json +1 -1
- package/payload/platform/config/brand.json +6 -1
- package/payload/platform/plugins/.claude-plugin/marketplace.json +103 -0
- package/payload/platform/plugins/admin/.claude-plugin/plugin.json +17 -0
- package/payload/platform/plugins/anthropic/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/business-assistant/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/cloudflare/.claude-plugin/plugin.json +17 -0
- package/payload/platform/plugins/contacts/.claude-plugin/plugin.json +17 -0
- package/payload/platform/plugins/deep-research/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/docs/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/docs/references/deployment.md +50 -0
- package/payload/platform/plugins/docs/references/platform.md +1 -1
- package/payload/platform/plugins/email/.claude-plugin/plugin.json +17 -0
- package/payload/platform/plugins/linkedin-import/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/memory/.claude-plugin/plugin.json +17 -0
- package/payload/platform/plugins/outlook/.claude-plugin/plugin.json +17 -0
- package/payload/platform/plugins/projects/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/replicate/.claude-plugin/plugin.json +17 -0
- package/payload/platform/plugins/sales/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/scheduling/.claude-plugin/plugin.json +17 -0
- package/payload/platform/plugins/tasks/.claude-plugin/plugin.json +13 -13
- package/payload/platform/plugins/waitlist/.claude-plugin/plugin.json +17 -0
- package/payload/platform/plugins/whatsapp/.claude-plugin/plugin.json +17 -0
- package/payload/platform/plugins/workflows/.claude-plugin/plugin.json +13 -12
- package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/http-server.js +13 -2
- package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts +6 -0
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +9 -3
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
- package/payload/premium-plugins/.claude-plugin/marketplace.json +18 -0
- package/payload/premium-plugins/real-agency/plugins/.claude-plugin/marketplace.json +63 -0
- package/payload/premium-plugins/real-agency/plugins/brochures/.claude-plugin/plugin.json +8 -0
- package/payload/premium-plugins/real-agency/plugins/buyers/.claude-plugin/plugin.json +8 -0
- package/payload/premium-plugins/real-agency/plugins/estate-business/.claude-plugin/plugin.json +8 -0
- package/payload/premium-plugins/real-agency/plugins/estate-coaching/.claude-plugin/plugin.json +8 -0
- package/payload/premium-plugins/real-agency/plugins/estate-onboarding/.claude-plugin/plugin.json +8 -0
- package/payload/premium-plugins/real-agency/plugins/estate-sales/.claude-plugin/plugin.json +8 -0
- package/payload/premium-plugins/real-agency/plugins/estate-teaching/.claude-plugin/plugin.json +8 -0
- package/payload/premium-plugins/real-agency/plugins/leads/.claude-plugin/plugin.json +8 -0
- package/payload/premium-plugins/real-agency/plugins/listings/.claude-plugin/plugin.json +8 -0
- package/payload/premium-plugins/real-agency/plugins/loop/.claude-plugin/plugin.json +17 -0
- package/payload/premium-plugins/real-agency/plugins/vendors/.claude-plugin/plugin.json +8 -0
- package/payload/premium-plugins/teaching/.claude-plugin/plugin.json +8 -0
- package/payload/premium-plugins/writer-craft/.claude-plugin/plugin.json +8 -0
- package/payload/server/public/assets/{Checkbox-YcNN7jq1.js → Checkbox-nrf4ISU0.js} +1 -1
- package/payload/server/public/assets/{admin-B1JZ0uth.js → admin-BctPxbjB.js} +53 -53
- package/payload/server/public/assets/{architectureDiagram-Q4EWVU46-96vgHxqG.js → architectureDiagram-Q4EWVU46-DZI73ap7.js} +1 -1
- package/payload/server/public/assets/{blockDiagram-DXYQGD6D-BdH2Cb_g.js → blockDiagram-DXYQGD6D-BQQz9YNZ.js} +1 -1
- package/payload/server/public/assets/{c4Diagram-AHTNJAMY-N93PeJeZ.js → c4Diagram-AHTNJAMY-gl8-XVLH.js} +1 -1
- package/payload/server/public/assets/channel-BIMyzzFT.js +1 -0
- package/payload/server/public/assets/{chunk-336JU56O--ZhC91-8.js → chunk-336JU56O-839etdKR.js} +2 -2
- package/payload/server/public/assets/{chunk-426QAEUC-NreYOhuj.js → chunk-426QAEUC-hyvaLE5p.js} +1 -1
- package/payload/server/public/assets/{chunk-4TB4RGXK-D8tdHM-B.js → chunk-4TB4RGXK-DEIYWdpd.js} +1 -1
- package/payload/server/public/assets/{chunk-5FUZZQ4R-0x7lCysy.js → chunk-5FUZZQ4R-zWevOyjc.js} +1 -1
- package/payload/server/public/assets/{chunk-5PVQY5BW-B8aFD0v2.js → chunk-5PVQY5BW-CL9KWSZH.js} +1 -1
- package/payload/server/public/assets/{chunk-EDXVE4YY-DcGxS2xv.js → chunk-EDXVE4YY-D91vGp64.js} +1 -1
- package/payload/server/public/assets/{chunk-ENJZ2VHE-CGa-VGZR.js → chunk-ENJZ2VHE-DApK4iuk.js} +1 -1
- package/payload/server/public/assets/{chunk-ICPOFSXX-jOlAtTf8.js → chunk-ICPOFSXX-BOjV-nTe.js} +1 -1
- package/payload/server/public/assets/{chunk-OYMX7WX6-DYDZSTbO.js → chunk-OYMX7WX6-D3Cv5Z_Z.js} +1 -1
- package/payload/server/public/assets/{chunk-U2HBQHQK-CZ-7SbAa.js → chunk-U2HBQHQK-C92E-iRU.js} +1 -1
- package/payload/server/public/assets/{chunk-X2U36JSP-DE9wpb9Q.js → chunk-X2U36JSP-DohG6qWK.js} +1 -1
- package/payload/server/public/assets/{chunk-YZCP3GAM-B6klGA8S.js → chunk-YZCP3GAM-CyeLVSjf.js} +1 -1
- package/payload/server/public/assets/{chunk-ZZ45TVLE-BtC_su1V.js → chunk-ZZ45TVLE-D7R-lONY.js} +1 -1
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-BAfXNwa9.js +1 -0
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-D5bE1GaW.js +1 -0
- package/payload/server/public/assets/clone-DOH_suVb.js +1 -0
- package/payload/server/public/assets/{dagre-DJ6RkHVs.js → dagre-DjhovTZd.js} +1 -1
- package/payload/server/public/assets/{dagre-KV5264BT-BL-5O-QR.js → dagre-KV5264BT-DFeRlQuy.js} +1 -1
- package/payload/server/public/assets/data-DzTaKq-r.js +1 -0
- package/payload/server/public/assets/{device-url-actions-BN_tQerV.js → device-url-actions-CE3A1UDw.js} +1 -1
- package/payload/server/public/assets/{diagram-5BDNPKRD-tmZhEAU-.js → diagram-5BDNPKRD-DsmRGnVL.js} +1 -1
- package/payload/server/public/assets/{diagram-G4DWMVQ6-Cm8Qa00o.js → diagram-G4DWMVQ6-CVSK-mLR.js} +1 -1
- package/payload/server/public/assets/{diagram-MMDJMWI5-gpFqrqSd.js → diagram-MMDJMWI5-DMN94Pe-.js} +1 -1
- package/payload/server/public/assets/{diagram-TYMM5635-Dhui1_oR.js → diagram-TYMM5635-DaD4mLMc.js} +1 -1
- package/payload/server/public/assets/{erDiagram-SMLLAGMA-DVwK_CfW.js → erDiagram-SMLLAGMA-BUkZ2Iq1.js} +1 -1
- package/payload/server/public/assets/{flowDiagram-DWJPFMVM-BElR60Ob.js → flowDiagram-DWJPFMVM-DW8DX_ge.js} +1 -1
- package/payload/server/public/assets/{ganttDiagram-T4ZO3ILL-8NGZhLA3.js → ganttDiagram-T4ZO3ILL-DWaRL6__.js} +1 -1
- package/payload/server/public/assets/{gitGraphDiagram-UUTBAWPF-DGVw9ymM.js → gitGraphDiagram-UUTBAWPF-BaPTFtVx.js} +1 -1
- package/payload/server/public/assets/graph-dgoq2zvY.js +1 -0
- package/payload/server/public/assets/{graph-labels-piCPPdFq.js → graph-labels-BRtJE9AE.js} +1 -1
- package/payload/server/public/assets/{graphlib-uE-sp1ee.js → graphlib-BUhb3hPU.js} +1 -1
- package/payload/server/public/assets/{infoDiagram-42DDH7IO-B-Vuz8L0.js → infoDiagram-42DDH7IO-Ch6CE3GO.js} +1 -1
- package/payload/server/public/assets/{ishikawaDiagram-UXIWVN3A-DlcYgX27.js → ishikawaDiagram-UXIWVN3A-DApFr2KO.js} +1 -1
- package/payload/server/public/assets/{journeyDiagram-VCZTEJTY-C-19XR7D.js → journeyDiagram-VCZTEJTY-D72xl-VA.js} +1 -1
- package/payload/server/public/assets/jsx-runtime-BgXAk35j.css +1 -0
- package/payload/server/public/assets/{kanban-definition-6JOO6SKY-CEsBB-l2.js → kanban-definition-6JOO6SKY-TuAvkCJU.js} +1 -1
- package/payload/server/public/assets/{line-B_WJJGNO.js → line-Cr3lHgh8.js} +1 -1
- package/payload/server/public/assets/{mermaid-parser.core-DHnCk5T5.js → mermaid-parser.core-BvbEd4_6.js} +1 -1
- package/payload/server/public/assets/{mermaid.core-DhZqC4uG.js → mermaid.core-CSIEcw1L.js} +3 -3
- package/payload/server/public/assets/{mindmap-definition-QFDTVHPH-B2tHowcI.js → mindmap-definition-QFDTVHPH-CNLvqgk-.js} +1 -1
- package/payload/server/public/assets/{page-CjxybpTy.js → page-B_80xGrM.js} +1 -1
- package/payload/server/public/assets/{page-CBA4FUGo.js → page-BcnqM490.js} +1 -1
- package/payload/server/public/assets/{pieDiagram-DEJITSTG-xopsRxKN.js → pieDiagram-DEJITSTG-CSOsdFn6.js} +1 -1
- package/payload/server/public/assets/{public-BBqroGXK.js → public-DGrCAqZN.js} +3 -3
- package/payload/server/public/assets/{quadrantDiagram-34T5L4WZ-B19ZbtY0.js → quadrantDiagram-34T5L4WZ-Bsxz9S58.js} +1 -1
- package/payload/server/public/assets/{requirementDiagram-MS252O5E-BMcM9iam.js → requirementDiagram-MS252O5E-BZRrlQlh.js} +1 -1
- package/payload/server/public/assets/{sankeyDiagram-XADWPNL6-DW5Hs7Av.js → sankeyDiagram-XADWPNL6-C-W-Az7g.js} +1 -1
- package/payload/server/public/assets/{sequenceDiagram-FGHM5R23-Cn7z1Q3s.js → sequenceDiagram-FGHM5R23-DCZPAj4-.js} +1 -1
- package/payload/server/public/assets/{stateDiagram-FHFEXIEX-DR7At7js.js → stateDiagram-FHFEXIEX-C3wODMGb.js} +1 -1
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-Ch6qbhpm.js +1 -0
- package/payload/server/public/assets/{timeline-definition-GMOUNBTQ-Bm8JLRpB.js → timeline-definition-GMOUNBTQ-TRzSKinM.js} +1 -1
- package/payload/server/public/assets/{vennDiagram-DHZGUBPP-6XqALjnd.js → vennDiagram-DHZGUBPP-DSKZVM8N.js} +1 -1
- package/payload/server/public/assets/{wardleyDiagram-NUSXRM2D-DhdYZjeI.js → wardleyDiagram-NUSXRM2D-BRXL08eb.js} +1 -1
- package/payload/server/public/assets/{xychartDiagram-5P7HB3ND-CBmEo9Oi.js → xychartDiagram-5P7HB3ND-CgWMOf0l.js} +1 -1
- package/payload/server/public/data.html +5 -5
- package/payload/server/public/graph.html +6 -6
- package/payload/server/public/index.html +8 -8
- package/payload/server/public/public.html +5 -5
- package/payload/server/public/assets/channel-TAr3X5oz.js +0 -1
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-DjmusLvy.js +0 -1
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-TIJEjUyl.js +0 -1
- package/payload/server/public/assets/clone-O8K8fxhJ.js +0 -1
- package/payload/server/public/assets/data-DcMPzQFt.js +0 -1
- package/payload/server/public/assets/graph-oLjrPnCQ.js +0 -1
- package/payload/server/public/assets/jsx-runtime-jZDyLD_2.css +0 -1
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-CvqZ4uTP.js +0 -1
- /package/payload/server/public/assets/{jsx-runtime-HrrfyPcI.js → jsx-runtime-Bz7aoCi7.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-DD-I1_y5.js";import{n as t,o as n,r,t as i}from"./jsx-runtime-HrrfyPcI.js";import{a,c as o,d as s,f as c,l,o as u,s as d,t as f,u as p}from"./graph-labels-piCPPdFq.js";var m=r(`circle-arrow-up`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 12-4-4-4 4`,key:`177agl`}],[`path`,{d:`M12 16V8`,key:`1sbj14`}]]),h=r(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),g=r(`file`,[[`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`}]]),_=r(`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`}]]),v=r(`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`}]]);function y(e){let t=new Set,n=[];for(let r of e)for(let e of r.labels)e&&(t.has(e)||f.has(e)&&(t.add(e),n.push(e)));return n}var b=80;function x(e){let t=S(e.properties)??e.labels[0]??``,n=t.length>b?t.slice(0,b):t;return`/graph?${new URLSearchParams({nodeId:e.nodeId,label:n}).toString()}`}function S(e){for(let t of[`title`,`name`,`summary`,`headline`]){let n=e[t];if(typeof n==`string`&&n.length>0)return n}return null}var C=e(n(),1),w=i();function T(){let[e,t]=(0,C.useState)(null),[n,r]=(0,C.useState)(!1);return(0,C.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem(`maxy-admin-session-key`)}catch{}if(!n){t(null),r(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(i=>{if(!e){if(i.status===401){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`;return}t(n),r(!0)}}).catch(()=>{e||(t(n),r(!0))}),()=>{e=!0}},[]),n?e?(0,w.jsxs)(`div`,{className:`data-page`,children:[(0,w.jsxs)(`header`,{className:`data-header`,children:[(0,w.jsxs)(`h1`,{className:`data-title`,children:[(0,w.jsx)(c,{size:18}),` Data`]}),(0,w.jsx)(D,{})]}),(0,w.jsx)(E,{cacheKey:e})]}):(0,w.jsxs)(`div`,{className:`data-page`,children:[(0,w.jsx)(`header`,{className:`data-header`,children:(0,w.jsxs)(`h1`,{className:`data-title`,children:[(0,w.jsx)(c,{size:18}),` Data`]})}),(0,w.jsxs)(`div`,{className:`data-empty`,children:[(0,w.jsx)(`p`,{children:`You are not signed in.`}),(0,w.jsxs)(`p`,{children:[`Open the `,(0,w.jsx)(`a`,{href:`/`,className:`data-link`,children:`main admin page`}),` and log in, then return here.`]})]})]}):(0,w.jsx)(`div`,{className:`data-page`,children:(0,w.jsxs)(`div`,{className:`data-loading`,children:[(0,w.jsx)(p,{size:18,className:`spin`}),` Loading…`]})})}function E({cacheKey:e,onOpenInGraph:t}){let{adminFetch:n,cacheKey:r,sessionRefetchNonce:i,banner:o,reloadToLogin:s}=a({initialCacheKey:e,surface:`data`});return(0,w.jsxs)(`main`,{className:`data-main`,children:[o&&(0,w.jsx)(`button`,{type:`button`,className:`data-session-banner`,onClick:s,"data-reason":o.reason,children:o.message}),(0,w.jsx)(O,{adminFetch:n,sessionRefetchNonce:i,onOpenInGraph:t}),(0,w.jsx)(N,{adminFetch:n,cacheKey:r,sessionRefetchNonce:i})]})}function D(){let[e,t]=(0,C.useState)(!1),n=(0,C.useRef)(null);(0,C.useEffect)(()=>{if(!e)return;let r=e=>{n.current&&(n.current.contains(e.target)||t(!1))},i=e=>{e.key===`Escape`&&t(!1)};return document.addEventListener(`mousedown`,r),document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`mousedown`,r),document.removeEventListener(`keydown`,i)}},[e]);let r=(0,C.useCallback)(()=>{try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},[]);return(0,w.jsxs)(`div`,{className:`chat-burger-wrap`,ref:n,children:[(0,w.jsx)(`button`,{type:`button`,className:`chat-burger`,onClick:()=>t(e=>!e),"aria-label":`Menu`,"aria-haspopup":`true`,"aria-expanded":e,children:(0,w.jsx)(o,{size:20})}),e&&(0,w.jsxs)(`div`,{className:`chat-menu`,children:[(0,w.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,onClick:()=>{t(!1),window.location.href=`/`},children:[(0,w.jsx)(s,{size:14}),` Chat`]}),(0,w.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,onClick:()=>{t(!1),window.location.href=`/graph`},children:[(0,w.jsx)(u,{size:14}),` Graph`]}),(0,w.jsx)(`div`,{className:`chat-menu-divider`}),(0,w.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,onClick:()=>{t(!1),r()},children:[(0,w.jsx)(l,{size:14}),` Log out`]})]})]})}function O({adminFetch:e,sessionRefetchNonce:t,onOpenInGraph:n}){let[r,i]=(0,C.useState)(``),[a,o]=(0,C.useState)(``),[s,c]=(0,C.useState)(null),[l,u]=(0,C.useState)(`hybrid`),[f,m]=(0,C.useState)(!1),[h,g]=(0,C.useState)(null),[_,v]=(0,C.useState)(null),[b,S]=(0,C.useState)(0),[T,E]=(0,C.useState)(!1);(0,C.useEffect)(()=>{let e=r.trim();if(!e){o(``),c(null);return}E(!1);let t=setTimeout(()=>o(e),300);return()=>clearTimeout(t)},[r]),(0,C.useEffect)(()=>{if(!a)return;let t=!1;return m(!0),g(null),e(`/api/admin/graph-search?q=${encodeURIComponent(a)}&labels=*&limit=20${T?`&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||(c(e.results),u(e.mode??`hybrid`),S(typeof e.suppressed==`number`?e.suppressed:0))}).catch(e=>{t||g(e instanceof Error?e.message:String(e))}).finally(()=>{t||m(!1)}),()=>{t=!0}},[a,e,t,T]);let D=(0,C.useMemo)(()=>s?y(s):[],[s]),O=_&&D.includes(_)?_:null,j=(0,C.useMemo)(()=>s?O?s.filter(e=>e.labels.includes(O)):s:null,[s,O]),M=(0,C.useCallback)(e=>{if(n){n(e);return}window.location.href=x(e)},[n]);return(0,w.jsxs)(`section`,{className:`data-panel`,children:[(0,w.jsx)(`h2`,{className:`data-panel-title`,children:`Search`}),(0,w.jsx)(`p`,{className:`data-panel-subtitle`,children:`Find anything in your knowledge base by keyword.`}),(0,w.jsxs)(`div`,{className:`data-search-input`,children:[(0,w.jsx)(d,{size:14}),(0,w.jsx)(`input`,{type:`text`,placeholder:`Search your knowledge…`,value:r,onChange:e=>i(e.target.value),autoFocus:!0,autoComplete:`off`,spellCheck:!1}),f&&(0,w.jsx)(p,{size:14,className:`spin`})]}),h&&(0,w.jsxs)(`div`,{className:`data-error`,children:[`Search failed: `,h]}),D.length>0&&(0,w.jsx)(`div`,{className:`data-chip-row`,role:`group`,"aria-label":`Filter by type`,children:D.map(e=>{let t=e===O;return(0,w.jsx)(`button`,{type:`button`,className:`data-chip`,"data-active":t,onClick:()=>v(t?null:e),children:A([e])??e},e)})}),s&&!f&&(0,w.jsxs)(`div`,{className:`data-results-meta`,children:[j.length,` of `,s.length,` result`,s.length===1?``:`s`]}),s&&!f&&!O&&b>0&&!T&&(0,w.jsxs)(`button`,{type:`button`,className:`data-suppressed-banner`,onClick:()=>E(!0),children:[b,` low-confidence result`,b===1?``:`s`,` hidden — show all`]}),s&&!f&&!O&&T&&(0,w.jsx)(`button`,{type:`button`,className:`data-suppressed-banner`,onClick:()=>E(!1),children:`Showing all results — hide low-confidence`}),s&&s.length===0&&!f&&(0,w.jsx)(`div`,{className:`data-empty-results`,children:`No matches. Try a different keyword.`}),j&&j.length>0&&(0,w.jsx)(`ul`,{className:`data-results`,children:j.map(e=>(0,w.jsx)(k,{hit:e,mode:l,onOpenInGraph:M},e.nodeId))})]})}function k({hit:e,mode:t,onOpenInGraph:n}){let r=j(e.properties),i=M(e.properties),a=A(e.labels),[o,s]=(0,C.useState)(!1),c=i&&i.length>280,l=o||!c?i:i?.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)}`;return(0,w.jsxs)(`li`,{className:`data-result`,children:[(0,w.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":`Open ${r??a??`node`} in graph`,children:[a&&(0,w.jsx)(`div`,{className:`data-result-header`,children:(0,w.jsx)(`span`,{className:`data-result-labels`,children:a})}),r&&(0,w.jsx)(`div`,{className:`data-result-title`,children:r}),i&&(0,w.jsx)(`pre`,{className:`data-result-body`,children:l}),(0,w.jsx)(`div`,{className:`data-result-scores`,children:u})]}),c&&(0,w.jsx)(`button`,{type:`button`,className:`data-result-toggle`,onClick:()=>s(e=>!e),children:o?`Show less`:`Show more`})]})}function A(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 j(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 M(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 N({adminFetch:e,cacheKey:n,sessionRefetchNonce:r}){let[i,a]=(0,C.useState)(`.`),[o,s]=(0,C.useState)(null),[c,l]=(0,C.useState)([]),[u,d]=(0,C.useState)(!1),[f,y]=(0,C.useState)(null),[b,x]=(0,C.useState)(!1),[S,T]=(0,C.useState)(null),[E,D]=(0,C.useState)(null),[O,k]=(0,C.useState)(null),[A,j]=(0,C.useState)(null),M=(0,C.useRef)(null),[N,I]=(0,C.useState)(0);(0,C.useEffect)(()=>{let t=!1;return d(!0),y(null),e(`/api/admin/files?path=${encodeURIComponent(i===`.`?``:i)}`).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||(s(e.entries),l(e.displayPath??[]))}).catch(e=>{t||(s([]),l([]),y(e instanceof Error?e.message:String(e)))}).finally(()=>{t||d(!1)}),()=>{t=!0}},[e,i,N,r]);let L=(0,C.useCallback)(e=>{a(e)},[]),R=(0,C.useCallback)(()=>{if(i===`.`||i===``)return;let e=i.split(`/`).filter(Boolean);e.pop(),a(e.length===0?`.`:e.join(`/`))},[i]),z=(0,C.useCallback)(e=>{let t=i===`.`?e.name:`${i}/${e.name}`,r=`/api/admin/files/download?session_key=${encodeURIComponent(n)}&path=${encodeURIComponent(t)}`,a=document.createElement(`a`);a.href=r,a.rel=`noopener noreferrer`,document.body.appendChild(a),a.click(),a.remove()},[i,n]),B=(0,C.useCallback)(()=>{M.current?.click()},[]),V=(0,C.useCallback)(e=>{D(null),j(e.name)},[]),H=(0,C.useCallback)(()=>{j(null)},[]),U=(0,C.useCallback)(async t=>{let n=i===`.`?t.name:`${i}/${t.name}`;D(null),j(null),k(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}`);I(e=>e+1)}catch(e){D(e instanceof Error?e.message:String(e))}finally{k(null)}},[i,e]);(0,C.useEffect)(()=>{if(!A)return;let e=e=>{e.key===`Escape`&&j(null)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[A]);let W=(0,C.useCallback)(async e=>{T(null),x(!0);try{let t=new FormData;t.append(`session_key`,n),t.append(`file`,e);let r=await fetch(`/api/admin/files/upload`,{method:`POST`,body:t}),i=await r.json().catch(()=>({error:`HTTP ${r.status}`}));if(!r.ok)throw Error(i.error??`HTTP ${r.status}`);a(i.path.split(`/`).slice(0,-1).join(`/`)||`.`),I(e=>e+1)}catch(e){T(e instanceof Error?e.message:String(e))}finally{x(!1),M.current&&(M.current.value=``)}},[n]);return(0,w.jsxs)(`section`,{className:`data-panel`,children:[(0,w.jsxs)(`div`,{className:`data-panel-heading`,children:[(0,w.jsx)(`h2`,{className:`data-panel-title`,children:`Files`}),(0,w.jsxs)(`div`,{className:`data-file-actions`,children:[(0,w.jsxs)(`button`,{type:`button`,className:`data-btn`,onClick:B,disabled:b,children:[b?(0,w.jsx)(p,{size:14,className:`spin`}):(0,w.jsx)(v,{size:14}),` Upload`]}),(0,w.jsx)(`input`,{type:`file`,ref:M,hidden:!0,onChange:e=>{let t=e.target.files?.[0];t&&W(t)}})]})]}),(0,w.jsxs)(`p`,{className:`data-panel-subtitle`,children:[`Everything under your install's `,(0,w.jsx)(`code`,{children:`data/`}),` directory. Click a folder to open it, a file to download it. Uploads go to `,(0,w.jsx)(`code`,{children:`data/uploads/`}),`.`]}),(0,w.jsxs)(`div`,{className:`data-breadcrumbs`,children:[(0,w.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>L(`.`),children:`data`}),c.map((e,t)=>{let n=c.slice(0,t+1).map(e=>e.name).join(`/`);return(0,w.jsxs)(`span`,{className:`data-crumb-wrap`,children:[(0,w.jsx)(`span`,{className:`data-crumb-sep`,children:`/`}),(0,w.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>L(n),title:e.name,children:e.displayName??e.name})]},n)}),i!==`.`&&(0,w.jsxs)(`button`,{type:`button`,className:`data-btn data-btn-ghost data-up-btn`,onClick:R,children:[(0,w.jsx)(m,{size:14}),` Up`]})]}),S&&(0,w.jsxs)(`div`,{className:`data-error`,children:[`Upload failed: `,S]}),E&&(0,w.jsxs)(`div`,{className:`data-error`,children:[`Delete failed: `,E]}),f&&(0,w.jsx)(`div`,{className:`data-error`,children:f}),u&&(0,w.jsxs)(`div`,{className:`data-loading`,children:[(0,w.jsx)(p,{size:14,className:`spin`}),` Loading…`]}),!u&&o&&o.length===0&&!f&&(0,w.jsx)(`div`,{className:`data-empty-results`,children:`Empty directory.`}),!u&&o&&o.length>0&&(0,w.jsx)(`ul`,{className:`data-entries`,children:o.map(e=>{let n=e.displayName??e.name,r=O===e.name,a=A===e.name;return(0,w.jsx)(`li`,{className:`data-entry`,children:e.kind===`directory`?(0,w.jsxs)(`button`,{type:`button`,className:`data-entry-btn`,onClick:()=>L(i===`.`?e.name:`${i}/${e.name}`),children:[(0,w.jsx)(_,{size:14}),(0,w.jsx)(`span`,{className:`data-entry-name`,title:e.name,children:n})]}):e.kind===`file`?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`button`,{type:`button`,className:`data-entry-btn`,onClick:()=>z(e),title:`Download ${n}`,disabled:a,children:[(0,w.jsx)(g,{size:14}),(0,w.jsx)(`span`,{className:`data-entry-name`,title:e.name,children:n}),(0,w.jsxs)(`span`,{className:`data-entry-meta`,title:`Modified ${F(e.modifiedAt)}`,children:[P(e.sizeBytes),` · `,F(e.modifiedAt)]}),(0,w.jsx)(h,{size:12,className:`data-entry-download-icon`})]}),a?(0,w.jsxs)(`div`,{className:`data-entry-confirm`,role:`group`,"aria-label":`Confirm delete ${n}`,children:[(0,w.jsx)(`span`,{className:`data-entry-confirm-label`,children:`Delete?`}),(0,w.jsx)(`button`,{type:`button`,className:`data-entry-confirm-yes`,onClick:()=>U(e),autoFocus:!0,children:`Yes`}),(0,w.jsx)(`button`,{type:`button`,className:`data-entry-confirm-no`,onClick:H,children:`No`})]}):(0,w.jsx)(`button`,{type:`button`,className:`data-entry-delete`,onClick:()=>V(e),disabled:r,title:`Delete ${n}`,"aria-label":`Delete ${n}`,children:r?(0,w.jsx)(p,{size:14,className:`spin`}):(0,w.jsx)(t,{size:14})})]}):(0,w.jsxs)(`div`,{className:`data-entry-btn data-entry-disabled`,children:[(0,w.jsx)(g,{size:14}),(0,w.jsx)(`span`,{className:`data-entry-name`,children:n}),(0,w.jsx)(`span`,{className:`data-entry-meta`,children:`special`})]})},e.name)})})]})}function P(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 F(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`—`}}export{h as i,E as n,S as r,T as t};
|
|
1
|
+
import{o as e}from"./chunk-DD-I1_y5.js";import{n as t,o as n,r,t as i}from"./jsx-runtime-Bz7aoCi7.js";import{a,c as o,d as s,f as c,l,o as u,s as d,t as f,u as p}from"./graph-labels-BRtJE9AE.js";var m=r(`circle-arrow-up`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 12-4-4-4 4`,key:`177agl`}],[`path`,{d:`M12 16V8`,key:`1sbj14`}]]),h=r(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),g=r(`file`,[[`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`}]]),_=r(`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`}]]),v=r(`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`}]]);function y(e){let t=new Set,n=[];for(let r of e)for(let e of r.labels)e&&(t.has(e)||f.has(e)&&(t.add(e),n.push(e)));return n}var b=80;function x(e){let t=S(e.properties)??e.labels[0]??``,n=t.length>b?t.slice(0,b):t;return`/graph?${new URLSearchParams({nodeId:e.nodeId,label:n}).toString()}`}function S(e){for(let t of[`title`,`name`,`summary`,`headline`]){let n=e[t];if(typeof n==`string`&&n.length>0)return n}return null}var C=e(n(),1),w=i();function T(){let[e,t]=(0,C.useState)(null),[n,r]=(0,C.useState)(!1);return(0,C.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem(`maxy-admin-session-key`)}catch{}if(!n){t(null),r(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(i=>{if(!e){if(i.status===401){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`;return}t(n),r(!0)}}).catch(()=>{e||(t(n),r(!0))}),()=>{e=!0}},[]),n?e?(0,w.jsxs)(`div`,{className:`data-page`,children:[(0,w.jsxs)(`header`,{className:`data-header`,children:[(0,w.jsxs)(`h1`,{className:`data-title`,children:[(0,w.jsx)(c,{size:18}),` Data`]}),(0,w.jsx)(D,{})]}),(0,w.jsx)(E,{cacheKey:e})]}):(0,w.jsxs)(`div`,{className:`data-page`,children:[(0,w.jsx)(`header`,{className:`data-header`,children:(0,w.jsxs)(`h1`,{className:`data-title`,children:[(0,w.jsx)(c,{size:18}),` Data`]})}),(0,w.jsxs)(`div`,{className:`data-empty`,children:[(0,w.jsx)(`p`,{children:`You are not signed in.`}),(0,w.jsxs)(`p`,{children:[`Open the `,(0,w.jsx)(`a`,{href:`/`,className:`data-link`,children:`main admin page`}),` and log in, then return here.`]})]})]}):(0,w.jsx)(`div`,{className:`data-page`,children:(0,w.jsxs)(`div`,{className:`data-loading`,children:[(0,w.jsx)(p,{size:18,className:`spin`}),` Loading…`]})})}function E({cacheKey:e,onOpenInGraph:t}){let{adminFetch:n,cacheKey:r,sessionRefetchNonce:i,banner:o,reloadToLogin:s}=a({initialCacheKey:e,surface:`data`});return(0,w.jsxs)(`main`,{className:`data-main`,children:[o&&(0,w.jsx)(`button`,{type:`button`,className:`data-session-banner`,onClick:s,"data-reason":o.reason,children:o.message}),(0,w.jsx)(O,{adminFetch:n,sessionRefetchNonce:i,onOpenInGraph:t}),(0,w.jsx)(N,{adminFetch:n,cacheKey:r,sessionRefetchNonce:i})]})}function D(){let[e,t]=(0,C.useState)(!1),n=(0,C.useRef)(null);(0,C.useEffect)(()=>{if(!e)return;let r=e=>{n.current&&(n.current.contains(e.target)||t(!1))},i=e=>{e.key===`Escape`&&t(!1)};return document.addEventListener(`mousedown`,r),document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`mousedown`,r),document.removeEventListener(`keydown`,i)}},[e]);let r=(0,C.useCallback)(()=>{try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},[]);return(0,w.jsxs)(`div`,{className:`chat-burger-wrap`,ref:n,children:[(0,w.jsx)(`button`,{type:`button`,className:`chat-burger`,onClick:()=>t(e=>!e),"aria-label":`Menu`,"aria-haspopup":`true`,"aria-expanded":e,children:(0,w.jsx)(o,{size:20})}),e&&(0,w.jsxs)(`div`,{className:`chat-menu`,children:[(0,w.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,onClick:()=>{t(!1),window.location.href=`/`},children:[(0,w.jsx)(s,{size:14}),` Chat`]}),(0,w.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,onClick:()=>{t(!1),window.location.href=`/graph`},children:[(0,w.jsx)(u,{size:14}),` Graph`]}),(0,w.jsx)(`div`,{className:`chat-menu-divider`}),(0,w.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,onClick:()=>{t(!1),r()},children:[(0,w.jsx)(l,{size:14}),` Log out`]})]})]})}function O({adminFetch:e,sessionRefetchNonce:t,onOpenInGraph:n}){let[r,i]=(0,C.useState)(``),[a,o]=(0,C.useState)(``),[s,c]=(0,C.useState)(null),[l,u]=(0,C.useState)(`hybrid`),[f,m]=(0,C.useState)(!1),[h,g]=(0,C.useState)(null),[_,v]=(0,C.useState)(null),[b,S]=(0,C.useState)(0),[T,E]=(0,C.useState)(!1);(0,C.useEffect)(()=>{let e=r.trim();if(!e){o(``),c(null);return}E(!1);let t=setTimeout(()=>o(e),300);return()=>clearTimeout(t)},[r]),(0,C.useEffect)(()=>{if(!a)return;let t=!1;return m(!0),g(null),e(`/api/admin/graph-search?q=${encodeURIComponent(a)}&labels=*&limit=20${T?`&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||(c(e.results),u(e.mode??`hybrid`),S(typeof e.suppressed==`number`?e.suppressed:0))}).catch(e=>{t||g(e instanceof Error?e.message:String(e))}).finally(()=>{t||m(!1)}),()=>{t=!0}},[a,e,t,T]);let D=(0,C.useMemo)(()=>s?y(s):[],[s]),O=_&&D.includes(_)?_:null,j=(0,C.useMemo)(()=>s?O?s.filter(e=>e.labels.includes(O)):s:null,[s,O]),M=(0,C.useCallback)(e=>{if(n){n(e);return}window.location.href=x(e)},[n]);return(0,w.jsxs)(`section`,{className:`data-panel`,children:[(0,w.jsx)(`h2`,{className:`data-panel-title`,children:`Search`}),(0,w.jsx)(`p`,{className:`data-panel-subtitle`,children:`Find anything in your knowledge base by keyword.`}),(0,w.jsxs)(`div`,{className:`data-search-input`,children:[(0,w.jsx)(d,{size:14}),(0,w.jsx)(`input`,{type:`text`,placeholder:`Search your knowledge…`,value:r,onChange:e=>i(e.target.value),autoFocus:!0,autoComplete:`off`,spellCheck:!1}),f&&(0,w.jsx)(p,{size:14,className:`spin`})]}),h&&(0,w.jsxs)(`div`,{className:`data-error`,children:[`Search failed: `,h]}),D.length>0&&(0,w.jsx)(`div`,{className:`data-chip-row`,role:`group`,"aria-label":`Filter by type`,children:D.map(e=>{let t=e===O;return(0,w.jsx)(`button`,{type:`button`,className:`data-chip`,"data-active":t,onClick:()=>v(t?null:e),children:A([e])??e},e)})}),s&&!f&&(0,w.jsxs)(`div`,{className:`data-results-meta`,children:[j.length,` of `,s.length,` result`,s.length===1?``:`s`]}),s&&!f&&!O&&b>0&&!T&&(0,w.jsxs)(`button`,{type:`button`,className:`data-suppressed-banner`,onClick:()=>E(!0),children:[b,` low-confidence result`,b===1?``:`s`,` hidden — show all`]}),s&&!f&&!O&&T&&(0,w.jsx)(`button`,{type:`button`,className:`data-suppressed-banner`,onClick:()=>E(!1),children:`Showing all results — hide low-confidence`}),s&&s.length===0&&!f&&(0,w.jsx)(`div`,{className:`data-empty-results`,children:`No matches. Try a different keyword.`}),j&&j.length>0&&(0,w.jsx)(`ul`,{className:`data-results`,children:j.map(e=>(0,w.jsx)(k,{hit:e,mode:l,onOpenInGraph:M},e.nodeId))})]})}function k({hit:e,mode:t,onOpenInGraph:n}){let r=j(e.properties),i=M(e.properties),a=A(e.labels),[o,s]=(0,C.useState)(!1),c=i&&i.length>280,l=o||!c?i:i?.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)}`;return(0,w.jsxs)(`li`,{className:`data-result`,children:[(0,w.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":`Open ${r??a??`node`} in graph`,children:[a&&(0,w.jsx)(`div`,{className:`data-result-header`,children:(0,w.jsx)(`span`,{className:`data-result-labels`,children:a})}),r&&(0,w.jsx)(`div`,{className:`data-result-title`,children:r}),i&&(0,w.jsx)(`pre`,{className:`data-result-body`,children:l}),(0,w.jsx)(`div`,{className:`data-result-scores`,children:u})]}),c&&(0,w.jsx)(`button`,{type:`button`,className:`data-result-toggle`,onClick:()=>s(e=>!e),children:o?`Show less`:`Show more`})]})}function A(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 j(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 M(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 N({adminFetch:e,cacheKey:n,sessionRefetchNonce:r}){let[i,a]=(0,C.useState)(`.`),[o,s]=(0,C.useState)(null),[c,l]=(0,C.useState)([]),[u,d]=(0,C.useState)(!1),[f,y]=(0,C.useState)(null),[b,x]=(0,C.useState)(!1),[S,T]=(0,C.useState)(null),[E,D]=(0,C.useState)(null),[O,k]=(0,C.useState)(null),[A,j]=(0,C.useState)(null),M=(0,C.useRef)(null),[N,I]=(0,C.useState)(0);(0,C.useEffect)(()=>{let t=!1;return d(!0),y(null),e(`/api/admin/files?path=${encodeURIComponent(i===`.`?``:i)}`).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||(s(e.entries),l(e.displayPath??[]))}).catch(e=>{t||(s([]),l([]),y(e instanceof Error?e.message:String(e)))}).finally(()=>{t||d(!1)}),()=>{t=!0}},[e,i,N,r]);let L=(0,C.useCallback)(e=>{a(e)},[]),R=(0,C.useCallback)(()=>{if(i===`.`||i===``)return;let e=i.split(`/`).filter(Boolean);e.pop(),a(e.length===0?`.`:e.join(`/`))},[i]),z=(0,C.useCallback)(e=>{let t=i===`.`?e.name:`${i}/${e.name}`,r=`/api/admin/files/download?session_key=${encodeURIComponent(n)}&path=${encodeURIComponent(t)}`,a=document.createElement(`a`);a.href=r,a.rel=`noopener noreferrer`,document.body.appendChild(a),a.click(),a.remove()},[i,n]),B=(0,C.useCallback)(()=>{M.current?.click()},[]),V=(0,C.useCallback)(e=>{D(null),j(e.name)},[]),H=(0,C.useCallback)(()=>{j(null)},[]),U=(0,C.useCallback)(async t=>{let n=i===`.`?t.name:`${i}/${t.name}`;D(null),j(null),k(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}`);I(e=>e+1)}catch(e){D(e instanceof Error?e.message:String(e))}finally{k(null)}},[i,e]);(0,C.useEffect)(()=>{if(!A)return;let e=e=>{e.key===`Escape`&&j(null)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[A]);let W=(0,C.useCallback)(async e=>{T(null),x(!0);try{let t=new FormData;t.append(`session_key`,n),t.append(`file`,e);let r=await fetch(`/api/admin/files/upload`,{method:`POST`,body:t}),i=await r.json().catch(()=>({error:`HTTP ${r.status}`}));if(!r.ok)throw Error(i.error??`HTTP ${r.status}`);a(i.path.split(`/`).slice(0,-1).join(`/`)||`.`),I(e=>e+1)}catch(e){T(e instanceof Error?e.message:String(e))}finally{x(!1),M.current&&(M.current.value=``)}},[n]);return(0,w.jsxs)(`section`,{className:`data-panel`,children:[(0,w.jsxs)(`div`,{className:`data-panel-heading`,children:[(0,w.jsx)(`h2`,{className:`data-panel-title`,children:`Files`}),(0,w.jsxs)(`div`,{className:`data-file-actions`,children:[(0,w.jsxs)(`button`,{type:`button`,className:`data-btn`,onClick:B,disabled:b,children:[b?(0,w.jsx)(p,{size:14,className:`spin`}):(0,w.jsx)(v,{size:14}),` Upload`]}),(0,w.jsx)(`input`,{type:`file`,ref:M,hidden:!0,onChange:e=>{let t=e.target.files?.[0];t&&W(t)}})]})]}),(0,w.jsxs)(`p`,{className:`data-panel-subtitle`,children:[`Everything under your install's `,(0,w.jsx)(`code`,{children:`data/`}),` directory. Click a folder to open it, a file to download it. Uploads go to `,(0,w.jsx)(`code`,{children:`data/uploads/`}),`.`]}),(0,w.jsxs)(`div`,{className:`data-breadcrumbs`,children:[(0,w.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>L(`.`),children:`data`}),c.map((e,t)=>{let n=c.slice(0,t+1).map(e=>e.name).join(`/`);return(0,w.jsxs)(`span`,{className:`data-crumb-wrap`,children:[(0,w.jsx)(`span`,{className:`data-crumb-sep`,children:`/`}),(0,w.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>L(n),title:e.name,children:e.displayName??e.name})]},n)}),i!==`.`&&(0,w.jsxs)(`button`,{type:`button`,className:`data-btn data-btn-ghost data-up-btn`,onClick:R,children:[(0,w.jsx)(m,{size:14}),` Up`]})]}),S&&(0,w.jsxs)(`div`,{className:`data-error`,children:[`Upload failed: `,S]}),E&&(0,w.jsxs)(`div`,{className:`data-error`,children:[`Delete failed: `,E]}),f&&(0,w.jsx)(`div`,{className:`data-error`,children:f}),u&&(0,w.jsxs)(`div`,{className:`data-loading`,children:[(0,w.jsx)(p,{size:14,className:`spin`}),` Loading…`]}),!u&&o&&o.length===0&&!f&&(0,w.jsx)(`div`,{className:`data-empty-results`,children:`Empty directory.`}),!u&&o&&o.length>0&&(0,w.jsx)(`ul`,{className:`data-entries`,children:o.map(e=>{let n=e.displayName??e.name,r=O===e.name,a=A===e.name;return(0,w.jsx)(`li`,{className:`data-entry`,children:e.kind===`directory`?(0,w.jsxs)(`button`,{type:`button`,className:`data-entry-btn`,onClick:()=>L(i===`.`?e.name:`${i}/${e.name}`),children:[(0,w.jsx)(_,{size:14}),(0,w.jsx)(`span`,{className:`data-entry-name`,title:e.name,children:n})]}):e.kind===`file`?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`button`,{type:`button`,className:`data-entry-btn`,onClick:()=>z(e),title:`Download ${n}`,disabled:a,children:[(0,w.jsx)(g,{size:14}),(0,w.jsx)(`span`,{className:`data-entry-name`,title:e.name,children:n}),(0,w.jsxs)(`span`,{className:`data-entry-meta`,title:`Modified ${F(e.modifiedAt)}`,children:[P(e.sizeBytes),` · `,F(e.modifiedAt)]}),(0,w.jsx)(h,{size:12,className:`data-entry-download-icon`})]}),a?(0,w.jsxs)(`div`,{className:`data-entry-confirm`,role:`group`,"aria-label":`Confirm delete ${n}`,children:[(0,w.jsx)(`span`,{className:`data-entry-confirm-label`,children:`Delete?`}),(0,w.jsx)(`button`,{type:`button`,className:`data-entry-confirm-yes`,onClick:()=>U(e),autoFocus:!0,children:`Yes`}),(0,w.jsx)(`button`,{type:`button`,className:`data-entry-confirm-no`,onClick:H,children:`No`})]}):(0,w.jsx)(`button`,{type:`button`,className:`data-entry-delete`,onClick:()=>V(e),disabled:r,title:`Delete ${n}`,"aria-label":`Delete ${n}`,children:r?(0,w.jsx)(p,{size:14,className:`spin`}):(0,w.jsx)(t,{size:14})})]}):(0,w.jsxs)(`div`,{className:`data-entry-btn data-entry-disabled`,children:[(0,w.jsx)(g,{size:14}),(0,w.jsx)(`span`,{className:`data-entry-name`,children:n}),(0,w.jsx)(`span`,{className:`data-entry-meta`,children:`special`})]})},e.name)})})]})}function P(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 F(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`—`}}export{h as i,E as n,S as r,T as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e,t}from"./chunk-DD-I1_y5.js";import{n,o as r,r as i,t as a}from"./jsx-runtime-HrrfyPcI.js";import{a as o,c as s,d as c,f as l,i as u,l as d,n as f,o as p,r as m,s as h,u as g}from"./graph-labels-piCPPdFq.js";import{t as _}from"./Checkbox-YcNN7jq1.js";var v=i(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),y=i(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),b=i(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),x=i(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),S=i(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),ee=i(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),C=i(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),te=i(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),ne=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.vis=n.vis||{}))})(e,(function(e){function t(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var n=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var i={exports:{}},a=function(e){return e&&e.Math===Math&&e},o=a(typeof globalThis==`object`&&globalThis)||a(typeof window==`object`&&window)||a(typeof self==`object`&&self)||a(typeof n==`object`&&n)||(function(){return this})()||n||Function(`return this`)(),s=function(e){try{return!!e()}catch{return!0}},c=!s(function(){var e=(function(){}).bind();return typeof e!=`function`||e.hasOwnProperty(`prototype`)}),l=c,u=Function.prototype,d=u.apply,f=u.call,p=typeof Reflect==`object`&&Reflect.apply||(l?f.bind(d):function(){return f.apply(d,arguments)}),m=c,h=Function.prototype,g=h.call,_=m&&h.bind.bind(g,g),v=m?_:function(e){return function(){return g.apply(e,arguments)}},y=v,b=y({}.toString),x=y(``.slice),S=function(e){return x(b(e),8,-1)},ee=S,C=v,te=function(e){if(ee(e)===`Function`)return C(e)},ne=typeof document==`object`&&document.all,re={all:ne,IS_HTMLDDA:ne===void 0&&ne!==void 0},w=re,T=w.all,E=w.IS_HTMLDDA?function(e){return typeof e==`function`||e===T}:function(e){return typeof e==`function`},D={},O=!s(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),ie=c,k=Function.prototype.call,A=ie?k.bind(k):function(){return k.apply(k,arguments)},ae={},oe={}.propertyIsEnumerable,se=Object.getOwnPropertyDescriptor;ae.f=se&&!oe.call({1:2},1)?function(e){var t=se(this,e);return!!t&&t.enumerable}:oe;var ce=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},le=v,ue=s,de=S,fe=Object,pe=le(``.split),me=ue(function(){return!fe(`z`).propertyIsEnumerable(0)})?function(e){return de(e)===`String`?pe(e,``):fe(e)}:fe,he=function(e){return e==null},ge=he,_e=TypeError,ve=function(e){if(ge(e))throw new _e(`Can't call method on `+e);return e},ye=me,be=ve,xe=function(e){return ye(be(e))},Se=E,Ce=re,j=Ce.all,M=Ce.IS_HTMLDDA?function(e){return typeof e==`object`?e!==null:Se(e)||e===j}:function(e){return typeof e==`object`?e!==null:Se(e)},N={},we=N,P=o,Te=E,F=function(e){return Te(e)?e:void 0},I=function(e,t){return arguments.length<2?F(we[e])||F(P[e]):we[e]&&we[e][t]||P[e]&&P[e][t]},Ee=v({}.isPrototypeOf),De=typeof navigator<`u`&&String(navigator.userAgent)||``,Oe=o,ke=De,Ae=Oe.process,je=Oe.Deno,Me=Ae&&Ae.versions||je&&je.version,Ne=Me&&Me.v8,Pe,Fe;Ne&&(Pe=Ne.split(`.`),Fe=Pe[0]>0&&Pe[0]<4?1:+(Pe[0]+Pe[1])),!Fe&&ke&&(Pe=ke.match(/Edge\/(\d+)/),(!Pe||Pe[1]>=74)&&(Pe=ke.match(/Chrome\/(\d+)/),Pe&&(Fe=+Pe[1])));var Ie=Fe,Le=Ie,Re=s,ze=o.String,Be=!!Object.getOwnPropertySymbols&&!Re(function(){var e=Symbol(`symbol detection`);return!ze(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Le&&Le<41}),Ve=Be&&!Symbol.sham&&typeof Symbol.iterator==`symbol`,He=I,Ue=E,We=Ee,Ge=Ve,Ke=Object,qe=Ge?function(e){return typeof e==`symbol`}:function(e){var t=He(`Symbol`);return Ue(t)&&We(t.prototype,Ke(e))},Je=String,Ye=function(e){try{return Je(e)}catch{return`Object`}},Xe=E,Ze=Ye,Qe=TypeError,$e=function(e){if(Xe(e))return e;throw new Qe(Ze(e)+` is not a function`)},et=$e,tt=he,nt=function(e,t){var n=e[t];return tt(n)?void 0:et(n)},rt=A,it=E,at=M,ot=TypeError,st=function(e,t){var n,r;if(t===`string`&&it(n=e.toString)&&!at(r=rt(n,e))||it(n=e.valueOf)&&!at(r=rt(n,e))||t!==`string`&&it(n=e.toString)&&!at(r=rt(n,e)))return r;throw new ot(`Can't convert object to primitive value`)},ct={exports:{}},lt=!0,ut=o,dt=Object.defineProperty,ft=function(e,t){try{dt(ut,e,{value:t,configurable:!0,writable:!0})}catch{ut[e]=t}return t},pt=o,mt=ft,ht=`__core-js_shared__`,gt=pt[ht]||mt(ht,{}),_t=gt;(ct.exports=function(e,t){return _t[e]||(_t[e]=t===void 0?{}:t)})(`versions`,[]).push({version:`3.33.2`,mode:`pure`,copyright:`© 2014-2023 Denis Pushkarev (zloirock.ru)`,license:`https://github.com/zloirock/core-js/blob/v3.33.2/LICENSE`,source:`https://github.com/zloirock/core-js`});var vt=ct.exports,yt=ve,bt=Object,xt=function(e){return bt(yt(e))},St=v,Ct=xt,wt=St({}.hasOwnProperty),Tt=Object.hasOwn||function(e,t){return wt(Ct(e),t)},Et=v,Dt=0,Ot=Math.random(),kt=Et(1 .toString),At=function(e){return`Symbol(`+(e===void 0?``:e)+`)_`+kt(++Dt+Ot,36)},jt=o,Mt=vt,Nt=Tt,Pt=At,Ft=Be,It=Ve,Lt=jt.Symbol,Rt=Mt(`wks`),zt=It?Lt.for||Lt:Lt&&Lt.withoutSetter||Pt,Bt=function(e){return Nt(Rt,e)||(Rt[e]=Ft&&Nt(Lt,e)?Lt[e]:zt(`Symbol.`+e)),Rt[e]},Vt=A,Ht=M,Ut=qe,Wt=nt,Gt=st,Kt=Bt,qt=TypeError,Jt=Kt(`toPrimitive`),Yt=function(e,t){if(!Ht(e)||Ut(e))return e;var n=Wt(e,Jt),r;if(n){if(t===void 0&&(t=`default`),r=Vt(n,e,t),!Ht(r)||Ut(r))return r;throw new qt(`Can't convert object to primitive value`)}return t===void 0&&(t=`number`),Gt(e,t)},Xt=qe,Zt=function(e){var t=Yt(e,`string`);return Xt(t)?t:t+``},Qt=o,$t=M,en=Qt.document,tn=$t(en)&&$t(en.createElement),nn=function(e){return tn?en.createElement(e):{}},rn=O,an=s,on=nn,sn=!rn&&!an(function(){return Object.defineProperty(on(`div`),`a`,{get:function(){return 7}}).a!==7}),cn=O,ln=A,un=ae,dn=ce,fn=xe,pn=Zt,mn=Tt,hn=sn,gn=Object.getOwnPropertyDescriptor;D.f=cn?gn:function(e,t){if(e=fn(e),t=pn(t),hn)try{return gn(e,t)}catch{}if(mn(e,t))return dn(!ln(un.f,e,t),e[t])};var _n=s,vn=E,yn=/#|\.prototype\./,bn=function(e,t){var n=Sn[xn(e)];return n===wn?!0:n===Cn?!1:vn(t)?_n(t):!!t},xn=bn.normalize=function(e){return String(e).replace(yn,`.`).toLowerCase()},Sn=bn.data={},Cn=bn.NATIVE=`N`,wn=bn.POLYFILL=`P`,Tn=bn,En=te,Dn=$e,On=c,kn=En(En.bind),An=function(e,t){return Dn(e),t===void 0?e:On?kn(e,t):function(){return e.apply(t,arguments)}},jn={},Mn=O&&s(function(){return Object.defineProperty(function(){},`prototype`,{value:42,writable:!1}).prototype!==42}),Nn=M,Pn=String,Fn=TypeError,In=function(e){if(Nn(e))return e;throw new Fn(Pn(e)+` is not an object`)},Ln=O,Rn=sn,zn=Mn,Bn=In,Vn=Zt,Hn=TypeError,Un=Object.defineProperty,Wn=Object.getOwnPropertyDescriptor,Gn=`enumerable`,L=`configurable`,R=`writable`;jn.f=Ln?zn?function(e,t,n){if(Bn(e),t=Vn(t),Bn(n),typeof e==`function`&&t===`prototype`&&`value`in n&&R in n&&!n[R]){var r=Wn(e,t);r&&r[R]&&(e[t]=n.value,n={configurable:L in n?n[L]:r[L],enumerable:Gn in n?n[Gn]:r[Gn],writable:!1})}return Un(e,t,n)}:Un:function(e,t,n){if(Bn(e),t=Vn(t),Bn(n),Rn)try{return Un(e,t,n)}catch{}if(`get`in n||`set`in n)throw new Hn(`Accessors not supported`);return`value`in n&&(e[t]=n.value),e};var Kn=O,qn=jn,Jn=ce,Yn=Kn?function(e,t,n){return qn.f(e,t,Jn(1,n))}:function(e,t,n){return e[t]=n,e},Xn=o,Zn=p,Qn=te,$n=E,er=D.f,tr=Tn,nr=N,rr=An,ir=Yn,ar=Tt,or=function(e){var t=function(n,r,i){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(n);case 2:return new e(n,r)}return new e(n,r,i)}return Zn(e,this,arguments)};return t.prototype=e.prototype,t},z=function(e,t){var n=e.target,r=e.global,i=e.stat,a=e.proto,o=r?Xn:i?Xn[n]:(Xn[n]||{}).prototype,s=r?nr:nr[n]||ir(nr,n,{})[n],c=s.prototype,l,u,d,f,p,m,h,g,_;for(f in t)l=tr(r?f:n+(i?`.`:`#`)+f,e.forced),u=!l&&o&&ar(o,f),m=s[f],u&&(e.dontCallGetSet?(_=er(o,f),h=_&&_.value):h=o[f]),p=u&&h?h:t[f],!(u&&typeof m==typeof p)&&(g=e.bind&&u?rr(p,Xn):e.wrap&&u?or(p):a&&$n(p)?Qn(p):p,(e.sham||p&&p.sham||m&&m.sham)&&ir(g,`sham`,!0),ir(s,f,g),a&&(d=n+`Prototype`,ar(nr,d)||ir(nr,d,{}),ir(nr[d],f,p),e.real&&c&&(l||!c[f])&&ir(c,f,p)))},sr=z,cr=O,lr=jn.f;sr({target:`Object`,stat:!0,forced:Object.defineProperty!==lr,sham:!cr},{defineProperty:lr});var ur=N.Object,dr=i.exports=function(e,t,n){return ur.defineProperty(e,t,n)};ur.defineProperty.sham&&(dr.sham=!0);var fr=i.exports,pr=fr,mr=r(pr),hr=S,gr=Array.isArray||function(e){return hr(e)===`Array`},_r=Math.ceil,vr=Math.floor,yr=Math.trunc||function(e){var t=+e;return(t>0?vr:_r)(t)},br=function(e){var t=+e;return t!==t||t===0?0:yr(t)},xr=br,Sr=Math.min,Cr=function(e){return e>0?Sr(xr(e),9007199254740991):0},wr=function(e){return Cr(e.length)},Tr=TypeError,Er=9007199254740991,Dr=function(e){if(e>Er)throw Tr(`Maximum allowed index exceeded`);return e},Or=Zt,kr=jn,Ar=ce,jr=function(e,t,n){var r=Or(t);r in e?kr.f(e,r,Ar(0,n)):e[r]=n},Mr=Bt(`toStringTag`),Nr={};Nr[Mr]=`z`;var Pr=String(Nr)===`[object z]`,Fr=Pr,Ir=E,Lr=S,Rr=Bt(`toStringTag`),zr=Object,Br=Lr(function(){return arguments}())===`Arguments`,Vr=function(e,t){try{return e[t]}catch{}},Hr=Fr?Lr:function(e){var t,n,r;return e===void 0?`Undefined`:e===null?`Null`:typeof(n=Vr(t=zr(e),Rr))==`string`?n:Br?Lr(t):(r=Lr(t))===`Object`&&Ir(t.callee)?`Arguments`:r},Ur=v,Wr=E,Gr=gt,Kr=Ur(Function.toString);Wr(Gr.inspectSource)||(Gr.inspectSource=function(e){return Kr(e)});var qr=Gr.inspectSource,Jr=v,Yr=s,Xr=E,Zr=Hr,Qr=I,B=qr,$r=function(){},ei=[],ti=Qr(`Reflect`,`construct`),ni=/^\s*(?:class|function)\b/,ri=Jr(ni.exec),ii=!ni.test($r),ai=function(e){if(!Xr(e))return!1;try{return ti($r,ei,e),!0}catch{return!1}},oi=function(e){if(!Xr(e))return!1;switch(Zr(e)){case`AsyncFunction`:case`GeneratorFunction`:case`AsyncGeneratorFunction`:return!1}try{return ii||!!ri(ni,B(e))}catch{return!0}};oi.sham=!0;var si=!ti||Yr(function(){var e;return ai(ai.call)||!ai(Object)||!ai(function(){e=!0})||e})?oi:ai,ci=gr,li=si,ui=M,di=Bt(`species`),fi=Array,pi=function(e){var t;return ci(e)&&(t=e.constructor,li(t)&&(t===fi||ci(t.prototype))?t=void 0:ui(t)&&(t=t[di],t===null&&(t=void 0))),t===void 0?fi:t},mi=function(e,t){return new(pi(e))(t===0?0:t)},hi=s,gi=Bt,_i=Ie,vi=gi(`species`),yi=function(e){return _i>=51||!hi(function(){var t=[],n=t.constructor={};return n[vi]=function(){return{foo:1}},t[e](Boolean).foo!==1})},bi=z,xi=s,Si=gr,Ci=M,wi=xt,Ti=wr,Ei=Dr,Di=jr,Oi=mi,ki=yi,Ai=Bt,ji=Ie,Mi=Ai(`isConcatSpreadable`),Ni=ji>=51||!xi(function(){var e=[];return e[Mi]=!1,e.concat()[0]!==e}),Pi=function(e){if(!Ci(e))return!1;var t=e[Mi];return t===void 0?Si(e):!!t};bi({target:`Array`,proto:!0,arity:1,forced:!Ni||!ki(`concat`)},{concat:function(e){var t=wi(this),n=Oi(t,0),r=0,i,a,o,s,c;for(i=-1,o=arguments.length;i<o;i++)if(c=i===-1?t:arguments[i],Pi(c))for(s=Ti(c),Ei(r+s),a=0;a<s;a++,r++)a in c&&Di(n,r,c[a]);else Ei(r+1),Di(n,r++,c);return n.length=r,n}});var Fi=Hr,Ii=String,Li=function(e){if(Fi(e)===`Symbol`)throw TypeError(`Cannot convert a Symbol value to a string`);return Ii(e)},Ri={},zi=br,Bi=Math.max,Vi=Math.min,Hi=function(e,t){var n=zi(e);return n<0?Bi(n+t,0):Vi(n,t)},Ui=xe,Wi=Hi,Gi=wr,Ki=function(e){return function(t,n,r){var i=Ui(t),a=Gi(i),o=Wi(r,a),s;if(e&&n!==n){for(;a>o;)if(s=i[o++],s!==s)return!0}else for(;a>o;o++)if((e||o in i)&&i[o]===n)return e||o||0;return!e&&-1}},qi={includes:Ki(!0),indexOf:Ki(!1)},Ji={},Yi=v,Xi=Tt,Zi=xe,Qi=qi.indexOf,$i=Ji,ea=Yi([].push),ta=function(e,t){var n=Zi(e),r=0,i=[],a;for(a in n)!Xi($i,a)&&Xi(n,a)&&ea(i,a);for(;t.length>r;)Xi(n,a=t[r++])&&(~Qi(i,a)||ea(i,a));return i},na=[`constructor`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`],ra=ta,ia=na,aa=Object.keys||function(e){return ra(e,ia)},oa=O,sa=Mn,ca=jn,la=In,ua=xe,da=aa;Ri.f=oa&&!sa?Object.defineProperties:function(e,t){la(e);for(var n=ua(t),r=da(t),i=r.length,a=0,o;i>a;)ca.f(e,o=r[a++],n[o]);return e};var fa=I(`document`,`documentElement`),pa=vt,ma=At,ha=pa(`keys`),ga=function(e){return ha[e]||(ha[e]=ma(e))},_a=In,va=Ri,ya=na,ba=Ji,xa=fa,Sa=nn,Ca=ga,wa=`>`,Ta=`<`,Ea=`prototype`,Da=`script`,Oa=Ca(`IE_PROTO`),ka=function(){},Aa=function(e){return Ta+Da+wa+e+Ta+`/`+Da+wa},ja=function(e){e.write(Aa(``)),e.close();var t=e.parentWindow.Object;return e=null,t},Ma=function(){var e=Sa(`iframe`),t=`java`+Da+`:`,n;return e.style.display=`none`,xa.appendChild(e),e.src=String(t),n=e.contentWindow.document,n.open(),n.write(Aa(`document.F=Object`)),n.close(),n.F},Na,Pa=function(){try{Na=new ActiveXObject(`htmlfile`)}catch{}Pa=typeof document<`u`?document.domain&&Na?ja(Na):Ma():ja(Na);for(var e=ya.length;e--;)delete Pa[Ea][ya[e]];return Pa()};ba[Oa]=!0;var Fa=Object.create||function(e,t){var n;return e===null?n=Pa():(ka[Ea]=_a(e),n=new ka,ka[Ea]=null,n[Oa]=e),t===void 0?n:va.f(n,t)},Ia={},La=ta,Ra=na.concat(`length`,`prototype`);Ia.f=Object.getOwnPropertyNames||function(e){return La(e,Ra)};var za={},Ba=Hi,Va=wr,Ha=jr,Ua=Array,Wa=Math.max,Ga=function(e,t,n){for(var r=Va(e),i=Ba(t,r),a=Ba(n===void 0?r:n,r),o=Ua(Wa(a-i,0)),s=0;i<a;i++,s++)Ha(o,s,e[i]);return o.length=s,o},Ka=S,qa=xe,Ja=Ia.f,Ya=Ga,Xa=typeof window==`object`&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Za=function(e){try{return Ja(e)}catch{return Ya(Xa)}};za.f=function(e){return Xa&&Ka(e)===`Window`?Za(e):Ja(qa(e))};var Qa={};Qa.f=Object.getOwnPropertySymbols;var $a=Yn,eo=function(e,t,n,r){return r&&r.enumerable?e[t]=n:$a(e,t,n),e},to=jn,no=function(e,t,n){return to.f(e,t,n)},ro={};ro.f=Bt;var io=N,ao=Tt,oo=ro,so=jn.f,co=function(e){var t=io.Symbol||={};ao(t,e)||so(t,e,{value:oo.f(e)})},lo=A,uo=I,fo=Bt,po=eo,mo=function(){var e=uo(`Symbol`),t=e&&e.prototype,n=t&&t.valueOf,r=fo(`toPrimitive`);t&&!t[r]&&po(t,r,function(e){return lo(n,this)},{arity:1})},ho=Pr,go=Hr,_o=ho?{}.toString:function(){return`[object `+go(this)+`]`},vo=Pr,yo=jn.f,bo=Yn,xo=Tt,So=_o,Co=Bt(`toStringTag`),wo=function(e,t,n,r){if(e){var i=n?e:e.prototype;xo(i,Co)||yo(i,Co,{configurable:!0,value:t}),r&&!vo&&bo(i,`toString`,So)}},To=o,Eo=E,Do=To.WeakMap,Oo=Eo(Do)&&/native code/.test(String(Do)),ko=o,Ao=M,jo=Yn,Mo=Tt,No=gt,Po=ga,Fo=Ji,Io=`Object already initialized`,Lo=ko.TypeError,Ro=ko.WeakMap,zo,Bo,Vo,Ho=function(e){return Vo(e)?Bo(e):zo(e,{})},Uo=function(e){return function(t){var n;if(!Ao(t)||(n=Bo(t)).type!==e)throw new Lo(`Incompatible receiver, `+e+` required`);return n}};if(Oo||No.state){var Wo=No.state||=new Ro;Wo.get=Wo.get,Wo.has=Wo.has,Wo.set=Wo.set,zo=function(e,t){if(Wo.has(e))throw new Lo(Io);return t.facade=e,Wo.set(e,t),t},Bo=function(e){return Wo.get(e)||{}},Vo=function(e){return Wo.has(e)}}else{var Go=Po(`state`);Fo[Go]=!0,zo=function(e,t){if(Mo(e,Go))throw new Lo(Io);return t.facade=e,jo(e,Go,t),t},Bo=function(e){return Mo(e,Go)?e[Go]:{}},Vo=function(e){return Mo(e,Go)}}var Ko={set:zo,get:Bo,has:Vo,enforce:Ho,getterFor:Uo},qo=An,Jo=v,Yo=me,Xo=xt,Zo=wr,Qo=mi,$o=Jo([].push),es=function(e){var t=e===1,n=e===2,r=e===3,i=e===4,a=e===6,o=e===7,s=e===5||a;return function(c,l,u,d){for(var f=Xo(c),p=Yo(f),m=qo(l,u),h=Zo(p),g=0,_=d||Qo,v=t?_(c,h):n||o?_(c,0):void 0,y,b;h>g;g++)if((s||g in p)&&(y=p[g],b=m(y,g,f),e))if(t)v[g]=b;else if(b)switch(e){case 3:return!0;case 5:return y;case 6:return g;case 2:$o(v,y)}else switch(e){case 4:return!1;case 7:$o(v,y)}return a?-1:r||i?i:v}},ts={forEach:es(0),map:es(1),filter:es(2),some:es(3),every:es(4),find:es(5),findIndex:es(6),filterReject:es(7)},ns=z,rs=o,is=A,as=v,os=O,ss=Be,cs=s,ls=Tt,us=Ee,ds=In,fs=xe,ps=Zt,ms=Li,hs=ce,gs=Fa,_s=aa,vs=Ia,ys=za,bs=Qa,xs=D,Ss=jn,Cs=Ri,ws=ae,Ts=eo,Es=no,Ds=vt,Os=ga,ks=Ji,As=At,js=Bt,Ms=ro,Ns=co,Ps=mo,Fs=wo,Is=Ko,Ls=ts.forEach,Rs=Os(`hidden`),zs=`Symbol`,Bs=`prototype`,Vs=Is.set,Hs=Is.getterFor(zs),Us=Object[Bs],Ws=rs.Symbol,Gs=Ws&&Ws[Bs],Ks=rs.RangeError,qs=rs.TypeError,Js=rs.QObject,Ys=xs.f,Xs=Ss.f,Zs=ys.f,Qs=ws.f,$s=as([].push),ec=Ds(`symbols`),tc=Ds(`op-symbols`),nc=Ds(`wks`),rc=!Js||!Js[Bs]||!Js[Bs].findChild,ic=function(e,t,n){var r=Ys(Us,t);r&&delete Us[t],Xs(e,t,n),r&&e!==Us&&Xs(Us,t,r)},ac=os&&cs(function(){return gs(Xs({},`a`,{get:function(){return Xs(this,`a`,{value:7}).a}})).a!==7})?ic:Xs,oc=function(e,t){var n=ec[e]=gs(Gs);return Vs(n,{type:zs,tag:e,description:t}),os||(n.description=t),n},sc=function(e,t,n){e===Us&&sc(tc,t,n),ds(e);var r=ps(t);return ds(n),ls(ec,r)?(n.enumerable?(ls(e,Rs)&&e[Rs][r]&&(e[Rs][r]=!1),n=gs(n,{enumerable:hs(0,!1)})):(ls(e,Rs)||Xs(e,Rs,hs(1,{})),e[Rs][r]=!0),ac(e,r,n)):Xs(e,r,n)},cc=function(e,t){ds(e);var n=fs(t);return Ls(_s(n).concat(pc(n)),function(t){(!os||is(uc,n,t))&&sc(e,t,n[t])}),e},lc=function(e,t){return t===void 0?gs(e):cc(gs(e),t)},uc=function(e){var t=ps(e),n=is(Qs,this,t);return this===Us&&ls(ec,t)&&!ls(tc,t)?!1:n||!ls(this,t)||!ls(ec,t)||ls(this,Rs)&&this[Rs][t]?n:!0},dc=function(e,t){var n=fs(e),r=ps(t);if(!(n===Us&&ls(ec,r)&&!ls(tc,r))){var i=Ys(n,r);return i&&ls(ec,r)&&!(ls(n,Rs)&&n[Rs][r])&&(i.enumerable=!0),i}},fc=function(e){var t=Zs(fs(e)),n=[];return Ls(t,function(e){!ls(ec,e)&&!ls(ks,e)&&$s(n,e)}),n},pc=function(e){var t=e===Us,n=Zs(t?tc:fs(e)),r=[];return Ls(n,function(e){ls(ec,e)&&(!t||ls(Us,e))&&$s(r,ec[e])}),r};ss||(Ws=function(){if(us(Gs,this))throw new qs(`Symbol is not a constructor`);var e=!arguments.length||arguments[0]===void 0?void 0:ms(arguments[0]),t=As(e),n=function(e){var r=this===void 0?rs:this;r===Us&&is(n,tc,e),ls(r,Rs)&&ls(r[Rs],t)&&(r[Rs][t]=!1);var i=hs(1,e);try{ac(r,t,i)}catch(e){if(!(e instanceof Ks))throw e;ic(r,t,i)}};return os&&rc&&ac(Us,t,{configurable:!0,set:n}),oc(t,e)},Gs=Ws[Bs],Ts(Gs,`toString`,function(){return Hs(this).tag}),Ts(Ws,`withoutSetter`,function(e){return oc(As(e),e)}),ws.f=uc,Ss.f=sc,Cs.f=cc,xs.f=dc,vs.f=ys.f=fc,bs.f=pc,Ms.f=function(e){return oc(js(e),e)},os&&Es(Gs,`description`,{configurable:!0,get:function(){return Hs(this).description}})),ns({global:!0,constructor:!0,wrap:!0,forced:!ss,sham:!ss},{Symbol:Ws}),Ls(_s(nc),function(e){Ns(e)}),ns({target:zs,stat:!0,forced:!ss},{useSetter:function(){rc=!0},useSimple:function(){rc=!1}}),ns({target:`Object`,stat:!0,forced:!ss,sham:!os},{create:lc,defineProperty:sc,defineProperties:cc,getOwnPropertyDescriptor:dc}),ns({target:`Object`,stat:!0,forced:!ss},{getOwnPropertyNames:fc}),Ps(),Fs(Ws,zs),ks[Rs]=!0;var mc=Be&&!!Symbol.for&&!!Symbol.keyFor,hc=z,gc=I,_c=Tt,vc=Li,yc=vt,bc=mc,xc=yc(`string-to-symbol-registry`),V=yc(`symbol-to-string-registry`);hc({target:`Symbol`,stat:!0,forced:!bc},{for:function(e){var t=vc(e);if(_c(xc,t))return xc[t];var n=gc(`Symbol`)(t);return xc[t]=n,V[n]=t,n}});var Sc=z,Cc=Tt,wc=qe,Tc=Ye,Ec=vt,Dc=mc,Oc=Ec(`symbol-to-string-registry`);Sc({target:`Symbol`,stat:!0,forced:!Dc},{keyFor:function(e){if(!wc(e))throw TypeError(Tc(e)+` is not a symbol`);if(Cc(Oc,e))return Oc[e]}});var kc=v([].slice),Ac=v,jc=gr,Mc=E,Nc=S,Pc=Li,Fc=Ac([].push),Ic=function(e){if(Mc(e))return e;if(jc(e)){for(var t=e.length,n=[],r=0;r<t;r++){var i=e[r];typeof i==`string`?Fc(n,i):(typeof i==`number`||Nc(i)===`Number`||Nc(i)===`String`)&&Fc(n,Pc(i))}var a=n.length,o=!0;return function(e,t){if(o)return o=!1,t;if(jc(this))return t;for(var r=0;r<a;r++)if(n[r]===e)return t}}},Lc=z,Rc=I,zc=p,Bc=A,Vc=v,Hc=s,Uc=E,Wc=qe,Gc=kc,Kc=Ic,qc=Be,Jc=String,Yc=Rc(`JSON`,`stringify`),Xc=Vc(/./.exec),Zc=Vc(``.charAt),Qc=Vc(``.charCodeAt),$c=Vc(``.replace),el=Vc(1 .toString),tl=/[\uD800-\uDFFF]/g,nl=/^[\uD800-\uDBFF]$/,rl=/^[\uDC00-\uDFFF]$/,il=!qc||Hc(function(){var e=Rc(`Symbol`)(`stringify detection`);return Yc([e])!==`[null]`||Yc({a:e})!==`{}`||Yc(Object(e))!==`{}`}),al=Hc(function(){return Yc(`\udf06\ud834`)!==`"\\udf06\\ud834"`||Yc(`\udead`)!==`"\\udead"`}),ol=function(e,t){var n=Gc(arguments),r=Kc(t);if(!(!Uc(r)&&(e===void 0||Wc(e))))return n[1]=function(e,t){if(Uc(r)&&(t=Bc(r,this,Jc(e),t)),!Wc(t))return t},zc(Yc,null,n)},sl=function(e,t,n){var r=Zc(n,t-1),i=Zc(n,t+1);return Xc(nl,e)&&!Xc(rl,i)||Xc(rl,e)&&!Xc(nl,r)?`\\u`+el(Qc(e,0),16):e};Yc&&Lc({target:`JSON`,stat:!0,arity:3,forced:il||al},{stringify:function(e,t,n){var r=Gc(arguments),i=zc(il?ol:Yc,null,r);return al&&typeof i==`string`?$c(i,tl,sl):i}});var cl=z,ll=Be,ul=s,dl=Qa,fl=xt;cl({target:`Object`,stat:!0,forced:!ll||ul(function(){dl.f(1)})},{getOwnPropertySymbols:function(e){var t=dl.f;return t?t(fl(e)):[]}}),co(`asyncIterator`),co(`hasInstance`),co(`isConcatSpreadable`),co(`iterator`),co(`match`),co(`matchAll`),co(`replace`),co(`search`),co(`species`),co(`split`);var pl=co,ml=mo;pl(`toPrimitive`),ml();var hl=I,gl=co,_l=wo;gl(`toStringTag`),_l(hl(`Symbol`),`Symbol`),co(`unscopables`),wo(o.JSON,`JSON`,!0);var vl=N.Symbol,yl={},bl=O,xl=Tt,Sl=Function.prototype,Cl=bl&&Object.getOwnPropertyDescriptor,wl=xl(Sl,`name`),Tl={EXISTS:wl,PROPER:wl&&(function(){}).name===`something`,CONFIGURABLE:wl&&(!bl||bl&&Cl(Sl,`name`).configurable)},El=!s(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Dl=Tt,Ol=E,kl=xt,Al=ga,jl=El,Ml=Al(`IE_PROTO`),Nl=Object,Pl=Nl.prototype,Fl=jl?Nl.getPrototypeOf:function(e){var t=kl(e);if(Dl(t,Ml))return t[Ml];var n=t.constructor;return Ol(n)&&t instanceof n?n.prototype:t instanceof Nl?Pl:null},Il=s,Ll=E,Rl=M,zl=Fa,Bl=Fl,Vl=eo,Hl=Bt(`iterator`),Ul=!1,Wl,Gl,Kl;[].keys&&(Kl=[].keys(),`next`in Kl?(Gl=Bl(Bl(Kl)),Gl!==Object.prototype&&(Wl=Gl)):Ul=!0),Wl=!Rl(Wl)||Il(function(){var e={};return Wl[Hl].call(e)!==e})?{}:zl(Wl),Ll(Wl[Hl])||Vl(Wl,Hl,function(){return this});var ql={IteratorPrototype:Wl,BUGGY_SAFARI_ITERATORS:Ul},Jl=ql.IteratorPrototype,Yl=Fa,Xl=ce,Zl=wo,Ql=yl,$l=function(){return this},eu=function(e,t,n,r){var i=t+` Iterator`;return e.prototype=Yl(Jl,{next:Xl(+!r,n)}),Zl(e,i,!1,!0),Ql[i]=$l,e},tu=v,nu=$e,ru=function(e,t,n){try{return tu(nu(Object.getOwnPropertyDescriptor(e,t)[n]))}catch{}},iu=E,au=String,ou=TypeError,su=function(e){if(typeof e==`object`||iu(e))return e;throw new ou(`Can't set `+au(e)+` as a prototype`)},cu=ru,lu=In,uu=su,du=Object.setPrototypeOf||(`__proto__`in{}?function(){var e=!1,t={},n;try{n=cu(Object.prototype,`__proto__`,`set`),n(t,[]),e=t instanceof Array}catch{}return function(t,r){return lu(t),uu(r),e?n(t,r):t.__proto__=r,t}}():void 0),fu=z,pu=A,mu=Tl,hu=eu,gu=Fl,_u=wo,vu=eo,yu=Bt,bu=yl,xu=ql,Su=mu.PROPER;mu.CONFIGURABLE,xu.IteratorPrototype;var Cu=xu.BUGGY_SAFARI_ITERATORS,wu=yu(`iterator`),Tu=`keys`,Eu=`values`,Du=`entries`,Ou=function(){return this},ku=function(e,t,n,r,i,a,o){hu(n,t,r);var s=function(e){if(e===i&&f)return f;if(!Cu&&e&&e in u)return u[e];switch(e){case Tu:return function(){return new n(this,e)};case Eu:return function(){return new n(this,e)};case Du:return function(){return new n(this,e)}}return function(){return new n(this)}},c=t+` Iterator`,l=!1,u=e.prototype,d=u[wu]||u[`@@iterator`]||i&&u[i],f=!Cu&&d||s(i),p=t===`Array`&&u.entries||d,m,h,g;if(p&&(m=gu(p.call(new e)),m!==Object.prototype&&m.next&&(_u(m,c,!0,!0),bu[c]=Ou)),Su&&i===Eu&&d&&d.name!==Eu&&(l=!0,f=function(){return pu(d,this)}),i)if(h={values:s(Eu),keys:a?f:s(Tu),entries:s(Du)},o)for(g in h)(Cu||l||!(g in u))&&vu(u,g,h[g]);else fu({target:t,proto:!0,forced:Cu||l},h);return o&&u[wu]!==f&&vu(u,wu,f,{name:i}),bu[t]=f,h},Au=function(e,t){return{value:e,done:t}},ju=xe,Mu=yl,Nu=Ko;jn.f;var Pu=ku,Fu=Au,Iu=`Array Iterator`,Lu=Nu.set,Ru=Nu.getterFor(Iu);Pu(Array,`Array`,function(e,t){Lu(this,{type:Iu,target:ju(e),index:0,kind:t})},function(){var e=Ru(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=void 0,Fu(void 0,!0);switch(e.kind){case`keys`:return Fu(n,!1);case`values`:return Fu(t[n],!1)}return Fu([n,t[n]],!1)},`values`),Mu.Arguments=Mu.Array;var zu={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Bu=o,Vu=Hr,Hu=Yn,Uu=yl,Wu=Bt(`toStringTag`);for(var Gu in zu){var Ku=Bu[Gu],qu=Ku&&Ku.prototype;qu&&Vu(qu)!==Wu&&Hu(qu,Wu,Gu),Uu[Gu]=Uu.Array}var Ju=vl,Yu=Bt,Xu=jn.f,Zu=Yu(`metadata`),Qu=Function.prototype;Qu[Zu]===void 0&&Xu(Qu,Zu,{value:null}),co(`asyncDispose`),co(`dispose`),co(`metadata`);var $u=Ju,ed=I,td=v,nd=ed(`Symbol`),rd=nd.keyFor,id=td(nd.prototype.valueOf),ad=nd.isRegisteredSymbol||function(e){try{return rd(id(e))!==void 0}catch{return!1}};z({target:`Symbol`,stat:!0},{isRegisteredSymbol:ad});for(var od=vt,sd=I,cd=v,ld=qe,ud=Bt,dd=sd(`Symbol`),fd=dd.isWellKnownSymbol,pd=sd(`Object`,`getOwnPropertyNames`),md=cd(dd.prototype.valueOf),hd=od(`wks`),gd=0,_d=pd(dd),vd=_d.length;gd<vd;gd++)try{var yd=_d[gd];ld(dd[yd])&&ud(yd)}catch{}var bd=function(e){if(fd&&fd(e))return!0;try{for(var t=md(e),n=0,r=pd(hd),i=r.length;n<i;n++)if(hd[r[n]]==t)return!0}catch{}return!1};z({target:`Symbol`,stat:!0,forced:!0},{isWellKnownSymbol:bd}),co(`matcher`),co(`observable`),z({target:`Symbol`,stat:!0,name:`isRegisteredSymbol`},{isRegistered:ad}),z({target:`Symbol`,stat:!0,name:`isWellKnownSymbol`,forced:!0},{isWellKnown:bd}),co(`metadataKey`),co(`patternMatch`),co(`replaceAll`);var xd=$u,Sd=r(xd),Cd=v,wd=br,Td=Li,Ed=ve,Dd=Cd(``.charAt),Od=Cd(``.charCodeAt),kd=Cd(``.slice),Ad=function(e){return function(t,n){var r=Td(Ed(t)),i=wd(n),a=r.length,o,s;return i<0||i>=a?e?``:void 0:(o=Od(r,i),o<55296||o>56319||i+1===a||(s=Od(r,i+1))<56320||s>57343?e?Dd(r,i):o:e?kd(r,i,i+2):(o-55296<<10)+(s-56320)+65536)}},jd={codeAt:Ad(!1),charAt:Ad(!0)}.charAt,Md=Li,Nd=Ko,Pd=ku,Fd=Au,Id=`String Iterator`,Ld=Nd.set,Rd=Nd.getterFor(Id);Pd(String,`String`,function(e){Ld(this,{type:Id,string:Md(e),index:0})},function(){var e=Rd(this),t=e.string,n=e.index,r;return n>=t.length?Fd(void 0,!0):(r=jd(t,n),e.index+=r.length,Fd(r,!1))});var zd=ro.f(`iterator`),Bd=zd,Vd=r(Bd);function Hd(e){"@babel/helpers - typeof";return Hd=typeof Sd==`function`&&typeof Vd==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Sd==`function`&&e.constructor===Sd&&e!==Sd.prototype?`symbol`:typeof e},Hd(e)}var Ud=r(ro.f(`toPrimitive`));function Wd(e,t){if(Hd(e)!==`object`||e===null)return e;var n=e[Ud];if(n!==void 0){var r=n.call(e,t||`default`);if(Hd(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Gd(e){var t=Wd(e,`string`);return Hd(t)===`symbol`?t:String(t)}function Kd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),mr(e,Gd(r.key),r)}}function qd(e,t,n){return t&&Kd(e.prototype,t),n&&Kd(e,n),mr(e,`prototype`,{writable:!1}),e}function Jd(e,t,n){return t=Gd(t),t in e?mr(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Yd=v,Xd=$e,Zd=M,Qd=Tt,$d=kc,ef=c,tf=Function,nf=Yd([].concat),rf=Yd([].join),af={},of=function(e,t,n){if(!Qd(af,t)){for(var r=[],i=0;i<t;i++)r[i]=`a[`+i+`]`;af[t]=tf(`C,a`,`return new C(`+rf(r,`,`)+`)`)}return af[t](e,n)},sf=ef?tf.bind:function(e){var t=Xd(this),n=t.prototype,r=$d(arguments,1),i=function(){var n=nf(r,$d(arguments));return this instanceof i?of(t,n.length,n):t.apply(e,n)};return Zd(n)&&(i.prototype=n),i},cf=z,lf=sf;cf({target:`Function`,proto:!0,forced:Function.bind!==lf},{bind:lf});var uf=o,df=N,ff=function(e,t){var n=df[e+`Prototype`],r=n&&n[t];if(r)return r;var i=uf[e],a=i&&i.prototype;return a&&a[t]},pf=ff(`Function`,`bind`),mf=Ee,hf=pf,gf=Function.prototype,_f=function(e){var t=e.bind;return e===gf||mf(gf,e)&&t===gf.bind?hf:t},vf=r(_f),yf=$e,bf=xt,xf=me,Sf=wr,Cf=TypeError,wf=function(e){return function(t,n,r,i){yf(n);var a=bf(t),o=xf(a),s=Sf(a),c=e?s-1:0,l=e?-1:1;if(r<2)for(;;){if(c in o){i=o[c],c+=l;break}if(c+=l,e?c<0:s<=c)throw new Cf(`Reduce of empty array with no initial value`)}for(;e?c>=0:s>c;c+=l)c in o&&(i=n(i,o[c],c,a));return i}},Tf={left:wf(!1),right:wf(!0)},H=s,Ef=function(e,t){var n=[][e];return!!n&&H(function(){n.call(null,t||function(){return 1},1)})},Df=S(o.process)===`process`,Of=z,kf=Tf.left,Af=Ef,jf=Ie;Of({target:`Array`,proto:!0,forced:!Df&&jf>79&&jf<83||!Af(`reduce`)},{reduce:function(e){var t=arguments.length;return kf(this,e,t,t>1?arguments[1]:void 0)}});var Mf=ff(`Array`,`reduce`),Nf=Ee,Pf=Mf,Ff=Array.prototype,If=r(function(e){var t=e.reduce;return e===Ff||Nf(Ff,e)&&t===Ff.reduce?Pf:t}),Lf=z,Rf=ts.filter;Lf({target:`Array`,proto:!0,forced:!yi(`filter`)},{filter:function(e){return Rf(this,e,arguments.length>1?arguments[1]:void 0)}});var zf=ff(`Array`,`filter`),Bf=Ee,Vf=zf,Hf=Array.prototype,Uf=r(function(e){var t=e.filter;return e===Hf||Bf(Hf,e)&&t===Hf.filter?Vf:t}),Wf=z,Gf=ts.map;Wf({target:`Array`,proto:!0,forced:!yi(`map`)},{map:function(e){return Gf(this,e,arguments.length>1?arguments[1]:void 0)}});var Kf=ff(`Array`,`map`),qf=Ee,Jf=Kf,Yf=Array.prototype,Xf=r(function(e){var t=e.map;return e===Yf||qf(Yf,e)&&t===Yf.map?Jf:t}),Zf=gr,Qf=wr,$f=Dr,ep=An,tp=function(e,t,n,r,i,a,o,s){for(var c=i,l=0,u=o?ep(o,s):!1,d,f;l<r;)l in n&&(d=u?u(n[l],l,t):n[l],a>0&&Zf(d)?(f=Qf(d),c=tp(e,t,d,f,c,a-1)-1):($f(c+1),e[c]=d),c++),l++;return c},np=tp,rp=z,ip=np,ap=$e,op=xt,sp=wr,cp=mi;rp({target:`Array`,proto:!0},{flatMap:function(e){var t=op(this),n=sp(t),r;return ap(e),r=cp(t,0),r.length=ip(r,t,t,n,0,1,e,arguments.length>1?arguments[1]:void 0),r}});var lp=ff(`Array`,`flatMap`),up=Ee,dp=lp,fp=Array.prototype,pp=r(function(e){var t=e.flatMap;return e===fp||up(fp,e)&&t===fp.flatMap?dp:t});function mp(e){return new gp(e)}var hp=function(){function e(n,r,i){var a,o,s;t(this,e),Jd(this,`_listeners`,{add:vf(a=this._add).call(a,this),remove:vf(o=this._remove).call(o,this),update:vf(s=this._update).call(s,this)}),this._source=n,this._transformers=r,this._target=i}return qd(e,[{key:`all`,value:function(){return this._target.update(this._transformItems(this._source.get())),this}},{key:`start`,value:function(){return this._source.on(`add`,this._listeners.add),this._source.on(`remove`,this._listeners.remove),this._source.on(`update`,this._listeners.update),this}},{key:`stop`,value:function(){return this._source.off(`add`,this._listeners.add),this._source.off(`remove`,this._listeners.remove),this._source.off(`update`,this._listeners.update),this}},{key:`_transformItems`,value:function(e){var t;return If(t=this._transformers).call(t,function(e,t){return t(e)},e)}},{key:`_add`,value:function(e,t){t!=null&&this._target.add(this._transformItems(this._source.get(t.items)))}},{key:`_update`,value:function(e,t){t!=null&&this._target.update(this._transformItems(this._source.get(t.items)))}},{key:`_remove`,value:function(e,t){t!=null&&this._target.remove(this._transformItems(t.oldData))}}]),e}(),gp=function(){function e(n){t(this,e),Jd(this,`_transformers`,[]),this._source=n}return qd(e,[{key:`filter`,value:function(e){return this._transformers.push(function(t){return Uf(t).call(t,e)}),this}},{key:`map`,value:function(e){return this._transformers.push(function(t){return Xf(t).call(t,e)}),this}},{key:`flatMap`,value:function(e){return this._transformers.push(function(t){return pp(t).call(t,e)}),this}},{key:`to`,value:function(e){return new hp(this._source,this._transformers,e)}}]),e}(),_p=A,vp=In,yp=nt,bp=function(e,t,n){var r,i;vp(e);try{if(r=yp(e,`return`),!r){if(t===`throw`)throw n;return n}r=_p(r,e)}catch(e){i=!0,r=e}if(t===`throw`)throw n;if(i)throw r;return vp(r),n},xp=In,Sp=bp,Cp=function(e,t,n,r){try{return r?t(xp(n)[0],n[1]):t(n)}catch(t){Sp(e,`throw`,t)}},wp=Bt,Tp=yl,Ep=wp(`iterator`),Dp=Array.prototype,Op=function(e){return e!==void 0&&(Tp.Array===e||Dp[Ep]===e)},kp=Hr,Ap=nt,jp=he,Mp=yl,Np=Bt(`iterator`),Pp=function(e){if(!jp(e))return Ap(e,Np)||Ap(e,`@@iterator`)||Mp[kp(e)]},Fp=A,Ip=$e,Lp=In,Rp=Ye,zp=Pp,Bp=TypeError,Vp=function(e,t){var n=arguments.length<2?zp(e):t;if(Ip(n))return Lp(Fp(n,e));throw new Bp(Rp(e)+` is not iterable`)},Hp=An,Up=A,Wp=xt,Gp=Cp,Kp=Op,qp=si,Jp=wr,Yp=jr,Xp=Vp,Zp=Pp,Qp=Array,$p=function(e){var t=Wp(e),n=qp(this),r=arguments.length,i=r>1?arguments[1]:void 0,a=i!==void 0;a&&(i=Hp(i,r>2?arguments[2]:void 0));var o=Zp(t),s=0,c,l,u,d,f,p;if(o&&!(this===Qp&&Kp(o)))for(d=Xp(t,o),f=d.next,l=n?new this:[];!(u=Up(f,d)).done;s++)p=a?Gp(d,i,[u.value,s],!0):u.value,Yp(l,s,p);else for(c=Jp(t),l=n?new this(c):Qp(c);c>s;s++)p=a?i(t[s],s):t[s],Yp(l,s,p);return l.length=s,l},em=Bt(`iterator`),tm=!1;try{var nm=0,rm={next:function(){return{done:!!nm++}},return:function(){tm=!0}};rm[em]=function(){return this},Array.from(rm,function(){throw 2})}catch{}var im=function(e,t){try{if(!t&&!tm)return!1}catch{return!1}var n=!1;try{var r={};r[em]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch{}return n},am=z,om=$p;am({target:`Array`,stat:!0,forced:!im(function(e){Array.from(e)})},{from:om});var sm=N.Array.from,cm=r(sm),lm=Pp,um=r(lm),dm=r(lm);z({target:`Array`,stat:!0},{isArray:gr});var fm=N.Array.isArray,pm=r(fm);function mm(e){if(pm(e))return e}var hm=O,gm=gr,_m=TypeError,vm=Object.getOwnPropertyDescriptor,ym=hm&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],`length`,{writable:!1}).length=1}catch(e){return e instanceof TypeError}}()?function(e,t){if(gm(e)&&!vm(e,`length`).writable)throw new _m(`Cannot set read only .length`);return e.length=t}:function(e,t){return e.length=t},bm=z,xm=xt,Sm=wr,Cm=ym,wm=Dr;bm({target:`Array`,proto:!0,arity:1,forced:s(function(){return[].push.call({length:4294967296},1)!==4294967297})||!function(){try{Object.defineProperty([],`length`,{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=xm(this),n=Sm(t),r=arguments.length;wm(n+r);for(var i=0;i<r;i++)t[n]=arguments[i],n++;return Cm(t,n),n}});var Tm=ff(`Array`,`push`),Em=Ee,Dm=Tm,Om=Array.prototype,km=function(e){var t=e.push;return e===Om||Em(Om,e)&&t===Om.push?Dm:t},Am=r(km);function jm(e,t){var n=e==null?null:Sd!==void 0&&um(e)||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(Am(s).call(s,r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}var Mm=z,Nm=gr,Pm=si,Fm=M,Im=Hi,Lm=wr,Rm=xe,zm=jr,Bm=Bt,Vm=yi,Hm=kc,Um=Vm(`slice`),Wm=Bm(`species`),Gm=Array,Km=Math.max;Mm({target:`Array`,proto:!0,forced:!Um},{slice:function(e,t){var n=Rm(this),r=Lm(n),i=Im(e,r),a=Im(t===void 0?r:t,r),o,s,c;if(Nm(n)&&(o=n.constructor,Pm(o)&&(o===Gm||Nm(o.prototype))?o=void 0:Fm(o)&&(o=o[Wm],o===null&&(o=void 0)),o===Gm||o===void 0))return Hm(n,i,a);for(s=new(o===void 0?Gm:o)(Km(a-i,0)),c=0;i<a;i++,c++)i in n&&zm(s,c,n[i]);return s.length=c,s}});var qm=ff(`Array`,`slice`),Jm=Ee,Ym=qm,Xm=Array.prototype,Zm=function(e){var t=e.slice;return e===Xm||Jm(Xm,e)&&t===Xm.slice?Ym:t},Qm=Zm,$m=r(Qm),eh=r(sm);function th(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nh(e,t){var n;if(e){if(typeof e==`string`)return th(e,t);var r=$m(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return eh(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return th(e,t)}}function rh(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1
|
+
import{o as e,t}from"./chunk-DD-I1_y5.js";import{n,o as r,r as i,t as a}from"./jsx-runtime-Bz7aoCi7.js";import{a as o,c as s,d as c,f as l,i as u,l as d,n as f,o as p,r as m,s as h,u as g}from"./graph-labels-BRtJE9AE.js";import{t as _}from"./Checkbox-nrf4ISU0.js";var v=i(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),y=i(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),b=i(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),x=i(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),S=i(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),ee=i(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),C=i(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),te=i(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),ne=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.vis=n.vis||{}))})(e,(function(e){function t(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var n=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var i={exports:{}},a=function(e){return e&&e.Math===Math&&e},o=a(typeof globalThis==`object`&&globalThis)||a(typeof window==`object`&&window)||a(typeof self==`object`&&self)||a(typeof n==`object`&&n)||(function(){return this})()||n||Function(`return this`)(),s=function(e){try{return!!e()}catch{return!0}},c=!s(function(){var e=(function(){}).bind();return typeof e!=`function`||e.hasOwnProperty(`prototype`)}),l=c,u=Function.prototype,d=u.apply,f=u.call,p=typeof Reflect==`object`&&Reflect.apply||(l?f.bind(d):function(){return f.apply(d,arguments)}),m=c,h=Function.prototype,g=h.call,_=m&&h.bind.bind(g,g),v=m?_:function(e){return function(){return g.apply(e,arguments)}},y=v,b=y({}.toString),x=y(``.slice),S=function(e){return x(b(e),8,-1)},ee=S,C=v,te=function(e){if(ee(e)===`Function`)return C(e)},ne=typeof document==`object`&&document.all,re={all:ne,IS_HTMLDDA:ne===void 0&&ne!==void 0},w=re,T=w.all,E=w.IS_HTMLDDA?function(e){return typeof e==`function`||e===T}:function(e){return typeof e==`function`},D={},O=!s(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),ie=c,k=Function.prototype.call,A=ie?k.bind(k):function(){return k.apply(k,arguments)},ae={},oe={}.propertyIsEnumerable,se=Object.getOwnPropertyDescriptor;ae.f=se&&!oe.call({1:2},1)?function(e){var t=se(this,e);return!!t&&t.enumerable}:oe;var ce=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},le=v,ue=s,de=S,fe=Object,pe=le(``.split),me=ue(function(){return!fe(`z`).propertyIsEnumerable(0)})?function(e){return de(e)===`String`?pe(e,``):fe(e)}:fe,he=function(e){return e==null},ge=he,_e=TypeError,ve=function(e){if(ge(e))throw new _e(`Can't call method on `+e);return e},ye=me,be=ve,xe=function(e){return ye(be(e))},Se=E,Ce=re,j=Ce.all,M=Ce.IS_HTMLDDA?function(e){return typeof e==`object`?e!==null:Se(e)||e===j}:function(e){return typeof e==`object`?e!==null:Se(e)},N={},we=N,P=o,Te=E,F=function(e){return Te(e)?e:void 0},I=function(e,t){return arguments.length<2?F(we[e])||F(P[e]):we[e]&&we[e][t]||P[e]&&P[e][t]},Ee=v({}.isPrototypeOf),De=typeof navigator<`u`&&String(navigator.userAgent)||``,Oe=o,ke=De,Ae=Oe.process,je=Oe.Deno,Me=Ae&&Ae.versions||je&&je.version,Ne=Me&&Me.v8,Pe,Fe;Ne&&(Pe=Ne.split(`.`),Fe=Pe[0]>0&&Pe[0]<4?1:+(Pe[0]+Pe[1])),!Fe&&ke&&(Pe=ke.match(/Edge\/(\d+)/),(!Pe||Pe[1]>=74)&&(Pe=ke.match(/Chrome\/(\d+)/),Pe&&(Fe=+Pe[1])));var Ie=Fe,Le=Ie,Re=s,ze=o.String,Be=!!Object.getOwnPropertySymbols&&!Re(function(){var e=Symbol(`symbol detection`);return!ze(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Le&&Le<41}),Ve=Be&&!Symbol.sham&&typeof Symbol.iterator==`symbol`,He=I,Ue=E,We=Ee,Ge=Ve,Ke=Object,qe=Ge?function(e){return typeof e==`symbol`}:function(e){var t=He(`Symbol`);return Ue(t)&&We(t.prototype,Ke(e))},Je=String,Ye=function(e){try{return Je(e)}catch{return`Object`}},Xe=E,Ze=Ye,Qe=TypeError,$e=function(e){if(Xe(e))return e;throw new Qe(Ze(e)+` is not a function`)},et=$e,tt=he,nt=function(e,t){var n=e[t];return tt(n)?void 0:et(n)},rt=A,it=E,at=M,ot=TypeError,st=function(e,t){var n,r;if(t===`string`&&it(n=e.toString)&&!at(r=rt(n,e))||it(n=e.valueOf)&&!at(r=rt(n,e))||t!==`string`&&it(n=e.toString)&&!at(r=rt(n,e)))return r;throw new ot(`Can't convert object to primitive value`)},ct={exports:{}},lt=!0,ut=o,dt=Object.defineProperty,ft=function(e,t){try{dt(ut,e,{value:t,configurable:!0,writable:!0})}catch{ut[e]=t}return t},pt=o,mt=ft,ht=`__core-js_shared__`,gt=pt[ht]||mt(ht,{}),_t=gt;(ct.exports=function(e,t){return _t[e]||(_t[e]=t===void 0?{}:t)})(`versions`,[]).push({version:`3.33.2`,mode:`pure`,copyright:`© 2014-2023 Denis Pushkarev (zloirock.ru)`,license:`https://github.com/zloirock/core-js/blob/v3.33.2/LICENSE`,source:`https://github.com/zloirock/core-js`});var vt=ct.exports,yt=ve,bt=Object,xt=function(e){return bt(yt(e))},St=v,Ct=xt,wt=St({}.hasOwnProperty),Tt=Object.hasOwn||function(e,t){return wt(Ct(e),t)},Et=v,Dt=0,Ot=Math.random(),kt=Et(1 .toString),At=function(e){return`Symbol(`+(e===void 0?``:e)+`)_`+kt(++Dt+Ot,36)},jt=o,Mt=vt,Nt=Tt,Pt=At,Ft=Be,It=Ve,Lt=jt.Symbol,Rt=Mt(`wks`),zt=It?Lt.for||Lt:Lt&&Lt.withoutSetter||Pt,Bt=function(e){return Nt(Rt,e)||(Rt[e]=Ft&&Nt(Lt,e)?Lt[e]:zt(`Symbol.`+e)),Rt[e]},Vt=A,Ht=M,Ut=qe,Wt=nt,Gt=st,Kt=Bt,qt=TypeError,Jt=Kt(`toPrimitive`),Yt=function(e,t){if(!Ht(e)||Ut(e))return e;var n=Wt(e,Jt),r;if(n){if(t===void 0&&(t=`default`),r=Vt(n,e,t),!Ht(r)||Ut(r))return r;throw new qt(`Can't convert object to primitive value`)}return t===void 0&&(t=`number`),Gt(e,t)},Xt=qe,Zt=function(e){var t=Yt(e,`string`);return Xt(t)?t:t+``},Qt=o,$t=M,en=Qt.document,tn=$t(en)&&$t(en.createElement),nn=function(e){return tn?en.createElement(e):{}},rn=O,an=s,on=nn,sn=!rn&&!an(function(){return Object.defineProperty(on(`div`),`a`,{get:function(){return 7}}).a!==7}),cn=O,ln=A,un=ae,dn=ce,fn=xe,pn=Zt,mn=Tt,hn=sn,gn=Object.getOwnPropertyDescriptor;D.f=cn?gn:function(e,t){if(e=fn(e),t=pn(t),hn)try{return gn(e,t)}catch{}if(mn(e,t))return dn(!ln(un.f,e,t),e[t])};var _n=s,vn=E,yn=/#|\.prototype\./,bn=function(e,t){var n=Sn[xn(e)];return n===wn?!0:n===Cn?!1:vn(t)?_n(t):!!t},xn=bn.normalize=function(e){return String(e).replace(yn,`.`).toLowerCase()},Sn=bn.data={},Cn=bn.NATIVE=`N`,wn=bn.POLYFILL=`P`,Tn=bn,En=te,Dn=$e,On=c,kn=En(En.bind),An=function(e,t){return Dn(e),t===void 0?e:On?kn(e,t):function(){return e.apply(t,arguments)}},jn={},Mn=O&&s(function(){return Object.defineProperty(function(){},`prototype`,{value:42,writable:!1}).prototype!==42}),Nn=M,Pn=String,Fn=TypeError,In=function(e){if(Nn(e))return e;throw new Fn(Pn(e)+` is not an object`)},Ln=O,Rn=sn,zn=Mn,Bn=In,Vn=Zt,Hn=TypeError,Un=Object.defineProperty,Wn=Object.getOwnPropertyDescriptor,Gn=`enumerable`,L=`configurable`,R=`writable`;jn.f=Ln?zn?function(e,t,n){if(Bn(e),t=Vn(t),Bn(n),typeof e==`function`&&t===`prototype`&&`value`in n&&R in n&&!n[R]){var r=Wn(e,t);r&&r[R]&&(e[t]=n.value,n={configurable:L in n?n[L]:r[L],enumerable:Gn in n?n[Gn]:r[Gn],writable:!1})}return Un(e,t,n)}:Un:function(e,t,n){if(Bn(e),t=Vn(t),Bn(n),Rn)try{return Un(e,t,n)}catch{}if(`get`in n||`set`in n)throw new Hn(`Accessors not supported`);return`value`in n&&(e[t]=n.value),e};var Kn=O,qn=jn,Jn=ce,Yn=Kn?function(e,t,n){return qn.f(e,t,Jn(1,n))}:function(e,t,n){return e[t]=n,e},Xn=o,Zn=p,Qn=te,$n=E,er=D.f,tr=Tn,nr=N,rr=An,ir=Yn,ar=Tt,or=function(e){var t=function(n,r,i){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(n);case 2:return new e(n,r)}return new e(n,r,i)}return Zn(e,this,arguments)};return t.prototype=e.prototype,t},z=function(e,t){var n=e.target,r=e.global,i=e.stat,a=e.proto,o=r?Xn:i?Xn[n]:(Xn[n]||{}).prototype,s=r?nr:nr[n]||ir(nr,n,{})[n],c=s.prototype,l,u,d,f,p,m,h,g,_;for(f in t)l=tr(r?f:n+(i?`.`:`#`)+f,e.forced),u=!l&&o&&ar(o,f),m=s[f],u&&(e.dontCallGetSet?(_=er(o,f),h=_&&_.value):h=o[f]),p=u&&h?h:t[f],!(u&&typeof m==typeof p)&&(g=e.bind&&u?rr(p,Xn):e.wrap&&u?or(p):a&&$n(p)?Qn(p):p,(e.sham||p&&p.sham||m&&m.sham)&&ir(g,`sham`,!0),ir(s,f,g),a&&(d=n+`Prototype`,ar(nr,d)||ir(nr,d,{}),ir(nr[d],f,p),e.real&&c&&(l||!c[f])&&ir(c,f,p)))},sr=z,cr=O,lr=jn.f;sr({target:`Object`,stat:!0,forced:Object.defineProperty!==lr,sham:!cr},{defineProperty:lr});var ur=N.Object,dr=i.exports=function(e,t,n){return ur.defineProperty(e,t,n)};ur.defineProperty.sham&&(dr.sham=!0);var fr=i.exports,pr=fr,mr=r(pr),hr=S,gr=Array.isArray||function(e){return hr(e)===`Array`},_r=Math.ceil,vr=Math.floor,yr=Math.trunc||function(e){var t=+e;return(t>0?vr:_r)(t)},br=function(e){var t=+e;return t!==t||t===0?0:yr(t)},xr=br,Sr=Math.min,Cr=function(e){return e>0?Sr(xr(e),9007199254740991):0},wr=function(e){return Cr(e.length)},Tr=TypeError,Er=9007199254740991,Dr=function(e){if(e>Er)throw Tr(`Maximum allowed index exceeded`);return e},Or=Zt,kr=jn,Ar=ce,jr=function(e,t,n){var r=Or(t);r in e?kr.f(e,r,Ar(0,n)):e[r]=n},Mr=Bt(`toStringTag`),Nr={};Nr[Mr]=`z`;var Pr=String(Nr)===`[object z]`,Fr=Pr,Ir=E,Lr=S,Rr=Bt(`toStringTag`),zr=Object,Br=Lr(function(){return arguments}())===`Arguments`,Vr=function(e,t){try{return e[t]}catch{}},Hr=Fr?Lr:function(e){var t,n,r;return e===void 0?`Undefined`:e===null?`Null`:typeof(n=Vr(t=zr(e),Rr))==`string`?n:Br?Lr(t):(r=Lr(t))===`Object`&&Ir(t.callee)?`Arguments`:r},Ur=v,Wr=E,Gr=gt,Kr=Ur(Function.toString);Wr(Gr.inspectSource)||(Gr.inspectSource=function(e){return Kr(e)});var qr=Gr.inspectSource,Jr=v,Yr=s,Xr=E,Zr=Hr,Qr=I,B=qr,$r=function(){},ei=[],ti=Qr(`Reflect`,`construct`),ni=/^\s*(?:class|function)\b/,ri=Jr(ni.exec),ii=!ni.test($r),ai=function(e){if(!Xr(e))return!1;try{return ti($r,ei,e),!0}catch{return!1}},oi=function(e){if(!Xr(e))return!1;switch(Zr(e)){case`AsyncFunction`:case`GeneratorFunction`:case`AsyncGeneratorFunction`:return!1}try{return ii||!!ri(ni,B(e))}catch{return!0}};oi.sham=!0;var si=!ti||Yr(function(){var e;return ai(ai.call)||!ai(Object)||!ai(function(){e=!0})||e})?oi:ai,ci=gr,li=si,ui=M,di=Bt(`species`),fi=Array,pi=function(e){var t;return ci(e)&&(t=e.constructor,li(t)&&(t===fi||ci(t.prototype))?t=void 0:ui(t)&&(t=t[di],t===null&&(t=void 0))),t===void 0?fi:t},mi=function(e,t){return new(pi(e))(t===0?0:t)},hi=s,gi=Bt,_i=Ie,vi=gi(`species`),yi=function(e){return _i>=51||!hi(function(){var t=[],n=t.constructor={};return n[vi]=function(){return{foo:1}},t[e](Boolean).foo!==1})},bi=z,xi=s,Si=gr,Ci=M,wi=xt,Ti=wr,Ei=Dr,Di=jr,Oi=mi,ki=yi,Ai=Bt,ji=Ie,Mi=Ai(`isConcatSpreadable`),Ni=ji>=51||!xi(function(){var e=[];return e[Mi]=!1,e.concat()[0]!==e}),Pi=function(e){if(!Ci(e))return!1;var t=e[Mi];return t===void 0?Si(e):!!t};bi({target:`Array`,proto:!0,arity:1,forced:!Ni||!ki(`concat`)},{concat:function(e){var t=wi(this),n=Oi(t,0),r=0,i,a,o,s,c;for(i=-1,o=arguments.length;i<o;i++)if(c=i===-1?t:arguments[i],Pi(c))for(s=Ti(c),Ei(r+s),a=0;a<s;a++,r++)a in c&&Di(n,r,c[a]);else Ei(r+1),Di(n,r++,c);return n.length=r,n}});var Fi=Hr,Ii=String,Li=function(e){if(Fi(e)===`Symbol`)throw TypeError(`Cannot convert a Symbol value to a string`);return Ii(e)},Ri={},zi=br,Bi=Math.max,Vi=Math.min,Hi=function(e,t){var n=zi(e);return n<0?Bi(n+t,0):Vi(n,t)},Ui=xe,Wi=Hi,Gi=wr,Ki=function(e){return function(t,n,r){var i=Ui(t),a=Gi(i),o=Wi(r,a),s;if(e&&n!==n){for(;a>o;)if(s=i[o++],s!==s)return!0}else for(;a>o;o++)if((e||o in i)&&i[o]===n)return e||o||0;return!e&&-1}},qi={includes:Ki(!0),indexOf:Ki(!1)},Ji={},Yi=v,Xi=Tt,Zi=xe,Qi=qi.indexOf,$i=Ji,ea=Yi([].push),ta=function(e,t){var n=Zi(e),r=0,i=[],a;for(a in n)!Xi($i,a)&&Xi(n,a)&&ea(i,a);for(;t.length>r;)Xi(n,a=t[r++])&&(~Qi(i,a)||ea(i,a));return i},na=[`constructor`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`],ra=ta,ia=na,aa=Object.keys||function(e){return ra(e,ia)},oa=O,sa=Mn,ca=jn,la=In,ua=xe,da=aa;Ri.f=oa&&!sa?Object.defineProperties:function(e,t){la(e);for(var n=ua(t),r=da(t),i=r.length,a=0,o;i>a;)ca.f(e,o=r[a++],n[o]);return e};var fa=I(`document`,`documentElement`),pa=vt,ma=At,ha=pa(`keys`),ga=function(e){return ha[e]||(ha[e]=ma(e))},_a=In,va=Ri,ya=na,ba=Ji,xa=fa,Sa=nn,Ca=ga,wa=`>`,Ta=`<`,Ea=`prototype`,Da=`script`,Oa=Ca(`IE_PROTO`),ka=function(){},Aa=function(e){return Ta+Da+wa+e+Ta+`/`+Da+wa},ja=function(e){e.write(Aa(``)),e.close();var t=e.parentWindow.Object;return e=null,t},Ma=function(){var e=Sa(`iframe`),t=`java`+Da+`:`,n;return e.style.display=`none`,xa.appendChild(e),e.src=String(t),n=e.contentWindow.document,n.open(),n.write(Aa(`document.F=Object`)),n.close(),n.F},Na,Pa=function(){try{Na=new ActiveXObject(`htmlfile`)}catch{}Pa=typeof document<`u`?document.domain&&Na?ja(Na):Ma():ja(Na);for(var e=ya.length;e--;)delete Pa[Ea][ya[e]];return Pa()};ba[Oa]=!0;var Fa=Object.create||function(e,t){var n;return e===null?n=Pa():(ka[Ea]=_a(e),n=new ka,ka[Ea]=null,n[Oa]=e),t===void 0?n:va.f(n,t)},Ia={},La=ta,Ra=na.concat(`length`,`prototype`);Ia.f=Object.getOwnPropertyNames||function(e){return La(e,Ra)};var za={},Ba=Hi,Va=wr,Ha=jr,Ua=Array,Wa=Math.max,Ga=function(e,t,n){for(var r=Va(e),i=Ba(t,r),a=Ba(n===void 0?r:n,r),o=Ua(Wa(a-i,0)),s=0;i<a;i++,s++)Ha(o,s,e[i]);return o.length=s,o},Ka=S,qa=xe,Ja=Ia.f,Ya=Ga,Xa=typeof window==`object`&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Za=function(e){try{return Ja(e)}catch{return Ya(Xa)}};za.f=function(e){return Xa&&Ka(e)===`Window`?Za(e):Ja(qa(e))};var Qa={};Qa.f=Object.getOwnPropertySymbols;var $a=Yn,eo=function(e,t,n,r){return r&&r.enumerable?e[t]=n:$a(e,t,n),e},to=jn,no=function(e,t,n){return to.f(e,t,n)},ro={};ro.f=Bt;var io=N,ao=Tt,oo=ro,so=jn.f,co=function(e){var t=io.Symbol||={};ao(t,e)||so(t,e,{value:oo.f(e)})},lo=A,uo=I,fo=Bt,po=eo,mo=function(){var e=uo(`Symbol`),t=e&&e.prototype,n=t&&t.valueOf,r=fo(`toPrimitive`);t&&!t[r]&&po(t,r,function(e){return lo(n,this)},{arity:1})},ho=Pr,go=Hr,_o=ho?{}.toString:function(){return`[object `+go(this)+`]`},vo=Pr,yo=jn.f,bo=Yn,xo=Tt,So=_o,Co=Bt(`toStringTag`),wo=function(e,t,n,r){if(e){var i=n?e:e.prototype;xo(i,Co)||yo(i,Co,{configurable:!0,value:t}),r&&!vo&&bo(i,`toString`,So)}},To=o,Eo=E,Do=To.WeakMap,Oo=Eo(Do)&&/native code/.test(String(Do)),ko=o,Ao=M,jo=Yn,Mo=Tt,No=gt,Po=ga,Fo=Ji,Io=`Object already initialized`,Lo=ko.TypeError,Ro=ko.WeakMap,zo,Bo,Vo,Ho=function(e){return Vo(e)?Bo(e):zo(e,{})},Uo=function(e){return function(t){var n;if(!Ao(t)||(n=Bo(t)).type!==e)throw new Lo(`Incompatible receiver, `+e+` required`);return n}};if(Oo||No.state){var Wo=No.state||=new Ro;Wo.get=Wo.get,Wo.has=Wo.has,Wo.set=Wo.set,zo=function(e,t){if(Wo.has(e))throw new Lo(Io);return t.facade=e,Wo.set(e,t),t},Bo=function(e){return Wo.get(e)||{}},Vo=function(e){return Wo.has(e)}}else{var Go=Po(`state`);Fo[Go]=!0,zo=function(e,t){if(Mo(e,Go))throw new Lo(Io);return t.facade=e,jo(e,Go,t),t},Bo=function(e){return Mo(e,Go)?e[Go]:{}},Vo=function(e){return Mo(e,Go)}}var Ko={set:zo,get:Bo,has:Vo,enforce:Ho,getterFor:Uo},qo=An,Jo=v,Yo=me,Xo=xt,Zo=wr,Qo=mi,$o=Jo([].push),es=function(e){var t=e===1,n=e===2,r=e===3,i=e===4,a=e===6,o=e===7,s=e===5||a;return function(c,l,u,d){for(var f=Xo(c),p=Yo(f),m=qo(l,u),h=Zo(p),g=0,_=d||Qo,v=t?_(c,h):n||o?_(c,0):void 0,y,b;h>g;g++)if((s||g in p)&&(y=p[g],b=m(y,g,f),e))if(t)v[g]=b;else if(b)switch(e){case 3:return!0;case 5:return y;case 6:return g;case 2:$o(v,y)}else switch(e){case 4:return!1;case 7:$o(v,y)}return a?-1:r||i?i:v}},ts={forEach:es(0),map:es(1),filter:es(2),some:es(3),every:es(4),find:es(5),findIndex:es(6),filterReject:es(7)},ns=z,rs=o,is=A,as=v,os=O,ss=Be,cs=s,ls=Tt,us=Ee,ds=In,fs=xe,ps=Zt,ms=Li,hs=ce,gs=Fa,_s=aa,vs=Ia,ys=za,bs=Qa,xs=D,Ss=jn,Cs=Ri,ws=ae,Ts=eo,Es=no,Ds=vt,Os=ga,ks=Ji,As=At,js=Bt,Ms=ro,Ns=co,Ps=mo,Fs=wo,Is=Ko,Ls=ts.forEach,Rs=Os(`hidden`),zs=`Symbol`,Bs=`prototype`,Vs=Is.set,Hs=Is.getterFor(zs),Us=Object[Bs],Ws=rs.Symbol,Gs=Ws&&Ws[Bs],Ks=rs.RangeError,qs=rs.TypeError,Js=rs.QObject,Ys=xs.f,Xs=Ss.f,Zs=ys.f,Qs=ws.f,$s=as([].push),ec=Ds(`symbols`),tc=Ds(`op-symbols`),nc=Ds(`wks`),rc=!Js||!Js[Bs]||!Js[Bs].findChild,ic=function(e,t,n){var r=Ys(Us,t);r&&delete Us[t],Xs(e,t,n),r&&e!==Us&&Xs(Us,t,r)},ac=os&&cs(function(){return gs(Xs({},`a`,{get:function(){return Xs(this,`a`,{value:7}).a}})).a!==7})?ic:Xs,oc=function(e,t){var n=ec[e]=gs(Gs);return Vs(n,{type:zs,tag:e,description:t}),os||(n.description=t),n},sc=function(e,t,n){e===Us&&sc(tc,t,n),ds(e);var r=ps(t);return ds(n),ls(ec,r)?(n.enumerable?(ls(e,Rs)&&e[Rs][r]&&(e[Rs][r]=!1),n=gs(n,{enumerable:hs(0,!1)})):(ls(e,Rs)||Xs(e,Rs,hs(1,{})),e[Rs][r]=!0),ac(e,r,n)):Xs(e,r,n)},cc=function(e,t){ds(e);var n=fs(t);return Ls(_s(n).concat(pc(n)),function(t){(!os||is(uc,n,t))&&sc(e,t,n[t])}),e},lc=function(e,t){return t===void 0?gs(e):cc(gs(e),t)},uc=function(e){var t=ps(e),n=is(Qs,this,t);return this===Us&&ls(ec,t)&&!ls(tc,t)?!1:n||!ls(this,t)||!ls(ec,t)||ls(this,Rs)&&this[Rs][t]?n:!0},dc=function(e,t){var n=fs(e),r=ps(t);if(!(n===Us&&ls(ec,r)&&!ls(tc,r))){var i=Ys(n,r);return i&&ls(ec,r)&&!(ls(n,Rs)&&n[Rs][r])&&(i.enumerable=!0),i}},fc=function(e){var t=Zs(fs(e)),n=[];return Ls(t,function(e){!ls(ec,e)&&!ls(ks,e)&&$s(n,e)}),n},pc=function(e){var t=e===Us,n=Zs(t?tc:fs(e)),r=[];return Ls(n,function(e){ls(ec,e)&&(!t||ls(Us,e))&&$s(r,ec[e])}),r};ss||(Ws=function(){if(us(Gs,this))throw new qs(`Symbol is not a constructor`);var e=!arguments.length||arguments[0]===void 0?void 0:ms(arguments[0]),t=As(e),n=function(e){var r=this===void 0?rs:this;r===Us&&is(n,tc,e),ls(r,Rs)&&ls(r[Rs],t)&&(r[Rs][t]=!1);var i=hs(1,e);try{ac(r,t,i)}catch(e){if(!(e instanceof Ks))throw e;ic(r,t,i)}};return os&&rc&&ac(Us,t,{configurable:!0,set:n}),oc(t,e)},Gs=Ws[Bs],Ts(Gs,`toString`,function(){return Hs(this).tag}),Ts(Ws,`withoutSetter`,function(e){return oc(As(e),e)}),ws.f=uc,Ss.f=sc,Cs.f=cc,xs.f=dc,vs.f=ys.f=fc,bs.f=pc,Ms.f=function(e){return oc(js(e),e)},os&&Es(Gs,`description`,{configurable:!0,get:function(){return Hs(this).description}})),ns({global:!0,constructor:!0,wrap:!0,forced:!ss,sham:!ss},{Symbol:Ws}),Ls(_s(nc),function(e){Ns(e)}),ns({target:zs,stat:!0,forced:!ss},{useSetter:function(){rc=!0},useSimple:function(){rc=!1}}),ns({target:`Object`,stat:!0,forced:!ss,sham:!os},{create:lc,defineProperty:sc,defineProperties:cc,getOwnPropertyDescriptor:dc}),ns({target:`Object`,stat:!0,forced:!ss},{getOwnPropertyNames:fc}),Ps(),Fs(Ws,zs),ks[Rs]=!0;var mc=Be&&!!Symbol.for&&!!Symbol.keyFor,hc=z,gc=I,_c=Tt,vc=Li,yc=vt,bc=mc,xc=yc(`string-to-symbol-registry`),V=yc(`symbol-to-string-registry`);hc({target:`Symbol`,stat:!0,forced:!bc},{for:function(e){var t=vc(e);if(_c(xc,t))return xc[t];var n=gc(`Symbol`)(t);return xc[t]=n,V[n]=t,n}});var Sc=z,Cc=Tt,wc=qe,Tc=Ye,Ec=vt,Dc=mc,Oc=Ec(`symbol-to-string-registry`);Sc({target:`Symbol`,stat:!0,forced:!Dc},{keyFor:function(e){if(!wc(e))throw TypeError(Tc(e)+` is not a symbol`);if(Cc(Oc,e))return Oc[e]}});var kc=v([].slice),Ac=v,jc=gr,Mc=E,Nc=S,Pc=Li,Fc=Ac([].push),Ic=function(e){if(Mc(e))return e;if(jc(e)){for(var t=e.length,n=[],r=0;r<t;r++){var i=e[r];typeof i==`string`?Fc(n,i):(typeof i==`number`||Nc(i)===`Number`||Nc(i)===`String`)&&Fc(n,Pc(i))}var a=n.length,o=!0;return function(e,t){if(o)return o=!1,t;if(jc(this))return t;for(var r=0;r<a;r++)if(n[r]===e)return t}}},Lc=z,Rc=I,zc=p,Bc=A,Vc=v,Hc=s,Uc=E,Wc=qe,Gc=kc,Kc=Ic,qc=Be,Jc=String,Yc=Rc(`JSON`,`stringify`),Xc=Vc(/./.exec),Zc=Vc(``.charAt),Qc=Vc(``.charCodeAt),$c=Vc(``.replace),el=Vc(1 .toString),tl=/[\uD800-\uDFFF]/g,nl=/^[\uD800-\uDBFF]$/,rl=/^[\uDC00-\uDFFF]$/,il=!qc||Hc(function(){var e=Rc(`Symbol`)(`stringify detection`);return Yc([e])!==`[null]`||Yc({a:e})!==`{}`||Yc(Object(e))!==`{}`}),al=Hc(function(){return Yc(`\udf06\ud834`)!==`"\\udf06\\ud834"`||Yc(`\udead`)!==`"\\udead"`}),ol=function(e,t){var n=Gc(arguments),r=Kc(t);if(!(!Uc(r)&&(e===void 0||Wc(e))))return n[1]=function(e,t){if(Uc(r)&&(t=Bc(r,this,Jc(e),t)),!Wc(t))return t},zc(Yc,null,n)},sl=function(e,t,n){var r=Zc(n,t-1),i=Zc(n,t+1);return Xc(nl,e)&&!Xc(rl,i)||Xc(rl,e)&&!Xc(nl,r)?`\\u`+el(Qc(e,0),16):e};Yc&&Lc({target:`JSON`,stat:!0,arity:3,forced:il||al},{stringify:function(e,t,n){var r=Gc(arguments),i=zc(il?ol:Yc,null,r);return al&&typeof i==`string`?$c(i,tl,sl):i}});var cl=z,ll=Be,ul=s,dl=Qa,fl=xt;cl({target:`Object`,stat:!0,forced:!ll||ul(function(){dl.f(1)})},{getOwnPropertySymbols:function(e){var t=dl.f;return t?t(fl(e)):[]}}),co(`asyncIterator`),co(`hasInstance`),co(`isConcatSpreadable`),co(`iterator`),co(`match`),co(`matchAll`),co(`replace`),co(`search`),co(`species`),co(`split`);var pl=co,ml=mo;pl(`toPrimitive`),ml();var hl=I,gl=co,_l=wo;gl(`toStringTag`),_l(hl(`Symbol`),`Symbol`),co(`unscopables`),wo(o.JSON,`JSON`,!0);var vl=N.Symbol,yl={},bl=O,xl=Tt,Sl=Function.prototype,Cl=bl&&Object.getOwnPropertyDescriptor,wl=xl(Sl,`name`),Tl={EXISTS:wl,PROPER:wl&&(function(){}).name===`something`,CONFIGURABLE:wl&&(!bl||bl&&Cl(Sl,`name`).configurable)},El=!s(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Dl=Tt,Ol=E,kl=xt,Al=ga,jl=El,Ml=Al(`IE_PROTO`),Nl=Object,Pl=Nl.prototype,Fl=jl?Nl.getPrototypeOf:function(e){var t=kl(e);if(Dl(t,Ml))return t[Ml];var n=t.constructor;return Ol(n)&&t instanceof n?n.prototype:t instanceof Nl?Pl:null},Il=s,Ll=E,Rl=M,zl=Fa,Bl=Fl,Vl=eo,Hl=Bt(`iterator`),Ul=!1,Wl,Gl,Kl;[].keys&&(Kl=[].keys(),`next`in Kl?(Gl=Bl(Bl(Kl)),Gl!==Object.prototype&&(Wl=Gl)):Ul=!0),Wl=!Rl(Wl)||Il(function(){var e={};return Wl[Hl].call(e)!==e})?{}:zl(Wl),Ll(Wl[Hl])||Vl(Wl,Hl,function(){return this});var ql={IteratorPrototype:Wl,BUGGY_SAFARI_ITERATORS:Ul},Jl=ql.IteratorPrototype,Yl=Fa,Xl=ce,Zl=wo,Ql=yl,$l=function(){return this},eu=function(e,t,n,r){var i=t+` Iterator`;return e.prototype=Yl(Jl,{next:Xl(+!r,n)}),Zl(e,i,!1,!0),Ql[i]=$l,e},tu=v,nu=$e,ru=function(e,t,n){try{return tu(nu(Object.getOwnPropertyDescriptor(e,t)[n]))}catch{}},iu=E,au=String,ou=TypeError,su=function(e){if(typeof e==`object`||iu(e))return e;throw new ou(`Can't set `+au(e)+` as a prototype`)},cu=ru,lu=In,uu=su,du=Object.setPrototypeOf||(`__proto__`in{}?function(){var e=!1,t={},n;try{n=cu(Object.prototype,`__proto__`,`set`),n(t,[]),e=t instanceof Array}catch{}return function(t,r){return lu(t),uu(r),e?n(t,r):t.__proto__=r,t}}():void 0),fu=z,pu=A,mu=Tl,hu=eu,gu=Fl,_u=wo,vu=eo,yu=Bt,bu=yl,xu=ql,Su=mu.PROPER;mu.CONFIGURABLE,xu.IteratorPrototype;var Cu=xu.BUGGY_SAFARI_ITERATORS,wu=yu(`iterator`),Tu=`keys`,Eu=`values`,Du=`entries`,Ou=function(){return this},ku=function(e,t,n,r,i,a,o){hu(n,t,r);var s=function(e){if(e===i&&f)return f;if(!Cu&&e&&e in u)return u[e];switch(e){case Tu:return function(){return new n(this,e)};case Eu:return function(){return new n(this,e)};case Du:return function(){return new n(this,e)}}return function(){return new n(this)}},c=t+` Iterator`,l=!1,u=e.prototype,d=u[wu]||u[`@@iterator`]||i&&u[i],f=!Cu&&d||s(i),p=t===`Array`&&u.entries||d,m,h,g;if(p&&(m=gu(p.call(new e)),m!==Object.prototype&&m.next&&(_u(m,c,!0,!0),bu[c]=Ou)),Su&&i===Eu&&d&&d.name!==Eu&&(l=!0,f=function(){return pu(d,this)}),i)if(h={values:s(Eu),keys:a?f:s(Tu),entries:s(Du)},o)for(g in h)(Cu||l||!(g in u))&&vu(u,g,h[g]);else fu({target:t,proto:!0,forced:Cu||l},h);return o&&u[wu]!==f&&vu(u,wu,f,{name:i}),bu[t]=f,h},Au=function(e,t){return{value:e,done:t}},ju=xe,Mu=yl,Nu=Ko;jn.f;var Pu=ku,Fu=Au,Iu=`Array Iterator`,Lu=Nu.set,Ru=Nu.getterFor(Iu);Pu(Array,`Array`,function(e,t){Lu(this,{type:Iu,target:ju(e),index:0,kind:t})},function(){var e=Ru(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=void 0,Fu(void 0,!0);switch(e.kind){case`keys`:return Fu(n,!1);case`values`:return Fu(t[n],!1)}return Fu([n,t[n]],!1)},`values`),Mu.Arguments=Mu.Array;var zu={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Bu=o,Vu=Hr,Hu=Yn,Uu=yl,Wu=Bt(`toStringTag`);for(var Gu in zu){var Ku=Bu[Gu],qu=Ku&&Ku.prototype;qu&&Vu(qu)!==Wu&&Hu(qu,Wu,Gu),Uu[Gu]=Uu.Array}var Ju=vl,Yu=Bt,Xu=jn.f,Zu=Yu(`metadata`),Qu=Function.prototype;Qu[Zu]===void 0&&Xu(Qu,Zu,{value:null}),co(`asyncDispose`),co(`dispose`),co(`metadata`);var $u=Ju,ed=I,td=v,nd=ed(`Symbol`),rd=nd.keyFor,id=td(nd.prototype.valueOf),ad=nd.isRegisteredSymbol||function(e){try{return rd(id(e))!==void 0}catch{return!1}};z({target:`Symbol`,stat:!0},{isRegisteredSymbol:ad});for(var od=vt,sd=I,cd=v,ld=qe,ud=Bt,dd=sd(`Symbol`),fd=dd.isWellKnownSymbol,pd=sd(`Object`,`getOwnPropertyNames`),md=cd(dd.prototype.valueOf),hd=od(`wks`),gd=0,_d=pd(dd),vd=_d.length;gd<vd;gd++)try{var yd=_d[gd];ld(dd[yd])&&ud(yd)}catch{}var bd=function(e){if(fd&&fd(e))return!0;try{for(var t=md(e),n=0,r=pd(hd),i=r.length;n<i;n++)if(hd[r[n]]==t)return!0}catch{}return!1};z({target:`Symbol`,stat:!0,forced:!0},{isWellKnownSymbol:bd}),co(`matcher`),co(`observable`),z({target:`Symbol`,stat:!0,name:`isRegisteredSymbol`},{isRegistered:ad}),z({target:`Symbol`,stat:!0,name:`isWellKnownSymbol`,forced:!0},{isWellKnown:bd}),co(`metadataKey`),co(`patternMatch`),co(`replaceAll`);var xd=$u,Sd=r(xd),Cd=v,wd=br,Td=Li,Ed=ve,Dd=Cd(``.charAt),Od=Cd(``.charCodeAt),kd=Cd(``.slice),Ad=function(e){return function(t,n){var r=Td(Ed(t)),i=wd(n),a=r.length,o,s;return i<0||i>=a?e?``:void 0:(o=Od(r,i),o<55296||o>56319||i+1===a||(s=Od(r,i+1))<56320||s>57343?e?Dd(r,i):o:e?kd(r,i,i+2):(o-55296<<10)+(s-56320)+65536)}},jd={codeAt:Ad(!1),charAt:Ad(!0)}.charAt,Md=Li,Nd=Ko,Pd=ku,Fd=Au,Id=`String Iterator`,Ld=Nd.set,Rd=Nd.getterFor(Id);Pd(String,`String`,function(e){Ld(this,{type:Id,string:Md(e),index:0})},function(){var e=Rd(this),t=e.string,n=e.index,r;return n>=t.length?Fd(void 0,!0):(r=jd(t,n),e.index+=r.length,Fd(r,!1))});var zd=ro.f(`iterator`),Bd=zd,Vd=r(Bd);function Hd(e){"@babel/helpers - typeof";return Hd=typeof Sd==`function`&&typeof Vd==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Sd==`function`&&e.constructor===Sd&&e!==Sd.prototype?`symbol`:typeof e},Hd(e)}var Ud=r(ro.f(`toPrimitive`));function Wd(e,t){if(Hd(e)!==`object`||e===null)return e;var n=e[Ud];if(n!==void 0){var r=n.call(e,t||`default`);if(Hd(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Gd(e){var t=Wd(e,`string`);return Hd(t)===`symbol`?t:String(t)}function Kd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),mr(e,Gd(r.key),r)}}function qd(e,t,n){return t&&Kd(e.prototype,t),n&&Kd(e,n),mr(e,`prototype`,{writable:!1}),e}function Jd(e,t,n){return t=Gd(t),t in e?mr(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Yd=v,Xd=$e,Zd=M,Qd=Tt,$d=kc,ef=c,tf=Function,nf=Yd([].concat),rf=Yd([].join),af={},of=function(e,t,n){if(!Qd(af,t)){for(var r=[],i=0;i<t;i++)r[i]=`a[`+i+`]`;af[t]=tf(`C,a`,`return new C(`+rf(r,`,`)+`)`)}return af[t](e,n)},sf=ef?tf.bind:function(e){var t=Xd(this),n=t.prototype,r=$d(arguments,1),i=function(){var n=nf(r,$d(arguments));return this instanceof i?of(t,n.length,n):t.apply(e,n)};return Zd(n)&&(i.prototype=n),i},cf=z,lf=sf;cf({target:`Function`,proto:!0,forced:Function.bind!==lf},{bind:lf});var uf=o,df=N,ff=function(e,t){var n=df[e+`Prototype`],r=n&&n[t];if(r)return r;var i=uf[e],a=i&&i.prototype;return a&&a[t]},pf=ff(`Function`,`bind`),mf=Ee,hf=pf,gf=Function.prototype,_f=function(e){var t=e.bind;return e===gf||mf(gf,e)&&t===gf.bind?hf:t},vf=r(_f),yf=$e,bf=xt,xf=me,Sf=wr,Cf=TypeError,wf=function(e){return function(t,n,r,i){yf(n);var a=bf(t),o=xf(a),s=Sf(a),c=e?s-1:0,l=e?-1:1;if(r<2)for(;;){if(c in o){i=o[c],c+=l;break}if(c+=l,e?c<0:s<=c)throw new Cf(`Reduce of empty array with no initial value`)}for(;e?c>=0:s>c;c+=l)c in o&&(i=n(i,o[c],c,a));return i}},Tf={left:wf(!1),right:wf(!0)},H=s,Ef=function(e,t){var n=[][e];return!!n&&H(function(){n.call(null,t||function(){return 1},1)})},Df=S(o.process)===`process`,Of=z,kf=Tf.left,Af=Ef,jf=Ie;Of({target:`Array`,proto:!0,forced:!Df&&jf>79&&jf<83||!Af(`reduce`)},{reduce:function(e){var t=arguments.length;return kf(this,e,t,t>1?arguments[1]:void 0)}});var Mf=ff(`Array`,`reduce`),Nf=Ee,Pf=Mf,Ff=Array.prototype,If=r(function(e){var t=e.reduce;return e===Ff||Nf(Ff,e)&&t===Ff.reduce?Pf:t}),Lf=z,Rf=ts.filter;Lf({target:`Array`,proto:!0,forced:!yi(`filter`)},{filter:function(e){return Rf(this,e,arguments.length>1?arguments[1]:void 0)}});var zf=ff(`Array`,`filter`),Bf=Ee,Vf=zf,Hf=Array.prototype,Uf=r(function(e){var t=e.filter;return e===Hf||Bf(Hf,e)&&t===Hf.filter?Vf:t}),Wf=z,Gf=ts.map;Wf({target:`Array`,proto:!0,forced:!yi(`map`)},{map:function(e){return Gf(this,e,arguments.length>1?arguments[1]:void 0)}});var Kf=ff(`Array`,`map`),qf=Ee,Jf=Kf,Yf=Array.prototype,Xf=r(function(e){var t=e.map;return e===Yf||qf(Yf,e)&&t===Yf.map?Jf:t}),Zf=gr,Qf=wr,$f=Dr,ep=An,tp=function(e,t,n,r,i,a,o,s){for(var c=i,l=0,u=o?ep(o,s):!1,d,f;l<r;)l in n&&(d=u?u(n[l],l,t):n[l],a>0&&Zf(d)?(f=Qf(d),c=tp(e,t,d,f,c,a-1)-1):($f(c+1),e[c]=d),c++),l++;return c},np=tp,rp=z,ip=np,ap=$e,op=xt,sp=wr,cp=mi;rp({target:`Array`,proto:!0},{flatMap:function(e){var t=op(this),n=sp(t),r;return ap(e),r=cp(t,0),r.length=ip(r,t,t,n,0,1,e,arguments.length>1?arguments[1]:void 0),r}});var lp=ff(`Array`,`flatMap`),up=Ee,dp=lp,fp=Array.prototype,pp=r(function(e){var t=e.flatMap;return e===fp||up(fp,e)&&t===fp.flatMap?dp:t});function mp(e){return new gp(e)}var hp=function(){function e(n,r,i){var a,o,s;t(this,e),Jd(this,`_listeners`,{add:vf(a=this._add).call(a,this),remove:vf(o=this._remove).call(o,this),update:vf(s=this._update).call(s,this)}),this._source=n,this._transformers=r,this._target=i}return qd(e,[{key:`all`,value:function(){return this._target.update(this._transformItems(this._source.get())),this}},{key:`start`,value:function(){return this._source.on(`add`,this._listeners.add),this._source.on(`remove`,this._listeners.remove),this._source.on(`update`,this._listeners.update),this}},{key:`stop`,value:function(){return this._source.off(`add`,this._listeners.add),this._source.off(`remove`,this._listeners.remove),this._source.off(`update`,this._listeners.update),this}},{key:`_transformItems`,value:function(e){var t;return If(t=this._transformers).call(t,function(e,t){return t(e)},e)}},{key:`_add`,value:function(e,t){t!=null&&this._target.add(this._transformItems(this._source.get(t.items)))}},{key:`_update`,value:function(e,t){t!=null&&this._target.update(this._transformItems(this._source.get(t.items)))}},{key:`_remove`,value:function(e,t){t!=null&&this._target.remove(this._transformItems(t.oldData))}}]),e}(),gp=function(){function e(n){t(this,e),Jd(this,`_transformers`,[]),this._source=n}return qd(e,[{key:`filter`,value:function(e){return this._transformers.push(function(t){return Uf(t).call(t,e)}),this}},{key:`map`,value:function(e){return this._transformers.push(function(t){return Xf(t).call(t,e)}),this}},{key:`flatMap`,value:function(e){return this._transformers.push(function(t){return pp(t).call(t,e)}),this}},{key:`to`,value:function(e){return new hp(this._source,this._transformers,e)}}]),e}(),_p=A,vp=In,yp=nt,bp=function(e,t,n){var r,i;vp(e);try{if(r=yp(e,`return`),!r){if(t===`throw`)throw n;return n}r=_p(r,e)}catch(e){i=!0,r=e}if(t===`throw`)throw n;if(i)throw r;return vp(r),n},xp=In,Sp=bp,Cp=function(e,t,n,r){try{return r?t(xp(n)[0],n[1]):t(n)}catch(t){Sp(e,`throw`,t)}},wp=Bt,Tp=yl,Ep=wp(`iterator`),Dp=Array.prototype,Op=function(e){return e!==void 0&&(Tp.Array===e||Dp[Ep]===e)},kp=Hr,Ap=nt,jp=he,Mp=yl,Np=Bt(`iterator`),Pp=function(e){if(!jp(e))return Ap(e,Np)||Ap(e,`@@iterator`)||Mp[kp(e)]},Fp=A,Ip=$e,Lp=In,Rp=Ye,zp=Pp,Bp=TypeError,Vp=function(e,t){var n=arguments.length<2?zp(e):t;if(Ip(n))return Lp(Fp(n,e));throw new Bp(Rp(e)+` is not iterable`)},Hp=An,Up=A,Wp=xt,Gp=Cp,Kp=Op,qp=si,Jp=wr,Yp=jr,Xp=Vp,Zp=Pp,Qp=Array,$p=function(e){var t=Wp(e),n=qp(this),r=arguments.length,i=r>1?arguments[1]:void 0,a=i!==void 0;a&&(i=Hp(i,r>2?arguments[2]:void 0));var o=Zp(t),s=0,c,l,u,d,f,p;if(o&&!(this===Qp&&Kp(o)))for(d=Xp(t,o),f=d.next,l=n?new this:[];!(u=Up(f,d)).done;s++)p=a?Gp(d,i,[u.value,s],!0):u.value,Yp(l,s,p);else for(c=Jp(t),l=n?new this(c):Qp(c);c>s;s++)p=a?i(t[s],s):t[s],Yp(l,s,p);return l.length=s,l},em=Bt(`iterator`),tm=!1;try{var nm=0,rm={next:function(){return{done:!!nm++}},return:function(){tm=!0}};rm[em]=function(){return this},Array.from(rm,function(){throw 2})}catch{}var im=function(e,t){try{if(!t&&!tm)return!1}catch{return!1}var n=!1;try{var r={};r[em]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch{}return n},am=z,om=$p;am({target:`Array`,stat:!0,forced:!im(function(e){Array.from(e)})},{from:om});var sm=N.Array.from,cm=r(sm),lm=Pp,um=r(lm),dm=r(lm);z({target:`Array`,stat:!0},{isArray:gr});var fm=N.Array.isArray,pm=r(fm);function mm(e){if(pm(e))return e}var hm=O,gm=gr,_m=TypeError,vm=Object.getOwnPropertyDescriptor,ym=hm&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],`length`,{writable:!1}).length=1}catch(e){return e instanceof TypeError}}()?function(e,t){if(gm(e)&&!vm(e,`length`).writable)throw new _m(`Cannot set read only .length`);return e.length=t}:function(e,t){return e.length=t},bm=z,xm=xt,Sm=wr,Cm=ym,wm=Dr;bm({target:`Array`,proto:!0,arity:1,forced:s(function(){return[].push.call({length:4294967296},1)!==4294967297})||!function(){try{Object.defineProperty([],`length`,{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=xm(this),n=Sm(t),r=arguments.length;wm(n+r);for(var i=0;i<r;i++)t[n]=arguments[i],n++;return Cm(t,n),n}});var Tm=ff(`Array`,`push`),Em=Ee,Dm=Tm,Om=Array.prototype,km=function(e){var t=e.push;return e===Om||Em(Om,e)&&t===Om.push?Dm:t},Am=r(km);function jm(e,t){var n=e==null?null:Sd!==void 0&&um(e)||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(Am(s).call(s,r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}var Mm=z,Nm=gr,Pm=si,Fm=M,Im=Hi,Lm=wr,Rm=xe,zm=jr,Bm=Bt,Vm=yi,Hm=kc,Um=Vm(`slice`),Wm=Bm(`species`),Gm=Array,Km=Math.max;Mm({target:`Array`,proto:!0,forced:!Um},{slice:function(e,t){var n=Rm(this),r=Lm(n),i=Im(e,r),a=Im(t===void 0?r:t,r),o,s,c;if(Nm(n)&&(o=n.constructor,Pm(o)&&(o===Gm||Nm(o.prototype))?o=void 0:Fm(o)&&(o=o[Wm],o===null&&(o=void 0)),o===Gm||o===void 0))return Hm(n,i,a);for(s=new(o===void 0?Gm:o)(Km(a-i,0)),c=0;i<a;i++,c++)i in n&&zm(s,c,n[i]);return s.length=c,s}});var qm=ff(`Array`,`slice`),Jm=Ee,Ym=qm,Xm=Array.prototype,Zm=function(e){var t=e.slice;return e===Xm||Jm(Xm,e)&&t===Xm.slice?Ym:t},Qm=Zm,$m=r(Qm),eh=r(sm);function th(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nh(e,t){var n;if(e){if(typeof e==`string`)return th(e,t);var r=$m(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return eh(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return th(e,t)}}function rh(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ih(e,t){return mm(e)||jm(e,t)||nh(e,t)||rh()}function ah(e){if(pm(e))return th(e)}function oh(e){if(Sd!==void 0&&um(e)!=null||e[`@@iterator`]!=null)return eh(e)}function sh(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ch(e){return ah(e)||oh(e)||nh(e)||sh()}var lh=r(Ju),uh=ff(`Array`,`concat`),dh=Ee,fh=uh,ph=Array.prototype,mh=r(function(e){var t=e.concat;return e===ph||dh(ph,e)&&t===ph.concat?fh:t}),hh=r(Zm),gh=I,_h=v,vh=Ia,yh=Qa,bh=In,xh=_h([].concat),Sh=gh(`Reflect`,`ownKeys`)||function(e){var t=vh.f(bh(e)),n=yh.f;return n?xh(t,n(e)):t};z({target:`Reflect`,stat:!0},{ownKeys:Sh});var Ch=N.Reflect.ownKeys,wh=r(Ch),Th=r(fm),Eh=z,Dh=xt,Oh=aa;Eh({target:`Object`,stat:!0,forced:s(function(){Oh(1)})},{keys:function(e){return Oh(Dh(e))}});var kh=N.Object.keys,Ah=r(kh),jh=ts.forEach,Mh=Ef(`forEach`)?[].forEach:function(e){return jh(this,e,arguments.length>1?arguments[1]:void 0)},Nh=z,Ph=Mh;Nh({target:`Array`,proto:!0,forced:[].forEach!==Ph},{forEach:Ph});var Fh=ff(`Array`,`forEach`),Ih=Hr,Lh=Tt,Rh=Ee,zh=Fh,Bh=Array.prototype,Vh={DOMTokenList:!0,NodeList:!0},Hh=function(e){var t=e.forEach;return e===Bh||Rh(Bh,e)&&t===Bh.forEach||Lh(Vh,Ih(e))?zh:t},Uh=r(Hh),Wh=z,Gh=v,Kh=gr,qh=Gh([].reverse),Jh=[1,2];Wh({target:`Array`,proto:!0,forced:String(Jh)===String(Jh.reverse())},{reverse:function(){return Kh(this)&&(this.length=this.length),qh(this)}});var Yh=ff(`Array`,`reverse`),Xh=Ee,Zh=Yh,Qh=Array.prototype,$h=function(e){var t=e.reverse;return e===Qh||Xh(Qh,e)&&t===Qh.reverse?Zh:t},eg=r($h),tg=Ye,ng=TypeError,rg=function(e,t){if(!delete e[t])throw new ng(`Cannot delete property `+tg(t)+` of `+tg(e))},ig=z,ag=xt,og=Hi,sg=br,cg=wr,lg=ym,ug=Dr,dg=mi,fg=jr,pg=rg,mg=yi(`splice`),hg=Math.max,gg=Math.min;ig({target:`Array`,proto:!0,forced:!mg},{splice:function(e,t){var n=ag(this),r=cg(n),i=og(e,r),a=arguments.length,o,s,c,l,u,d;for(a===0?o=s=0:a===1?(o=0,s=r-i):(o=a-2,s=gg(hg(sg(t),0),r-i)),ug(r+o-s),c=dg(n,s),l=0;l<s;l++)u=i+l,u in n&&fg(c,l,n[u]);if(c.length=s,o<s){for(l=i;l<r-s;l++)u=l+s,d=l+o,u in n?n[d]=n[u]:pg(n,d);for(l=r;l>r-s+o;l--)pg(n,l-1)}else if(o>s)for(l=r-s;l>i;l--)u=l+s-1,d=l+o-1,u in n?n[d]=n[u]:pg(n,d);for(l=0;l<o;l++)n[l+i]=arguments[l+2];return lg(n,r-s+o),c}});var _g=ff(`Array`,`splice`),vg=Ee,yg=_g,bg=Array.prototype,xg=r(function(e){var t=e.splice;return e===bg||vg(bg,e)&&t===bg.splice?yg:t}),Sg=O,Cg=v,wg=A,Tg=s,Eg=aa,Dg=Qa,Og=ae,kg=xt,Ag=me,jg=Object.assign,Mg=Object.defineProperty,Ng=Cg([].concat),Pg=!jg||Tg(function(){if(Sg&&jg({b:1},jg(Mg({},`a`,{enumerable:!0,get:function(){Mg(this,`b`,{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var e={},t={},n=Symbol(`assign detection`),r=`abcdefghijklmnopqrst`;return e[n]=7,r.split(``).forEach(function(e){t[e]=e}),jg({},e)[n]!==7||Eg(jg({},t)).join(``)!==r})?function(e,t){for(var n=kg(e),r=arguments.length,i=1,a=Dg.f,o=Og.f;r>i;)for(var s=Ag(arguments[i++]),c=a?Ng(Eg(s),a(s)):Eg(s),l=c.length,u=0,d;l>u;)d=c[u++],(!Sg||wg(o,s,d))&&(n[d]=s[d]);return n}:jg,Fg=z,Ig=Pg;Fg({target:`Object`,stat:!0,arity:2,forced:Object.assign!==Ig},{assign:Ig});var Lg=N.Object.assign,Rg=r(Lg),zg=z,Bg=s,Vg=xt,Hg=Fl,Ug=El;zg({target:`Object`,stat:!0,forced:Bg(function(){Hg(1)}),sham:!Ug},{getPrototypeOf:function(e){return Hg(Vg(e))}});var Wg=N.Object.getPrototypeOf;z({target:`Object`,stat:!0,sham:!O},{create:Fa});var Gg=N.Object,Kg=function(e,t){return Gg.create(e,t)},qg=r(Kg),Jg=N,Yg=p;Jg.JSON||={stringify:JSON.stringify};var Xg=r(function(e,t,n){return Yg(Jg.JSON.stringify,null,arguments)}),Zg=typeof Bun==`function`&&Bun&&typeof Bun.version==`string`,Qg=TypeError,$g=function(e,t){if(e<t)throw new Qg(`Not enough arguments`);return e},e_=o,t_=p,n_=E,r_=Zg,i_=De,a_=kc,o_=$g,s_=e_.Function,c_=/MSIE .\./.test(i_)||r_&&(function(){var e=e_.Bun.version.split(`.`);return e.length<3||e[0]===`0`&&(e[1]<3||e[1]===`3`&&e[2]===`0`)})(),l_=function(e,t){var n=t?2:1;return c_?function(r,i){var a=o_(arguments.length,1)>n,o=n_(r)?r:s_(r),s=a?a_(arguments,n):[],c=a?function(){t_(o,this,s)}:o;return t?e(c,i):e(c)}:e},u_=z,d_=o,f_=l_(d_.setInterval,!0);u_({global:!0,bind:!0,forced:d_.setInterval!==f_},{setInterval:f_});var p_=z,m_=o,h_=l_(m_.setTimeout,!0);p_({global:!0,bind:!0,forced:m_.setTimeout!==h_},{setTimeout:h_});var g_=N.setTimeout,__=r(g_),v_={exports:{}};(function(e){function t(e){if(e)return n(e);this._callbacks=new Map}function n(e){return Object.assign(e,t.prototype),e._callbacks=new Map,e}t.prototype.on=function(e,t){let n=this._callbacks.get(e)??[];return n.push(t),this._callbacks.set(e,n),this},t.prototype.once=function(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return n.fn=t,this.on(e,n),this},t.prototype.off=function(e,t){if(e===void 0&&t===void 0)return this._callbacks.clear(),this;if(t===void 0)return this._callbacks.delete(e),this;let n=this._callbacks.get(e);if(n){for(let[e,r]of n.entries())if(r===t||r.fn===t){n.splice(e,1);break}n.length===0?this._callbacks.delete(e):this._callbacks.set(e,n)}return this},t.prototype.emit=function(e,...t){let n=this._callbacks.get(e);if(n){let e=[...n];for(let n of e)n.apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks.get(e)??[]},t.prototype.listenerCount=function(e){if(e)return this.listeners(e).length;let t=0;for(let e of this._callbacks.values())t+=e.length;return t},t.prototype.hasListeners=function(e){return this.listenerCount(e)>0},t.prototype.addEventListener=t.prototype.on,t.prototype.removeListener=t.prototype.off,t.prototype.removeEventListener=t.prototype.off,t.prototype.removeAllListeners=t.prototype.off,e.exports=t})(v_);var y_=v_.exports,b_=r(y_);function x_(){return x_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},x_.apply(this,arguments)}function S_(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function C_(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}var w_=typeof Object.assign==`function`?Object.assign:function(e){if(e==null)throw TypeError(`Cannot convert undefined or null to object`);for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!=null)for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])}return t},T_=[``,`webkit`,`Moz`,`MS`,`ms`,`o`],E_=typeof document>`u`?{style:{}}:document.createElement(`div`),D_=`function`,O_=Math.round,k_=Math.abs,A_=Date.now;function j_(e,t){for(var n,r,i=t[0].toUpperCase()+t.slice(1),a=0;a<T_.length;){if(n=T_[a],r=n?n+i:t,r in e)return r;a++}}var M_=typeof window>`u`?{}:window,N_=j_(E_.style,`touchAction`),P_=N_!==void 0;function F_(){if(!P_)return!1;var e={},t=M_.CSS&&M_.CSS.supports;return[`auto`,`manipulation`,`pan-y`,`pan-x`,`pan-x pan-y`,`none`].forEach(function(n){return e[n]=t?M_.CSS.supports(`touch-action`,n):!0}),e}var I_=`compute`,L_=`auto`,R_=`manipulation`,z_=`none`,B_=`pan-x`,V_=`pan-y`,H_=F_(),U_=/mobile|tablet|ip(ad|hone|od)|android/i,W_=`ontouchstart`in M_,G_=j_(M_,`PointerEvent`)!==void 0,K_=W_&&U_.test(navigator.userAgent),q_=`touch`,J_=`pen`,Y_=`mouse`,X_=`kinect`,Z_=25,Q_=1,$_=2,ev=4,tv=8,nv=1,rv=2,iv=4,av=8,ov=16,sv=rv|iv,cv=av|ov,lv=sv|cv,uv=[`x`,`y`],dv=[`clientX`,`clientY`];function fv(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==void 0)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function pv(e,t){return typeof e===D_?e.apply(t&&t[0]||void 0,t):e}function mv(e,t){return e.indexOf(t)>-1}function hv(e){if(mv(e,z_))return z_;var t=mv(e,B_),n=mv(e,V_);return t&&n?z_:t||n?t?B_:V_:mv(e,R_)?R_:L_}var gv=function(){function e(e,t){this.manager=e,this.set(t)}var t=e.prototype;return t.set=function(e){e===I_&&(e=this.compute()),P_&&this.manager.element.style&&H_[e]&&(this.manager.element.style[N_]=e),this.actions=e.toLowerCase().trim()},t.update=function(){this.set(this.manager.options.touchAction)},t.compute=function(){var e=[];return fv(this.manager.recognizers,function(t){pv(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),hv(e.join(` `))},t.preventDefaults=function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented){t.preventDefault();return}var r=this.actions,i=mv(r,z_)&&!H_[z_],a=mv(r,V_)&&!H_[V_],o=mv(r,B_)&&!H_[B_];if(i){var s=e.pointers.length===1,c=e.distance<2,l=e.deltaTime<250;if(s&&c&&l)return}if(!(o&&a)&&(i||a&&n&sv||o&&n&cv))return this.preventSrc(t)},t.preventSrc=function(e){this.manager.session.prevented=!0,e.preventDefault()},e}();function _v(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function vv(e){var t=e.length;if(t===1)return{x:O_(e[0].clientX),y:O_(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:O_(n/t),y:O_(r/t)}}function yv(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:O_(e.pointers[n].clientX),clientY:O_(e.pointers[n].clientY)},n++;return{timeStamp:A_(),pointers:t,center:vv(t),deltaX:e.deltaX,deltaY:e.deltaY}}function bv(e,t,n){n||=uv;var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function xv(e,t,n){n||=uv;var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.atan2(i,r)*180/Math.PI}function Sv(e,t){return e===t?nv:k_(e)>=k_(t)?e<0?rv:iv:t<0?av:ov}function Cv(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},a=e.prevInput||{};(t.eventType===Q_||a.eventType===ev)&&(i=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}function wv(e,t,n){return{x:t/e||0,y:n/e||0}}function Tv(e,t){return bv(t[0],t[1],dv)/bv(e[0],e[1],dv)}function Ev(e,t){return xv(t[1],t[0],dv)+xv(e[1],e[0],dv)}function Dv(e,t){var n=e.lastInterval||t,r=t.timeStamp-n.timeStamp,i,a,o,s;if(t.eventType!==tv&&(r>Z_||n.velocity===void 0)){var c=t.deltaX-n.deltaX,l=t.deltaY-n.deltaY,u=wv(r,c,l);a=u.x,o=u.y,i=k_(u.x)>k_(u.y)?u.x:u.y,s=Sv(c,l),e.lastInterval=t}else i=n.velocity,a=n.velocityX,o=n.velocityY,s=n.direction;t.velocity=i,t.velocityX=a,t.velocityY=o,t.direction=s}function Ov(e,t){var n=e.session,r=t.pointers,i=r.length;n.firstInput||=yv(t),i>1&&!n.firstMultiple?n.firstMultiple=yv(t):i===1&&(n.firstMultiple=!1);var a=n.firstInput,o=n.firstMultiple,s=o?o.center:a.center,c=t.center=vv(r);t.timeStamp=A_(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=xv(s,c),t.distance=bv(s,c),Cv(n,t),t.offsetDirection=Sv(t.deltaX,t.deltaY);var l=wv(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=l.x,t.overallVelocityY=l.y,t.overallVelocity=k_(l.x)>k_(l.y)?l.x:l.y,t.scale=o?Tv(o.pointers,r):1,t.rotation=o?Ev(o.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,Dv(n,t);var u=e.element,d=t.srcEvent,f=d.composedPath?d.composedPath()[0]:d.path?d.path[0]:d.target;_v(f,u)&&(u=f),t.target=u}function kv(e,t,n){var r=n.pointers.length,i=n.changedPointers.length,a=t&Q_&&r-i===0,o=t&(ev|tv)&&r-i===0;n.isFirst=!!a,n.isFinal=!!o,a&&(e.session={}),n.eventType=t,Ov(e,n),e.emit(`hammer.input`,n),e.recognize(n),e.session.prevInput=n}function Av(e){return e.trim().split(/\s+/g)}function jv(e,t,n){fv(Av(t),function(t){e.addEventListener(t,n,!1)})}function U(e,t,n){fv(Av(t),function(t){e.removeEventListener(t,n,!1)})}function Mv(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||window}var Nv=function(){function e(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){pv(e.options.enable,[e])&&n.handler(t)},this.init()}var t=e.prototype;return t.handler=function(){},t.init=function(){this.evEl&&jv(this.element,this.evEl,this.domHandler),this.evTarget&&jv(this.target,this.evTarget,this.domHandler),this.evWin&&jv(Mv(this.element),this.evWin,this.domHandler)},t.destroy=function(){this.evEl&&U(this.element,this.evEl,this.domHandler),this.evTarget&&U(this.target,this.evTarget,this.domHandler),this.evWin&&U(Mv(this.element),this.evWin,this.domHandler)},e}();function Pv(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}var Fv={pointerdown:Q_,pointermove:$_,pointerup:ev,pointercancel:tv,pointerout:tv},Iv={2:q_,3:J_,4:Y_,5:X_},Lv=`pointerdown`,Rv=`pointermove pointerup pointercancel`;M_.MSPointerEvent&&!M_.PointerEvent&&(Lv=`MSPointerDown`,Rv=`MSPointerMove MSPointerUp MSPointerCancel`);var zv=function(e){S_(t,e);function t(){var n,r=t.prototype;return r.evEl=Lv,r.evWin=Rv,n=e.apply(this,arguments)||this,n.store=n.manager.session.pointerEvents=[],n}var n=t.prototype;return n.handler=function(e){var t=this.store,n=!1,r=Fv[e.type.toLowerCase().replace(`ms`,``)],i=Iv[e.pointerType]||e.pointerType,a=i===q_,o=Pv(t,e.pointerId,`pointerId`);r&Q_&&(e.button===0||a)?o<0&&(t.push(e),o=t.length-1):r&(ev|tv)&&(n=!0),!(o<0)&&(t[o]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:i,srcEvent:e}),n&&t.splice(o,1))},t}(Nv);function Bv(e){return Array.prototype.slice.call(e,0)}function Vv(e,t,n){for(var r=[],i=[],a=0;a<e.length;){var o=t?e[a][t]:e[a];Pv(i,o)<0&&r.push(e[a]),i[a]=o,a++}return n&&(r=t?r.sort(function(e,n){return e[t]>n[t]}):r.sort()),r}var Hv={touchstart:Q_,touchmove:$_,touchend:ev,touchcancel:tv},Uv=`touchstart touchmove touchend touchcancel`,Wv=function(e){S_(t,e);function t(){var n;return t.prototype.evTarget=Uv,n=e.apply(this,arguments)||this,n.targetIds={},n}var n=t.prototype;return n.handler=function(e){var t=Hv[e.type],n=Gv.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:q_,srcEvent:e})},t}(Nv);function Gv(e,t){var n=Bv(e.touches),r=this.targetIds;if(t&(Q_|$_)&&n.length===1)return r[n[0].identifier]=!0,[n,n];var i,a,o=Bv(e.changedTouches),s=[],c=this.target;if(a=n.filter(function(e){return _v(e.target,c)}),t===Q_)for(i=0;i<a.length;)r[a[i].identifier]=!0,i++;for(i=0;i<o.length;)r[o[i].identifier]&&s.push(o[i]),t&(ev|tv)&&delete r[o[i].identifier],i++;if(s.length)return[Vv(a.concat(s),`identifier`,!0),s]}var Kv={mousedown:Q_,mousemove:$_,mouseup:ev},qv=`mousedown`,Jv=`mousemove mouseup`,Yv=function(e){S_(t,e);function t(){var n,r=t.prototype;return r.evEl=qv,r.evWin=Jv,n=e.apply(this,arguments)||this,n.pressed=!1,n}var n=t.prototype;return n.handler=function(e){var t=Kv[e.type];t&Q_&&e.button===0&&(this.pressed=!0),t&$_&&e.which!==1&&(t=ev),this.pressed&&(t&ev&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:Y_,srcEvent:e}))},t}(Nv),Xv=2500,Zv=25;function Qv(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY},r=this.lastTouches;this.lastTouches.push(n),setTimeout(function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)},Xv)}}function $v(e,t){e&Q_?(this.primaryTouch=t.changedPointers[0].identifier,Qv.call(this,t)):e&(ev|tv)&&Qv.call(this,t)}function ey(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],a=Math.abs(t-i.x),o=Math.abs(n-i.y);if(a<=Zv&&o<=Zv)return!0}return!1}var ty=function(){return function(e){S_(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.handler=function(e,t,n){var i=n.pointerType===q_,a=n.pointerType===Y_;if(!(a&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)$v.call(C_(C_(r)),t,n);else if(a&&ey.call(C_(C_(r)),n))return;r.callback(e,t,n)}},r.touch=new Wv(r.manager,r.handler),r.mouse=new Yv(r.manager,r.handler),r.primaryTouch=null,r.lastTouches=[],r}var n=t.prototype;return n.destroy=function(){this.touch.destroy(),this.mouse.destroy()},t}(Nv)}();function ny(e){var t;return t=e.options.inputClass||(G_?zv:K_?Wv:W_?ty:Yv),new t(e,kv)}function ry(e,t,n){return Array.isArray(e)?(fv(e,n[t],n),!0):!1}var iy=1,ay=2,oy=4,sy=8,cy=sy,ly=16,uy=32,dy=1;function fy(){return dy++}function W(e,t){var n=t.manager;return n?n.get(e):e}function G(e){return e&ly?`cancel`:e&sy?`end`:e&oy?`move`:e&ay?`start`:``}var py=function(){function e(e){e===void 0&&(e={}),this.options=x_({enable:!0},e),this.id=fy(),this.manager=null,this.state=iy,this.simultaneous={},this.requireFail=[]}var t=e.prototype;return t.set=function(e){return w_(this.options,e),this.manager&&this.manager.touchAction.update(),this},t.recognizeWith=function(e){if(ry(e,`recognizeWith`,this))return this;var t=this.simultaneous;return e=W(e,this),t[e.id]||(t[e.id]=e,e.recognizeWith(this)),this},t.dropRecognizeWith=function(e){return ry(e,`dropRecognizeWith`,this)?this:(e=W(e,this),delete this.simultaneous[e.id],this)},t.requireFailure=function(e){if(ry(e,`requireFailure`,this))return this;var t=this.requireFail;return e=W(e,this),Pv(t,e)===-1&&(t.push(e),e.requireFailure(this)),this},t.dropRequireFailure=function(e){if(ry(e,`dropRequireFailure`,this))return this;e=W(e,this);var t=Pv(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},t.hasRequireFailures=function(){return this.requireFail.length>0},t.canRecognizeWith=function(e){return!!this.simultaneous[e.id]},t.emit=function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<sy&&r(t.options.event+G(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=sy&&r(t.options.event+G(n))},t.tryEmit=function(e){if(this.canEmit())return this.emit(e);this.state=uy},t.canEmit=function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(uy|iy)))return!1;e++}return!0},t.recognize=function(e){var t=w_({},e);if(!pv(this.options.enable,[this,t])){this.reset(),this.state=uy;return}this.state&(cy|ly|uy)&&(this.state=iy),this.state=this.process(t),this.state&(ay|oy|sy|ly)&&this.tryEmit(t)},t.process=function(e){},t.getTouchAction=function(){},t.reset=function(){},e}(),my=function(e){S_(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,x_({event:`tap`,pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},t))||this,n.pTime=!1,n.pCenter=!1,n._timer=null,n._input=null,n.count=0,n}var n=t.prototype;return n.getTouchAction=function(){return[R_]},n.process=function(e){var t=this,n=this.options,r=e.pointers.length===n.pointers,i=e.distance<n.threshold,a=e.deltaTime<n.time;if(this.reset(),e.eventType&Q_&&this.count===0)return this.failTimeout();if(i&&a&&r){if(e.eventType!==ev)return this.failTimeout();var o=this.pTime?e.timeStamp-this.pTime<n.interval:!0,s=!this.pCenter||bv(this.pCenter,e.center)<n.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,!s||!o?this.count=1:this.count+=1,this._input=e,this.count%n.taps===0)return this.hasRequireFailures()?(this._timer=setTimeout(function(){t.state=cy,t.tryEmit()},n.interval),ay):cy}return uy},n.failTimeout=function(){var e=this;return this._timer=setTimeout(function(){e.state=uy},this.options.interval),uy},n.reset=function(){clearTimeout(this._timer)},n.emit=function(){this.state===cy&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},t}(py),hy=function(e){S_(t,e);function t(t){return t===void 0&&(t={}),e.call(this,x_({pointers:1},t))||this}var n=t.prototype;return n.attrTest=function(e){var t=this.options.pointers;return t===0||e.pointers.length===t},n.process=function(e){var t=this.state,n=e.eventType,r=t&(ay|oy),i=this.attrTest(e);return r&&(n&tv||!i)?t|ly:r||i?n&ev?t|sy:t&ay?t|oy:ay:uy},t}(py);function gy(e){return e===ov?`down`:e===av?`up`:e===rv?`left`:e===iv?`right`:``}var _y=function(e){S_(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,x_({event:`pan`,threshold:10,pointers:1,direction:lv},t))||this,n.pX=null,n.pY=null,n}var n=t.prototype;return n.getTouchAction=function(){var e=this.options.direction,t=[];return e&sv&&t.push(V_),e&cv&&t.push(B_),t},n.directionTest=function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,a=e.deltaX,o=e.deltaY;return i&t.direction||(t.direction&sv?(i=a===0?nv:a<0?rv:iv,n=a!==this.pX,r=Math.abs(e.deltaX)):(i=o===0?nv:o<0?av:ov,n=o!==this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},n.attrTest=function(e){return hy.prototype.attrTest.call(this,e)&&(this.state&ay||!(this.state&ay)&&this.directionTest(e))},n.emit=function(t){this.pX=t.deltaX,this.pY=t.deltaY;var n=gy(t.direction);n&&(t.additionalEvent=this.options.event+n),e.prototype.emit.call(this,t)},t}(hy),vy=function(e){S_(t,e);function t(t){return t===void 0&&(t={}),e.call(this,x_({event:`swipe`,threshold:10,velocity:.3,direction:sv|cv,pointers:1},t))||this}var n=t.prototype;return n.getTouchAction=function(){return _y.prototype.getTouchAction.call(this)},n.attrTest=function(t){var n=this.options.direction,r;return n&(sv|cv)?r=t.overallVelocity:n&sv?r=t.overallVelocityX:n&cv&&(r=t.overallVelocityY),e.prototype.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers===this.options.pointers&&k_(r)>this.options.velocity&&t.eventType&ev},n.emit=function(e){var t=gy(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)},t}(hy),yy=function(e){S_(t,e);function t(t){return t===void 0&&(t={}),e.call(this,x_({event:`pinch`,threshold:0,pointers:2},t))||this}var n=t.prototype;return n.getTouchAction=function(){return[z_]},n.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&ay)},n.emit=function(t){if(t.scale!==1){var n=t.scale<1?`in`:`out`;t.additionalEvent=this.options.event+n}e.prototype.emit.call(this,t)},t}(hy),by=function(e){S_(t,e);function t(t){return t===void 0&&(t={}),e.call(this,x_({event:`rotate`,threshold:0,pointers:2},t))||this}var n=t.prototype;return n.getTouchAction=function(){return[z_]},n.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&ay)},t}(hy),xy=function(e){S_(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,x_({event:`press`,pointers:1,time:251,threshold:9},t))||this,n._timer=null,n._input=null,n}var n=t.prototype;return n.getTouchAction=function(){return[L_]},n.process=function(e){var t=this,n=this.options,r=e.pointers.length===n.pointers,i=e.distance<n.threshold,a=e.deltaTime>n.time;if(this._input=e,!i||!r||e.eventType&(ev|tv)&&!a)this.reset();else if(e.eventType&Q_)this.reset(),this._timer=setTimeout(function(){t.state=cy,t.tryEmit()},n.time);else if(e.eventType&ev)return cy;return uy},n.reset=function(){clearTimeout(this._timer)},n.emit=function(e){this.state===cy&&(e&&e.eventType&ev?this.manager.emit(this.options.event+`up`,e):(this._input.timeStamp=A_(),this.manager.emit(this.options.event,this._input)))},t}(py),Sy={domEvents:!1,touchAction:I_,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:`none`,touchSelect:`none`,touchCallout:`none`,contentZooming:`none`,userDrag:`none`,tapHighlightColor:`rgba(0,0,0,0)`}},Cy=[[by,{enable:!1}],[yy,{enable:!1},[`rotate`]],[vy,{direction:sv}],[_y,{direction:sv},[`swipe`]],[my],[my,{event:`doubletap`,taps:2},[`tap`]],[xy]],wy=1,Ty=2;function Ey(e,t){var n=e.element;if(n.style){var r;fv(e.options.cssProps,function(i,a){r=j_(n.style,a),t?(e.oldCssProps[r]=n.style[r],n.style[r]=i):n.style[r]=e.oldCssProps[r]||``}),t||(e.oldCssProps={})}}function Dy(e,t){var n=document.createEvent(`Event`);n.initEvent(e,!0,!0),n.gesture=t,t.target.dispatchEvent(n)}var Oy=function(){function e(e,t){var n=this;this.options=w_({},Sy,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=ny(this),this.touchAction=new gv(this,this.options.touchAction),Ey(this,!0),fv(this.options.recognizers,function(e){var t=n.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}var t=e.prototype;return t.set=function(e){return w_(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},t.stop=function(e){this.session.stopped=e?Ty:wy},t.recognize=function(e){var t=this.session;if(!t.stopped){this.touchAction.preventDefaults(e);var n,r=this.recognizers,i=t.curRecognizer;(!i||i&&i.state&cy)&&(t.curRecognizer=null,i=null);for(var a=0;a<r.length;)n=r[a],t.stopped!==Ty&&(!i||n===i||n.canRecognizeWith(i))?n.recognize(e):n.reset(),!i&&n.state&(ay|oy|sy)&&(t.curRecognizer=n,i=n),a++}},t.get=function(e){if(e instanceof py)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event===e)return t[n];return null},t.add=function(e){if(ry(e,`add`,this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},t.remove=function(e){if(ry(e,`remove`,this))return this;var t=this.get(e);if(e){var n=this.recognizers,r=Pv(n,t);r!==-1&&(n.splice(r,1),this.touchAction.update())}return this},t.on=function(e,t){if(e===void 0||t===void 0)return this;var n=this.handlers;return fv(Av(e),function(e){n[e]=n[e]||[],n[e].push(t)}),this},t.off=function(e,t){if(e===void 0)return this;var n=this.handlers;return fv(Av(e),function(e){t?n[e]&&n[e].splice(Pv(n[e],t),1):delete n[e]}),this},t.emit=function(e,t){this.options.domEvents&&Dy(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(!(!n||!n.length)){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](t),r++}},t.destroy=function(){this.element&&Ey(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},e}(),ky={touchstart:Q_,touchmove:$_,touchend:ev,touchcancel:tv},Ay=`touchstart`,jy=`touchstart touchmove touchend touchcancel`,My=function(e){S_(t,e);function t(){var n,r=t.prototype;return r.evTarget=Ay,r.evWin=jy,n=e.apply(this,arguments)||this,n.started=!1,n}var n=t.prototype;return n.handler=function(e){var t=ky[e.type];if(t===Q_&&(this.started=!0),this.started){var n=Ny.call(this,e,t);t&(ev|tv)&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:q_,srcEvent:e})}},t}(Nv);function Ny(e,t){var n=Bv(e.touches),r=Bv(e.changedTouches);return t&(ev|tv)&&(n=Vv(n.concat(r),`identifier`,!0)),[n,r]}function Py(e,t,n){var r=`DEPRECATED METHOD: `+t+`
|
|
4
4
|
`+n+` AT
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./chunk-K5T4RW27-B_ZUrFUq.js";import"./chunk-7N4EOEYR-BvMbitX7.js";import"./chunk-67CJDMHE-BG6-9r6c.js";import"./chunk-KGLVRYIC-CcWTvRlI.js";import"./chunk-FOC6F5B3-f9cFywhd.js";import"./chunk-AA7GKIK3-CE8mGBD5.js";import"./chunk-2KRD3SAO-Di4bO8ir.js";import"./chunk-ORNJ4GCN-B4Z5L25I.js";import"./chunk-LIHQZDEY-D-5-peQw.js";import"./chunk-CIAEETIT-VfnIdN-h.js";import{g as e,h as t}from"./src-B6XdH6xq.js";import{B as n,C as r,V as i,W as a,_ as o,a as s,b as c,c as l,d as u,v as d}from"./chunk-ICPOFSXX-
|
|
1
|
+
import"./chunk-K5T4RW27-B_ZUrFUq.js";import"./chunk-7N4EOEYR-BvMbitX7.js";import"./chunk-67CJDMHE-BG6-9r6c.js";import"./chunk-KGLVRYIC-CcWTvRlI.js";import"./chunk-FOC6F5B3-f9cFywhd.js";import"./chunk-AA7GKIK3-CE8mGBD5.js";import"./chunk-2KRD3SAO-Di4bO8ir.js";import"./chunk-ORNJ4GCN-B4Z5L25I.js";import"./chunk-LIHQZDEY-D-5-peQw.js";import"./chunk-CIAEETIT-VfnIdN-h.js";import{g as e,h as t}from"./src-B6XdH6xq.js";import{B as n,C as r,V as i,W as a,_ as o,a as s,b as c,c as l,d as u,v as d}from"./chunk-ICPOFSXX-BOjV-nTe.js";import{t as f}from"./ordinal-krseTxxN.js";import{n as p}from"./path-B0Ik7Tu9.js";import{m}from"./dist-Bd4S37oi.js";import{t as h}from"./arc-DMDAZHAN.js";import{t as g}from"./array-DetWRiSa.js";import{f as _,r as v}from"./chunk-5PVQY5BW-CL9KWSZH.js";import{t as y}from"./chunk-426QAEUC-hyvaLE5p.js";import{t as b}from"./chunk-4BX2VUAB-DyEhFk-Z.js";import{t as x}from"./mermaid-parser.core-BvbEd4_6.js";function S(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function C(e){return e}function w(){var e=C,t=S,n=null,r=p(0),i=p(m),a=p(0);function o(o){var s,c=(o=g(o)).length,l,u,d=0,f=Array(c),p=Array(c),h=+r.apply(this,arguments),_=Math.min(m,Math.max(-m,i.apply(this,arguments)-h)),v,y=Math.min(Math.abs(_)/c,a.apply(this,arguments)),b=y*(_<0?-1:1),x;for(s=0;s<c;++s)(x=p[f[s]=s]=+e(o[s],s,o))>0&&(d+=x);for(t==null?n!=null&&f.sort(function(e,t){return n(o[e],o[t])}):f.sort(function(e,n){return t(p[e],p[n])}),s=0,u=d?(_-c*b)/d:0;s<c;++s,h=v)l=f[s],x=p[l],v=h+(x>0?x*u:0)+b,p[l]={data:o[l],index:s,value:x,startAngle:h,endAngle:v,padAngle:y};return p}return o.value=function(t){return arguments.length?(e=typeof t==`function`?t:p(+t),o):e},o.sortValues=function(e){return arguments.length?(t=e,n=null,o):t},o.sort=function(e){return arguments.length?(n=e,t=null,o):n},o.startAngle=function(e){return arguments.length?(r=typeof e==`function`?e:p(+e),o):r},o.endAngle=function(e){return arguments.length?(i=typeof e==`function`?e:p(+e),o):i},o.padAngle=function(e){return arguments.length?(a=typeof e==`function`?e:p(+e),o):a},o}var T=u.pie,E={sections:new Map,showData:!1,config:T},D=E.sections,O=E.showData,k=structuredClone(T),A={getConfig:t(()=>structuredClone(k),`getConfig`),clear:t(()=>{D=new Map,O=E.showData,s()},`clear`),setDiagramTitle:a,getDiagramTitle:r,setAccTitle:i,getAccTitle:d,setAccDescription:n,getAccDescription:o,addSection:t(({label:t,value:n})=>{if(n<0)throw Error(`"${t}" has invalid value: ${n}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);D.has(t)||(D.set(t,n),e.debug(`added new section: ${t}, with value: ${n}`))},`addSection`),getSections:t(()=>D,`getSections`),setShowData:t(e=>{O=e},`setShowData`),getShowData:t(()=>O,`getShowData`)},j=t((e,t)=>{b(e,t),t.setShowData(e.showData),e.sections.map(t.addSection)},`populateDb`),M={parse:t(async t=>{let n=await x(`pie`,t);e.debug(n),j(n,A)},`parse`)},N=t(e=>`
|
|
2
2
|
.pieCircle{
|
|
3
3
|
stroke: ${e.pieStrokeColor};
|
|
4
4
|
stroke-width : ${e.pieStrokeWidth};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-
|
|
2
|
-
import{o as e}from"./chunk-DD-I1_y5.js";import{i as t,n,o as r,r as i,t as a}from"./jsx-runtime-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-CSIEcw1L.js","assets/dist-Bd4S37oi.js","assets/chunk-DD-I1_y5.js","assets/chunk-U2HBQHQK-C92E-iRU.js","assets/src-B6XdH6xq.js","assets/chunk-5PVQY5BW-CL9KWSZH.js","assets/chunk-ICPOFSXX-BOjV-nTe.js","assets/_baseFor-BHtDrjIo.js","assets/isEmpty-BWl67LAZ.js","assets/chunk-336JU56O-839etdKR.js","assets/chunk-5FUZZQ4R-zWevOyjc.js","assets/chunk-X2U36JSP-DohG6qWK.js","assets/chunk-ZZ45TVLE-D7R-lONY.js","assets/rough.esm-DKRO8IF-.js","assets/chunk-ENJZ2VHE-DApK4iuk.js","assets/line-Cr3lHgh8.js","assets/path-B0Ik7Tu9.js","assets/array-DetWRiSa.js","assets/chunk-BSJP7CBP-DP7LTBll.js","assets/chunk-426QAEUC-hyvaLE5p.js","assets/chunk-XPW4576I-m1Y_r88I.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{o as e}from"./chunk-DD-I1_y5.js";import{i as t,n,o as r,r as i,t as a}from"./jsx-runtime-Bz7aoCi7.js";import{a as o,c as s,d as c,f as l,h as u,i as d,m as f,n as p,o as m,p as h,r as g,s as _,t as v,u as y}from"./device-url-actions-CE3A1UDw.js";import{t as b}from"./Checkbox-nrf4ISU0.js";var x=i(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),S=i(`file-code`,[[`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 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),C=i(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),w=i(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),T=i(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),E=i(`square-check-big`,[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),D=i(`square-plus`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}],[`path`,{d:`M12 8v8`,key:`napkw2`}]]),O=i(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),k=t(),A=e(r(),1),j=`image/jpeg,image/png,image/gif,image/webp,application/pdf,text/plain,text/markdown,text/csv,text/html,text/calendar,audio/ogg,audio/opus,audio/mp4,audio/mpeg,audio/webm,audio/wav,.opus,.ogg,.m4a,.mp3,.wav,.webm`,M=new Set(j.split(`,`).filter(e=>!e.startsWith(`.`))),N=50*1024*1024,P=typeof window<`u`&&/^(localhost|127\.0\.0\.1|[a-z0-9-]+\.local)(:|$)/.test(window.location.hostname);function ee(){let e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=[...e].map(e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function F(){let e=window.location.pathname;if(e.startsWith(`/g/`))return;let t=e.match(/^\/([a-z][a-z0-9-]{2,49})$/);return t?t[1]:void 0}function I(){let e=window.location.pathname.match(/^\/g\/([a-z0-9][a-z0-9-]{0,49})$/);return e?e[1]:void 0}function L(e){return[{key:`length`,label:`At least 8 characters`,met:e.length>=8},{key:`number`,label:`Contains a number`,met:/\d/.test(e)},{key:`special`,label:`Contains a special character`,met:/[^A-Za-z0-9]/.test(e)},{key:`whitespace`,label:`No spaces`,met:e.length>0&&!/\s/.test(e)}]}function R(e,t){if(t===`phone`)return e.length>4?e.slice(0,e.length-4).replace(/\d/g,`•`)+` `+e.slice(-4):e;let n=e.indexOf(`@`);return n<=2?e:e.slice(0,2)+`•••`+e.slice(n)}function z(e){let[t,n]=(0,A.useState)(null),[r,i]=(0,A.useState)(null),[a,o]=(0,A.useState)(`loading`),[s,c]=(0,A.useState)(``),[l,u]=(0,A.useState)(null),[d,f]=(0,A.useState)(null),[p,m]=(0,A.useState)(!1),[h,g]=(0,A.useState)(null),_=(0,A.useMemo)(()=>F(),[]),v=(0,A.useMemo)(()=>I(),[]),[y,b]=(0,A.useState)(null),x=(0,A.useRef)(_||``),S=(0,A.useRef)(null),C=(0,A.useRef)(null),w=(0,A.useRef)(!1),T=(0,A.useRef)(null),[E,D]=(0,A.useState)(`sign-in`),[O,k]=(0,A.useState)(null),j=(0,A.useRef)(null),M=(0,A.useRef)(null);(0,A.useEffect)(()=>{try{let e=sessionStorage.getItem(`maxy_session`);e&&(M.current=e)}catch{}},[]);let N=(0,A.useCallback)(t=>{S.current=t,n(t);try{sessionStorage.setItem(`maxy_session`,t)}catch{}o(`chat`),e(t)},[e]),L=(0,A.useCallback)(()=>{S.current=null;try{sessionStorage.removeItem(`maxy_session`)}catch{}n(null),o(`auth-required`),D(`sign-in`)},[]),R=(0,A.useCallback)(async e=>{try{let t=x.current,n=await fetch(`/api/access/verify-token`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({token:e,agentSlug:t})}),r=await n.json();n.ok?(j.current=r.session_key,k(r.grant),D(`set-password`),window.history.replaceState({},``,window.location.pathname)):D(`link-expired`)}catch{D(`sign-in`)}},[]),z=(0,A.useCallback)(async()=>{if(S.current)return S.current;if(C.current)return C.current;let e=(async()=>{try{let e=M.current,t=await fetch(`/api/session`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({session_id:ee(),..._?{agent:_}:{},...v?{group_slug:v}:{},...e?{session_key:e}:{}})});if(!t.ok){let e=await t.json().catch(()=>({error:``}));return P&&console.error(`[session] POST /api/session failed: ${t.status} ${t.statusText}`,e),t.status===404?i(e.error||`Agent not found`):t.status===503&&i(e.error||`Service unavailable`),null}let r=await t.json();if(r.auth_required){r.agent_id&&(x.current=r.agent_id),c(r.displayName||``),r.agentImage&&u(r.agentImage),r.agentImageShape&&f(r.agentImageShape),r.showAgentName&&m(r.showAgentName),r.branding&&g(r.branding),o(`auth-required`);let e=new URLSearchParams(window.location.search).get(`token`);return e?R(e):D(`sign-in`),null}S.current=r.session_key,n(r.session_key),r.displayName&&c(r.displayName),r.agentImage&&u(r.agentImage),r.agentImageShape&&f(r.agentImageShape),r.showAgentName&&m(r.showAgentName),r.branding&&g(r.branding),o(`chat`),r.resumed&&r.messages&&(w.current=!0,T.current=r.messages),r.group&&b({groupSlug:r.groupSlug,groupName:r.groupName,participants:r.participants??[]});try{sessionStorage.setItem(`maxy_session`,r.session_key)}catch{}return r.session_key}catch(e){return P&&console.error(`[session] fetch /api/session threw:`,e),i(`Unable to connect. Please check your connection and try again.`),null}finally{C.current=null}})();return C.current=e,e},[_,v,R]);return{sessionId:t,cacheKeyRef:S,sessionError:r,pageState:a,setPageState:o,agentDisplayName:s,agentImage:l,agentImageShape:d,showAgentName:p,agentSlug:_,branding:h,resolvedSlugRef:x,ensureSession:z,startNewSession:(0,A.useCallback)(async()=>{S.current=null,C.current=null,M.current=null,w.current=!1,T.current=null,n(null),i(null);try{sessionStorage.removeItem(`maxy_session`)}catch{}let t=await z();t&&e(t)},[z,e]),enterChat:N,enterGate:L,resumedRef:w,resumeMessagesRef:T,gateState:E,setGateState:D,grantInfo:O,setGrantInfo:k,gateCacheKeyRef:j,groupContext:y,groupSlug:v}}async function*B(e){let t=e.body?.getReader();if(!t)throw Error(`No response stream`);let n=new TextDecoder,r=``;try{for(;;){let{done:e,value:i}=await t.read();if(e)break;r+=n.decode(i,{stream:!0});let a=r.split(`
|
|
3
3
|
`);r=a.pop();for(let e of a){if(!e.startsWith(`data: `))continue;let t=e.slice(6);if(t===`[DONE]`)continue;let n;try{n=JSON.parse(t)}catch{continue}yield n}}}finally{t.cancel()}}function te({cacheKeyRef:e,ensureSession:t,sessionError:n,pageState:r,inputRef:i}){let[a,o]=(0,A.useState)([]),[s,c]=(0,A.useState)(!1),l=(0,A.useRef)(!1),u=e=>{l.current=e,c(e)},d=(0,A.useCallback)(async a=>{if(!l.current){u(!0),o([{role:`maxy`,content:``,timestamp:Date.now()}]);try{let n=await fetch(`/api/chat`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({greeting:!0,session_key:a})});if(n.status===401){e.current=null;try{sessionStorage.removeItem(`maxy_session`)}catch{}P&&console.warn(`[greeting] stale session, retrying with fresh session`);let r=await t();if(!r)return;n=await fetch(`/api/chat`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({greeting:!0,session_key:r})})}if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error||`Something went wrong`)}let r=``,i=``,s=()=>{i&&(r+=i,i=``,o(e=>{let t=[...e];return t[0]={...t[0],content:r},t}))},c=setInterval(s,60);try{for await(let e of B(n)){if(e.error)throw Object.assign(Error(e.error),{fromSSE:!0});e.text&&(i+=e.text),e.type===`component`&&(s(),o(t=>{let n=[...t],r={...n[0]},i=[...r.components||[]];return i.push({name:e.name,data:e.data,submitted:!1}),n[0]={...r,components:i},n}))}}finally{clearInterval(c),s()}}catch(e){if(P&&console.error(`[chat] greeting failed:`,e),r===`auth-required`)return;let t=e instanceof Error?e.message:String(e);o([{role:`maxy`,content:e instanceof Error&&e.fromSSE?t:n??`I'm having trouble connecting right now. Try refreshing the page.`,timestamp:Date.now()}])}finally{u(!1),r===`chat`&&i.current?.focus()}}},[e,t,n,r,i]),f=(0,A.useCallback)(async(a,s)=>{let c=s?.hidden??!1,d=s?.files??[];if(!a&&d.length===0||l.current)return;u(!0);let f=d.map(e=>({filename:e.name,mimeType:e.type})),p={role:`visitor`,content:a,attachments:f.length>0?f:void 0,timestamp:Date.now(),hidden:c},m;o(e=>{let t=[...e,p,{role:`maxy`,content:``,timestamp:Date.now()}];return m=t.length-1,t});try{let n=await t();if(!n)throw Error(`session`);let r=e=>{if(d.length>0){let t=new FormData;t.append(`message`,a),t.append(`session_key`,e);for(let e of d)t.append(`attachments`,e);return{body:t,headers:{}}}return{body:JSON.stringify({message:a,session_key:e}),headers:{"Content-Type":`application/json`}}},{body:i,headers:s}=r(n),c=await fetch(`/api/chat`,{method:`POST`,headers:s,body:i});if(c.status===401){e.current=null;try{sessionStorage.removeItem(`maxy_session`)}catch{}P&&console.warn(`[session-expired] stale key cleared, retrying with fresh session`);let n=await t();if(!n)throw Error(`session`);({body:i,headers:s}=r(n)),c=await fetch(`/api/chat`,{method:`POST`,headers:s,body:i})}if(!c.ok){let e=await c.json().catch(()=>({}));throw Error(e.error||`Something went wrong`)}let l=``,u=``,f=()=>{u&&(l+=u,u=``,o(e=>{let t=[...e];return t[m]={...t[m],content:l},t}))},p=setInterval(f,60);try{for await(let e of B(c)){if(e.error)throw Object.assign(Error(e.error),{fromSSE:!0});e.text&&(u+=e.text),e.type===`component`&&(f(),o(t=>{let n=[...t],r={...n[m]},i=[...r.components||[]];return i.push({name:e.name,data:e.data,submitted:!1}),n[m]={...r,components:i},n}))}}finally{clearInterval(p),f()}}catch(e){if(P&&console.error(`[chat] sendMessage failed:`,e),r===`auth-required`)return;let t=e instanceof Error?e.message:String(e),i=e instanceof Error&&e.fromSSE;o(e=>{let r=[...e];return r[m]={...r[m],content:i?t:t===`session`?n??`I'm having trouble connecting right now. Try refreshing the page.`:`Sorry, I hit a snag. Try again in a moment.`},r})}finally{u(!1),r===`chat`&&i.current?.focus()}},[e,t,n,r,i]);return{messages:a,setMessages:o,isStreaming:s,sendMessage:f,sendGreeting:d,handleComponentSubmit:(0,A.useCallback)((e,t,n)=>{o(n=>{let r=[...n],i={...r[e]},a=[...i.components||[]];return a[t]={...a[t],submitted:!0},r[e]={...i,components:a},r}),f(n,{hidden:!0})},[f])}}function ne({cacheKeyRef:e,groupSlug:t,isStreaming:n,setMessages:r}){let i=(0,A.useRef)(new Date().toISOString()),a=(0,A.useRef)(!0);(0,A.useEffect)(()=>{let e=()=>{a.current=document.visibilityState===`visible`};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]);let o=(0,A.useCallback)(async()=>{let n=e.current;if(!(!n||!t))try{let e=await fetch(`/api/group/messages?session_key=${encodeURIComponent(n)}&since=${encodeURIComponent(i.current)}`);if(!e.ok)return;let t=await e.json();if(!t.messages||t.messages.length===0)return;let a=t.messages[t.messages.length-1];a.timestamp&&(i.current=new Date(a.timestamp).toISOString()),r(e=>{let n=new Set(e.filter(e=>e.messageId).map(e=>e.messageId)),r=t.messages.filter(e=>!n.has(e.messageId)).map(e=>({role:e.role,content:e.content,timestamp:e.timestamp,senderName:e.senderName??void 0,senderVisitorId:e.senderVisitorId??void 0,messageId:e.messageId}));if(r.length===0)return e;let i=[...e,...r];return i.sort((e,t)=>e.timestamp-t.timestamp),i})}catch(e){console.error(`[group-poll] failed: ${e instanceof Error?e.message:String(e)}`)}},[e,t,r]);(0,A.useEffect)(()=>{if(!t)return;let e,r=!1;function i(){if(r)return;let t=a.current?3e3:3e4;e=setTimeout(async()=>{n||await o(),i()},t)}return i(),()=>{r=!0,clearTimeout(e)}},[t,n,o])}var V=a();function re({value:e,onChange:t,onComplete:n,disabled:r}){let i=(0,A.useRef)([]);function a(n,r){r.key===`Backspace`?(r.preventDefault(),e[n]?t(e.slice(0,n)+e.slice(n+1)):n>0&&(t(e.slice(0,n-1)+e.slice(n)),i.current[n-1]?.focus())):r.key===`ArrowLeft`&&n>0?i.current[n-1]?.focus():r.key===`ArrowRight`&&n<5&&i.current[n+1]?.focus()}function o(r,a){let o=a.nativeEvent.data;if(!o||!/^\d$/.test(o))return;let s=e.split(``);for(s[r]=o;s.length<r;)s.push(``);let c=s.join(``).replace(/\D/g,``).slice(0,6);t(c),c.length===6?n(c):r<5&&i.current[r+1]?.focus()}function s(e){e.preventDefault();let r=e.clipboardData.getData(`text`).replace(/\D/g,``).slice(0,6);r&&(t(r),r.length===6?n(r):i.current[r.length]?.focus())}return(0,V.jsx)(`div`,{className:`gate-otp-field`,children:Array.from({length:6}).map((t,n)=>(0,V.jsx)(`input`,{ref:e=>{i.current[n]=e},type:`text`,inputMode:`numeric`,className:`pin-box${e[n]?` pin-box-filled`:``}`,value:e[n]||``,onKeyDown:e=>a(n,e),onInput:e=>o(n,e),onPaste:s,onFocus:e=>e.target.select(),autoFocus:n===0,autoComplete:`off`,maxLength:1,disabled:r,"aria-label":`Code digit ${n+1}`},n))})}function ie({gateState:e,setGateState:t,grantInfo:n,setGrantInfo:r,gateCacheKeyRef:i,resolvedSlugRef:a,onAuthenticated:o}){let[s,c]=(0,A.useState)(``),[l,u]=(0,A.useState)(``),[d,f]=(0,A.useState)(``),[p,m]=(0,A.useState)(!1),[h,g]=(0,A.useState)(``),[_,v]=(0,A.useState)(``),[x,S]=(0,A.useState)(!1),[C,w]=(0,A.useState)(null),[T,E]=(0,A.useState)(null),[D,O]=(0,A.useState)(!1);async function k(e){if(e.preventDefault(),!D){w(null),O(!0);try{let e=a.current,n=await fetch(`/api/access/login`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({contact:s,password:l,agentSlug:e})}),i=await n.json();n.ok?o(i.session_key):n.status===401?i.error?.includes(`setup not complete`)||i.error?.includes(`invitation link`)?(t(`private-agent`),w(null)):w(i.error||`Invalid credentials`):n.status===403?(t(`access-expired`),i.expiresAt&&r(e=>e?{...e,expiresAt:i.expiresAt}:{displayName:null,contactValue:s,contactMethod:`email`,expiresAt:i.expiresAt,status:`expired`})):n.status===429?w(i.error||`Too many attempts. Please try again later.`):w(i.error||`Something went wrong`)}catch{w(`Unable to connect. Please try again.`)}finally{O(!1)}}}async function j(e){if(!D){w(null),O(!0);try{let n=a.current,o=await fetch(`/api/access/verify-otp`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({phone:_,code:e,agentSlug:n})}),s=await o.json();o.ok?(i.current=s.session_key,r(s.grant),t(`set-password`)):o.status===429?t(`otp-failed`):(w(s.error||`Invalid code`),g(``))}catch{w(`Unable to connect. Please try again.`)}finally{O(!1)}}}async function M(e){if(e.preventDefault(),!D){if(w(null),l!==d){w(`Passwords do not match`);return}if(!L(l).every(e=>e.met)){w(`Password does not meet requirements`);return}O(!0);try{let e=i.current;if(!e){w(`Session expired. Please use your invitation link again.`);return}let t=await fetch(`/api/access/create-credentials`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({session_key:e,password:l})}),n=await t.json();t.ok?o(n.session_key):t.status===400&&n.requirements?w(n.requirements.filter(e=>!e.met).map(e=>e.label).join(`, `)):w(n.error||`Something went wrong`)}catch{w(`Unable to connect. Please try again.`)}finally{O(!1)}}}async function N(e){if(e.preventDefault(),!(D||!s)){w(null),O(!0);try{let e=a.current,t=await fetch(`/api/access/forgot-password`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({contact:s,agentSlug:e})});t.status===429?w((await t.json()).error||`Too many attempts. Please try again later.`):(E(`If an account exists, a reset link has been sent.`),setTimeout(()=>{S(!1),E(null)},4e3))}catch{w(`Unable to connect. Please try again.`)}finally{O(!1)}}}switch(e){case`set-password`:{let e=L(l),t=e.every(e=>e.met),r=l===d,i=t&&r&&d.length>0;return(0,V.jsx)(`div`,{className:`gate-wrap`,children:(0,V.jsxs)(`div`,{className:`gate-card`,children:[n?.expiresAt&&(0,V.jsxs)(`div`,{className:`gate-expiry-badge`,children:[`Access until `,new Date(n.expiresAt).toLocaleDateString(`en-GB`,{day:`numeric`,month:`short`,year:`numeric`})]}),(0,V.jsxs)(`h2`,{className:`gate-title`,children:[`Welcome, `,n?.displayName||`there`]}),(0,V.jsx)(`p`,{className:`gate-subtitle`,children:`Create a password to access this agent in the future.`}),(0,V.jsxs)(`form`,{className:`gate-form`,onSubmit:M,children:[(0,V.jsxs)(`div`,{className:`gate-field`,children:[(0,V.jsx)(`label`,{htmlFor:`gate-display-name`,children:`Display name`}),(0,V.jsx)(`input`,{id:`gate-display-name`,type:`text`,value:n?.displayName||``,disabled:!0})]}),(0,V.jsxs)(`div`,{className:`gate-field gate-pw-row`,children:[(0,V.jsx)(`label`,{htmlFor:`gate-pw`,children:`Password`}),(0,V.jsx)(`div`,{className:`gate-pw-toggle`,children:(0,V.jsx)(b,{checked:p,onChange:m,label:`Show`})}),(0,V.jsx)(`input`,{id:`gate-pw`,type:p?`text`:`password`,value:l,onChange:e=>u(e.target.value),placeholder:`Your password`,autoFocus:!0,autoComplete:`new-password`}),l.length>0&&(0,V.jsx)(`div`,{className:`gate-strength`,children:e.map(e=>(0,V.jsxs)(`span`,{className:`gate-strength-item${e.met?` met`:``}`,children:[e.met?`✓`:`○`,` `,e.label]},e.key))})]}),(0,V.jsxs)(`div`,{className:`gate-field`,children:[(0,V.jsx)(`label`,{htmlFor:`gate-pw-confirm`,children:`Confirm password`}),(0,V.jsx)(`input`,{id:`gate-pw-confirm`,type:p?`text`:`password`,value:d,onChange:e=>f(e.target.value),placeholder:`Confirm your password`,autoComplete:`new-password`}),d.length>0&&!r&&(0,V.jsx)(`div`,{className:`gate-error`,children:`Passwords do not match`})]}),C&&(0,V.jsx)(`div`,{className:`gate-error`,children:C}),(0,V.jsx)(`div`,{className:`gate-submit`,children:(0,V.jsx)(y,{variant:`primary`,type:`submit`,fullWidth:!0,disabled:!i||D,loading:D,children:`Create account & enter chat`})})]})]})})}case`enter-otp`:return(0,V.jsx)(`div`,{className:`gate-wrap`,children:(0,V.jsxs)(`div`,{className:`gate-card`,children:[(0,V.jsx)(`h2`,{className:`gate-title`,children:`Enter your code`}),(0,V.jsxs)(`p`,{className:`gate-subtitle`,children:[`Enter the 6-digit code sent to `,R(_,`phone`)]}),(0,V.jsx)(re,{value:h,onChange:g,onComplete:j,disabled:D}),C&&(0,V.jsx)(`div`,{className:`gate-error`,children:C}),D&&(0,V.jsxs)(`div`,{className:`gate-loading`,children:[(0,V.jsx)(`span`,{className:`spinner`}),`Verifying...`]}),(0,V.jsx)(`div`,{className:`gate-resend`,children:(0,V.jsx)(`button`,{type:`button`,className:`gate-link`,onClick:()=>{t(`sign-in`),g(``),w(null)},children:`Use a different number`})})]})});case`sign-in`:case`private-agent`:return(0,V.jsx)(`div`,{className:`gate-wrap`,children:(0,V.jsxs)(`div`,{className:`gate-card`,children:[(0,V.jsx)(`h2`,{className:`gate-title`,children:e===`private-agent`?`Private Agent`:`Welcome back`}),(0,V.jsx)(`p`,{className:`gate-subtitle`,children:e===`private-agent`?`This agent is invitation-only. If you have an account, sign in below.`:`Sign in to continue your conversation.`}),x?(0,V.jsxs)(`form`,{className:`gate-form`,onSubmit:N,children:[(0,V.jsxs)(`div`,{className:`gate-field`,children:[(0,V.jsx)(`label`,{htmlFor:`gate-forgot-contact`,children:`Email or phone`}),(0,V.jsx)(`input`,{id:`gate-forgot-contact`,type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`you@example.com`,autoFocus:!0,autoComplete:`email`})]}),C&&(0,V.jsx)(`div`,{className:`gate-error`,children:C}),T&&(0,V.jsx)(`div`,{className:`gate-success`,children:T}),(0,V.jsx)(`div`,{className:`gate-submit`,children:(0,V.jsx)(y,{variant:`primary`,type:`submit`,fullWidth:!0,disabled:!s.trim()||D,loading:D,children:`Send reset link`})}),(0,V.jsx)(`div`,{className:`gate-actions`,children:(0,V.jsx)(`button`,{type:`button`,className:`gate-link`,onClick:()=>{S(!1),w(null),E(null)},children:`Back to sign in`})})]}):(0,V.jsxs)(`form`,{className:`gate-form`,onSubmit:k,children:[(0,V.jsxs)(`div`,{className:`gate-field`,children:[(0,V.jsx)(`label`,{htmlFor:`gate-contact`,children:`Email or phone`}),(0,V.jsx)(`input`,{id:`gate-contact`,type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`you@example.com`,autoFocus:!0,autoComplete:`email`})]}),(0,V.jsxs)(`div`,{className:`gate-field gate-pw-row`,children:[(0,V.jsx)(`label`,{htmlFor:`gate-login-pw`,children:`Password`}),(0,V.jsx)(`div`,{className:`gate-pw-toggle`,children:(0,V.jsx)(b,{checked:p,onChange:m,label:`Show`})}),(0,V.jsx)(`input`,{id:`gate-login-pw`,type:p?`text`:`password`,value:l,onChange:e=>u(e.target.value),placeholder:`Your password`,autoComplete:`current-password`})]}),C&&(0,V.jsx)(`div`,{className:`gate-error`,children:C}),(0,V.jsx)(`div`,{className:`gate-submit`,children:(0,V.jsx)(y,{variant:`primary`,type:`submit`,fullWidth:!0,disabled:!s.trim()||!l||D,loading:D,children:`Sign in`})}),(0,V.jsx)(`div`,{className:`gate-actions`,children:(0,V.jsx)(`button`,{type:`button`,className:`gate-link`,onClick:()=>{S(!0),w(null)},children:`Forgot password?`})})]}),e===`private-agent`&&(0,V.jsx)(`p`,{className:`gate-hint`,children:`No account? You need an invitation from the agent owner.`})]})});case`access-expired`:return(0,V.jsx)(`div`,{className:`gate-wrap`,children:(0,V.jsxs)(`div`,{className:`gate-card`,children:[(0,V.jsx)(`div`,{className:`gate-icon`,children:`⏰`}),(0,V.jsx)(`h2`,{className:`gate-title`,children:`Access expired`}),(0,V.jsxs)(`p`,{className:`gate-subtitle`,children:[n?.expiresAt?`Your access expired on ${new Date(n.expiresAt).toLocaleDateString(`en-GB`,{day:`numeric`,month:`long`,year:`numeric`})}.`:`Your access to this agent has expired.`,` `,`Contact the agent owner to renew.`]}),(0,V.jsx)(`div`,{className:`gate-actions`,children:(0,V.jsx)(y,{variant:`secondary`,onClick:()=>{t(`sign-in`),w(null),u(``)},children:`Sign in with a different account`})})]})});case`link-expired`:return(0,V.jsx)(`div`,{className:`gate-wrap`,children:(0,V.jsxs)(`div`,{className:`gate-card`,children:[(0,V.jsx)(`div`,{className:`gate-icon`,children:`⚠️`}),(0,V.jsx)(`h2`,{className:`gate-title`,children:`Link expired`}),(0,V.jsx)(`p`,{className:`gate-subtitle`,children:`This invitation link has expired or has already been used. If you already set your password, sign in below. Otherwise, ask the agent owner to send a new invitation.`}),(0,V.jsx)(`div`,{className:`gate-actions`,children:(0,V.jsx)(y,{variant:`primary`,onClick:()=>{t(`sign-in`),w(null)},children:`Go to sign in`})})]})});case`otp-failed`:return(0,V.jsx)(`div`,{className:`gate-wrap`,children:(0,V.jsxs)(`div`,{className:`gate-card`,children:[(0,V.jsx)(`div`,{className:`gate-icon`,children:`⛔`}),(0,V.jsx)(`h2`,{className:`gate-title`,children:`Too many attempts`}),(0,V.jsx)(`p`,{className:`gate-subtitle`,children:`You've entered the wrong code too many times. Ask the agent owner to send a new code.`}),(0,V.jsx)(`div`,{className:`gate-actions`,children:(0,V.jsx)(y,{variant:`secondary`,onClick:()=>{t(`sign-in`),w(null),g(``)},children:`Back to sign in`})})]})})}}var H=100;function U(e){let t;try{t=JSON.parse(e)}catch(e){return{ok:!1,reason:`invalid JSON: ${e instanceof Error?e.message:String(e)}`}}if(typeof t!=`object`||!t||Array.isArray(t))return{ok:!1,reason:`payload is not a JSON object`};let n=t;if(typeof n.url!=`string`||n.url.length===0)return{ok:!1,reason:`url is required`};let r;try{r=new URL(n.url)}catch{return{ok:!1,reason:`url is not a valid URL`}}if(r.protocol!==`http:`&&r.protocol!==`https:`)return{ok:!1,reason:`url scheme ${r.protocol} is not permitted (http/https only)`};if(typeof n.intent!=`string`||n.intent.length===0)return{ok:!1,reason:`intent is required`};if(n.intent.length>H)return{ok:!1,reason:`intent exceeds ${H} chars`};let i;if(n.hostname!==void 0){if(typeof n.hostname!=`string`)return{ok:!1,reason:`hostname must be a string when provided`};i=n.hostname}return{ok:!0,payload:i?{url:n.url,intent:n.intent,hostname:i}:{url:n.url,intent:n.intent}}}var W={ok:`succeeded`,timeout:`navigation timed out`,"cdp-unreachable":`device browser is not responding`,error:`navigation error`};async function G(e,t){try{await fetch(`/api/admin/events`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({event:e,fields:t})})}catch(t){console.error(`[device-url:event] failed to post event`,e,t)}}function K({raw:e,reason:t}){return(0,A.useEffect)(()=>{G(`device-url:malformed`,{reason:t.slice(0,200),length:e.length})},[e,t]),(0,V.jsx)(`pre`,{className:`md-pre md-device-url-malformed`,children:(0,V.jsxs)(`code`,{className:`md-code`,children:[(0,V.jsxs)(`span`,{className:`md-device-url-malformed-label`,children:[(0,V.jsx)(O,{size:12}),` device-URL block is malformed: `,t]}),`
|
|
4
|
-
`,e]})})}function q({payload:e,reason:t}){let[n,r]=(0,A.useState)(`idle`);(0,A.useEffect)(()=>{G(`device-url:fallback-shown`,{intent:e.intent,reason:t,hostname:e.hostname??``})},[e.intent,e.hostname,t]);let i=async()=>{try{await navigator.clipboard.writeText(e.url),r(`copied`),window.setTimeout(()=>r(`idle`),2e3)}catch(t){r(`failed`),G(`device-url:fallback-shown`,{intent:e.intent,reason:`clipboard-api-unavailable`,hostname:e.hostname??``,detail:t instanceof Error?t.message.slice(0,200):String(t).slice(0,200)})}},a=e.hostname?` on the device (${e.hostname})`:` on the device`;return(0,V.jsxs)(`div`,{className:`md-device-url md-device-url-fallback`,role:`group`,children:[(0,V.jsxs)(`div`,{className:`md-device-url-fallback-message`,children:[(0,V.jsx)(O,{size:14}),(0,V.jsxs)(`span`,{children:[`Could not open `,(0,V.jsx)(`strong`,{children:e.intent}),a,` automatically (`,t,`). Copy the URL and open it in a browser on the device:`]})]}),(0,V.jsxs)(`div`,{className:`md-device-url-fallback-url`,children:[(0,V.jsx)(`code`,{children:e.url}),(0,V.jsxs)(`button`,{type:`button`,className:`md-device-url-fallback-copy`,onClick:i,"aria-label":`Copy URL`,children:[n===`copied`?(0,V.jsx)(u,{size:14}):(0,V.jsx)(f,{size:14}),n===`copied`?`Copied`:n===`failed`?`Copy failed`:`Copy`]})]}),n===`failed`&&(0,V.jsx)(`div`,{className:`md-device-url-fallback-copy-failed`,children:`Your browser blocked the copy action. Select the URL text above manually to copy it.`})]})}function J({payload:e}){let t=v(),[n,r]=(0,A.useState)({phase:`idle`});(0,A.useEffect)(()=>{G(`device-url:render`,{intent:e.intent,url:e.url,hostname:e.hostname??``,origin:`tool`})},[e.intent,e.url,e.hostname]);let i=async()=>{if(n.phase!==`navigating`){r({phase:`navigating`});try{let n=await fetch(`/api/admin/device-browser/navigate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}),i=await n.json().catch(()=>({}));if(n.ok&&i.ok){r({phase:`succeeded`}),t&&(t.onShowVnc(),G(`device-url:vnc-surface-shown`,{intent:e.intent})),window.setTimeout(()=>r({phase:`idle`}),2500);return}r({phase:`fallback`,reason:i.navigateResult?W[i.navigateResult]:i.detail?i.detail.slice(0,80):`navigation failed`})}catch(e){r({phase:`fallback`,reason:(e instanceof Error?e.message:String(e)).slice(0,80)})}}},a=n.phase===`navigating`,o=n.phase===`succeeded`;return(0,V.jsxs)(`div`,{className:`md-device-url`,children:[(0,V.jsxs)(`button`,{type:`button`,className:`md-device-url-button`,onClick:i,disabled:a,"aria-label":`Open ${e.intent} on the device's browser`,title:e.hostname?`Opens on device: ${e.hostname}`:`Opens on the device running Maxy`,children:[(0,V.jsx)(l,{size:16,className:`md-device-url-icon`}),(0,V.jsx)(`span`,{className:`md-device-url-label`,children:a?`Opening…`:o?`Opened on device`:`Open ${e.intent} on device`})]}),n.phase===`fallback`&&(0,V.jsx)(q,{payload:e,reason:n.reason})]})}function Y({source:e}){let t=U(e.trim());return t.ok?(0,V.jsx)(J,{payload:t.payload}):(0,V.jsx)(K,{raw:e,reason:t.reason})}var X=`modulepreload`,ae=function(e){return`/`+e},Z={},Q=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=ae(t,n),t in Z)return;Z[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:X,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},$=null;function oe(){return $||=Q(async()=>{let{default:e}=await import(`./mermaid.core-DhZqC4uG.js`);return{default:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])).then(({default:e})=>(e.initialize({startOnLoad:!1,theme:`neutral`}),e)),$}function se({source:e}){let t=(0,A.useRef)(null),[n,r]=(0,A.useState)(null);return(0,A.useEffect)(()=>{let n=!1,i=`mermaid-${Math.random().toString(36).slice(2,9)}`;return oe().then(t=>t.render(i,e)).then(({svg:e})=>{!n&&t.current&&(t.current.innerHTML=e)}).catch(t=>{n||(console.error(`[MermaidBlock] render failed:`,e,t),r(t instanceof Error?t.message:`Diagram render failed`))}),()=>{n=!0}},[e]),n?(0,V.jsxs)(`div`,{className:`md-mermaid md-mermaid-error`,children:[(0,V.jsx)(`div`,{className:`md-mermaid-error-label`,children:`Diagram render error`}),(0,V.jsx)(`pre`,{className:`md-pre`,children:(0,V.jsx)(`code`,{className:`md-code`,children:e})})]}):(0,V.jsx)(`div`,{className:`md-mermaid`,ref:t})}var ce=/\.(mp4|webm|mov)(\?.*)?$/i,le=/(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]+)/,ue=/vimeo\.com\/(\d+)/;function de(e){return!!e&&ce.test(e)}function fe(e){if(!e)return null;let t=e.match(le);return t?t[1]:null}function pe(e){if(!e)return null;let t=e.match(ue);return t?t[1]:null}function me({src:e}){return(0,V.jsx)(`video`,{className:`md-video`,controls:!0,playsInline:!0,preload:`metadata`,children:(0,V.jsx)(`source`,{src:e})})}function he({videoId:e}){return(0,V.jsx)(`div`,{className:`md-video-iframe`,children:(0,V.jsx)(`iframe`,{src:`https://www.youtube-nocookie.com/embed/${e}`,allow:`accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture`,allowFullScreen:!0,loading:`lazy`})})}function ge({videoId:e}){return(0,V.jsx)(`div`,{className:`md-video-iframe`,children:(0,V.jsx)(`iframe`,{src:`https://player.vimeo.com/video/${e}`,allow:`autoplay; fullscreen; picture-in-picture`,allowFullScreen:!0,loading:`lazy`})})}function _e(e){if(de(e))return(0,V.jsx)(me,{src:e});let t=fe(e);if(t)return(0,V.jsx)(he,{videoId:t});let n=pe(e);return n?(0,V.jsx)(ge,{videoId:n}):null}var ve={p:({children:e})=>(0,V.jsx)(`p`,{className:`md-p`,children:e}),h1:({children:e})=>(0,V.jsx)(`h1`,{className:`md-heading`,children:e}),h2:({children:e})=>(0,V.jsx)(`h2`,{className:`md-heading`,children:e}),h3:({children:e})=>(0,V.jsx)(`h3`,{className:`md-heading`,children:e}),code:({children:e,className:t})=>t===`language-mermaid`?(0,V.jsx)(se,{source:String(e).replace(/\n$/,``)}):t===`language-maxy-device-url`?(0,V.jsx)(Y,{source:String(e).replace(/\n$/,``)}):(0,V.jsx)(`code`,{className:`md-code ${t||``}`.trim(),children:e}),pre:({children:e,node:t})=>{let n=t?.children?.[0];if(n?.type===`element`&&n.tagName===`code`){let t=n.properties?.className??[];if(t.includes(`language-mermaid`)||t.includes(`language-maxy-device-url`))return(0,V.jsx)(V.Fragment,{children:e})}return(0,V.jsx)(`pre`,{className:`md-pre`,children:e})},ul:({children:e})=>(0,V.jsx)(`ul`,{className:`md-list`,children:e}),ol:({children:e})=>(0,V.jsx)(`ol`,{className:`md-list md-list-ordered`,children:e}),li:({children:e})=>(0,V.jsx)(`li`,{className:`md-list-item`,children:e}),hr:()=>(0,V.jsx)(`hr`,{className:`md-hr`}),strong:({children:e})=>(0,V.jsx)(`strong`,{className:`md-strong`,children:e}),img:({src:e,alt:t})=>_e(e)||(0,V.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,children:(0,V.jsx)(`img`,{className:`md-img`,src:e,alt:t||``,loading:`lazy`})}),a:({href:e,children:t})=>_e(e)||(0,V.jsx)(`a`,{href:e,className:`md-link`,target:`_blank`,rel:`noopener noreferrer`,children:t}),table:({children:e})=>(0,V.jsx)(`table`,{className:`md-table`,children:e}),thead:({children:e})=>(0,V.jsx)(`thead`,{className:`md-thead`,children:e}),tbody:({children:e})=>(0,V.jsx)(`tbody`,{children:e}),tr:({children:e})=>(0,V.jsx)(`tr`,{className:`md-tr`,children:e}),th:({children:e})=>(0,V.jsx)(`th`,{className:`md-th`,children:e}),td:({children:e})=>(0,V.jsx)(`td`,{className:`md-td`,children:e})};function ye({content:e,elapsedSeconds:t,timestamp:n}){return(0,V.jsxs)(`div`,{className:`markdown-message`,children:[(0,V.jsx)(g,{remarkPlugins:[p],components:ve,children:e}),t!==void 0&&(0,V.jsxs)(`div`,{className:`message-meta`,children:[t,`s`]}),n&&(0,V.jsx)(`span`,{className:`message-timestamp`,children:n})]})}function be({submitted:e,submittedLabel:t=`Submitted`,actions:n,children:r}){return(0,V.jsxs)(`div`,{className:`component-card${e?` component-card--submitted`:``}`,children:[r,(0,V.jsx)(`div`,{className:`component-card__actions`,children:e?(0,V.jsx)(`span`,{className:`component-card__done-label`,children:t}):n.map((e,t)=>(0,V.jsx)(y,{variant:e.variant,size:`sm`,disabled:e.disabled,onClick:e.onClick,children:e.label},t))})]})}function xe({data:e,onSubmit:t,submitted:n}){let r=e,i=Array.isArray(r?.options)?r.options:[],[a,o]=(0,A.useState)(null),[s,c]=(0,A.useState)(`Submitted`);if(i.length===0)return null;let l=e=>{n||o(e)},u=()=>{if(!a||n)return;let e=i.find(e=>e.value===a);c(e?.label??`Submitted`),t((r?.submitMessage??`Selected: {{value}}`).replace(`{{value}}`,a).replace(`{{label}}`,e?.label??a))},d=()=>{n||(c(r?.backLabel??`Back`),t(r?.backMessage??``))},f=(e,t)=>{if(!n)if(e.key===`ArrowDown`||e.key===`ArrowRight`){e.preventDefault();let n=(t+1)%i.length;l(i[n].value),(e.currentTarget.parentElement?.children[n])?.focus()}else if(e.key===`ArrowUp`||e.key===`ArrowLeft`){e.preventDefault();let n=(t-1+i.length)%i.length;l(i[n].value),(e.currentTarget.parentElement?.children[n])?.focus()}else (e.key===` `||e.key===`Enter`)&&(e.preventDefault(),l(i[t].value))};return(0,V.jsx)(be,{submitted:n,submittedLabel:s,actions:[...r?.backLabel&&r?.backMessage?[{label:r.backLabel,variant:`ghost`,onClick:d}]:[],{label:r?.submitLabel??`Confirm`,variant:`primary`,disabled:!a,onClick:u}],children:(0,V.jsxs)(`div`,{className:`single-select`,role:`radiogroup`,"aria-label":r?.title??`Select one`,children:[r?.title&&(0,V.jsx)(`div`,{className:`single-select__title`,children:r.title}),i.map((e,t)=>(0,V.jsxs)(`div`,{className:`single-select__row${a===e.value?` single-select__row--selected`:``}`,role:`radio`,"aria-checked":a===e.value,tabIndex:a===e.value||!a&&t===0?0:-1,onClick:()=>l(e.value),onKeyDown:e=>f(e,t),children:[(0,V.jsx)(`span`,{className:`single-select__radio${a===e.value?` single-select__radio--checked`:``}`}),(0,V.jsxs)(`div`,{className:`single-select__info`,children:[(0,V.jsxs)(`span`,{className:`single-select__label`,children:[e.icon&&(0,V.jsx)(`span`,{className:`single-select__icon`,children:e.icon}),e.label]}),e.description&&(0,V.jsx)(`span`,{className:`single-select__desc`,children:e.description})]})]},e.value))]})})}function Se({data:e,onSubmit:t,submitted:n}){let r=e,i=Array.isArray(r?.options)?r.options:[],[a,o]=(0,A.useState)(i.map(e=>!!e.locked||!!e.defaultSelected)),[s,c]=(0,A.useState)(`Submitted`);if(i.length===0)return null;let l=i.some(e=>e.locked),u=i.every((e,t)=>e.locked||a[t]),d=e=>{n||i[e].locked||o(t=>t.map((t,n)=>n===e?!t:t))},f=()=>{n||o(i.map((e,t)=>e.locked?a[t]:!u))},p=i.filter((e,t)=>!e.locked&&a[t]).map(e=>e.value),m=p.length>0||l,h=()=>{if(!(!m||n)){if(c(`Submitted`),p.length===0){t(`No optional plugins selected`);return}t((r?.submitMessage??`Selected: {{values}}`).replace(`{{values}}`,p.join(`, `)))}},g=()=>{n||(c(`Skipped`),t(r?.skipMessage??`Skipped`))},_=()=>{n||(c(r?.backLabel??`Back`),t(r?.backMessage??``))},v=[];return r?.backLabel&&r?.backMessage&&v.push({label:r.backLabel,variant:`ghost`,onClick:_}),r?.skipLabel&&v.push({label:r.skipLabel,variant:`ghost`,onClick:g}),v.push({label:r?.submitLabel??`Confirm`,variant:`primary`,disabled:!m,onClick:h}),(0,V.jsx)(be,{submitted:n,submittedLabel:s,actions:v,children:(0,V.jsxs)(`div`,{className:`multi-select`,children:[r?.title&&(0,V.jsx)(`div`,{className:`multi-select__title`,children:r.title}),r?.selectAll&&(0,V.jsx)(`div`,{className:`multi-select__header`,children:(0,V.jsx)(b,{checked:u,onChange:f,label:`Select all`,disabled:n})}),(0,V.jsx)(`div`,{className:`multi-select__list`,role:`group`,"aria-label":r?.title??`Select options`,children:i.map((e,t)=>{let r=e.group&&(t===0||e.group!==i[t-1].group),o=!!e.locked;return(0,V.jsxs)(A.Fragment,{children:[r&&(0,V.jsx)(`div`,{className:`multi-select__group-header`,children:e.group}),(0,V.jsxs)(`div`,{className:`multi-select__row${o?` multi-select__row--locked`:``}`,role:`checkbox`,"aria-checked":a[t],"aria-disabled":o||void 0,tabIndex:o?-1:0,onClick:()=>d(t),onKeyDown:e=>{n||o||(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),d(t))},children:[(0,V.jsx)(b,{checked:a[t],onChange:()=>d(t),disabled:n||o}),(0,V.jsxs)(`div`,{className:`multi-select__info`,children:[(0,V.jsxs)(`span`,{className:`multi-select__label`,children:[e.label,e.badge&&(0,V.jsx)(`span`,{className:`multi-select__badge`,children:e.badge})]}),e.description&&(0,V.jsx)(`span`,{className:`multi-select__desc`,children:e.description})]})]})]},e.value)})})]})})}function Ce({data:e,onSubmit:t,submitted:n}){let r=e,i=Array.isArray(r?.buttons)?r.buttons:[],[a,o]=(0,A.useState)(`Submitted`);if(i.length===0)return null;let s=e=>{n||(o(e.label),t(e.value))};return(0,V.jsx)(be,{submitted:n,submittedLabel:a,actions:i.map(e=>({label:e.label,variant:`primary`,onClick:()=>s(e)})),children:(0,V.jsx)(V.Fragment,{})})}var we={"single-select":xe,"multi-select":Se,"action-buttons":Ce};function Te({name:e,data:t,onSubmit:n,submitted:r}){let i=we[e];return i?(0,V.jsx)(i,{data:t,onSubmit:n,submitted:r}):(console.warn(`[PublicComponentRenderer] Unknown component: "${e}". Registered: ${Object.keys(we).join(`, `)}`),(0,V.jsx)(`div`,{className:`component-card component-card--error`,children:(0,V.jsxs)(`p`,{style:{fontFamily:`var(--font-body)`,fontSize:12,color:`var(--text-secondary)`},children:[`Component “`,e,`” is not available. This may require a platform update.`]})}))}function Ee(e){let t=new Date(e),n=new Date,r=String(t.getHours()).padStart(2,`0`),i=String(t.getMinutes()).padStart(2,`0`),a=String(t.getSeconds()).padStart(2,`0`);return t.toDateString()===n.toDateString()?`${r}:${i}:${a}`:`${String(t.getDate()).padStart(2,`0`)}-${String(t.getMonth()+1).padStart(2,`0`)}-${t.getFullYear()} ${r}:${i}:${a}`}function De({messages:e,isStreaming:t,sessionError:n,selectionMode:r,selectedItems:i,toggleSelectItem:a,onComponentSubmit:o,remainingSuggestions:s,onSuggestionClick:c,isAtBottom:l,setIsAtBottom:u,isGroup:d,sessionId:f}){let[p,m]=(0,A.useState)(new Set),[g,_]=(0,A.useState)(new Set),v=(0,A.useRef)(null),C=(0,A.useRef)(null),w=(0,A.useRef)(null),T=(0,A.useRef)(!1),E=(0,A.useRef)(!1),D=(0,A.useRef)(!1),O=(0,A.useRef)(0),k=(0,A.useRef)(!1),j=(0,A.useRef)(new Map);k.current=t,(0,A.useEffect)(()=>{t&&!T.current&&l&&(E.current=!0)},[t,l]),(0,A.useEffect)(()=>{if(!E.current&&!l){T.current=t,D.current=!1;return}if(T.current&&!t&&w.current&&C.current){let e=w.current;if(e.offsetHeight>C.current.clientHeight){E.current=!1,D.current=!0,e.scrollIntoView({behavior:`smooth`,block:`start`}),T.current=t;return}}(l||E.current)&&!D.current&&v.current?.scrollIntoView({behavior:`smooth`}),T.current&&!t&&(E.current=!1),T.current=t},[e,l,t]),(0,A.useEffect)(()=>{let e=C.current;if(!e)return;let t=()=>{let t=e.scrollTop;k.current&&t<O.current&&(E.current=!1),O.current=t,u(e.scrollHeight-e.scrollTop-e.clientHeight<80)};return e.addEventListener(`scroll`,t,{passive:!0}),t(),()=>e.removeEventListener(`scroll`,t)},[u]),(0,A.useEffect)(()=>{function e(){_(e=>{let t=new Set;return j.current.forEach((n,r)=>{n.isConnected&&(p.has(r)?e.has(r)&&t.add(r):n.scrollHeight>n.clientHeight+2&&t.add(r))}),e.size===t.size&&[...e].every(e=>t.has(e))?e:t})}e();let t=new ResizeObserver(e);return j.current.forEach(e=>t.observe(e)),()=>t.disconnect()},[e.length,p]);let M=[...e].sort((e,t)=>e.timestamp-t.timestamp);(0,A.useEffect)(()=>{r&&console.log(`[selection] entered`,{conversationId:f??`unknown`,order:M.map(e=>({ts:e.timestamp,role:e.role,id:e.messageId}))})},[r]);let N=M.reduce((e,t,n)=>t.role===`maxy`&&!t.hidden?n:e,-1);return(0,V.jsxs)(`div`,{className:`chat-messages-wrap`,children:[r&&(0,V.jsx)(`div`,{className:`selection-overlay-band`}),(0,V.jsxs)(`div`,{className:`chat-messages`,ref:C,children:[n&&e.length===0&&(0,V.jsx)(`div`,{className:`session-error`,children:(0,V.jsx)(`p`,{children:n})}),M.map((e,n)=>{if(e.hidden)return null;let s=t&&n===M.length-1,c=`${e.timestamp}_${e.role}`,l=i.has(c);return(0,V.jsxs)(`div`,{ref:n===N?w:void 0,className:`message ${e.role}${l?` selected`:``}`,children:[r&&!s&&(0,V.jsx)(`div`,{className:`message-select-check`,children:(0,V.jsx)(b,{checked:l,onChange:()=>a(c)})}),(0,V.jsxs)(`div`,{className:`bubble`,children:[d&&e.role===`visitor`&&e.senderName&&(0,V.jsx)(`span`,{className:`bubble-sender`,children:e.senderName}),e.role===`visitor`&&e.content?(()=>{let t=p.has(n),r=g.has(n);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{ref:e=>{e?j.current.set(n,e):j.current.delete(n)},className:t?`bubble-content`:`bubble-content clamped${r?` overflowing`:``}`,children:e.content}),r&&(0,V.jsx)(`div`,{className:`bubble-expand`,children:(0,V.jsx)(y,{variant:`icon`,className:t?`expanded`:``,onClick:()=>m(e=>{let t=new Set(e);return t.has(n)?t.delete(n):t.add(n),t}),"aria-label":t?`Collapse message`:`Expand message`,children:(0,V.jsx)(x,{size:14})})})]})})():e.content?(0,V.jsx)(ye,{content:e.content,timestamp:Ee(e.timestamp)}):(0,V.jsxs)(`span`,{className:`typing-indicator`,children:[(0,V.jsx)(`span`,{className:`typing-dot`}),(0,V.jsx)(`span`,{className:`typing-dot`}),(0,V.jsx)(`span`,{className:`typing-dot`})]}),e.attachments&&e.attachments.length>0&&(0,V.jsx)(`div`,{className:`message-attachments`,children:e.attachments.map((e,t)=>(0,V.jsxs)(`span`,{className:`message-attachment-chip no-action`,children:[e.mimeType===`application/pdf`?(0,V.jsx)(h,{size:12}):e.mimeType.startsWith(`text/`)?(0,V.jsx)(S,{size:12}):null,(0,V.jsx)(`span`,{children:e.filename})]},t))}),e.role===`visitor`&&(0,V.jsx)(`span`,{className:`message-timestamp`,children:Ee(e.timestamp)})]}),e.role===`maxy`&&e.components&&e.components.length>0&&(0,V.jsx)(`div`,{className:`public-components`,children:e.components.map((e,t)=>(0,V.jsx)(`div`,{className:`public-component-enter`,children:(0,V.jsx)(Te,{name:e.name,data:e.data,onSubmit:e=>o(n,t,e),submitted:e.submitted})},t))})]},n)}),!t&&s.length>0&&(0,V.jsx)(`div`,{className:`chat-suggestions`,children:s.map(e=>(0,V.jsx)(y,{variant:`suggestion`,onClick:()=>c(e),children:e},e))}),(0,V.jsx)(`div`,{ref:v})]}),!l&&(0,V.jsx)(`button`,{className:`scroll-to-bottom`,onClick:()=>v.current?.scrollIntoView({behavior:`smooth`}),"aria-label":`Scroll to bottom`,children:(0,V.jsx)(x,{size:18})})]})}function Oe({selectedItems:e,messages:t,isStreaming:n,copySelected:r,selectAll:i,exitSelection:a,showCopyToast:o}){let[s,c]=(0,A.useState)(!1),l=(0,A.useRef)(null),u=(0,A.useRef)(!1);function p(e){let n=e.lastIndexOf(`_`),r=e.slice(0,n),i=e.slice(n+1),a=parseInt(r,10);return t.find(e=>e.timestamp===a&&e.role===i)?.content??``}function m(e,t){return parseInt(e.slice(0,e.lastIndexOf(`_`)),10)-parseInt(t.slice(0,t.lastIndexOf(`_`)),10)}function h(){let e=[...t].sort((e,t)=>e.timestamp-t.timestamp),n=[];for(let t of e){if(t.hidden||!t.content)continue;let e=t.role===`visitor`?`Visitor`:`Maxy`;n.push(`${e}:\n${t.content}`)}return n.join(`
|
|
4
|
+
`,e]})})}function q({payload:e,reason:t}){let[n,r]=(0,A.useState)(`idle`);(0,A.useEffect)(()=>{G(`device-url:fallback-shown`,{intent:e.intent,reason:t,hostname:e.hostname??``})},[e.intent,e.hostname,t]);let i=async()=>{try{await navigator.clipboard.writeText(e.url),r(`copied`),window.setTimeout(()=>r(`idle`),2e3)}catch(t){r(`failed`),G(`device-url:fallback-shown`,{intent:e.intent,reason:`clipboard-api-unavailable`,hostname:e.hostname??``,detail:t instanceof Error?t.message.slice(0,200):String(t).slice(0,200)})}},a=e.hostname?` on the device (${e.hostname})`:` on the device`;return(0,V.jsxs)(`div`,{className:`md-device-url md-device-url-fallback`,role:`group`,children:[(0,V.jsxs)(`div`,{className:`md-device-url-fallback-message`,children:[(0,V.jsx)(O,{size:14}),(0,V.jsxs)(`span`,{children:[`Could not open `,(0,V.jsx)(`strong`,{children:e.intent}),a,` automatically (`,t,`). Copy the URL and open it in a browser on the device:`]})]}),(0,V.jsxs)(`div`,{className:`md-device-url-fallback-url`,children:[(0,V.jsx)(`code`,{children:e.url}),(0,V.jsxs)(`button`,{type:`button`,className:`md-device-url-fallback-copy`,onClick:i,"aria-label":`Copy URL`,children:[n===`copied`?(0,V.jsx)(u,{size:14}):(0,V.jsx)(f,{size:14}),n===`copied`?`Copied`:n===`failed`?`Copy failed`:`Copy`]})]}),n===`failed`&&(0,V.jsx)(`div`,{className:`md-device-url-fallback-copy-failed`,children:`Your browser blocked the copy action. Select the URL text above manually to copy it.`})]})}function J({payload:e}){let t=v(),[n,r]=(0,A.useState)({phase:`idle`});(0,A.useEffect)(()=>{G(`device-url:render`,{intent:e.intent,url:e.url,hostname:e.hostname??``,origin:`tool`})},[e.intent,e.url,e.hostname]);let i=async()=>{if(n.phase!==`navigating`){r({phase:`navigating`});try{let n=await fetch(`/api/admin/device-browser/navigate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}),i=await n.json().catch(()=>({}));if(n.ok&&i.ok){r({phase:`succeeded`}),t&&(t.onShowVnc(),G(`device-url:vnc-surface-shown`,{intent:e.intent})),window.setTimeout(()=>r({phase:`idle`}),2500);return}r({phase:`fallback`,reason:i.navigateResult?W[i.navigateResult]:i.detail?i.detail.slice(0,80):`navigation failed`})}catch(e){r({phase:`fallback`,reason:(e instanceof Error?e.message:String(e)).slice(0,80)})}}},a=n.phase===`navigating`,o=n.phase===`succeeded`;return(0,V.jsxs)(`div`,{className:`md-device-url`,children:[(0,V.jsxs)(`button`,{type:`button`,className:`md-device-url-button`,onClick:i,disabled:a,"aria-label":`Open ${e.intent} on the device's browser`,title:e.hostname?`Opens on device: ${e.hostname}`:`Opens on the device running Maxy`,children:[(0,V.jsx)(l,{size:16,className:`md-device-url-icon`}),(0,V.jsx)(`span`,{className:`md-device-url-label`,children:a?`Opening…`:o?`Opened on device`:`Open ${e.intent} on device`})]}),n.phase===`fallback`&&(0,V.jsx)(q,{payload:e,reason:n.reason})]})}function Y({source:e}){let t=U(e.trim());return t.ok?(0,V.jsx)(J,{payload:t.payload}):(0,V.jsx)(K,{raw:e,reason:t.reason})}var X=`modulepreload`,ae=function(e){return`/`+e},Z={},Q=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=ae(t,n),t in Z)return;Z[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:X,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},$=null;function oe(){return $||=Q(async()=>{let{default:e}=await import(`./mermaid.core-CSIEcw1L.js`);return{default:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])).then(({default:e})=>(e.initialize({startOnLoad:!1,theme:`neutral`}),e)),$}function se({source:e}){let t=(0,A.useRef)(null),[n,r]=(0,A.useState)(null);return(0,A.useEffect)(()=>{let n=!1,i=`mermaid-${Math.random().toString(36).slice(2,9)}`;return oe().then(t=>t.render(i,e)).then(({svg:e})=>{!n&&t.current&&(t.current.innerHTML=e)}).catch(t=>{n||(console.error(`[MermaidBlock] render failed:`,e,t),r(t instanceof Error?t.message:`Diagram render failed`))}),()=>{n=!0}},[e]),n?(0,V.jsxs)(`div`,{className:`md-mermaid md-mermaid-error`,children:[(0,V.jsx)(`div`,{className:`md-mermaid-error-label`,children:`Diagram render error`}),(0,V.jsx)(`pre`,{className:`md-pre`,children:(0,V.jsx)(`code`,{className:`md-code`,children:e})})]}):(0,V.jsx)(`div`,{className:`md-mermaid`,ref:t})}var ce=/\.(mp4|webm|mov)(\?.*)?$/i,le=/(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]+)/,ue=/vimeo\.com\/(\d+)/;function de(e){return!!e&&ce.test(e)}function fe(e){if(!e)return null;let t=e.match(le);return t?t[1]:null}function pe(e){if(!e)return null;let t=e.match(ue);return t?t[1]:null}function me({src:e}){return(0,V.jsx)(`video`,{className:`md-video`,controls:!0,playsInline:!0,preload:`metadata`,children:(0,V.jsx)(`source`,{src:e})})}function he({videoId:e}){return(0,V.jsx)(`div`,{className:`md-video-iframe`,children:(0,V.jsx)(`iframe`,{src:`https://www.youtube-nocookie.com/embed/${e}`,allow:`accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture`,allowFullScreen:!0,loading:`lazy`})})}function ge({videoId:e}){return(0,V.jsx)(`div`,{className:`md-video-iframe`,children:(0,V.jsx)(`iframe`,{src:`https://player.vimeo.com/video/${e}`,allow:`autoplay; fullscreen; picture-in-picture`,allowFullScreen:!0,loading:`lazy`})})}function _e(e){if(de(e))return(0,V.jsx)(me,{src:e});let t=fe(e);if(t)return(0,V.jsx)(he,{videoId:t});let n=pe(e);return n?(0,V.jsx)(ge,{videoId:n}):null}var ve={p:({children:e})=>(0,V.jsx)(`p`,{className:`md-p`,children:e}),h1:({children:e})=>(0,V.jsx)(`h1`,{className:`md-heading`,children:e}),h2:({children:e})=>(0,V.jsx)(`h2`,{className:`md-heading`,children:e}),h3:({children:e})=>(0,V.jsx)(`h3`,{className:`md-heading`,children:e}),code:({children:e,className:t})=>t===`language-mermaid`?(0,V.jsx)(se,{source:String(e).replace(/\n$/,``)}):t===`language-maxy-device-url`?(0,V.jsx)(Y,{source:String(e).replace(/\n$/,``)}):(0,V.jsx)(`code`,{className:`md-code ${t||``}`.trim(),children:e}),pre:({children:e,node:t})=>{let n=t?.children?.[0];if(n?.type===`element`&&n.tagName===`code`){let t=n.properties?.className??[];if(t.includes(`language-mermaid`)||t.includes(`language-maxy-device-url`))return(0,V.jsx)(V.Fragment,{children:e})}return(0,V.jsx)(`pre`,{className:`md-pre`,children:e})},ul:({children:e})=>(0,V.jsx)(`ul`,{className:`md-list`,children:e}),ol:({children:e})=>(0,V.jsx)(`ol`,{className:`md-list md-list-ordered`,children:e}),li:({children:e})=>(0,V.jsx)(`li`,{className:`md-list-item`,children:e}),hr:()=>(0,V.jsx)(`hr`,{className:`md-hr`}),strong:({children:e})=>(0,V.jsx)(`strong`,{className:`md-strong`,children:e}),img:({src:e,alt:t})=>_e(e)||(0,V.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,children:(0,V.jsx)(`img`,{className:`md-img`,src:e,alt:t||``,loading:`lazy`})}),a:({href:e,children:t})=>_e(e)||(0,V.jsx)(`a`,{href:e,className:`md-link`,target:`_blank`,rel:`noopener noreferrer`,children:t}),table:({children:e})=>(0,V.jsx)(`table`,{className:`md-table`,children:e}),thead:({children:e})=>(0,V.jsx)(`thead`,{className:`md-thead`,children:e}),tbody:({children:e})=>(0,V.jsx)(`tbody`,{children:e}),tr:({children:e})=>(0,V.jsx)(`tr`,{className:`md-tr`,children:e}),th:({children:e})=>(0,V.jsx)(`th`,{className:`md-th`,children:e}),td:({children:e})=>(0,V.jsx)(`td`,{className:`md-td`,children:e})};function ye({content:e,elapsedSeconds:t,timestamp:n}){return(0,V.jsxs)(`div`,{className:`markdown-message`,children:[(0,V.jsx)(g,{remarkPlugins:[p],components:ve,children:e}),t!==void 0&&(0,V.jsxs)(`div`,{className:`message-meta`,children:[t,`s`]}),n&&(0,V.jsx)(`span`,{className:`message-timestamp`,children:n})]})}function be({submitted:e,submittedLabel:t=`Submitted`,actions:n,children:r}){return(0,V.jsxs)(`div`,{className:`component-card${e?` component-card--submitted`:``}`,children:[r,(0,V.jsx)(`div`,{className:`component-card__actions`,children:e?(0,V.jsx)(`span`,{className:`component-card__done-label`,children:t}):n.map((e,t)=>(0,V.jsx)(y,{variant:e.variant,size:`sm`,disabled:e.disabled,onClick:e.onClick,children:e.label},t))})]})}function xe({data:e,onSubmit:t,submitted:n}){let r=e,i=Array.isArray(r?.options)?r.options:[],[a,o]=(0,A.useState)(null),[s,c]=(0,A.useState)(`Submitted`);if(i.length===0)return null;let l=e=>{n||o(e)},u=()=>{if(!a||n)return;let e=i.find(e=>e.value===a);c(e?.label??`Submitted`),t((r?.submitMessage??`Selected: {{value}}`).replace(`{{value}}`,a).replace(`{{label}}`,e?.label??a))},d=()=>{n||(c(r?.backLabel??`Back`),t(r?.backMessage??``))},f=(e,t)=>{if(!n)if(e.key===`ArrowDown`||e.key===`ArrowRight`){e.preventDefault();let n=(t+1)%i.length;l(i[n].value),(e.currentTarget.parentElement?.children[n])?.focus()}else if(e.key===`ArrowUp`||e.key===`ArrowLeft`){e.preventDefault();let n=(t-1+i.length)%i.length;l(i[n].value),(e.currentTarget.parentElement?.children[n])?.focus()}else (e.key===` `||e.key===`Enter`)&&(e.preventDefault(),l(i[t].value))};return(0,V.jsx)(be,{submitted:n,submittedLabel:s,actions:[...r?.backLabel&&r?.backMessage?[{label:r.backLabel,variant:`ghost`,onClick:d}]:[],{label:r?.submitLabel??`Confirm`,variant:`primary`,disabled:!a,onClick:u}],children:(0,V.jsxs)(`div`,{className:`single-select`,role:`radiogroup`,"aria-label":r?.title??`Select one`,children:[r?.title&&(0,V.jsx)(`div`,{className:`single-select__title`,children:r.title}),i.map((e,t)=>(0,V.jsxs)(`div`,{className:`single-select__row${a===e.value?` single-select__row--selected`:``}`,role:`radio`,"aria-checked":a===e.value,tabIndex:a===e.value||!a&&t===0?0:-1,onClick:()=>l(e.value),onKeyDown:e=>f(e,t),children:[(0,V.jsx)(`span`,{className:`single-select__radio${a===e.value?` single-select__radio--checked`:``}`}),(0,V.jsxs)(`div`,{className:`single-select__info`,children:[(0,V.jsxs)(`span`,{className:`single-select__label`,children:[e.icon&&(0,V.jsx)(`span`,{className:`single-select__icon`,children:e.icon}),e.label]}),e.description&&(0,V.jsx)(`span`,{className:`single-select__desc`,children:e.description})]})]},e.value))]})})}function Se({data:e,onSubmit:t,submitted:n}){let r=e,i=Array.isArray(r?.options)?r.options:[],[a,o]=(0,A.useState)(i.map(e=>!!e.locked||!!e.defaultSelected)),[s,c]=(0,A.useState)(`Submitted`);if(i.length===0)return null;let l=i.some(e=>e.locked),u=i.every((e,t)=>e.locked||a[t]),d=e=>{n||i[e].locked||o(t=>t.map((t,n)=>n===e?!t:t))},f=()=>{n||o(i.map((e,t)=>e.locked?a[t]:!u))},p=i.filter((e,t)=>!e.locked&&a[t]).map(e=>e.value),m=p.length>0||l,h=()=>{if(!(!m||n)){if(c(`Submitted`),p.length===0){t(`No optional plugins selected`);return}t((r?.submitMessage??`Selected: {{values}}`).replace(`{{values}}`,p.join(`, `)))}},g=()=>{n||(c(`Skipped`),t(r?.skipMessage??`Skipped`))},_=()=>{n||(c(r?.backLabel??`Back`),t(r?.backMessage??``))},v=[];return r?.backLabel&&r?.backMessage&&v.push({label:r.backLabel,variant:`ghost`,onClick:_}),r?.skipLabel&&v.push({label:r.skipLabel,variant:`ghost`,onClick:g}),v.push({label:r?.submitLabel??`Confirm`,variant:`primary`,disabled:!m,onClick:h}),(0,V.jsx)(be,{submitted:n,submittedLabel:s,actions:v,children:(0,V.jsxs)(`div`,{className:`multi-select`,children:[r?.title&&(0,V.jsx)(`div`,{className:`multi-select__title`,children:r.title}),r?.selectAll&&(0,V.jsx)(`div`,{className:`multi-select__header`,children:(0,V.jsx)(b,{checked:u,onChange:f,label:`Select all`,disabled:n})}),(0,V.jsx)(`div`,{className:`multi-select__list`,role:`group`,"aria-label":r?.title??`Select options`,children:i.map((e,t)=>{let r=e.group&&(t===0||e.group!==i[t-1].group),o=!!e.locked;return(0,V.jsxs)(A.Fragment,{children:[r&&(0,V.jsx)(`div`,{className:`multi-select__group-header`,children:e.group}),(0,V.jsxs)(`div`,{className:`multi-select__row${o?` multi-select__row--locked`:``}`,role:`checkbox`,"aria-checked":a[t],"aria-disabled":o||void 0,tabIndex:o?-1:0,onClick:()=>d(t),onKeyDown:e=>{n||o||(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),d(t))},children:[(0,V.jsx)(b,{checked:a[t],onChange:()=>d(t),disabled:n||o}),(0,V.jsxs)(`div`,{className:`multi-select__info`,children:[(0,V.jsxs)(`span`,{className:`multi-select__label`,children:[e.label,e.badge&&(0,V.jsx)(`span`,{className:`multi-select__badge`,children:e.badge})]}),e.description&&(0,V.jsx)(`span`,{className:`multi-select__desc`,children:e.description})]})]})]},e.value)})})]})})}function Ce({data:e,onSubmit:t,submitted:n}){let r=e,i=Array.isArray(r?.buttons)?r.buttons:[],[a,o]=(0,A.useState)(`Submitted`);if(i.length===0)return null;let s=e=>{n||(o(e.label),t(e.value))};return(0,V.jsx)(be,{submitted:n,submittedLabel:a,actions:i.map(e=>({label:e.label,variant:`primary`,onClick:()=>s(e)})),children:(0,V.jsx)(V.Fragment,{})})}var we={"single-select":xe,"multi-select":Se,"action-buttons":Ce};function Te({name:e,data:t,onSubmit:n,submitted:r}){let i=we[e];return i?(0,V.jsx)(i,{data:t,onSubmit:n,submitted:r}):(console.warn(`[PublicComponentRenderer] Unknown component: "${e}". Registered: ${Object.keys(we).join(`, `)}`),(0,V.jsx)(`div`,{className:`component-card component-card--error`,children:(0,V.jsxs)(`p`,{style:{fontFamily:`var(--font-body)`,fontSize:12,color:`var(--text-secondary)`},children:[`Component “`,e,`” is not available. This may require a platform update.`]})}))}function Ee(e){let t=new Date(e),n=new Date,r=String(t.getHours()).padStart(2,`0`),i=String(t.getMinutes()).padStart(2,`0`),a=String(t.getSeconds()).padStart(2,`0`);return t.toDateString()===n.toDateString()?`${r}:${i}:${a}`:`${String(t.getDate()).padStart(2,`0`)}-${String(t.getMonth()+1).padStart(2,`0`)}-${t.getFullYear()} ${r}:${i}:${a}`}function De({messages:e,isStreaming:t,sessionError:n,selectionMode:r,selectedItems:i,toggleSelectItem:a,onComponentSubmit:o,remainingSuggestions:s,onSuggestionClick:c,isAtBottom:l,setIsAtBottom:u,isGroup:d,sessionId:f}){let[p,m]=(0,A.useState)(new Set),[g,_]=(0,A.useState)(new Set),v=(0,A.useRef)(null),C=(0,A.useRef)(null),w=(0,A.useRef)(null),T=(0,A.useRef)(!1),E=(0,A.useRef)(!1),D=(0,A.useRef)(!1),O=(0,A.useRef)(0),k=(0,A.useRef)(!1),j=(0,A.useRef)(new Map);k.current=t,(0,A.useEffect)(()=>{t&&!T.current&&l&&(E.current=!0)},[t,l]),(0,A.useEffect)(()=>{if(!E.current&&!l){T.current=t,D.current=!1;return}if(T.current&&!t&&w.current&&C.current){let e=w.current;if(e.offsetHeight>C.current.clientHeight){E.current=!1,D.current=!0,e.scrollIntoView({behavior:`smooth`,block:`start`}),T.current=t;return}}(l||E.current)&&!D.current&&v.current?.scrollIntoView({behavior:`smooth`}),T.current&&!t&&(E.current=!1),T.current=t},[e,l,t]),(0,A.useEffect)(()=>{let e=C.current;if(!e)return;let t=()=>{let t=e.scrollTop;k.current&&t<O.current&&(E.current=!1),O.current=t,u(e.scrollHeight-e.scrollTop-e.clientHeight<80)};return e.addEventListener(`scroll`,t,{passive:!0}),t(),()=>e.removeEventListener(`scroll`,t)},[u]),(0,A.useEffect)(()=>{function e(){_(e=>{let t=new Set;return j.current.forEach((n,r)=>{n.isConnected&&(p.has(r)?e.has(r)&&t.add(r):n.scrollHeight>n.clientHeight+2&&t.add(r))}),e.size===t.size&&[...e].every(e=>t.has(e))?e:t})}e();let t=new ResizeObserver(e);return j.current.forEach(e=>t.observe(e)),()=>t.disconnect()},[e.length,p]);let M=[...e].sort((e,t)=>e.timestamp-t.timestamp);(0,A.useEffect)(()=>{r&&console.log(`[selection] entered`,{conversationId:f??`unknown`,order:M.map(e=>({ts:e.timestamp,role:e.role,id:e.messageId}))})},[r]);let N=M.reduce((e,t,n)=>t.role===`maxy`&&!t.hidden?n:e,-1);return(0,V.jsxs)(`div`,{className:`chat-messages-wrap`,children:[r&&(0,V.jsx)(`div`,{className:`selection-overlay-band`}),(0,V.jsxs)(`div`,{className:`chat-messages`,ref:C,children:[n&&e.length===0&&(0,V.jsx)(`div`,{className:`session-error`,children:(0,V.jsx)(`p`,{children:n})}),M.map((e,n)=>{if(e.hidden)return null;let s=t&&n===M.length-1,c=`${e.timestamp}_${e.role}`,l=i.has(c);return(0,V.jsxs)(`div`,{ref:n===N?w:void 0,className:`message ${e.role}${l?` selected`:``}`,children:[r&&!s&&(0,V.jsx)(`div`,{className:`message-select-check`,children:(0,V.jsx)(b,{checked:l,onChange:()=>a(c)})}),(0,V.jsxs)(`div`,{className:`bubble`,children:[d&&e.role===`visitor`&&e.senderName&&(0,V.jsx)(`span`,{className:`bubble-sender`,children:e.senderName}),e.role===`visitor`&&e.content?(()=>{let t=p.has(n),r=g.has(n);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{ref:e=>{e?j.current.set(n,e):j.current.delete(n)},className:t?`bubble-content`:`bubble-content clamped${r?` overflowing`:``}`,children:e.content}),r&&(0,V.jsx)(`div`,{className:`bubble-expand`,children:(0,V.jsx)(y,{variant:`icon`,className:t?`expanded`:``,onClick:()=>m(e=>{let t=new Set(e);return t.has(n)?t.delete(n):t.add(n),t}),"aria-label":t?`Collapse message`:`Expand message`,children:(0,V.jsx)(x,{size:14})})})]})})():e.content?(0,V.jsx)(ye,{content:e.content,timestamp:Ee(e.timestamp)}):(0,V.jsxs)(`span`,{className:`typing-indicator`,children:[(0,V.jsx)(`span`,{className:`typing-dot`}),(0,V.jsx)(`span`,{className:`typing-dot`}),(0,V.jsx)(`span`,{className:`typing-dot`})]}),e.attachments&&e.attachments.length>0&&(0,V.jsx)(`div`,{className:`message-attachments`,children:e.attachments.map((e,t)=>(0,V.jsxs)(`span`,{className:`message-attachment-chip no-action`,children:[e.mimeType===`application/pdf`?(0,V.jsx)(h,{size:12}):e.mimeType.startsWith(`text/`)?(0,V.jsx)(S,{size:12}):null,(0,V.jsx)(`span`,{children:e.filename})]},t))}),e.role===`visitor`&&(0,V.jsx)(`span`,{className:`message-timestamp`,children:Ee(e.timestamp)})]}),e.role===`maxy`&&e.components&&e.components.length>0&&(0,V.jsx)(`div`,{className:`public-components`,children:e.components.map((e,t)=>(0,V.jsx)(`div`,{className:`public-component-enter`,children:(0,V.jsx)(Te,{name:e.name,data:e.data,onSubmit:e=>o(n,t,e),submitted:e.submitted})},t))})]},n)}),!t&&s.length>0&&(0,V.jsx)(`div`,{className:`chat-suggestions`,children:s.map(e=>(0,V.jsx)(y,{variant:`suggestion`,onClick:()=>c(e),children:e},e))}),(0,V.jsx)(`div`,{ref:v})]}),!l&&(0,V.jsx)(`button`,{className:`scroll-to-bottom`,onClick:()=>v.current?.scrollIntoView({behavior:`smooth`}),"aria-label":`Scroll to bottom`,children:(0,V.jsx)(x,{size:18})})]})}function Oe({selectedItems:e,messages:t,isStreaming:n,copySelected:r,selectAll:i,exitSelection:a,showCopyToast:o}){let[s,c]=(0,A.useState)(!1),l=(0,A.useRef)(null),u=(0,A.useRef)(!1);function p(e){let n=e.lastIndexOf(`_`),r=e.slice(0,n),i=e.slice(n+1),a=parseInt(r,10);return t.find(e=>e.timestamp===a&&e.role===i)?.content??``}function m(e,t){return parseInt(e.slice(0,e.lastIndexOf(`_`)),10)-parseInt(t.slice(0,t.lastIndexOf(`_`)),10)}function h(){let e=[...t].sort((e,t)=>e.timestamp-t.timestamp),n=[];for(let t of e){if(t.hidden||!t.content)continue;let e=t.role===`visitor`?`Visitor`:`Maxy`;n.push(`${e}:\n${t.content}`)}return n.join(`
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as e,h as t,p as n}from"./src-B6XdH6xq.js";import{B as r,C as i,E as a,L as o,V as s,W as c,_ as l,a as u,b as d,c as f,d as p,v as m}from"./chunk-ICPOFSXX-
|
|
1
|
+
import{g as e,h as t,p as n}from"./src-B6XdH6xq.js";import{B as r,C as i,E as a,L as o,V as s,W as c,_ as l,a as u,b as d,c as f,d as p,v as m}from"./chunk-ICPOFSXX-BOjV-nTe.js";import{t as h}from"./linear-0O14Y6uf.js";import"./defaultLocale-_WRwicXn.js";var g=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,3],r=[1,4],i=[1,5],a=[1,6],o=[1,7],s=[1,4,5,10,12,13,14,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],c=[1,4,5,10,12,13,14,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],l=[55,56,57],u=[2,36],d=[1,37],f=[1,36],p=[1,38],m=[1,35],h=[1,43],g=[1,41],_=[1,14],v=[1,23],y=[1,18],b=[1,19],x=[1,20],S=[1,21],C=[1,22],w=[1,24],T=[1,25],E=[1,26],D=[1,27],O=[1,28],k=[1,29],A=[1,32],j=[1,33],M=[1,34],N=[1,39],P=[1,40],F=[1,42],I=[1,44],L=[1,62],R=[1,61],z=[4,5,8,10,12,13,14,18,44,47,49,55,56,57,63,64,65,66,67],B=[1,65],ee=[1,66],te=[1,67],ne=[1,68],re=[1,69],ie=[1,70],ae=[1,71],oe=[1,72],se=[1,73],ce=[1,74],le=[1,75],ue=[1,76],V=[4,5,6,7,8,9,10,11,12,13,14,15,18],H=[1,90],U=[1,91],W=[1,92],G=[1,99],K=[1,93],q=[1,96],J=[1,94],Y=[1,95],X=[1,97],Z=[1,98],de=[1,102],fe=[10,55,56,57],Q=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],pe={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:`error`,4:`ALPHA`,5:`NUM`,6:`NODE_STRING`,7:`DOWN`,8:`MINUS`,9:`DEFAULT`,10:`COMMA`,11:`COLON`,12:`AMP`,13:`BRKT`,14:`MULT`,15:`UNICODE_TEXT`,17:`UNIT`,18:`SPACE`,19:`STYLE`,20:`PCT`,25:`CLASSDEF`,28:`QUADRANT`,35:`title`,36:`title_value`,37:`acc_title`,38:`acc_title_value`,39:`acc_descr`,40:`acc_descr_value`,41:`acc_descr_multiline_value`,42:`section`,44:`point_start`,45:`point_x`,46:`point_y`,47:`class_name`,48:`X-AXIS`,49:`AXIS-TEXT-DELIMITER`,50:`Y-AXIS`,51:`QUADRANT_1`,52:`QUADRANT_2`,53:`QUADRANT_3`,54:`QUADRANT_4`,55:`NEWLINE`,56:`SEMI`,57:`EOF`,60:`STR`,61:`MD_STR`,63:`PUNCTUATION`,64:`PLUS`,65:`EQUALS`,66:`DOT`,67:`UNDERSCORE`},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 23:this.$=a[s];break;case 24:this.$=a[s-1]+``+a[s];break;case 26:this.$=a[s-1]+a[s];break;case 27:this.$=[a[s].trim()];break;case 28:a[s-2].push(a[s].trim()),this.$=a[s-2];break;case 29:this.$=a[s-4],r.addClass(a[s-2],a[s]);break;case 37:this.$=[];break;case 42:this.$=a[s].trim(),r.setDiagramTitle(this.$);break;case 43:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 44:case 45:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 46:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 47:r.addPoint(a[s-3],``,a[s-1],a[s],[]);break;case 48:r.addPoint(a[s-4],a[s-3],a[s-1],a[s],[]);break;case 49:r.addPoint(a[s-4],``,a[s-2],a[s-1],a[s]);break;case 50:r.addPoint(a[s-5],a[s-4],a[s-2],a[s-1],a[s]);break;case 51:r.setXAxisLeftText(a[s-2]),r.setXAxisRightText(a[s]);break;case 52:a[s-1].text+=` ⟶ `,r.setXAxisLeftText(a[s-1]);break;case 53:r.setXAxisLeftText(a[s]);break;case 54:r.setYAxisBottomText(a[s-2]),r.setYAxisTopText(a[s]);break;case 55:a[s-1].text+=` ⟶ `,r.setYAxisBottomText(a[s-1]);break;case 56:r.setYAxisBottomText(a[s]);break;case 57:r.setQuadrant1Text(a[s]);break;case 58:r.setQuadrant2Text(a[s]);break;case 59:r.setQuadrant3Text(a[s]);break;case 60:r.setQuadrant4Text(a[s]);break;case 64:this.$={text:a[s],type:`text`};break;case 65:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 66:this.$={text:a[s],type:`text`};break;case 67:this.$={text:a[s],type:`markdown`};break;case 68:this.$=a[s];break;case 69:this.$=a[s-1]+``+a[s];break}},`anonymous`),table:[{18:n,26:1,27:2,28:r,55:i,56:a,57:o},{1:[3]},{18:n,26:8,27:2,28:r,55:i,56:a,57:o},{18:n,26:9,27:2,28:r,55:i,56:a,57:o},e(s,[2,33],{29:10}),e(c,[2,61]),e(c,[2,62]),e(c,[2,63]),{1:[2,30]},{1:[2,31]},e(l,u,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:d,5:f,10:p,12:m,13:h,14:g,18:_,25:v,35:y,37:b,39:x,41:S,42:C,48:w,50:T,51:E,52:D,53:O,54:k,60:A,61:j,63:M,64:N,65:P,66:F,67:I}),e(s,[2,34]),{27:45,55:i,56:a,57:o},e(l,[2,37]),e(l,u,{24:13,32:15,33:16,34:17,43:30,58:31,31:46,4:d,5:f,10:p,12:m,13:h,14:g,18:_,25:v,35:y,37:b,39:x,41:S,42:C,48:w,50:T,51:E,52:D,53:O,54:k,60:A,61:j,63:M,64:N,65:P,66:F,67:I}),e(l,[2,39]),e(l,[2,40]),e(l,[2,41]),{36:[1,47]},{38:[1,48]},{40:[1,49]},e(l,[2,45]),e(l,[2,46]),{18:[1,50]},{4:d,5:f,10:p,12:m,13:h,14:g,43:51,58:31,60:A,61:j,63:M,64:N,65:P,66:F,67:I},{4:d,5:f,10:p,12:m,13:h,14:g,43:52,58:31,60:A,61:j,63:M,64:N,65:P,66:F,67:I},{4:d,5:f,10:p,12:m,13:h,14:g,43:53,58:31,60:A,61:j,63:M,64:N,65:P,66:F,67:I},{4:d,5:f,10:p,12:m,13:h,14:g,43:54,58:31,60:A,61:j,63:M,64:N,65:P,66:F,67:I},{4:d,5:f,10:p,12:m,13:h,14:g,43:55,58:31,60:A,61:j,63:M,64:N,65:P,66:F,67:I},{4:d,5:f,10:p,12:m,13:h,14:g,43:56,58:31,60:A,61:j,63:M,64:N,65:P,66:F,67:I},{4:d,5:f,8:L,10:p,12:m,13:h,14:g,18:R,44:[1,57],47:[1,58],58:60,59:59,63:M,64:N,65:P,66:F,67:I},e(z,[2,64]),e(z,[2,66]),e(z,[2,67]),e(z,[2,70]),e(z,[2,71]),e(z,[2,72]),e(z,[2,73]),e(z,[2,74]),e(z,[2,75]),e(z,[2,76]),e(z,[2,77]),e(z,[2,78]),e(z,[2,79]),e(z,[2,80]),e(s,[2,35]),e(l,[2,38]),e(l,[2,42]),e(l,[2,43]),e(l,[2,44]),{3:64,4:B,5:ee,6:te,7:ne,8:re,9:ie,10:ae,11:oe,12:se,13:ce,14:le,15:ue,21:63},e(l,[2,53],{59:59,58:60,4:d,5:f,8:L,10:p,12:m,13:h,14:g,18:R,49:[1,77],63:M,64:N,65:P,66:F,67:I}),e(l,[2,56],{59:59,58:60,4:d,5:f,8:L,10:p,12:m,13:h,14:g,18:R,49:[1,78],63:M,64:N,65:P,66:F,67:I}),e(l,[2,57],{59:59,58:60,4:d,5:f,8:L,10:p,12:m,13:h,14:g,18:R,63:M,64:N,65:P,66:F,67:I}),e(l,[2,58],{59:59,58:60,4:d,5:f,8:L,10:p,12:m,13:h,14:g,18:R,63:M,64:N,65:P,66:F,67:I}),e(l,[2,59],{59:59,58:60,4:d,5:f,8:L,10:p,12:m,13:h,14:g,18:R,63:M,64:N,65:P,66:F,67:I}),e(l,[2,60],{59:59,58:60,4:d,5:f,8:L,10:p,12:m,13:h,14:g,18:R,63:M,64:N,65:P,66:F,67:I}),{45:[1,79]},{44:[1,80]},e(z,[2,65]),e(z,[2,81]),e(z,[2,82]),e(z,[2,83]),{3:82,4:B,5:ee,6:te,7:ne,8:re,9:ie,10:ae,11:oe,12:se,13:ce,14:le,15:ue,18:[1,81]},e(V,[2,23]),e(V,[2,1]),e(V,[2,2]),e(V,[2,3]),e(V,[2,4]),e(V,[2,5]),e(V,[2,6]),e(V,[2,7]),e(V,[2,8]),e(V,[2,9]),e(V,[2,10]),e(V,[2,11]),e(V,[2,12]),e(l,[2,52],{58:31,43:83,4:d,5:f,10:p,12:m,13:h,14:g,60:A,61:j,63:M,64:N,65:P,66:F,67:I}),e(l,[2,55],{58:31,43:84,4:d,5:f,10:p,12:m,13:h,14:g,60:A,61:j,63:M,64:N,65:P,66:F,67:I}),{46:[1,85]},{45:[1,86]},{4:H,5:U,6:W,8:G,11:K,13:q,16:89,17:J,18:Y,19:X,20:Z,22:88,23:87},e(V,[2,24]),e(l,[2,51],{59:59,58:60,4:d,5:f,8:L,10:p,12:m,13:h,14:g,18:R,63:M,64:N,65:P,66:F,67:I}),e(l,[2,54],{59:59,58:60,4:d,5:f,8:L,10:p,12:m,13:h,14:g,18:R,63:M,64:N,65:P,66:F,67:I}),e(l,[2,47],{22:88,16:89,23:100,4:H,5:U,6:W,8:G,11:K,13:q,17:J,18:Y,19:X,20:Z}),{46:[1,101]},e(l,[2,29],{10:de}),e(fe,[2,27],{16:103,4:H,5:U,6:W,8:G,11:K,13:q,17:J,18:Y,19:X,20:Z}),e(Q,[2,25]),e(Q,[2,13]),e(Q,[2,14]),e(Q,[2,15]),e(Q,[2,16]),e(Q,[2,17]),e(Q,[2,18]),e(Q,[2,19]),e(Q,[2,20]),e(Q,[2,21]),e(Q,[2,22]),e(l,[2,49],{10:de}),e(l,[2,48],{22:88,16:89,23:104,4:H,5:U,6:W,8:G,11:K,13:q,17:J,18:Y,19:X,20:Z}),{4:H,5:U,6:W,8:G,11:K,13:q,16:89,17:J,18:Y,19:X,20:Z,22:105},e(Q,[2,26]),e(l,[2,50],{10:de}),e(fe,[2,28],{16:103,4:H,5:U,6:W,8:G,11:K,13:q,17:J,18:Y,19:X,20:Z})],defaultActions:{8:[2,30],9:[2,31]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
2
2
|
`+h.showPosition()+`
|
|
3
3
|
Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};pe.lexer=(function(){return{EOF:1,parseError:t(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:t(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:t(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:t(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:t(function(){return this._more=!0,this},`more`),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:t(function(e){this.unput(this.match.slice(e))},`less`),pastInput:t(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:t(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:t(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
|