@lobu/runtime-server 24.7.0 → 24.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalogs/connectors.json +199 -316
- package/dist/component.json +1 -1
- package/dist/connectors/imessage.ts +953 -0
- package/dist/connectors/linkedin.ts +20 -377
- package/dist/dependencies.bun.lock +124 -92
- package/dist/embeddings-server.mjs +14 -2
- package/dist/owletto/dist/assets/_-B0tmXZ86.js +2 -0
- package/dist/owletto/dist/assets/_-DwXULq4r.js +3 -0
- package/dist/owletto/dist/assets/_agentId-B1dNkhnr.js +2 -0
- package/dist/owletto/dist/assets/_agentId-sYjvnBaB.js +2 -0
- package/dist/owletto/dist/assets/_automationId-Bnw_CnT_.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey._connectionId-D7Z8DQ-B.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey.index-DM5MTO8c.js +2 -0
- package/dist/owletto/dist/assets/_conversationId-OJrZjd0o.js +2 -0
- package/dist/owletto/dist/assets/_eventId-CfB0_2zK.js +2 -0
- package/dist/owletto/dist/assets/_owner-BDvTUY0a.js +3 -0
- package/dist/owletto/dist/assets/_shape-BZidoJMB.js +2 -0
- package/dist/owletto/dist/assets/_slug-R989vOiM.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-BDUSrpe5.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-BnFqh5-t.js +2 -0
- package/dist/owletto/dist/assets/{accept-invitation-CX7Egv-p.js → accept-invitation-BC-ZIsrf.js} +2 -2
- package/dist/owletto/dist/assets/activity-route-view-CN2dOiCD.js +2 -0
- package/dist/owletto/dist/assets/agent-connect-pages-CdDjrHjn.js +4 -0
- package/dist/owletto/dist/assets/agent-editor-form-CDAHRNWl.js +2 -0
- package/dist/owletto/dist/assets/{agent-loading-shells-DHvKiEUB.js → agent-loading-shells-BupiSjR-.js} +2 -2
- package/dist/owletto/dist/assets/agent-permissions-matrix-ju7L2M0l.js +2 -0
- package/dist/owletto/dist/assets/{agent-skill-context-DF5q0Dfr.js → agent-skill-context-B0ZYVE3n.js} +2 -2
- package/dist/owletto/dist/assets/{agent-subpage-shell-Pi5cECga.js → agent-subpage-shell-ByU0xhXn.js} +2 -2
- package/dist/owletto/dist/assets/{agent-thread-B1ZepGZc.js → agent-thread-DiVKn1WX.js} +4 -4
- package/dist/owletto/dist/assets/agent-thread-storage-Bx2-WBHQ.js +2 -0
- package/dist/owletto/dist/assets/app._appId-BQWElSoP.js +2 -0
- package/dist/owletto/dist/assets/assist-composer-igTXq3DL.js +2 -0
- package/dist/owletto/dist/assets/automation-detail-content-BJwRU6qT.js +2 -0
- package/dist/owletto/dist/assets/{callback-Ckrxv0eo.js → callback-Dmaio9CX.js} +2 -2
- package/dist/owletto/dist/assets/{card-DT9mSjSp.js → card-rE4Ctuy6.js} +2 -2
- package/dist/owletto/dist/assets/{claim-Bzby28tT.js → claim-BN17CPYh.js} +2 -2
- package/dist/owletto/dist/assets/{client-activity-scopes-DoIErdUy.js → client-activity-scopes-B7xVaUA-.js} +2 -2
- package/dist/owletto/dist/assets/{client-rows-BbVQy5Ti.js → client-rows-B3LULJxW.js} +2 -2
- package/dist/owletto/dist/assets/clients-CydgUHrc.js +2 -0
- package/dist/owletto/dist/assets/code-editor-UppEMWpt.js +26 -0
- package/dist/owletto/dist/assets/connect-OdHpIVV9.js +2 -0
- package/dist/owletto/dist/assets/connect-menu-B9u86bb2.js +2 -0
- package/dist/owletto/dist/assets/connect._clientId-EI1tcdSE.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId-CaF-ZWlZ.js +2 -0
- package/dist/owletto/dist/assets/{connection-BOaMa324.js → connection-D8ZAMHBT.js} +2 -2
- package/dist/owletto/dist/assets/connection-feed-detail-CJYqryAV.js +2 -0
- package/dist/owletto/dist/assets/connector-boxes-BWPXijAk.js +2 -0
- package/dist/owletto/dist/assets/connector-page-shell-C23dWdKz.js +2 -0
- package/dist/owletto/dist/assets/connector-provenance-CW4CXtCz.js +2 -0
- package/dist/owletto/dist/assets/{connectors-D5F5rHxX.js → connectors-Bp08_KPq.js} +2 -2
- package/dist/owletto/dist/assets/consent-_PpYI1cT.js +2 -0
- package/dist/owletto/dist/assets/copy-button-1ALlvZU1.js +2 -0
- package/dist/owletto/dist/assets/{core.esm-BIE97rfo.js → core.esm-6koO33th.js} +2 -2
- package/dist/owletto/dist/assets/create-DULVO0HS.js +2 -0
- package/dist/owletto/dist/assets/create-Drx9tcnG.js +2 -0
- package/dist/owletto/dist/assets/{create-automation-form-B12yTrmj.js → create-automation-form-BhujNbRr.js} +3 -3
- package/dist/owletto/dist/assets/{create-BPxsKwk7.js → create-kUevP9Xx.js} +2 -2
- package/dist/owletto/dist/assets/create._connectorKey-N6fhcIPy.js +2 -0
- package/dist/owletto/dist/assets/{custom-guardrail-edits-B9plaLBN.js → custom-guardrail-edits-B_aCgvoZ.js} +2 -2
- package/dist/owletto/dist/assets/definition-comparison-3zKUSTt8.js +2 -0
- package/dist/owletto/dist/assets/{detail-page-skeleton-I5_7FkKx.js → detail-page-skeleton-BmxqqIsH.js} +2 -2
- package/dist/owletto/dist/assets/{device-CadaiNF4.js → device-D2eUt_nr.js} +2 -2
- package/dist/owletto/dist/assets/device-pin-tombstone-BFPbTM_o.js +2 -0
- package/dist/owletto/dist/assets/device._deviceId-Dqtmb1Xp.js +2 -0
- package/dist/owletto/dist/assets/dynamic-schema-form-D3KnzCsW.js +2 -0
- package/dist/owletto/dist/assets/entity-options-IUdQ-64R.js +2 -0
- package/dist/owletto/dist/assets/entity-page-B3Im65EI.js +2 -0
- package/dist/owletto/dist/assets/entity-pages-DJNSQrfB.js +2 -0
- package/dist/owletto/dist/assets/entity-type-page-CouHZbc9.js +2 -0
- package/dist/owletto/dist/assets/event-detail-CvaRN1qB.js +2 -0
- package/dist/owletto/dist/assets/event-kind-options-fHAIXu24.js +2 -0
- package/dist/owletto/dist/assets/events-feed-DwOkLk6A.js +2 -0
- package/dist/owletto/dist/assets/filter-editors-DQ5V4Cvh.js +2 -0
- package/dist/owletto/dist/assets/{full-page-spinner-CCU4PkRv.js → full-page-spinner-B7A6Ycyi.js} +2 -2
- package/dist/owletto/dist/assets/home-stream-Bg97PUBJ.js +2 -0
- package/dist/owletto/dist/assets/home-toolbar-CpCcHA6z.js +2 -0
- package/dist/owletto/dist/assets/index-9PGnv4-5.js +2 -0
- package/dist/owletto/dist/assets/{index-pmr1WUoG.js → index-B-dZruj6.js} +2 -2
- package/dist/owletto/dist/assets/index-BztXeLBN.js +2 -0
- package/dist/owletto/dist/assets/{index-B-Ab8srM.js → index-C2TCKJDP.js} +1599 -1597
- package/dist/owletto/dist/assets/index-C7QM3aqU.js +2 -0
- package/dist/owletto/dist/assets/index-CWn46a4y.js +2 -0
- package/dist/owletto/dist/assets/index-CxJONizf.js +2 -0
- package/dist/owletto/dist/assets/index-DJhb3li3.js +2 -0
- package/dist/owletto/dist/assets/{index-B72KYdN1.js → index-DXfYVs5m.js} +2 -2
- package/dist/owletto/dist/assets/{index-BYFDMIQC.js → index-DY-YGnCe.js} +2 -2
- package/dist/owletto/dist/assets/index-j3v7ITPb.js +2 -0
- package/dist/owletto/dist/assets/index-oiy6ygaI.js +2 -0
- package/dist/owletto/dist/assets/index-pEgtAY1t.js +2 -0
- package/dist/owletto/dist/assets/index-xAvK3IyQ.css +1 -0
- package/dist/owletto/dist/assets/json-diff-CJK-gzCt.js +4 -0
- package/dist/owletto/dist/assets/{list-skeleton-BAqT0vxo.js → list-skeleton-bQAZ0hQp.js} +2 -2
- package/dist/owletto/dist/assets/{login-D5bIjMtf.js → login-DLqL54Rk.js} +2 -2
- package/dist/owletto/dist/assets/{logout-JYZvxz8v.js → logout-H0F3IfiO.js} +2 -2
- package/dist/owletto/dist/assets/member-scope-gate-Doic_6qX.js +2 -0
- package/dist/owletto/dist/assets/memory-browse-page-CUea2Llz.js +74 -0
- package/dist/owletto/dist/assets/model-selector-BrfaDwIg.js +2 -0
- package/dist/owletto/dist/assets/new-5GkxlOuQ.js +2 -0
- package/dist/owletto/dist/assets/{new-B-Jd-vBl.js → new-BiA4DGoN.js} +2 -2
- package/dist/owletto/dist/assets/new-M-MX_T5C.js +2 -0
- package/dist/owletto/dist/assets/organization-CLrcmgNK.js +2 -0
- package/dist/owletto/dist/assets/peek-pane-content-B29OcHwm.js +2 -0
- package/dist/owletto/dist/assets/{pending-seed-CoFPQ835.js → pending-seed-DYYOoCvj.js} +2 -2
- package/dist/owletto/dist/assets/proposal-review-shell-BVwOMoq9.js +2 -0
- package/dist/owletto/dist/assets/public-shell-ready-BbjPgh3k.js +2 -0
- package/dist/owletto/dist/assets/record-activity-BCpNKaUo.js +2 -0
- package/dist/owletto/dist/assets/{record-session-Bpx4_LGk.js → record-session-KuEDuF3S.js} +2 -2
- package/dist/owletto/dist/assets/{renderer-CgaQKMoG.js → renderer-ucwCQmBk.js} +2 -2
- package/dist/owletto/dist/assets/{reset-password-C-4Jnuqk.js → reset-password-BkiAmXZW.js} +2 -2
- package/dist/owletto/dist/assets/run-initiator-8vdkq-3o.js +2 -0
- package/dist/owletto/dist/assets/{runs-BMzp7j7j.js → runs-B_iywKWb.js} +2 -2
- package/dist/owletto/dist/assets/runs-list-CJJFRhTl.js +2 -0
- package/dist/owletto/dist/assets/schema-type-editor-panel-C4e8pq1A.js +2 -0
- package/dist/owletto/dist/assets/{schema-value-BUgC0Ro8.js → schema-value-CefbtPIY.js} +3 -3
- package/dist/owletto/dist/assets/scoped-feed-bar-CapleZvS.js +2 -0
- package/dist/owletto/dist/assets/{settings-DYYvrrZ4.js → settings-DvzkRYQy.js} +2 -2
- package/dist/owletto/dist/assets/source-record-panels-LJIWGtHb.js +2 -0
- package/dist/owletto/dist/assets/{status-variants-DT61YfsU.js → status-variants-BxHtpMOj.js} +2 -2
- package/dist/owletto/dist/assets/subDays-DwIOMzYC.js +2 -0
- package/dist/owletto/dist/assets/{table-B6yimlsZ.js → table-1O-ik4_O.js} +2 -2
- package/dist/owletto/dist/assets/{use-automations-II_YJWtN.js → use-automations-lV8PuE8L.js} +2 -2
- package/dist/owletto/dist/assets/use-login-redirect-CfCbEeJR.js +2 -0
- package/dist/owletto/dist/assets/use-mention-search-CA-evCDf.js +91 -0
- package/dist/owletto/dist/assets/{view-param-filters-DYlqBocg.js → view-param-filters-Bp84PUMd.js} +2 -2
- package/dist/owletto/dist/assets/{views-access-required-BVtMfgLh.js → views-access-required-BerT4Z1d.js} +2 -2
- package/dist/owletto/dist/index.html +2 -2
- package/dist/server-main.bundle.mjs +274 -136
- package/npm-shrinkwrap.json +540 -447
- package/package.json +4 -2
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/core/dist/connector-query-errors.d.ts +6 -0
- package/vendor/core/dist/connector-query-errors.js +4 -0
- package/vendor/core/dist/contracts/tools/manage-entity.d.ts +2 -0
- package/vendor/core/dist/contracts/tools/manage-entity.js +7 -0
- package/vendor/core/dist/contracts/tools/manage-feeds.d.ts +2 -0
- package/vendor/core/dist/contracts/tools/manage-feeds.js +3 -0
- package/vendor/core/dist/contracts/tools/view-host.js +2 -0
- package/vendor/core/dist/error-report.js +1 -0
- package/vendor/core/package.json +1 -1
- package/vendor/views/package.json +1 -1
- package/dist/connectors/linkedin-takeout.ts +0 -577
- package/dist/connectors/takeout-utils.ts +0 -240
- package/dist/owletto/dist/assets/_-CZgmjLR9.js +0 -2
- package/dist/owletto/dist/assets/_-Cm5OgtYD.js +0 -3
- package/dist/owletto/dist/assets/_-DtqBFgK5.js +0 -2
- package/dist/owletto/dist/assets/_agentId-Cci6NFc1.js +0 -2
- package/dist/owletto/dist/assets/_agentId-GhWTlPO2.js +0 -2
- package/dist/owletto/dist/assets/_automationId-KUlxSTK2.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey._connectionId-Zpy7Hvml.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey.index-CYDRp9UX.js +0 -2
- package/dist/owletto/dist/assets/_conversationId-NNqDdije.js +0 -2
- package/dist/owletto/dist/assets/_eventId-0BSX6VHj.js +0 -2
- package/dist/owletto/dist/assets/_owner-C-CD22NB.js +0 -3
- package/dist/owletto/dist/assets/_shape-CvXp4omb.js +0 -2
- package/dist/owletto/dist/assets/_slug-DgK7zpKA.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-cH54P0zY.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-m0B5j7L9.js +0 -2
- package/dist/owletto/dist/assets/activity-link-rXNpmppV.js +0 -2
- package/dist/owletto/dist/assets/activity-route-view-B0m7_g9q.js +0 -2
- package/dist/owletto/dist/assets/agent-client-setup-list-BmD3-_Ox.js +0 -4
- package/dist/owletto/dist/assets/agent-connect-pages-BtOTCsTU.js +0 -2
- package/dist/owletto/dist/assets/agent-editor-form-CirqCpcM.js +0 -2
- package/dist/owletto/dist/assets/agent-list-row-SyACVYX7.js +0 -2
- package/dist/owletto/dist/assets/agent-permissions-matrix-Dsc26dyW.js +0 -2
- package/dist/owletto/dist/assets/agent-thread-storage-U6htL3ad.js +0 -2
- package/dist/owletto/dist/assets/agents-D1FHZ0jR.js +0 -2
- package/dist/owletto/dist/assets/app._appId-01I0CJal.js +0 -2
- package/dist/owletto/dist/assets/assist-composer-BD9msDk3.js +0 -2
- package/dist/owletto/dist/assets/automation-detail-content-BFv1TglZ.js +0 -2
- package/dist/owletto/dist/assets/automation-row-CmTpAD4r.js +0 -2
- package/dist/owletto/dist/assets/automation-source-list-D8ZSavQU.js +0 -2
- package/dist/owletto/dist/assets/automations-D1FHZ0jR.js +0 -2
- package/dist/owletto/dist/assets/change-summary-CGrKEJ04.js +0 -2
- package/dist/owletto/dist/assets/clients-6aJvabvS.js +0 -2
- package/dist/owletto/dist/assets/connect-BmDziBzI.js +0 -2
- package/dist/owletto/dist/assets/connect-menu-Bs8mxsga.js +0 -2
- package/dist/owletto/dist/assets/connect._clientId-t5aKu3aa.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId-DswMAw8l.js +0 -2
- package/dist/owletto/dist/assets/connection-feed-detail-BLCjhP-H.js +0 -2
- package/dist/owletto/dist/assets/connector-boxes-BAP_f77M.js +0 -2
- package/dist/owletto/dist/assets/connector-page-shell-ClOmVPJr.js +0 -2
- package/dist/owletto/dist/assets/connector-provenance-wmYu5jwO.js +0 -2
- package/dist/owletto/dist/assets/consent-RqHNkmm8.js +0 -2
- package/dist/owletto/dist/assets/copy-button-D6zpsZLi.js +0 -2
- package/dist/owletto/dist/assets/create-GT8_yF0R.js +0 -2
- package/dist/owletto/dist/assets/create-Yx2qBMBy.js +0 -2
- package/dist/owletto/dist/assets/create._connectorKey-CzXqSkuI.js +0 -2
- package/dist/owletto/dist/assets/definition-comparison-C3k6Wa9B.js +0 -2
- package/dist/owletto/dist/assets/device-pin-tombstone-U7Bx05P6.js +0 -2
- package/dist/owletto/dist/assets/device._deviceId-DTZqj1HS.js +0 -2
- package/dist/owletto/dist/assets/dynamic-schema-form-DyT_9iVE.js +0 -2
- package/dist/owletto/dist/assets/entity-options-CGTjLlcS.js +0 -2
- package/dist/owletto/dist/assets/entity-page-DHHMmA8V.js +0 -2
- package/dist/owletto/dist/assets/entity-pages-eYbG2FDT.js +0 -2
- package/dist/owletto/dist/assets/entity-type-page-CjFqxSdL.js +0 -2
- package/dist/owletto/dist/assets/event-card-BtTUuf2q.js +0 -2
- package/dist/owletto/dist/assets/event-detail-8xHiplt_.js +0 -2
- package/dist/owletto/dist/assets/events-feed-zFnTSE27.js +0 -2
- package/dist/owletto/dist/assets/filter-editors-Dd5R2Etd.js +0 -2
- package/dist/owletto/dist/assets/home-stream-IVsNEkwp.js +0 -2
- package/dist/owletto/dist/assets/index-2oaMOFKe.js +0 -2
- package/dist/owletto/dist/assets/index-B4RZgvvI.js +0 -2
- package/dist/owletto/dist/assets/index-BBZM53p8.js +0 -2
- package/dist/owletto/dist/assets/index-BOb0a5f9.js +0 -2
- package/dist/owletto/dist/assets/index-BwnFQcMe.js +0 -2
- package/dist/owletto/dist/assets/index-CvYsWYlF.js +0 -2
- package/dist/owletto/dist/assets/index-DIXIvtnM.js +0 -2
- package/dist/owletto/dist/assets/index-DLwokXHW.js +0 -2
- package/dist/owletto/dist/assets/index-_nlPHus1.js +0 -2
- package/dist/owletto/dist/assets/index-cwOgj4-i.js +0 -2
- package/dist/owletto/dist/assets/index-pp4qmhkA.js +0 -2
- package/dist/owletto/dist/assets/index-tTbno-PX.css +0 -1
- package/dist/owletto/dist/assets/json-diff-B-1Swv_y.js +0 -28
- package/dist/owletto/dist/assets/member-scope-gate-Lj9m4RL2.js +0 -2
- package/dist/owletto/dist/assets/memory-browse-page-rAKfVdQ_.js +0 -74
- package/dist/owletto/dist/assets/model-selector-onvGA9Ww.js +0 -2
- package/dist/owletto/dist/assets/new-BmehH1uR.js +0 -2
- package/dist/owletto/dist/assets/new-KDi15LWZ.js +0 -2
- package/dist/owletto/dist/assets/organization-B9bh20Xo.js +0 -2
- package/dist/owletto/dist/assets/peek-pane-content-Bqus80Mq.js +0 -2
- package/dist/owletto/dist/assets/proposal-review-shell-CnACXCUg.js +0 -2
- package/dist/owletto/dist/assets/public-shell-ready-Dlh-eWz0.js +0 -2
- package/dist/owletto/dist/assets/record-activity-6CfR95Ul.js +0 -2
- package/dist/owletto/dist/assets/run-initiator-BvruBM5H.js +0 -2
- package/dist/owletto/dist/assets/runs-list-DVhrTr3v.js +0 -2
- package/dist/owletto/dist/assets/schema-type-editor-panel-Bdeumkux.js +0 -2
- package/dist/owletto/dist/assets/source-record-panels-CBV9tsR3.js +0 -2
- package/dist/owletto/dist/assets/use-login-redirect-BqtEilid.js +0 -2
- package/dist/owletto/dist/assets/use-mention-search-Bxlpd6Dp.js +0 -96
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{aG as fn,j as n,r as k,c as V,H as ne,cQ as hn,cC as Ct,cP as St,L as Se,a7 as vn,dm as yn,S as Nt,dn as gn,cJ as xn,dp as _t,dq as E,be as dt,dr as bn,ds as jn,av as kn,dt as Cn,au as Sn,du as Nn,dv as te,ch as _n,dw as It,dx as In,ax as Tn,dy as En,s as An,cB as Fn,aC as je,dz as Rn,dA as Pn,n as Tt,d4 as Et,dB as Mn,dC as ut,dD as Ln,dE as On,dh as At,dF as wn,dG as $n,cn as Dn,b9 as Bn,bg as Kn,bh as Gn,dH as Ft,bi as Vn,bj as Qn,bk as Un,da as Wn,U as Hn,i as De,X as zn,dI as qn,dJ as Jn,bJ as Yn,dK as Zn,dL as Xn,dM as es,dN as Rt,dO as mt,z as ts,dP as ns,dQ as Pe,dR as pt,d5 as ss,dS as os,x as as,ct as is,dT as rs,dU as cs,t as ls,dV as ds,dW as us,dX as ms,bT as ps,dY as fs,dZ as hs,cG as vs,b0 as ft,d_ as ht,d$ as Pt,cj as Me,cp as Mt,B as Lt,e0 as ys,e1 as Le,dd as gs}from"./index-C2TCKJDP.js";import{T as vt}from"./home-toolbar-CpCcHA6z.js";import{S as B,F as xs,a as bs,o as X,d as js,r as ks,f as Cs,b as Ss}from"./filter-editors-DQ5V4Cvh.js";import{u as Ns}from"./runs-B_iywKWb.js";import{e as _s,f as Fe,C as Ot,c as Is}from"./event-kind-options-fHAIXu24.js";import{S as Ts}from"./source-record-panels-LJIWGtHb.js";import{u as Es}from"./clients-CydgUHrc.js";import{u as As}from"./client-activity-scopes-B7xVaUA-.js";import{g as Fs}from"./client-rows-B3LULJxW.js";import{E as Rs}from"./events-feed-DwOkLk6A.js";import{E as Ps}from"./run-initiator-8vdkq-3o.js";import{L as Ms,u as Ls}from"./renderer-ucwCQmBk.js";import{E as Os}from"./agent-loading-shells-BupiSjR-.js";import{M as ws}from"./member-scope-gate-Doic_6qX.js";const Be=k.createContext(null);function $s({organizationId:e,isWorkspaceLoading:t,children:a}){const{data:s=[],isLoading:o}=fn(e);return n.jsx(Be.Provider,{value:{groups:s,isLoading:!!t||o},children:a})}function Ds(){const e=k.useContext(Be);if(!e)throw new Error("useMemoryConnectorGroups must be used within MemoryConnectorGroupsProvider");return e}function Bs(){return k.useContext(Be)}function wt(e){const{parse:t,serialize:a,filterKeys:s,clearClassifications:o=!0,replace:i=!0,merge:u}=e,d=V(),h=ne(),l=k.useMemo(()=>{const g=new URLSearchParams;for(const[r,p]of Object.entries(h.search||{}))p!=null&&g.set(r,typeof p=="object"&&!Array.isArray(p)?JSON.stringify(p):String(p));return t(g)},[h.search,t]),m=k.useCallback((g,r)=>{const p=u?u(l,g):{...l,...g},y=a(p),S={};for(const[N,x]of Object.entries(h.search||{}))x!=null&&(S[N]=x);for(const N of s)delete S[N];if(o)for(const N of Object.keys(S))N.startsWith("clf_")&&delete S[N];for(const[N,x]of Object.entries(y))x!==void 0&&(S[N]=x);d({to:h.pathname,search:S,replace:r?.replace??i})},[l,a,s,o,u,d,h,i]),v=k.useCallback(()=>{const g={};for(const[r,p]of Object.entries(h.search||{}))p!=null&&(s.includes(r)||o&&r.startsWith("clf_")||(g[r]=p));d({to:h.pathname,search:g,replace:i})},[d,h.pathname,h.search,s,o,i]);return{filters:l,updateFilters:m,clearFilters:v}}function Ks(e){const{slug:t}=hn();return Ct({queryKey:["schedules",t,e],queryFn:async()=>((await St("manage_schedules",{action:"list",action_type:"wake_agent",include_paused:!0})).schedules??[]).filter(s=>s.action_args?.agent_id===e),enabled:!!t&&!!e,staleTime:3e4})}function Gs(e,t){return{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:e,connectorKey:t.connector_key,connectionId:String(t.connection_id)},search:{feedId:t.id}}}function Vs(e,t){return{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:e,connectorKey:t.connector_key,connectionId:String(t.id)}}}function Qs(e,t){return{to:"/$owner/agents/connected/$clientId",params:{owner:e,clientId:t}}}function Us(e,t){return{to:"/$owner/automations/$automationId",params:{owner:e,automationId:t}}}function Ws(e,t,a){return{to:"/$owner/events",params:{owner:e},search:{agent:t,schedule:a}}}function ve({id:e,label:t,value:a,sourceLink:s,details:o,onRemove:i}){return{id:e,label:t,op:"is",value:a,onRemove:i,editor:s||o?{kind:"custom",className:"w-80",render:()=>n.jsxs("div",{className:"flex flex-col gap-2 p-3 text-sm",children:[s?n.jsxs(Se,{to:s.to,params:s.params,search:s.search,className:"inline-flex min-w-0 items-center gap-1.5 font-medium text-foreground hover:underline",children:[n.jsx("span",{className:"truncate",children:a}),n.jsx(vn,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]}):n.jsx("span",{className:"font-medium",children:a}),o]})}:void 0}}function Hs({ownerSlug:e,clientIds:t,linkedUser:a,linkedUserEntitySlug:s}){const o=e&&s?yn(e,[{entity_type:"$member",slug:s}]):null;return n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"inline-flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-xs text-muted-foreground",children:[n.jsx("span",{children:t.length===1?"Client ID":"Client IDs"}),t.map(i=>n.jsx("code",{className:"break-all text-foreground",children:i},i))]}),a?n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:["Granted by",o?n.jsx(Se,{to:o,className:"font-medium text-foreground hover:underline",children:a}):n.jsx("span",{className:"font-medium text-foreground",children:a})]}):null]})}function zs(e,t=!0){return Ct({queryKey:["automations-list","activity",e],queryFn:async()=>{const a=await Promise.all(["active","archived"].map(s=>St("manage_automations",{action:"list",status:s,include_details:!1},{slug:e})));return[...new Map(a.flatMap(s=>s.automations).map(s=>[Number(s.automation_id),s])).values()].sort((s,o)=>s.name.localeCompare(o.name))},enabled:t&&!!e,staleTime:3e4})}function ee({to:e,params:t,search:a,label:s}){return n.jsx(Se,{to:e,params:t,search:a,onClick:o=>o.stopPropagation(),onPointerDown:o=>o.stopPropagation(),className:"shrink-0 rounded-md p-1 text-muted-foreground opacity-0 transition-opacity hover:text-foreground group-hover:opacity-100 focus-visible:opacity-100","aria-label":`Manage ${s}`,children:n.jsx(Nt,{className:"h-3.5 w-3.5"})})}const Oe=["produced","analyzed"],ke=e=>e==="produced"?"Produced by":"Analyzed by";function qs({enabled:e,...t}){const a=Js(t,e);if(!e)return{fields:[],chips:[]};const s=Ys(t);return{fields:[a.field,s.field],chips:[...a.chips,...s.chips]}}function Js({ownerSlug:e,filters:t,onFiltersChange:a},s){const o=zs(e,s),i=o.data??[],u=m=>m==="produced"?t.producedByAutomationId:t.automationId,d=m=>i.find(v=>Number(v.automation_id)===m)?.name??`#${m}`,h=Oe.flatMap(m=>{const v=u(m);return v==null?[]:[{id:`automation-${m}`,field:"automation",label:ke(m),value:d(v),onRemove:()=>a(m==="produced"?{producedByAutomationId:null}:{automationId:null})}]}),l={kind:"list",className:"w-80",searchPlaceholder:"Search Automations...",emptyText:o.isLoading?"Loading Automations...":"No Automations found",items:m=>n.jsxs(n.Fragment,{children:[Oe.map(v=>{const g=u(v),r=i.map(y=>({id:Number(y.automation_id),label:`${y.name}${y.status==="archived"?" (archived)":""}`}));g!=null&&!r.some(y=>y.id===g)&&r.unshift({id:g,label:`Automation #${g} (selected)`});const p=y=>{a(v==="produced"?{producedByAutomationId:y}:{automationId:y}),m()};return n.jsx(_t,{heading:ke(v),children:r.map(y=>n.jsxs(E,{"aria-label":y.label,value:`${v} ${y.label} ${y.id}`,onSelect:()=>p(y.id),className:"group",children:[n.jsx(B,{selected:g===y.id}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:y.label}),n.jsx(ee,{...Us(e,String(y.id)),label:y.label})]},y.id))},v)}),o.isError?n.jsx(E,{forceMount:!0,onSelect:()=>void o.refetch(),children:"Could not load Automations. Retry"}):null]})};return{chips:h,field:{key:"automation",label:"Automation",group:"Scope",icon:n.jsx(gn,{className:"h-4 w-4"}),editor:l}}}function Ys(e){const{filters:t,onFiltersChange:a}=e,s=[];t.runIds?.length&&s.push({id:"run-produced",field:"run",label:"Produced by run",value:t.runIds.map(i=>`#${i}`).join(", "),onRemove:()=>a({runIds:null})}),t.runId!=null&&s.push({id:"run-analyzed",field:"run",label:"Analyzed by run",value:`#${t.runId}`,onRemove:()=>a({runId:null})});const o={kind:"list",className:"w-96",searchPlaceholder:"Search runs or enter a run ID...",emptyText:"No matching runs. Enter an exact run ID or load more.",items:(i,u)=>Oe.map(d=>n.jsx(Zs,{...e,mode:d,query:u,close:i},d))};return{chips:s,field:{key:"run",label:"Run",group:"Scope",icon:n.jsx(xn,{className:"h-4 w-4"}),editor:o}}}function Zs({ownerSlug:e,filters:t,onFiltersChange:a,mode:s,query:o,close:i}){const u=s==="produced"?t.producedByAutomationId:t.automationId,d=Ns({workspace:!0},{automationIds:u==null?void 0:[u],runTypes:s==="analyzed"?["automation"]:void 0,connectionIds:s==="produced"?t.connectionIds??void 0:void 0,feedIds:s==="produced"?t.feedIds??void 0:void 0},e),h=s==="produced"?t.runIds??[]:t.runId==null?[]:[t.runId],l=d.data?.pages.flatMap(r=>r.runs)??[],m=[...new Map(l.map(r=>[r.id,{id:r.id,label:`Run #${r.id} · ${r.feed_display_name??r.operation_key??r.run_type} · ${r.status}`}])).values()];for(const r of h)m.some(p=>p.id===r)||m.unshift({id:r,label:`Run #${r} (selected)`});const v=r=>{if(s==="produced"){const p=h.includes(r)?h.filter(y=>y!==r):[...h,r];a({runIds:p.length?p:null})}else a({runId:r}),i()},g=/^\d+$/.test(o.trim())?Number(o.trim()):0;return n.jsxs(_t,{heading:ke(s),children:[m.map(r=>n.jsxs(E,{value:`${s} ${r.label}`,onSelect:()=>v(r.id),children:[n.jsx(B,{selected:h.includes(r.id)}),n.jsx("span",{className:"truncate",children:r.label})]},r.id)),Number.isSafeInteger(g)&&g>0&&!m.some(r=>r.id===g)?n.jsxs(E,{value:`${s} ${g}`,onSelect:()=>v(g),children:[ke(s)," run #",g]}):null,d.isLoading?n.jsx(E,{disabled:!0,forceMount:!0,children:"Loading runs..."}):null,d.isError?n.jsx(E,{forceMount:!0,onSelect:()=>void(d.isFetchNextPageError?d.fetchNextPage():d.refetch()),children:"Could not load runs. Retry"}):null,!d.isLoading&&!d.isError&&!m.length?n.jsx(E,{disabled:!0,forceMount:!0,children:"No runs found"}):null,d.hasNextPage?n.jsx(E,{forceMount:!0,disabled:d.isFetching,onSelect:()=>void d.fetchNextPage(),children:d.isFetchingNextPage?"Loading more runs...":"Load more runs"}):null]})}const Ke="Scope",Re="Source",W="h-4 w-4";function se(){return ne().search??{}}function $t(e){const{pathname:t}=ne(),a=t.startsWith(`/${e}/events/`),s=kn(t,a?1:0),o=!!(s&&!a&&!Cn(s.split("/")[0]));return{pathname:t,embedded:o,recordPath:o?Sn(s)?.entityPath:a?s:void 0}}function Dt(e){const t=se(),{recordPath:a,pathname:s,embedded:o}=$t(e);return i=>{const u=te(e,t,i,a);return o?{to:s,search:u.search}:u}}const yt=e=>new Set((e??"").split(",").map(t=>t.trim()).filter(Boolean));function Xs({ownerSlug:e,sourceRead:t=!1,filters:a,onFiltersChange:s}){const o=se(),{recordPath:i,embedded:u}=$t(e),d=i?i.split("/").at(-2):void 0,h=typeof o.type=="string"&&o.type.trim()?o.type.trim():void 0,l=(d?dt(d):void 0)??(h?dt(h):void 0),m=bn(o),v=jn(o),g=typeof o.feed_ids=="string"?o.feed_ids:typeof o.feed_ids=="number"?String(o.feed_ids):void 0,r=eo(e,l,!u),p=to(e,l,i,u),y=no(e,m,!t),S=qs({ownerSlug:e,filters:a,onFiltersChange:s,enabled:!t}),N=so(e,v,g);return[r,p,y,S,N].reduce((x,M)=>({fields:[...x.fields,...M.fields],chips:[...x.chips,...M.chips]}),{fields:[],chips:[]})}function eo(e,t,a){const s=V(),o=se(),{visible:i}=Nn(e);if(!a)return{fields:[],chips:[]};const u=i.find(h=>h.slug===t),d={kind:"list",searchPlaceholder:"Search types...",emptyText:"No entity types",items:h=>n.jsxs(n.Fragment,{children:[i.map(l=>n.jsxs(E,{onSelect:()=>{s(te(e,o,{entity:void 0,create:void 0,type:l.slug})),h()},className:"group gap-2",children:[n.jsx(B,{selected:l.slug===t}),n.jsx(On,{icon:l.icon,className:"h-4 w-4 shrink-0"}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:l.name}),typeof l.entity_count=="number"?n.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:l.entity_count}):null,n.jsx(ee,{to:"/$owner/entity-types/$slug",params:{owner:e,slug:l.slug},label:l.name})]},l.id)),n.jsxs(E,{onSelect:()=>{s(wn(e)),h()},className:"text-muted-foreground",children:[n.jsx(At,{className:"h-4 w-4 shrink-0"}),"Add entity type"]})]})};return{fields:[{key:"type",label:"Entity type",group:Ke,icon:n.jsx(_n,{className:W}),editor:d}],chips:t?[{id:"type",label:"Entity type",op:"is",value:u?.name??t,onRemove:()=>void s(te(e,o,{type:void 0}))}]:[]}}function to(e,t,a,s){const o=V(),i=se(),[u,d]=k.useState(""),[h,l]=k.useState(0),m=It(u,250),v={slug:e},{data:g,isLoading:r,isError:p,refetch:y}=In(t??"",v,{search:m,offset:h,limit:30,enabled:!s&&!!t}),{data:S}=Tn(a?`/${e}/${a}`:"",v),N=a?S?.entity:void 0,x=N?.name??(a?a.split("/").at(-1):void 0);if(s)return{fields:[],chips:x?[{id:"entity",label:"Entity",op:"is",value:x}]:[]};if(!t)return{fields:[],chips:[]};const M={kind:"list",searchPlaceholder:"Search entities...",emptyText:r?"Loading entities...":"No matching entities",className:"w-80",onQueryChange:F=>{d(F),l(0)},items:F=>n.jsxs(n.Fragment,{children:[p?n.jsx(E,{onSelect:()=>void y(),children:"Could not load entities. Retry"}):g?.entities.map(I=>n.jsxs(E,{value:I.slug,onSelect:()=>{const R=$n([...I.parent_slug&&I.parent_entity_type?[{entity_type:I.parent_entity_type,slug:I.parent_slug}]:[],{entity_type:I.entity_type,slug:I.slug}]);o(te(e,i,{type:t},R)),F()},children:[n.jsx(B,{selected:N?.slug===I.slug}),I.name]},I.slug)),h>0&&n.jsx(E,{onSelect:()=>l(Math.max(0,h-30)),children:"Previous entities"}),g?.metadata.has_more&&n.jsx(E,{disabled:r,onSelect:()=>l(h+30),children:"More entities"})]})};return{fields:[{key:"entity",label:"Entity",group:Ke,icon:n.jsx(En,{className:W}),editor:M}],chips:x?[{id:"entity",label:"Entity",op:"is",value:x,onRemove:()=>void o(te(e,i,{type:t}))}]:[]}}function no(e,t,a){const s=V(),o=Dt(e),{data:i=[]}=An(),u=k.useMemo(()=>[...i].sort((l,m)=>l.name.localeCompare(m.name)),[i]);if(!a)return{fields:[],chips:[]};const d=u.find(l=>l.agentId===t),h={kind:"list",searchPlaceholder:"Search agents...",emptyText:"No agents",items:l=>u.map(m=>n.jsxs(E,{onSelect:()=>{s(o({agent:m.agentId,schedule:void 0})),l()},className:"gap-2",children:[n.jsx(B,{selected:m.agentId===t}),n.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-md bg-muted text-[10px] font-medium",children:m.name.trim().charAt(0).toUpperCase()||"?"}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:m.name})]},m.agentId))};return{fields:[{key:"agent",label:"Agent",group:Ke,icon:n.jsx(Fn,{className:W}),editor:h}],chips:t?[{id:"agent",label:"Agent",op:"is",value:d?.name??t,onRemove:()=>void s(o({agent:void 0,schedule:void 0}))}]:[]}}function so(e,t,a){const s=V(),o=Dt(e),{groups:i}=Ds(),u=se(),d=je({platforms:String(u.platforms??u.platform??"")}).platforms??[],h=k.useMemo(()=>yt(t),[t]),l=k.useMemo(()=>yt(a),[a]),m=d.length===1?d[0]:Rn(i,h),v=i.find(_=>_.connector_key===m),g=h.size===1?Number([...h][0]):void 0,r=Pn(g),{org:p}=Tt(),y=Et(p?.id,{feedIds:[...l].map(Number),enabled:g==null&&l.size>0}),S=g==null?y:r,N=S.data??[],x={platforms:void 0,platform:void 0,connection_ids:void 0,feed_ids:void 0},M={kind:"list",searchPlaceholder:"Search connectors...",emptyText:"No connectors",items:_=>n.jsxs(n.Fragment,{children:[i.map(b=>{const A=b.connector_name??b.connector_key;return n.jsxs(E,{disabled:b.connections.length===0,onSelect:()=>{s(o({...x,platforms:b.connector_key})),_()},className:"group gap-2",children:[n.jsx(B,{selected:b.connector_key===v?.connector_key}),n.jsx(Bn,{plain:!0,name:A,faviconDomain:b.favicon_domain,className:"h-5 w-5 shrink-0 rounded-md text-[10px]"}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:A}),b.connection_count>0?n.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:b.connection_count}):null,n.jsx(ee,{to:"/$owner/connectors/$connectorKey",params:{owner:e,connectorKey:b.connector_key},label:A})]},b.connector_key)}),n.jsx(E,{asChild:!0,onSelect:_,className:"text-muted-foreground",children:n.jsxs(Se,{to:"/$owner/connectors/create",params:{owner:e},className:"flex items-center gap-2",children:[n.jsx(At,{className:"h-4 w-4 shrink-0"}),"Add connector"]})})]})},F=[{key:"connector",label:"Connector",group:Re,icon:n.jsx(Dn,{className:W}),editor:M}],I=[],R=v?.connector_name??v?.connector_key??(d.join(", ")||(h.size?`Connections ${[...h].join(", ")}`:void 0));if(R&&I.push({id:"connector",label:"Connector",op:"is",value:R,onRemove:()=>void s(o(x))}),v){F.push({key:"connection",label:"Connection",group:Re,icon:n.jsx(Mn,{className:W}),editor:K(v)});const _=h.size===1?v.connections.find(b=>h.has(String(b.id))):void 0;_&&I.push({id:"connection",label:"Connection",op:"is",value:ut({display_name:_.display_name,connector_name:v.connector_name,connector_key:v.connector_key}),onRemove:()=>void s(o({...x,platforms:v.connector_key}))})}if((g||a)&&F.push({key:"feed",label:"Feed",group:Re,icon:n.jsx(Ln,{className:W}),editor:Q()}),l.size>0){const _=l.size===1?N.find(b=>l.has(String(b.id))):void 0;I.push({id:"feed",label:"Feed",op:"is",value:_?ye(_):`#${a}`,onRemove:()=>void s(o({...g!=null?{connection_ids:String(g)}:{},feed_ids:void 0}))})}return{fields:F,chips:I};function K(_){return{kind:"list",searchPlaceholder:"Search connections...",emptyText:"No connections",items:b=>_.connections.map(A=>{const O=ut({display_name:A.display_name,connector_name:_.connector_name,connector_key:_.connector_key});return n.jsxs(E,{onSelect:()=>{s(o({connection_ids:String(A.id),feed_ids:void 0})),b()},className:"group gap-2",children:[n.jsx(B,{selected:h.has(String(A.id))}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:O}),A.feed_count>0?n.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:A.feed_count}):null,n.jsx(ee,{...Vs(e,{id:A.id,connector_key:_.connector_key}),label:O})]},A.id)})}}function Q(){return{kind:"list",searchPlaceholder:"Search feeds...",emptyText:S.isLoading?"Loading feeds...":"No feeds",items:_=>N.map(b=>n.jsxs(E,{"aria-label":ye(b),onSelect:()=>{s(o({...g!=null?{connection_ids:String(g)}:{},feed_ids:String(b.id)})),_()},className:"group gap-2",children:[n.jsx(B,{selected:l.has(String(b.id))}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:ye(b)}),n.jsx(ee,{...Gs(e,b),label:ye(b)})]},b.id))}}}function ye(e){return e.display_name?.trim()||e.feed_key}const Ce=[{value:"date-desc",label:"Newest first"},{value:"date-asc",label:"Oldest first"},{value:"score-desc",label:"Highest score"},{value:"score-asc",label:"Lowest score"}],Bt={value:"notifications",label:"Notifications"};function oo({value:e,onChange:t,withNotifications:a=!1}){const s=a?[Bt,...Ce]:Ce,o=s.find(i=>i.value===e)?.label??"Newest first";return n.jsxs(Kn,{value:e,onValueChange:t,children:[n.jsxs(Gn,{"aria-label":"Sort",className:"h-8 w-auto shrink-0 gap-2 bg-muted px-2.5",children:[n.jsx(Ft,{"aria-hidden":"true",className:"h-3.5 w-3.5 text-muted-foreground"}),n.jsx(Vn,{children:o})]}),n.jsx(Qn,{align:"end",className:"min-w-40",children:s.map(i=>n.jsx(Un,{value:i.value,children:i.label},i.value))})]})}const gt=[{value:"user",label:"Manual review"},{value:"system",label:"Auto-classified"},{value:"llm",label:"LLM-classified"}],xt=[{value:"pending",label:"Pending approval"},{value:"approved",label:"Approved"},{value:"rejected",label:"Rejected"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"}],ge=0,xe=100,Z="Event",U="h-4 w-4";function ao(e,t,a,s){const o=e.engagementRange??[ge,xe],i=e.reviewStatus,u=e.interactionStatus,d=e.semanticTypes??[],h=[{key:"kind",label:"Event kind",group:Z,icon:n.jsx(qn,{className:U}),editor:X({searchPlaceholder:"Search event kinds...",emptyText:"No event kinds found",options:_s(a,d).map(v=>({value:v,label:Fe(v)})),selected:d,multiple:!0,onSelect:v=>{const g=d.includes(v)?d.filter(r=>r!==v):[...d,v];t({semanticTypes:g.length>0?g:void 0})}})},{key:"date",label:"Date",group:Z,icon:n.jsx(Jn,{className:U}),editor:js({value:e.dateRange??void 0,onApply:v=>t({dateRange:v})})},{key:"approval",label:"Approval",group:Z,icon:n.jsx(Yn,{className:U}),editor:X({searchPlaceholder:"Search statuses...",options:[...xt],selected:u?[u]:[],onSelect:v=>t({interactionStatus:v})})},{key:"review",label:"Reviewed by",group:Z,icon:n.jsx(Zn,{className:U}),editor:X({searchPlaceholder:"Search reviewers...",options:[...gt],selected:i&&i!=="all"?[i]:[],onSelect:v=>t({reviewStatus:v})})},{key:"score",label:"Engagement score",group:Z,icon:n.jsx(Xn,{className:U}),editor:ks({value:o,min:ge,max:xe,onApply:v=>t({engagementRange:v})})}],l=[],m=e.eventCategory!=null&&d.length===1&&d[0]===Ot;return d.length&&!m&&l.push({id:"kind",label:"Kind",value:d.length<=2?d.map(Fe).join(", "):`${d.length} kinds`,title:d.map(Fe).join(", "),onRemove:()=>t({semanticTypes:void 0})}),e.dateRange&&l.push({id:"date",label:"Date",op:"is",value:Cs(e.dateRange),onRemove:()=>t({dateRange:null})}),u&&!(s&&u==="pending")&&l.push({id:"approval",label:"Approval",op:"is",value:xt.find(v=>v.value===u)?.label??u,onRemove:()=>t({interactionStatus:null})}),i&&i!=="all"&&l.push({id:"review",label:"Reviewed by",op:"is",value:gt.find(v=>v.value===i)?.label??i,onRemove:()=>t({reviewStatus:void 0})}),(o[0]!==ge||o[1]!==xe)&&l.push({id:"score",label:"Engagement score",value:Ss(o,ge,xe),onRemove:()=>t({engagementRange:void 0})}),{fields:h,chips:l}}function Kt({filters:e,onFiltersChange:t,eventKinds:a=[],searchQuery:s,onSearchChange:o,scope:i,extraFields:u=[],drillChips:d=[],onShowNotifications:h,sourceRead:l=!1,filterTrailing:m,filterActions:v,quickFilters:g,needsYou:r=!1,toolbarLeading:p,toolbarTrailing:y,searchPlaceholder:S="Search events...",onClearFilters:N}){const x=s.trim().length>0,M=l?{fields:[],chips:[]}:ao(e,t,a,r),F=`${e.sortBy??"date"}-${e.sortOrder??"desc"}`,I=b=>{const[A,O]=b.split("-");t({sortBy:A,sortOrder:O})},R=p!=null||y!=null,K=R&&!l?{fields:[{key:"sort",label:"Order",group:"Order",icon:n.jsx(Ft,{className:U}),editor:X({searchPlaceholder:"Search orders...",options:[...Ce],selected:[F],onSelect:I})}],chips:F==="date-desc"?[]:[{id:"sort",label:"Order",value:Ce.find(b=>b.value===F)?.label??F,onRemove:()=>t({sortBy:"date",sortOrder:"desc"})}]}:{fields:[],chips:[]},Q=[...g?.fields??[],...M.fields,...i?.fields??[],...u,...K.fields],_=[...g?.chips??[],...i?.chips??[],...d,...M.chips,...K.chips];return n.jsxs("div",{className:"w-full space-y-2.5",children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[p,!l&&n.jsxs("div",{className:"relative min-w-0 flex-1",children:[n.jsx(Wn,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),n.jsx(Hn,{type:"search","aria-label":"Search events",placeholder:S,value:s,onChange:b=>o(b.target.value),className:De("h-8 pl-9",R&&vt,x&&"pr-9")}),x&&n.jsx("button",{type:"button","aria-label":"Clear search",onClick:()=>o(""),className:"absolute right-0.5 top-1/2 flex h-8 w-8 -translate-y-1/2 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:n.jsx(zn,{className:"h-3.5 w-3.5"})})]}),!l&&!R&&n.jsx(oo,{value:F,withNotifications:h!=null,onChange:b=>{if(b===Bt.value){h?.();return}I(b)}}),y,R?n.jsx(xs,{fields:Q,triggerClassName:vt}):null]}),n.jsx(bs,{label:"Event filters",menu:!R,clearAllMin:R?2:1,fields:Q,chips:_,actions:v,trailing:m,onClearAll:N,hasClearableState:x})]})}function Gt({ownerSlug:e,...t}){const a=Xs({ownerSlug:e,sourceRead:t.sourceRead,filters:t.filters,onFiltersChange:t.onFiltersChange});return n.jsx(Kt,{...t,scope:a})}const we=3600*1e3,bt=24*we;function jt(e){const t=e instanceof Date?e:new Date(String(e));return Number.isNaN(t.getTime())?null:t}function kt(e){return e.toISOString().split("T")[0]}function $e(e){return e.toLocaleDateString(void 0,{timeZone:"UTC",month:"short",day:"numeric"})}function io(e){const a=e[e.length-1].date.getTime()-e[0].date.getTime()>180*bt,s=new Map;for(const o of e){const i=new Date(o.date);a&&i.setUTCDate(i.getUTCDate()-i.getUTCDay()),s.set(i.getTime(),(s.get(i.getTime())??0)+o.count)}return[...s.entries()].sort(([o],[i])=>o-i).map(([o,i])=>{const u=new Date(o);return{start:u,end:new Date(o+(a?7:1)*bt),count:i,label:`${u.getUTCMonth()+1}/${u.getUTCDate()}`,tooltip:a?`Week of ${$e(u)}`:$e(u)}})}function ro(e){const t=u=>{const d=new Date(u);return d.setMinutes(0,0,0),d.getTime()},a=new Map;for(const u of e)a.set(t(u),(a.get(t(u))??0)+1);const s=Math.min(...a.keys()),o=Math.max(...a.keys()),i=[];for(let u=s;u<=o;u+=we){const d=new Date(u);i.push({start:d,end:new Date(u+we),count:a.get(u)??0,label:mt(d,"HH:mm"),tooltip:mt(d,"MMM d, HH:mm")})}return i}function co({entityId:e,organizationId:t,ownerSlug:a,eventTimes:s,selectedRange:o,onSelectRange:i}){const{data:u,isLoading:d,error:h}=es(t,{entityId:e},{slug:a}),l=k.useMemo(()=>(u??[]).map(p=>{const y=jt(p.date);return y?{date:y,count:p.count}:null}).filter(p=>p!==null).sort((p,y)=>p.date.getTime()-y.date.getTime()),[u]),m=k.useMemo(()=>{if(l.length===0)return[];if(l.length>1)return io(l);const[p]=l,y=kt(p.date),S=(s??[]).map(jt).filter(N=>N!==null&&kt(N)===y);return S.length===p.count?ro(S):[]},[l,s]),v=k.useCallback(p=>{const y=m[p.dataIndex];y&&i&&i(y.start,y.end)},[m,i]),g=k.useCallback(p=>{if(i&&p.startValue!==void 0&&p.endValue!==void 0){const y=new Date(p.startValue),S=new Date(p.endValue);i(y,S)}},[i]),r=k.useMemo(()=>{if(m.length<2)return null;let p;if(o){const[y,S]=o,N=m.filter(x=>x.start<S&&x.end>y);N.length>0&&(p=[[{xAxis:N[0].label},{xAxis:N[N.length-1].label}]])}return{tooltip:{trigger:"axis",axisPointer:{type:"line"},formatter:y=>{const S=y[0];return`${m[S.dataIndex]?.tooltip}: ${S.value} items`}},grid:{left:50,right:20,top:20,bottom:60},xAxis:{type:"category",boundaryGap:!1,data:m.map(y=>y.label)},yAxis:{type:"value",minInterval:1,splitLine:{lineStyle:{color:"rgba(0,0,0,0.05)"}}},dataZoom:[{type:"slider",start:0,end:100,height:20,bottom:10,borderColor:"transparent",backgroundColor:"rgba(0,0,0,0.02)",fillerColor:"rgba(99, 102, 241, 0.1)",handleStyle:{color:"#6366f1"}}],series:[{type:"line",smooth:!0,areaStyle:{opacity:.3,color:new Ms(0,0,0,1,[{offset:0,color:"rgba(99, 102, 241, 0.5)"},{offset:1,color:"rgba(99, 102, 241, 0.05)"}])},lineStyle:{width:2,color:"#6366f1"},itemStyle:{color:"#6366f1"},showSymbol:!1,data:m.map(y=>y.count),markLine:{silent:!0,symbol:"none",label:{position:"insideEndTop",formatter:"avg: {c}",fontSize:10,color:"#9ca3af"},lineStyle:{color:"#d1d5db",type:"dashed",width:1},data:[{type:"average",name:"Average"}]},markArea:p?{silent:!0,itemStyle:{color:"rgba(99, 102, 241, 0.1)"},data:p}:void 0}]}},[m,o]);if(d||h)return n.jsx("div",{className:De(Rt,"p-4"),children:n.jsx("div",{className:"flex h-48 w-full items-center justify-center",children:d?n.jsx(Os,{}):n.jsx("p",{className:"text-sm text-muted-foreground",children:"Failed to load timeline"})})});if(l.length===0)return null;if(!r){const[p]=l;return n.jsxs("p",{className:"text-xs text-muted-foreground",children:[p.count===1?"1 event":`All ${p.count} events`," on"," ",$e(p.date),"."]})}return n.jsx(lo,{option:r,onClick:v,onDataZoom:g})}function lo({option:e,onClick:t,onDataZoom:a}){const{chartRef:s,setOption:o}=Ls({onClick:t,onDataZoom:a});return k.useEffect(()=>{o(e,!0)},[e,o]),n.jsx("div",{"data-testid":"events-timeline",className:De(Rt,"p-4 relative"),children:n.jsx("div",{ref:s,className:"h-48 w-full"})})}const be={config:"Configuration",deployment:"Applies"};function uo({organizationId:e,ownerSlug:t,entityId:a,hideSourceFilter:s=!1,scopedEntityTypes:o,pinned:i,onShowNotifications:u,emptyState:d,toolbar:h}){const{isAuthenticated:l,isReady:m}=ts(),{isMember:v,isLoading:g}=Tt(),r=m&&l&&v,p=m&&(!l||!g&&!v),y=V(),S=ne(),N=ns(),{filters:x,updateFilters:M,clearFilters:F}=wt({parse:je,serialize:Me,filterKeys:Mt,replace:!1,merge:Pt}),[I,R]=k.useState(x.searchQuery||""),[K,Q]=k.useState(Pe(x)||s&&(a!=null||!!o?.length)),_=I.trim(),b=_.length>=3?_:void 0,A=It(b,1e3),O=k.useRef(!1);k.useEffect(()=>N.history.subscribe(({location:c,action:f})=>{const C=je(new URLSearchParams(c.search)).searchQuery??"";!(f.type==="BACK"||f.type==="FORWARD"||f.type==="GO")&&O.current&&(C===(x.searchQuery??"")||C===(b??""))||(O.current=!1,R(C))}),[N.history,b,x.searchQuery]);const j=k.useMemo(()=>{const{afterOccurredAt:c,afterId:f,...C}=x;return pt({...C,...o?.length?{entityTypes:o}:{}})},[x,o]),P=M;k.useEffect(()=>{O.current&&(x.searchQuery||void 0)!==A&&M({searchQuery:A})},[A,M,x.searchQuery]);const Ge=()=>{O.current=!1,R(""),s&&t?y({...Le(t,S.search??{}),...a!==void 0&&!S.pathname.startsWith(`/${t}/events/`)?{to:S.pathname}:{}}):F()},oe=Pe(pt(x)),ae=a===void 0,{data:Vt=[]}=ss(m&&r?e:null),{data:Qt=[]}=os(p?t:null),Ve=r?Vt:Qt,{data:Qe=[]}=as(r&&e?{organizationId:e}:void 0),ie=Bs(),re=j.connectionIds,Ne=(re?.length??0)>0,{data:Ue=[]}=is(m&&r?e??"":"",{connectionIds:re??void 0,enabled:!ie&&m&&r&&Ne}),We=j.feedIds,_e=(We?.length??0)>0,{data:He=[]}=Et(m&&r?e:null,{feedIds:We??void 0,enabled:m&&r&&_e}),ze=k.useMemo(()=>ie?ie.groups.flatMap(c=>c.connections.map(f=>({id:f.id,display_name:f.display_name,connector_name:c.connector_name,connector_key:c.connector_key}))):Ue,[Ue,ie]),Ie=k.useMemo(()=>{const c=new Set(re??[]);return[...new Set([...j.platforms??[],...ze.filter(f=>c.has(f.id)).map(f=>f.connector_key)])]},[re,ze,j.platforms]),Te=k.useMemo(()=>He.map(c=>({connectorKey:c.connector_key,feedKey:c.feed_key})),[He]),Ut=k.useMemo(()=>Ne&&Ie.length===0||_e&&Te.length===0?[]:Is({connectors:Ve,entityTypes:Qe,selectedPlatforms:Ie,selectedFeeds:Te,selectedEntityTypes:j.entityTypes}),[Ve,j.entityTypes,Ne,_e,Ie,Te,Qe]),L=j.clientIds,ce=(L?.length??0)>0,{data:qe=[]}=Es(null,{enabled:m&&r&&ce}),le=k.useMemo(()=>{if(!L)return[];const c=new Set(L);return Fs(qe).filter(f=>f.clientIds.some(C=>c.has(C)))},[L,qe]),Je=k.useMemo(()=>{if(!ce||!L)return null;const c=le.map(f=>f.title);return c.length>0?c.join(", "):L.length>1?`${L.length} client registrations`:"Client registration"},[le,L,ce]),de=le.length===1?le[0]:null,Wt=t&&de?Qs(t,de.clientId):void 0,ue=j.mcpActivityId??null,{data:Ye=[]}=As({enabled:m&&r&&ce&&!!ue,clientIds:L??[],limit:100}),Ze=k.useMemo(()=>{if(!ue)return null;const c=Ye.find(C=>C.activityId===ue);if(!c)return"Selected conversation";const f=c.title?.trim();return f||(c.activityKind==="session"?"MCP session":c.clientId)},[ue,Ye]),H=j.agentId,z=j.schedule,{data:Xe=[]}=Ks(H??void 0),et=k.useMemo(()=>!z||!H?null:Xe.find(f=>f.id===z)?.description?.trim()||"Scheduled task",[H,z,Xe]),{data:Ht}=rs(m&&r?e:null,a),{data:zt}=cs(p&&!ae?t:null,a),tt=r?Ht:zt,me=k.useMemo(()=>{const c=new Map;for(const f of tt||[]){const C=f.automation_name??"__global__";c.has(C)||c.set(C,{automationName:f.automation_name??null,classifiers:[]});const T=c.get(C),$=f.attribute_values||{},w=Object.keys($);let he=null;const q={};for(const[J,G]of Object.entries($))if(G.parent)for(const[Ae,Y]of Object.entries(G.parent))he=Ae,q[Y]||(q[Y]=[]),q[Y].push(J);const D=T.classifiers.find(J=>J.slug===f.slug);if(D){const J=new Set([...D.values,...w]);D.values=[...J];for(const[G,Ae]of Object.entries(q)){D.valuesByParentValue[G]||(D.valuesByParentValue[G]=[]);const Y=new Set([...D.valuesByParentValue[G],...Ae]);D.valuesByParentValue[G]=[...Y]}he&&(D.parentSlug=he)}else T.classifiers.push({slug:f.slug,name:f.name,values:w,parentSlug:he,valuesByParentValue:q})}for(const f of c.values())f.classifiers.sort((C,T)=>C.parentSlug===null&&T.parentSlug!==null?-1:C.parentSlug!==null&&T.parentSlug===null?1:0);return[...c.values()]},[tt]),qt=ls(m&&r?e:null,a,j,t),Jt=ds(p?t:null,a,j),Yt=p?Jt:qt,{data:Ee,isLoading:Zt,error:Xt}=Yt,en=k.useMemo(()=>Ee?.pages.flatMap(c=>c.content.map(f=>f.occurred_at)),[Ee]),nt=Ee?.pages[0],tn=(nt?.content.length??0)>0,st=me.some(c=>c.classifiers.length>0),nn=us(m&&r&&st?e:null,a,j,t),sn=ms(p&&st?t:null,a,j),on=(p?sn:nn).data?.classification_stats,an=k.useCallback(()=>{P({beforeOccurredAt:void 0,beforeId:void 0,afterOccurredAt:void 0,afterId:void 0}),window.scrollTo({top:0,behavior:"smooth"})},[P]),rn=(c,f)=>{P({dateRange:[c,f]})},ot=(c,f)=>{const C={...j.classificationFilters||{}};if(f.length>0)C[c]=f;else{delete C[c];for(const T of me)for(const $ of T.classifiers)$.parentSlug===c&&delete C[$.slug]}P({classificationFilters:C})},cn=(c,f)=>{const C=j.classificationFilters?.[c]||[];ot(c,C.includes(f)?C.filter(T=>T!==f):[...C,f])},ln=c=>ot(c,[]);if(Xt)return n.jsx(ps,{label:"knowledge"});const at=!m||l&&g||r&&!e||Zt,pe={fields:[],chips:[]};for(const c of me)for(const f of c.classifiers){const C=j.classificationFilters?.[f.slug]??[],T=f.parentSlug?j.classificationFilters?.[f.parentSlug]??[]:void 0,$=T?[...new Set(T.flatMap(w=>f.valuesByParentValue[w]??[]))]:f.values;$.length>0&&pe.fields.push({key:`clf:${f.slug}`,label:f.name,group:c.automationName??"Classifiers",icon:n.jsx(fs,{className:"h-4 w-4"}),editor:X({searchPlaceholder:`Search ${f.name.toLowerCase()}...`,options:$.map(w=>({value:w,label:w,count:on?.[f.slug]?.[w]})),selected:C,multiple:!0,onSelect:w=>cn(f.slug,w)})})}for(const[c,f]of Object.entries(j.classificationFilters??{})){if(f.length===0)continue;const C=me.flatMap(T=>T.classifiers).find(T=>T.slug===c);pe.chips.push({id:`clf:${c}`,field:`clf:${c}`,label:C?.name??c,op:f.length>1?"is any of":"is",value:f.join(", "),onRemove:()=>ln(c)})}const dn=[j.contentIds?.length?ve({id:"contentIds",label:j.contentIds.length>1?"Events":"Event",value:`#${j.contentIds.join(", #")}`,onRemove:()=>P({contentIds:void 0})}):null,Ze?ve({id:"mcpActivityId",label:"Conversation",value:Ze,onRemove:()=>P({mcpActivityId:void 0})}):null,Je?ve({id:"clientIds",label:"Connected app",value:Je,sourceLink:Wt,details:L&&L.length>0?n.jsx(Hs,{ownerSlug:t,clientIds:L,linkedUser:de?.linkedUser,linkedUserEntitySlug:de?.linkedUserEntitySlug}):void 0,onRemove:()=>P({clientIds:void 0})}):null,et?ve({id:"schedule",label:"Schedule",value:et,sourceLink:t&&H&&z?Ws(t,H,z):void 0,onRemove:()=>P({schedule:void 0,runIds:void 0})}):null,...j.eventCategory?[be[j.eventCategory]?{id:"event-category",label:be[j.eventCategory],value:"",onRemove:()=>P({eventCategory:void 0,semanticTypes:void 0})}:{id:"event-category",label:"Category",op:"is",value:j.eventCategory,onRemove:()=>P({eventCategory:void 0})}]:[],...j.resourceKind||j.resourceId?[{id:"resource",label:"Resource",op:"is",value:`${j.resourceKind}: ${j.resourceId}`,onRemove:()=>P({resourceKind:void 0,resourceId:void 0})}]:[],...pe.chips].filter(c=>c!=null),un=!!(r&&a&&e),it=i&&!oe?i:void 0,rt=ae&&r&&u!=null,fe={fields:[],chips:[]};if(rt){const c=x.interactionStatus==="pending";fe.fields.push({key:"needs-you",label:"Needs you",icon:n.jsx(gs,{className:"h-4 w-4"}),editor:{kind:"toggle",checked:c,onToggle:()=>P({interactionStatus:c?null:"pending"})}}),c&&fe.chips.push({id:"needs-you",label:"Needs you",value:"",onRemove:()=>P({interactionStatus:null})})}if(ae&&r)for(const[c,f,C]of[["config",be.config,Nt],["deployment",be.deployment,hs]]){const T=x.eventCategory===c;fe.fields.push({key:`category:${c}`,label:f,icon:n.jsx(C,{className:"h-4 w-4"}),editor:{kind:"toggle",checked:T,onToggle:()=>P({eventCategory:T?void 0:c,semanticTypes:T?void 0:[Ot],resourceKind:void 0,resourceId:void 0})}})}const ct={quickFilters:fe,needsYou:rt,toolbarLeading:h?.leading,toolbarTrailing:h?.trailing,searchPlaceholder:h?"Search activity":void 0,filterTrailing:un?n.jsxs(Lt,{variant:"ghost",size:"sm",className:"h-8 text-muted-foreground","aria-pressed":K,onClick:()=>Q(c=>!c),children:[n.jsx(ys,{className:"mr-1.5 h-3.5 w-3.5"}),"Timeline"]}):void 0,onClearFilters:Ge,onShowNotifications:u,filters:j,onFiltersChange:P,eventKinds:Ut,searchQuery:I,onSearchChange:c=>{O.current=!0,R(c)},extraFields:pe.fields,drillChips:dn},mn=!at&&!!nt&&!tn&&!oe,pn=l?r?"Activity is the workspace's live feed — every message, email, file, and record a connector pulls in lands here as an event. Connect your data to start collecting.":"Activity is the workspace's live feed of connector events. Join this workspace to add connectors and collect knowledge here.":"No public knowledge items are available yet",lt=!!(r&&t);return n.jsx(vs,{children:n.jsxs("div",{className:"space-y-2",children:[n.jsx("div",{className:s?"sticky top-0 z-10 -mx-4 bg-background px-4 pb-2 lg:-mx-6 lg:px-6":void 0,children:s&&t?n.jsx(Gt,{...ct,ownerSlug:t}):n.jsx(Kt,{...ct})}),K&&r&&a&&e&&n.jsx(co,{entityId:a,organizationId:e,ownerSlug:t||"",eventTimes:en,selectedRange:j.dateRange||void 0,onSelectRange:rn}),it?.rows,at?n.jsx(Ps,{}):mn?d??n.jsx(ft,{icon:ht,title:"No activity yet",description:pn,actionLabel:lt?"Add a connector":void 0,onAction:lt&&t?()=>void y({to:"/$owner/connectors/create",params:{owner:t}}):void 0}):n.jsx(Rs,{organizationId:e,ownerSlug:t,entityId:a,filters:j,showEntityLinks:ae,groupStretches:!0,onGoToLatest:j.beforeOccurredAt?an:void 0,hiddenApprovalRunIds:it?.hiddenApprovalRunIds,emptyState:n.jsx(ft,{icon:ht,title:"No results found",description:"Try adjusting your filters to find what you are looking for",actionLabel:oe?"Clear filters":void 0,onAction:oe?Ge:void 0})})]})})}function mo({record:e,ownerSlug:t}){const a=ne(),s=V(),{filters:o,updateFilters:i}=wt({parse:je,serialize:Me,filterKeys:Mt,replace:!1,merge:Pt}),u=Pe({...o,platforms:void 0,connectionIds:void 0,feedIds:void 0})||o.sortBy!=null&&o.sortBy!=="date"||o.sortOrder!=null&&o.sortOrder!=="desc",d=()=>{s({...Le(t,a.search??{}),...a.pathname.startsWith(`/${t}/events/`)?{}:{to:a.pathname}})};return n.jsxs("div",{className:"space-y-4",children:[n.jsx(Gt,{ownerSlug:t,sourceRead:!0,filters:o,onFiltersChange:i,searchQuery:o.searchQuery??"",onSearchChange:h=>i({searchQuery:h}),onClearFilters:d}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Live activity supports connector, connection and feed filters. Search and other event filters are available for saved activity."}),u?n.jsxs("div",{role:"alert",className:"space-y-2 rounded-md border p-3 text-sm",children:[n.jsx("p",{children:"Some selected filters aren't supported for live activity. Clear them to see results."}),n.jsx(Lt,{variant:"outline",size:"sm",onClick:()=>{const h=Me({platforms:o.platforms,connectionIds:o.connectionIds,feedIds:o.feedIds}),l={...Le(t,a.search??{}).search,...h};s({to:a.pathname,search:l})},children:"Clear unsupported filters"})]}):n.jsx(Ts,{record:e,orgContext:{slug:t},filters:o})]})}function Eo({entity:e,organizationId:t,ownerSlug:a}){const s=e.is_derived?n.jsx(mo,{ownerSlug:a,record:{type:e.entity_type,key:e.slug}}):n.jsx(uo,{organizationId:t,ownerSlug:a,entityId:typeof e.id=="number"?e.id:void 0,hideSourceFilter:!0});return n.jsx($s,{organizationId:t,children:e.entity_type==="$member"?n.jsx(ws,{children:s}):s})}export{uo as E,$s as M,Bt as N,Eo as R,oo as S};
|
|
2
|
+
//# sourceMappingURL=record-activity-BCpNKaUo.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as s,j as c}from"./index-
|
|
2
|
-
//# sourceMappingURL=record-session-
|
|
1
|
+
import{r as s,j as c}from"./index-C2TCKJDP.js";function u(){const o=new Map,e=new Set,n=()=>{for(const t of e)t()};return{get:t=>o.get(t),set:t=>{o.get(t.entity.id)!==t&&(o.set(t.entity.id,t),n())},remove:t=>{o.delete(t)&&n()},subscribe:t=>(e.add(t),()=>e.delete(t))}}const r=s.createContext(null);function d({children:o}){const[e]=s.useState(u);return c.jsx(r.Provider,{value:e,children:o})}function f(o){const e=s.useContext(r);s.useLayoutEffect(()=>{e?.set(o)});const n=o.entity.id;s.useEffect(()=>()=>e?.remove(n),[e,n])}const i=()=>()=>{};function S(o){const e=s.useContext(r);return s.useSyncExternalStore(e?.subscribe??i,()=>e?.get(o),()=>e?.get(o))}export{d as R,f as a,S as u};
|
|
2
|
+
//# sourceMappingURL=record-session-KuEDuF3S.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{eS as iB,d3 as oB,j as V,cH as kI,cI as OI,bJ as sB,cK as NI,fi as F_,cG as lB,i as pd,fj as uB,r as ze,dx as fB,fk as vB,fl as cB,dm as hB,eV as vm,ax as BI,L as dB,c as pB,u as gB,ek as yB,el as mB,m as pp,B as Wu,A as _B,fm as SB,a7 as VI,fd as xB,fn as wB,fo as bB,k as CB,C as TB,dN as AB,ey as MB,bw as DB}from"./index-C2TCKJDP.js";import{S as cm,i as hm,t as dm,f as IB}from"./schema-value-CefbtPIY.js";import{c as LB,d as PB,b as RB,a as EB,C as kB}from"./card-rE4Ctuy6.js";import{T as OB,a as NB,b as gp,c as BB,d as VB,e as Rx}from"./table-1O-ik4_O.js";function zB(r){return String(r??"").split(/[_-]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function FB(r,e){return e.title||e.description||zB(r)}function GB(r){return r.title&&r.description&&r.description!==r.title?r.description:void 0}function HB({control:r}){const e=[r.set_by,r.set_at?oB(r.set_at):null].filter(Boolean).join(" · ");return V.jsxs(kI,{children:[V.jsx(OI,{asChild:!0,children:V.jsx("button",{type:"button",className:"shrink-0 text-emerald-600 hover:text-emerald-500 dark:text-emerald-400","aria-label":"Set by a person",children:V.jsx(sB,{className:"h-3 w-3"})})}),V.jsxs(NI,{className:"max-w-xs space-y-1",children:[V.jsx("div",{className:"text-xs font-medium",children:"Set by a person"}),V.jsx("div",{className:"text-[11px] text-primary-foreground/70",children:"Automations ask for approval before changing it."}),r.note?V.jsx("div",{className:"text-xs text-primary-foreground/90",children:r.note}):null,e?V.jsx("div",{className:"text-[11px] text-primary-foreground/70",children:e}):null]})]})}function UB(r){const e=iB(r);return e===null||e===""?void 0:e}function WB(r){return r.parent_id&&r.parent_slug&&r.parent_entity_type?[{entity_type:r.parent_entity_type,slug:r.parent_slug},{entity_type:r.entity_type,slug:r.slug}]:[{entity_type:r.entity_type,slug:r.slug}]}function Une(r){return typeof r=="string"?JSON.parse(r):r??{}}function $B(r){return r.type==="array"&&!!r.items&&(r.items?.type==="object"||!!r.items?.properties)}function zI(r){return(r.type==="object"||!!r.properties)&&Object.keys(r.properties??{}).length>0}function YB(r){const e=r?.properties;return F_(e).filter(([,t])=>!("x-measure"in t)&&!("x-dimension"in t)).map(([t,n])=>({key:t,prop:n}))}function pm(r){return r.label??r.prop["x-table-label"]??FB(r.key,r.prop)}function FI(r){try{return UB(r)}catch{return r instanceof uB?r.text:r}}function gm(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}function ym(r,e){const t=FI(e);return t==null?!1:typeof t=="string"?t.trim().length>0:Array.isArray(t)?t.length>0:gm(t)?zI(r.prop)?F_(r.prop.properties).some(([n,a])=>ym({prop:a},t[n])):Object.entries(t).some(([n,a])=>ym({prop:{}},a)):!0}function GI(r,e){return r.filter(t=>ym(t,e[t.key]))}function XB({value:r,prop:e,ownerSlug:t,orgContext:n}){const a=e["x-link-entity-type"],i=e["x-link-lookup-field"]||"slug",{data:o}=fB(a,n,{limit:vB}),s=c=>{const h=o?.entities.find(d=>{const p=i==="slug"?d.slug:d.metadata?.[i];return p!=null&&String(p)===c});return h?{label:h.name,to:hB(t,WB(h))}:void 0},l=Array.isArray(r)?r:[r],u=c=>i==="slug"&&o!==void 0&&ZB(c)&&!s(String(c));if(!l.some(u))return V.jsx(cm,{value:r,prop:e,resolveLink:s});const f=[...new Set(l.map(String))],v=new Map(l.map(c=>[String(c),c]));return V.jsx("span",{className:"inline-flex flex-wrap gap-x-2 gap-y-1",children:f.map(c=>v.get(c)).map(c=>u(c)?V.jsx(jB,{entityType:a,recordKey:String(c),ownerSlug:t},String(c)):V.jsx(cm,{value:c,prop:Array.isArray(r)?e.items??e:e,resolveLink:s},String(c)))})}function ZB(r){const e=typeof r=="number"?String(r):r;return typeof e=="string"&&e.trim()!==""&&!/[/?#]/.test(e)}function jB({entityType:r,recordKey:e,ownerSlug:t}){const n=vm(t,[{entity_type:r,slug:e}]),{data:a,isError:i}=BI(n,{slug:t}),o=a?.entity,s=o&&o.entity_type===r&&o.slug===e;return i||a&&!s?V.jsx("span",{className:"text-muted-foreground",title:"This record is not available",children:e}):V.jsx(dB,{to:n,className:"text-primary hover:underline",onClick:l=>l.stopPropagation(),children:s?o.name:e})}function qB({field:r,value:e,context:t}){if($B(r.prop)&&(e==null||Array.isArray(e))){const n=Array.isArray(e)?e.length:0,a=`${n} ${n===1?"item":"items"}`,i=t.dirtyKeys?.includes(r.key)??!1,o="inline-flex items-center gap-1 rounded-md bg-muted px-1.5 py-0.5 text-xs tabular-nums";if(!t.openField)return V.jsx("span",{className:o,children:a});const s=t.openFieldKey===r.key;return V.jsxs("button",{type:"button","aria-pressed":s,"aria-label":`${pm(r)}: ${a}${i?", unsaved changes":""}`,className:pd(o,"hover:bg-muted/70 hover:text-foreground",s&&"ring-1 ring-primary"),onClick:()=>t.openField?.(r),children:[a,i?V.jsx("span",{className:"text-amber-600 dark:text-amber-400",children:"· edited"}):null]})}return r.prop["x-link-entity-type"]&&t.orgContext&&e!=null?V.jsx(XB,{value:e,prop:r.prop,ownerSlug:t.ownerSlug,orgContext:t.orgContext}):V.jsx(cm,{value:e,prop:r.prop})}function Ex({field:r,control:e,labelId:t}){const n=GB(r.prop);return V.jsxs("span",{className:"flex min-w-0 flex-wrap items-center gap-x-1 gap-y-0.5",children:[V.jsx("span",{id:t,className:"min-w-0 break-words",children:pm(r)}),n?V.jsxs(kI,{children:[V.jsx(OI,{asChild:!0,children:V.jsx("button",{type:"button",className:"shrink-0 text-muted-foreground/70 hover:text-foreground","aria-label":`About ${pm(r)}: ${n}`,children:V.jsx(cB,{className:"h-3 w-3"})})}),V.jsx(NI,{className:"max-w-xs",children:n})]}):null,e?V.jsx(HB,{control:e}):null]})}function HI({field:r,value:e,context:t,nested:n}){const a=ze.useId(),i=n?void 0:t.controls?.[r.key],o=FI(e);if(zI(r.prop)&&(o==null||gm(o))){const s=gm(o)?o:{},l=GI(F_(r.prop.properties).map(([u,f])=>({key:u,prop:f})),s);return V.jsxs("fieldset",{"aria-labelledby":a,className:"m-0 min-w-0 space-y-2 border-0 p-0",children:[V.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:V.jsx(Ex,{field:r,control:i,labelId:a})}),V.jsx("dl",{className:"space-y-2 border-l border-border pl-3",children:l.map(u=>V.jsx(HI,{field:u,value:s[u.key],context:t,nested:!0},u.key))})]})}return V.jsxs("div",{className:"grid grid-cols-[minmax(0,2fr)_minmax(0,3fr)] items-baseline gap-x-3",children:[V.jsx("dt",{className:"text-muted-foreground",children:V.jsx(Ex,{field:r,control:i,labelId:a})}),V.jsx("dd",{"aria-labelledby":a,className:pd("min-w-0 [overflow-wrap:anywhere]",r.numeric&&"tabular-nums"),children:V.jsx(qB,{field:r,value:o,context:t})})]})}function KB({fields:r,values:e,context:t,fieldLimit:n}){const a=GI(r,e);return a.length===0?V.jsx("p",{className:"text-sm text-muted-foreground",children:r.length===0?"This type declares no fields.":"No details have been added yet."}):V.jsx(lB,{delayDuration:200,children:V.jsx("dl",{className:"space-y-2.5 text-sm leading-5",children:(n===void 0?a:a.slice(0,n)).map(i=>V.jsx(HI,{field:i,value:e[i.key],context:t,nested:!1},i.key))})})}function JB(r,e){if(typeof r!="string"||!e||e.length===0)return r;const t=r.trim();if(e.includes(t))return t;try{const n=JSON.parse(t);if(typeof n=="string"&&e.includes(n))return n}catch{}return r}function QB(r,e){if(!r)return{};const t=e?.properties;return t?Object.fromEntries(Object.entries(r).map(([n,a])=>[n,JB(a,t[n]?.enum)])):{...r}}function Wne(r){return{href:"",key:`record-peer:${r.record?JSON.stringify([r.record.type,r.record.key]):r.entityId}`,title:r.name?.trim()||"Record",recordPeer:{...r.record?{record:r.record}:{entityId:r.entityId},ownerSlug:r.ownerSlug,orgContext:r.orgContext}}}function $ne({target:r}){const e=pB(),t=gB(),n=yB(r.entityId,r.orgContext),a=r.record?vm(r.ownerSlug,[{entity_type:r.record.type,slug:r.record.key}]):"",i=BI(a,r.orgContext),o=r.record?i.data?.entity:n.data,{isLoading:s,isError:l}=r.record?i:n,{data:u}=mB(o?.entity_type??"",r.orgContext),[f,v]=ze.useState(!1),[c,h]=ze.useState(!1);if(s)return V.jsxs("div",{className:"space-y-3 px-5 py-5",children:[V.jsx(pp,{className:"h-5 w-2/3"}),V.jsx(pp,{className:"h-4 w-full"}),V.jsx(pp,{className:"h-4 w-full"})]});if(l||!o)return V.jsx("p",{className:"px-5 py-5 text-sm text-muted-foreground",children:"This record is not available. It may have been deleted, or you may not have access to it."});const d=u?.metadata_schema,p=async()=>{v(!0),h(!1);try{const g=r.record?[{entity_type:r.record.type,slug:r.record.key}]:await SB(r.entityId,r.orgContext);t?.close(),await e({to:vm(r.ownerSlug,g)})}catch{h(!0)}finally{v(!1)}};return V.jsxs("article",{className:"space-y-4 px-5 py-4",children:[V.jsxs("div",{className:"flex items-start justify-between gap-3",children:[V.jsxs("div",{className:"min-w-0",children:[V.jsx("p",{className:"truncate text-sm font-medium",children:o.name}),V.jsx("p",{className:"text-xs text-muted-foreground",children:u?.name??o.entity_type})]}),V.jsxs(Wu,{type:"button",variant:"ghost",size:"sm",className:"h-7 shrink-0 gap-1 px-2 text-muted-foreground hover:text-foreground",disabled:f,"aria-busy":f,onClick:()=>void p(),children:["Open record",V.jsx(_B,{className:"h-3.5 w-3.5"})]})]}),c?V.jsx("p",{role:"alert",className:"text-xs text-destructive",children:"Could not open this record. Try again."}):null,V.jsx(KB,{fields:YB(d),values:QB(o.metadata??{},d),context:{ownerSlug:r.ownerSlug,orgContext:r.orgContext}})]})}const eV=r=>r!=null;function tV(r,e,t=eV){let n=r;for(const a of e.replace(/\[(\d+)\]/g,".$1").split(".")){if(!t(n))return;n=n[a]}return n}function rV(r,e,t){return typeof r!="string"?r:r.startsWith("@")?e?.[r.slice(1)]:r.startsWith("{{")&&r.endsWith("}}")&&r.indexOf("}}")===r.length-2?t(r.slice(2,-2).trim()):r.replace(/\{\{(.+?)\}\}/g,(n,a)=>{const i=t(a.trim());return i===void 0?"":String(i)})}const nV=new Set(["type","children","props","path","fallback","key"]);function aV(r,e){const t={};for(const[n,a]of Object.entries(r))nV.has(n)||(t[n]=a);return Object.assign(t,e)}/*! *****************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -93,4 +93,4 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
93
93
|
* @license MIT
|
|
94
94
|
*/function sm(r,e){return r?Tne(r)?ze.createElement(r,e):r:null}function Tne(r){return Ane(r)||typeof r=="function"||Mne(r)}function Ane(r){return typeof r=="function"&&(()=>{const e=Object.getPrototypeOf(r);return e.prototype&&e.prototype.isReactComponent})()}function Mne(r){return typeof r=="object"&&typeof r.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(r.$$typeof.description)}function Dne(r){const e={state:{},onStateChange:()=>{},renderFallbackValue:null,...r},[t]=ze.useState(()=>({current:Sne(e)})),[n,a]=ze.useState(()=>t.current.initialState);return t.current.setOptions(i=>({...i,...r,state:{...n,...r.state},onStateChange:o=>{a(o),r.onStateChange==null||r.onStateChange(o)}})),t.current}const PI=12;function lm(r){return!!r&&typeof r=="object"&&!Array.isArray(r)}function um(r){return r.replace(/[_-]+/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function Ine(r){try{return JSON.stringify(r,null,2)}catch{return String(r)}}function $i(r){return r===null?"null":r===void 0?"—":typeof r=="string"?r:typeof r=="number"||typeof r=="boolean"?String(r):Ine(r)}const RI=({value:r,openLink:e})=>{if(!hm(r))return V.jsx("span",{className:"break-words",children:r});let t=r;try{const n=new URL(r);t=`${n.host}${n.pathname==="/"?"":n.pathname}`}catch{}return V.jsxs(Wu,{type:"button",variant:"ghost",size:"sm",className:"h-auto max-w-full justify-start px-1 py-0 text-left font-normal text-xs",onClick:()=>e(r),children:[V.jsx(VI,{className:"mr-1 h-3 w-3 shrink-0"}),V.jsx("span",{className:"truncate",children:t})]})};function Lne({page:r,pageCount:e,onChange:t}){return V.jsxs("div",{className:"mt-2 flex items-center justify-end gap-1.5",children:[V.jsxs(Wu,{type:"button",size:"sm",variant:"outline",disabled:r===0,onClick:()=>t(r-1),children:[V.jsx(CB,{className:"h-3.5 w-3.5"}),V.jsx("span",{className:"sr-only",children:"Previous page"})]}),V.jsxs("span",{className:"text-muted-foreground text-xs",children:[r+1," / ",e]}),V.jsxs(Wu,{type:"button",size:"sm",variant:"outline",disabled:r+1>=e,onClick:()=>t(r+1),children:[V.jsx(TB,{className:"h-3.5 w-3.5"}),V.jsx("span",{className:"sr-only",children:"Next page"})]})]})}function Pne({rows:r,columns:e,openLink:t,stateKey:n="table",viewState:a,onViewStateChange:i,renderCell:o,renderStructuredValue:s,pageSize:l}){const u=ze.useMemo(()=>e?null:[...new Set(r.flatMap(L=>Object.keys(L)))],[e,r]),f=ze.useMemo(()=>e?.map(L=>L.name)??(u??[]).slice(0,PI),[e,u]),v=u?u.slice(PI):[],c=a?.[`${n}.sort.column`],h=a?.[`${n}.sort.desc`],d=typeof c=="string"&&c?[{id:c,desc:h===!0}]:[],[p,g]=ze.useState(d),[y,m]=ze.useState(null);ze.useEffect(()=>{g(d)},[c,h]);function _(L){const I=new Set(f);return Object.keys(L).filter(P=>!I.has(P))}const S=ze.useMemo(()=>f.map(L=>({id:L,accessorFn:I=>I[L],header:um(L),enableSorting:L!=="open",sortDescFirst:!1,sortingFn:(I,P,R)=>{const E=I.getValue(R),O=P.getValue(R);return typeof E=="number"&&typeof O=="number"?E-O:$i(E).localeCompare($i(O),void 0,{numeric:!0,sensitivity:"base"})},cell:({getValue:I,row:P})=>{const R=I(),E=P.index===y;if(lm(R)||Array.isArray(R))return E?V.jsx("div",{className:"max-w-md break-words",children:s?s(R,t):$i(R)}):V.jsx("span",{className:"text-muted-foreground",children:Array.isArray(R)?"[…]":"{…}"});const O=o?.(R,L);if(O!=null)return O;if(L==="open"&&typeof R=="string")return V.jsxs(Wu,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2",onClick:z=>{z.stopPropagation(),t(R)},children:[V.jsx(VI,{className:"mr-1 h-3.5 w-3.5"}),"Open"]});if(typeof R=="string"&&hm(R))return V.jsx(RI,{value:R,openLink:t});if(E)return V.jsx("span",{className:"break-words whitespace-pre-wrap",children:$i(R)});const k=$i(R);return V.jsx("span",{className:"block max-w-80 truncate",title:k,children:k})}})),[f,t,y,o,s]),x=a?.[`${n}.page`],[w,b]=ze.useState(typeof x=="number"?Math.max(0,x):0);ze.useEffect(()=>{b(typeof x=="number"?Math.max(0,x):0)},[x]);const T=l?Math.max(1,Math.ceil(r.length/l)):1,C=typeof x=="number"?Math.max(0,x):w,A=Math.min(C,T-1),D=Dne({data:r,columns:S,state:{sorting:p,...l?{pagination:{pageIndex:A,pageSize:l}}:{}},onSortingChange:L=>{const I=typeof L=="function"?L(p):L;g(I),i?.(`${n}.sort.column`,I[0]?.id??""),i?.(`${n}.sort.desc`,I[0]?.desc??!1)},getCoreRowModel:xne(),getSortedRowModel:Cne(),...l?{getPaginationRowModel:bne(),onPaginationChange:L=>{const I=typeof L=="function"?L({pageIndex:A,pageSize:l}):L;b(I.pageIndex),i?.(`${n}.page`,I.pageIndex)}}:{}});return V.jsxs("div",{children:[V.jsx("div",{className:"overflow-hidden rounded-md border border-border/70",children:V.jsxs(OB,{className:"text-xs",children:[V.jsx(NB,{className:"bg-muted/50",children:D.getHeaderGroups().map(L=>V.jsx(gp,{className:"hover:bg-transparent",children:L.headers.map(I=>{const P=I.column.getIsSorted(),R=String(I.column.columnDef.header),E=I.column.getCanSort();return V.jsx(BB,{"aria-sort":E?P==="asc"?"ascending":P==="desc"?"descending":"none":void 0,className:"h-8 whitespace-nowrap px-2",children:E?V.jsxs("button",{type:"button","aria-label":`Sort by ${R}`,className:"flex w-full items-center gap-1.5 text-left",onClick:I.column.getToggleSortingHandler(),children:[sm(I.column.columnDef.header,I.getContext()),P==="asc"?V.jsx(xB,{className:"h-3 w-3"}):P==="desc"?V.jsx(wB,{className:"h-3 w-3"}):V.jsx(bB,{className:"h-3 w-3 opacity-45"})]}):sm(I.column.columnDef.header,I.getContext())},I.id)})},L.id))}),V.jsx(VB,{children:D.getRowModel().rows.map(L=>{const I=L.index===y,P=_(L.original),R=P.length>0||f.some(E=>{const O=L.original[E];return lm(O)||Array.isArray(O)});return V.jsxs(ze.Fragment,{children:[V.jsx(gp,{className:pd("transition-colors",R&&"cursor-pointer",I?"bg-muted/20":R&&"hover:bg-muted/30"),onClick:R?()=>m(I?null:L.index):void 0,children:L.getVisibleCells().map(E=>V.jsx(Rx,{className:"p-2 align-top",children:sm(E.column.columnDef.cell,E.getContext())},E.id))}),I&&P.length>0?V.jsx(gp,{className:"border-b last:border-b-0 bg-muted/10",children:V.jsx(Rx,{colSpan:L.getVisibleCells().length,className:"p-2",children:V.jsx("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1",children:P.map(E=>{const O=L.original[E];return V.jsxs("div",{children:[V.jsxs("span",{className:"text-muted-foreground capitalize",children:[um(E),":"]})," ",lm(O)||Array.isArray(O)?s?s(O,t):V.jsx("span",{className:"break-words whitespace-pre-wrap",children:$i(O)}):(()=>{const k=o?.(O,E);return k??(typeof O=="string"&&hm(O)?V.jsx(RI,{value:O,openLink:t}):V.jsx("span",{className:"break-words whitespace-pre-wrap",children:$i(O)}))})()]},E)})})})}):null]},L.id)})})]})}),v.length>0?V.jsxs("p",{className:"mt-2 text-muted-foreground text-xs",children:[v.length," additional"," ",v.length===1?"column":"columns"," available in expanded rows:"," ",v.slice(0,4).map(um).join(", "),v.length>4?`, +${v.length-4} more`:""]}):null,l&&T>1?V.jsx(Lne,{page:A,pageCount:T,onChange:L=>D.setPageIndex(L)}):null]})}function Rne(r,e,t){const n=e[0];let a=t;if(n&&typeof n=="object"&&!Array.isArray(n)){const i=n,o=i.currentTarget&&typeof i.currentTarget=="object"?i.currentTarget:i.target&&typeof i.target=="object"?i.target:null;o&&o.value!==void 0&&(o.value!==""||t==null)&&(a=o.value)}else(typeof n=="string"||typeof n=="number"||typeof n=="boolean")&&(a=n);return dm(r,a)}function fm(r,e,t){const n=r;return Array.isArray(n)?!e&&!t?n:n.map(a=>({label:String(a[e??"label"]??""),value:Number(a[t??"value"]??0)})):[]}function Ene(r,e,t){const n=r;return Array.isArray(n)?!e&&!t?n:n.map(a=>({name:String(a[e??"name"]??""),value:Number(a[t??"value"]??0)})):[]}const EI={div:({children:r,...e})=>V.jsx("div",{...e,children:r}),span:({children:r,...e})=>V.jsx("span",{...e,children:r}),p:({children:r,...e})=>V.jsx("p",{...e,children:r}),h1:({children:r,...e})=>V.jsx("h1",{...e,children:r}),h2:({children:r,...e})=>V.jsx("h2",{...e,children:r}),h3:({children:r,...e})=>V.jsx("h3",{...e,children:r}),h4:({children:r,...e})=>V.jsx("h4",{...e,children:r}),ul:({children:r,...e})=>V.jsx("ul",{...e,children:r}),ol:({children:r,...e})=>V.jsx("ol",{...e,children:r}),li:({children:r,...e})=>V.jsx("li",{...e,children:r}),table:({children:r,...e})=>V.jsx("table",{...e,children:r}),thead:({children:r,...e})=>V.jsx("thead",{...e,children:r}),tbody:({children:r,...e})=>V.jsx("tbody",{...e,children:r}),tr:({children:r,...e})=>V.jsx("tr",{...e,children:r}),th:({children:r,...e})=>V.jsx("th",{...e,children:r}),td:({children:r,...e})=>V.jsx("td",{...e,children:r}),card:({children:r,className:e,...t})=>V.jsx(kB,{className:e,...t,children:r}),"card-header":({children:r,className:e,...t})=>V.jsx(EB,{className:e,...t,children:r}),"card-title":({children:r,className:e,...t})=>V.jsx(RB,{asChild:!0,className:e,children:V.jsx("h3",{...t,children:r})}),"card-description":({children:r,className:e,...t})=>V.jsx(PB,{className:e,...t,children:r}),"card-content":({children:r,className:e,...t})=>V.jsx(LB,{className:e,...t,children:r}),badge:({children:r,className:e,variant:t="default",...n})=>{const a={default:"bg-primary text-primary-foreground",secondary:"bg-secondary text-secondary-foreground",destructive:"bg-destructive text-destructive-foreground",outline:"border border-input bg-background"},i=s=>typeof s=="string"?s.replace(/[_-]/g," ").replace(/\b\w/g,l=>l.toUpperCase()):typeof s=="number"||typeof s=="boolean"||s==null||DB.isValidElement(s)?s:Array.isArray(s)?s.map(i):String(s),o=i(r);return V.jsx("span",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold ${a[t]||a.default} ${e||""}`,...n,children:o})},button:({children:r,className:e,variant:t="default",type:n="button",label:a,...i})=>{const o={default:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground"};return V.jsx("button",{type:n,className:`inline-flex items-center justify-center rounded-md text-sm font-medium h-10 px-4 py-2 ${o[t]||o.default} ${e||""}`,...i,children:r??String(a??"")})},select:({className:r,label:e,placeholder:t,options:n,onChange:a,onSelect:i,...o})=>V.jsxs("label",{className:`flex flex-col gap-1 text-sm ${r||""}`,children:[e?V.jsx("span",{className:"font-medium",children:String(e)}):null,V.jsxs("select",{className:"h-10 rounded-md border border-input bg-background px-3",onChange:a??i,defaultValue:"",...o,children:[t?V.jsx("option",{value:"",disabled:!0,children:String(t)}):null,Array.isArray(n)?n.map(s=>{const l=s,u=String(l.value??l.label??"");return V.jsx("option",{value:u,children:String(l.label??u)},JSON.stringify(l))}):null]})]}),alert:({children:r,className:e,variant:t="default",...n})=>{const a={default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive"};return V.jsx("div",{role:"alert",className:`relative w-full rounded-lg border p-4 ${a[t]||a.default} ${e||""}`,...n,children:r})},"alert-title":({children:r,className:e,...t})=>V.jsx("h5",{className:`mb-1 font-medium leading-none tracking-tight ${e||""}`,...t,children:r}),"alert-description":({children:r,className:e,...t})=>V.jsx("div",{className:`text-sm [&_p]:leading-relaxed ${e||""}`,...t,children:r}),progress:({className:r,value:e=0,label:t,...n})=>{const a=Math.round(e);return V.jsxs("div",{className:`flex items-center gap-2 ${r||""}`,...n,children:[V.jsx("div",{className:"relative h-4 flex-1 overflow-hidden rounded-full bg-secondary",children:V.jsx("div",{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-a}%)`}})}),V.jsx("span",{className:"text-xs font-medium tabular-nums text-muted-foreground shrink-0",children:t?String(t):`${a}%`})]})},strong:({children:r,...e})=>V.jsx("strong",{...e,children:r}),b:({children:r,...e})=>V.jsx("strong",{...e,children:r}),em:({children:r,...e})=>V.jsx("em",{...e,children:r}),link:({children:r,className:e,href:t,...n})=>{const a=String(t??""),i=/^https?:\/\//i.test(a);return V.jsx("a",{href:a,className:`text-primary underline underline-offset-2 hover:no-underline ${e||""}`,...i?{target:"_blank",rel:"noreferrer"}:{},...n,children:r})},a:({children:r,className:e,href:t,...n})=>V.jsx("a",{href:String(t??""),className:`text-primary underline underline-offset-2 hover:no-underline ${e||""}`,...n,children:r}),context:({children:r,className:e,...t})=>V.jsx("div",{className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 text-xs text-muted-foreground ${e||""}`,...t,children:r}),fields:({children:r,className:e,...t})=>V.jsx("div",{className:`grid grid-cols-1 gap-x-6 gap-y-2 sm:grid-cols-2 ${e||""}`,...t,children:r}),field:({children:r,className:e,label:t,value:n,...a})=>V.jsxs("div",{className:`flex flex-col gap-0.5 ${e||""}`,...a,children:[V.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:String(t??"")}),V.jsx("span",{className:"text-sm break-words",children:r??(n==null?"—":String(n))})]}),separator:({className:r,...e})=>V.jsx("div",{className:`shrink-0 bg-border h-[1px] w-full ${r||""}`,...e}),markdown:({content:r,className:e})=>V.jsx("div",{className:`max-w-none text-sm space-y-2 ${e||""}`,children:V.jsx(MB,{text:String(r??"")})}),layout:({children:r,className:e,direction:t="vertical"})=>V.jsx("div",{className:`flex ${t==="horizontal"?"flex-row":"flex-col"} gap-4 ${e||""}`,children:r}),columns:({children:r,className:e})=>{const t=Array.isArray(r)?r.filter(n=>n!=null).length:r?1:0;return V.jsx("div",{className:`grid gap-4 ${e||""}`,style:{gridTemplateColumns:`repeat(${t}, minmax(0, 1fr))`},children:r})},metric:({label:r,value:e,className:t})=>V.jsxs("div",{className:pd(AB,"p-4",t),children:[V.jsx("p",{className:"text-sm text-muted-foreground",children:String(r??"")}),V.jsx("p",{className:"mt-1 text-2xl font-bold",children:String(e??"")})]}),"bar-chart":({data:r,height:e,xLabel:t,yLabel:n,labelField:a,valueField:i})=>V.jsx(Lre,{data:fm(r,a,i),height:e,xLabel:t,yLabel:n}),"line-chart":({data:r,height:e,xLabel:t,yLabel:n,labelField:a,valueField:i})=>V.jsx(Pre,{data:fm(r,a,i),height:e,xLabel:t,yLabel:n}),"area-chart":({data:r,height:e,xLabel:t,yLabel:n,labelField:a,valueField:i})=>V.jsx(Ire,{data:fm(r,a,i),height:e,xLabel:t,yLabel:n}),"pie-chart":({data:r,height:e,showLabel:t,showLegend:n,radius:a,highlightName:i,nameField:o,valueField:s})=>V.jsx(Rre,{data:Ene(r,o,s),height:e,showLabel:t,showLegend:n,radius:a,highlightName:i}),sparkline:({data:r,height:e,width:t,color:n,trend:a})=>V.jsx(Ere,{data:r,height:e,width:t,color:n,trend:a}),"stacked-area-chart":({data:r,series:e,height:t,xLabel:n,yLabel:a,onSeriesClick:i,onDateRangeSelect:o})=>V.jsx(kre,{data:r,series:e,height:t,xLabel:n,yLabel:a,onSeriesClick:i,onDateRangeSelect:o})},kne=new Set(["urgency","severity","sentiment","trend","status","priority"]),One={critical:"bg-red-500/15 text-red-400 border-red-500/30",high:"bg-orange-500/15 text-orange-400 border-orange-500/30",medium:"bg-yellow-500/15 text-yellow-400 border-yellow-500/30",low:"bg-green-500/15 text-green-400 border-green-500/30"};function Nne(r,e){if(r==null)return V.jsx("span",{className:"text-muted-foreground",children:"–"});const t=String(r);if(t.startsWith("http://")||t.startsWith("https://"))return V.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:e==="url"?"↗ Link":t});if(e==="subreddit"&&typeof r=="string")return V.jsxs("a",{href:`https://reddit.com/r/${r}`,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:["r/",r]});if(kne.has(e)&&typeof r=="string"){const n=One[r.toLowerCase()]??"bg-secondary text-secondary-foreground border-border",a=r.replace(/[_-]/g," ").replace(/\b\w/g,i=>i.toUpperCase());return V.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${n}`,children:a})}return typeof r=="number"?V.jsx("span",{className:"font-mono tabular-nums",children:r}):typeof r=="boolean"?V.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r?"bg-green-500/15 text-green-400 border-green-500/30":"bg-secondary text-secondary-foreground border-border"}`,children:r?"Yes":"No"}):V.jsx("span",{className:"whitespace-pre-wrap",children:t})}function Bne({rows:r,columns:e,title:t}){return V.jsxs("div",{className:"space-y-2",children:[t&&V.jsx("h4",{className:"text-sm font-semibold",children:t}),V.jsx(Pne,{rows:r,columns:e.map(n=>({name:n})),openLink:()=>{},renderCell:(n,a)=>Nne(n,a)})]})}const wc=tV;function Du(r,e,t){if(r.type==="text")return r.content;if(r.type==="data"){const u=r,f=wc(e.data,u.path),v=f!==void 0?f:u.fallback,c=IB(v,u.format);if(c.length>100&&(c.includes(`
|
|
95
95
|
`)||/[#*-]/.test(c))){const h=EI.markdown;return h?V.jsx(h,{content:c}):c}return c}if(r.type==="if"){const u=r;return wc(e.data,u.condition)?Du(u.then,e,t):u.else?Du(u.else,e,t):null}if(r.type==="each"){const u=r,f=wc(e.data,u.items);return Array.isArray(f)?f.map((v,c)=>{const h=u.as,d={...e,data:{...e.data,[h]:v,[`${h}Index`]:c}};if(typeof u.render=="string"){const p=`{{${h}}}`,g=typeof v=="string"?v:JSON.stringify(v);return u.render.split(p).join(g)}return Du(u.render,d,c)}):null}const n=r,a=e.components?.[n.type]??EI[n.type];if(!a)return console.warn(`Unknown component type: ${n.type}`),null;const i=u=>rV(u,e.actions,f=>wc(e.data,f)),o=aV(r,n.props),s={};for(const[u,f]of Object.entries(o)){if(/^on[A-Z]/.test(u))continue;const v=i(f);s[u]=v}for(const[u,f]of Object.entries(o)){if(!/^on[A-Z]/.test(u))continue;if(e.actionsDisabled){s.disabled=!0;continue}let v=i(f);if(typeof v!="function"&&e.onAction){const c=dm(f,s.value);c&&e.interactions?.[c.action]&&(v=(...h)=>e.onAction?.(Rne(f,h,s.value)??c))}if(typeof v!="function"){dm(f,s.value)&&(s.disabled=!0),f!==void 0&&console.warn(`Ignoring non-function handler for "${u}" (got ${typeof v}). Bind actions as "@actionName".`);continue}s[u]=v}if(n.type==="table"&&Array.isArray(s.data)&&Array.isArray(s.columns)){const u=s.data,f=s.columns,v=s.title;return V.jsx(Bne,{rows:u,columns:f,title:v},t)}const l=n.children?.map((u,f)=>Du(u,e,f));return V.jsx(a,{...s,children:l},t)}function Vne(r,e,t,n,a,i,o){const s={data:e,actions:t,onAction:n,interactions:a,components:i,actionsDisabled:o};return Du(r.root,s)}function Yne({template:r,data:e,actions:t,onAction:n,interactions:a,components:i,actionsDisabled:o}){return V.jsx(V.Fragment,{children:Vne(r,e,t,n,a,i,o)})}export{HB as F,Yne as J,bl as L,KB as R,Ere as S,Pre as a,Dne as b,YB as c,FB as d,WB as e,sm as f,xne as g,GB as h,zB as i,UB as j,$ne as k,Wne as l,QB as m,JB as n,GI as o,Une as p,$B as q,qB as r,pm as s,Mx as u};
|
|
96
|
-
//# sourceMappingURL=renderer-
|
|
96
|
+
//# sourceMappingURL=renderer-ucwCQmBk.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=reset-password-
|
|
1
|
+
import{a9 as v,r as a,j as e,L as h,aa as j,$ as y,ab as N}from"./index-C2TCKJDP.js";import{C as k,a as C,b as S,c as L}from"./card-rE4Ctuy6.js";function R(){const{token:n,error:x}=v.useSearch(),[o,p]=a.useState(""),[i,f]=a.useState(""),[d,s]=a.useState(null),[l,c]=a.useState(!1),[u,g]=a.useState(!1),w=async t=>{if(t.preventDefault(),!n){s("This reset link is invalid or expired.");return}if(o.length<8){s("Password must be at least 8 characters.");return}if(o!==i){s("Passwords do not match.");return}c(!0),s(null);try{const r=await j(`${y}/api/auth/reset-password`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({token:n,newPassword:o})});if(!r.ok)throw await N(r);g(!0)}catch(r){s(r instanceof Error?r.message:"Failed to reset password")}finally{c(!1)}},b=!n||x==="INVALID_TOKEN",m={callbackUrl:void 0,mode:void 0,error:void 0,errorDescription:void 0,loginHint:void 0,invitationOrg:void 0,intent:void 0};return e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center",children:e.jsxs("div",{className:"w-full max-w-md p-8",children:[e.jsx("img",{src:"/lobu-logo.svg",alt:"Lobu",className:"mx-auto mb-6 h-8 w-auto"}),e.jsxs(k,{children:[e.jsx(C,{children:e.jsx(S,{asChild:!0,children:e.jsx("h1",{className:"text-center text-2xl",children:"Reset your password"})})}),e.jsx(L,{children:b&&!u?e.jsxs("div",{className:"mt-6 space-y-4 text-center",children:[e.jsx("p",{className:"text-sm text-destructive",children:"This reset link is invalid or expired."}),e.jsx(h,{to:"/auth/login",search:m,className:"text-sm text-primary hover:underline",children:"Back to sign in"})]}):u?e.jsxs("div",{className:"mt-6 space-y-4 text-center",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your password has been reset successfully."}),e.jsx(h,{to:"/auth/login",search:m,className:"text-sm text-primary hover:underline",children:"Continue to sign in"})]}):e.jsxs("form",{onSubmit:w,className:"mt-6 space-y-4",children:[d&&e.jsx("div",{className:"p-3 text-sm text-destructive bg-destructive/10 rounded-lg",children:d}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"new-password",className:"block text-sm font-medium",children:"New password"}),e.jsx("input",{id:"new-password",type:"password",value:o,onChange:t=>p(t.target.value),minLength:8,required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"confirm-password",className:"block text-sm font-medium",children:"Confirm new password"}),e.jsx("input",{id:"confirm-password",type:"password",value:i,onChange:t=>f(t.target.value),minLength:8,required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsx("button",{type:"submit",disabled:l,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:l?"Resetting password...":"Reset password"})]})})]})]})})}export{R as component};
|
|
2
|
+
//# sourceMappingURL=reset-password-BkiAmXZW.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{fe as M,ff as w,fg as k,f2 as L,r as h,j as n,m as j,b0 as S,d_ as A,ai as C,B as I,dO as R,G as D,eH as E,L as _,em as T}from"./index-C2TCKJDP.js";import{a as O}from"./list-skeleton-bQAZ0hQp.js";import{s as F}from"./subDays-DwIOMzYC.js";import{u as Y}from"./use-automations-lV8PuE8L.js";import{u as z}from"./clients-CydgUHrc.js";function B(e,s){return M(k(e,e),w(e))}function V(e,s){return L(k(e,e),w(e))}function q(e,s){return L(k(e,e),F(w(e),1))}function G({onIntersect:e,onLeave:s,enabled:t,rootMargin:r="400px"}){const a=h.useRef(null),o=h.useRef(e);o.current=e;const u=h.useRef(s);return u.current=s,h.useEffect(()=>{const c=a.current;if(!c||!t)return;const f=new IntersectionObserver(l=>{l[0]?.isIntersecting?o.current():u.current?.()},{rootMargin:r});return f.observe(c),()=>f.disconnect()},[t,r]),a}function H({groupByDate:e=!0}){return n.jsx("div",{role:"status","aria-label":"Loading activity","aria-busy":"true",children:n.jsxs("div",{"aria-hidden":"true",children:[e?n.jsx("div",{className:"px-3 pb-2",children:n.jsx(j,{className:"h-4 w-28 rounded-none"})}):null,["first","second","third","fourth","fifth"].map(s=>n.jsxs("div",{className:"flex items-start gap-3 px-3 py-3",children:[n.jsx(j,{className:"h-8 w-8 shrink-0 rounded-none"}),n.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[n.jsx(j,{className:"h-4 w-3/5 max-w-sm rounded-none"}),n.jsxs("div",{className:"flex gap-3",children:[n.jsx(j,{className:"h-3 w-20 rounded-none"}),n.jsx(j,{className:"h-3 w-12 rounded-none"})]})]})]},s))]})})}function $(e){if(e==null||e==="")return null;const s=new Date(e);return Number.isNaN(s.getTime())?null:R(s,"d MMMM yyyy")}function U(e){if(e==null||e==="")return null;const s=new Date(e);return Number.isNaN(s.getTime())?null:V(s)?"Today":q(s)?"Yesterday":R(s,B(s)?"d MMM":"d MMM yyyy")}function W({items:e}){const s=[];for(const t of e){const r=U(t.occurredAt)??"Undated",a=s.at(-1);a?.day===r?a.items.push(t):s.push({day:r,items:[t]})}return n.jsx(n.Fragment,{children:s.map(({day:t,items:r},a)=>n.jsxs("section",{"aria-label":t,className:"min-w-0",children:[n.jsx("div",{className:a===0?"px-1 pb-1.5":"px-1 pt-4 pb-1.5",children:n.jsx("h2",{className:"text-sm font-semibold",children:t})}),n.jsx("ul",{className:"divide-y overflow-hidden rounded-lg border",children:r.map(o=>n.jsx("li",{children:o.content},o.key))})]},`${t}:${a}`))})}const X=3;function se({items:e,isLoading:s,emptyState:t,hasNextPage:r,isFetching:a,isFetchingNextPage:o,onLoadMore:u,autoLoadMore:c=!0,groupByDate:f=!0,rows:l=!1}){const[g,x]=h.useState(0),N=g>=X,b=G({onIntersect:()=>{x(i=>i+1),u()},onLeave:()=>x(0),enabled:c&&r&&!a&&!N}),y=()=>{x(0),u()};return s&&e.length===0?l?n.jsx("div",{role:"status","aria-label":"Loading activity",className:"divide-y overflow-hidden rounded-lg border",children:[0,1,2,3].map(i=>n.jsx(O,{},i))}):n.jsx(H,{groupByDate:f}):n.jsxs("div",{children:[e.length===0?r?null:t!==void 0?t:n.jsx(S,{icon:A,title:"Nothing here yet",description:"No events match this view."}):l?n.jsx(W,{items:e}):e.map((i,m)=>{const p=$(i.occurredAt),v=m>0?$(e[m-1].occurredAt):null;return n.jsxs(h.Fragment,{children:[f&&p&&p!==v&&n.jsx("p",{className:"px-3 pb-2 pt-4 text-xs text-muted-foreground first:pt-0",children:p}),n.jsx("div",{className:"mb-1",children:i.content})]},i.key)}),n.jsx("div",{ref:b,className:"h-1"}),o?n.jsx("div",{role:"status","aria-label":"Loading earlier activity",className:"flex justify-center py-3",children:n.jsx(C,{className:"text-muted-foreground"})}):r?c?N?n.jsx("div",{className:"flex justify-center py-3",children:n.jsx(I,{variant:"link",size:"sm",className:"h-auto p-0 text-xs font-normal text-muted-foreground",disabled:a,onClick:y,children:"Show earlier activity"})}):null:n.jsx(I,{size:"sm",variant:"outline",className:l?"mt-3":void 0,disabled:a,onClick:y,children:"Load more"}):null]})}function J(e,s,t){return e?.kind==="agent_session"&&e.agent_id?e.client_id?`${e.agent_id} via ${e.client_id}`:e.agent_id:e?.kind==="user"?"a person":s==="agent"?"an agent":t?`Automation ${t}`:"an Automation"}function ne({ownerSlug:e,initiator:s,clientName:t,fallback:r}){const a=s?.client_id??t,{allOrgs:o,isAuthenticated:u}=D(),c=u&&o?.some(d=>d.slug===e),l=z(void 0,{ownerSlug:e,enabled:!!(a&&c)}).data?.find(d=>d.id===a)?.title,g=c?o.find(d=>d.slug===e)?.id:void 0,x=s?.kind==="automation"&&s.automation_id?String(s.automation_id):void 0,b=Y(x?g:void 0,void 0,{includeDetails:!1}).data?.find(d=>d.automation_id===x)?.name,{members:y}=E(s?.kind==="user"&&s.user_id?g:void 0),i=y.find(d=>d.userId===s?.user_id)?.user.name,m=s&&s.kind!=="user"?b??J(s,void 0,s.automation_id===void 0?void 0:String(s.automation_id)):i??r,p="font-medium text-foreground",v=`${p} underline-offset-4 hover:underline`;return s?.kind==="automation"&&s.automation_id?n.jsx(_,{to:"/$owner/automations/$automationId",params:{owner:e,automationId:String(s.automation_id)},search:{view:"definition",run_id:void 0},className:v,children:m}):s?.kind==="agent_session"&&s.agent_id?n.jsx(_,{to:"/$owner/agents/$agentId",params:{owner:e,agentId:String(s.agent_id)},className:v,children:m}):a?n.jsxs(_,{to:"/$owner/agents/connected/$clientId",params:{owner:e,clientId:a},className:`${v} inline-flex items-center gap-1 align-middle`,children:[n.jsx(T,{name:l??t??a}),l??m]}):n.jsx("span",{className:p,children:m})}export{H as E,ne as R,se as a,B as b,V as i,J as p};
|
|
2
|
+
//# sourceMappingURL=run-initiator-8vdkq-3o.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=runs-
|
|
1
|
+
import{fr as r,cP as s,cQ as c,cC as l,aa as g,fs as f}from"./index-C2TCKJDP.js";const I=30,_=new Set(["running","pending","claimed"]);function m(n){return"workspace"in n?["workspace"]:"connectionId"in n?["connection",n.connectionId]:"deviceId"in n?["device",n.deviceId]:"connectorKey"in n?["connector",n.connectorKey]:["feed",n.feedId]}function y(n){return"workspace"in n?{}:"connectionId"in n?{connection_ids:[n.connectionId]}:"deviceId"in n?{device_worker_id:n.deviceId}:"connectorKey"in n?{connector_key:n.connectorKey}:{feed_ids:[n.feedId]}}function v(n,e,i){return r({queryKey:["runs-infinite",i??null,n?m(n):null,e.runTypes??null,e.status??null,e.automationIds??null,e.connectionIds??null,e.feedIds??null],queryFn:async({pageParam:t})=>{const a=t;return s("manage_operations",{action:"list_runs",...y(n),...e.runTypes&&e.runTypes.length>0?{run_types:e.runTypes}:{},...e.status?{status:e.status}:{},...e.automationIds?.length?{automation_ids:e.automationIds}:{},...e.connectionIds?.length?{connection_ids:e.connectionIds}:{},...e.feedIds?.length?{feed_ids:e.feedIds}:{},...a?{before_id:a.before_id,before_created_at:a.before_created_at}:{},limit:I},i?{slug:i}:void 0)},initialPageParam:null,getNextPageParam:t=>{if(!t.has_more)return;const a=t.runs[t.runs.length-1];if(a)return{before_id:a.id,before_created_at:a.created_at}},refetchInterval:t=>(t.state.data?.pages??[]).some(d=>d.runs.some(u=>_.has(u.status)))?5e3:!1,enabled:!!n,staleTime:15e3})}function p(n,e){return n.kind==="agent"?n.agentId?`/${n.agentId}/config/pending/${e}`:null:n.agentId&&n.automationId?`/${n.agentId}/automations/${n.automationId}/pending/${e}`:null}function P(n,e){const{slug:i}=c(),t=e!=null?p(n,e):null,a=n.kind==="agent"?["agent",n.agentId]:["automation",n.agentId,n.automationId];return l({queryKey:["pending-proposal",i,...a,e],queryFn:async()=>{const o=await g(f(i,t),{credentials:"include"});if(o.status===404)return{status:"gone"};if(!o.ok)throw new Error(`Failed to fetch pending proposal: ${o.status}`);return{status:"pending",proposal:await o.json()}},enabled:!!i&&!!t&&!!e,staleTime:0,retry:!1})}export{P as a,v as u};
|
|
2
|
+
//# sourceMappingURL=runs-B_iywKWb.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as t,B as k,L as v,da as B,i as h,cH as D,cI as F,cK as M,hJ as A,hK as I,u as K,hL as p,hM as E,b4 as y,ba as w,eA as O,r as x,e3 as N,e4 as b,e7 as C,eE as P,aq as V,ai as z,hN as J,hO as U,hP as _,b5 as q,C as G,dO as H}from"./index-C2TCKJDP.js";import{R as Q,a as W}from"./run-initiator-8vdkq-3o.js";function X(e,s){switch(s.kind){case"connection":return I(e,s.id);case"feed":return A(e,s.id);case"run":return{to:"/$owner/events",params:{owner:e},search:{run_ids:String(s.id)}}}}function Y({ownerSlug:e,scope:s,variant:n="outline",iconOnly:a=!1,label:o,className:c,title:i}){const l=X(e,s),r=i??o??"View in memory",u=t.jsx(k,{asChild:!0,variant:n,size:a?"icon":"sm",className:h(a&&"h-7 w-7",c),children:t.jsxs(v,{to:l.to,params:l.params,search:l.search,children:[t.jsx(B,{className:h("h-3.5 w-3.5",!a&&"mr-1.5")}),!a&&(o??"View in memory")]})});return a?t.jsxs(D,{children:[t.jsx(F,{asChild:!0,children:u}),t.jsx(M,{children:r})]}):u}function Z({status:e}){return e==="completed"?t.jsx(P,{className:"h-4 w-4 text-green-500"}):e==="failed"?t.jsx(V,{className:"h-4 w-4 text-destructive"}):e==="running"?t.jsx(z,{className:"text-blue-500"}):t.jsx(J,{className:"h-4 w-4 text-muted-foreground"})}const ee={completed:"Completed",failed:"Failed",running:"Running",pending:"Queued",claimed:"Starting",timeout:"Timed out",cancelled:"Cancelled"};function $(e){const s=e.split("_").join(" ");return s.charAt(0).toUpperCase()+s.slice(1)}function te({error:e}){const[s,n]=x.useState(!1);return e.length<=80?t.jsx("span",{className:"text-destructive",children:e}):t.jsxs(N,{open:s,onOpenChange:n,children:[t.jsx(b,{asChild:!0,children:t.jsx("button",{type:"button",className:"text-left text-destructive hover:underline",children:e})}),t.jsx(C,{className:"max-h-64 w-96 overflow-auto",children:t.jsx("pre",{className:"whitespace-pre-wrap break-words text-xs text-destructive",children:e})})]})}function se({checkpoint:e}){return t.jsxs(N,{children:[t.jsx(b,{asChild:!0,children:t.jsx(k,{variant:"ghost",size:"icon",title:"Checkpoint","aria-label":"Checkpoint",className:"size-8 shrink-0 text-muted-foreground hover:text-foreground",children:t.jsx(U,{className:"h-4 w-4","aria-hidden":"true"})})}),t.jsx(C,{className:"max-h-64 w-80 overflow-auto",children:t.jsx("pre",{className:"whitespace-pre-wrap break-words text-xs",children:JSON.stringify(e,null,2)})})]})}function R(e){if(e.initiator_kind)return{kind:e.initiator_kind,...e.initiator_ref};if(e.automation_id)return{kind:"automation",automation_id:e.automation_id};if(e.created_by_user_id)return{kind:"user",user_id:e.created_by_user_id}}function ne({run:e,ownerSlug:s}){const n=R(e);return n?n.kind==="system"?t.jsx(t.Fragment,{children:"by the system"}):t.jsxs(t.Fragment,{children:["by"," ",t.jsx(Q,{ownerSlug:s,initiator:n,clientName:void 0,fallback:"a person"})]}):null}function ie({parts:e}){return t.jsx(t.Fragment,{children:e.map(([s,n],a)=>t.jsxs(x.Fragment,{children:[a>0?" · ":"",n]},s))})}function j(e,s){return[e.run_type?$(e.run_type):"Run",s.connection?e.connection_display_name:null,s.feed?e.feed_display_name??e.feed_key:null].filter(Boolean).join(" · ")}const ae=3;function g(e,s){const n=p(e.created_at);return e.status==="completed"&&n!=null?`${j(e,s)}|${H(n,"yyyy-MM-dd")}`:null}function re(e,s){const n=new Map;for(const c of e){const i=g(c,s);i&&n.set(i,[...n.get(i)??[],c])}const a=[],o=new Set;for(const c of e){const i=g(c,s),l=i?n.get(i):void 0;!i||!l||l.length<ae?a.push({kind:"run",run:c}):o.has(i)||(o.add(i),a.push({kind:"group",name:j(c,s),runs:l}))}return a}function oe({name:e,runs:s,ownerSlug:n,columns:a}){const[o,c]=x.useState(!1),i=p(s[0].created_at),l=p(s[s.length-1].created_at),r=Date.now(),u=s.reduce((m,T)=>m+(T.items_collected??0),0),d=l!=null?_(l,r):null,f=i!=null?_(i,r):null,S=d&&f&&d!==f?`${d}–${f}`:f;return t.jsxs("div",{children:[t.jsx("button",{type:"button","aria-expanded":o,onClick:()=>c(m=>!m),className:h(w,"rounded-lg transition-colors hover:bg-accent/40"),children:t.jsx(y,{mark:t.jsx(G,{"aria-hidden":"true",className:h("h-4 w-4 text-muted-foreground transition-transform",o&&"rotate-90")}),name:e,details:t.jsx(q,{parts:[`${s.length} runs`,S,"all completed",u>0?`${u} ${u===1?"item":"items"}`:null]}),at:i})}),o?t.jsx("div",{className:"ml-6 border-l pl-2",children:s.map(m=>t.jsx("div",{className:"mb-1",children:t.jsx(L,{run:m,ownerSlug:n,columns:a})},m.id))}):null]})}function L({run:e,ownerSlug:s,columns:n={}}){const a=K(),o=p(e.created_at),c=p(e.completed_at),i=o!=null&&c!=null?Math.round((c-o)/1e3):null,l=j(e,n),r=n.startedBy&&R(e)?t.jsx(ne,{run:e,ownerSlug:s}):null,u=[["status",ee[e.status]??$(e.status)],e.error_message?["error",t.jsx(te,{error:e.error_message},"error")]:null,e.items_collected!=null&&(e.run_type==="sync"||e.items_collected>0)?["items",`${e.items_collected} ${e.items_collected===1?"item":"items"}`]:null,i!=null?["duration",E(i)]:null,r?["by",r]:null,e.connector_version?["version",`v${e.connector_version}`]:null,["id",`#${e.id}`]].filter(d=>d!==null);return t.jsxs("article",{"aria-label":`Run #${e.id}`,title:O(e.created_at),className:"group relative flex items-center rounded-lg transition-colors hover:bg-accent/40",children:[t.jsx("div",{className:h(w,"min-w-0 flex-1"),children:t.jsx(y,{mark:t.jsx(Z,{status:e.status}),name:t.jsx(v,{to:"/$owner/events",params:{owner:s},search:{run_ids:String(e.id)},"aria-label":`${l} · Run #${e.id}`,className:"hover:underline",onClick:d=>{!a||d.button!==0||d.metaKey||d.ctrlKey||d.shiftKey||d.altKey||(d.preventDefault(),a.open({href:e.run_type==="automation"&&e.automation_id!=null?`/${s}/automations/${e.automation_id}?view=activity&run_id=${e.id}`:`/${s}/events?run_ids=${e.id}`,title:`Run #${e.id}`,runId:e.id}))},children:l}),tone:e.status==="failed"||e.status==="timeout"?"destructive":null,details:t.jsx(ie,{parts:u}),at:o,atClassName:"group-hover:invisible group-focus-within:invisible"})}),t.jsxs("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 items-center gap-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100",children:[e.checkpoint?t.jsx(se,{checkpoint:e.checkpoint}):null,t.jsx(Y,{ownerSlug:s,scope:{kind:"run",id:e.id},variant:"ghost",iconOnly:!0,title:"View events from this run"})]})]})}function de({runs:e,ownerSlug:s,columns:n={},emptyState:a,hasNextPage:o=!1,isFetching:c=!1,isFetchingNextPage:i=!1,onLoadMore:l=()=>{}}){return t.jsx(W,{items:re(e,n).map(r=>r.kind==="run"?{key:String(r.run.id),occurredAt:r.run.created_at,content:t.jsx(L,{run:r.run,ownerSlug:s,columns:n})}:{key:`group:${r.runs[0].id}`,occurredAt:r.runs[0].created_at,content:t.jsx(oe,{name:r.name,runs:r.runs,ownerSlug:s,columns:n})}),isLoading:!1,emptyState:a,hasNextPage:o,isFetching:c,isFetchingNextPage:i,onLoadMore:l})}export{L as R,Y as V,de as a};
|
|
2
|
+
//# sourceMappingURL=runs-list-CJJFRhTl.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{G as u,cr as l,j as t,bH as c,bT as m,cs as x}from"./index-C2TCKJDP.js";import{E as a}from"./entity-type-page-CouHZbc9.js";function T({slug:r,onClose:s}){const{orgContext:e}=u(),{data:i=[],isLoading:o,isError:y}=l(e);if(r===null)return t.jsx(a,{entityType:null,orgContext:e,onClose:s,compact:!0});if(o)return t.jsx(c,{label:"entity type",variant:"panel"});if(y)return t.jsx(m,{label:"entity type"});const n=i.find(p=>p.slug===r)??null;return n?t.jsx(a,{entityType:n,orgContext:e,hideDelete:x(n),onClose:s,compact:!0}):t.jsx("p",{className:"text-sm text-muted-foreground",children:"Entity type not found."})}export{T as S};
|
|
2
|
+
//# sourceMappingURL=schema-type-editor-panel-C4e8pq1A.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{j as i,
|
|
2
|
-
`):JSON.stringify(t):typeof t=="object"?Object.entries(t).filter(([,n])=>n!=null&&n!=="").map(([n,e])=>`${N(n)}: ${m(e)}`).join("; "):JSON.stringify(t)}function d(t,r){if(t==null)return"";if(typeof t=="boolean")return t?"Yes":"No";if(typeof t=="number")return r==="currency"?p(t):r===void 0||r==="text"?String(t):h(t);if(typeof t!="string")return m(t);switch(r){case"currency":return p(Number(t));case"date":return b(t);case"url":return g(t);case"enum":return N(t);case"number":return h(Number(t));case"auto":return S(t)?g(t):T(t)?b(t):t;default:return t}}function E(t){return t==null?null:typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):null}function R(t,r){return typeof t!="string"||!t.startsWith("@")||t.length===1?null:{action:t.slice(1),value:E(r)}}function k(t){return i.jsx("a",{...t})}const
|
|
3
|
-
//# sourceMappingURL=schema-value-
|
|
1
|
+
import{j as i,dO as w,i as L,L as A,fB as D,fC as $}from"./index-C2TCKJDP.js";const O=/^\d{4}-\d{2}-\d{2}(?:[tT ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?)?$/,U=/^\d{4}-\d{2}-\d{2}$/;function T(t){return O.test(t)}function S(t){if(!/^https?:\/\//i.test(t))return!1;try{const r=new URL(t);return r.protocol==="http:"||r.protocol==="https:"}catch{return!1}}function N(t){return t.replace(/[-_]/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,r=>r.toUpperCase())}function p(t){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",notation:t>=1e3?"compact":"standard",maximumFractionDigits:t>=1e9?1:0}).format(t)}function h(t){return new Intl.NumberFormat("en-US",{maximumFractionDigits:Number.isInteger(t)?0:2}).format(t)}function b(t){const r=new Date(U.test(t)?`${t}T00:00:00`:t);return Number.isNaN(r.getTime())?t:r.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function g(t){try{const r=new URL(t),n=r.hostname.replace(/^www\./i,""),e=r.pathname&&r.pathname!=="/"?r.pathname.replace(/\/$/,""):"";return`${n}${e}`}catch{return t}}function m(t){return t==null?"":typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"?String(d(t)):Array.isArray(t)?t.some(r=>typeof r=="object"&&r!==null)?t.map((r,n)=>`${n+1}. ${m(r)}`).join(`
|
|
2
|
+
`):JSON.stringify(t):typeof t=="object"?Object.entries(t).filter(([,n])=>n!=null&&n!=="").map(([n,e])=>`${N(n)}: ${m(e)}`).join("; "):JSON.stringify(t)}function d(t,r){if(t==null)return"";if(typeof t=="boolean")return t?"Yes":"No";if(typeof t=="number")return r==="currency"?p(t):r===void 0||r==="text"?String(t):h(t);if(typeof t!="string")return m(t);switch(r){case"currency":return p(Number(t));case"date":return b(t);case"url":return g(t);case"enum":return N(t);case"number":return h(Number(t));case"auto":return S(t)?g(t):T(t)?b(t):t;default:return t}}function E(t){return t==null?null:typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):null}function R(t,r){return typeof t!="string"||!t.startsWith("@")||t.length===1?null:{action:t.slice(1),value:E(r)}}function k(t){return i.jsx("a",{...t})}const C=/^\d{4}-\d{2}-\d{2}$/;function F(t){if(C.test(t)){const[r,n,e]=t.split("-").map(Number),s=new Date(0);return s.setHours(0,0,0,0),s.setFullYear(r,n-1,e),s}return new Date(t)}function I(t,r){const n=F(t);return Number.isNaN(n.getTime())?t:r?n.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):w(n,"LLL dd, y")}function x(t){return t?t["x-currency"]||t.format==="currency"?"currency":t.format==="uri"||t.format==="url"?"url":t.enum?.length?"enum":t.type==="number"||t.type==="integer"?"number":t.type==="boolean"?"boolean":"auto":"auto"}function j(t){return t==null||t===""||Array.isArray(t)&&t.length===0}function V(t){return Array.isArray(t)&&t.some(r=>typeof r=="object"&&r!==null)}function _(t,r,n){const e=$(r,t);return e!==void 0?e:typeof t=="string"&&(r?.format==="date"||r?.format==="date-time")?I(t,r.format==="date-time"):d(t,n)}function y(t,r){return!r||t===null||typeof t!="object"?t:Array.isArray(t)?t.map(n=>y(n,r.items)):Object.fromEntries(Object.entries(t).filter(([n])=>!D(r.properties?.[n])).map(([n,e])=>[n,y(e,r.properties?.[n])]))}function l({value:t,prop:r,format:n,resolveLink:e,className:s}){const c=String(t),o=e?.(c);if(o)return i.jsx(A,{to:o.to,className:"text-primary hover:underline",onClick:a=>a.stopPropagation(),children:o.label});const u=typeof t=="string"&&S(t),f=n==="url"&&!u?c:_(t,r,n);return u?i.jsx(k,{href:t,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline [overflow-wrap:anywhere]",onClick:a=>a.stopPropagation(),children:f}):i.jsx("span",{className:s,children:f})}function Y({value:t,prop:r,format:n,resolveLink:e,empty:s="-",className:c}){if(j(t))return i.jsx("span",{className:"text-muted-foreground",children:s});if(V(t)){const o=t.length;return i.jsxs("span",{className:c,children:[o," ",o===1?"item":"items"]})}if(Array.isArray(t)){const o=t.filter(f=>!j(f)),u=r?.items??r;return i.jsx("span",{className:L("inline-flex flex-wrap gap-x-1",c),children:o.map((f,a)=>i.jsxs("span",{children:[i.jsx(l,{value:f,prop:u,format:n??x(u),resolveLink:e}),a<o.length-1&&","]},`${a}:${String(f)}`))})}return typeof t=="object"?i.jsx("span",{className:c,children:d(y(t,r))}):i.jsx(l,{value:t,prop:r,format:n??x(r),resolveLink:e,className:c})}export{Y as S,I as a,d as f,S as i,F as p,R as t};
|
|
3
|
+
//# sourceMappingURL=schema-value-CefbtPIY.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as t,L as m,A as p,n as u,d5 as x,x as f,r as h,dI as v}from"./index-C2TCKJDP.js";import{e as j,f as c,c as g}from"./event-kind-options-fHAIXu24.js";import{o as N,a as y,F}from"./filter-editors-DQ5V4Cvh.js";import{T as E}from"./home-toolbar-CpCcHA6z.js";function b(o,{platforms:e}={}){const{isMember:i}=u(),n=i?o:null,{data:a=[]}=x(n),{data:r=[]}=f(n?{organizationId:n}:void 0);return h.useMemo(()=>g({connectors:a,entityTypes:r,selectedPlatforms:e}),[a,r,e])}function L({owner:o,organizationId:e,activitySearch:i,kinds:n,onKindsChange:a,platforms:r}){const l=n??[],s=l.length>0?{semantic_types:l.join(",")}:{};return t.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[a?t.jsx(O,{organizationId:e,kinds:l,onKindsChange:a,platforms:r}):t.jsx("span",{className:"flex-1"}),t.jsxs(m,{to:"/$owner/events",params:{owner:o},search:{...i,...s},className:"inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:["Open in Activity",t.jsx(p,{"aria-hidden":"true",className:"h-3.5 w-3.5"})]})]})}function O({organizationId:o,kinds:e,onKindsChange:i,platforms:n}){const a=b(o,{platforms:n}),r={key:"kind",label:"Event kind",icon:t.jsx(v,{className:"h-4 w-4"}),editor:N({searchPlaceholder:"Search event kinds...",emptyText:"No event kinds found",options:j(a,e).map(s=>({value:s,label:c(s)})),selected:e,multiple:!0,onSelect:s=>i(e.includes(s)?e.filter(d=>d!==s):[...e,s])})},l=e.length>0?[{id:"kind",label:"Kind",value:e.length<=2?e.map(c).join(", "):`${e.length} kinds`,title:e.map(c).join(", "),onRemove:()=>i([])}]:[];return t.jsxs(t.Fragment,{children:[t.jsx(y,{label:"Feed filters",menu:!1,fields:[r],chips:l,className:"flex-1"}),t.jsx(F,{fields:[r],triggerClassName:E})]})}export{L as S};
|
|
2
|
+
//# sourceMappingURL=scoped-feed-bar-CapleZvS.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=settings-
|
|
1
|
+
import{z as l,j as e,B as i,L as t,J as c,ar as o,as as d}from"./index-C2TCKJDP.js";import{F as m}from"./full-page-spinner-B7A6Ycyi.js";function h(){const{session:a,isReady:n}=l();if(!n)return e.jsx(m,{});if(!a?.user)return e.jsxs("div",{className:"mx-auto w-full max-w-md space-y-4 px-4 py-8 text-center",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Account settings"}),e.jsx("p",{className:"text-muted-foreground",children:"Sign in to view your profile and account details."}),e.jsx(i,{asChild:!0,children:e.jsx(t,{to:"/auth/login",search:c({intent:"sign-in",callbackUrl:"/account/settings"}),children:"Sign in"})})]});const{user:s}=a,r=s.name?.trim()||"User";return e.jsx(o,{className:"py-8",children:e.jsxs(d,{className:"space-y-8",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h1",{className:"text-3xl font-semibold leading-tight",children:"Account settings"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your personal profile and sign-in details."})]}),e.jsxs("section",{"aria-labelledby":"account-profile-heading",className:"space-y-5 border-b border-border pb-8",children:[e.jsx("h2",{id:"account-profile-heading",className:"text-sm font-medium",children:"Profile"}),e.jsxs("div",{className:"flex min-w-0 items-center gap-4",children:[s.image?e.jsx("img",{src:s.image,alt:"",referrerPolicy:"no-referrer",className:"h-12 w-12 shrink-0 rounded-full object-cover"}):e.jsx("div",{"aria-hidden":"true",className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-muted text-lg font-medium",children:(s.name?.trim()||s.email||"U").charAt(0).toUpperCase()}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("p",{className:"break-words font-medium",children:r}),e.jsx("p",{className:"break-all text-sm text-muted-foreground",children:s.email})]})]}),e.jsxs("details",{className:"space-y-3",children:[e.jsx("summary",{className:"w-fit cursor-pointer rounded-sm text-sm text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:"Account details"}),e.jsxs("dl",{className:"space-y-1 text-sm",children:[e.jsx("dt",{className:"text-muted-foreground",children:"User ID"}),e.jsx("dd",{className:"break-all font-mono text-xs",children:s.id})]})]})]}),e.jsxs("section",{"aria-labelledby":"account-session-heading",className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{id:"account-session-heading",className:"text-sm font-medium",children:"Session"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Sign out of your account on this device."})]}),e.jsx(i,{variant:"outline",asChild:!0,children:e.jsx(t,{to:"/auth/logout",children:"Sign out"})})]})]})})}export{h as component};
|
|
2
|
+
//# sourceMappingURL=settings-DvzkRYQy.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{G as y,cC as b,fp as R,j as e,B as j,fq as v,m as _,bG as C,L,eV as F,I as E}from"./index-C2TCKJDP.js";import{a as $,R as P,b as S}from"./events-feed-DwOkLk6A.js";import{a as A}from"./run-initiator-8vdkq-3o.js";function f({failures:o,onRetry:c,isError:l=!1,isFetching:d=!1}){return o.length===0&&!l?null:e.jsxs("div",{role:"alert",className:"flex items-center justify-between gap-3 rounded-md border border-destructive/40 px-3 py-2 text-xs",children:[e.jsxs("span",{children:[o.length<=1?"A source":`${o.length} sources`," could not be read, so some items may be missing."]}),e.jsx(j,{size:"sm",variant:"outline",className:"h-7",onClick:c,disabled:d,children:"Retry"})]})}function z({record:o,orgContext:c,filters:l}){const{orgContext:d}=y(),t=c??d,{data:p}=b({queryKey:["connector-definitions","source-record",t.organizationId,t.slug],queryFn:()=>E(t),enabled:!!(t.organizationId||t.slug),staleTime:6e4}),{data:i,isLoading:u,isError:n,refetch:g,fetchNextPage:a,hasNextPage:h,isFetching:x,isFetchingNextPage:s}=R(o,t,l),N=i?.pages.flatMap(r=>r.events)??[],m=i?.pages.flatMap(r=>r.failures)??[];return e.jsxs("div",{className:"space-y-4 p-4",children:[e.jsx(f,{failures:m,isError:n,isFetching:x,onRetry:()=>void g()}),e.jsx(A,{isLoading:u,hasNextPage:!!h&&!n,autoLoadMore:m.length===0,isFetching:x,isFetchingNextPage:s,onLoadMore:()=>void a(),emptyState:n||m.length>0||h?null:e.jsx("p",{className:"text-xs text-muted-foreground",children:"No activity for this record in its connected sources."}),items:N.map(r=>({key:`${r.feed_id}:${r.origin_id}`,occurredAt:r.occurred_at,content:e.jsx("div",{className:"p-3",children:e.jsx($,{ownerSlug:t.slug,connectorDefinitions:p,content:{...r,title:r.title||r.origin_type||r.origin_id,text_content:r.payload_text??""}})})}))})]})}function q({record:o,ownerSlug:c,orgContext:l}){const{orgContext:d}=y(),{data:t,isLoading:p,isError:i,refetch:u,hasNextPage:n,fetchNextPage:g,isFetching:a,isFetchNextPageError:h,error:x}=v(o,l??d);return p?e.jsx(_,{className:"h-12 w-full rounded-lg"}):t?e.jsxs("div",{className:"space-y-2",children:[e.jsx(P,{count:t.relationshipFailures?.length??0,onRetry:()=>void u()}),e.jsx(f,{failures:t.failures,isError:i,isFetching:a,onRetry:()=>{if(a)return;const s=x instanceof C&&x.status===400;h&&!s||!i&&n?g():u()}}),t.links.length===0&&(t.relationships?.length??0)===0&&t.failures.length===0&&(t.relationshipFailures?.length??0)===0&&!n&&!i&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"No relationships for this record in its connected sources."}),t.links.length===0&&(t.relationships?.length??0)===0&&n&&!i&&t.failures.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"More source records remain to check for relationships."}),e.jsxs("ul",{className:"space-y-1",children:[(t.relationships??[]).map(s=>e.jsx("li",{className:"rounded-lg border px-3 py-2",children:e.jsx(S,{row:s,entityId:o.key,entityType:o.type,ownerSlug:c,orgContext:l??d})},`authored:${s.id}`)),t.links.map(s=>e.jsx("li",{children:e.jsx(L,{to:F(c,[{entity_type:s.entity_type,slug:s.key}]),className:"flex items-center justify-between rounded-lg border px-3 py-2 text-sm hover:bg-muted/50",children:e.jsxs("span",{children:[e.jsxs("span",{className:"text-xs text-muted-foreground",children:[s.relationship_type.replaceAll("_"," "),s.direction==="incoming"?" (from)":""," ·"," ",s.entity_type," ·"," "]}),s.name]})})},`${s.relationship_type}:${s.direction}:${s.entity_type}:${s.key}`))]}),n&&!i&&t.failures.length===0&&e.jsx(j,{variant:"outline",size:"sm",disabled:a,onClick:()=>void g(),children:a?"Loading…":"Load more"})]}):e.jsx(f,{failures:[],isError:!0,isFetching:a,onRetry:()=>void u()})}export{z as S,q as a};
|
|
2
|
+
//# sourceMappingURL=source-record-panels-LJIWGtHb.js.map
|
package/dist/owletto/dist/assets/{status-variants-DT61YfsU.js → status-variants-BxHtpMOj.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as t,i as s,
|
|
2
|
-
//# sourceMappingURL=status-variants-
|
|
1
|
+
import{j as t,i as s,bB as a}from"./index-C2TCKJDP.js";const u=a("inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium transition-colors",{variants:{status:{active:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",paused:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400",error:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",pending:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",rejected:"bg-gray-100 text-gray-700 dark:bg-gray-900/30 dark:text-gray-400",default:"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300"}},defaultVariants:{status:"default"}}),i=a("h-1.5 w-1.5 rounded-full",{variants:{status:{active:"bg-green-500",paused:"bg-yellow-500",error:"bg-red-500",pending:"bg-blue-500",rejected:"bg-gray-500",default:"bg-gray-500"}},defaultVariants:{status:"default"}});function b({className:e,status:r,showDot:n=!0,children:d,...g}){return t.jsxs("span",{className:s(u({status:r}),e),...g,children:[n&&t.jsx("span",{className:i({status:r})}),d]})}const l=new Set(["error","failed","revoked"]);function x(e){return e==="active"?"active":e==="paused"?"paused":e==="pending"||e==="pending_auth"?"pending":l.has(e)?"error":"default"}export{b as S,x as g};
|
|
2
|
+
//# sourceMappingURL=status-variants-BxHtpMOj.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,j as l,i as o}from"./index-
|
|
2
|
-
//# sourceMappingURL=table-
|
|
1
|
+
import{r as t,j as l,i as o}from"./index-C2TCKJDP.js";const r=t.forwardRef(({className:e,...a},s)=>l.jsx("div",{className:"relative w-full overflow-auto",children:l.jsx("table",{ref:s,className:o("w-full caption-bottom text-sm",e),...a})}));r.displayName="Table";const d=t.forwardRef(({className:e,...a},s)=>l.jsx("thead",{ref:s,className:o("[&_tr]:border-b",e),...a}));d.displayName="TableHeader";const c=t.forwardRef(({className:e,...a},s)=>l.jsx("tbody",{ref:s,className:o("[&_tr:last-child]:border-0",e),...a}));c.displayName="TableBody";const b=t.forwardRef(({className:e,...a},s)=>l.jsx("tr",{ref:s,className:o("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...a}));b.displayName="TableRow";const m=t.forwardRef(({className:e,...a},s)=>l.jsx("th",{ref:s,className:o("h-10 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a}));m.displayName="TableHead";const i=t.forwardRef(({className:e,...a},s)=>l.jsx("td",{ref:s,className:o("p-4 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a}));i.displayName="TableCell";export{r as T,d as a,b,m as c,c as d,i as e};
|
|
2
|
+
//# sourceMappingURL=table-1O-ik4_O.js.map
|
package/dist/owletto/dist/assets/{use-automations-II_YJWtN.js → use-automations-lV8PuE8L.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=use-automations-
|
|
1
|
+
import{cC as o,cN as c,cO as u,ad as r,bQ as l,cP as s}from"./index-C2TCKJDP.js";function y(){return o({queryKey:["automation-catalog"],queryFn:async()=>(await s("manage_catalog",{action:"list_catalog",kinds:["automations"]})).catalogs?.automations?.entries??[],staleTime:6e4})}function g(e,a,i){return o({queryKey:["automations-list",e,a,i?.includeDetails??!0],queryFn:async()=>(await s("manage_automations",{action:"list",entity_id:a,status:"active",include_details:i?.includeDetails??!0})).automations||[],enabled:!!e,staleTime:3e4})}function _(e,a,i,t={}){const n=c(t.ownerSlug);return o({queryKey:["automation-detail",n,e,a,t.since,t.until,t.templateVersion,t.includeVersions??!1],queryFn:async()=>await s("get_automation",{automation_id:e,entity_id:a,content_since:t.since,content_until:t.until,template_version:t.templateVersion,page_size:100,include_classification:"summary",include_versions:t.includeVersions??!1},{slug:n},{timeoutMs:3e4}),enabled:!!n&&!!e&&!!(t.ownerSlug||i),staleTime:3e4})}const q=u({tool:"manage_automations",body:e=>({action:"update",...e}),invalidateKeys:["automations-list","automation-detail","automations"],checkError:!1,successMessage:"Automation updated",errorMessage:"Failed to update Automation"}),v=u({tool:"manage_automations",body:e=>({action:"delete",automation_ids:[e]}),invalidateKeys:["automations-list","automation-detail","automations","agent-threads"],checkError:!1,successMessage:"Automation deleted",errorMessage:"Failed to delete Automation"}),A=u({tool:"manage_automations",body:e=>({action:"create",...e}),invalidateKeys:["automations-list","automations"],successMessage:"Automation created",errorMessage:"Failed to create Automation"});function f(){const e=r();return l({mutationFn:async a=>s("manage_automations",{action:"create_version",...a}),onSuccess:()=>{e.invalidateQueries({queryKey:["automations-list"]}),e.invalidateQueries({queryKey:["automation-detail"]}),e.invalidateQueries({queryKey:["automations"]})}})}function K(){const e=r();return l({mutationFn:async a=>s("manage_automations",{action:"set_reaction_script",...a}),onSuccess:()=>{e.invalidateQueries({queryKey:["automations-list"]}),e.invalidateQueries({queryKey:["automation-detail"]}),e.invalidateQueries({queryKey:["automations"]})}})}export{_ as a,v as b,A as c,f as d,K as e,q as f,y as g,g as u};
|
|
2
|
+
//# sourceMappingURL=use-automations-lV8PuE8L.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as d,j as e,a2 as U,i as R,a3 as D,B as W,a4 as B,a5 as I,a6 as T,a7 as V,W as q,a8 as G}from"./index-C2TCKJDP.js";import{C as K,a as J,b as Q,d as X,c as Y}from"./card-rE4Ctuy6.js";function z(s){if(!s)return null;try{const t=new URL(s);return t.protocol==="https:"&&t.hostname?t.toString():null}catch{return null}}function _(s){const t=z(s);if(!t)return null;const a=new URL(t).hostname.toLowerCase();return a.length>0&&a.length<=253&&/^[a-z0-9.-]+$/.test(a)?a:null}function Z({clientName:s,logoUri:t=null,clientUri:a=null}){const[r,i]=d.useState(!1),[o,p]=d.useState(!1),g=r?null:z(t),j=o?null:_(a)??_(t);return g?e.jsx("img",{src:g,alt:"",referrerPolicy:"no-referrer",onError:()=>i(!0),className:"h-10 w-10 shrink-0 rounded-md object-contain"}):j?e.jsx("img",{src:`https://www.google.com/s2/favicons?domain=${encodeURIComponent(j)}&sz=64`,alt:"",referrerPolicy:"no-referrer",onError:()=>p(!0),className:"h-10 w-10 shrink-0 rounded-md bg-secondary object-contain"}):e.jsx("div",{"aria-hidden":"true",className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-secondary text-base font-bold text-secondary-foreground",children:(s??"?").charAt(0).toUpperCase()||"?"})}const H=["mcp:read","mcp:write","mcp:admin"],ee=[{value:"read",title:"Read only",description:"Search and view authorized workspace data."},{value:"write",title:"Read and make changes",description:"Includes read access. Create and update authorized workspace data."},{value:"admin",title:"Administer workspaces",description:"Includes read and write access. Manage administrator-only settings.",risk:"high"}],L={read:0,write:1,admin:2};function F(s){return s.includes("mcp:admin")?"admin":s.includes("mcp:write")?"write":s.includes("mcp:read")?"read":null}function se(s,t){const a=s.filter(i=>!H.includes(i));if(!t)return a;const r=F(s);return!r||L[t]>L[r]?a:["mcp:read",...t==="write"||t==="admin"?["mcp:write"]:[],...t==="admin"?["mcp:admin"]:[],...a]}function ie({idPrefix:s,clientName:t,clientNote:a,requestedScopes:r,accessLevel:i,onAccessLevelChange:o,allowNoAccess:p=!1,disabled:g=!1,resource:j=null,logoUri:w=null,clientUri:h=null}){const y=F(r),x=r.includes("profile:read"),m=r.filter(c=>!H.includes(c)&&c!=="profile:read"&&c!=="device_worker:run"&&c!=="connections:token");return e.jsxs("div",{className:"space-y-5",children:[e.jsx("section",{"aria-label":"Application",className:"space-y-2",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Z,{clientName:t,logoUri:w,clientUri:h}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:t||"Unnamed application"}),a?e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:a}):null,j&&e.jsxs("div",{className:"mt-2 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1.5",children:[e.jsx("p",{children:"Requesting access to"}),r.length>0&&e.jsx("p",{className:"flex flex-wrap gap-1.5",children:r.map(c=>e.jsx("span",{className:"px-1 py-0.5 font-mono text-[11px] text-foreground",children:c},c))})]}),e.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:e.jsxs("p",{children:["on"," ",e.jsx("code",{className:"break-all rounded bg-muted px-1.5 py-0.5 font-mono text-xs text-foreground",children:j})]})})]})]})]})}),x&&e.jsxs("section",{"aria-labelledby":`${s}-profile`,className:"space-y-2",children:[e.jsx("p",{id:`${s}-profile`,className:"text-sm font-medium",children:"Account information"}),e.jsxs("div",{className:"rounded-md border p-3",children:[e.jsxs("p",{className:"flex flex-wrap items-center gap-2 text-sm font-medium text-foreground",children:["Basic profile",e.jsx(U,{variant:"secondary",children:"Always included"})]}),e.jsx("p",{className:"mt-0.5 text-sm text-muted-foreground",children:"See your basic Lobu identity and the names and slugs of workspaces you belong to. This is separate from the workspace data access below."})]})]}),y&&e.jsxs("fieldset",{className:"space-y-2",disabled:g,children:[e.jsx("legend",{className:"text-sm font-medium",children:"What should this client have access to?"}),e.jsxs("div",{className:"space-y-2",children:[p?e.jsxs("label",{htmlFor:`${s}-access-none`,className:R("flex cursor-pointer items-start gap-3 rounded-md border p-3 transition-colors",i===null&&"border-primary bg-primary/5"),children:[e.jsx("input",{id:`${s}-access-none`,type:"radio",name:`${s}-access-level`,value:"none",checked:i===null,onChange:()=>o(null),className:"mt-1 h-4 w-4 accent-primary"}),e.jsxs("span",{className:"min-w-0 space-y-0.5",children:[e.jsx("span",{className:"block text-sm font-medium text-foreground",children:"No workspace data access"}),e.jsx("span",{className:"block text-sm text-muted-foreground",children:"Pair the device only. It won't read or write workspace data."})]})]}):null,ee.filter(c=>L[c.value]<=L[y]).map(c=>{const f=`${s}-access-${c.value}`,b=i===c.value;return e.jsxs("label",{htmlFor:f,className:R("flex cursor-pointer items-start gap-3 rounded-md border p-3 transition-colors",b&&"border-primary bg-primary/5"),children:[e.jsx("input",{id:f,type:"radio",name:`${s}-access-level`,value:c.value,checked:b,onChange:()=>o(c.value),className:"mt-1 h-4 w-4 accent-primary"}),e.jsxs("span",{className:"min-w-0 space-y-0.5",children:[e.jsxs("span",{className:"flex flex-wrap items-center gap-2 text-sm font-medium text-foreground",children:[c.title,c.risk==="high"&&e.jsx(D,{"aria-label":"High risk",className:"h-3.5 w-3.5 shrink-0 text-destructive",children:e.jsx("title",{children:"High risk"})})]}),e.jsx("span",{className:"block text-sm text-muted-foreground",children:c.description})]})]},c.value)})]})]}),m.length>0&&e.jsxs("section",{"aria-labelledby":`${s}-additional`,className:"space-y-2",children:[e.jsx("p",{id:`${s}-additional`,className:"text-sm font-medium",children:"Additional permissions"}),e.jsx("ul",{className:"space-y-2",children:m.map(c=>e.jsx("li",{className:"rounded-md border p-3 font-mono text-xs text-foreground",children:c},c))})]})]})}function oe({summary:s,children:t,className:a}){return e.jsxs("div",{className:R("flex flex-wrap items-center gap-3 border-t pt-4",s?"justify-between":"justify-end",a),children:[s?e.jsx("p",{className:"text-sm text-muted-foreground",children:s}):null,e.jsx("div",{className:"ml-auto flex items-center gap-3",children:t})]})}function de({busy:s,approveLabel:t="Approve",approveDisabled:a=!1,denyDisabled:r=!1,onApprove:i,onDeny:o}){return e.jsxs(e.Fragment,{children:[e.jsx(W,{type:"button",variant:"outline",onClick:o,disabled:r,children:s==="deny"?"Denying...":"Deny"}),e.jsx(W,{type:"button",onClick:i,disabled:a,children:s==="approve"?"Approving...":t})]})}function me({title:s,description:t,busy:a=!1,error:r=null,review:i,aside:o,below:p,notice:g,footer:j,live:w=!1}){return e.jsx("main",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center p-4",children:e.jsxs(K,{className:R("w-full",o?"max-w-4xl":"max-w-lg"),role:w?"status":void 0,"aria-live":w?"polite":void 0,children:[e.jsxs(J,{children:[e.jsx(Q,{asChild:!0,children:e.jsx("h1",{children:s})}),t?e.jsx(X,{children:t}):null]}),e.jsxs(Y,{className:"space-y-5","aria-busy":a,children:[o?e.jsxs("div",{className:"grid gap-6 md:grid-cols-[minmax(0,1fr)_300px]",children:[e.jsx("div",{className:"min-w-0",children:i}),e.jsx("div",{className:"min-w-0",children:o})]}):i,p,g,r?e.jsx("p",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:r}):null,j]})]})})}function ue({resourceOrg:s,accessLevel:t}){return e.jsxs("section",{className:"rounded-md border border-primary/20 bg-primary/5 p-3 text-sm space-y-2",children:[e.jsxs("p",{className:"font-medium text-foreground",children:["Workspace access: only ",s]}),e.jsxs("ul",{className:"space-y-1 text-muted-foreground",children:[e.jsx("li",{children:"If this workspace is public, the app can read public data immediately after approval."}),t==="write"?e.jsx("li",{children:"If you are not already a member, this connection will stay read-only. Ask an organization admin to grant write access, then reconnect the MCP client."}):null,t==="admin"?e.jsx("li",{children:"If you are not already an admin or owner, elevated actions will stay blocked. Ask an organization owner to grant the required role, then reconnect the MCP client."}):null,t==="read"?e.jsx("li",{children:"Public read access does not require membership."}):null]})]})}function te(s){const t=q(s);return t.kind==="cross-host"?t.href:t.to}function pe({idPrefix:s,heading:t,orgList:a,selectedOrgIds:r,onWorkspaceAccessChange:i,onSelectedOrgChange:o,orgsLoading:p,orgsError:g,onRetry:j,disabled:w=!1,includedOrgId:h=null,allowMultiple:y}){const x=`${s}-workspace-access-legend`,m=`${s}-workspace-search`,[c,f]=d.useState(""),b=t??"Workspace access",N=h?a.find(n=>n.id===h)??null:null,k=a.filter(n=>n.id!==h),$=r.filter(n=>n!==h).length,A=h?$:r.length,E=k.length>0&&k.every(n=>r.includes(n.id));if(p)return e.jsxs("section",{"aria-labelledby":x,className:"space-y-2",children:[e.jsx("p",{id:x,className:"text-sm font-medium",children:b}),e.jsx("p",{role:"status","aria-live":"polite",className:"text-sm text-muted-foreground",children:"Loading your workspaces..."})]});if(g)return e.jsxs("section",{"aria-labelledby":x,className:"space-y-2",children:[e.jsx("p",{id:x,className:"text-sm font-medium",children:b}),e.jsxs("div",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:[e.jsx("p",{children:"Workspaces could not be loaded. Approval is unavailable until they load."}),e.jsx(W,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:j,children:"Retry"})]})]});if(a.length===0)return e.jsxs("section",{"aria-labelledby":x,className:"space-y-2",children:[e.jsx("p",{id:x,className:"text-sm font-medium",children:b}),e.jsx("p",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:"No member workspaces are available for this connection."})]});const M=()=>{if(E)for(const n of k)o(n.id,!1);else i("all_current")},S=c.trim().toLowerCase(),l=S?k.filter(n=>n.name.toLowerCase().includes(S)||n.slug.toLowerCase().includes(S)):k;return e.jsxs("fieldset",{className:"min-w-0 space-y-3",disabled:w,children:[e.jsx("legend",{id:x,className:"sr-only",children:b}),e.jsxs("p",{className:"text-sm font-medium",children:[b," ",e.jsxs("span",{className:"font-normal text-muted-foreground",children:["· ",A," selected"]})]}),e.jsxs("div",{className:"flex min-w-0 flex-col overflow-hidden rounded-md border bg-card",children:[e.jsxs("div",{className:"border-b bg-card p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("p",{className:"text-sm font-medium",children:"Workspaces"}),y&&k.length>0&&e.jsx("button",{type:"button",onClick:M,className:"shrink-0 cursor-pointer bg-none p-0 text-xs font-semibold text-foreground underline underline-offset-4",children:E?"Clear all":`Select all ${k.length}`})]}),!h&&e.jsx("p",{className:"mt-0.5 whitespace-nowrap text-sm text-muted-foreground",children:y?"Choose workspaces for this app.":"Choose one workspace this application can access."}),e.jsx("input",{id:m,type:"search",value:c,onChange:n=>f(n.target.value),placeholder:"Filter workspaces…","aria-label":"Filter workspaces",className:"mt-2 flex h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus:outline-none focus:ring-1 focus:ring-ring"})]}),e.jsxs("div",{className:"max-h-80 space-y-1.5 overflow-auto p-2",children:[N?e.jsxs("div",{className:"flex items-center gap-2.5 rounded-md bg-muted px-2.5 py-2",children:[e.jsx(B,{"aria-hidden":"true",className:"h-4 w-4 shrink-0 text-primary"}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"min-w-0 truncate",children:N.name}),N.isPersonal&&e.jsx(I,{"aria-label":"Personal workspace",className:"h-3.5 w-3.5 shrink-0 text-muted-foreground",children:e.jsx("title",{children:"Personal workspace"})}),e.jsx(U,{variant:"secondary",className:"shrink-0",children:"Device home"})]})}),e.jsx("span",{className:"sr-only",children:"Included"})]}):null,l.map(n=>{const u=`${s}-workspace-${n.id}`,v=r.includes(n.id);return e.jsxs("div",{className:R("flex items-center gap-2.5 rounded-md px-2.5 py-2 transition-colors hover:bg-muted/60",v&&"bg-primary/5 hover:bg-primary/5"),children:[e.jsx(T,{id:u,checked:v,disabled:w,onCheckedChange:C=>o(n.id,C===!0)}),e.jsx("label",{htmlFor:u,className:"min-w-0 flex-1 cursor-pointer truncate text-sm font-medium text-foreground",children:e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"min-w-0 truncate",children:n.name}),n.isPersonal&&e.jsx(I,{"aria-label":"Personal workspace",className:"h-3.5 w-3.5 shrink-0 text-muted-foreground",children:e.jsx("title",{children:"Personal workspace"})})]})}),e.jsx("a",{href:te(n.slug),target:"_blank",rel:"noopener noreferrer",onClick:C=>C.stopPropagation(),"aria-label":`Open ${n.name} workspace`,title:`Open ${n.name} workspace`,className:"shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:text-foreground",children:e.jsx(V,{className:"h-3.5 w-3.5"})})]},n.id)}),l.length===0&&!N&&e.jsx("p",{className:"px-2 py-3 text-[13px] text-muted-foreground",children:"No workspaces match."})]}),e.jsx("div",{className:"border-t bg-card px-3 py-2 text-xs text-muted-foreground",children:e.jsx("p",{"aria-live":"polite",children:h?`${$} additional workspace${$===1?"":"s"} selected.`:`${r.length} of ${a.length} workspaces selected.`})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Workspaces you join later are not added automatically."}),r.length===0&&e.jsx("p",{role:"alert",className:"text-xs text-destructive",children:"Choose at least one workspace."})]})}function ne(s,t){return s.length===t.length&&s.every((a,r)=>a===t[r])}function re(s={}){const{requireDeviceHome:t=!1,deviceHomeOrgId:a=null,allowMultiple:r=!0}=s,{data:i,error:o,isPending:p,refetch:g}=G(),[j,w]=d.useState("selected"),[h,y]=d.useState([]),x=d.useRef(!1),m=d.useMemo(()=>i?i.filter(l=>l.is_member).map(l=>({id:l.id,name:l.name,slug:l.slug,isPersonal:l.is_personal===!0})):[],[i]),c=m.find(l=>l.isPersonal)?.id??null,f=t?a&&m.some(l=>l.id===a)?a:c:null,b=d.useRef(m);b.current=m;const N=o instanceof Error?o.message:o?"Unable to load workspaces":null;d.useEffect(()=>{if(p||N)return;const l=m.map(u=>u.id),n=new Set(l);y(u=>{const v=x.current?u.filter(C=>n.has(C)):[c??l[0]].filter(C=>!!C);return x.current=!0,ne(u,v)?u:v})},[m,N,p,c]);const k=d.useCallback(l=>{if(l==="all_current"){if(!r)return;y(b.current.map(n=>n.id))}w(l)},[r]),$=d.useCallback((l,n)=>{b.current.some(u=>u.id===l)&&(t&&(l===f||!r)||(w("selected"),y(u=>n?r?u.includes(l)?u:[...u,l]:[l]:u.filter(v=>v!==l))))},[r,f,t]),A=d.useMemo(()=>{if(t&&f&&!r)return[f];const l=new Set(h);return t&&f&&l.add(f),m.filter(n=>l.has(n.id)).map(n=>n.id)},[r,h,f,m,t]),E=d.useCallback(()=>{const l=b.current,n=l.find(u=>u.isPersonal)?.id??l[0]?.id;x.current=l.length>0,w("selected"),y(n?[n]:[])},[]),M=!p&&!N&&m.length>0&&A.length>0&&(r||A.length===1)&&(!t||f!==null&&A.includes(f)),S=d.useCallback(()=>{g()},[g]);return{orgList:m,workspaceAccess:j,setWorkspaceAccess:k,selectedOrgIds:A,toggleSelectedOrgId:$,resetWorkspaceSelection:E,personalOrgId:c,deviceHomeOrgId:f,orgsLoading:p,orgsError:N,retryOrgs:S,workspaceSelectionReady:M}}function ae(s){if(!s)return null;try{return new URL(s).pathname.match(/^\/mcp\/([^/]+)$/)?.[1]?.trim()||null}catch{return null}}function he({requestedScopes:s,resource:t=null,allowMultiple:a,requireDeviceHome:r=!1,deviceHomeOrgId:i=null}){const o=F(s),[p,g]=d.useState(o);d.useEffect(()=>{g(F(s))},[s]);const j=d.useMemo(()=>se(s,p),[s,p]),w=d.useMemo(()=>ae(t),[t]),h=j.some(m=>m.startsWith("mcp:")),y=h&&!w,x=re({allowMultiple:a,requireDeviceHome:r,deviceHomeOrgId:i});return{accessLevel:p,setAccessLevel:g,selectedScopes:j,resourceOrg:w,hasMcpScopes:h,requiresWorkspaceAccess:y,...x}}function P(s){return typeof s=="string"&&s.length>0?s:null}function xe(s,t){return P(s?.error_description)??P(s?.message)??P(s?.error)??t}function O(s=window.location.href){const t=new URL("/auth/login",window.location.origin);return t.searchParams.set("callbackUrl",s),t.toString()}function fe(){window.location.href=O()}function ge(s,t){d.useEffect(()=>{t||s||(window.location.href=O())},[s,t])}export{ie as A,me as C,ue as R,pe as W,ge as a,oe as b,de as c,F as g,xe as o,fe as r,he as u};
|
|
2
|
+
//# sourceMappingURL=use-login-redirect-CfCbEeJR.js.map
|