@glacislabs/stablegenie-zerodelta 3.4.0 → 4.1.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.
@@ -1,5 +1,5 @@
1
- import { CHAIN_DISPLAY_NAMES, EXECUTABLE_STABLE_ASSETS, STABLE_ASSETS, SUPPORTED_ASSETS, symbolKey, normalizeDecimalText, parseUnitsDecimal, assetDecimals, findToken, counterpartTokens, assetClassOf, brokenLaneFor, brokenLaneReason, destinationAvailability, SUPPORTED_CHAIN_IDS, formatUnits, createEngine, routeNativeValue, checkNativeFee, nativeFeeShortLabel, nativeSymbol, nativeFeeShortMessage, allowanceCovers, validatePlannedTransaction, BUNDLED_RPC } from './chunk-TYQF2L5C.js';
2
- import { createContext, useMemo, useState, useEffect, useRef, useCallback, useId, createElement, useContext } from 'react';
1
+ import { CHAIN_DISPLAY_NAMES, EXECUTABLE_STABLE_ASSETS, STABLE_ASSETS, SUPPORTED_ASSETS, complianceView, complianceChecks, DIRECT_CHECK_IDS, complianceTagOf, symbolKey, normalizeDecimalText, parseUnitsDecimal, assetDecimals, findToken, counterpartTokens, assetClassOf, brokenLaneFor, brokenLaneReason, destinationAvailability, SUPPORTED_CHAIN_IDS, formatUnits, unattributedComplianceReasons, distinctScreenedWallets, humanizeComplianceReason, DIRECT_SCOPE_NOTE, categoryLabel, SCREENING_BUCKETS, createEngine, routeNativeValue, checkNativeFee, nativeFeeShortLabel, nativeSymbol, nativeFeeShortMessage, allowanceCovers, validatePlannedTransaction, BUNDLED_RPC } from './chunk-YEYFEQWS.js';
2
+ import { createContext, useState, useRef, useEffect, useMemo, useCallback, useId, createElement, useContext } from 'react';
3
3
  import { createRoot } from 'react-dom/client';
4
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
5
 
@@ -453,7 +453,10 @@ function useFlow(args) {
453
453
  account,
454
454
  recipient,
455
455
  settlement: route.state === "DIRECT" ? "direct" : "escrow",
456
- status: v.status === "confirmed" ? "confirmed" : v.status === "mismatch" || v.status === "reverted" ? "error" : "unconfirmed"
456
+ status: v.status === "confirmed" ? "confirmed" : v.status === "mismatch" || v.status === "reverted" ? "error" : "unconfirmed",
457
+ // One signature can be several orders. Record them, or the history of a chained RWA trade
458
+ // reads as a single hop that skipped a chain it demonstrably went through.
459
+ legs: route.legs
457
460
  });
458
461
  setLastTxEntry(entry.hash ? entry : null);
459
462
  appendTxHistory(account, entry);
@@ -674,6 +677,12 @@ var WIDGET_CSS = `
674
677
  @keyframes sg-shimmer{0%{background-position:100% 0}100%{background-position:-100% 0}}
675
678
 
676
679
  .sg-foot{margin-top:14px;display:flex;align-items:center;justify-content:center;gap:6px;font-size:11px;color:var(--sg-text-muted);text-align:center}
680
+ /* display:inline-block is load-bearing, not tidiness. A host running a CSS reset \u2014 Tailwind
681
+ preflight, which most integrators use and which this repo's own playground applies \u2014 sets
682
+ svg{display:block}, and the padlock then takes a line of its own above the sentence. Every other
683
+ glyph in the widget sits in a flex or absolute box where that is harmless; this is the one that
684
+ lives in normal text flow. (WIDGET_CSS is a template literal: no backticks in these comments.) */
685
+ .sg-foot svg{display:inline-block;vertical-align:-1px;margin-right:5px}
677
686
 
678
687
  /* fixed-height variant \u2014 head/foot pinned, body scrolls */
679
688
  .sg-widget[data-sg-fixed="true"]{display:flex;flex-direction:column}
@@ -693,6 +702,7 @@ var WIDGET_CSS = `
693
702
  .sg-tile:disabled{cursor:default}
694
703
  .sg-tile-label{font-size:12px;color:var(--sg-text-muted)}
695
704
  .sg-tile-main{display:flex;align-items:center;gap:10px;min-width:0}
705
+ .sg-tile-text{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
696
706
  .sg-tile-sym{font-size:16px;font-weight:700;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
697
707
  .sg-tile-chain{font-size:11px;color:var(--sg-text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
698
708
  .sg-tile-empty{color:var(--sg-text-muted);font-size:15px;font-weight:600}
@@ -727,7 +737,9 @@ img.sg-tok-badge{width:16px;padding:0;object-fit:cover;background:var(--sg-bg)}
727
737
  .sg-sel-head{display:flex;align-items:center;margin-bottom:14px}
728
738
  .sg-back{width:32px;height:32px;flex:0 0 auto;border:none;border-radius:999px;background:transparent;color:var(--sg-text);cursor:pointer;font:inherit;display:flex;align-items:center;justify-content:center;transition:background 120ms ease}
729
739
  .sg-back:hover{background:var(--sg-surface)}
730
- .sg-sel-title{flex:1 1 auto;text-align:center;font-size:15px;font-weight:600;margin-right:32px}
740
+ .sg-sel-title{flex:1 1 auto;min-width:0;text-align:center;font-size:15px;font-weight:600;margin-right:32px}
741
+ /* Whose transactions these are \u2014 history is per wallet, and the takeover hides the header's pill. */
742
+ .sg-sel-sub{display:block;font-size:11px;font-weight:600;color:var(--sg-text-muted);margin-top:1px}
731
743
  /* Scrolls at ~2.5 rows. The catalogue's destination chains outnumber its source chains three to one
732
744
  (9 escrow chains, ~37 total), so an ungated grid was eight rows tall and pushed the token list \u2014
733
745
  the thing the panel exists for \u2014 below the fold. The fade is a scroll affordance, not decoration. */
@@ -786,6 +798,53 @@ img.sg-tok-badge{width:16px;padding:0;object-fit:cover;background:var(--sg-bg)}
786
798
  .sg-hist{width:32px;height:32px;flex:0 0 auto;border:1px solid var(--sg-border);border-radius:999px;background:transparent;color:var(--sg-text-muted);cursor:pointer;font:inherit;display:flex;align-items:center;justify-content:center;transition:color 120ms ease,border-color 120ms ease}
787
799
  .sg-hist:hover{color:var(--sg-accent);border-color:var(--sg-accent)}
788
800
 
801
+ /* transaction history row. NOT the picker's flex row: at 390px that layout wrapped the pair onto two
802
+ lines and then ellipsised the whole meta line down to "\u2026". A 3-column grid instead, where the meta
803
+ spans the badge column so it always has the full card width to wrap into. */
804
+ .sg-txrow{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:11px;row-gap:3px;align-items:center;width:100%;padding:10px 8px;border:none;border-radius:var(--sg-radius-control);background:transparent;color:var(--sg-text);cursor:pointer;font:inherit;text-align:left;transition:background 120ms ease}
805
+ .sg-txrow:hover{background:var(--sg-surface)}
806
+ /* Both ends of the trade, side by side \u2014 the RWA gets a mark of its own. NOT overlapped: each disc
807
+ carries a chain badge at its bottom-right, and an overlap parks that badge on top of its neighbour. */
808
+ .sg-txrow-glyphs{grid-column:1;grid-row:1 / span 2;display:flex;align-items:center;gap:9px}
809
+ /* Each side is its own nowrap span, so a narrow card breaks the line AT THE ARROW, never mid-symbol. */
810
+ .sg-txrow-pair{grid-column:2;grid-row:1;display:flex;flex-wrap:wrap;align-items:baseline;gap:0 6px;font-size:14px;font-weight:700;line-height:1.35;min-width:0}
811
+ .sg-txrow-side{white-space:nowrap;display:inline-flex;align-items:center;gap:5px}
812
+ .sg-txrow-arrow{display:inline-flex;color:var(--sg-text-muted)}
813
+ /* Meta and status share line 2. The badge sat beside the pair until it squeezed the pair onto two
814
+ lines at 390px; down here the pair gets the card's full width and the badge still reads at a glance. */
815
+ /* flex-start, not center: on a phone the meta wraps to two lines, and a centred badge then floats
816
+ between them. Pinned to the first line it reads as the row's status rather than as a third line. */
817
+ .sg-txrow-meta{grid-column:2;grid-row:2;display:flex;align-items:flex-start;gap:8px;font-size:11.5px;color:var(--sg-text-muted);line-height:1.4}
818
+ .sg-txrow-when{flex:1 1 auto;min-width:0;display:flex;flex-wrap:wrap;column-gap:8px}
819
+ /* The kind+chain+orders unit WRAPS; only the timestamp is unbreakable. Holding both as nowrap made
820
+ the express card (the narrowest surface) overflow its text straight under the status pill. */
821
+ .sg-txrow-time{white-space:nowrap}
822
+ .sg-txrow-what{display:flex;flex-wrap:wrap;column-gap:5px;min-width:0}
823
+ .sg-txrow-what>span{white-space:nowrap}
824
+ /* The separator is the literal character, never a CSS unicode escape. WIDGET_CSS is a JS template
825
+ literal, so a backslash-zero-zero escape in here is a legacy octal sequence and esbuild refuses to
826
+ build the package at all \u2014 including inside a comment like this one. */
827
+ .sg-txrow-what>span:not(:last-child)::after{content:"\xB7";margin-left:5px}
828
+ .sg-txrow-end{flex:0 0 auto;margin-left:auto}
829
+
830
+ /* transaction detail: the route, one row per ORDER. A chained (RWA) trade is ONE signature and TWO
831
+ orders; the numbered rail is what makes the middle hop visible instead of merely implied. */
832
+ /* The pair's artwork above the anchor amount, same marks the pickers draw. */
833
+ .sg-panel > .sg-txrow-glyphs{margin-bottom:10px}
834
+ .sg-legs{margin-top:14px}
835
+ .sg-legs-head{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:13px;margin-bottom:6px}
836
+ .sg-leg-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}
837
+ .sg-leg{display:flex;align-items:flex-start;gap:10px;padding:8px 0;border-bottom:1px solid var(--sg-border)}
838
+ .sg-leg:last-child{border-bottom:none}
839
+ /* The step number doubles as the rail: a pseudo-element joins consecutive orders, so two legs read as
840
+ one continuous path rather than as two unrelated rows. */
841
+ .sg-leg-n{position:relative;flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;margin-top:1px;border-radius:999px;background:color-mix(in srgb,var(--sg-accent) 14%,transparent);color:var(--sg-accent);font-size:10px;font-weight:700;font-variant-numeric:tabular-nums}
842
+ .sg-leg:not(:last-child) .sg-leg-n::after{content:"";position:absolute;top:19px;left:50%;width:1px;height:calc(100% + 6px);background:var(--sg-border)}
843
+ .sg-leg-body{min-width:0;flex:1 1 auto}
844
+ .sg-leg-line{display:flex;align-items:center;gap:7px;flex-wrap:wrap;font-size:13px;font-weight:600}
845
+ .sg-leg-arrow{display:inline-flex;color:var(--sg-text-muted)}
846
+ .sg-leg-sub{margin-top:2px;font-size:11.5px;color:var(--sg-text-muted);line-height:1.45}
847
+
789
848
  /* transaction detail: copyable hash row (no external links \u2014 everything stays in-widget) */
790
849
  .sg-txd-hash{display:flex;align-items:center;gap:8px;margin-top:12px;font-size:13px}
791
850
  .sg-txd-hash .sg-mono{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@@ -936,6 +995,98 @@ img.sg-tok-badge{width:16px;padding:0;object-fit:cover;background:var(--sg-bg)}
936
995
  .sg-island .sg-spinner{display:none!important}
937
996
  .sg-island .sg-rm-dot{display:inline-block}
938
997
  }
998
+
999
+ /* \u2500\u2500 compliance disclosure \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
1000
+ Mirrors the dApp's compliance row + details dialog. The row is a quiet affordance in the payment
1001
+ summary; the details open a sheet that fills the widget's own card, because a page-level modal
1002
+ inside somebody else's checkout is a z-index fight we would lose.
1003
+
1004
+ Tone note, carried over from the dApp: a PASS reads in body ink, not in green. The shield tick is
1005
+ already green, so colouring the sentence too says the same thing twice and spends the accent on
1006
+ the half that carries no information. A DENY still shouts. */
1007
+ /* NOT positioned. The sheet is inset:0 against the WIDGET CARD, so this wrapper must not become
1008
+ the containing block: when it carried position:relative the sheet collapsed to the height of
1009
+ this one row and drew straight through the CTA beneath it.
1010
+ NB this stylesheet is a JS template literal - never write a backtick in these comments. */
1011
+ .sg-cp{margin-top:10px}
1012
+ .sg-cp-row{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:9px 12px;border:1px solid var(--sg-border);border-radius:var(--sg-radius-control);background:var(--sg-surface);color:inherit;font:inherit;text-align:left;cursor:pointer;transition:border-color 120ms ease,background 120ms ease}
1013
+ .sg-cp-row:hover{border-color:color-mix(in srgb,var(--sg-accent) 40%,var(--sg-border))}
1014
+ .sg-cp-row:focus-visible{outline:2px solid var(--sg-accent);outline-offset:2px}
1015
+ .sg-cp-row-main{display:flex;align-items:center;gap:8px;min-width:0}
1016
+ .sg-cp-row-glyph{display:flex;flex:0 0 auto;color:var(--sg-success)}
1017
+ .sg-cp-row[data-tone="neutral"] .sg-cp-row-glyph{color:var(--sg-text-muted);opacity:.55}
1018
+ .sg-cp-row[data-tone="blocked"] .sg-cp-row-glyph,.sg-cp-row[data-tone="warn"] .sg-cp-row-glyph{color:var(--sg-danger)}
1019
+ .sg-cp-row-label{font-size:13px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
1020
+ .sg-cp-row[data-tone="neutral"] .sg-cp-row-label{color:var(--sg-text-muted)}
1021
+ .sg-cp-row[data-tone="blocked"] .sg-cp-row-label,.sg-cp-row[data-tone="warn"] .sg-cp-row-label{color:var(--sg-danger)}
1022
+ .sg-cp-row-chev{display:flex;flex:0 0 auto;color:var(--sg-text-muted)}
1023
+ .sg-cp-row-tag{display:block;margin:4px 0 0 32px;font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--sg-text-muted)}
1024
+
1025
+ /* the sheet \u2014 fills the widget card */
1026
+ .sg-cp-sheet{display:flex;flex-direction:column;padding:14px;background:var(--sg-bg);border:1px solid var(--sg-border);border-radius:var(--sg-radius-control);animation:sg-cp-in var(--sg-motion-fast) var(--sg-ease-out-soft) both}
1027
+ @keyframes sg-cp-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
1028
+ .sg-cp-sheet:focus{outline:none}
1029
+ .sg-cp-sheet-head{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:0 0 auto}
1030
+ .sg-cp-sheet-title{margin:0;font-size:15px;font-weight:600}
1031
+ .sg-cp-close{display:flex;align-items:center;justify-content:center;width:28px;height:28px;flex:0 0 auto;border:0;border-radius:8px;background:transparent;color:var(--sg-text-muted);cursor:pointer;transition:background 120ms ease,color 120ms ease}
1032
+ .sg-cp-close:hover{background:var(--sg-surface);color:var(--sg-text)}
1033
+ .sg-cp-close:focus-visible{outline:2px solid var(--sg-accent);outline-offset:2px}
1034
+ .sg-cp-tabs{display:flex;align-items:center;gap:4px;flex:0 0 auto;margin-top:10px;padding:4px;border:1px solid var(--sg-border);border-radius:14px}
1035
+ .sg-cp-tab{flex:1 1 0;min-width:0;padding:7px 8px;border:0;border-radius:11px;background:transparent;color:var(--sg-text-muted);font:inherit;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;cursor:pointer;transition:background 120ms ease,color 120ms ease}
1036
+ .sg-cp-tab[data-active="true"]{background:color-mix(in srgb,var(--sg-accent) 10%,transparent);color:var(--sg-accent)}
1037
+ .sg-cp-tab:focus-visible{outline:2px solid var(--sg-accent);outline-offset:-2px}
1038
+ .sg-cp-sheet-body{margin-top:10px}
1039
+ .sg-cp-tabpanel{display:flex;flex-direction:column;gap:8px}
1040
+
1041
+ /* cards */
1042
+ .sg-cp-card{display:flex;flex-direction:column;gap:12px;padding:14px;border:1px solid var(--sg-border);border-radius:16px}
1043
+ .sg-cp-card-head{display:flex;align-items:center;gap:8px}
1044
+ .sg-cp-card-glyph{display:flex;flex:0 0 auto;color:var(--sg-accent)}
1045
+ .sg-cp-card-title{margin:0;font-size:14px;font-weight:600}
1046
+ .sg-cp-summary{display:flex;flex-direction:column;gap:3px}
1047
+ .sg-cp-summary-head{display:flex;align-items:center;gap:8px;color:var(--sg-success)}
1048
+ .sg-cp-summary-head[data-tone="neutral"]{color:var(--sg-text-muted)}
1049
+ .sg-cp-summary-head[data-tone="blocked"],.sg-cp-summary-head[data-tone="warn"]{color:var(--sg-danger)}
1050
+ .sg-cp-summary-title{font-size:14px;font-weight:600;color:var(--sg-text)}
1051
+ .sg-cp-summary-head[data-tone="blocked"] .sg-cp-summary-title,.sg-cp-summary-head[data-tone="warn"] .sg-cp-summary-title{color:var(--sg-danger)}
1052
+ .sg-cp-summary-sub{margin:0;padding-left:24px;font-size:12px;line-height:1.35;color:var(--sg-text-muted)}
1053
+
1054
+ /* per-control rows */
1055
+ .sg-cp-checks{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:11px}
1056
+ .sg-cp-check-head{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px}
1057
+ .sg-cp-check-label{display:flex;align-items:center;gap:8px;min-width:0;font-size:13.5px;line-height:1.25}
1058
+ .sg-cp-check[data-ok="false"] .sg-cp-check-label{color:var(--sg-danger)}
1059
+ .sg-cp-check-mark{display:flex;flex:0 0 auto;color:var(--sg-success)}
1060
+ .sg-cp-check-mark[data-ok="false"]{color:var(--sg-danger)}
1061
+ .sg-cp-check-note,.sg-cp-check-reason{display:block;padding-left:20px;margin-top:3px;font-size:11.5px;line-height:1.4;color:var(--sg-text-muted);overflow-wrap:anywhere}
1062
+ .sg-cp-check-reason{color:var(--sg-danger)}
1063
+ .sg-cp-link{display:inline-flex;align-items:center;gap:5px;padding:0;border:0;background:transparent;color:var(--sg-accent);font:inherit;font-size:12px;font-weight:500;cursor:pointer}
1064
+ .sg-cp-link:hover{text-decoration:underline}
1065
+ .sg-cp-link:focus-visible{outline:2px solid var(--sg-accent);outline-offset:2px;border-radius:4px}
1066
+ .sg-cp-orphans{list-style:none;margin:0;padding:0 0 0 20px;display:flex;flex-direction:column;gap:3px;font-size:11.5px;line-height:1.4;color:var(--sg-danger)}
1067
+ .sg-cp-scope{margin:0;font-size:11.5px;line-height:1.45;color:var(--sg-text-muted)}
1068
+ .sg-cp-flags{margin:0;font-size:13px}
1069
+
1070
+ /* quote details */
1071
+ .sg-cp-facts{margin:0;display:flex;flex-direction:column;gap:9px}
1072
+ .sg-cp-fact{display:grid;grid-template-columns:78px minmax(0,1fr);align-items:center;gap:10px}
1073
+ .sg-cp-fact dt{font-size:12px;color:var(--sg-text-muted)}
1074
+ .sg-cp-fact dd{margin:0;font-size:13px;min-width:0;overflow-wrap:anywhere}
1075
+
1076
+ /* screening policy */
1077
+ .sg-cp-policy-head{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:8px;padding-bottom:2px}
1078
+ .sg-cp-policy-id{font-size:11px;color:var(--sg-text-muted);overflow-wrap:anywhere}
1079
+ .sg-cp-policy-facts{padding:2px 0 8px}
1080
+ .sg-cp-buckets{display:flex;flex-direction:column;gap:8px}
1081
+ .sg-cp-bucket{gap:10px;padding:12px 14px}
1082
+ .sg-cp-bucket-head{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:4px 10px}
1083
+ .sg-cp-bucket-detail{font-size:11.5px;color:var(--sg-text-muted)}
1084
+ .sg-cp-cats{list-style:none;margin:0;padding:0 0 0 4px;display:flex;flex-direction:column;gap:5px}
1085
+ .sg-cp-cats li{display:flex;align-items:center;gap:10px;font-size:12.5px;line-height:1.35}
1086
+ .sg-cp-dot{flex:0 0 auto;width:4px;height:4px;border-radius:999px;background:var(--sg-accent);opacity:.8}
1087
+
1088
+ /* express (PaymentIsland) trims the card padding, so the sheet follows */
1089
+ @media (prefers-reduced-motion:reduce){.sg-cp-sheet{animation:none}}
939
1090
  `;
940
1091
  var injected = false;
941
1092
  function injectStyles() {
@@ -1083,10 +1234,10 @@ function WidgetShell(props) {
1083
1234
  ] })
1084
1235
  ] }),
1085
1236
  /* @__PURE__ */ jsx("div", { className: "sg-body", children: props.children }),
1086
- /* @__PURE__ */ jsxs("div", { className: "sg-foot", children: [
1237
+ /* @__PURE__ */ jsx("div", { className: "sg-foot", children: /* @__PURE__ */ jsxs("span", { children: [
1087
1238
  /* @__PURE__ */ jsx(LockGlyph, {}),
1088
1239
  " Your wallet signs every transaction \xB7 Powered by ZeroDelta"
1089
- ] })
1240
+ ] }) })
1090
1241
  ] });
1091
1242
  }
1092
1243
  function shortAddress(a) {
@@ -1301,6 +1452,251 @@ function RouteList(props) {
1301
1452
  ] }) : null
1302
1453
  ] });
1303
1454
  }
1455
+ function ShieldTick({ size = 16 }) {
1456
+ return /* @__PURE__ */ jsxs("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
1457
+ /* @__PURE__ */ jsx("path", { d: "M12 2.5 4.5 5.5v6c0 4.4 3.1 8.5 7.5 10 4.4-1.5 7.5-5.6 7.5-10v-6L12 2.5Z", fill: "currentColor", opacity: ".14" }),
1458
+ /* @__PURE__ */ jsx("path", { d: "M12 2.5 4.5 5.5v6c0 4.4 3.1 8.5 7.5 10 4.4-1.5 7.5-5.6 7.5-10v-6L12 2.5Z", stroke: "currentColor", strokeWidth: "1.6", strokeLinejoin: "round" }),
1459
+ /* @__PURE__ */ jsx("path", { d: "m8.6 11.9 2.3 2.3 4.5-4.5", stroke: "currentColor", strokeWidth: "1.9", strokeLinecap: "round", strokeLinejoin: "round" })
1460
+ ] });
1461
+ }
1462
+ function TickCircle({ size = 16 }) {
1463
+ return /* @__PURE__ */ jsxs("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
1464
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10", fill: "currentColor" }),
1465
+ /* @__PURE__ */ jsx("path", { d: "m7.8 12.2 2.7 2.7 5.7-5.8", stroke: "var(--sg-bg)", strokeWidth: "2.1", strokeLinecap: "round", strokeLinejoin: "round" })
1466
+ ] });
1467
+ }
1468
+ function CloseCircle({ size = 16 }) {
1469
+ return /* @__PURE__ */ jsxs("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
1470
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10", fill: "currentColor" }),
1471
+ /* @__PURE__ */ jsx("path", { d: "m8.7 8.7 6.6 6.6M15.3 8.7l-6.6 6.6", stroke: "var(--sg-bg)", strokeWidth: "2.1", strokeLinecap: "round" })
1472
+ ] });
1473
+ }
1474
+ function PendingCircle({ size = 16 }) {
1475
+ return /* @__PURE__ */ jsxs("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
1476
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "9.2", stroke: "currentColor", strokeWidth: "1.6", strokeDasharray: "3 3" }),
1477
+ /* @__PURE__ */ jsx("path", { d: "M8.5 12h7", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round" })
1478
+ ] });
1479
+ }
1480
+ function Tick({ size = 12 }) {
1481
+ return /* @__PURE__ */ jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "m4.5 12.8 5 5L19.5 6.5", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round" }) });
1482
+ }
1483
+ function Cross({ size = 12 }) {
1484
+ return /* @__PURE__ */ jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "m5.5 5.5 13 13M18.5 5.5l-13 13", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round" }) });
1485
+ }
1486
+ function Chevron({ size = 16 }) {
1487
+ return /* @__PURE__ */ jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "m9 5 7 7-7 7", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
1488
+ }
1489
+ function Info({ size = 16 }) {
1490
+ return /* @__PURE__ */ jsxs("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
1491
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10", fill: "currentColor" }),
1492
+ /* @__PURE__ */ jsx("path", { d: "M12 10.6v6", stroke: "var(--sg-bg)", strokeWidth: "2.1", strokeLinecap: "round" }),
1493
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "7.6", r: "1.25", fill: "var(--sg-bg)" })
1494
+ ] });
1495
+ }
1496
+ function Lock({ size = 16 }) {
1497
+ return /* @__PURE__ */ jsxs("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
1498
+ /* @__PURE__ */ jsx("rect", { x: "4.5", y: "10.5", width: "15", height: "9.5", rx: "2.2", stroke: "currentColor", strokeWidth: "1.7" }),
1499
+ /* @__PURE__ */ jsx("path", { d: "M8 10.5V7.8a4 4 0 0 1 8 0v2.7", stroke: "currentColor", strokeWidth: "1.7", strokeLinecap: "round" })
1500
+ ] });
1501
+ }
1502
+ function ShieldOutline({ size = 16 }) {
1503
+ return /* @__PURE__ */ jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M12 2.5 4.5 5.5v6c0 4.4 3.1 8.5 7.5 10 4.4-1.5 7.5-5.6 7.5-10v-6L12 2.5Z", stroke: "currentColor", strokeWidth: "1.7", strokeLinejoin: "round" }) });
1504
+ }
1505
+ function WarningFilled({ size = 16 }) {
1506
+ return /* @__PURE__ */ jsxs("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
1507
+ /* @__PURE__ */ jsx("path", { d: "M12 3.2 21.4 19.4H2.6L12 3.2Z", fill: "currentColor" }),
1508
+ /* @__PURE__ */ jsx("path", { d: "M12 9.4v4.3", stroke: "var(--sg-bg)", strokeWidth: "1.9", strokeLinecap: "round" }),
1509
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "16.4", r: "1.05", fill: "var(--sg-bg)" })
1510
+ ] });
1511
+ }
1512
+ function CornerArrow({ size = 12 }) {
1513
+ return /* @__PURE__ */ jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M7 17 17 7M9 7h8v8", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round" }) });
1514
+ }
1515
+ var POLICY_GLYPH = {
1516
+ "always-blocked": Lock,
1517
+ blocked: ShieldOutline,
1518
+ flagged: WarningFilled
1519
+ };
1520
+ var POLICY_DETAIL = {
1521
+ "always-blocked": "Cannot be changed or disabled",
1522
+ blocked: "Stops the payment",
1523
+ flagged: "Does not automatically block"
1524
+ };
1525
+ function shortAddr(a) {
1526
+ return a.length > 14 ? `${a.slice(0, 6)}\u2026${a.slice(-4)}` : a;
1527
+ }
1528
+ function TriggerGlyph({ cv }) {
1529
+ if (cv.tone === "blocked" || cv.tone === "warn") return /* @__PURE__ */ jsx(CloseCircle, {});
1530
+ return /* @__PURE__ */ jsx(ShieldTick, {});
1531
+ }
1532
+ function CheckRow({ check, onViewPolicy }) {
1533
+ const label = check.id === "risk" ? check.ok ? "Risk screening passed" : "Risk screening failed" : check.label;
1534
+ return /* @__PURE__ */ jsxs("li", { className: "sg-cp-check", "data-ok": check.ok, children: [
1535
+ /* @__PURE__ */ jsxs("div", { className: "sg-cp-check-head", children: [
1536
+ /* @__PURE__ */ jsxs("span", { className: "sg-cp-check-label", children: [
1537
+ /* @__PURE__ */ jsx("span", { className: "sg-cp-check-mark", "data-ok": check.ok, children: check.ok ? /* @__PURE__ */ jsx(Tick, {}) : /* @__PURE__ */ jsx(Cross, {}) }),
1538
+ /* @__PURE__ */ jsx("span", { children: label }),
1539
+ /* @__PURE__ */ jsx("span", { className: "sg-sr-only", children: check.ok ? " \u2014 passed" : " \u2014 failed" })
1540
+ ] }),
1541
+ check.id === "risk" ? /* @__PURE__ */ jsxs("button", { type: "button", className: "sg-cp-link", onClick: onViewPolicy, children: [
1542
+ "View policy",
1543
+ /* @__PURE__ */ jsx(CornerArrow, {})
1544
+ ] }) : null
1545
+ ] }),
1546
+ check.note ? /* @__PURE__ */ jsx("span", { className: "sg-cp-check-note", children: check.note }) : null,
1547
+ check.reasons.map((reason) => /* @__PURE__ */ jsx("span", { className: "sg-cp-check-reason", children: humanizeComplianceReason(reason) }, reason))
1548
+ ] });
1549
+ }
1550
+ function QuoteChecks({
1551
+ compliance,
1552
+ cv,
1553
+ checks,
1554
+ direct,
1555
+ onViewPolicy
1556
+ }) {
1557
+ const allPassed = cv.tone === "ok" && checks.length > 0 && checks.every((c) => c.ok);
1558
+ const summary = allPassed ? "All checks passed" : cv.label;
1559
+ const orphans = unattributedComplianceReasons(compliance, cv);
1560
+ const wallets = distinctScreenedWallets(compliance);
1561
+ const jurisdiction = compliance?.sourceJurisdiction?.trim();
1562
+ const hasDetails = Boolean(jurisdiction || wallets.length || compliance?.checkId);
1563
+ return /* @__PURE__ */ jsxs("div", { className: "sg-cp-tabpanel", role: "tabpanel", "aria-label": "Quote checks", children: [
1564
+ /* @__PURE__ */ jsxs("section", { className: "sg-cp-card", children: [
1565
+ /* @__PURE__ */ jsxs("div", { className: "sg-cp-summary", children: [
1566
+ /* @__PURE__ */ jsxs("span", { className: "sg-cp-summary-head", "data-tone": cv.tone, children: [
1567
+ cv.tone === "blocked" || cv.tone === "warn" ? /* @__PURE__ */ jsx(CloseCircle, {}) : cv.tone === "neutral" ? /* @__PURE__ */ jsx(PendingCircle, {}) : /* @__PURE__ */ jsx(TickCircle, {}),
1568
+ /* @__PURE__ */ jsx("span", { className: "sg-cp-summary-title", children: summary })
1569
+ ] }),
1570
+ checks.length > 0 ? /* @__PURE__ */ jsxs("p", { className: "sg-cp-summary-sub", children: [
1571
+ checks.length,
1572
+ " check",
1573
+ checks.length === 1 ? " was" : "s were",
1574
+ " completed for this payment"
1575
+ ] }) : (
1576
+ // No decision was issued. Listing the controls here would be ticks for a verdict nobody
1577
+ // gave, and an unconfigured gate is not a set of passed checks.
1578
+ /* @__PURE__ */ jsx("p", { className: "sg-cp-summary-sub", children: "The gateway returned no compliance decision for this quote, so there is nothing to show. It is not a failed check." })
1579
+ )
1580
+ ] }),
1581
+ checks.length > 0 ? /* @__PURE__ */ jsx("ul", { className: "sg-cp-checks", children: checks.map((check) => /* @__PURE__ */ jsx(CheckRow, { check, onViewPolicy }, check.id)) }) : null,
1582
+ orphans.length > 0 ? /* @__PURE__ */ jsx("ul", { className: "sg-cp-orphans", children: orphans.map((reason) => /* @__PURE__ */ jsx("li", { children: humanizeComplianceReason(reason) }, reason)) }) : null,
1583
+ direct && checks.length > 0 ? /* @__PURE__ */ jsx("p", { className: "sg-cp-scope", children: DIRECT_SCOPE_NOTE }) : null
1584
+ ] }),
1585
+ compliance?.flaggedCategories?.length ? /* @__PURE__ */ jsxs("section", { className: "sg-cp-card", children: [
1586
+ /* @__PURE__ */ jsxs("div", { className: "sg-cp-card-head", children: [
1587
+ /* @__PURE__ */ jsx("span", { className: "sg-cp-card-glyph", children: /* @__PURE__ */ jsx(WarningFilled, {}) }),
1588
+ /* @__PURE__ */ jsx("h5", { className: "sg-cp-card-title", children: "Flagged, not blocking" })
1589
+ ] }),
1590
+ /* @__PURE__ */ jsx("p", { className: "sg-cp-flags", children: compliance.flaggedCategories.map(categoryLabel).join(" \xB7 ") }),
1591
+ /* @__PURE__ */ jsx("p", { className: "sg-cp-scope", children: "The policy records these and still allows the payment. They do not stop settlement." })
1592
+ ] }) : null,
1593
+ hasDetails ? /* @__PURE__ */ jsxs("section", { className: "sg-cp-card", children: [
1594
+ /* @__PURE__ */ jsxs("div", { className: "sg-cp-card-head", children: [
1595
+ /* @__PURE__ */ jsx("span", { className: "sg-cp-card-glyph", children: /* @__PURE__ */ jsx(Info, {}) }),
1596
+ /* @__PURE__ */ jsx("h5", { className: "sg-cp-card-title", children: "Quote details" })
1597
+ ] }),
1598
+ /* @__PURE__ */ jsxs("dl", { className: "sg-cp-facts", children: [
1599
+ jurisdiction ? /* @__PURE__ */ jsx(Fact, { label: "Jurisdiction", value: jurisdiction }) : null,
1600
+ wallets.map((w, i) => /* @__PURE__ */ jsx(Fact, { label: wallets.length > 1 ? i === 0 ? "Payer" : "Recipient" : "Wallet", value: shortAddr(w), title: w, mono: true }, w)),
1601
+ compliance?.checkId ? /* @__PURE__ */ jsx(Fact, { label: "Check ID", value: compliance.checkId, mono: true }) : null
1602
+ ] })
1603
+ ] }) : null
1604
+ ] });
1605
+ }
1606
+ function Fact({ label, value, title, mono = false }) {
1607
+ return /* @__PURE__ */ jsxs("div", { className: "sg-cp-fact", children: [
1608
+ /* @__PURE__ */ jsx("dt", { children: label }),
1609
+ /* @__PURE__ */ jsx("dd", { title, className: mono ? "sg-mono" : void 0, children: value })
1610
+ ] });
1611
+ }
1612
+ function ScreeningPolicy({ compliance }) {
1613
+ const policyId = compliance?.policyVersion?.trim();
1614
+ const applied = Boolean(compliance?.decision || policyId || compliance?.appliedPolicyNames?.length);
1615
+ const names = [...compliance?.appliedPolicyNames ?? [], ...compliance?.appliedLegislation ?? []];
1616
+ return /* @__PURE__ */ jsxs("div", { className: "sg-cp-tabpanel", role: "tabpanel", "aria-label": "Screening policy", children: [
1617
+ /* @__PURE__ */ jsxs("div", { className: "sg-cp-policy-head", children: [
1618
+ /* @__PURE__ */ jsxs("div", { className: "sg-cp-summary", children: [
1619
+ /* @__PURE__ */ jsxs("span", { className: "sg-cp-summary-head", "data-tone": applied ? "ok" : "neutral", children: [
1620
+ applied ? /* @__PURE__ */ jsx(TickCircle, {}) : /* @__PURE__ */ jsx(PendingCircle, {}),
1621
+ /* @__PURE__ */ jsx("span", { className: "sg-cp-summary-title", children: "Transaction screening policy" })
1622
+ ] }),
1623
+ /* @__PURE__ */ jsx("p", { className: "sg-cp-summary-sub", children: applied ? "Applied to this payment" : "No policy decision was returned" })
1624
+ ] }),
1625
+ /* @__PURE__ */ jsx("span", { className: "sg-cp-policy-id sg-mono", children: policyId ? `Policy ${policyId}` : "Policy ID unavailable" })
1626
+ ] }),
1627
+ names.length ? /* @__PURE__ */ jsxs("dl", { className: "sg-cp-facts sg-cp-policy-facts", children: [
1628
+ compliance?.appliedPolicyNames?.length ? /* @__PURE__ */ jsx(Fact, { label: "Policy", value: compliance.appliedPolicyNames.join(", ") }) : null,
1629
+ compliance?.appliedLegislation?.length ? /* @__PURE__ */ jsx(Fact, { label: "Legislation", value: compliance.appliedLegislation.join(", ") }) : null
1630
+ ] }) : null,
1631
+ /* @__PURE__ */ jsx("div", { className: "sg-cp-buckets", children: SCREENING_BUCKETS.map((bucket) => {
1632
+ const Glyph = POLICY_GLYPH[bucket.outcome];
1633
+ return /* @__PURE__ */ jsxs("section", { className: "sg-cp-card sg-cp-bucket", children: [
1634
+ /* @__PURE__ */ jsxs("div", { className: "sg-cp-bucket-head", children: [
1635
+ /* @__PURE__ */ jsxs("span", { className: "sg-cp-card-head", children: [
1636
+ /* @__PURE__ */ jsx("span", { className: "sg-cp-card-glyph", children: /* @__PURE__ */ jsx(Glyph, {}) }),
1637
+ /* @__PURE__ */ jsx("h5", { className: "sg-cp-card-title", children: bucket.title })
1638
+ ] }),
1639
+ /* @__PURE__ */ jsx("span", { className: "sg-cp-bucket-detail", children: POLICY_DETAIL[bucket.outcome] })
1640
+ ] }),
1641
+ /* @__PURE__ */ jsx("ul", { className: "sg-cp-cats", children: bucket.categories.map((category) => /* @__PURE__ */ jsxs("li", { children: [
1642
+ /* @__PURE__ */ jsx("span", { className: "sg-cp-dot", "aria-hidden": "true" }),
1643
+ category
1644
+ ] }, category)) })
1645
+ ] }, bucket.outcome);
1646
+ }) })
1647
+ ] });
1648
+ }
1649
+ function CompliancePanel(props) {
1650
+ const [open, setOpen] = useState(false);
1651
+ const [tab, setTab] = useState("checks");
1652
+ const triggerRef = useRef(null);
1653
+ const sheetRef = useRef(null);
1654
+ const compliance = props.compliance ?? null;
1655
+ const cv = complianceView(compliance, props.hasQuote ?? true);
1656
+ const allChecks = complianceChecks(compliance, cv);
1657
+ const checks = props.direct ? allChecks.filter((c) => DIRECT_CHECK_IDS.includes(c.id)) : allChecks;
1658
+ const tag = complianceTagOf(compliance);
1659
+ useEffect(() => {
1660
+ if (!open) return;
1661
+ sheetRef.current?.focus();
1662
+ const onKey = (e) => {
1663
+ if (e.key === "Escape") {
1664
+ e.stopPropagation();
1665
+ setOpen(false);
1666
+ triggerRef.current?.focus();
1667
+ }
1668
+ };
1669
+ document.addEventListener("keydown", onKey, true);
1670
+ return () => document.removeEventListener("keydown", onKey, true);
1671
+ }, [open]);
1672
+ const close = () => {
1673
+ setOpen(false);
1674
+ triggerRef.current?.focus();
1675
+ };
1676
+ return /* @__PURE__ */ jsxs("div", { className: "sg-cp", "data-tone": cv.tone, children: [
1677
+ open ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
1678
+ /* @__PURE__ */ jsxs("button", { ref: triggerRef, type: "button", className: "sg-cp-row", "data-tone": cv.tone, onClick: () => setOpen(true), "aria-haspopup": "dialog", children: [
1679
+ /* @__PURE__ */ jsxs("span", { className: "sg-cp-row-main", children: [
1680
+ /* @__PURE__ */ jsx("span", { className: "sg-cp-row-glyph", children: /* @__PURE__ */ jsx(TriggerGlyph, { cv }) }),
1681
+ /* @__PURE__ */ jsx("span", { className: "sg-cp-row-label", children: cv.label })
1682
+ ] }),
1683
+ /* @__PURE__ */ jsx("span", { className: "sg-cp-row-chev", children: /* @__PURE__ */ jsx(Chevron, {}) })
1684
+ ] }),
1685
+ (cv.blocked || cv.needsAction) && tag ? /* @__PURE__ */ jsx("span", { className: "sg-cp-row-tag sg-mono", children: tag }) : null
1686
+ ] }),
1687
+ open ? /* @__PURE__ */ jsxs("div", { className: "sg-cp-sheet", role: "dialog", "aria-modal": "true", "aria-label": "Compliance details", ref: sheetRef, tabIndex: -1, children: [
1688
+ /* @__PURE__ */ jsxs("div", { className: "sg-cp-sheet-head", children: [
1689
+ /* @__PURE__ */ jsx("h4", { className: "sg-cp-sheet-title", children: "Compliance details" }),
1690
+ /* @__PURE__ */ jsx("button", { type: "button", className: "sg-cp-close", onClick: close, "aria-label": "Close compliance details", children: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "m6 6 12 12M18 6 6 18", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }) })
1691
+ ] }),
1692
+ /* @__PURE__ */ jsxs("div", { className: "sg-cp-tabs", role: "tablist", "aria-label": "Compliance details sections", children: [
1693
+ /* @__PURE__ */ jsx("button", { type: "button", role: "tab", "aria-selected": tab === "checks", "data-active": tab === "checks", className: "sg-cp-tab", onClick: () => setTab("checks"), children: "Quote checks" }),
1694
+ /* @__PURE__ */ jsx("button", { type: "button", role: "tab", "aria-selected": tab === "policy", "data-active": tab === "policy", className: "sg-cp-tab", onClick: () => setTab("policy"), children: "Screening policy" })
1695
+ ] }),
1696
+ /* @__PURE__ */ jsx("div", { className: "sg-cp-sheet-body", children: tab === "checks" ? /* @__PURE__ */ jsx(QuoteChecks, { compliance, cv, checks, direct: !!props.direct, onViewPolicy: () => setTab("policy") }) : /* @__PURE__ */ jsx(ScreeningPolicy, { compliance }) })
1697
+ ] }) : null
1698
+ ] });
1699
+ }
1304
1700
 
1305
1701
  // src/react/ui/chain-logos.ts
1306
1702
  var BUNDLED_CHAIN_LOGO = {
@@ -1337,9 +1733,15 @@ var BUNDLED_TOKEN_LOGO = {
1337
1733
  function isHttpsUrl(u) {
1338
1734
  return typeof u === "string" && /^https:\/\//i.test(u);
1339
1735
  }
1736
+ function isSameOriginPath(u) {
1737
+ return typeof u === "string" && u.startsWith("/") && !u.startsWith("//") && !u.startsWith("/\\");
1738
+ }
1739
+ function isDisplayableImageSrc(u) {
1740
+ return isHttpsUrl(u) || isSameOriginPath(u);
1741
+ }
1340
1742
  function tokenLogoCandidates(symbol, logoUrl) {
1341
1743
  const out = [];
1342
- if (isHttpsUrl(logoUrl)) out.push(logoUrl);
1744
+ if (isDisplayableImageSrc(logoUrl)) out.push(logoUrl);
1343
1745
  const bundled = BUNDLED_TOKEN_LOGO[symbolKey(symbol)];
1344
1746
  if (bundled && !out.includes(bundled)) out.push(bundled);
1345
1747
  return out;
@@ -1386,7 +1788,7 @@ function TokenTile(props) {
1386
1788
  const shown = props.token?.symbol ?? props.pick?.symbol ?? "";
1387
1789
  const glyph = props.pick ? /* @__PURE__ */ jsxs(Fragment, { children: [
1388
1790
  /* @__PURE__ */ jsx(TokenGlyph, { symbol: props.pick.symbol, logoUrl: props.token?.logoUrl, chainId: props.pick.chainId }),
1389
- /* @__PURE__ */ jsxs("span", { style: { minWidth: 0 }, children: [
1791
+ /* @__PURE__ */ jsxs("span", { className: "sg-tile-text", children: [
1390
1792
  /* @__PURE__ */ jsx("span", { className: "sg-tile-sym", children: shown }),
1391
1793
  /* @__PURE__ */ jsx("span", { className: "sg-tile-chain", children: CHAIN_LABELS[props.pick.chainId] || `Chain ${props.pick.chainId}` })
1392
1794
  ] })
@@ -1574,6 +1976,59 @@ function HistoryButton(props) {
1574
1976
  function chainLabel(entry) {
1575
1977
  return entry.chainId != null && CHAIN_LABELS[entry.chainId] || entry.chainName || (entry.chainId != null ? `Chain ${entry.chainId}` : "Unknown chain");
1576
1978
  }
1979
+ function chainName(chainId, fallback) {
1980
+ return CHAIN_LABELS[chainId] || fallback || (chainId ? `Chain ${chainId}` : "Unknown chain");
1981
+ }
1982
+ function legsOf(entry) {
1983
+ if (entry.legs?.length) return entry.legs;
1984
+ const leg = {
1985
+ index: 1,
1986
+ fromAsset: entry.fromAsset,
1987
+ fromChainId: entry.chainId ?? 0,
1988
+ fromChainName: entry.chainName,
1989
+ fromAmount: entry.payAmount,
1990
+ toAsset: entry.toAsset,
1991
+ toChainId: 0,
1992
+ toChainName: "",
1993
+ toAmount: entry.receiveAmount,
1994
+ executionChainId: 0,
1995
+ executionChainName: ""
1996
+ };
1997
+ return [leg];
1998
+ }
1999
+ function ordersLabel(count) {
2000
+ return count === 1 ? "1 order" : `${count} orders`;
2001
+ }
2002
+ function LegArrowGlyph() {
2003
+ return /* @__PURE__ */ jsxs("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.6", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
2004
+ /* @__PURE__ */ jsx("path", { d: "M5 12h14" }),
2005
+ /* @__PURE__ */ jsx("path", { d: "m13 6 6 6-6 6" })
2006
+ ] });
2007
+ }
2008
+ function TxLegs(props) {
2009
+ const multi = props.legs.length > 1;
2010
+ return /* @__PURE__ */ jsxs("div", { className: "sg-legs", "data-multi": multi || void 0, children: [
2011
+ /* @__PURE__ */ jsxs("div", { className: "sg-legs-head", children: [
2012
+ /* @__PURE__ */ jsx("span", { className: "sg-meta-label", children: "Route" }),
2013
+ /* @__PURE__ */ jsx("span", { className: "sg-badge", children: ordersLabel(props.legs.length) })
2014
+ ] }),
2015
+ /* @__PURE__ */ jsx("ol", { className: "sg-leg-list", children: props.legs.map((leg) => /* @__PURE__ */ jsxs("li", { className: "sg-leg", children: [
2016
+ multi ? /* @__PURE__ */ jsx("span", { className: "sg-leg-n", "aria-hidden": "true", children: leg.index }) : null,
2017
+ /* @__PURE__ */ jsxs("div", { className: "sg-leg-body", children: [
2018
+ /* @__PURE__ */ jsxs("div", { className: "sg-leg-line", children: [
2019
+ /* @__PURE__ */ jsx("span", { className: "sg-mono", children: `${leg.fromAmount ? `${leg.fromAmount} ` : ""}${leg.fromAsset || "\u2014"}` }),
2020
+ /* @__PURE__ */ jsx("span", { className: "sg-leg-arrow", "aria-hidden": "true", children: /* @__PURE__ */ jsx(LegArrowGlyph, {}) }),
2021
+ /* @__PURE__ */ jsx("span", { className: "sg-mono", children: `${leg.toAmount ? `${leg.toAmount} ` : ""}${leg.toAsset || "\u2014"}` })
2022
+ ] }),
2023
+ /* @__PURE__ */ jsxs("div", { className: "sg-leg-sub", children: [
2024
+ chainName(leg.fromChainId, leg.fromChainName),
2025
+ leg.toChainId ? ` \u2192 ${chainName(leg.toChainId, leg.toChainName)}` : "",
2026
+ leg.executionChainId && leg.executionChainId !== leg.fromChainId ? ` \xB7 filled on ${chainName(leg.executionChainId, leg.executionChainName)}` : ""
2027
+ ] })
2028
+ ] })
2029
+ ] }, `${leg.index}:${leg.fromChainId}:${leg.toChainId}`)) })
2030
+ ] });
2031
+ }
1577
2032
  function statusBadge(status) {
1578
2033
  if (status === "confirmed")
1579
2034
  return /* @__PURE__ */ jsx("span", { className: "sg-badge", "data-tone": "ok", children: "Confirmed" });
@@ -1583,40 +2038,73 @@ function statusBadge(status) {
1583
2038
  }
1584
2039
  function whenLabel(at) {
1585
2040
  const d = new Date(at);
1586
- return Number.isNaN(d.getTime()) ? "" : d.toLocaleString();
2041
+ if (Number.isNaN(d.getTime())) return "";
2042
+ const sameYear = d.getFullYear() === (/* @__PURE__ */ new Date()).getFullYear();
2043
+ try {
2044
+ return d.toLocaleString(void 0, { day: "numeric", month: "short", year: sameYear ? void 0 : "numeric", hour: "2-digit", minute: "2-digit" });
2045
+ } catch {
2046
+ return d.toLocaleString();
2047
+ }
2048
+ }
2049
+ function endpoints(entry) {
2050
+ const legs = entry.legs;
2051
+ return {
2052
+ fromChainId: entry.chainId ?? legs?.[0]?.fromChainId ?? void 0,
2053
+ toChainId: legs?.length ? legs[legs.length - 1].toChainId || void 0 : void 0
2054
+ };
2055
+ }
2056
+ function TxPairGlyphs(props) {
2057
+ const e = props.entry;
2058
+ const { fromChainId, toChainId } = endpoints(e);
2059
+ return /* @__PURE__ */ jsxs("span", { className: "sg-txrow-glyphs", children: [
2060
+ /* @__PURE__ */ jsx(TokenGlyph, { symbol: e.fromAsset || "?", logoUrl: logoFor(props.art, e.fromAsset, fromChainId ?? null), chainId: fromChainId, size: "sm" }),
2061
+ /* @__PURE__ */ jsx(TokenGlyph, { symbol: e.toAsset || "?", logoUrl: logoFor(props.art, e.toAsset, toChainId ?? null), chainId: toChainId, size: "sm" })
2062
+ ] });
2063
+ }
2064
+ function TxPair(props) {
2065
+ const e = props.entry;
2066
+ return /* @__PURE__ */ jsxs("span", { className: "sg-txrow-pair", children: [
2067
+ /* @__PURE__ */ jsx("span", { className: "sg-txrow-side sg-mono", children: `${e.payAmount} ${e.fromAsset}` }),
2068
+ /* @__PURE__ */ jsxs("span", { className: "sg-txrow-side sg-mono", children: [
2069
+ /* @__PURE__ */ jsx("span", { className: "sg-txrow-arrow", "aria-hidden": "true", children: /* @__PURE__ */ jsx(LegArrowGlyph, {}) }),
2070
+ `${e.receiveAmount} ${e.toAsset}`
2071
+ ] })
2072
+ ] });
1587
2073
  }
1588
- function logoFor(tokens, symbol, chainId) {
1589
- if (!tokens?.length) return void 0;
2074
+ function logoFor(art, symbol, chainId) {
1590
2075
  const key = symbolKey(symbol);
1591
2076
  if (!key) return void 0;
1592
- const sameChain = chainId == null ? void 0 : tokens.find((t) => Number(t.chainId) === chainId && symbolKey(t.symbol) === key);
1593
- return (sameChain ?? tokens.find((t) => symbolKey(t.symbol) === key))?.logoUrl;
2077
+ const tokens = art.tokens;
2078
+ if (tokens?.length) {
2079
+ const sameChain = chainId == null ? void 0 : tokens.find((t) => Number(t.chainId) === chainId && symbolKey(t.symbol) === key);
2080
+ const found = (sameChain ?? tokens.find((t) => symbolKey(t.symbol) === key))?.logoUrl;
2081
+ if (found) return found;
2082
+ }
2083
+ return art.vaultIcons?.get(key);
1594
2084
  }
1595
2085
  function TxHistoryList(props) {
1596
2086
  if (!props.entries.length) {
1597
2087
  return /* @__PURE__ */ jsx("div", { className: "sg-sel-empty", children: "No transactions yet \u2014 activity from this wallet will appear here." });
1598
2088
  }
1599
- return /* @__PURE__ */ jsx("section", { className: "sg-toklist", "aria-label": "Transaction history", children: props.entries.map((e) => /* @__PURE__ */ jsxs("button", { type: "button", className: "sg-tokrow", onClick: () => props.onPick(e), children: [
1600
- /* @__PURE__ */ jsx(TokenGlyph, { symbol: e.fromAsset || e.toAsset || "?", logoUrl: logoFor(props.tokens, e.fromAsset, e.chainId), chainId: e.chainId ?? void 0 }),
1601
- /* @__PURE__ */ jsxs("span", { className: "sg-tokrow-main", children: [
1602
- /* @__PURE__ */ jsxs("span", { className: "sg-tokrow-sym sg-mono", children: [
1603
- e.payAmount,
1604
- " ",
1605
- e.fromAsset,
1606
- " \u2192 ",
1607
- e.receiveAmount,
1608
- " ",
1609
- e.toAsset
1610
- ] }),
1611
- /* @__PURE__ */ jsxs("span", { className: "sg-tokrow-name", children: [
1612
- e.kind === "payment" ? "Payment" : "Swap",
1613
- " \xB7 ",
1614
- chainLabel(e),
1615
- whenLabel(e.at) ? ` \xB7 ${whenLabel(e.at)}` : ""
2089
+ return /* @__PURE__ */ jsx("section", { className: "sg-toklist", "aria-label": "Transaction history", children: props.entries.map((e) => (
2090
+ // A GRID, not the picker's flex row: the meta line spans the badge column too, so at 390px it
2091
+ // has the full card width to wrap into instead of being ellipsised away to "…".
2092
+ /* @__PURE__ */ jsxs("button", { type: "button", className: "sg-txrow", onClick: () => props.onPick(e), children: [
2093
+ /* @__PURE__ */ jsx(TxPairGlyphs, { entry: e, art: props }),
2094
+ /* @__PURE__ */ jsx(TxPair, { entry: e }),
2095
+ /* @__PURE__ */ jsxs("span", { className: "sg-txrow-meta", children: [
2096
+ /* @__PURE__ */ jsxs("span", { className: "sg-txrow-when", children: [
2097
+ /* @__PURE__ */ jsxs("span", { className: "sg-txrow-what", children: [
2098
+ /* @__PURE__ */ jsx("span", { children: e.kind === "payment" ? "Payment" : "Swap" }),
2099
+ /* @__PURE__ */ jsx("span", { children: chainLabel(e) }),
2100
+ (e.legs?.length ?? 1) > 1 ? /* @__PURE__ */ jsx("span", { children: ordersLabel(e.legs.length) }) : null
2101
+ ] }),
2102
+ whenLabel(e.at) ? /* @__PURE__ */ jsx("span", { className: "sg-txrow-time", children: whenLabel(e.at) }) : null
2103
+ ] }),
2104
+ /* @__PURE__ */ jsx("span", { className: "sg-txrow-end", children: statusBadge(e.status) })
1616
2105
  ] })
1617
- ] }),
1618
- /* @__PURE__ */ jsx("span", { className: "sg-tokrow-end", children: statusBadge(e.status) })
1619
- ] }, `${e.hash}:${e.at}`)) });
2106
+ ] }, `${e.hash}:${e.at}`)
2107
+ )) });
1620
2108
  }
1621
2109
  function TxDetail(props) {
1622
2110
  const e = props.entry;
@@ -1639,6 +2127,7 @@ function TxDetail(props) {
1639
2127
  }
1640
2128
  };
1641
2129
  return /* @__PURE__ */ jsxs("div", { className: "sg-panel", children: [
2130
+ /* @__PURE__ */ jsx(TxPairGlyphs, { entry: e, art: props }),
1642
2131
  /* @__PURE__ */ jsxs("div", { className: "sg-anchor sg-mono", children: [
1643
2132
  e.receiveAmount,
1644
2133
  " ",
@@ -1648,6 +2137,7 @@ function TxDetail(props) {
1648
2137
  e.kind === "payment" ? "Payment" : "Swap",
1649
2138
  whenLabel(e.at) ? ` \xB7 ${whenLabel(e.at)}` : ""
1650
2139
  ] }),
2140
+ /* @__PURE__ */ jsx(TxLegs, { legs: legsOf(e) }),
1651
2141
  /* @__PURE__ */ jsxs("div", { className: "sg-meta", children: [
1652
2142
  /* @__PURE__ */ jsxs("div", { className: "sg-meta-row", children: [
1653
2143
  /* @__PURE__ */ jsx("span", { className: "sg-meta-label", children: "Status" }),
@@ -1662,7 +2152,7 @@ function TxDetail(props) {
1662
2152
  ] })
1663
2153
  ] }),
1664
2154
  /* @__PURE__ */ jsxs("div", { className: "sg-meta-row", children: [
1665
- /* @__PURE__ */ jsx("span", { className: "sg-meta-label", children: "Chain" }),
2155
+ /* @__PURE__ */ jsx("span", { className: "sg-meta-label", children: "Signed on" }),
1666
2156
  /* @__PURE__ */ jsx("b", { children: chainLabel(e) })
1667
2157
  ] }),
1668
2158
  e.recipient ? /* @__PURE__ */ jsxs("div", { className: "sg-meta-row", children: [
@@ -1681,14 +2171,17 @@ function TxDetail(props) {
1681
2171
  ] })
1682
2172
  ] });
1683
2173
  }
1684
- function displayableHistory(entries) {
1685
- return entries.filter((e) => e.txKind !== "approve");
2174
+ function displayableHistory(entries, account) {
2175
+ const owner = typeof account === "string" ? account.toLowerCase() : "";
2176
+ return entries.filter((e) => e.txKind !== "approve" && (!e.account || !owner || e.account.toLowerCase() === owner));
1686
2177
  }
1687
2178
  function TxHistoryPanel(props) {
1688
- const entries = displayableHistory(useTxHistory(props.account));
1689
- const [selected, setSelected] = useState(props.initialEntry ?? null);
2179
+ const account = props.account;
2180
+ const entries = displayableHistory(useTxHistory(account), account);
2181
+ const deepLink = props.initialEntry && displayableHistory([props.initialEntry], account).length ? props.initialEntry : null;
2182
+ const [selected, setSelected] = useState(deepLink);
1690
2183
  const backRef = useRef(null);
1691
- useEffect(() => setSelected(props.initialEntry ?? null), [props.initialEntry]);
2184
+ useEffect(() => setSelected(deepLink), [deepLink]);
1692
2185
  const pick = (entry) => {
1693
2186
  setSelected(entry);
1694
2187
  requestAnimationFrame(() => backRef.current?.focus());
@@ -1696,9 +2189,12 @@ function TxHistoryPanel(props) {
1696
2189
  return /* @__PURE__ */ jsxs("div", { children: [
1697
2190
  /* @__PURE__ */ jsxs("div", { className: "sg-sel-head", children: [
1698
2191
  /* @__PURE__ */ jsx("button", { type: "button", autoFocus: true, ref: backRef, className: "sg-back", onClick: selected ? () => setSelected(null) : props.onBack, "aria-label": "Back", children: /* @__PURE__ */ jsx(BackGlyph2, {}) }),
1699
- /* @__PURE__ */ jsx("div", { className: "sg-sel-title", children: selected ? "Transaction" : "Transaction history" })
2192
+ /* @__PURE__ */ jsxs("div", { className: "sg-sel-title", children: [
2193
+ selected ? "Transaction" : "Transaction history",
2194
+ account ? /* @__PURE__ */ jsx("span", { className: "sg-sel-sub sg-mono", children: shortAddress(account) }) : null
2195
+ ] })
1700
2196
  ] }),
1701
- selected ? /* @__PURE__ */ jsx(TxDetail, { entry: selected }) : /* @__PURE__ */ jsx(TxHistoryList, { entries, tokens: props.tokens, onPick: pick })
2197
+ selected ? /* @__PURE__ */ jsx(TxDetail, { entry: selected, tokens: props.tokens, vaultIcons: props.vaultIcons }) : /* @__PURE__ */ jsx(TxHistoryList, { entries, tokens: props.tokens, vaultIcons: props.vaultIcons, onPick: pick })
1702
2198
  ] });
1703
2199
  }
1704
2200
  var IDENTITY_KEY_PREFIX = "sg:link:v1:";
@@ -1761,7 +2257,7 @@ function forgetIdentity(account) {
1761
2257
  }
1762
2258
  }
1763
2259
  var addrEq = (a, b) => String(a || "").toLowerCase() === String(b || "").toLowerCase();
1764
- var chainName = (id) => id != null ? CHAIN_LABELS[id] || `Chain ${id}` : "";
2260
+ var chainName2 = (id) => id != null ? CHAIN_LABELS[id] || `Chain ${id}` : "";
1765
2261
  var STABLES = EXECUTABLE_STABLE_ASSETS;
1766
2262
  function BankGlyph() {
1767
2263
  return /* @__PURE__ */ jsx(
@@ -2277,6 +2773,7 @@ function PaymentIsland(props) {
2277
2773
  const [expanded, setExpanded] = useState(() => Boolean(props.defaultExpanded) || rampMode);
2278
2774
  const [view, setView] = useState("main");
2279
2775
  const [hist, setHist] = useState(null);
2776
+ const histBtnRef = useRef(null);
2280
2777
  const pillRef = useRef(null);
2281
2778
  const methodRowRef = useRef(null);
2282
2779
  const exFromTileRef = useRef(null);
@@ -2284,6 +2781,7 @@ function PaymentIsland(props) {
2284
2781
  const regionRef = useRef(null);
2285
2782
  const panelId = useId();
2286
2783
  useEffect(() => setView("main"), [wallet.account, payParamsKey]);
2784
+ useEffect(() => setHist(null), [wallet.account]);
2287
2785
  const firstRender = useRef(true);
2288
2786
  useEffect(() => {
2289
2787
  if (firstRender.current) {
@@ -2307,7 +2805,7 @@ function PaymentIsland(props) {
2307
2805
  };
2308
2806
  const closeHistory = () => {
2309
2807
  setHist(null);
2310
- requestAnimationFrame(() => (methodRowRef.current ?? regionRef.current)?.focus());
2808
+ requestAnimationFrame(() => (histBtnRef.current ?? methodRowRef.current ?? regionRef.current)?.focus());
2311
2809
  };
2312
2810
  const pickFunding = (pick) => {
2313
2811
  const r = visibleRoutes.find((x) => x.source.chainId === pick.chainId && symbolKey(x.source.asset) === symbolKey(pick.symbol));
@@ -2369,7 +2867,11 @@ function PaymentIsland(props) {
2369
2867
  /* @__PURE__ */ jsx("span", { className: "sg-link-word", children: "ZeroDelta" }),
2370
2868
  /* @__PURE__ */ jsx("span", { className: "sg-badge", "data-tone": "accent", children: "Link" })
2371
2869
  ] });
2372
- const walletSlot = menuItems.length ? /* @__PURE__ */ jsx(LinkMenu, { items: menuItems }) : void 0;
2870
+ const linkMenu = menuItems.length ? /* @__PURE__ */ jsx(LinkMenu, { items: menuItems }) : null;
2871
+ const walletSlot = wallet.account || linkMenu ? /* @__PURE__ */ jsxs("div", { className: "sg-head-tools", children: [
2872
+ wallet.account ? /* @__PURE__ */ jsx(HistoryButton, { btnRef: histBtnRef, disabled: submitting, onClick: () => setHist({}) }) : null,
2873
+ linkMenu
2874
+ ] }) : void 0;
2373
2875
  const activeStep = flow.steps.find((s) => s.state === "active");
2374
2876
  const liveMsg = flow.status === "loading" ? isPay ? "Finding the best way to pay." : "Finding the best route." : flow.status === "submitting" ? `${activeStep?.label ?? (isPay ? "Processing your payment" : `Processing your ${verb.present.toLowerCase()}`)} \u2014 in progress.` : flow.status === "success" || flow.status === "pending" ? flow.verdict?.status === "confirmed" ? isPay ? "Payment confirmed on-chain \u2014 the merchant has been settled." : `${verb.past} \u2014 confirmed on-chain.` : isPay ? "Payment sent \u2014 confirmation is still pending." : "Submitted \u2014 confirmation is still pending." : "";
2375
2877
  const loading = flow.status === "loading";
@@ -2403,7 +2905,7 @@ function PaymentIsland(props) {
2403
2905
  ] });
2404
2906
  let body;
2405
2907
  if (hist && wallet.account) {
2406
- body = /* @__PURE__ */ jsx(TxHistoryPanel, { account: wallet.account, tokens: registryTokens, initialEntry: hist.entry ?? null, onBack: closeHistory });
2908
+ body = /* @__PURE__ */ jsx(TxHistoryPanel, { account: wallet.account, tokens: registryTokens, vaultIcons: catalogue?.vaultIcons, initialEntry: hist.entry ?? null, onBack: closeHistory });
2407
2909
  } else if (isPay && view === "select" && wallet.account) {
2408
2910
  body = /* @__PURE__ */ jsx(
2409
2911
  TokenSelect,
@@ -2582,7 +3084,7 @@ function PaymentIsland(props) {
2582
3084
  ] }),
2583
3085
  /* @__PURE__ */ jsxs("div", { className: "sg-anchor-sub", children: [
2584
3086
  "on ",
2585
- chainName(sel.source.chainId),
3087
+ chainName2(sel.source.chainId),
2586
3088
  selBal ? ` \xB7 balance ${selBal.formatted}` : ""
2587
3089
  ] })
2588
3090
  ] }) : null,
@@ -2595,9 +3097,10 @@ function PaymentIsland(props) {
2595
3097
  ] }),
2596
3098
  /* @__PURE__ */ jsxs("div", { className: "sg-anchor-sub", children: [
2597
3099
  "on ",
2598
- chainName(sel.source.chainId)
3100
+ chainName2(sel.source.chainId)
2599
3101
  ] })
2600
3102
  ] }) : null,
3103
+ sel && !loading && !quoteError ? /* @__PURE__ */ jsx(CompliancePanel, { compliance: sel.quote.compliance, direct: sel.state === "DIRECT" }) : null,
2601
3104
  quoteError ? /* @__PURE__ */ jsx(StatusPanel, { tone: "error", children: flow.error || "Couldn't get a price right now." }) : null,
2602
3105
  walletError ? /* @__PURE__ */ jsx(StatusPanel, { tone: "error", children: flow.error || "The wallet could not complete this payment." }) : null,
2603
3106
  submitting || walletError ? /* @__PURE__ */ jsx(StepList, { variant: "rich", steps: flow.steps, verdict: flow.verdict }) : null,
@@ -2866,7 +3369,7 @@ function StableGeniePay(props) {
2866
3369
  ] })
2867
3370
  ] }) : void 0;
2868
3371
  if (props.variant === "pill") return /* @__PURE__ */ jsx(PaymentIsland, { kind: "pay", ...props });
2869
- return /* @__PURE__ */ jsx(WidgetShell, { title: config.title || "Complete payment", theme: config.theme, heightPx: props.heightPx, walletSlot, children: hist && wallet.account ? /* @__PURE__ */ jsx(TxHistoryPanel, { account: wallet.account, tokens: registryTokens, initialEntry: hist.entry ?? null, onBack: closeHistory }) : view === "select" && wallet.account ? /* @__PURE__ */ jsx(
3372
+ return /* @__PURE__ */ jsx(WidgetShell, { title: config.title || "Complete payment", theme: config.theme, heightPx: props.heightPx, walletSlot, children: hist && wallet.account ? /* @__PURE__ */ jsx(TxHistoryPanel, { account: wallet.account, tokens: registryTokens, vaultIcons: catalogue?.vaultIcons, initialEntry: hist.entry ?? null, onBack: closeHistory }) : view === "select" && wallet.account ? /* @__PURE__ */ jsx(
2870
3373
  TokenSelect,
2871
3374
  {
2872
3375
  title: "Pay with",
@@ -2934,6 +3437,7 @@ function StableGeniePay(props) {
2934
3437
  scannedEmpty ? /* @__PURE__ */ jsx("div", { className: "sg-note", children: "None of your balances can cover this yet \u2014 pick a different asset to fund with." }) : null,
2935
3438
  flow.status === "ready" && !visibleRoutes.length ? /* @__PURE__ */ jsx(StatusPanel, { children: "No funding route matches the accepted assets for this payment." }) : null
2936
3439
  ] }),
3440
+ sel && flow.status !== "loading" ? /* @__PURE__ */ jsx(CompliancePanel, { compliance: sel.quote.compliance, direct: sel.state === "DIRECT" }) : null,
2937
3441
  submitting ? /* @__PURE__ */ jsx(StepList, { steps: flow.steps }) : null,
2938
3442
  /* @__PURE__ */ jsx("div", { className: "sg-cta-wrap", children: /* @__PURE__ */ jsx(
2939
3443
  Button,
@@ -3038,7 +3542,7 @@ function StableGenieSwap(props) {
3038
3542
  /* @__PURE__ */ jsx("div", { className: "sg-brand", children: "ZeroDelta" })
3039
3543
  ] }) : void 0;
3040
3544
  if (hist && wallet.account) {
3041
- return /* @__PURE__ */ jsx(WidgetShell, { title: config.title || "Swap", theme: config.theme, walletSlot, children: /* @__PURE__ */ jsx(TxHistoryPanel, { account: wallet.account, tokens: registryTokens, initialEntry: hist.entry ?? null, onBack: closeHistory }) });
3545
+ return /* @__PURE__ */ jsx(WidgetShell, { title: config.title || "Swap", theme: config.theme, walletSlot, children: /* @__PURE__ */ jsx(TxHistoryPanel, { account: wallet.account, tokens: registryTokens, vaultIcons: catalogue?.vaultIcons, initialEntry: hist.entry ?? null, onBack: closeHistory }) });
3042
3546
  }
3043
3547
  if (flow.status === "success" || flow.status === "pending") {
3044
3548
  return /* @__PURE__ */ jsxs(WidgetShell, { title: config.title || "Swap", theme: config.theme, walletSlot, children: [
@@ -3077,6 +3581,7 @@ function StableGenieSwap(props) {
3077
3581
  ] }),
3078
3582
  flow.status === "error" && flow.error ? /* @__PURE__ */ jsx(StatusPanel, { tone: "error", children: flow.error }) : null,
3079
3583
  flow.routes.length ? /* @__PURE__ */ jsx(RouteList, { routes: flow.routes, selectedId: flow.selected?.id ?? null, onSelect: flow.selectRoute }) : null,
3584
+ flow.selected && flow.status !== "loading" ? /* @__PURE__ */ jsx(CompliancePanel, { compliance: flow.selected.quote.compliance, direct: flow.selected.state === "DIRECT" }) : null,
3080
3585
  submitting ? /* @__PURE__ */ jsx(StepList, { steps: flow.steps }) : null,
3081
3586
  /* @__PURE__ */ jsxs("div", { className: "sg-cta-wrap", children: [
3082
3587
  !wallet.account ? /* @__PURE__ */ jsx(Button, { onClick: wallet.connect, busy: wallet.connecting, children: "Connect wallet" }) : /* @__PURE__ */ jsx(Button, { onClick: flow.submit, busy: submitting, disabled: !flow.selected || flow.insufficient || !!flow.nativeShortfall || !enabled || flow.status === "loading", children: swapLabel }),
@@ -3287,7 +3792,7 @@ function StableGenieExchange(props) {
3287
3792
  if (props.variant === "pill") return /* @__PURE__ */ jsx(PaymentIsland, { kind: "exchange", ...props });
3288
3793
  let body;
3289
3794
  if (hist && connected) {
3290
- body = /* @__PURE__ */ jsx(TxHistoryPanel, { account: wallet.account, tokens, initialEntry: hist.entry ?? null, onBack: closeHistory });
3795
+ body = /* @__PURE__ */ jsx(TxHistoryPanel, { account: wallet.account, tokens, vaultIcons: catalogue?.vaultIcons, initialEntry: hist.entry ?? null, onBack: closeHistory });
3291
3796
  } else if (view === "from" || view === "to") {
3292
3797
  const isFrom = view === "from";
3293
3798
  body = /* @__PURE__ */ jsx(
@@ -3364,6 +3869,7 @@ function StableGenieExchange(props) {
3364
3869
  meta.duration ? ` \xB7 ~${meta.duration}s` : ""
3365
3870
  ] }) : null
3366
3871
  ] }) : null,
3872
+ connected && flow.selected && flow.status !== "loading" ? /* @__PURE__ */ jsx(CompliancePanel, { compliance: flow.selected.quote.compliance, direct: flow.selected.state === "DIRECT" }) : null,
3367
3873
  submitting ? /* @__PURE__ */ jsx(StepList, { steps: flow.steps }) : null,
3368
3874
  /* @__PURE__ */ jsxs("div", { className: "sg-cta-wrap", children: [
3369
3875
  !connected && !rampMode ? /* @__PURE__ */ jsx(Button, { onClick: wallet.connect, busy: wallet.connecting, children: "Connect wallet" }) : /* @__PURE__ */ jsx(Button, { onClick: rampMode ? void 0 : flow.submit, busy: submitting, disabled: rampMode || !quotable || !cryptoReady || connected && (!flow.selected || flow.insufficient || !!flow.nativeShortfall || flow.status === "loading"), children: ctaLabel }),
@@ -3468,4 +3974,4 @@ function mount(el, config) {
3468
3974
  return () => root.unmount();
3469
3975
  }
3470
3976
 
3471
- export { PaymentIsland, StableGenieExchange, StableGeniePay, StableGenieProvider, StableGenieRwaExchange, StableGenieSwap, darkTheme, lightTheme, mount, resolveTheme };
3977
+ export { CompliancePanel, PaymentIsland, StableGenieExchange, StableGeniePay, StableGenieProvider, StableGenieRwaExchange, StableGenieSwap, darkTheme, lightTheme, mount, resolveTheme };