@origintrail-official/dkg-node-ui 10.0.14 → 10.0.16
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/db.d.ts +6 -7
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +37 -58
- package/dist/db.js.map +1 -1
- package/dist/gelf-push-worker.d.ts +1 -1
- package/dist/gelf-push-worker.d.ts.map +1 -1
- package/dist/otlp-log-worker.d.ts +3 -5
- package/dist/otlp-log-worker.d.ts.map +1 -1
- package/dist/otlp-log-worker.js +7 -5
- package/dist/otlp-log-worker.js.map +1 -1
- package/dist/routine-log-retention.d.ts +40 -0
- package/dist/routine-log-retention.d.ts.map +1 -0
- package/dist/routine-log-retention.js +262 -0
- package/dist/routine-log-retention.js.map +1 -0
- package/dist/structured-logger.d.ts.map +1 -1
- package/dist/structured-logger.js.map +1 -1
- package/dist-ui/assets/{3d-force-graph-C9KowW4u.js → 3d-force-graph-bUKbeTGZ.js} +1 -1
- package/dist-ui/assets/ActivityFeed-CC5S_gk9.js +100 -0
- package/dist-ui/assets/{AgentHub-BVrcom9_.js → AgentHub-4c4sH_Jd.js} +1 -1
- package/dist-ui/assets/AgentProfilePage-ClhUeZxy.js +1 -0
- package/dist-ui/assets/{ApproveWalletsModal-BdR2mshx.js → ApproveWalletsModal-CBKp6zQB.js} +18 -18
- package/dist-ui/assets/ContextGraphPrimitives-Bwc2i7EX.js +1 -0
- package/dist-ui/assets/ConvictionDetailView-a3v7xwcm.js +2 -0
- package/dist-ui/assets/MemoryLayerView-DxL2MjyA.js +2 -0
- package/dist-ui/assets/MemoryStackView-BLhA3bn0.js +1 -0
- package/dist-ui/assets/Network-BNhbBzOD.js +1 -0
- package/dist-ui/assets/OnChainProvenanceCard-DKyfVEjF.js +1 -0
- package/dist-ui/assets/{Operations-Dg1gfLXv.js → Operations-mCPe0E-j.js} +18 -18
- package/dist-ui/assets/ProjectView-jrGPu5ON.js +290 -0
- package/dist-ui/assets/PublishingConviction-BGi128uo.js +2 -0
- package/dist-ui/assets/Settings-D1oxLo1Y.js +1 -0
- package/dist-ui/assets/{ccip-wJ3OMRuz.js → ccip-WHHgwjp-.js} +1 -1
- package/dist-ui/assets/index-RLb1kuzE.js +1174 -0
- package/dist-ui/assets/{index-5DS6xjw0.js → index-UvxrSkC_.js} +4 -4
- package/dist-ui/assets/index-VYV5TH6q.css +1 -0
- package/dist-ui/assets/{jsonld-32FQRO67-CDirPi8u.js → jsonld-32FQRO67-Dl6_9Lk9.js} +2 -2
- package/dist-ui/assets/{jsonld-CwHW9UDN.js → jsonld-Dj4KMENF.js} +1 -1
- package/dist-ui/assets/{renderer-3d-2EVDZII7-BNXV6iSu.js → renderer-3d-2EVDZII7-DfnhcMkF.js} +2 -2
- package/dist-ui/assets/{shikiHighlighter-C-LWPPSu.js → shikiHighlighter-ByXDJnWi.js} +1 -1
- package/dist-ui/assets/string-DtUow4KV.js +1 -0
- package/dist-ui/assets/truncate-BaiMkAOo.js +1 -0
- package/dist-ui/assets/useEntityOnChainReceipt-BRK_O_sb.js +85 -0
- package/dist-ui/assets/useProjectActivity-OdoQs9mK.js +1 -0
- package/dist-ui/index.html +2 -2
- package/package.json +6 -5
- package/dist-ui/assets/AgentProfilePage-C9XaTt7j.js +0 -1
- package/dist-ui/assets/ConvictionDetailView-cao48GL1.js +0 -2
- package/dist-ui/assets/Network-B3jCYzr5.js +0 -1
- package/dist-ui/assets/OnChainProvenanceCard-DboMX4Aq.js +0 -1
- package/dist-ui/assets/PublishingConviction-Byp6t69e.js +0 -2
- package/dist-ui/assets/Settings-CxI0SKeV.js +0 -1
- package/dist-ui/assets/index-DOjsv0r7.css +0 -1
- package/dist-ui/assets/index-KoAnx9JE.js +0 -1661
- package/dist-ui/assets/ordinal-DhEzRPdO.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aN as t}from"./index-RLb1kuzE.js";const d={neutral:"var(--border-strong)",wm:"var(--layer-working, #64748b)",swm:"var(--layer-shared, #f59e0b)",vm:"var(--layer-verified, #22c55e)",danger:"var(--text-danger)",query:"#38bdf8",warning:"var(--text-warning)"};function m(e){return e}function h({icon:e,title:s,description:r,actions:n=[],tone:i="neutral",compact:a=!1,inline:c=!1,className:v=""}){const o={"--v10-empty-accent":d[i]};return t.jsxs("div",{className:["v10-empty-state",a?"compact":"",c?"inline":"",v].filter(Boolean).join(" "),"data-tone":i,style:o,children:[e&&t.jsx("div",{className:"v10-empty-state-icon","aria-hidden":"true",children:e}),t.jsxs("div",{className:"v10-empty-state-copy",children:[t.jsx("div",{className:"v10-empty-state-title",children:s}),r&&t.jsx("div",{className:"v10-empty-state-desc",children:r}),n.length>0&&t.jsx("div",{className:"v10-empty-state-actions",children:n.map(l=>t.jsx("button",{type:"button",className:`v10-empty-state-action ${l.variant??"secondary"}`,onClick:l.onClick,"data-testid":l.testId,children:l.label},l.label))})]})]})}function y({items:e,layer:s,compact:r=!1,className:n=""}){const i=s?{"--v10-stat-accent":d[s]}:void 0;return t.jsx("div",{className:["v10-stat-strip",r?"compact":"",n].filter(Boolean).join(" "),"data-layer":s,style:i,children:e.map((a,c)=>t.jsxs("div",{className:"v10-stat-strip-cell","data-stat-id":a.id,title:a.tooltip,children:[t.jsx("span",{className:"v10-stat-strip-label",children:a.label}),t.jsx("span",{className:"v10-stat-strip-value",children:a.value}),a.hint&&t.jsx("span",{className:"v10-stat-strip-hint",children:a.hint})]},a.id??c))})}export{h as E,y as S,m as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{aN as e,bL as $,bH as R,ba as y,aV as z,b6 as J,aq as P,H as Q,B as E,bw as S,aU as M,a7 as U,bJ as X,ar as V,ai as Z,bt as I,N as O,aB as ee,aw as ae}from"./index-RLb1kuzE.js";import{f as W,k as Y,u as te,e as B,g as ne,d as se,A as re,a as q,C as le,E as oe,G as ie,F as ce,H as de,c as pe,W as ue,D as me,x as he}from"./ApproveWalletsModal-CBKp6zQB.js";import{S as ve}from"./ContextGraphPrimitives-Bwc2i7EX.js";const D=(a,t)=>!!a&&!!t&&a.toLowerCase()===t.toLowerCase();function we({agents:a,nodeWallets:t,ownerIsPrimary:r,ownerTitle:l,confirmRemove:s,onAskRemove:n,onCancelRemove:i,onConfirmRemove:v,removeBusy:u,explorer:p}){return e.jsx("div",{className:"v10-pca-detail-agentlist","data-testid":"pca-agent-list",children:a.map(c=>{const h=t.some(f=>D(f,c)),o=D(s??void 0,c);return e.jsx("div",{className:"v10-pca-agent-row","data-testid":"pca-agent-row",children:e.jsx(W,{address:c,status:h?"approved · this node":"approved",statusTone:"success",trailing:o?e.jsxs("span",{className:"v10-pca-agent-confirm",children:[e.jsx("span",{children:h?"This is one of this node’s own signing wallets — its publishes will pay the direct cost (and revert if it holds no TRAC). Remove?":"Publishes from this wallet will pay the direct cost (and revert if it holds no TRAC). Remove?"}),e.jsx("button",{type:"button",className:"v10-pca-card-btn","data-testid":"pca-deregister-btn","aria-label":`Confirm removing ${c}`,onClick:()=>v(c),disabled:u,children:u?"Removing…":"Yes, remove"}),e.jsx("button",{type:"button",className:"v10-pca-card-btn","aria-label":`Cancel removing ${c}`,onClick:i,disabled:u,children:"Cancel"})]}):e.jsxs(e.Fragment,{children:[p&&e.jsx("a",{className:"v10-pca-card-explorer",href:`${p}/address/${c}`,target:"_blank",rel:"noreferrer","aria-label":`View ${c} on explorer`,children:"↗"}),e.jsx("button",{type:"button",className:"v10-pca-card-btn","aria-label":`Remove ${c}`,onClick:()=>n(c),disabled:!r,title:l,children:"Remove"})]})})},c)})})}function ge(){const a=$(l=>l.setBootstrap),t=$(l=>l.initWallet),r=R(l=>l.setScope);y.useEffect(()=>{let l=!1;return z().then(s=>{l||(r(J(s)),a(s))}).catch(()=>{}).finally(()=>{l||t()}),()=>{l=!0}},[t,r,a])}function be(a){return a==="topup"?{requiresApproval:!0,actionLabel:"Sign top-up"}:{requiresApproval:!1,actionLabel:"Sign remove wallet"}}function _(a,t){const r=Y(a,"action");return t==="remove"&&r.kind==="rejected"?"You rejected the remove-wallet transaction. No wallet was removed.":r.message}const fe={busy:!1,error:null,result:null};function G(){return y.useState(fe)}function xe({accountId:a,setFund:t,refresh:r}){const l=R(i=>i.topUpPending[a]??null),s=R(i=>i.clearTopUpPending),n=$(i=>i.bootstrap);y.useEffect(()=>{var p;if(!l||!((p=n==null?void 0:n.rpcUrls)!=null&&p.length))return;let i=!1,v=null;const u=async()=>{try{const h=await te(n.chainId,n.rpcUrls).getTransactionReceipt({hash:l.txHash});if(i)return;s(a),h.status==="success"?(t({busy:!1,error:null,warning:null,result:{txHash:l.txHash,message:"Top-up confirmed on-chain."}}),r()):t({busy:!1,error:"The pending top-up transaction reverted on-chain.",warning:null,result:null})}catch{i||(v=setTimeout(u,5e3))}};return u(),()=>{i=!0,v&&clearTimeout(v)}},[a,s,r,t,l,n])}function ye({accountId:a,snapshot:t,ownerTrac:r,explorer:l,access:s,ownerTitle:n,owner:i,deviceProgress:v,refresh:u}){const p=R(b=>b.topUpPending[a]??null),c=R(b=>b.setTopUpPending),h=R(b=>b.clearTopUpPending),[o,f]=y.useState(""),[m,w]=G();xe({accountId:a,setFund:w,refresh:u});const C=async()=>{var b,x;s.mode==="wallet"?v.begin("topup"):v.reset(),w({busy:!0,error:null,result:null,warning:null});try{const d=await i.topUp(a,o.trim());h(a),w({busy:!1,error:null,result:{txHash:d.txHash,message:`Added ${P(d.addedTokens)} TRAC.`}}),f(""),u()}catch(d){if(d instanceof Q&&d.status===504){const j=(b=d.body)==null?void 0:b.txHash;if(j){c({accountId:a,ownerEoa:t.owner,submittedAt:Date.now(),txHash:j,tokens:o.trim(),previousTopUpBufferTrac:t.topUpBufferTrac}),w({busy:!1,error:null,result:null,warning:{txHash:j,message:"Your top-up was submitted but we lost confirmation — it may already be on-chain. Verify on the explorer before adding again; a second top-up would lock additional TRAC."}});return}}if(d instanceof B&&d.txStep==="action"&&d.txHash){c({accountId:a,ownerEoa:t.owner,submittedAt:Date.now(),txHash:d.txHash,tokens:o.trim(),previousTopUpBufferTrac:t.topUpBufferTrac}),w({busy:!1,error:null,result:null,warning:{txHash:d.txHash,message:"Your top-up was submitted but we lost confirmation - it may already be on-chain. This exact transaction is being checked; do not add again until it resolves."}});return}if(s.mode==="wallet"){const j=Y(d,d instanceof ne?d.txStep:d instanceof B?d.txStep??"action":"action");w({busy:!1,error:j.message,result:null,warning:d instanceof se?null:void 0});return}w({busy:!1,error:((x=E(d,{accountId:a}))==null?void 0:x.message)??(d==null?void 0:d.message)??"Top-up failed.",result:null})}};return e.jsxs("section",{className:"v10-pca-detail-section",children:[e.jsx("h3",{className:"v10-pca-detail-section-title",children:"Funding"}),e.jsxs("p",{className:"v10-pca-detail-hint",children:["Top-up raises the spendable buffer. It does ",e.jsx("strong",{children:"not"})," extend the lock period — when the account expires you create a new one."]}),r!=null&&e.jsxs("p",{className:"v10-pca-detail-hint",children:["Owner balance: ",P(r)," TRAC"]}),e.jsxs("div",{className:"v10-pca-detail-form",children:[e.jsx("input",{className:"v10-form-input",type:"text",inputMode:"decimal",value:o,onChange:b=>f(b.target.value),placeholder:"Top up (TRAC)",disabled:!s.writesEnabled||m.busy||!!p,"aria-label":"Top-up amount in TRAC"}),e.jsx("button",{type:"button",className:"v10-pca-card-btn primary","data-testid":"pca-topup-btn",onClick:C,disabled:!s.writesEnabled||m.busy||!!p||!/^\d+(\.\d+)?$/.test(o.trim())||Number(o.trim())<=0,title:n,children:m.busy?"Adding…":"Add funds"})]}),e.jsx(Ce,{state:m,explorer:l,onRecheck:u}),p&&e.jsxs("p",{className:"v10-pca-create-warn","data-testid":"pca-topup-pending",role:"alert",children:["Top-up transaction ",e.jsx("code",{children:p.txHash})," is pending confirmation. The top-up button is disabled while this exact receipt is checked; adding again could lock more TRAC."," ",e.jsx("button",{type:"button",className:"v10-pca-card-btn",onClick:u,children:"Recheck account"})]})]})}function Ce({state:a,explorer:t,onRecheck:r}){if(a.warning){const s=t&&a.warning.txHash?`${t}/tx/${a.warning.txHash}`:void 0;return e.jsxs("p",{className:"v10-pca-create-warn","data-testid":"pca-action-warning",role:"alert",children:[a.warning.message," ",a.warning.txHash&&(s?e.jsxs("a",{href:s,target:"_blank",rel:"noreferrer",children:[a.warning.txHash," ↗"]}):e.jsx("code",{children:a.warning.txHash}))," ",r&&e.jsx("button",{type:"button",className:"v10-pca-card-btn",onClick:r,children:"Recheck"})]})}if(a.error)return e.jsx("p",{className:"v10-modal-error",role:"alert",children:a.error});if(!a.result)return null;const l=t&&a.result.txHash?`${t}/tx/${a.result.txHash}`:void 0;return e.jsxs("p",{className:"v10-pca-detail-result","data-testid":"pca-action-result",role:"status",children:[a.result.message," ",l&&e.jsx("a",{href:l,target:"_blank",rel:"noreferrer",children:"tx ↗"})," ","Still pending? You can close this and verify here."]})}const je=/^0x[0-9a-fA-F]{40}$/;function Ne({accountId:a,snapshot:t,wallets:r,explorer:l,access:s,ownerTitle:n,owner:i,deviceProgress:v,refresh:u}){const[p,c]=y.useState(""),[h,o]=y.useState(null),[f,m]=y.useState(null),[w,C]=G(),[b,x]=y.useState(!1),{data:d,loading:j,refresh:N}=S(()=>M(a),[a]),k=d&&d.accountId===a?d:null,K=async()=>{var T,A;o(null);const g=p.trim();if(!je.test(g)){o("Enter a valid 0x address.");return}try{const L=(T=(await U(a,g)).probedKey)==null?void 0:T.registered;o(L===!0?`✓ ${g} is an approved publishing wallet here.`:L===!1?`✗ ${g} is NOT approved here.`:`Couldn’t determine whether ${g} is approved here — retry.`)}catch(F){o(((A=E(F,{accountId:a}))==null?void 0:A.message)??"Probe failed.")}},H=async g=>{var T;s.mode==="wallet"?v.begin("remove"):v.reset(),C({busy:!0,error:null,result:null});try{await i.deregisterAgent(a,g),C({busy:!1,error:null,result:{message:`Removed ${g}.`}}),m(null),u(),N()}catch(A){C({busy:!1,error:s.mode==="wallet"?_(A,"remove"):((T=E(A,{accountId:a}))==null?void 0:T.message)??(A==null?void 0:A.message)??"Remove failed.",result:null})}};return e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"v10-pca-detail-section",children:[e.jsxs("h3",{className:"v10-pca-detail-section-title",children:["Publishing wallets — ",t.agentCount," / 100"]}),e.jsxs("div",{className:"v10-pca-detail-form",children:[e.jsx(re,{mode:"single",value:p,onChange:c,label:"Check a wallet",cruxNote:null}),e.jsx("button",{type:"button",className:"v10-pca-card-btn",onClick:K,children:"Probe"})]}),h&&e.jsx("p",{className:"v10-pca-detail-hint",role:"status",children:h}),j&&!k?e.jsx("p",{className:"v10-pca-detail-hint",role:"status",children:"Loading approved wallets…"}):k?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"v10-pca-detail-subhead",children:"Approved publishing wallets:"}),k.agents.length>0?e.jsx(we,{agents:k.agents,nodeWallets:r,ownerIsPrimary:s.writesEnabled,ownerTitle:n,confirmRemove:f,onAskRemove:g=>m(g),onCancelRemove:()=>m(null),onConfirmRemove:g=>H(g),removeBusy:w.busy,explorer:l}):e.jsx("div",{className:"v10-pca-detail-agentlist","data-testid":"pca-agent-list",children:e.jsx("p",{className:"v10-pca-handshake-empty",children:"No approved publishing wallets yet."})})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"v10-pca-detail-subhead",children:"This node’s wallets:"}),e.jsxs("div",{className:"v10-pca-detail-agentlist","data-testid":"pca-agent-list",children:[r.map(g=>e.jsx(Ae,{accountId:a,wallet:g,ownerIsPrimary:s.writesEnabled,ownerTitle:n,confirming:f===g,onAskRemove:()=>m(g),onCancelRemove:()=>m(null),onConfirmRemove:()=>H(g),removeBusy:w.busy},g)),r.length===0&&e.jsx("p",{className:"v10-pca-handshake-empty",children:"No operational wallets on this node."})]}),e.jsx("p",{className:"v10-pca-overview-caveat",children:"ⓘ The chain exposes how many wallets are approved, not the full list — only this node’s wallets and any you probe are shown here."})]}),w.error&&e.jsx("p",{className:"v10-modal-error",role:"alert",children:w.error}),w.result&&e.jsx("p",{className:"v10-pca-detail-result",role:"status","data-testid":"pca-remove-result",children:w.result.message}),e.jsx("button",{type:"button",className:"v10-pca-card-btn primary",onClick:()=>x(!0),disabled:!s.writesEnabled,title:n,children:"+ Approve publishing wallet"})]}),b&&e.jsx(q,{accountId:a,initialMode:"self",onClose:()=>{x(!1),u(),N()}})]})}function Ae({accountId:a,wallet:t,ownerIsPrimary:r,ownerTitle:l,confirming:s,onAskRemove:n,onCancelRemove:i,onConfirmRemove:v,removeBusy:u}){var m;const{data:p,loading:c,error:h}=S(()=>U(a,t),[a,t]),o=(m=p==null?void 0:p.probedKey)==null?void 0:m.registered,f=!c&&(h!=null||p!=null&&o==null);return e.jsx("div",{className:"v10-pca-agent-row","data-testid":"pca-agent-row",children:e.jsx(W,{address:t,status:o===!0?"approved":o===!1?"not approved":f?"couldn’t determine":"checking…",statusTone:o===!0?"success":o===!1?"danger":"neutral",trailing:o===!0?s?e.jsxs("span",{className:"v10-pca-agent-confirm",children:[e.jsx("span",{children:"This is one of this node’s own signing wallets — its publishes will pay the direct cost (and revert if it holds no TRAC). Remove?"}),e.jsx("button",{type:"button",className:"v10-pca-card-btn","data-testid":"pca-deregister-btn","aria-label":`Confirm removing ${t}`,onClick:v,disabled:u,children:u?"Removing…":"Yes, remove"}),e.jsx("button",{type:"button",className:"v10-pca-card-btn","aria-label":`Cancel removing ${t}`,onClick:i,disabled:u,children:"Cancel"})]}):e.jsx("button",{type:"button",className:"v10-pca-card-btn","aria-label":`Remove ${t}`,onClick:n,disabled:!r,title:l,children:"Remove"}):void 0})})}function Re(a){const[t,r]=y.useState(!1),[l,s]=y.useState(!1),[n,i]=y.useState(null),v=X(c=>c.openTab);return{renewOpen:t,renewChaining:l,renewApprove:n,openRenew:()=>r(!0),closeRenew:()=>r(!1),onRenewSuccess:c=>{r(!1),s(!0),M(a).then(h=>({agents:h.agents,resolved:!0})).catch(()=>({agents:[],resolved:!1})).then(({agents:h,resolved:o})=>{s(!1),i({newAccountId:c,seedBulk:h.join(`
|
|
2
|
+
`),agentsResolved:o})})},onManageNew:c=>{r(!1),v({id:`conviction:${c}`,label:`PCA #${c}`,closable:!0})},clearRenewApprove:()=>i(null)}}function Te({accountId:a,snapshot:t,access:r,ownerTitle:l,health:s}){const n=Re(a);return e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"v10-pca-detail-section",children:[e.jsx("h3",{className:"v10-pca-detail-section-title",children:"Lifecycle"}),(s==="expiring"||s==="expired")&&e.jsxs("p",{className:"v10-pca-card-warn",children:[V(t.expiresAtTimestamp),". The lock period can’t be extended — Renew creates a fresh replacement account seeded from this one (the old TRAC stays locked until its own expiry)."]}),e.jsx("button",{type:"button",className:`v10-pca-card-btn${s==="expiring"||s==="expired"?" primary":""}`,"data-testid":"pca-renew-btn",onClick:()=>n.openRenew(),disabled:!r.writesEnabled,title:l,children:"Renew — create a replacement PCA"})]}),n.renewOpen&&e.jsx(le,{seed:{tokens:t.committedTRACTrac,primaryNode:t.primaryNode&&t.primaryNode!=="0"?String(t.primaryNode):void 0,primaryNodeUnknown:t.primaryNode==null},replacingAccountId:a,initialOwnerKey:r.mode==="wallet"?"hardware":"hot",onClose:()=>n.closeRenew(),onApproveOwnWallets:n.onRenewSuccess,onManage:n.onManageNew,onGetSponsored:()=>n.closeRenew()}),n.renewChaining&&e.jsx("div",{className:"lazy-spinner",role:"status","data-testid":"pca-renew-chaining",children:"Preparing re-approval…"}),n.renewApprove&&e.jsx(q,{accountId:n.renewApprove.newAccountId,initialMode:"sponsor",seedBulk:n.renewApprove.seedBulk,deregisterFrom:a,seedAgentsResolved:n.renewApprove.agentsResolved,onClose:()=>n.clearRenewApprove()})]})}function Pe(a){return V(a).replace(/^Expires in /,"")}function Ue({accountId:a}){var d,j;const{data:t,loading:r,error:l,refresh:s}=S(()=>U(a,void 0,{extended:!0}),[a]),n=(t==null?void 0:t.accountId)===a?t:null,{data:i,error:v,refresh:u}=S(Z,[],0),p=I(N=>N.nodeStatus),c=(p==null?void 0:p.blockExplorerUrl)??null,h=$(N=>N.address),o=(i==null?void 0:i.wallets)??[],f=he(i,v),m=oe({owner:n==null?void 0:n.owner,primaryWallet:o[0],primaryWalletState:f});if(ge(),r&&!n)return e.jsxs("div",{className:"lazy-spinner",children:["Loading PCA #",a,"…"]});if(l||!n)return e.jsx("div",{className:"v10-pca-detail",children:e.jsx("div",{className:"card",children:e.jsxs("div",{className:"card-body v10-pca-card-error",children:[e.jsxs("p",{children:["Couldn’t load PCA #",a,"."]}),e.jsx("button",{type:"button",className:"v10-pca-card-btn",onClick:()=>s(),children:"Retry"})]})})});const w=o.some(N=>O(N,n.owner)),C=m.ownerUnknownCause==="wallets-loading",b=m.ownerUnknownCause==="wallets-unreadable",x=C?`Confirming ownership of PCA #${a}…`:b?`Couldn't load this node's wallets - can't confirm ownership of PCA #${a}.`:m.mode==="wallet"&&m.wrongNetwork?`Wrong network - switch the connected wallet to this node's PCA network to manage PCA #${a}.`:m.mode==="wallet"?`Connected wallet ${n.owner} owns PCA #${a}; device-signed owner actions are enabled.`:w?`Owner-only - PCA #${a} is owned by ${n.owner}, not this node's primary operational wallet, so node-UI can't sign for it.`:h?`Owner-only - connected as ${h}; switch to ${n.owner} to manage PCA #${a}.`:`Owner-only - connect ${n.owner} to manage PCA #${a}.`;return e.jsx(ke,{accountId:a,snapshot:n,wallets:o,ownerTrac:(j=(d=i==null?void 0:i.balances)==null?void 0:d.find(N=>O(N.address,n.owner)))==null?void 0:j.trac,explorer:c,access:m,connectedWallet:h,ownerOnlyReason:x,walletsLoading:C,walletsUnreadable:b,onRetryWallets:u,refresh:s})}function ke({accountId:a,snapshot:t,wallets:r,ownerTrac:l,explorer:s,access:n,connectedWallet:i,ownerOnlyReason:v,walletsLoading:u,walletsUnreadable:p,onRetryWallets:c,refresh:h}){const o=ie({labels:{idle:"Confirm on your device",approveActive:"Confirm on your device (1 of 2): approve TRAC",approveReady:"Allowance ready — continue to the owner action",actionActive:x=>x==="remove"?"Confirm on your device: remove wallet":"Confirm on your device (2 of 2): top up",submitted:"Waiting for on-chain confirmation",confirmed:"Transaction confirmed on-chain",failed:"Wallet transaction failed"},flow:x=>be(x??"topup"),describeActionError:(x,d)=>_(x,d??"topup")}),f=ce({access:n,onWalletProgress:n.mode==="wallet"?o.onProgress:void 0}),m=ee(t),w=n.writesEnabled?void 0:v,C=(t.discountBps/100).toFixed(t.discountBps%100===0?0:1),b=i?n.mode==="wallet"?n.wrongNetwork?"Owner wallet matches; switch network before signing owner actions.":"Connected owner wallet will sign top-up, approve, remove, and renewal actions.":n.mode==="daemon"?"Connected wallet is available for wallet-owned PCAs; this account uses the node daemon for owner actions.":`Connected as ${i}; switch to ${t.owner} to manage owner actions.`:n.mode==="external"?"Connect the PCA owner wallet to manage this account. Provider metadata is display-only.":"Connect a wallet to view and manage wallet-owned PCAs from this tab.";return e.jsxs("div",{className:"v10-pca-detail","data-testid":"pca-detail",children:[e.jsxs("div",{className:"v10-pca-detail-band",children:[e.jsxs("span",{className:"v10-pca-detail-id",children:["PCA #",a]}),e.jsxs("span",{className:"badge badge-info",children:["◉ ",C,"% discount"]}),e.jsxs("span",{className:"v10-pca-detail-committed",children:[P(t.committedTRACTrac)," TRAC committed"]}),e.jsx("span",{className:"v10-pca-card-spacer"}),e.jsx(de,{state:m})]}),e.jsxs("div",{className:"v10-modal-tip",role:"status",children:[b,i?e.jsx(pe,{}):e.jsx(ue,{})]}),o.steps.length>0&&e.jsx(me,{steps:o.steps,currentLabel:o.currentLabel,blockExplorerUrl:s}),!n.writesEnabled&&(u?e.jsx("div",{className:"v10-modal-tip",role:"status",children:v}):e.jsxs("div",{className:"v10-modal-warning",role:"status",children:["ⓘ ",v," ",p?e.jsx("button",{type:"button",className:"v10-pca-card-btn",onClick:c,children:"Retry"}):"Wallet probe stays available."]})),e.jsx(ve,{items:[{id:"buffer",label:"Top-up buffer",value:`${P(t.topUpBufferTrac)} TRAC`},{id:"per-epoch",label:"TRAC per epoch",value:`${ae(t.baseEpochAllowance)} TRAC`},...t.remainingAllowanceTrac!=null?[{id:"remaining",label:"Remaining this epoch",value:`${P(t.remainingAllowanceTrac)} TRAC`,tooltip:t.currentEpoch!=null?`Current epoch ${t.currentEpoch}`:void 0}]:[],{id:"wallets",label:"Publishing wallets",value:`${t.agentCount} / 100`},{id:"expires",label:"Expires in",value:Pe(t.expiresAtTimestamp),tooltip:`Expiry epoch ${t.expiresAtEpoch}`},...t.primaryNode!=null?[{id:"primary-node",label:"Primary node",value:t.primaryNode==="0"?"None set":`Node #${t.primaryNode}`,tooltip:t.lastPrimaryNodeChangeEpoch!=null?`Last changed epoch ${t.lastPrimaryNodeChangeEpoch}`:void 0}]:[]]}),e.jsxs("div",{className:"v10-pca-detail-owner",children:[e.jsx("span",{className:"v10-pca-card-owner-lbl",children:"Owner"}),e.jsx(W,{address:t.owner,trailing:s?e.jsx("a",{className:"v10-pca-card-explorer",href:`${s}/address/${t.owner}`,target:"_blank",rel:"noreferrer","aria-label":"View owner on explorer",children:"↗"}):void 0})]}),e.jsx(ye,{accountId:a,snapshot:t,ownerTrac:l,explorer:s,access:n,ownerTitle:w,owner:f,deviceProgress:o,refresh:h}),e.jsx(Ne,{accountId:a,snapshot:t,wallets:r,explorer:s,access:n,ownerTitle:w,owner:f,deviceProgress:o,refresh:h}),e.jsx(Te,{accountId:a,snapshot:t,access:n,ownerTitle:w,health:m})]})}export{Ue as ConvictionDetailView};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-UvxrSkC_.js","assets/index-RLb1kuzE.js","assets/index-VYV5TH6q.css","assets/string-DtUow4KV.js","assets/OnChainProvenanceCard-DKyfVEjF.js","assets/useEntityOnChainReceipt-BRK_O_sb.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{ba as i,$ as ve,aj as G,q as oe,bD as be,aN as e,R as K,bw as D,O as ge,bC as B,af as xe,aQ as de,b9 as fe,b1 as je,f as Ne,b8 as ie,F as we,E as re,_ as q,aX as ye}from"./index-RLb1kuzE.js";import{t as he}from"./truncate-BaiMkAOo.js";const Se={"application/pdf":"pdf","application/json":"text","text/plain":"text","text/csv":"text","text/markdown":"markdown","image/png":"image","image/jpeg":"image","image/gif":"image","image/webp":"image"};function ne(s){const c=Se[s];return c?c==="markdown"?"text":c:"binary"}async function ce(s){const c=await fetch(s,{headers:oe()});if(!c.ok)throw new Error(`HTTP ${c.status}`);const l=await c.blob();return URL.createObjectURL(l)}function ke({open:s,onClose:c,assertionName:l,contextGraphId:g,subGraphName:d}){const[r,p]=i.useState(null),[N,C]=i.useState(null),[m,w]=i.useState(null),[y,x]=i.useState(!0),[v,S]=i.useState(null);i.useEffect(()=>{if(s)return x(!0),S(null),p(null),C(null),w(null),ve(l,g,d).then(async b=>{p(b);const P=ne(b.detectedContentType),E=G(b.fileHash,b.detectedContentType);if(P==="text"){const t=await fetch(E,{headers:oe()});t.ok&&C(await t.text())}else if(P==="pdf"||P==="image"){const t=await ce(E);w(t)}}).catch(b=>S(b.message??"Failed to load file info")).finally(()=>x(!1)),()=>{m&&URL.revokeObjectURL(m)}},[s,l,g,d]),i.useEffect(()=>()=>{m&&URL.revokeObjectURL(m)},[m]);const{dialogRef:n,onBackdropClick:u}=be(s,c);if(!s)return null;const o=r?ne(r.detectedContentType):null,f=r?G(r.fileHash,r.detectedContentType):null,k=async(b,P)=>{try{const E=await ce(b),t=document.createElement("a");t.href=E,t.download=P,t.click(),URL.revokeObjectURL(E)}catch{window.open(b,"_blank")}};return e.jsx("div",{className:"v10-modal-overlay",onClick:u,role:"presentation",children:e.jsxs("div",{className:"v10-modal-box v10-file-preview-modal",ref:n,role:"dialog","aria-modal":"true","aria-labelledby":"dkg-file-preview-title",children:[e.jsxs("div",{className:"v10-modal-header",children:[e.jsx("div",{id:"dkg-file-preview-title",className:"v10-modal-title",children:l}),e.jsx("button",{type:"button",className:"v10-modal-close",onClick:c,"aria-label":"Close file preview",title:"Close (Esc)",children:"×"})]}),y&&e.jsx("div",{className:"v10-file-preview-loading",children:"Loading file preview..."}),v&&e.jsxs("div",{className:"v10-file-preview-error",children:[e.jsx("p",{children:v}),e.jsx("p",{style:{fontSize:11,marginTop:4},children:"File preview requires the extraction status to still be cached on the node. If the node was restarted, the preview metadata may be unavailable."})]}),r&&!y&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"v10-file-preview-meta",children:[e.jsx("span",{className:"v10-file-preview-meta-item",children:r.detectedContentType}),e.jsxs("span",{className:"v10-file-preview-meta-item",children:[r.tripleCount," triples extracted"]}),e.jsx("span",{className:"v10-file-preview-meta-item",children:r.pipelineUsed}),r.completedAt&&e.jsx("span",{className:"v10-file-preview-meta-item",children:new Date(r.completedAt).toLocaleString()})]}),e.jsxs("div",{className:"v10-file-preview-content",children:[o==="pdf"&&m&&e.jsx("iframe",{src:m,className:"v10-file-preview-iframe",title:`Preview: ${l}`}),o==="image"&&m&&e.jsx("img",{src:m,alt:l,className:"v10-file-preview-image"}),o==="text"&&N!=null&&e.jsx("pre",{className:"v10-file-preview-text",children:N}),o==="binary"&&e.jsxs("div",{className:"v10-file-preview-binary",children:[e.jsx("p",{children:"This file type cannot be previewed directly."}),f&&e.jsx("button",{className:"v10-file-preview-download",onClick:()=>k(f,l),children:"Download file"})]})]}),e.jsxs("div",{className:"v10-file-preview-footer",children:[f&&e.jsx("button",{className:"v10-file-preview-download",onClick:()=>k(f,l),children:"Download original"}),r.mdIntermediateHash&&e.jsx("button",{className:"v10-file-preview-download",onClick:()=>k(G(r.mdIntermediateHash,"text/markdown"),`${l}.md`),children:"Download markdown intermediate"})]})]})]})})}const Ce=i.lazy(()=>q(()=>import("./index-UvxrSkC_.js").then(s=>s.h),__vite__mapDeps([0,1,2,3])).then(s=>({default:s.RdfGraph}))),Ee=i.lazy(()=>q(()=>import("./index-UvxrSkC_.js").then(s=>s.h),__vite__mapDeps([0,1,2,3])).then(s=>({default:s.NodePanel}))),Le=i.lazy(()=>q(()=>import("./OnChainProvenanceCard-DKyfVEjF.js"),__vite__mapDeps([4,1,2,0,3,5])).then(s=>({default:s.OnChainProvenanceCard}))),Pe={wm:{label:"Working Memory",color:"var(--layer-working)",icon:"◇",description:"Private agent drafts. Fast local storage."},swm:{label:"Shared Working Memory",color:"var(--layer-shared)",icon:"◈",description:"Shared proposals with collaborators. TTL-bounded."},vm:{label:"Verifiable Memory",color:"var(--layer-verified)",icon:"◉",description:"Endorsed, published, on-chain knowledge."}},Ae={labelMode:"humanized",renderer:"2d",labels:ye({extraPredicates:["http://schema.org/text"]}),style:{classColors:{"http://schema.org/Person":"#f472b6","http://schema.org/Organization":"#fb923c","http://schema.org/Place":"#34d399","http://schema.org/Product":"#c084fc","http://schema.org/Event":"#facc15","http://schema.org/CreativeWork":"#7dd3fc","http://schema.org/Thing":"#94a3b8"},defaultNodeColor:"#94a3b8",defaultEdgeColor:"#5f8598",edgeWidth:.9},hexagon:{baseSize:4,minSize:3,maxSize:6,scaleWithDegree:!0},focus:{maxNodes:3e3,hops:999}},Re=e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e.jsx("line",{x1:"3",y1:"9",x2:"21",y2:"9"}),e.jsx("line",{x1:"3",y1:"15",x2:"21",y2:"15"}),e.jsx("line",{x1:"9",y1:"3",x2:"9",y2:"21"})]}),Te=e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"6",cy:"6",r:"3"}),e.jsx("circle",{cx:"18",cy:"6",r:"3"}),e.jsx("circle",{cx:"6",cy:"18",r:"3"}),e.jsx("circle",{cx:"18",cy:"18",r:"3"}),e.jsx("line",{x1:"8.5",y1:"7.5",x2:"15.5",y2:"16.5"}),e.jsx("line",{x1:"15.5",y1:"7.5",x2:"8.5",y2:"16.5"})]});function Ve({layer:s,contextGraphId:c,externalQuery:l,externalQueryKey:g,queryPresetOptions:d}){var le,te;const r=Pe[s],[p,N]=i.useState("graph"),[C,m]=i.useState(""),[w,y]=i.useState(""),[x,v]=i.useState(""),[S,n]=i.useState(""),[u,o]=i.useState("any"),[f,k]=i.useState(50),[b,P]=i.useState(""),[E,t]=i.useState("any"),[h,L]=i.useState(50),[U,A]=i.useState(s!=="vm"),j=K.useRef(s);K.useEffect(()=>{j.current!==s&&(j.current=s,m(""),A(s!=="vm"),y(""),v(""),n(""),o("any"),k(50),P(""),t("any"),L(50))},[s]),K.useEffect(()=>{l!==void 0&&(m(""),y(l),v(l))},[l,g]);const W=i.useMemo(()=>s==="wm"?`SELECT ?s ?p ?o WHERE { GRAPH <${`did:dkg:context-graph:${c}/_meta`}> { ?g <http://dkg.io/ontology/memoryLayer> "WM" } GRAPH ?g { ?s ?p ?o } FILTER(!CONTAINS(STR(?g), "/meta/assertion/")) } LIMIT 1000`:s==="vm"?$e({query:b,field:E,limit:h}):"SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT 500",[c,s,E,h,b]),$=x||W,O=s==="swm"?"_shared_memory":void 0,Y=s==="swm",X=s==="vm"?"verifiable-memory":void 0,J=s==="wm"&&$===W,{data:T,loading:V,error:Z,refresh:R}=D(()=>ge($,{contextGraphId:c,includeSharedMemory:Y,graphSuffix:O,view:X,includeContextGraphPartitions:J}),[$,c,Y,O,X,J],0);B(c,R,{layers:[s]});const{data:I}=D(xe,[],3e4),me=I==null?void 0:I.blockExplorerUrl,ee=i.useCallback(()=>{const a=w.trim();if(a===x){R();return}v(a)},[x,w,R]),se=i.useCallback(()=>{const a=S!==b||u!==E||f!==h;if(a&&(P(S),t(u),L(f)),x){v("");return}a||R()},[x,E,h,b,u,f,S,R]),M=((le=T==null?void 0:T.result)==null?void 0:le.bindings)??((te=T==null?void 0:T.results)==null?void 0:te.bindings)??[],F=i.useMemo(()=>M.map(a=>({subject:_(a.s)??"",predicate:_(a.p)??"",object:_(a.o)??""})).filter(a=>a.subject&&a.predicate&&a.object),[M]),ue=i.useCallback(a=>{a!=null&&a.id&&v(`SELECT (<${a.id}> AS ?s) ?p ?o WHERE { <${a.id}> ?p ?o } LIMIT 100`)},[]);return e.jsxs("div",{className:"v10-memory-layer-view",children:[e.jsxs("div",{className:"v10-mlv-header",children:[e.jsx("span",{className:"v10-mlv-icon",style:{color:r.color},children:r.icon}),e.jsxs("div",{children:[e.jsx("h2",{className:"v10-mlv-title",children:r.label}),e.jsx("p",{className:"v10-mlv-desc",children:r.description})]})]}),s==="wm"&&e.jsx(Me,{contextGraphId:c,onPromoted:R}),s==="swm"&&e.jsx(_e,{contextGraphId:c,onPublished:R}),s==="vm"&&e.jsxs("div",{className:"v10-vm-search-panel",children:[e.jsxs("div",{className:"v10-vm-search-header",children:[e.jsxs("div",{children:[e.jsx("div",{className:"v10-vm-search-title",children:"Search Verifiable Memory"}),e.jsx("div",{className:"v10-vm-search-desc",children:"Search published triples by subject, predicate, object, or across all fields."})]}),e.jsx("button",{className:"v10-vm-search-toggle",type:"button",onClick:()=>A(a=>!a),children:U?"Hide SPARQL":"Advanced SPARQL"})]}),e.jsxs("div",{className:"v10-vm-search-controls",children:[e.jsx("input",{type:"text",className:"v10-mlv-query-input",placeholder:"Search verifiable memory...",value:S,onChange:a=>n(a.target.value),onKeyDown:a=>{a.key==="Enter"&&se()}}),e.jsxs("select",{className:"v10-vm-search-select",value:u,onChange:a=>o(a.target.value),children:[e.jsx("option",{value:"any",children:"Any field"}),e.jsx("option",{value:"subject",children:"Subject"}),e.jsx("option",{value:"predicate",children:"Predicate"}),e.jsx("option",{value:"object",children:"Object"})]}),e.jsxs("select",{className:"v10-vm-search-select",value:String(f),onChange:a=>k(Number.parseInt(a.target.value,10)||50),children:[e.jsx("option",{value:"25",children:"25 rows"}),e.jsx("option",{value:"50",children:"50 rows"}),e.jsx("option",{value:"100",children:"100 rows"}),e.jsx("option",{value:"200",children:"200 rows"})]}),e.jsx("button",{className:"v10-mlv-run-btn",onClick:se,children:"Search"})]})]}),(s!=="vm"||U)&&e.jsxs("div",{className:"v10-mlv-query-bar",children:[d!=null&&d.length?e.jsxs("select",{className:"v10-vm-search-select",value:C,onChange:a=>{const H=a.target.value;m(H);const z=d.find(pe=>pe.label===H),ae=(z==null?void 0:z.query)??"";y(ae),v(ae)},children:[e.jsx("option",{value:"",children:"Select common query..."}),d.map(a=>e.jsx("option",{value:a.label,children:a.label},a.label))]}):e.jsx("input",{type:"text",className:"v10-mlv-query-input",placeholder:"Custom SPARQL query...",value:w,onChange:a=>y(a.target.value),onKeyDown:a=>{a.key==="Enter"&&ee()}}),e.jsx("button",{className:"v10-mlv-run-btn",onClick:ee,children:"Run"}),x&&e.jsx("button",{className:"v10-mlv-clear-btn",onClick:()=>v(""),title:"Reset to full layer overview",children:"Reset"}),e.jsxs("div",{className:"v10-mlv-view-toggle",children:[e.jsx("button",{className:`v10-mlv-toggle-btn ${p==="table"?"active":""}`,onClick:()=>N("table"),title:"Table view",children:Re}),e.jsx("button",{className:`v10-mlv-toggle-btn ${p==="graph"?"active":""}`,onClick:()=>N("graph"),title:"Graph view",children:Te})]})]}),V&&e.jsx("p",{className:"v10-mlv-status",children:"Loading..."}),Z&&e.jsxs("p",{className:"v10-mlv-status",style:{color:"var(--accent-red)"},children:["Error: ",Z]}),!V&&M.length===0&&e.jsxs("div",{className:"v10-mlv-empty",children:[e.jsxs("p",{children:["No triples found in ",r.label.toLowerCase(),"."]}),e.jsxs("p",{style:{fontSize:11,marginTop:4},children:[s==="wm"&&"Import files or chat with your agent to generate working memory.",s==="swm"&&"Promote assertions from working memory to share with collaborators.",s==="vm"&&"Publish shared memory to create verified on-chain knowledge."]})]}),!V&&M.length>0&&p==="table"&&e.jsxs("div",{className:"v10-mlv-table-wrap",children:[e.jsxs("div",{className:"v10-mlv-result-count",children:[M.length," triples"]}),e.jsxs("table",{className:"v10-mlv-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Subject"}),e.jsx("th",{children:"Predicate"}),e.jsx("th",{children:"Object"})]})}),e.jsx("tbody",{children:M.map((a,H)=>e.jsxs("tr",{children:[e.jsx("td",{className:"v10-mlv-cell",children:Q(_(a.s))}),e.jsx("td",{className:"v10-mlv-cell",children:Q(_(a.p))}),e.jsx("td",{className:"v10-mlv-cell",children:Q(_(a.o))})]},H))})]})]}),!V&&F.length>0&&p==="graph"&&e.jsxs("div",{className:"v10-mlv-graph-container",children:[e.jsxs("div",{className:"v10-mlv-graph-info",children:[e.jsxs("span",{children:[F.length," triples"]}),x&&e.jsx("span",{className:"v10-mlv-graph-info-custom",children:"filtered"})]}),e.jsx(i.Suspense,{fallback:e.jsx("div",{className:"v10-mlv-graph-loading",children:"Loading graph renderer..."}),children:e.jsxs(Ce,{data:F,format:"triples",options:Ae,style:{width:"100%",height:"100%"},onNodeClick:ue,initialFit:!0,children:[e.jsx(Ee,{className:"v10-mlv-node-panel",showUri:!0,showTypes:!0,showProperties:!0,showMetadata:!1,maxValueLength:150}),e.jsx(Le,{contextGraphId:c,layer:s,explorerUrl:me})]})})]})]})}function Me({contextGraphId:s,onPromoted:c}){const{data:l,loading:g,refresh:d}=D(()=>de(s,"wm"),[s],0);B(s,d,{layers:["wm"]});const[r,p]=i.useState(null),[N,C]=i.useState(null),[m,w]=i.useState(null),[y,x]=i.useState(null),v=i.useCallback(async n=>{p(n.graphUri),C(null),w(null);try{const u=await ie(s,n.name,n.subGraph?{subGraphName:n.subGraph}:{}),o=we(n.name,u);C({message:o.message+(n.subGraph?` (in ${n.subGraph})`:""),kind:o.kind==="success"?"success":"noop",subGraph:n.subGraph}),d(),c()}catch(u){const o=re(n.name,u);w(o?{message:o.message,kind:"not-persisted"}:{message:(u==null?void 0:u.message)??"Promote failed",kind:"other"})}finally{p(null)}},[s,d,c]),S=i.useCallback(async()=>{if(!(l!=null&&l.length))return;p("__all__"),C(null),w(null);let n=0,u=null;try{for(const k of l)u=k.name,(await ie(s,k.name,k.subGraph?{subGraphName:k.subGraph}:{})).promotedCount===0&&(n+=1);const o=l.length-n,f=n>0?` (${n} already shared or still committing)`:"";C({message:o>0?`Shared ${o} complete Knowledge Asset${o===1?"":"s"} to Shared Working Memory${f}.`:"No Knowledge Assets were newly shared — all were already in Shared Working Memory or still committing.",kind:o>0?"success":"noop"}),d(),c()}catch(o){const f=re(u??"selected assertion",o);w(f?{message:f.message,kind:"not-persisted"}:{message:(o==null?void 0:o.message)??"Promote failed",kind:"other"})}finally{p(null)}},[l,s,d,c]);return g?e.jsx("div",{className:"v10-assertion-list-loading",children:"Loading assertions..."}):l!=null&&l.length?e.jsxs("div",{className:"v10-assertion-list",children:[e.jsxs("div",{className:"v10-assertion-list-header",children:[e.jsxs("span",{className:"v10-assertion-list-title",children:["Assertions in Working Memory (",l.length,")"]}),e.jsx("button",{className:"v10-btn-promote-all",disabled:r!==null,onClick:S,children:r==="__all__"?"Sharing...":"Share Complete KAs → SWM"})]}),e.jsx("div",{className:"v10-assertion-items",children:l.map(n=>e.jsxs("div",{className:"v10-assertion-item",children:[e.jsxs("div",{className:"v10-assertion-item-info",children:[e.jsx("button",{className:"v10-assertion-item-name clickable",title:n.graphUri,onClick:()=>x({name:n.name,subGraph:n.subGraph}),children:n.name}),n.tripleCount!=null&&e.jsxs("span",{className:"v10-assertion-item-count",children:[n.tripleCount," triples"]}),n.subGraph&&e.jsxs("span",{className:"v10-item-count v10-item-subgraph",title:`In sub-graph: ${n.subGraph}`,children:["› ",he(n.subGraph,18)]})]}),e.jsx("button",{className:"v10-btn-promote",disabled:r!==null,onClick:()=>v(n),title:"Share this complete Knowledge Asset to Shared Working Memory",children:r===n.graphUri?"Promoting...":"→ SWM"})]},n.graphUri))}),N&&e.jsx("div",{className:N.kind==="success"?"v10-promote-result success":"v10-promote-result info",children:N.message}),m&&e.jsx("div",{className:"v10-promote-result error",children:m.message}),y&&e.jsx(ke,{open:!0,onClose:()=>x(null),assertionName:y.name,subGraphName:y.subGraph,contextGraphId:s})]}):null}function _e({contextGraphId:s,onPublished:c}){const{data:l,loading:g,refresh:d}=D(()=>de(s,"swm"),[s],0);B(s,d,{layers:["swm"]});const[r,p]=i.useState(new Set),[N,C]=i.useState(!1),[m,w]=i.useState(null),[y,x]=i.useState(null),v=(l==null?void 0:l.map(t=>t.graphUri))??[],S=v.length>0&&v.every(t=>r.has(t)),n=i.useCallback(t=>{p(h=>{const L=new Set(h);return L.has(t)?L.delete(t):L.add(t),L})},[]),u=i.useCallback(()=>{p(S?new Set:new Set(v))},[S,v]),o=i.useCallback(async t=>{if(t.length!==0){C(!0),w(null),x(null);try{w(await fe(s,t)),p(new Set),d(),c()}catch(h){x((h==null?void 0:h.message)??"Publish failed")}finally{C(!1)}}},[s,d,c]),f=i.useCallback(()=>{const t=(l??[]).filter(h=>r.has(h.graphUri));return o(t)},[l,r,o]),k=i.useCallback(()=>o(l??[]),[l,o]),b=(l==null?void 0:l.reduce((t,h)=>t+(h.tripleCount??0),0))??0,P=(l==null?void 0:l.filter(t=>r.has(t.graphUri)).reduce((t,h)=>t+(h.tripleCount??0),0))??0,E=!g&&(!l||l.length===0);return g?e.jsx("div",{className:"v10-assertion-list-loading",children:"Loading SWM contents..."}):E?e.jsxs("div",{className:"v10-publish-panel",children:[e.jsx("div",{className:"v10-publish-panel-header",children:e.jsx("span",{className:"v10-publish-panel-title",children:"Publish to Verifiable Memory"})}),e.jsx("div",{className:"v10-publish-panel-empty",children:"No data in Shared Working Memory yet. Promote assertions from Working Memory first."})]}):e.jsxs("div",{className:"v10-publish-panel",children:[e.jsxs("div",{className:"v10-publish-panel-header",children:[e.jsxs("span",{className:"v10-publish-panel-title",children:["Knowledge assets in Shared Working Memory (",l.length," asset",l.length===1?"":"s"," · ",b," triples)"]}),e.jsxs("div",{className:"v10-publish-panel-header-actions",children:[e.jsx("button",{className:"v10-publish-panel-refresh",onClick:d,title:"Refresh",children:"↻"}),e.jsx("button",{className:"v10-btn-promote-all",disabled:N,onClick:k,children:N&&r.size===0?"Publishing...":"Publish All → VM"})]})]}),e.jsxs("div",{className:"v10-publish-select-bar",children:[e.jsxs("label",{className:"v10-publish-select-all",children:[e.jsx("input",{type:"checkbox",checked:S,onChange:u}),e.jsx("span",{children:"Select all"})]}),r.size>0&&e.jsx("button",{className:"v10-btn-publish",disabled:N,onClick:f,children:N?"Publishing...":`Publish ${r.size} selected (${P} triples) → VM`})]}),e.jsx("div",{className:"v10-assertion-items",children:l.map(t=>e.jsxs("div",{className:`v10-assertion-item ${r.has(t.graphUri)?"selected":""}`,children:[e.jsx("label",{className:"v10-publish-entity-check",children:e.jsx("input",{type:"checkbox",checked:r.has(t.graphUri),onChange:()=>n(t.graphUri)})}),e.jsxs("div",{className:"v10-assertion-item-info",children:[e.jsx("span",{className:"v10-assertion-item-name",title:t.graphUri,children:t.name}),t.subGraph&&e.jsxs("span",{className:"v10-item-count v10-item-subgraph",title:`In sub-graph: ${t.subGraph}`,children:["› ",he(t.subGraph,18)]}),t.tripleCount!=null&&e.jsxs("span",{className:"v10-assertion-item-count",children:[t.tripleCount," triples"]})]})]},t.graphUri))}),m&&(()=>{const{published:t,total:h,partial:L,partialError:U,failures:A,sample:j,convictionCostCovered:W}=m,$=t===h&&t>0&&L===0,O=(j==null?void 0:j.status)==="confirmed"&&!!j.txHash;return e.jsxs("div",{className:`v10-publish-result-card ${$?"success":"error"}`,children:[e.jsx("div",{className:"v10-publish-result-title",children:t>0?`Published ${t} of ${h} knowledge asset${h===1?"":"s"} to Verifiable Memory`:"NOT published to Verifiable Memory"}),L>0&&e.jsxs("div",{className:"v10-publish-result-details",style:{marginBottom:6},children:["⚠ ",L," asset",L===1?"":"s",": ",je(U)]}),A.length>0&&e.jsxs("div",{className:"v10-publish-result-details",style:{marginBottom:6},children:[A.length," asset",A.length===1?"":"s"," could not be published — ",A[0].name,": ",A[0].error,A.length>1?` (+${A.length-1} more)`:""]}),e.jsxs("div",{className:"v10-publish-result-details",children:[(j==null?void 0:j.kaId)!=null&&e.jsxs("div",{children:[e.jsx("span",{className:"v10-publish-result-label",children:"Knowledge Asset:"})," ",j.kaId]}),O?e.jsxs("div",{className:"v10-publish-result-tx",children:[e.jsx("span",{className:"v10-publish-result-label",children:"Tx hash:"})," ",e.jsx("span",{className:"mono",title:j.txHash,children:j.txHash}),j.blockNumber!=null&&e.jsxs("span",{className:"v10-publish-result-block",children:[" (block ",j.blockNumber,")"]})]}):e.jsxs("div",{className:"v10-publish-result-details",children:["Verifiable Memory requires a confirmed ",e.jsx("code",{children:"KCCreated"})," event. If a publish did not land on-chain, check the node logs (typically a missing publisher wallet, an unfunded signer, or a chain adapter that isn't V10-ready)."]}),e.jsx(Ne,{convictionCostCovered:W})]})]})})(),y&&e.jsx("div",{className:"v10-publish-result-card error",children:y})]})}function _(s){if(s!=null)return typeof s=="string"?s:typeof s=="object"&&"value"in s?String(s.value):String(s)}function Q(s){if(!s)return"—";const c=s.lastIndexOf("#"),l=s.lastIndexOf("/"),g=Math.max(c,l);return g>=0?s.slice(g+1):s}function $e(s){const c=Number.isFinite(s.limit)&&s.limit>0?Math.floor(s.limit):50,l=s.query.trim();if(!l)return`SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT ${c}`;const g=Ue(l.toLowerCase()),d={subject:`CONTAINS(LCASE(STR(?s)), "${g}")`,predicate:`CONTAINS(LCASE(STR(?p)), "${g}")`,object:`CONTAINS(LCASE(STR(?o)), "${g}")`};return`SELECT ?s ?p ?o WHERE { ?s ?p ?o . FILTER(${s.field==="any"?`(${d.subject} || ${d.predicate} || ${d.object})`:d[s.field]}) } LIMIT ${c}`}function Ue(s){return s.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r")}export{Ve as MemoryLayerView,_e as PublishPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{bI as u,bx as x,ba as v,aN as e,bB as j,bJ as b,bA as y}from"./index-RLb1kuzE.js";import{r as N}from"./useProjectActivity-OdoQs9mK.js";const k=[{key:"working",title:"Working Memory",short:"WM",icon:"◇",color:"#64748b",desc:"Private agent drafts",tabPrefix:"wm"},{key:"shared",title:"Shared Working Memory",short:"SWM",icon:"◈",color:"#f59e0b",desc:"Team proposals",tabPrefix:"swm"},{key:"verified",title:"Verifiable Memory",short:"VM",icon:"◉",color:"#22c55e",desc:"On-chain knowledge",tabPrefix:"vm"}],f=["http://purl.org/dc/terms/created","http://dkg.io/ontology/github/mergedAt","http://dkg.io/ontology/github/closedAt","http://dkg.io/ontology/decisions/date","http://dkg.io/ontology/tasks/dueDate"];function $(){const{contextGraphs:s}=u(),{hidden:a}=x(),l=v.useMemo(()=>s.filter(t=>!a.has(t.id)),[s,a]);return e.jsxs("div",{className:"v10-memstack",children:[e.jsxs("div",{className:"v10-memstack-head",children:[e.jsx("h1",{className:"v10-memstack-title",children:"Memory Stack"}),e.jsxs("p",{className:"v10-memstack-sub",children:["Every layer across every context graph, at a glance. ",l.length," visible context graph",l.length===1?"":"s"," · hidden context graphs are skipped."]})]}),l.length===0?e.jsx("div",{className:"v10-memstack-empty",children:"No visible context graphs. Create one from the sidebar or un-hide dismissed ones."}):e.jsxs("div",{className:"v10-memstack-table",children:[e.jsxs("div",{className:"v10-memstack-colheads",children:[e.jsx("div",{className:"v10-memstack-colhead project"}),k.map(t=>e.jsxs("div",{className:"v10-memstack-colhead",style:{color:t.color},children:[e.jsx("span",{className:"v10-memstack-colhead-icon",children:t.icon}),e.jsx("span",{className:"v10-memstack-colhead-title",children:t.title}),e.jsx("span",{className:"v10-memstack-colhead-desc",children:t.desc})]},t.key))]}),l.map(t=>e.jsx(g,{cg:t},t.id))]})]})}function g({cg:s}){const a=j(s.id),{openTab:l}=b(),t=y(a),r=v.useMemo(()=>{const c={working:{entities:[],tripleCount:t.wm},shared:{entities:[],tripleCount:t.swm},verified:{entities:[],tripleCount:t.vm}};for(const i of a.entityList)c[i.trustLevel].entities.push(i);for(const i of Object.keys(c))c[i].entities.sort((o,n)=>{const d=h(o),p=h(n);return d&&p?p-d:d?-1:p?1:o.label.localeCompare(n.label)});return c},[a.entityList,t]),m=()=>l({id:`project:${s.id}`,label:s.name||s.id.slice(0,16),closable:!0});return e.jsxs("div",{className:"v10-memstack-row",children:[e.jsxs("div",{className:"v10-memstack-project",children:[e.jsxs("button",{type:"button",className:"v10-memstack-project-btn",onClick:m,children:[e.jsx("span",{className:"v10-memstack-project-dot"}),e.jsx("span",{className:"v10-memstack-project-name",children:s.name||s.id})]}),s.description&&e.jsx("div",{className:"v10-memstack-project-desc",title:s.description,children:s.description}),a.loading&&!a.entityList.length&&e.jsx("div",{className:"v10-memstack-project-status",children:"loading…"}),a.error&&e.jsx("div",{className:"v10-memstack-project-status error",children:a.error})]}),k.map(c=>{const i=r[c.key];return e.jsx(C,{cgId:s.id,color:c.color,layerTitle:c.title,tabPrefix:c.tabPrefix,entityCount:i.entities.length,tripleCount:i.tripleCount,recent:i.entities.slice(0,4),onOpenLayer:()=>l({id:`${c.tabPrefix}:${s.id}`,label:`${c.short} · ${s.name||s.id.slice(0,12)}`,closable:!0})},c.key)})]})}function C({cgId:s,color:a,layerTitle:l,tabPrefix:t,entityCount:r,tripleCount:m,recent:c,onOpenLayer:i}){const o=r===0;return e.jsxs("div",{className:`v10-memstack-cell${o?" empty":""}`,style:{"--cell-color":a},children:[e.jsxs("div",{className:"v10-memstack-cell-stats",children:[e.jsx("span",{className:"v10-memstack-cell-n",children:r}),e.jsxs("span",{className:"v10-memstack-cell-n-lbl",children:["entit",r===1?"y":"ies"]}),e.jsx("span",{className:"v10-memstack-cell-sep",children:"·"}),e.jsx("span",{className:"v10-memstack-cell-t",children:m.toLocaleString()}),e.jsx("span",{className:"v10-memstack-cell-t-lbl",children:"triples"})]}),c.length>0?e.jsx("ul",{className:"v10-memstack-cell-recent",children:c.map(n=>e.jsxs("li",{className:"v10-memstack-cell-recent-item",title:n.label,children:[e.jsx("span",{className:"v10-memstack-cell-recent-bullet"}),e.jsx("span",{className:"v10-memstack-cell-recent-label",children:n.label}),e.jsx("span",{className:"v10-memstack-cell-recent-time",children:N(w(n))})]},n.uri))}):e.jsxs("div",{className:"v10-memstack-cell-empty-hint",children:["Nothing in ",t.toUpperCase()," yet"]}),!o&&e.jsxs("button",{type:"button",className:"v10-memstack-cell-open",onClick:i,title:`Open ${l}`,children:["Open ",t.toUpperCase()," →"]})]})}function h(s){var a;for(const l of f){const t=(a=s.properties.get(l))==null?void 0:a[0];if(!t)continue;const r=new Date(t.replace(/^"|"$/g,"").replace(/^"(.+)"(?:@\w+|\^\^.+)?$/,"$1"));if(Number.isFinite(r.getTime()))return r.getTime()}return null}function w(s){const a=h(s);return a?new Date(a):null}export{$ as MemoryStackView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{bw as r,aN as e,g as o,bf as d,an as l,V as h,Q as x}from"./index-RLb1kuzE.js";function j({agent:s}){if(s.connectionStatus==="self")return e.jsx("span",{className:"badge",style:{background:"var(--text-muted)"},children:"Self"});if(s.connectionStatus==="connected"){const n=s.connectionTransport==="relayed"?"Relayed":"Direct",i=s.connectedSinceMs?` · ${l(s.connectedSinceMs)}`:"";return e.jsxs("span",{className:"badge badge-success",title:`${s.connectionDirection??""} ${n.toLowerCase()} connection${i}`,children:[n,i]})}return e.jsx("span",{className:"badge",style:{background:"var(--error)"},children:"Disconnected"})}function v(){const{data:s}=r(h,[],1e4),{data:n}=r(x,[],15e3),i=(s==null?void 0:s.connections)??[],a=(n==null?void 0:n.agents)??[];return e.jsxs("div",{children:[e.jsxs(o,{to:"/",className:"page-back-link",style:{display:"inline-flex",alignItems:"center",gap:6,marginBottom:12,fontSize:13,color:"var(--text-secondary)",textDecoration:"none"},children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M19 12H5"}),e.jsx("path",{d:"M12 19l-7-7 7-7"})]}),"Back to dashboard"]}),e.jsx("h1",{className:"page-title",children:"Network"}),e.jsxs("div",{className:"stats-grid",children:[e.jsxs("div",{className:"stat-card",children:[e.jsx("div",{className:"stat-label",children:"Total Connections"}),e.jsx("div",{className:"stat-value",children:(s==null?void 0:s.total)??"—"})]}),e.jsxs("div",{className:"stat-card",children:[e.jsx("div",{className:"stat-label",children:"Direct"}),e.jsx("div",{className:"stat-value",children:(s==null?void 0:s.direct)??"—"})]}),e.jsxs("div",{className:"stat-card",children:[e.jsx("div",{className:"stat-label",children:"Relayed"}),e.jsx("div",{className:"stat-value",children:(s==null?void 0:s.relayed)??"—"})]}),e.jsxs("div",{className:"stat-card",children:[e.jsx("div",{className:"stat-label",children:"Known Agents"}),e.jsx("div",{className:"stat-value",children:a.length})]})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"card-title",children:"Active Connections"}),i.length===0?e.jsxs("div",{className:"empty-state empty-state--compact",children:[e.jsx("div",{className:"empty-state-icon",children:e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M5 12h14"}),e.jsx("path",{d:"M12 5l7 7-7 7"})]})}),e.jsx("div",{className:"empty-state-title",children:"No active connections"}),e.jsx("div",{className:"empty-state-desc",children:"Connections will appear here as your node links with peers on the network."})]}):e.jsxs("table",{className:"data-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Peer"}),e.jsx("th",{children:"Transport"}),e.jsx("th",{children:"Direction"}),e.jsx("th",{children:"Remote Address"}),e.jsx("th",{children:"Duration"})]})}),e.jsx("tbody",{children:i.map((t,c)=>e.jsxs("tr",{children:[e.jsx("td",{className:"mono",children:d(t.peerId,12)}),e.jsx("td",{children:e.jsx("span",{className:`badge ${t.transport==="direct"?"badge-success":"badge-info"}`,children:t.transport})}),e.jsx("td",{children:t.direction}),e.jsx("td",{className:"mono",style:{fontSize:11},children:t.remoteAddr}),e.jsx("td",{children:l(t.durationMs)})]},c))})]})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"card-title",children:"Discovered Agents"}),a.length===0?e.jsxs("div",{className:"empty-state empty-state--compact",children:[e.jsx("div",{className:"empty-state-icon",children:e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}),e.jsx("div",{className:"empty-state-title",children:"No agents discovered"}),e.jsx("div",{className:"empty-state-desc",children:"Agents will be listed here as they are discovered through the network."})]}):e.jsxs("table",{className:"data-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Name"}),e.jsx("th",{children:"PeerId"}),e.jsx("th",{children:"Framework"}),e.jsx("th",{children:"Role"}),e.jsx("th",{children:"Connection"})]})}),e.jsx("tbody",{children:a.map((t,c)=>e.jsxs("tr",{children:[e.jsx("td",{style:{fontWeight:600},children:t.name}),e.jsx("td",{className:"mono",children:d(t.peerId,12)}),e.jsx("td",{children:t.framework??"—"}),e.jsx("td",{children:t.nodeRole??"—"}),e.jsx("td",{children:e.jsx(j,{agent:t})})]},c))})]})]})]})}export{v as NetworkPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ba as h,aN as e}from"./index-RLb1kuzE.js";import{u as x}from"./index-UvxrSkC_.js";import{u as N,t as r}from"./useEntityOnChainReceipt-BRK_O_sb.js";import"./string-DtUow4KV.js";const b={wm:"This entity lives in Working Memory — a private local draft. It gets an on-chain anchor only after it is promoted and published to Verifiable Memory.",swm:"This entity lives in Shared Working Memory. It is not anchored on-chain until it is published to Verifiable Memory.",vm:"No on-chain receipt found for this entity yet. It may still be settling, or it was read back from a pre-cutover graph."},w=({contextGraphId:t,layer:a,explorerUrl:l})=>{const{selectedNode:n}=x(),[p,d]=h.useState(null),s=(n==null?void 0:n.id)??null;h.useEffect(()=>{d(null)},[s]);const v=!!s&&s!==p,i=N(t,s,v);if(!v||!n)return null;const o=y=>{var m;(m=navigator.clipboard)==null||m.writeText(y).catch(()=>{})},u=n.label||n.id,c=i.status==="verified";return e.jsxs("div",{className:`v10-graph-prov-card${c?" verified":""}`,role:"dialog","aria-label":"On-chain provenance",children:[e.jsxs("div",{className:"v10-graph-prov-head",children:[e.jsx("span",{className:"v10-graph-prov-glyph",children:c?"◉":"◌"}),e.jsx("span",{className:"v10-graph-prov-title",children:"On-chain provenance"}),c&&e.jsx("span",{className:"v10-graph-prov-badge",children:"VERIFIED"}),e.jsx("button",{type:"button",className:"v10-graph-prov-close",onClick:()=>d(s),"aria-label":"Dismiss",title:"Dismiss",children:"×"})]}),e.jsx("div",{className:"v10-graph-prov-entity",title:n.id,children:u}),i.status==="loading"&&e.jsx("div",{className:"v10-graph-prov-muted",children:"Resolving on-chain identity…"}),i.status==="error"&&e.jsx("div",{className:"v10-graph-prov-muted",children:"Couldn’t load on-chain identity."}),i.status==="offchain"&&e.jsxs("div",{className:"v10-graph-prov-offchain",children:[e.jsx("span",{className:"v10-graph-prov-offchain-tag",children:"Off-chain"}),e.jsx("p",{children:b[a??"vm"]})]}),c&&e.jsxs("div",{className:"v10-vm-identity",style:{margin:0,background:"none",border:"none",padding:0},children:[i.ual&&e.jsxs("div",{className:"v10-vm-identity-row",children:[e.jsx("span",{className:"v10-vm-identity-lbl",children:"UAL"}),e.jsx("span",{className:"v10-vm-identity-val mono",title:i.ual,children:i.ual}),e.jsx("button",{type:"button",className:"v10-vm-identity-copy",onClick:()=>o(i.ual),title:"Copy UAL",children:"⎘"})]}),i.txHash&&e.jsxs("div",{className:"v10-vm-identity-row",children:[e.jsx("span",{className:"v10-vm-identity-lbl",children:"Tx"}),l?e.jsxs("a",{className:"v10-vm-identity-val mono v10-graph-prov-link",href:`${l}/tx/${i.txHash}`,target:"_blank",rel:"noopener noreferrer",title:i.txHash,children:[r(i.txHash,10,8)," ↗"]}):e.jsx("span",{className:"v10-vm-identity-val mono",title:i.txHash,children:r(i.txHash,10,8)}),e.jsx("button",{type:"button",className:"v10-vm-identity-copy",onClick:()=>o(i.txHash),title:"Copy transaction hash",children:"⎘"})]}),i.blockNumber&&e.jsxs("div",{className:"v10-vm-identity-row",children:[e.jsx("span",{className:"v10-vm-identity-lbl",children:"Block"}),e.jsx("span",{className:"v10-vm-identity-val mono",children:j(i.blockNumber)})]}),i.kaId&&e.jsxs("div",{className:"v10-vm-identity-row",children:[e.jsx("span",{className:"v10-vm-identity-lbl",children:"KA id"}),e.jsx("span",{className:"v10-vm-identity-val mono",title:i.kaId,children:r(i.kaId,8,8)}),e.jsx("button",{type:"button",className:"v10-vm-identity-copy",onClick:()=>o(i.kaId),title:"Copy KA id",children:"⎘"})]}),i.author&&e.jsxs("div",{className:"v10-vm-identity-row",children:[e.jsx("span",{className:"v10-vm-identity-lbl",children:"Author"}),l?e.jsxs("a",{className:"v10-vm-identity-val mono v10-graph-prov-link",href:`${l}/address/${i.author}`,target:"_blank",rel:"noopener noreferrer",title:i.author,children:[r(i.author,6,4)," ↗"]}):e.jsx("span",{className:"v10-vm-identity-val mono",title:i.author,children:r(i.author,6,4)}),e.jsx("button",{type:"button",className:"v10-vm-identity-copy",onClick:()=>o(i.author),title:"Copy author address",children:"⎘"})]}),i.finalizedAt&&e.jsxs("div",{className:"v10-vm-identity-row",children:[e.jsx("span",{className:"v10-vm-identity-lbl",children:"Finalized"}),e.jsx("span",{className:"v10-vm-identity-val",children:f(i.finalizedAt)})]})]})]})};function j(t){const a=Number.parseInt(t,10);return Number.isFinite(a)?a.toLocaleString():t}function f(t){const a=new Date(t.replace(/^"|"$/g,""));return Number.isFinite(a.getTime())?a.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):t}export{w as OnChainProvenanceCard};
|