@glacislabs/stablegenie-zerodelta 4.19.0 → 4.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-NS444RZM.js → chunk-FXH7TCJ5.js} +1013 -36
- package/dist/{chunk-NLXQVXZ5.js → chunk-JIQRTR3C.js} +27 -8
- package/dist/core/index.cjs +27 -8
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +1 -1
- package/dist/index.cjs +1107 -45
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/{mount-BsoZvwCl.d.cts → mount-D2tDkHea.d.cts} +1 -1
- package/dist/{mount-A24qHOI0.d.ts → mount-DuTF5CQV.d.ts} +1 -1
- package/dist/mount.cjs +1107 -45
- package/dist/mount.d.cts +2 -2
- package/dist/mount.d.ts +2 -2
- package/dist/mount.js +2 -2
- package/dist/standalone.global.js +221 -9
- package/dist/{verify-BzTQQMc8.d.cts → verify-UqDjAVxa.d.cts} +14 -10
- package/dist/{verify-BzTQQMc8.d.ts → verify-UqDjAVxa.d.ts} +14 -10
- package/package.json +1 -1
package/dist/mount.cjs
CHANGED
|
@@ -4271,10 +4271,55 @@ function buildZdHeavyRoute(ctx) {
|
|
|
4271
4271
|
// src/core/quote-compare.ts
|
|
4272
4272
|
var WAIT_MIN_SEC = 180;
|
|
4273
4273
|
var WAIT_MAX_SEC = 7200;
|
|
4274
|
+
var WAIT_STEP_SEC = 60;
|
|
4274
4275
|
function clampWait(sec) {
|
|
4275
4276
|
if (!Number.isFinite(sec)) return WAIT_MIN_SEC;
|
|
4276
4277
|
return Math.min(WAIT_MAX_SEC, Math.max(WAIT_MIN_SEC, sec));
|
|
4277
4278
|
}
|
|
4279
|
+
var WAIT_POINTS = [
|
|
4280
|
+
[WAIT_MIN_SEC, 0],
|
|
4281
|
+
[1800, 0.295],
|
|
4282
|
+
[2700, 0.4725],
|
|
4283
|
+
[WAIT_MAX_SEC, 1]
|
|
4284
|
+
];
|
|
4285
|
+
var FIGMA_TRAVEL_PX = 400;
|
|
4286
|
+
function waitScaleFor(travelPx) {
|
|
4287
|
+
if (!Number.isFinite(travelPx) || travelPx >= FIGMA_TRAVEL_PX || travelPx < 200) return WAIT_POINTS;
|
|
4288
|
+
return WAIT_POINTS.map(
|
|
4289
|
+
([sec, fraction], i) => i === 0 || i === WAIT_POINTS.length - 1 ? [sec, fraction] : [sec, fraction * FIGMA_TRAVEL_PX / travelPx]
|
|
4290
|
+
);
|
|
4291
|
+
}
|
|
4292
|
+
var WAIT_POSITIONS = 1e3;
|
|
4293
|
+
function waitFraction(sec, points = WAIT_POINTS) {
|
|
4294
|
+
const s = clampWait(sec);
|
|
4295
|
+
for (let i = 1; i < points.length; i++) {
|
|
4296
|
+
const [s1, f1] = points[i];
|
|
4297
|
+
if (s <= s1) {
|
|
4298
|
+
const [s0, f0] = points[i - 1];
|
|
4299
|
+
return f0 + (s - s0) / (s1 - s0) * (f1 - f0);
|
|
4300
|
+
}
|
|
4301
|
+
}
|
|
4302
|
+
return 1;
|
|
4303
|
+
}
|
|
4304
|
+
function waitFromFraction(fraction, points = WAIT_POINTS) {
|
|
4305
|
+
const f = Number.isFinite(fraction) ? Math.min(1, Math.max(0, fraction)) : 0;
|
|
4306
|
+
for (let i = 1; i < points.length; i++) {
|
|
4307
|
+
const [s1, f1] = points[i];
|
|
4308
|
+
if (f <= f1) {
|
|
4309
|
+
const [s0, f0] = points[i - 1];
|
|
4310
|
+
return s0 + (f - f0) / (f1 - f0) * (s1 - s0);
|
|
4311
|
+
}
|
|
4312
|
+
}
|
|
4313
|
+
return WAIT_MAX_SEC;
|
|
4314
|
+
}
|
|
4315
|
+
function snapWait(sec) {
|
|
4316
|
+
return clampWait(Math.round(sec / WAIT_STEP_SEC) * WAIT_STEP_SEC);
|
|
4317
|
+
}
|
|
4318
|
+
function waitLabel(sec) {
|
|
4319
|
+
const min = Math.round(clampWait(sec) / 60);
|
|
4320
|
+
if (min >= 60 && min % 60 === 0) return `Up to ${min / 60} ${min === 60 ? "hour" : "hours"}`;
|
|
4321
|
+
return `Up to ${min} min`;
|
|
4322
|
+
}
|
|
4278
4323
|
var hasTime = (o) => Number.isFinite(o.estimatedDuration) && o.estimatedDuration > 0;
|
|
4279
4324
|
function selectableOptions(options) {
|
|
4280
4325
|
return options.filter((o) => !o.unavailable);
|
|
@@ -4298,15 +4343,23 @@ function pickForWait(options, waitSec) {
|
|
|
4298
4343
|
}
|
|
4299
4344
|
var MAX_QUOTE_CARDS = 3;
|
|
4300
4345
|
function visibleOptions(options, waitSec, selectedId) {
|
|
4301
|
-
if (options.length <= MAX_QUOTE_CARDS) return
|
|
4346
|
+
if (options.length <= MAX_QUOTE_CARDS) return nettingFirst(options);
|
|
4302
4347
|
const selectable = selectableOptions(options);
|
|
4303
|
-
if (selectable.length === 0) return options.slice(0, MAX_QUOTE_CARDS);
|
|
4348
|
+
if (selectable.length === 0) return nettingFirst(options.slice(0, MAX_QUOTE_CARDS));
|
|
4304
4349
|
const chosen = selectable.find((o) => o.id === selectedId) ?? pickForWait(options, waitSec);
|
|
4305
4350
|
const gasless = bestOutputOption(selectable.filter((o) => o.gasSponsored));
|
|
4306
4351
|
const netting = bestOutputOption(selectable.filter((o) => o.entersNetting));
|
|
4307
4352
|
const ids = new Set([chosen?.id, fastestOption(options)?.id, gasless?.id, netting?.id].filter((id) => !!id));
|
|
4308
4353
|
const keep = new Set([...ids].slice(0, MAX_QUOTE_CARDS));
|
|
4309
|
-
return options.filter((o) => keep.has(o.id));
|
|
4354
|
+
return nettingFirst(options.filter((o) => keep.has(o.id)));
|
|
4355
|
+
}
|
|
4356
|
+
function nettingFirst(options) {
|
|
4357
|
+
return [...options.filter((o) => o.entersNetting), ...options.filter((o) => !o.entersNetting)];
|
|
4358
|
+
}
|
|
4359
|
+
function compareDuration(seconds) {
|
|
4360
|
+
if (!Number.isFinite(seconds) || seconds <= 0) return "--";
|
|
4361
|
+
if (seconds < 60) return `~${Math.round(seconds)} s`;
|
|
4362
|
+
return `~${Math.round(seconds / 60)} min`;
|
|
4310
4363
|
}
|
|
4311
4364
|
function parity(options, inputUsd, toUnitUsd) {
|
|
4312
4365
|
const priced = (v) => typeof v === "number" && Number.isFinite(v) && v > 0;
|
|
@@ -4362,10 +4415,10 @@ function routeShapeLabel(option) {
|
|
|
4362
4415
|
function cornerTags(options, option, parityState) {
|
|
4363
4416
|
if (option.unavailable) return [];
|
|
4364
4417
|
if (option.kind === "transfer") return [{ text: "Transfer", tone: "brand" }];
|
|
4418
|
+
if (option.entersNetting) return [{ text: "Best return", tone: "green" }];
|
|
4365
4419
|
const tags = [];
|
|
4366
4420
|
const labelledFastest = selectableOptions(options).some((o) => o.label?.toLowerCase() === "fastest");
|
|
4367
4421
|
if (parityState.kind === "at" && parityState.option.id === option.id) tags.push({ text: "Target 1:1", tone: "brand" });
|
|
4368
|
-
else if (option.entersNetting) tags.push({ text: "Potential best return", tone: "brand" });
|
|
4369
4422
|
else if (option.label?.toLowerCase() === "fastest") tags.push({ text: "Fastest", tone: "brand" });
|
|
4370
4423
|
else if (option.gasSponsored) tags.push({ text: "Gasless", tone: "purple" });
|
|
4371
4424
|
else {
|
|
@@ -4373,9 +4426,24 @@ function cornerTags(options, option, parityState) {
|
|
|
4373
4426
|
const text = badge === "Fastest" && labelledFastest ? void 0 : badge ?? routeShapeLabel(option) ?? void 0;
|
|
4374
4427
|
if (text) tags.push({ text, tone: "brand" });
|
|
4375
4428
|
}
|
|
4376
|
-
if (option.entersNetting) tags.push({ text: "Netting", tone: "green" });
|
|
4377
4429
|
return tags;
|
|
4378
4430
|
}
|
|
4431
|
+
function humanAmount(n, maxFrac = 6) {
|
|
4432
|
+
if (!Number.isFinite(n)) return String(n);
|
|
4433
|
+
if (n === 0) return "0";
|
|
4434
|
+
const digits = Math.min(Math.max(0, Math.trunc(maxFrac)), 8);
|
|
4435
|
+
const fixed = n.toFixed(digits);
|
|
4436
|
+
const out = fixed.includes(".") ? fixed.replace(/\.?0+$/, "") : fixed;
|
|
4437
|
+
if (Number(out) === 0) return `<${digits > 0 ? `0.${"0".repeat(digits - 1)}1` : "1"}`;
|
|
4438
|
+
const match = out.match(/^([+-]?)(\d+)(\.\d+)?$/);
|
|
4439
|
+
return match ? `${match[1]}${match[2].replace(/\B(?=(\d{3})+(?!\d))/g, ",")}${match[3] ?? ""}` : out;
|
|
4440
|
+
}
|
|
4441
|
+
function compareAmount(value) {
|
|
4442
|
+
const text = humanAmount(value, 6);
|
|
4443
|
+
if (text.startsWith("<")) return text;
|
|
4444
|
+
const [whole, fraction = ""] = text.split(".");
|
|
4445
|
+
return fraction.length >= 2 ? text : `${whole}.${fraction.padEnd(2, "0")}`;
|
|
4446
|
+
}
|
|
4379
4447
|
function compareFeeUsd(option, fromUsd) {
|
|
4380
4448
|
const centibips = option.feeCentibips;
|
|
4381
4449
|
if (centibips === void 0 || option.feeNative) return null;
|
|
@@ -4894,7 +4962,7 @@ var CHANNEL_HEADER = "x-zd-channel";
|
|
|
4894
4962
|
var CHANNEL_VERSION_HEADER = "x-zd-channel-version";
|
|
4895
4963
|
var CHANNEL_ORIGIN_HEADER = "x-zd-channel-origin";
|
|
4896
4964
|
var WIDGET_CHANNEL = "widget";
|
|
4897
|
-
var WIDGET_VERSION = "4.
|
|
4965
|
+
var WIDGET_VERSION = "4.20.0" ;
|
|
4898
4966
|
var MAX_CHANNEL_VERSION_LEN = 32;
|
|
4899
4967
|
function sanitizeVersion(raw2) {
|
|
4900
4968
|
const v = String(raw2).trim();
|
|
@@ -4931,6 +4999,20 @@ function isReportableSubmission(report) {
|
|
|
4931
4999
|
return typeof wallet === "string" && /^0x[0-9a-fA-F]{40}$/.test(wallet);
|
|
4932
5000
|
}
|
|
4933
5001
|
|
|
5002
|
+
// src/core/quote-refusals.ts
|
|
5003
|
+
var GATE_REFUSALS = /* @__PURE__ */ new Set(["ROUTE_UNHEALTHY", "ROUTE_UNMEASURED", "GATE_UNAVAILABLE"]);
|
|
5004
|
+
function quoteRefusalCopy(code) {
|
|
5005
|
+
return code && GATE_REFUSALS.has(code) ? "This route is not available right now. Try again in a moment, or pick another token or network." : void 0;
|
|
5006
|
+
}
|
|
5007
|
+
var DETERMINISTIC_REFUSALS = /* @__PURE__ */ new Set(["ROUTE_UNHEALTHY", "ROUTE_UNMEASURED", "ROUTE_BLOCKED", "PAIR_HALTED", "PROTOCOL_DISABLED"]);
|
|
5008
|
+
var TRANSIENT_REFUSALS = /* @__PURE__ */ new Set(["GATE_UNAVAILABLE", "MARKET_HALTED"]);
|
|
5009
|
+
function gateRefusalRetryable(code) {
|
|
5010
|
+
if (!code) return void 0;
|
|
5011
|
+
if (DETERMINISTIC_REFUSALS.has(code)) return false;
|
|
5012
|
+
if (TRANSIENT_REFUSALS.has(code)) return true;
|
|
5013
|
+
return void 0;
|
|
5014
|
+
}
|
|
5015
|
+
|
|
4934
5016
|
// src/core/api.ts
|
|
4935
5017
|
function apiError(message, props = {}) {
|
|
4936
5018
|
const err2 = new Error(message);
|
|
@@ -4994,6 +5076,8 @@ function nowFresh(entry) {
|
|
|
4994
5076
|
return !!entry && Date.now() - entry.at < API_CACHE_TTL_MS;
|
|
4995
5077
|
}
|
|
4996
5078
|
function isTransientQuoteError(error) {
|
|
5079
|
+
const gate = gateRefusalRetryable(error?.code);
|
|
5080
|
+
if (gate !== void 0) return gate;
|
|
4997
5081
|
if (error?.code === "BRIDGE_RATE_LIMITED" || Array.isArray(error?.fieldErrors) && error.fieldErrors.length > 0) return false;
|
|
4998
5082
|
return error?.code === "gateway_timeout" || error?.status === 502 || error?.status === 503 || error?.status === 504 || /failed to get swap quote|timeout|temporar/i.test(error?.message || "");
|
|
4999
5083
|
}
|
|
@@ -5064,9 +5148,10 @@ function createApiClient(cfg) {
|
|
|
5064
5148
|
}
|
|
5065
5149
|
}
|
|
5066
5150
|
if (!response.ok) {
|
|
5067
|
-
|
|
5151
|
+
const code = json?.error?.code || json?.code || (response.status >= 502 ? "gateway_timeout" : "api_error");
|
|
5152
|
+
throw apiError(quoteRefusalCopy(code) ?? apiMessage(json, `ZeroDelta request failed (${response.status}).`), {
|
|
5068
5153
|
status: response.status,
|
|
5069
|
-
code
|
|
5154
|
+
code,
|
|
5070
5155
|
fieldErrors: json?.error?.fieldErrors || json?.fieldErrors,
|
|
5071
5156
|
limits: json?.error?.limits || json?.limits,
|
|
5072
5157
|
reasons: json?.error?.reasons || json?.reasons
|
|
@@ -6674,6 +6759,11 @@ function useFlow(args) {
|
|
|
6674
6759
|
};
|
|
6675
6760
|
}
|
|
6676
6761
|
var RETRY_DELAYS_MS = [800, 2400, 6e3];
|
|
6762
|
+
var CATALOGUE_REFRESH_MS = 6e4 + 250;
|
|
6763
|
+
function catalogueSignature(c) {
|
|
6764
|
+
const ids = (list) => list.map((t) => `${Number(t.chainId)}:${String(t.address).toLowerCase()}`).join(",");
|
|
6765
|
+
return [ids(c.tokens), ids(c.sources), [...c.source].sort().join(","), [...c.destination].sort().join(","), [...c.lanes ?? []].sort().join(","), [...c.brokenLanes?.keys() ?? []].sort().join(","), [...c.limitedLanes.keys()].sort().join(",")].join("|");
|
|
6766
|
+
}
|
|
6677
6767
|
function useCatalogue(engine, options = {}) {
|
|
6678
6768
|
const { allowedAssets, product, solanaSources } = options;
|
|
6679
6769
|
const enabled = options.enabled !== false;
|
|
@@ -6690,7 +6780,10 @@ function useCatalogue(engine, options = {}) {
|
|
|
6690
6780
|
engine.fetchCatalogue(allowedAssets, product, solanaSources ? { solanaSources: true } : void 0).then((next) => {
|
|
6691
6781
|
if (!alive) return;
|
|
6692
6782
|
setCatalogue(next);
|
|
6693
|
-
if (next.ready)
|
|
6783
|
+
if (next.ready) {
|
|
6784
|
+
timer2 = setTimeout(refresh, CATALOGUE_REFRESH_MS);
|
|
6785
|
+
return;
|
|
6786
|
+
}
|
|
6694
6787
|
if (attempt >= RETRY_DELAYS_MS.length) {
|
|
6695
6788
|
setFailed(true);
|
|
6696
6789
|
return;
|
|
@@ -6698,6 +6791,23 @@ function useCatalogue(engine, options = {}) {
|
|
|
6698
6791
|
timer2 = setTimeout(read, RETRY_DELAYS_MS[attempt++]);
|
|
6699
6792
|
});
|
|
6700
6793
|
};
|
|
6794
|
+
const refresh = () => {
|
|
6795
|
+
if (typeof document !== "undefined" && document.visibilityState === "hidden") {
|
|
6796
|
+
timer2 = setTimeout(refresh, CATALOGUE_REFRESH_MS);
|
|
6797
|
+
return;
|
|
6798
|
+
}
|
|
6799
|
+
if (isUserIdle()) {
|
|
6800
|
+
timer2 = setTimeout(refresh, CATALOGUE_REFRESH_MS);
|
|
6801
|
+
return;
|
|
6802
|
+
}
|
|
6803
|
+
engine.fetchCatalogue(allowedAssets, product, solanaSources ? { solanaSources: true } : void 0).then((next) => {
|
|
6804
|
+
if (!alive) return;
|
|
6805
|
+
if (next.ready) setCatalogue((prev) => prev?.ready && catalogueSignature(prev) === catalogueSignature(next) ? prev : next);
|
|
6806
|
+
}).catch(() => {
|
|
6807
|
+
}).finally(() => {
|
|
6808
|
+
if (alive) timer2 = setTimeout(refresh, CATALOGUE_REFRESH_MS);
|
|
6809
|
+
});
|
|
6810
|
+
};
|
|
6701
6811
|
read();
|
|
6702
6812
|
return () => {
|
|
6703
6813
|
alive = false;
|
|
@@ -7685,6 +7795,217 @@ button.sg-rcp-row:focus-visible{outline:2px solid var(--sg-accent);outline-offse
|
|
|
7685
7795
|
.sg-widget[data-sg-side]:has(>.sg-ws){display:flex;flex-direction:column}
|
|
7686
7796
|
.sg-widget[data-sg-side]>.sg-ws{flex:1 1 auto}
|
|
7687
7797
|
@media (prefers-reduced-motion:reduce){.sg-ws{animation:none}.sg-ws-spin{animation:none}}
|
|
7798
|
+
/* \u2500\u2500 Compliance details screen (ComplianceDetails) \u2014 Figma Widget Playground 3238:16033 / 16419 / 16879 / 17276 / 17894 \u2500\u2500 */
|
|
7799
|
+
.sg-cd{--sg-cd-r:min(var(--sg-radius-control),20px);--sg-t50:color-mix(in srgb,var(--sg-text) 50%,transparent);--sg-t25:color-mix(in srgb,var(--sg-text) 25%,transparent);display:flex;flex-direction:column;gap:12px;width:100%;box-sizing:border-box;animation:sg-cp-in var(--sg-motion-fast) var(--sg-ease-out-soft) both}
|
|
7800
|
+
.sg-cd:focus{outline:none}
|
|
7801
|
+
.sg-cd-back{position:relative;align-self:flex-start;display:inline-flex;align-items:center;gap:10px;margin:0 0 12px;padding:0;border:0;background:transparent;color:var(--sg-t50);font:inherit;font-size:14px;font-weight:500;line-height:1.2;cursor:pointer;transition:color 120ms ease}
|
|
7802
|
+
.sg-cd-back::after{content:"";position:absolute;inset:-12px -10px}
|
|
7803
|
+
.sg-cd-back:hover{color:var(--sg-text)}
|
|
7804
|
+
.sg-cd-back:focus-visible{outline:2px solid var(--sg-accent);outline-offset:4px;border-radius:6px}
|
|
7805
|
+
.sg-cd-title{margin:0;font-family:var(--sg-font-display);font-size:16px;font-weight:600;line-height:19.2px;letter-spacing:.32px;color:var(--sg-t90)}
|
|
7806
|
+
.sg-cd-tabs{display:flex;align-items:stretch;gap:0;padding:4px;border:1px solid var(--sg-border);border-radius:calc(var(--sg-cd-r) - 4px)}
|
|
7807
|
+
.sg-cd-tab{flex:1 0 0;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-width:0;padding:13px 8px;border:0;border-radius:calc(var(--sg-cd-r) - 4px);background:transparent;color:var(--sg-t50);font:inherit;font-size:10px;font-weight:700;line-height:14px;text-transform:uppercase;letter-spacing:.2px;white-space:nowrap;cursor:pointer;transition:background 120ms ease,color 120ms ease}
|
|
7808
|
+
.sg-cd-tab:hover{color:var(--sg-text)}
|
|
7809
|
+
.sg-cd-tab[data-active="true"]{background:color-mix(in srgb,var(--sg-accent) 8%,transparent);color:var(--sg-accent)}
|
|
7810
|
+
.sg-cd-tab:focus-visible{outline:2px solid var(--sg-accent);outline-offset:-2px}
|
|
7811
|
+
.sg-cd-tab-count{font-weight:700;color:var(--sg-t25)}
|
|
7812
|
+
.sg-cd-tab[data-active="true"] .sg-cd-tab-count{color:color-mix(in srgb,var(--sg-accent) 50%,transparent)}
|
|
7813
|
+
.sg-cd-panel{display:flex;flex-direction:column;gap:6px;margin-top:-4px}
|
|
7814
|
+
.sg-cd-card{display:flex;flex-direction:column;gap:20px;padding:16px;border:1px solid var(--sg-border);border-radius:var(--sg-cd-r)}
|
|
7815
|
+
.sg-cd-card-head{display:flex;align-items:center;gap:8px}
|
|
7816
|
+
.sg-cd-card-glyph{display:flex;flex:0 0 auto;color:var(--sg-accent)}
|
|
7817
|
+
.sg-cd-card-title{margin:0;font-size:15px;font-weight:500;line-height:1.2;color:var(--sg-t90)}
|
|
7818
|
+
.sg-cd-summary{display:flex;flex-direction:column;gap:4px}
|
|
7819
|
+
.sg-cd-summary-head{display:flex;align-items:center;gap:8px;color:var(--sg-ok-ink)}
|
|
7820
|
+
.sg-cd-summary-head[data-tone="neutral"]{color:var(--sg-t60)}
|
|
7821
|
+
.sg-cd-summary-head[data-tone="blocked"],.sg-cd-summary-head[data-tone="warn"]{color:var(--sg-danger)}
|
|
7822
|
+
.sg-cd-summary-title{font-size:14px;font-weight:500;line-height:1.2;color:var(--sg-t90)}
|
|
7823
|
+
.sg-cd-summary-head[data-tone="blocked"] .sg-cd-summary-title,.sg-cd-summary-head[data-tone="warn"] .sg-cd-summary-title{color:var(--sg-danger)}
|
|
7824
|
+
.sg-cd-summary-sub{margin:0;padding-left:24px;font-size:13px;line-height:1.2;color:var(--sg-t50)}
|
|
7825
|
+
.sg-cd-checks{list-style:none;margin:2px 0 -1px;padding:0;display:flex;flex-direction:column;gap:12px}
|
|
7826
|
+
.sg-cd-card:has(.sg-cd-facts){gap:16px}
|
|
7827
|
+
.sg-cd-check-line{display:flex;align-items:center;gap:8px;min-width:0}
|
|
7828
|
+
.sg-cd-check-mark{display:flex;flex:0 0 auto;width:12px;justify-content:center;color:var(--sg-ok-ink)}
|
|
7829
|
+
.sg-cd-check-mark[data-ok="false"]{color:var(--sg-danger)}
|
|
7830
|
+
.sg-cd-check-label{font-size:14px;line-height:17px;color:var(--sg-t90)}
|
|
7831
|
+
.sg-cd-check[data-ok="false"] .sg-cd-check-label{color:var(--sg-danger)}
|
|
7832
|
+
.sg-cd-check-note,.sg-cd-check-reason{display:block;padding-left:26px;margin-top:3px;font-size:12px;line-height:1.4;color:var(--sg-t60);overflow-wrap:anywhere}
|
|
7833
|
+
.sg-cd-check-reason{color:var(--sg-danger)}
|
|
7834
|
+
.sg-cd-orphans{list-style:none;margin:0;padding:0 0 0 26px;display:flex;flex-direction:column;gap:3px;font-size:12px;line-height:1.4;color:var(--sg-danger)}
|
|
7835
|
+
.sg-cd-scope{margin:0;font-size:12px;line-height:1.45;color:var(--sg-t60)}
|
|
7836
|
+
.sg-cd-flags{margin:0;font-size:14px;color:var(--sg-t90)}
|
|
7837
|
+
.sg-cd-facts{margin:0;display:flex;flex-direction:column;gap:10px;padding-left:24px}
|
|
7838
|
+
.sg-cd-fact{display:grid;grid-template-columns:94px minmax(0,1fr);align-items:baseline;gap:0}
|
|
7839
|
+
.sg-cd-fact dt{font-size:13px;line-height:17px;color:var(--sg-t50)}
|
|
7840
|
+
.sg-cd-fact dd{margin:0;min-width:0;font-size:14px;line-height:17px;color:var(--sg-t90);overflow-wrap:anywhere}
|
|
7841
|
+
.sg-cd-policies{gap:6px}
|
|
7842
|
+
.sg-cd-policy{display:flex;flex-direction:column}
|
|
7843
|
+
.sg-cd-policy-head{position:relative;z-index:1;display:flex;align-items:center;gap:12px;width:100%;box-sizing:border-box;padding:21px 17px;border:1px solid var(--sg-border);border-radius:var(--sg-cd-r);background:var(--sg-bg);color:inherit;font:inherit;text-align:left}
|
|
7844
|
+
button.sg-cd-policy-head{cursor:pointer;transition:border-color 120ms ease}
|
|
7845
|
+
button.sg-cd-policy-head:hover{border-color:color-mix(in srgb,var(--sg-accent) 40%,var(--sg-border))}
|
|
7846
|
+
button.sg-cd-policy-head:focus-visible{outline:2px solid var(--sg-accent);outline-offset:2px}
|
|
7847
|
+
.sg-cd-policy-mark{display:flex;flex:0 0 auto;color:color-mix(in srgb,var(--sg-text) 45%,transparent)}
|
|
7848
|
+
.sg-cd-policy-text{display:flex;flex:1 1 auto;min-width:0;flex-direction:column;gap:6px}
|
|
7849
|
+
.sg-cd-policy-name{font-size:16px;font-weight:500;line-height:1.2;color:var(--sg-t90);overflow-wrap:anywhere}
|
|
7850
|
+
.sg-cd-policy-sub{font-size:14px;line-height:18px;color:var(--sg-t60)}
|
|
7851
|
+
.sg-cd-policy-chev{display:flex;flex:0 0 auto;color:var(--sg-t90)}
|
|
7852
|
+
.sg-cd-policy-body{display:flex;flex-direction:column;gap:6px;margin-top:-24px;padding:40px 16px 16px;border-radius:var(--sg-cd-r);background:color-mix(in srgb,var(--sg-accent) 8%,transparent);animation:sg-cp-in var(--sg-motion-fast) var(--sg-ease-out-soft) both}
|
|
7853
|
+
.sg-cd-bucket{position:relative;display:flex;flex-direction:column;gap:12px;padding:12px 16px;border-radius:var(--sg-cd-r);background:var(--sg-bg)}
|
|
7854
|
+
.sg-cd-bucket-head{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:4px 8px}
|
|
7855
|
+
.sg-cd-bucket[data-outcome] .sg-cd-bucket-head:has(.sg-cd-hint){justify-content:flex-start;align-items:center;gap:8px}
|
|
7856
|
+
.sg-cd-bucket-title{font-size:14px;font-weight:500;line-height:16px;color:var(--sg-t90)}
|
|
7857
|
+
.sg-cd-bucket-detail{font-size:12px;line-height:14px;color:var(--sg-t50)}
|
|
7858
|
+
.sg-cd-cats{list-style:none;margin:0;padding:0 0 0 8px;display:flex;flex-direction:column;gap:4px}
|
|
7859
|
+
.sg-cd-cats li{display:flex;align-items:center;gap:12px;font-size:13px;line-height:18px;color:var(--sg-t90)}
|
|
7860
|
+
.sg-cd-dot{flex:0 0 auto;width:4px;height:4px;border-radius:999px;background:var(--sg-t90)}
|
|
7861
|
+
.sg-cd-bucket[data-outcome="flagged"] .sg-cd-dot{background:var(--sg-accent);opacity:.8}
|
|
7862
|
+
.sg-cd-cats li .sg-cd-hint{margin-left:-6px}
|
|
7863
|
+
.sg-cd-hint{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:20px;height:20px;padding:0;border:0;border-radius:999px;background:transparent;color:var(--sg-t60);cursor:pointer;transition:color 120ms ease}
|
|
7864
|
+
.sg-cd-hint{position:relative}
|
|
7865
|
+
.sg-cd-hint::after{content:"";position:absolute;inset:-12px}
|
|
7866
|
+
.sg-cd-hint:hover,.sg-cd-hint[aria-expanded="true"]{color:var(--sg-accent)}
|
|
7867
|
+
.sg-cd-hint:focus-visible{outline:2px solid var(--sg-accent);outline-offset:1px}
|
|
7868
|
+
.sg-cd-tip{position:absolute;z-index:3;left:0;right:0;top:100%;margin-top:2px;padding:10px 12px;border-radius:12px;background:var(--sg-text);color:var(--sg-bg);font-size:12px;font-weight:400;line-height:1.4;text-align:left;pointer-events:none;box-shadow:0 6px 20px rgba(0,0,0,.18)}
|
|
7869
|
+
.sg-cd-cats li,.sg-cd-bucket-head{position:relative}
|
|
7870
|
+
.sg-cd-policy-version{margin:0;padding:4px 4px 0;font-size:12px;line-height:14px;color:var(--sg-t60);overflow-wrap:anywhere}
|
|
7871
|
+
/* Wide's second panel (layout="side", 280px): the same screen on a denser scale \u2014 Figma 3238:16419 / 18187 / 18446 */
|
|
7872
|
+
.sg-cd[data-layout="side"] .sg-cd-back{font-size:12px;font-weight:400;line-height:16px;margin-bottom:4px}
|
|
7873
|
+
.sg-cd[data-layout="side"] .sg-cd-title{margin-bottom:4px;font-family:inherit;font-size:16px;font-weight:500;line-height:1.2;letter-spacing:0}
|
|
7874
|
+
.sg-cd[data-layout="side"] .sg-cd-panel{margin-top:-8px}
|
|
7875
|
+
.sg-cd[data-layout="side"] .sg-cd-card{padding:16px 12px;gap:16px}
|
|
7876
|
+
.sg-cd[data-layout="side"] .sg-cd-card:has(.sg-cd-facts){gap:16px}
|
|
7877
|
+
.sg-cd[data-layout="side"] .sg-cd-card-title{font-size:14px}
|
|
7878
|
+
.sg-cd[data-layout="side"] .sg-cd-summary-head,.sg-cd[data-layout="side"] .sg-cd-card-head{gap:8px}
|
|
7879
|
+
.sg-cd[data-layout="side"] .sg-cd-summary-sub{padding-left:0;font-size:13px;line-height:16px}
|
|
7880
|
+
.sg-cd[data-layout="side"] .sg-cd-checks{gap:12px}
|
|
7881
|
+
.sg-cd[data-layout="side"] .sg-cd-check-label,.sg-cd[data-layout="side"] .sg-cd-fact dt,.sg-cd[data-layout="side"] .sg-cd-fact dd{font-size:13px;line-height:16px}
|
|
7882
|
+
.sg-cd[data-layout="side"] .sg-cd-facts{padding-left:24px;gap:10px}
|
|
7883
|
+
.sg-cd[data-layout="side"] .sg-cd-policy-head{gap:6px;padding:21px 13px}
|
|
7884
|
+
.sg-cd[data-layout="side"] .sg-cd-policy-text{gap:2px}
|
|
7885
|
+
.sg-cd[data-layout="side"] .sg-cd-policy-name{font-size:14px;line-height:1.2}
|
|
7886
|
+
.sg-cd[data-layout="side"] .sg-cd-policy-sub{font-size:13px;line-height:1.4}
|
|
7887
|
+
.sg-cd[data-layout="side"] .sg-cd-policy-mark svg{width:16px;height:16px}
|
|
7888
|
+
.sg-cd[data-layout="side"] .sg-cd-policy-body{padding:32px 8px 16px}
|
|
7889
|
+
.sg-cd[data-layout="side"] .sg-cd-bucket{gap:8px;padding:12px 16px;border-radius:16px}
|
|
7890
|
+
@media (prefers-reduced-motion:reduce){.sg-cd,.sg-cd-policy-body{animation:none}}
|
|
7891
|
+
/* \u2500\u2500 Compare quotes \u2014 Figma Widget Playground 3237:13270 / 3237:13581 / 3237:13897 / 3237:14224 (2026-11-13) \u2500\u2500 */
|
|
7892
|
+
.sg-widget{--sg-a5:color-mix(in srgb,var(--sg-accent) 5%,transparent);--sg-a8:color-mix(in srgb,var(--sg-accent) 8%,transparent);--sg-a50:color-mix(in srgb,var(--sg-accent) 50%,transparent);--sg-purple:#4f24b4;--sg-green-12:color-mix(in srgb,var(--sg-ok-ink) 12%,transparent);--sg-cq-dot:#8fb8b4}
|
|
7893
|
+
.sg-widget[data-sg-mode="dark"]{--sg-purple:#b79cff;--sg-cq-dot:color-mix(in srgb,var(--sg-text) 50%,transparent)}
|
|
7894
|
+
.sg-ws-titlerow{display:flex;align-items:center;gap:12px}
|
|
7895
|
+
.sg-cq-refresh{display:flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:0;border-radius:4px;background:transparent;color:var(--sg-accent);cursor:pointer}
|
|
7896
|
+
.sg-cq-refresh:focus-visible,.sg-cq-main:focus-visible,.sg-cq-route-toggle:focus-visible,.sg-cq-info:focus-visible,.sg-cq-gap:focus-visible{outline:2px solid var(--sg-accent);outline-offset:2px}
|
|
7897
|
+
.sg-cq-spin{animation:sg-spin 900ms linear infinite}
|
|
7898
|
+
.sg-cq{display:flex;flex-direction:column;gap:16px}
|
|
7899
|
+
.sg-cq-wait{display:flex;flex-direction:column;gap:20px;padding:16px 12px 20px;border-radius:24px;background:var(--sg-a5)}
|
|
7900
|
+
.sg-cq-wait-top{display:flex;flex-direction:column;gap:8px}
|
|
7901
|
+
.sg-cq-wait-row{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;font-size:13px;line-height:1.4;color:var(--sg-t80)}
|
|
7902
|
+
.sg-cq-wait-scale{display:flex;flex-direction:column;gap:12px}
|
|
7903
|
+
.sg-cq-track{position:relative;width:100%;height:20px}
|
|
7904
|
+
.sg-cq-range{position:absolute;inset:0;z-index:1;width:100%;height:100%;margin:0;padding:0;border-radius:10px;opacity:0;cursor:pointer;appearance:none;-webkit-appearance:none}
|
|
7905
|
+
.sg-cq-rail{position:absolute;inset:0;overflow:hidden;border-radius:10px;border:1px solid color-mix(in srgb,var(--sg-bg) 80%,transparent);background:var(--sg-a8) repeating-linear-gradient(120deg,transparent 0 5.06px,color-mix(in srgb,var(--sg-bg) 30%,transparent) 5.06px 9.06px)}
|
|
7906
|
+
.sg-cq-range:focus-visible~.sg-cq-rail{outline:2px solid var(--sg-accent);outline-offset:2px}
|
|
7907
|
+
.sg-cq-thumb{position:absolute;left:2px;top:2px;bottom:2px;display:flex;align-items:center;justify-content:flex-end;border-radius:8px;border:1px solid var(--sg-bg);background:var(--sg-accent)}
|
|
7908
|
+
.sg-cq-thumb svg{flex:0 0 auto;margin-right:1px}
|
|
7909
|
+
.sg-cq-ends{position:relative;display:flex;align-items:center;justify-content:space-between;font-size:12px;font-weight:500;line-height:1.2;color:var(--sg-t50)}
|
|
7910
|
+
.sg-cq-parity{position:absolute;top:calc(50% + 2px);transform:translate(-50%,-50%);display:flex;flex-direction:column;align-items:center;padding:4px 8px;border-radius:8px;background:var(--sg-a8);font-size:11px;line-height:1.3;text-align:center;color:color-mix(in srgb,var(--sg-accent) 80%,var(--sg-text))}
|
|
7911
|
+
.sg-cq-parity-none{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);white-space:nowrap;font-size:11px;font-weight:400;color:var(--sg-t50)}
|
|
7912
|
+
.sg-cq-rule{height:1px;margin-top:-1px;background:var(--sg-a12)}
|
|
7913
|
+
.sg-cq-extra{display:flex;flex-wrap:nowrap;align-items:center;justify-content:space-between;gap:8px}
|
|
7914
|
+
.sg-cq-extra-icon{flex:0 0 auto;align-self:center;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:999px;background:var(--sg-green-12);color:var(--sg-ok-ink)}
|
|
7915
|
+
.sg-cq-extra-icon svg{width:16px;height:16px}
|
|
7916
|
+
.sg-cq-extra-text{display:flex;flex:0 1 auto;min-width:0;flex-direction:column;justify-content:center;gap:0;margin-right:auto}
|
|
7917
|
+
.sg-cq-parity{white-space:nowrap}
|
|
7918
|
+
.sg-ws:has(.sg-cq) .sg-ws-top{gap:24px}
|
|
7919
|
+
.sg-cq-info,.sg-cq-gap{padding:0;border:0;background:transparent;font:inherit}
|
|
7920
|
+
.sg-cq-extra-label{display:flex;align-items:center;gap:6px;white-space:nowrap;font-size:12px;line-height:1.2;color:var(--sg-t50)}
|
|
7921
|
+
.sg-cq-extra-amt{white-space:nowrap;font-size:16px;font-weight:500;line-height:1.2;color:var(--sg-t90)}
|
|
7922
|
+
.sg-cq-extra-note{align-self:center;flex:0 0 auto;margin-left:auto;min-width:0;white-space:nowrap;text-align:right;font-size:9px;line-height:1.2;color:var(--sg-t50)}
|
|
7923
|
+
.sg-cq-info{display:inline-flex;border-radius:4px;color:var(--sg-t50);cursor:help}
|
|
7924
|
+
.sg-cq-list{display:flex;flex-direction:column;gap:8px}
|
|
7925
|
+
.sg-cq-empty{margin:0;padding:24px 0;text-align:center;font-size:13px;line-height:1.4;color:var(--sg-t50)}
|
|
7926
|
+
.sg-cq-card{position:relative;display:flex;flex-direction:column;gap:16px;overflow:clip;padding:16px 12px;border-radius:20px;border:1px solid var(--sg-a12);background:var(--sg-bg)}
|
|
7927
|
+
.sg-cq-card[data-selected]{border-color:color-mix(in srgb,var(--sg-accent) 80%,transparent)}
|
|
7928
|
+
.sg-cq-card[data-unavailable]{background:var(--sg-a4);opacity:.6;filter:grayscale(1)}
|
|
7929
|
+
.sg-cq-main{display:flex;flex-direction:column;align-items:flex-start;gap:20px;width:100%;padding:0;border:0;border-radius:20px;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}
|
|
7930
|
+
.sg-cq-main:disabled{cursor:not-allowed}
|
|
7931
|
+
.sg-cq-head{display:flex;align-items:flex-start;gap:8px;width:100%;padding-right:min(150px,42%)}
|
|
7932
|
+
.sg-cq-radio{flex:0 0 auto;display:grid;place-items:center;width:16px;height:16px;margin-top:1.6px;border-radius:999px;border:1px solid var(--sg-a50)}
|
|
7933
|
+
.sg-cq-radio[data-on]{border-color:var(--sg-accent)}
|
|
7934
|
+
.sg-cq-radio[data-on]::after{content:"";width:8px;height:8px;border-radius:999px;background:var(--sg-accent)}
|
|
7935
|
+
.sg-cq-amount{min-width:0;font-size:16px;font-weight:500;line-height:1.2;color:var(--sg-t90)}
|
|
7936
|
+
.sg-cq-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
|
|
7937
|
+
.sg-cq-tag{position:absolute;top:-2px;right:-2px;display:flex;align-items:center;gap:8px;padding:10px 32px 12px;border-radius:0 0 0 40px;background:var(--sg-a8);font-size:12px;font-weight:500;line-height:1.4;letter-spacing:.12px}
|
|
7938
|
+
.sg-cq-tag[data-kind="netting"]{background:var(--sg-green-12)}
|
|
7939
|
+
.sg-cq-tag[data-kind="purple"]{background:color-mix(in srgb,var(--sg-purple) 8%,transparent)}
|
|
7940
|
+
.sg-cq-tag-item{display:flex;align-items:center;gap:8px;white-space:nowrap}
|
|
7941
|
+
.sg-cq-tag-dot{width:4px;height:4px;border-radius:999px;background:var(--sg-cq-dot)}
|
|
7942
|
+
.sg-overlay[data-sg-overlay="drawer"] .sg-cq[data-layout="card"] .sg-cq-tag{padding:10px 20px 12px;border-radius:0 0 0 32px;font-size:11px;letter-spacing:.11px;gap:6px}
|
|
7943
|
+
.sg-cq-tag [data-tone="brand"]{color:var(--sg-accent)}
|
|
7944
|
+
.sg-cq-tag [data-tone="green"]{color:var(--sg-ok-ink)}
|
|
7945
|
+
.sg-cq-tag [data-tone="purple"]{color:var(--sg-purple)}
|
|
7946
|
+
.sg-widget[data-sg-mode="dark"] .sg-cq-tag [data-tone="brand"]{color:var(--sg-info)}
|
|
7947
|
+
.sg-cq-stats{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:0 12px 0 24px}
|
|
7948
|
+
.sg-cq-cols{display:flex;align-items:center;gap:32px;white-space:nowrap}
|
|
7949
|
+
.sg-cq-col{display:flex;flex-direction:column;justify-content:center;gap:6px}
|
|
7950
|
+
.sg-cq-col-label{font-size:10px;font-weight:500;line-height:1.2;text-transform:uppercase;color:var(--sg-t50)}
|
|
7951
|
+
.sg-cq-col-value{font-size:14px;line-height:1.2;color:var(--sg-text)}
|
|
7952
|
+
.sg-cq-note{width:125px;text-align:right;font-size:12px;line-height:1.2;color:var(--sg-t50)}
|
|
7953
|
+
.sg-cq-why{padding-left:24px;font-size:13px;line-height:1.3;color:var(--sg-t50)}
|
|
7954
|
+
.sg-cq-route{display:flex;flex-direction:column;gap:10px;padding-left:24px}
|
|
7955
|
+
.sg-cq-route-toggle{display:flex;align-items:center;gap:4px;width:fit-content;padding:0;border:0;border-radius:4px;background:transparent;font:inherit;font-size:10px;font-weight:500;line-height:1.2;text-transform:uppercase;color:var(--sg-t50);cursor:pointer}
|
|
7956
|
+
.sg-cq-route-toggle svg{color:var(--sg-text)}
|
|
7957
|
+
.sg-cq-hops{display:flex;flex-wrap:wrap;align-items:flex-start;gap:4px}
|
|
7958
|
+
.sg-cq-hop{display:flex;align-items:flex-start;gap:4px}
|
|
7959
|
+
.sg-cq-arrow{flex:0 0 auto;color:var(--sg-accent)}
|
|
7960
|
+
.sg-cq-hop-body{display:flex;flex-direction:column;gap:4px}
|
|
7961
|
+
.sg-cq-hop-name{display:flex;align-items:center;gap:4px;font-size:14px;line-height:1.2;color:var(--sg-text)}
|
|
7962
|
+
.sg-cq-hop-chain{white-space:nowrap;font-size:12px;line-height:1.2;color:var(--sg-t50)}
|
|
7963
|
+
.sg-cq .sg-tok[data-size="xxs"] .sg-tok-badge{min-width:8px;width:8px;height:8px;right:-1px;bottom:-1px;border-width:1px;border-color:var(--sg-bg);font-size:4px;padding:0}
|
|
7964
|
+
.sg-cq .sg-tok[data-size="xs"] .sg-tok-badge{min-width:11px;width:11px;height:11px;right:-3px;bottom:-3px;border-width:1px;border-color:var(--sg-bg);font-size:4px;padding:0}
|
|
7965
|
+
/* Back-link and gap scoped to Compare quotes (Figma: 14px t50 compact, 12px t50 wide, 24px/16px to the title). */
|
|
7966
|
+
.sg-ws:has(.sg-cq) .sg-ws-back{font-size:14px;font-weight:500;color:var(--sg-t50)}
|
|
7967
|
+
.sg-dialog .sg-ws:has(.sg-cq):not([data-wide]) .sg-ws-top{gap:16px}
|
|
7968
|
+
/* Wide: compact cards, the tag a centred band across the card's top, the route as inline marks */
|
|
7969
|
+
.sg-cq[data-layout="side"] .sg-cq-card{gap:12px;padding:0 0 16px;border-radius:20px}
|
|
7970
|
+
.sg-cq[data-layout="side"] .sg-cq-tag{position:static;justify-content:center;width:100%;padding:2px 20px 4px;border-radius:0;font-size:11px;line-height:1.4;letter-spacing:.11px;gap:6px}
|
|
7971
|
+
.sg-ws[data-wide]:has(.sg-cq) .sg-ws-top{gap:16px}
|
|
7972
|
+
.sg-ws[data-wide]:has(.sg-cq) .sg-ws-title{font-size:16px}
|
|
7973
|
+
.sg-ws[data-wide]:has(.sg-cq) .sg-ws-back{font-size:12px;font-weight:400;color:var(--sg-t50)}
|
|
7974
|
+
.sg-cq[data-layout="side"]{gap:12px}
|
|
7975
|
+
.sg-cq[data-layout="side"] .sg-cq-wait{padding:16px 12px 20px;gap:20px}
|
|
7976
|
+
.sg-cq[data-layout="side"] .sg-cq-rule{margin-bottom:-8px}
|
|
7977
|
+
.sg-cq[data-layout="side"] .sg-cq-card:not(:has(.sg-cq-tag)){padding-top:12px}
|
|
7978
|
+
.sg-cq[data-layout="side"] .sg-cq-main{gap:20px;padding:0 12px;border-radius:0}
|
|
7979
|
+
.sg-cq[data-layout="side"] .sg-cq-head{padding-right:0!important}
|
|
7980
|
+
.sg-cq[data-layout="side"] .sg-cq-amount{font-size:15px}
|
|
7981
|
+
.sg-cq[data-layout="side"] .sg-cq-stats{padding:0}
|
|
7982
|
+
.sg-cq[data-layout="side"] .sg-cq-cols{gap:20px}
|
|
7983
|
+
.sg-cq[data-layout="side"] .sg-cq-col{gap:4px}
|
|
7984
|
+
.sg-cq[data-layout="side"] .sg-cq-col-label{font-size:9px}
|
|
7985
|
+
.sg-cq[data-layout="side"] .sg-cq-col-value{font-size:13px}
|
|
7986
|
+
.sg-cq[data-layout="side"] .sg-cq-card[data-selected]{border-color:color-mix(in srgb,var(--sg-accent) 50%,transparent)}
|
|
7987
|
+
.sg-cq[data-layout="side"] .sg-cq-extra-amt{font-size:15px}
|
|
7988
|
+
.sg-cq[data-layout="side"] .sg-cq-extra-label{gap:4px}
|
|
7989
|
+
.sg-cq[data-layout="side"] .sg-cq-info svg{width:12px;height:12px}
|
|
7990
|
+
.sg-cq[data-layout="side"] .sg-cq-card:not(:has(.sg-cq-tag)) .sg-cq-main{padding-top:0}
|
|
7991
|
+
.sg-cq-route-icons{display:flex;align-items:center;gap:2px}
|
|
7992
|
+
.sg-cq-route-icons .sg-cq-arrow{width:10px;height:10px}
|
|
7993
|
+
.sg-cq-hop-inline{display:flex;align-items:center;gap:2px}
|
|
7994
|
+
.sg-cq-hop-inline>span{display:flex}
|
|
7995
|
+
.sg-cq-gap{display:inline-flex;padding:0 2px;border-radius:4px;color:var(--sg-accent);text-decoration:underline;cursor:help}
|
|
7996
|
+
.sg-cq[data-layout="side"] .sg-cq-wait-scale .sg-cq-parity{flex-direction:row;gap:4px}
|
|
7997
|
+
/* Below Figma's widths the cards must shrink, not clip (narrow page; container = the sheet). */
|
|
7998
|
+
.sg-ws:has(.sg-cq){container-type:inline-size}
|
|
7999
|
+
@container (max-width:300px){
|
|
8000
|
+
.sg-cq-head{padding-right:0!important}
|
|
8001
|
+
.sg-cq-stats{flex-wrap:wrap;gap:8px;padding-left:0}
|
|
8002
|
+
.sg-cq-cols{flex-wrap:wrap;gap:12px;white-space:normal}
|
|
8003
|
+
.sg-cq-note{width:auto;max-width:100%;text-align:left}
|
|
8004
|
+
.sg-cq-route-icons{flex-wrap:wrap}
|
|
8005
|
+
.sg-cq-extra{flex-wrap:wrap}
|
|
8006
|
+
.sg-cq-extra-note{margin-left:0;text-align:left}
|
|
8007
|
+
}
|
|
8008
|
+
@media (prefers-reduced-motion:reduce){.sg-cq-spin{animation:none}}
|
|
7688
8009
|
`;
|
|
7689
8010
|
var injected = false;
|
|
7690
8011
|
function injectStyles() {
|
|
@@ -8369,7 +8690,7 @@ function groupDecimal2(value) {
|
|
|
8369
8690
|
if (!match) return value;
|
|
8370
8691
|
return `${match[1]}${match[2].replace(/\B(?=(\d{3})+(?!\d))/g, ",")}${match[3] ?? ""}`;
|
|
8371
8692
|
}
|
|
8372
|
-
function
|
|
8693
|
+
function humanAmount2(n, maxFrac = 6) {
|
|
8373
8694
|
if (!Number.isFinite(n)) return String(n);
|
|
8374
8695
|
if (n === 0) return "0";
|
|
8375
8696
|
const digits = Math.min(Math.max(0, Math.trunc(maxFrac)), 8);
|
|
@@ -8505,7 +8826,7 @@ function BalanceColumn(props) {
|
|
|
8505
8826
|
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-pk-bal", children: [
|
|
8506
8827
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-pk-bal-usd sg-mono", children: props.usd == null ? "\u2014" : formatBalanceUsd(props.usd) }),
|
|
8507
8828
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-pk-bal-amt sg-mono", children: [
|
|
8508
|
-
|
|
8829
|
+
humanAmount2(props.amount, 6),
|
|
8509
8830
|
" ",
|
|
8510
8831
|
props.symbol
|
|
8511
8832
|
] })
|
|
@@ -9987,34 +10308,64 @@ function SheetFrame(props) {
|
|
|
9987
10308
|
document.addEventListener("keydown", onKey, true);
|
|
9988
10309
|
return () => document.removeEventListener("keydown", onKey, true);
|
|
9989
10310
|
}, []);
|
|
9990
|
-
return
|
|
9991
|
-
"
|
|
9992
|
-
|
|
9993
|
-
|
|
9994
|
-
"
|
|
9995
|
-
|
|
9996
|
-
|
|
9997
|
-
|
|
9998
|
-
|
|
9999
|
-
|
|
10000
|
-
|
|
10001
|
-
|
|
10002
|
-
|
|
10003
|
-
|
|
10004
|
-
|
|
10005
|
-
|
|
10006
|
-
|
|
10311
|
+
return (
|
|
10312
|
+
// biome-ignore lint/a11y/noStaticElementInteractions: role is "region" or "dialog" — both carry semantics; the Tab trap only runs for the modal (dialog) case.
|
|
10313
|
+
// biome-ignore lint/a11y/useAriaPropsSupportedByRole: aria-modal is set only when role is "dialog" (asRegion is false); a region never receives it.
|
|
10314
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
10315
|
+
"div",
|
|
10316
|
+
{
|
|
10317
|
+
className: "sg-ws",
|
|
10318
|
+
"data-wide": props.wide || void 0,
|
|
10319
|
+
role: props.asRegion ? "region" : "dialog",
|
|
10320
|
+
"aria-modal": props.asRegion ? void 0 : "true",
|
|
10321
|
+
"aria-label": props.label,
|
|
10322
|
+
ref: sheetRef,
|
|
10323
|
+
tabIndex: -1,
|
|
10324
|
+
onKeyDown: props.trapFocus ? (event) => {
|
|
10325
|
+
if (event.key !== "Tab") return;
|
|
10326
|
+
const root = sheetRef.current;
|
|
10327
|
+
if (!root) return;
|
|
10328
|
+
const focusable = Array.from(
|
|
10329
|
+
root.querySelectorAll('a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])')
|
|
10330
|
+
).filter((el) => el.offsetParent !== null || el === document.activeElement);
|
|
10331
|
+
if (focusable.length === 0) {
|
|
10332
|
+
event.preventDefault();
|
|
10333
|
+
root.focus();
|
|
10334
|
+
return;
|
|
10335
|
+
}
|
|
10336
|
+
const first = focusable[0];
|
|
10337
|
+
const last = focusable[focusable.length - 1];
|
|
10338
|
+
const active = document.activeElement;
|
|
10339
|
+
if (event.shiftKey && (active === first || active === root)) {
|
|
10340
|
+
event.preventDefault();
|
|
10341
|
+
last.focus();
|
|
10342
|
+
} else if (!event.shiftKey && active === last) {
|
|
10343
|
+
event.preventDefault();
|
|
10344
|
+
first.focus();
|
|
10345
|
+
}
|
|
10346
|
+
} : void 0,
|
|
10347
|
+
style: props.minHeight ? { minHeight: props.minHeight } : void 0,
|
|
10348
|
+
children: [
|
|
10349
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-ws-top", children: [
|
|
10350
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-ws-head", children: [
|
|
10351
|
+
/* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "sg-ws-back", onClick: () => closeRef.current(), children: [
|
|
10352
|
+
/* @__PURE__ */ jsxRuntime.jsx(ArrowLeft, {}),
|
|
10353
|
+
props.backLabel ?? "Back to Exchange"
|
|
10354
|
+
] }),
|
|
10355
|
+
props.wide || props.hideClose ? null : /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "sg-ws-close", onClick: () => closeRef.current(), "aria-label": `Close ${props.label.toLowerCase()}`, children: /* @__PURE__ */ jsxRuntime.jsx(CloseX, {}) })
|
|
10007
10356
|
] }),
|
|
10008
|
-
|
|
10357
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-ws-main", children: [
|
|
10358
|
+
props.titleAddon ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-ws-titlerow", children: [
|
|
10359
|
+
/* @__PURE__ */ jsxRuntime.jsx("h4", { className: "sg-ws-title", id: titleId, children: props.title }),
|
|
10360
|
+
props.titleAddon
|
|
10361
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "sg-ws-title", id: titleId, children: props.title }),
|
|
10362
|
+
props.children
|
|
10363
|
+
] })
|
|
10009
10364
|
] }),
|
|
10010
|
-
/* @__PURE__ */ jsxRuntime.
|
|
10011
|
-
|
|
10012
|
-
|
|
10013
|
-
|
|
10014
|
-
] }),
|
|
10015
|
-
props.footer ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-ws-foot", children: props.footer }) : null
|
|
10016
|
-
]
|
|
10017
|
-
}
|
|
10365
|
+
props.footer ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-ws-foot", children: props.footer }) : null
|
|
10366
|
+
]
|
|
10367
|
+
}
|
|
10368
|
+
)
|
|
10018
10369
|
);
|
|
10019
10370
|
}
|
|
10020
10371
|
function WalletChip(props) {
|
|
@@ -11316,6 +11667,7 @@ function PillLauncher(props) {
|
|
|
11316
11667
|
const openAs = props.openAs === "drawer" ? "drawer" : "modal";
|
|
11317
11668
|
const [open, setOpen] = react.useState(!!props.defaultOpen);
|
|
11318
11669
|
const buttonRef = react.useRef(null);
|
|
11670
|
+
const dialogRef = react.useRef(null);
|
|
11319
11671
|
const close = () => {
|
|
11320
11672
|
setOpen(false);
|
|
11321
11673
|
requestAnimationFrame(() => buttonRef.current?.focus());
|
|
@@ -11323,7 +11675,32 @@ function PillLauncher(props) {
|
|
|
11323
11675
|
react.useEffect(() => {
|
|
11324
11676
|
if (!open) return;
|
|
11325
11677
|
const onKey = (e) => {
|
|
11326
|
-
if (e.key === "Escape")
|
|
11678
|
+
if (e.key === "Escape") {
|
|
11679
|
+
close();
|
|
11680
|
+
return;
|
|
11681
|
+
}
|
|
11682
|
+
if (e.key !== "Tab") return;
|
|
11683
|
+
const root = dialogRef.current;
|
|
11684
|
+
if (!root) return;
|
|
11685
|
+
const list = Array.from(root.querySelectorAll("a[href],button,input,select,textarea,[tabindex]")).filter(
|
|
11686
|
+
(el) => el.tabIndex >= 0 && !el.hasAttribute("disabled") && el.getClientRects().length > 0
|
|
11687
|
+
);
|
|
11688
|
+
if (list.length === 0) {
|
|
11689
|
+
e.preventDefault();
|
|
11690
|
+
return;
|
|
11691
|
+
}
|
|
11692
|
+
const first = list[0];
|
|
11693
|
+
const last = list[list.length - 1];
|
|
11694
|
+
const idx = list.indexOf(document.activeElement);
|
|
11695
|
+
if (e.shiftKey) {
|
|
11696
|
+
if (idx <= 0) {
|
|
11697
|
+
e.preventDefault();
|
|
11698
|
+
last.focus();
|
|
11699
|
+
}
|
|
11700
|
+
} else if (idx === -1 || idx === list.length - 1) {
|
|
11701
|
+
e.preventDefault();
|
|
11702
|
+
first.focus();
|
|
11703
|
+
}
|
|
11327
11704
|
};
|
|
11328
11705
|
document.addEventListener("keydown", onKey);
|
|
11329
11706
|
return () => document.removeEventListener("keydown", onKey);
|
|
@@ -11338,7 +11715,7 @@ function PillLauncher(props) {
|
|
|
11338
11715
|
] }),
|
|
11339
11716
|
open ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-overlay", "data-sg-overlay": openAs, children: [
|
|
11340
11717
|
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "sg-overlay-scrim", tabIndex: -1, "aria-label": "Close", onClick: close }),
|
|
11341
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-dialog", role: "dialog", "aria-modal": "true", "aria-label": props.verb, children: props.children(close, openAs) })
|
|
11718
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: dialogRef, className: "sg-dialog", role: "dialog", "aria-modal": "true", "aria-label": props.verb, children: props.children(close, openAs) })
|
|
11342
11719
|
] }) : null
|
|
11343
11720
|
] });
|
|
11344
11721
|
}
|
|
@@ -12011,6 +12388,658 @@ function useSolanaSourceFlow(args) {
|
|
|
12011
12388
|
}, []);
|
|
12012
12389
|
return { status, preview, plan, error, balanceRaw, cost, progress, signature, lastTxEntry, sent, addressed, needsPreparation, insufficient, solShort, run, reset };
|
|
12013
12390
|
}
|
|
12391
|
+
function BackArrow() {
|
|
12392
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M19 12H5m6-6-6 6 6 6", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
12393
|
+
}
|
|
12394
|
+
function ChevronDown2({ up = false }) {
|
|
12395
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", style: up ? { transform: "rotate(180deg)" } : void 0, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m6 9 6 6 6-6", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
12396
|
+
}
|
|
12397
|
+
function PolicyShield() {
|
|
12398
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
12399
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12400
|
+
"path",
|
|
12401
|
+
{
|
|
12402
|
+
d: "M17.0089 5.8002V7.3252C17.0089 7.85853 16.7589 8.35853 16.3255 8.66686L7.15885 15.3835C6.56719 15.8169 5.75885 15.8169 5.17552 15.3752L3.97552 14.4752C3.43385 14.0669 2.99219 13.1835 2.99219 12.5085V5.8002C2.99219 4.86686 3.70885 3.83353 4.58385 3.50853L9.14219 1.8002C9.61719 1.6252 10.3839 1.6252 10.8589 1.8002L15.4172 3.50853C16.2922 3.83353 17.0089 4.86686 17.0089 5.8002Z",
|
|
12403
|
+
fill: "currentColor"
|
|
12404
|
+
}
|
|
12405
|
+
),
|
|
12406
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12407
|
+
"path",
|
|
12408
|
+
{
|
|
12409
|
+
d: "M15.682 10.2829C16.232 9.88287 17.007 10.2745 17.007 10.9579V12.5245C17.007 13.1995 16.5654 14.0745 16.0237 14.4829L11.4654 17.8912C11.0654 18.1829 10.532 18.3329 9.9987 18.3329C9.46537 18.3329 8.93204 18.1829 8.53204 17.8829L7.84037 17.3662C7.39037 17.0329 7.39037 16.3579 7.84871 16.0245L15.682 10.2829Z",
|
|
12410
|
+
fill: "currentColor"
|
|
12411
|
+
}
|
|
12412
|
+
)
|
|
12413
|
+
] });
|
|
12414
|
+
}
|
|
12415
|
+
function InfoSquare() {
|
|
12416
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
|
|
12417
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "2", y: "2", width: "20", height: "20", rx: "6", fill: "currentColor" }),
|
|
12418
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 10.8v6", stroke: "var(--sg-bg)", strokeWidth: "2.1", strokeLinecap: "round" }),
|
|
12419
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "7.7", r: "1.25", fill: "var(--sg-bg)" })
|
|
12420
|
+
] });
|
|
12421
|
+
}
|
|
12422
|
+
function InfoOutline() {
|
|
12423
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
|
|
12424
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "9.2", stroke: "currentColor", strokeWidth: "1.7" }),
|
|
12425
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 11v5.4", stroke: "currentColor", strokeWidth: "1.9", strokeLinecap: "round" }),
|
|
12426
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "7.8", r: "1.15", fill: "currentColor" })
|
|
12427
|
+
] });
|
|
12428
|
+
}
|
|
12429
|
+
var FLAGGED_CATEGORY_HINTS = {
|
|
12430
|
+
"High-risk entity": "An entity associated with elevated financial-crime risk based on available screening data.",
|
|
12431
|
+
"Politically exposed person (PEP)": "A person who holds or has held a prominent public function, including close associates and family members.",
|
|
12432
|
+
"Unknown / unclassified": "The screening provider could not confidently assign the entity to a known risk category.",
|
|
12433
|
+
"Unclassified risk": "The screening provider could not confidently assign the entity to a known risk category."
|
|
12434
|
+
};
|
|
12435
|
+
var POLICY_DETAILS = {
|
|
12436
|
+
"always-blocked": "Cannot be changed or disabled",
|
|
12437
|
+
blocked: "Stops the order",
|
|
12438
|
+
flagged: "Does not automatically block"
|
|
12439
|
+
};
|
|
12440
|
+
function Hint({ id, label: label2, text, hint }) {
|
|
12441
|
+
const tipId = react.useId();
|
|
12442
|
+
const open = hint.open === id;
|
|
12443
|
+
const ptr = react.useRef("");
|
|
12444
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
12445
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12446
|
+
"button",
|
|
12447
|
+
{
|
|
12448
|
+
type: "button",
|
|
12449
|
+
className: "sg-cd-hint",
|
|
12450
|
+
"data-sg-hint": "",
|
|
12451
|
+
"aria-label": `About ${label2}`,
|
|
12452
|
+
"aria-expanded": open,
|
|
12453
|
+
"aria-describedby": open ? tipId : void 0,
|
|
12454
|
+
onPointerEnter: (e) => {
|
|
12455
|
+
ptr.current = e.pointerType;
|
|
12456
|
+
if (e.pointerType === "mouse") hint.setOpen(id);
|
|
12457
|
+
},
|
|
12458
|
+
onPointerLeave: (e) => {
|
|
12459
|
+
if (e.pointerType === "mouse") hint.setOpen(null);
|
|
12460
|
+
},
|
|
12461
|
+
onClick: () => {
|
|
12462
|
+
hint.setOpen(ptr.current === "mouse" ? id : open ? null : id);
|
|
12463
|
+
ptr.current = "";
|
|
12464
|
+
},
|
|
12465
|
+
onBlur: () => {
|
|
12466
|
+
ptr.current = "";
|
|
12467
|
+
},
|
|
12468
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(InfoOutline, {})
|
|
12469
|
+
}
|
|
12470
|
+
),
|
|
12471
|
+
open ? /* @__PURE__ */ jsxRuntime.jsx("span", { role: "tooltip", id: tipId, className: "sg-cd-tip", children: text }) : null
|
|
12472
|
+
] });
|
|
12473
|
+
}
|
|
12474
|
+
function CheckRow2({ check: check2, hideNote }) {
|
|
12475
|
+
const label2 = check2.id === "risk" ? check2.ok ? "Risk screening passed" : "Risk screening failed" : check2.label;
|
|
12476
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "sg-cd-check", "data-ok": check2.ok, children: [
|
|
12477
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-cd-check-line", children: [
|
|
12478
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-cd-check-mark", "data-ok": check2.ok, children: check2.ok ? /* @__PURE__ */ jsxRuntime.jsx(Tick, { size: 12 }) : /* @__PURE__ */ jsxRuntime.jsx(Cross, { size: 12 }) }),
|
|
12479
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-cd-check-label", children: label2 }),
|
|
12480
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-sr-only", children: check2.ok ? " \u2014 passed" : " \u2014 failed" })
|
|
12481
|
+
] }),
|
|
12482
|
+
check2.note && !hideNote ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-cd-check-note", children: check2.note }) : null,
|
|
12483
|
+
check2.reasons.map((reason) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-cd-check-reason", children: humanizeComplianceReason(reason) }, reason))
|
|
12484
|
+
] });
|
|
12485
|
+
}
|
|
12486
|
+
function Fact2({ label: label2, value, title, mono = false }) {
|
|
12487
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-cd-fact", children: [
|
|
12488
|
+
/* @__PURE__ */ jsxRuntime.jsx("dt", { children: label2 }),
|
|
12489
|
+
/* @__PURE__ */ jsxRuntime.jsx("dd", { title, className: mono ? "sg-mono" : void 0, children: value })
|
|
12490
|
+
] });
|
|
12491
|
+
}
|
|
12492
|
+
function QuoteChecks2(props) {
|
|
12493
|
+
const { compliance, cv, checks } = props;
|
|
12494
|
+
const allPassed = cv.tone === "ok" && checks.length > 0 && checks.every((c) => c.ok);
|
|
12495
|
+
const summary = allPassed ? "All checks passed" : cv.label;
|
|
12496
|
+
const orphans = unattributedComplianceReasons(compliance, cv);
|
|
12497
|
+
const wallets = distinctScreenedWallets(compliance);
|
|
12498
|
+
const jurisdiction = formatJurisdiction(compliance?.sourceJurisdiction, compliance?.sourceCountry);
|
|
12499
|
+
const hasDetails = Boolean(jurisdiction || wallets.length || compliance?.checkId);
|
|
12500
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-cd-panel", children: [
|
|
12501
|
+
/* @__PURE__ */ jsxRuntime.jsxs("section", { className: "sg-cd-card", children: [
|
|
12502
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-cd-summary", children: [
|
|
12503
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-cd-summary-head", "data-tone": cv.tone, children: [
|
|
12504
|
+
cv.tone === "blocked" || cv.tone === "warn" ? /* @__PURE__ */ jsxRuntime.jsx(CloseCircle, {}) : cv.tone === "neutral" ? /* @__PURE__ */ jsxRuntime.jsx(PendingCircle, {}) : /* @__PURE__ */ jsxRuntime.jsx(TickCircle, {}),
|
|
12505
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-cd-summary-title", children: summary })
|
|
12506
|
+
] }),
|
|
12507
|
+
checks.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "sg-cd-summary-sub", children: [
|
|
12508
|
+
checks.length,
|
|
12509
|
+
" check",
|
|
12510
|
+
checks.length === 1 ? " was" : "s were",
|
|
12511
|
+
" completed for this quote"
|
|
12512
|
+
] }) : (
|
|
12513
|
+
// No decision was issued. Listing the controls here would be ticks for a verdict nobody gave,
|
|
12514
|
+
// and an unconfigured gate is not a set of passed checks.
|
|
12515
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "sg-cd-summary-sub", children: "The gateway returned no compliance decision for this quote, so there is nothing to show. It is not a failed check." })
|
|
12516
|
+
)
|
|
12517
|
+
] }),
|
|
12518
|
+
checks.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "sg-cd-checks", children: checks.map((check2) => (
|
|
12519
|
+
// The Figma row carries no sub-line: with ONE screened wallet the note would repeat the
|
|
12520
|
+
// address Quote details names two cards down. Any other note (a count of wallets) stays.
|
|
12521
|
+
/* @__PURE__ */ jsxRuntime.jsx(CheckRow2, { check: check2, hideNote: check2.id === "screening" && wallets.length === 1 && hasDetails }, check2.id)
|
|
12522
|
+
)) }) : null,
|
|
12523
|
+
orphans.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "sg-cd-orphans", children: orphans.map((reason) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: humanizeComplianceReason(reason) }, reason)) }) : null,
|
|
12524
|
+
props.direct && checks.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "sg-cd-scope", children: DIRECT_SCOPE_NOTE }) : null
|
|
12525
|
+
] }),
|
|
12526
|
+
compliance?.flaggedCategories?.length ? /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "sg-cd-card", children: [
|
|
12527
|
+
/* @__PURE__ */ jsxRuntime.jsx("h4", { className: "sg-cd-card-title", children: "Flagged, not blocking" }),
|
|
12528
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "sg-cd-flags", children: compliance.flaggedCategories.map(categoryLabel).join(" \xB7 ") }),
|
|
12529
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "sg-cd-scope", children: "The policy records these and still allows the payment. They do not stop settlement." })
|
|
12530
|
+
] }) : null,
|
|
12531
|
+
hasDetails ? /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "sg-cd-card", children: [
|
|
12532
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-cd-card-head", children: [
|
|
12533
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-cd-card-glyph", children: /* @__PURE__ */ jsxRuntime.jsx(InfoSquare, {}) }),
|
|
12534
|
+
/* @__PURE__ */ jsxRuntime.jsx("h4", { className: "sg-cd-card-title", children: "Quote details" })
|
|
12535
|
+
] }),
|
|
12536
|
+
/* @__PURE__ */ jsxRuntime.jsxs("dl", { className: "sg-cd-facts", children: [
|
|
12537
|
+
jurisdiction ? /* @__PURE__ */ jsxRuntime.jsx(Fact2, { label: "Jurisdiction", value: jurisdiction }) : null,
|
|
12538
|
+
wallets.map((w, i) => /* @__PURE__ */ jsxRuntime.jsx(Fact2, { label: wallets.length > 1 ? i === 0 ? "Payer" : "Recipient" : "Wallet", value: shortAddr(w), title: w, mono: false }, w)),
|
|
12539
|
+
compliance?.checkId ? /* @__PURE__ */ jsxRuntime.jsx(Fact2, { label: "Check ID", value: compliance.checkId, mono: true }) : null
|
|
12540
|
+
] })
|
|
12541
|
+
] }) : null
|
|
12542
|
+
] });
|
|
12543
|
+
}
|
|
12544
|
+
function riskRuleCount() {
|
|
12545
|
+
return SCREENING_BUCKETS.reduce((total, bucket) => total + bucket.categories.length, 0);
|
|
12546
|
+
}
|
|
12547
|
+
function appliedPolicies(compliance) {
|
|
12548
|
+
const names = compliance?.appliedPolicyNames ?? [];
|
|
12549
|
+
const legislation = compliance?.appliedLegislation ?? [];
|
|
12550
|
+
const applied = Boolean(compliance?.decision || compliance?.policyVersion?.trim()) || names.length > 0;
|
|
12551
|
+
if (!applied) return [];
|
|
12552
|
+
const ids = compliance?.appliedPolicyIds ?? [];
|
|
12553
|
+
const summary = `${riskRuleCount()} risk rules`;
|
|
12554
|
+
const statements = legislation.map((name, i) => ({ id: `legislation-${i}-${name}`, name, summary: null, buckets: null }));
|
|
12555
|
+
if (names.length === 0) return [{ id: "zd-screening-matrix", name: "Transaction screening", summary, buckets: SCREENING_BUCKETS }, ...statements];
|
|
12556
|
+
if (names.length === 1) return [{ id: ids[0] ?? names[0], name: names[0], summary, buckets: SCREENING_BUCKETS }, ...statements];
|
|
12557
|
+
return [
|
|
12558
|
+
...names.map((name, i) => ({ id: ids[i] ?? `${name}-${i}`, name, summary: null, buckets: null })),
|
|
12559
|
+
...statements,
|
|
12560
|
+
{ id: "zd-screening-matrix", name: "Transaction screening", summary, buckets: SCREENING_BUCKETS }
|
|
12561
|
+
];
|
|
12562
|
+
}
|
|
12563
|
+
function PolicyBuckets({ policyId, layout, hint }) {
|
|
12564
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: SCREENING_BUCKETS.map((bucket) => {
|
|
12565
|
+
const detail = POLICY_DETAILS[bucket.outcome];
|
|
12566
|
+
const bucketHint = `${policyId}:${bucket.outcome}`;
|
|
12567
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-cd-bucket", "data-outcome": bucket.outcome, children: [
|
|
12568
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-cd-bucket-head", children: [
|
|
12569
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-cd-bucket-title", children: bucket.title }),
|
|
12570
|
+
layout === "side" ? /* @__PURE__ */ jsxRuntime.jsx(Hint, { id: bucketHint, label: bucket.title, text: detail, hint }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-cd-bucket-detail", children: detail })
|
|
12571
|
+
] }),
|
|
12572
|
+
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "sg-cd-cats", children: bucket.categories.map((category) => {
|
|
12573
|
+
const text = bucket.outcome === "flagged" ? FLAGGED_CATEGORY_HINTS[category] : void 0;
|
|
12574
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("li", { children: [
|
|
12575
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-cd-dot", "aria-hidden": "true" }),
|
|
12576
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: category }),
|
|
12577
|
+
text ? /* @__PURE__ */ jsxRuntime.jsx(Hint, { id: `${policyId}:${category}`, label: category, text, hint }) : null
|
|
12578
|
+
] }, category);
|
|
12579
|
+
}) })
|
|
12580
|
+
] }, bucket.outcome);
|
|
12581
|
+
}) });
|
|
12582
|
+
}
|
|
12583
|
+
function PolicyRow({
|
|
12584
|
+
policy,
|
|
12585
|
+
open,
|
|
12586
|
+
onToggle,
|
|
12587
|
+
layout,
|
|
12588
|
+
hint,
|
|
12589
|
+
policyVersion
|
|
12590
|
+
}) {
|
|
12591
|
+
const bodyId = react.useId();
|
|
12592
|
+
const head = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
12593
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-cd-policy-mark", children: /* @__PURE__ */ jsxRuntime.jsx(PolicyShield, {}) }),
|
|
12594
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-cd-policy-text", children: [
|
|
12595
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-cd-policy-name", children: policy.name }),
|
|
12596
|
+
policy.summary ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-cd-policy-sub", children: policy.summary }) : null
|
|
12597
|
+
] }),
|
|
12598
|
+
policy.buckets ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-cd-policy-chev", children: /* @__PURE__ */ jsxRuntime.jsx(ChevronDown2, { up: open }) }) : null
|
|
12599
|
+
] });
|
|
12600
|
+
if (!policy.buckets) return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-cd-policy", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-cd-policy-head", "data-static": "", children: head }) });
|
|
12601
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-cd-policy", "data-open": open, children: [
|
|
12602
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "sg-cd-policy-head", "aria-expanded": open, "aria-controls": bodyId, onClick: onToggle, children: head }),
|
|
12603
|
+
open ? /* @__PURE__ */ jsxRuntime.jsxs("div", { id: bodyId, className: "sg-cd-policy-body", children: [
|
|
12604
|
+
/* @__PURE__ */ jsxRuntime.jsx(PolicyBuckets, { policyId: policy.id, layout, hint }),
|
|
12605
|
+
policyVersion ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "sg-cd-policy-version sg-mono", children: [
|
|
12606
|
+
"Policy version ",
|
|
12607
|
+
policyVersion
|
|
12608
|
+
] }) : null
|
|
12609
|
+
] }) : null
|
|
12610
|
+
] });
|
|
12611
|
+
}
|
|
12612
|
+
function AppliedPolicies({ policies, layout, hint, policyVersion }) {
|
|
12613
|
+
const [openId, setOpenId] = react.useState(() => policies.find((p) => p.buckets)?.id ?? null);
|
|
12614
|
+
if (policies.length === 0) {
|
|
12615
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-cd-panel", children: /* @__PURE__ */ jsxRuntime.jsx("section", { className: "sg-cd-card", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-cd-summary", children: [
|
|
12616
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-cd-summary-head", "data-tone": "neutral", children: [
|
|
12617
|
+
/* @__PURE__ */ jsxRuntime.jsx(PendingCircle, {}),
|
|
12618
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-cd-summary-title", children: "No policy decision was returned" })
|
|
12619
|
+
] }),
|
|
12620
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "sg-cd-summary-sub", children: "There is no applied policy to show for this quote. It is not a failed check." })
|
|
12621
|
+
] }) }) });
|
|
12622
|
+
}
|
|
12623
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-cd-panel sg-cd-policies", children: policies.map((policy) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
12624
|
+
PolicyRow,
|
|
12625
|
+
{
|
|
12626
|
+
policy,
|
|
12627
|
+
open: openId === policy.id,
|
|
12628
|
+
onToggle: () => setOpenId(openId === policy.id ? null : policy.id),
|
|
12629
|
+
layout,
|
|
12630
|
+
hint,
|
|
12631
|
+
policyVersion: openId === policy.id ? policyVersion : void 0
|
|
12632
|
+
},
|
|
12633
|
+
policy.id
|
|
12634
|
+
)) });
|
|
12635
|
+
}
|
|
12636
|
+
function ComplianceDetails(props) {
|
|
12637
|
+
const [tab, setTab] = react.useState("checks");
|
|
12638
|
+
const [hintOpen, setHintOpen] = react.useState(null);
|
|
12639
|
+
const rootRef = react.useRef(null);
|
|
12640
|
+
const ids = react.useId();
|
|
12641
|
+
const compliance = props.compliance ?? null;
|
|
12642
|
+
const cv = complianceView(compliance, props.hasQuote ?? true);
|
|
12643
|
+
const allChecks = complianceChecks(compliance, cv);
|
|
12644
|
+
const checks = props.direct ? allChecks.filter((c) => DIRECT_CHECK_IDS.includes(c.id)) : allChecks;
|
|
12645
|
+
const policies = appliedPolicies(compliance);
|
|
12646
|
+
const policyVersion = compliance?.policyVersion?.trim() || void 0;
|
|
12647
|
+
const onBackRef = react.useRef(props.onBack);
|
|
12648
|
+
onBackRef.current = props.onBack;
|
|
12649
|
+
const hintRef = react.useRef(hintOpen);
|
|
12650
|
+
hintRef.current = hintOpen;
|
|
12651
|
+
react.useEffect(() => {
|
|
12652
|
+
rootRef.current?.focus({ preventScroll: true });
|
|
12653
|
+
const onKey = (e) => {
|
|
12654
|
+
if (e.key !== "Escape") return;
|
|
12655
|
+
e.stopPropagation();
|
|
12656
|
+
if (hintRef.current) setHintOpen(null);
|
|
12657
|
+
else onBackRef.current();
|
|
12658
|
+
};
|
|
12659
|
+
const onPointer = (e) => {
|
|
12660
|
+
if (hintRef.current && !e.target?.closest?.("[data-sg-hint]")) setHintOpen(null);
|
|
12661
|
+
};
|
|
12662
|
+
document.addEventListener("keydown", onKey, true);
|
|
12663
|
+
document.addEventListener("pointerdown", onPointer, true);
|
|
12664
|
+
return () => {
|
|
12665
|
+
document.removeEventListener("keydown", onKey, true);
|
|
12666
|
+
document.removeEventListener("pointerdown", onPointer, true);
|
|
12667
|
+
};
|
|
12668
|
+
}, []);
|
|
12669
|
+
const tabKeys = (e) => {
|
|
12670
|
+
const order = ["checks", "policy"];
|
|
12671
|
+
let next = null;
|
|
12672
|
+
if (e.key === "Home") next = order[0];
|
|
12673
|
+
else if (e.key === "End") next = order[order.length - 1];
|
|
12674
|
+
else if (e.key === "ArrowRight") next = order[(order.indexOf(tab) + 1) % order.length];
|
|
12675
|
+
else if (e.key === "ArrowLeft") next = order[(order.indexOf(tab) - 1 + order.length) % order.length];
|
|
12676
|
+
if (next === null) return;
|
|
12677
|
+
e.preventDefault();
|
|
12678
|
+
setTab(next);
|
|
12679
|
+
document.getElementById(`${ids}-tab-${next}`)?.focus();
|
|
12680
|
+
};
|
|
12681
|
+
const hint = { open: hintOpen, setOpen: setHintOpen };
|
|
12682
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "sg-cd", "data-layout": props.layout, "aria-label": "Compliance details", ref: rootRef, tabIndex: -1, children: [
|
|
12683
|
+
/* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "sg-cd-back", onClick: props.onBack, children: [
|
|
12684
|
+
/* @__PURE__ */ jsxRuntime.jsx(BackArrow, {}),
|
|
12685
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Back to Exchange" })
|
|
12686
|
+
] }),
|
|
12687
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "sg-cd-title", children: "Compliance details" }),
|
|
12688
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-cd-tabs", role: "tablist", "aria-label": "Compliance details sections", children: [
|
|
12689
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12690
|
+
"button",
|
|
12691
|
+
{
|
|
12692
|
+
type: "button",
|
|
12693
|
+
role: "tab",
|
|
12694
|
+
id: `${ids}-tab-checks`,
|
|
12695
|
+
"aria-selected": tab === "checks",
|
|
12696
|
+
"aria-controls": `${ids}-panel`,
|
|
12697
|
+
tabIndex: tab === "checks" ? 0 : -1,
|
|
12698
|
+
"data-active": tab === "checks",
|
|
12699
|
+
className: "sg-cd-tab",
|
|
12700
|
+
onClick: () => setTab("checks"),
|
|
12701
|
+
onKeyDown: tabKeys,
|
|
12702
|
+
children: "Quote checks"
|
|
12703
|
+
}
|
|
12704
|
+
),
|
|
12705
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
12706
|
+
"button",
|
|
12707
|
+
{
|
|
12708
|
+
type: "button",
|
|
12709
|
+
role: "tab",
|
|
12710
|
+
id: `${ids}-tab-policy`,
|
|
12711
|
+
"aria-selected": tab === "policy",
|
|
12712
|
+
"aria-controls": `${ids}-panel`,
|
|
12713
|
+
tabIndex: tab === "policy" ? 0 : -1,
|
|
12714
|
+
"data-active": tab === "policy",
|
|
12715
|
+
className: "sg-cd-tab",
|
|
12716
|
+
onClick: () => setTab("policy"),
|
|
12717
|
+
onKeyDown: tabKeys,
|
|
12718
|
+
children: [
|
|
12719
|
+
"Applied policies",
|
|
12720
|
+
policies.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-cd-tab-count", children: policies.length }) : null
|
|
12721
|
+
]
|
|
12722
|
+
}
|
|
12723
|
+
)
|
|
12724
|
+
] }),
|
|
12725
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { id: `${ids}-panel`, role: "tabpanel", "aria-labelledby": `${ids}-tab-${tab}`, children: tab === "checks" ? /* @__PURE__ */ jsxRuntime.jsx(QuoteChecks2, { compliance, cv, checks, direct: !!props.direct }) : /* @__PURE__ */ jsxRuntime.jsx(AppliedPolicies, { policies, layout: props.layout, hint, policyVersion }) })
|
|
12726
|
+
] });
|
|
12727
|
+
}
|
|
12728
|
+
function RefreshGlyph({ spinning }) {
|
|
12729
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { className: spinning ? "sg-cq-spin" : void 0, width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4.22639 4.22667C4.71306 3.74 5.28639 3.35333 5.91972 3.08667C6.57972 2.80667 7.27306 2.66667 7.99306 2.66667V1.33333C7.09306 1.33333 6.21972 1.50667 5.39972 1.86C4.60639 2.19333 3.89306 2.68 3.27972 3.28667C2.66639 3.9 2.18639 4.61333 1.85306 5.40667C1.50639 6.22667 1.32639 7.1 1.32639 8C1.32639 8.9 1.49972 9.77333 1.85306 10.5933C2.18639 11.3867 2.66639 12.1 3.27972 12.7133C3.39306 12.8267 3.51306 12.9267 3.62639 13.0333L1.99306 14.6667H5.99306V10.6667L4.57306 12.0867C4.45306 11.9867 4.33306 11.88 4.22639 11.7667C3.7398 11.2804 3.3506 10.7057 3.07972 10.0733C2.79972 9.41333 2.65972 8.72 2.65972 8C2.65972 7.28 2.79972 6.58 3.07972 5.92667C3.34639 5.29333 3.73306 4.72 4.22639 4.23333V4.22667ZM12.7131 3.28667C12.5997 3.17333 12.4797 3.07333 12.3664 2.96667L13.9997 1.33333H9.99972V5.33333L11.4197 3.91333C11.5397 4.01333 11.6597 4.12 11.7664 4.23333C12.2597 4.72667 12.6397 5.29333 12.9131 5.92667C13.1931 6.58667 13.3331 7.28 13.3331 8C13.3331 8.72 13.1931 9.42 12.9131 10.0733C12.6464 10.7067 12.2597 11.28 11.7664 11.7667C11.2797 12.2533 10.7064 12.64 10.0731 12.9067C9.41306 13.1867 8.71972 13.3267 7.99972 13.3267V14.66C8.89972 14.66 9.77306 14.4867 10.5931 14.1333C11.3864 13.8 12.0997 13.3133 12.7131 12.7067C13.3264 12.0933 13.8064 11.38 14.1397 10.5867C14.4864 9.76667 14.6664 8.89333 14.6664 7.99333C14.6664 7.09333 14.4931 6.22 14.1397 5.4C13.8068 4.60714 13.3222 3.88698 12.7131 3.28V3.28667Z" }) });
|
|
12730
|
+
}
|
|
12731
|
+
function SliderGrip() {
|
|
12732
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "28", height: "12", viewBox: "0 0 28 12", fill: "none", "aria-hidden": "true", children: [
|
|
12733
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "0.5", y: "0.5", width: "27", height: "11", rx: "5.5", fill: "rgba(255,255,255,0.3)" }),
|
|
12734
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M11 3l3 3-3 3M15 3l3 3-3 3", stroke: "#fff", strokeWidth: "1.1", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
12735
|
+
] });
|
|
12736
|
+
}
|
|
12737
|
+
function WalletAddGlyph() {
|
|
12738
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: [
|
|
12739
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9.95 1.84167L7.94167 6.51667H5.93333C5.6 6.51667 5.275 6.54167 4.95833 6.60833L5.79167 4.60833L5.825 4.53333L5.875 4.4C5.9 4.34167 5.91667 4.29167 5.94167 4.25C6.90833 2.00833 7.99167 1.30833 9.95 1.84167Z" }),
|
|
12740
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15.6083 6.74167L15.5917 6.73333C15.0917 6.59167 14.5833 6.51667 14.0667 6.51667H8.85L10.725 2.15833L10.75 2.1C10.8667 2.14167 10.9917 2.2 11.1167 2.24167L12.9583 3.01667C13.9833 3.44167 14.7 3.88333 15.1417 4.41667C15.2167 4.51667 15.2833 4.60833 15.35 4.71667C15.425 4.83333 15.4833 4.95 15.5167 5.075C15.55 5.15 15.575 5.21667 15.5917 5.29167C15.7167 5.71667 15.725 6.2 15.6083 6.74167Z" }),
|
|
12741
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15.2417 7.93333C14.8667 7.825 14.475 7.76667 14.0667 7.76667H5.93333C5.36667 7.76667 4.83333 7.875 4.33333 8.09167C2.88333 8.71667 1.86667 10.1583 1.86667 11.8333V13.4583C1.86667 13.6583 1.88333 13.85 1.90833 14.05C2.09167 16.7 3.50833 18.1167 6.15833 18.2917C6.35 18.3167 6.54167 18.3333 6.75 18.3333H13.25C16.3333 18.3333 17.9583 16.8667 18.1167 13.95C18.125 13.7917 18.1333 13.625 18.1333 13.4583V11.8333C18.1333 9.99167 16.9083 8.44167 15.2417 7.93333ZM12.0833 13.4917H10.625V15C10.625 15.3417 10.3417 15.625 10 15.625C9.65833 15.625 9.375 15.3417 9.375 15V13.4917H7.91667C7.575 13.4917 7.29167 13.2167 7.29167 12.8667C7.29167 12.525 7.575 12.2417 7.91667 12.2417H9.375V10.8333C9.375 10.4917 9.65833 10.2083 10 10.2083C10.3417 10.2083 10.625 10.4917 10.625 10.8333V12.2417H12.0833C12.425 12.2417 12.7083 12.525 12.7083 12.8667C12.7083 13.2167 12.425 13.4917 12.0833 13.4917Z" })
|
|
12742
|
+
] });
|
|
12743
|
+
}
|
|
12744
|
+
function ChevronGlyph2({ up }) {
|
|
12745
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", style: up ? { transform: "scaleY(-1)" } : void 0, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M2.5 4.5 6 8l3.5-3.5", stroke: "currentColor", strokeWidth: "1.2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
12746
|
+
}
|
|
12747
|
+
function ArrowGlyph2() {
|
|
12748
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "sg-cq-arrow", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3.5 8h9M9 4.5 12.5 8 9 11.5", stroke: "currentColor", strokeWidth: "1.2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
12749
|
+
}
|
|
12750
|
+
function InfoGlyph() {
|
|
12751
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: [
|
|
12752
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "7", cy: "7", r: "5.6", stroke: "currentColor", strokeWidth: "1" }),
|
|
12753
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M7 6.2v3.4", stroke: "currentColor", strokeWidth: "1.1", strokeLinecap: "round" }),
|
|
12754
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "7", cy: "4.5", r: ".7", fill: "currentColor" })
|
|
12755
|
+
] });
|
|
12756
|
+
}
|
|
12757
|
+
function unavailableCopy(status) {
|
|
12758
|
+
return status === "unsigned-cross-chain-off" ? "Cross-chain orders are not enabled yet" : status === "router-unresolved" || status === "escrow-unresolved" ? "Not available on this network yet" : "Not available right now";
|
|
12759
|
+
}
|
|
12760
|
+
function compareFeeLabel(usd2) {
|
|
12761
|
+
if (usd2 === null) return "--";
|
|
12762
|
+
if (!Number.isFinite(usd2) || usd2 <= 0) return "$0.00";
|
|
12763
|
+
if (usd2 >= 0.01) return `$${usd2.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
|
|
12764
|
+
if (usd2 < 1e-6) return "<$0.000001";
|
|
12765
|
+
return `$${usd2.toLocaleString("en-US", { maximumSignificantDigits: 2 })}`;
|
|
12766
|
+
}
|
|
12767
|
+
function logoOf(tokens, hop) {
|
|
12768
|
+
const wanted = hop.address.toLowerCase();
|
|
12769
|
+
return tokens.find((t) => Number(t.chainId) === hop.chainId && String(t.address).toLowerCase() === wanted)?.logoUrl;
|
|
12770
|
+
}
|
|
12771
|
+
var WIDE_SCALE_TRAVEL_PX = 189 * 228 / 130;
|
|
12772
|
+
function thumbWidth(fraction) {
|
|
12773
|
+
return `max(32px, calc((100% - 4px) * ${fraction}))`;
|
|
12774
|
+
}
|
|
12775
|
+
function CompareQuotes(props) {
|
|
12776
|
+
const side = props.layout === "side";
|
|
12777
|
+
const sliderId = react.useId();
|
|
12778
|
+
const options = props.compare?.options ?? [];
|
|
12779
|
+
const selectedId = props.compare?.selectedId ?? null;
|
|
12780
|
+
const selected = options.find((o) => o.id === selectedId && !o.unavailable)?.id ?? options.find((o) => !o.unavailable)?.id ?? null;
|
|
12781
|
+
const picked = options.find((o) => o.id === selectedId && !o.unavailable);
|
|
12782
|
+
const [movedWait, setMovedWait] = react.useState(null);
|
|
12783
|
+
const wait2 = movedWait ?? (picked ? clampWait(picked.estimatedDuration) : proposedWait(options));
|
|
12784
|
+
const [openRoutes, setOpenRoutes] = react.useState(() => /* @__PURE__ */ new Set());
|
|
12785
|
+
const parityState = props.compare?.parity ?? { kind: "unknown" };
|
|
12786
|
+
const extra = props.compare ? extraVsFastest(options, selected) : null;
|
|
12787
|
+
const selectedOption = options.find((o) => o.id === selected);
|
|
12788
|
+
const anySelectable = options.some((o) => !o.unavailable);
|
|
12789
|
+
const moveWait = (sec) => {
|
|
12790
|
+
setMovedWait(sec);
|
|
12791
|
+
const pick = pickForWait(options, sec);
|
|
12792
|
+
if (pick && pick.id !== selected) props.onSelect(pick.id);
|
|
12793
|
+
};
|
|
12794
|
+
const pickCard = (option) => {
|
|
12795
|
+
if (props.onSelect(option.id)) setMovedWait(clampWait(option.estimatedDuration));
|
|
12796
|
+
};
|
|
12797
|
+
const toggleRoute = (id) => setOpenRoutes((prev) => {
|
|
12798
|
+
const next = new Set(prev);
|
|
12799
|
+
if (next.has(id)) next.delete(id);
|
|
12800
|
+
else next.add(id);
|
|
12801
|
+
return next;
|
|
12802
|
+
});
|
|
12803
|
+
const trackRef = react.useRef(null);
|
|
12804
|
+
const listRef = react.useRef(null);
|
|
12805
|
+
const [travel, setTravel] = react.useState(400);
|
|
12806
|
+
react.useLayoutEffect(() => {
|
|
12807
|
+
const el = trackRef.current;
|
|
12808
|
+
if (!el) return;
|
|
12809
|
+
const measure = () => setTravel(el.offsetWidth - 4);
|
|
12810
|
+
measure();
|
|
12811
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
12812
|
+
const ro = new ResizeObserver(measure);
|
|
12813
|
+
ro.observe(el);
|
|
12814
|
+
return () => ro.disconnect();
|
|
12815
|
+
}, [anySelectable]);
|
|
12816
|
+
const scale = react.useMemo(() => waitScaleFor(side ? WIDE_SCALE_TRAVEL_PX : travel), [side, travel]);
|
|
12817
|
+
const pct = waitFraction(wait2, scale) * 100;
|
|
12818
|
+
const shown = react.useMemo(() => visibleOptions(options, wait2, selected), [options, wait2, selected]);
|
|
12819
|
+
const rovingId = shown.find((o) => o.id === selected && !o.unavailable)?.id ?? shown.find((o) => !o.unavailable)?.id ?? null;
|
|
12820
|
+
const refresh = props.onRefresh ? /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "sg-cq-refresh", onClick: props.onRefresh, "aria-label": "Refresh quotes", "aria-busy": props.refreshing || void 0, children: /* @__PURE__ */ jsxRuntime.jsx(RefreshGlyph, { spinning: !!props.refreshing }) }) : void 0;
|
|
12821
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SheetFrame, { label: "Compare quotes", title: "Compare quotes", titleAddon: refresh, hideClose: true, wide: side, asRegion: !props.modal, trapFocus: props.modal, onClose: props.onBack, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-cq", "data-layout": props.layout, children: [
|
|
12822
|
+
anySelectable ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-cq-wait", "data-testid": "compare-wait", children: [
|
|
12823
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-cq-wait-top", children: [
|
|
12824
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-cq-wait-row", children: [
|
|
12825
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: sliderId, children: "I'm willing to wait" }),
|
|
12826
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-testid": "compare-wait-label", children: waitLabel(wait2) })
|
|
12827
|
+
] }),
|
|
12828
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-cq-wait-scale", children: [
|
|
12829
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { ref: trackRef, className: "sg-cq-track", children: [
|
|
12830
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12831
|
+
"input",
|
|
12832
|
+
{
|
|
12833
|
+
id: sliderId,
|
|
12834
|
+
className: "sg-cq-range",
|
|
12835
|
+
type: "range",
|
|
12836
|
+
min: 0,
|
|
12837
|
+
max: WAIT_POSITIONS,
|
|
12838
|
+
step: 1,
|
|
12839
|
+
value: Math.round(pct * WAIT_POSITIONS / 100),
|
|
12840
|
+
"aria-valuetext": waitLabel(wait2),
|
|
12841
|
+
onChange: (e) => moveWait(snapWait(waitFromFraction(Number(e.target.value) / WAIT_POSITIONS, scale))),
|
|
12842
|
+
onKeyDown: (e) => {
|
|
12843
|
+
const dir = e.key === "ArrowRight" || e.key === "ArrowUp" ? 1 : e.key === "ArrowLeft" || e.key === "ArrowDown" ? -1 : 0;
|
|
12844
|
+
if (dir === 0) return;
|
|
12845
|
+
e.preventDefault();
|
|
12846
|
+
moveWait(snapWait(wait2 + dir * WAIT_STEP_SEC));
|
|
12847
|
+
}
|
|
12848
|
+
}
|
|
12849
|
+
),
|
|
12850
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-cq-rail", "aria-hidden": "true" }),
|
|
12851
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-cq-thumb", "aria-hidden": "true", style: { width: thumbWidth(pct / 100) }, children: /* @__PURE__ */ jsxRuntime.jsx(SliderGrip, {}) })
|
|
12852
|
+
] }),
|
|
12853
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-cq-ends", children: [
|
|
12854
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "3 min" }),
|
|
12855
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "2 h" }),
|
|
12856
|
+
parityState.kind === "at" ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12857
|
+
"span",
|
|
12858
|
+
{
|
|
12859
|
+
className: "sg-cq-parity",
|
|
12860
|
+
"data-testid": "compare-parity",
|
|
12861
|
+
style: { left: `clamp(${side ? 60 : 44}px, calc(${thumbWidth(waitFraction(parityState.timeSec, scale))} - 13px), calc(100% - ${side ? 60 : 44}px))` },
|
|
12862
|
+
children: [
|
|
12863
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "1:1" }),
|
|
12864
|
+
" ",
|
|
12865
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: compareDuration(parityState.timeSec) })
|
|
12866
|
+
]
|
|
12867
|
+
}
|
|
12868
|
+
) : null,
|
|
12869
|
+
parityState.kind === "unavailable" ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-cq-parity-none", "data-testid": "compare-parity", children: "1:1 currently unavailable" }) : null
|
|
12870
|
+
] })
|
|
12871
|
+
] })
|
|
12872
|
+
] }),
|
|
12873
|
+
extra !== null ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
12874
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-cq-rule", "aria-hidden": "true" }),
|
|
12875
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-cq-extra", "data-testid": "compare-extra", children: [
|
|
12876
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-cq-extra-icon", children: /* @__PURE__ */ jsxRuntime.jsx(WalletAddGlyph, {}) }),
|
|
12877
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-cq-extra-text", children: [
|
|
12878
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-cq-extra-label", children: [
|
|
12879
|
+
"Potential extra received",
|
|
12880
|
+
side ? /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "sg-cq-info", "aria-label": `Compared with fastest${selectedOption?.entersNetting ? ". Depends on a matching order" : ""}`, title: `Compared with fastest${selectedOption?.entersNetting ? "\nDepends on a matching order" : ""}`, children: /* @__PURE__ */ jsxRuntime.jsx(InfoGlyph, {}) }) : null
|
|
12881
|
+
] }),
|
|
12882
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-cq-extra-amt", children: [
|
|
12883
|
+
"+",
|
|
12884
|
+
compareAmount(extra),
|
|
12885
|
+
" ",
|
|
12886
|
+
props.toSymbol
|
|
12887
|
+
] })
|
|
12888
|
+
] }),
|
|
12889
|
+
side ? null : /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-cq-extra-note", children: [
|
|
12890
|
+
"Compared with fastest",
|
|
12891
|
+
selectedOption?.entersNetting ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
12892
|
+
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
12893
|
+
"Depends on a matching order"
|
|
12894
|
+
] }) : null
|
|
12895
|
+
] })
|
|
12896
|
+
] })
|
|
12897
|
+
] }) : null
|
|
12898
|
+
] }) : null,
|
|
12899
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
12900
|
+
"div",
|
|
12901
|
+
{
|
|
12902
|
+
role: "radiogroup",
|
|
12903
|
+
"aria-label": "Quotes",
|
|
12904
|
+
className: "sg-cq-list",
|
|
12905
|
+
ref: listRef,
|
|
12906
|
+
onKeyDown: (e) => {
|
|
12907
|
+
const dir = e.key === "ArrowDown" || e.key === "ArrowRight" ? 1 : e.key === "ArrowUp" || e.key === "ArrowLeft" ? -1 : 0;
|
|
12908
|
+
if (dir === 0) return;
|
|
12909
|
+
const pickable = shown.filter((o) => !o.unavailable);
|
|
12910
|
+
if (pickable.length === 0) return;
|
|
12911
|
+
e.preventDefault();
|
|
12912
|
+
const cur = Math.max(0, pickable.findIndex((o) => o.id === rovingId));
|
|
12913
|
+
const next = pickable[(cur + dir + pickable.length) % pickable.length];
|
|
12914
|
+
pickCard(next);
|
|
12915
|
+
requestAnimationFrame(() => listRef.current?.querySelector(`[data-oid="${CSS.escape(next.id)}"]`)?.focus());
|
|
12916
|
+
},
|
|
12917
|
+
children: [
|
|
12918
|
+
shown.map((option) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
12919
|
+
QuoteCard,
|
|
12920
|
+
{
|
|
12921
|
+
option,
|
|
12922
|
+
isSelected: option.id === selected,
|
|
12923
|
+
tabIndex: option.id === rovingId ? 0 : -1,
|
|
12924
|
+
tags: cornerTags(options, option, parityState),
|
|
12925
|
+
toSymbol: props.toSymbol,
|
|
12926
|
+
side,
|
|
12927
|
+
routeOpen: openRoutes.has(option.id),
|
|
12928
|
+
tokens: props.tokens,
|
|
12929
|
+
chainName: props.chainName,
|
|
12930
|
+
onPick: () => pickCard(option),
|
|
12931
|
+
onToggleRoute: () => toggleRoute(option.id)
|
|
12932
|
+
},
|
|
12933
|
+
option.id
|
|
12934
|
+
)),
|
|
12935
|
+
options.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { role: "status", className: "sg-cq-empty", children: props.emptyMessage ?? "No quote yet \u2014 enter an amount to get one." }) : null
|
|
12936
|
+
]
|
|
12937
|
+
}
|
|
12938
|
+
)
|
|
12939
|
+
] }) });
|
|
12940
|
+
}
|
|
12941
|
+
function Column({ label: label2, value }) {
|
|
12942
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-cq-col", children: [
|
|
12943
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-cq-col-label", children: label2 }),
|
|
12944
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-cq-col-value", children: value })
|
|
12945
|
+
] });
|
|
12946
|
+
}
|
|
12947
|
+
function HopMark({ hop, tokens, size }) {
|
|
12948
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TokenGlyph, { symbol: hop.ticker, logoUrl: logoOf(tokens, hop), chainId: hop.chainId, size });
|
|
12949
|
+
}
|
|
12950
|
+
function QuoteCard(props) {
|
|
12951
|
+
const { option, tags, side } = props;
|
|
12952
|
+
const routeId = react.useId();
|
|
12953
|
+
const headRef = react.useRef(null);
|
|
12954
|
+
const tagRef = react.useRef(null);
|
|
12955
|
+
const [tagInset, setTagInset] = react.useState(null);
|
|
12956
|
+
react.useLayoutEffect(() => {
|
|
12957
|
+
const head = headRef.current;
|
|
12958
|
+
const tag = tagRef.current;
|
|
12959
|
+
if (side || !head || !tag) return setTagInset(null);
|
|
12960
|
+
const measure = () => setTagInset(Math.max(0, Math.ceil(head.getBoundingClientRect().right - tag.getBoundingClientRect().left) + 8));
|
|
12961
|
+
measure();
|
|
12962
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
12963
|
+
const observer = new ResizeObserver(measure);
|
|
12964
|
+
observer.observe(tag);
|
|
12965
|
+
observer.observe(head);
|
|
12966
|
+
return () => observer.disconnect();
|
|
12967
|
+
}, [tags.length, side]);
|
|
12968
|
+
const netting = !!option.entersNetting;
|
|
12969
|
+
const gasless = !!option.gasSponsored;
|
|
12970
|
+
const note = netting ? "Matches your swap with an opposite order" : gasless ? "No native token needed for gas" : null;
|
|
12971
|
+
const nettingTag = tags.some((t) => t.tone === "green");
|
|
12972
|
+
const purple = tags[0]?.tone === "purple" && !nettingTag;
|
|
12973
|
+
const hops = option.hops;
|
|
12974
|
+
const collapsed = side && hops.length > 3;
|
|
12975
|
+
const inline = collapsed ? [hops[0], hops[1], "gap", hops[hops.length - 1]] : hops;
|
|
12976
|
+
const hidden3 = collapsed ? hops.slice(2, -1) : [];
|
|
12977
|
+
const routeIcons = /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-cq-route-icons", "data-testid": "compare-route-inline", children: inline.map((hop, i) => /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-cq-hop-inline", children: [
|
|
12978
|
+
i > 0 ? /* @__PURE__ */ jsxRuntime.jsx(ArrowGlyph2, {}) : null,
|
|
12979
|
+
hop === "gap" ? /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "sg-cq-gap", title: hidden3.map((h2) => `${h2.ticker} on ${props.chainName(h2.chainId)}`).join(" \u2192 "), "aria-label": `Also via ${hidden3.map((h2) => `${h2.ticker} on ${props.chainName(h2.chainId)}`).join(", ")}`, children: "\u2026" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { title: `${hop.ticker} on ${props.chainName(hop.chainId)}`, children: /* @__PURE__ */ jsxRuntime.jsx(HopMark, { hop, tokens: props.tokens, size: "xxs" }) })
|
|
12980
|
+
] }, hop === "gap" ? "gap" : `${hop.chainId}-${hop.address}-${i}`)) });
|
|
12981
|
+
const fee = compareFeeLabel(option.feeUsd);
|
|
12982
|
+
const tagEl = tags.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { ref: tagRef, className: "sg-cq-tag", "data-kind": nettingTag ? "netting" : purple ? "purple" : "brand", children: tags.map((tag, i) => /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-cq-tag-item", children: [
|
|
12983
|
+
i > 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-cq-tag-dot", "aria-hidden": "true" }) : null,
|
|
12984
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-tone": tag.tone, children: tag.text })
|
|
12985
|
+
] }, tag.text)) }) : null;
|
|
12986
|
+
const body = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
12987
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { ref: headRef, className: "sg-cq-head", style: tagInset === null ? void 0 : { paddingRight: tagInset }, children: [
|
|
12988
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-cq-radio", "data-on": props.isSelected || void 0, "aria-hidden": "true" }),
|
|
12989
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-cq-amount", children: [
|
|
12990
|
+
tags.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-cq-sr", children: [
|
|
12991
|
+
tags.map((t) => t.text).join(", "),
|
|
12992
|
+
" "
|
|
12993
|
+
] }) : option.label ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-cq-sr", children: [
|
|
12994
|
+
option.label.toLowerCase().replace(/^./, (c) => c.toUpperCase()),
|
|
12995
|
+
" "
|
|
12996
|
+
] }) : null,
|
|
12997
|
+
netting ? "~" : "",
|
|
12998
|
+
compareAmount(option.amount),
|
|
12999
|
+
" ",
|
|
13000
|
+
props.toSymbol
|
|
13001
|
+
] })
|
|
13002
|
+
] }),
|
|
13003
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-cq-stats", children: [
|
|
13004
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-cq-cols", children: [
|
|
13005
|
+
/* @__PURE__ */ jsxRuntime.jsx(Column, { label: "Est. time", value: netting ? compareDuration(option.estimatedDuration).replace(/^~/, "") : compareDuration(option.estimatedDuration) }),
|
|
13006
|
+
gasless ? /* @__PURE__ */ jsxRuntime.jsx(Column, { label: "Gas fee", value: "Sponsored" }) : /* @__PURE__ */ jsxRuntime.jsx(Column, { label: netting ? "Est. fee" : "Fee", value: fee }),
|
|
13007
|
+
side && hops.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-cq-col", children: [
|
|
13008
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-cq-col-label", children: "Route" }),
|
|
13009
|
+
routeIcons
|
|
13010
|
+
] }) : null
|
|
13011
|
+
] }),
|
|
13012
|
+
!side && note ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-cq-note", children: note }) : null
|
|
13013
|
+
] }),
|
|
13014
|
+
option.unavailable ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-cq-why", children: unavailableCopy(option.unavailable) }) : null
|
|
13015
|
+
] });
|
|
13016
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-cq-card", "data-testid": "compare-quote", "data-selected": props.isSelected || void 0, "data-unavailable": option.unavailable ? true : void 0, children: [
|
|
13017
|
+
tagEl,
|
|
13018
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", role: "radio", "aria-checked": props.isSelected, disabled: !!option.unavailable, tabIndex: props.tabIndex, "data-oid": option.id, onClick: props.onPick, className: "sg-cq-main", children: body }),
|
|
13019
|
+
!side && hops.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-cq-route", children: [
|
|
13020
|
+
/* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "sg-cq-route-toggle", onClick: props.onToggleRoute, "aria-expanded": props.routeOpen, "aria-controls": routeId, children: [
|
|
13021
|
+
"Route",
|
|
13022
|
+
/* @__PURE__ */ jsxRuntime.jsx(ChevronGlyph2, { up: props.routeOpen })
|
|
13023
|
+
] }),
|
|
13024
|
+
props.routeOpen ? /* @__PURE__ */ jsxRuntime.jsx("div", { id: routeId, className: "sg-cq-hops", "data-testid": "compare-route", children: hops.map((hop, i) => (
|
|
13025
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: a route is a fixed sequence, and a token can appear twice on it.
|
|
13026
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-cq-hop", children: [
|
|
13027
|
+
i > 0 ? /* @__PURE__ */ jsxRuntime.jsx(ArrowGlyph2, {}) : null,
|
|
13028
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-cq-hop-body", children: [
|
|
13029
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-cq-hop-name", children: [
|
|
13030
|
+
/* @__PURE__ */ jsxRuntime.jsx(HopMark, { hop, tokens: props.tokens, size: "xxs" }),
|
|
13031
|
+
hop.ticker
|
|
13032
|
+
] }),
|
|
13033
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-cq-hop-chain", children: [
|
|
13034
|
+
"On ",
|
|
13035
|
+
props.chainName(hop.chainId)
|
|
13036
|
+
] })
|
|
13037
|
+
] })
|
|
13038
|
+
] }, `${hop.chainId}-${hop.address}-${i}`)
|
|
13039
|
+
)) }) : null
|
|
13040
|
+
] }) : null
|
|
13041
|
+
] });
|
|
13042
|
+
}
|
|
12014
13043
|
function QuoteSheet(props) {
|
|
12015
13044
|
const sheetRef = react.useRef(null);
|
|
12016
13045
|
const onCloseRef = react.useRef(props.onClose);
|
|
@@ -12301,6 +13330,14 @@ function ExchangeCard(props) {
|
|
|
12301
13330
|
() => destinationStates ? toPickerTokens.filter((t) => !destinationStates[`${Number(t.chainId)}:${String(t.address || "").toLowerCase()}`]?.disabled) : toPickerTokens,
|
|
12302
13331
|
[toPickerTokens, destinationStates]
|
|
12303
13332
|
);
|
|
13333
|
+
const seenReadyCatalogue = react.useRef(null);
|
|
13334
|
+
react.useEffect(() => {
|
|
13335
|
+
if (!catalogue?.ready) return;
|
|
13336
|
+
const first = seenReadyCatalogue.current === null;
|
|
13337
|
+
seenReadyCatalogue.current = catalogue;
|
|
13338
|
+
if (first || !to) return;
|
|
13339
|
+
if (destinationStates?.[`${Number(to.chainId)}:${String(findToken(tokens, to.chainId, to.symbol)?.address || "").toLowerCase()}`]?.disabled || !findToken(tokens, to.chainId, to.symbol)) setTo(null);
|
|
13340
|
+
}, [catalogue]);
|
|
12304
13341
|
const normalizedAmount = normalizeDecimalText(amount);
|
|
12305
13342
|
const amountValid = /^\d+(\.\d+)?$/.test(normalizedAmount) && Number(normalizedAmount) > 0 && Number(normalizedAmount) <= 1e9;
|
|
12306
13343
|
const rampMode = mode !== "exchange";
|
|
@@ -12478,6 +13515,7 @@ function ExchangeCard(props) {
|
|
|
12478
13515
|
const recipientLocked = wide && recipientState.open && recipientPending;
|
|
12479
13516
|
const ctaLabel = rampMode ? soonLabel : submitting ? "Exchanging\u2026" : connected2 && flow.quoteStale ? flow.quotePaused ? "Refresh quote" : "Refreshing quote\u2026" : flow.insufficient ? "Insufficient balance" : flow.nativeShortfall || "Exchange";
|
|
12480
13517
|
const selected = addressed ? flow.selected : null;
|
|
13518
|
+
const compare = addressed && !solActive ? flow.compare : null;
|
|
12481
13519
|
const hasQuote = Boolean(quotable && !quoting && !quoteError && receive);
|
|
12482
13520
|
const nativeWei = (() => {
|
|
12483
13521
|
try {
|
|
@@ -12534,10 +13572,14 @@ function ExchangeCard(props) {
|
|
|
12534
13572
|
setView("main");
|
|
12535
13573
|
requestAnimationFrame(() => (isFrom ? fromTileRef : toTileRef).current?.focus());
|
|
12536
13574
|
};
|
|
13575
|
+
const openPicker = (v) => () => {
|
|
13576
|
+
setSheet(null);
|
|
13577
|
+
setView(v);
|
|
13578
|
+
};
|
|
12537
13579
|
const closeSheet = () => {
|
|
12538
13580
|
const was = sheet;
|
|
12539
13581
|
setSheet(null);
|
|
12540
|
-
requestAnimationFrame(() => (was === "quote" ? quoteBtnRef : complianceBtnRef).current?.focus());
|
|
13582
|
+
requestAnimationFrame(() => (was === "quote" || was === "compare" ? quoteBtnRef : complianceBtnRef).current?.focus());
|
|
12541
13583
|
};
|
|
12542
13584
|
const pctChips = mode !== "onramp" ? (
|
|
12543
13585
|
// a11y note: <fieldset> carries UA styling that would have to be reset on every host page;
|
|
@@ -12567,7 +13609,7 @@ function ExchangeCard(props) {
|
|
|
12567
13609
|
icon: /* @__PURE__ */ jsxRuntime.jsx(QuoteGlyph, {}),
|
|
12568
13610
|
label: "Quote",
|
|
12569
13611
|
badge: lg && hasQuote ? { text: "Best return", tone: "info" } : null,
|
|
12570
|
-
onClick: () => setSheet("quote"),
|
|
13612
|
+
onClick: () => setSheet(compare ? "compare" : "quote"),
|
|
12571
13613
|
disabled: !hasQuote
|
|
12572
13614
|
}
|
|
12573
13615
|
);
|
|
@@ -12584,7 +13626,27 @@ function ExchangeCard(props) {
|
|
|
12584
13626
|
connect: !wallet.account ? { family: "evm", onClick: () => void wallet.connect(), busy: wallet.connecting } : !solanaWallet.address ? { family: "solana", onClick: (name) => void solanaWallet.connect(name), busy: solanaWallet.status === "connecting", choices: solanaWallet.wallets.map((w) => w.name) } : void 0,
|
|
12585
13627
|
error: solanaWallet.error || wallet.error
|
|
12586
13628
|
}
|
|
12587
|
-
) : recipientState.open ? /* @__PURE__ */ jsxRuntime.jsx(RecipientSheet, { state: recipientState, wide, onPending: wide ? setRecipientPending : void 0 }) : sheet === "compliance" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
13629
|
+
) : recipientState.open ? /* @__PURE__ */ jsxRuntime.jsx(RecipientSheet, { state: recipientState, wide, onPending: wide ? setRecipientPending : void 0 }) : sheet === "compliance" ? /* @__PURE__ */ jsxRuntime.jsx(ComplianceDetails, { compliance, direct: selected?.state === "DIRECT", hasQuote: complianceHasQuote, onBack: closeSheet, layout: wide ? "side" : "card" }) : sheet === "compare" ? (
|
|
13630
|
+
// Stays mounted even when `compare` is momentarily null (a refresh that is loading or failed), mirroring the
|
|
13631
|
+
// dapp's CompareQuotesDialog: it shows the empty/error notice in place of the cards instead of popping the
|
|
13632
|
+
// screen and dropping focus (zd-dapp src/components/CompareQuotesDialog.tsx uses `emptyMessage` the same way).
|
|
13633
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13634
|
+
CompareQuotes,
|
|
13635
|
+
{
|
|
13636
|
+
compare,
|
|
13637
|
+
toSymbol: toTicker,
|
|
13638
|
+
tokens,
|
|
13639
|
+
chainName: (id) => nameOf(id) ?? `Chain ${id}`,
|
|
13640
|
+
onSelect: flow.selectOption,
|
|
13641
|
+
onBack: closeSheet,
|
|
13642
|
+
onRefresh: flow.reload,
|
|
13643
|
+
refreshing: flow.status === "loading",
|
|
13644
|
+
emptyMessage: flow.status === "loading" ? "Fetching quote\u2026" : quoteError || void 0,
|
|
13645
|
+
modal: !!props.inDialog,
|
|
13646
|
+
layout: wide ? "side" : "card"
|
|
13647
|
+
}
|
|
13648
|
+
)
|
|
13649
|
+
) : sheet === "quote" && hasQuote ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
12588
13650
|
QuoteSheet,
|
|
12589
13651
|
{
|
|
12590
13652
|
onClose: closeSheet,
|
|
@@ -12663,7 +13725,7 @@ function ExchangeCard(props) {
|
|
|
12663
13725
|
}
|
|
12664
13726
|
);
|
|
12665
13727
|
} else if (sheetBody && !wide) {
|
|
12666
|
-
takeover = walletsOpen && !walletDetails || recipientState.open;
|
|
13728
|
+
takeover = walletsOpen && !walletDetails || recipientState.open || !walletsOpen && (sheet === "compare" || sheet === "compliance");
|
|
12667
13729
|
body = sheetBody;
|
|
12668
13730
|
} else if (solActive && solFlow.status === "sent") {
|
|
12669
13731
|
body = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -12729,9 +13791,9 @@ function ExchangeCard(props) {
|
|
|
12729
13791
|
body = wide ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
12730
13792
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-stack", children: [
|
|
12731
13793
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-ft", children: [
|
|
12732
|
-
mode === "onramp" ? /* @__PURE__ */ jsxRuntime.jsx(FiatTile, { label: "From", currency: fiatCurrency, onCurrency: setFiatCurrency }) : /* @__PURE__ */ jsxRuntime.jsx(TokenTile, { label: "From", pick: from, chainName: nameOf(from?.chainId), token: fromToken, disabled: submitting, btnRef: fromTileRef, onClick: (
|
|
13794
|
+
mode === "onramp" ? /* @__PURE__ */ jsxRuntime.jsx(FiatTile, { label: "From", currency: fiatCurrency, onCurrency: setFiatCurrency }) : /* @__PURE__ */ jsxRuntime.jsx(TokenTile, { label: "From", pick: from, chainName: nameOf(from?.chainId), token: fromToken, disabled: submitting, btnRef: fromTileRef, onClick: openPicker("from") }),
|
|
12733
13795
|
/* @__PURE__ */ jsxRuntime.jsx(FlipButton, { small: true, onClick: flip, disabled: !flippable }),
|
|
12734
|
-
mode === "offramp" ? /* @__PURE__ */ jsxRuntime.jsx(FiatTile, { label: "To", currency: fiatCurrency, onCurrency: setFiatCurrency }) : /* @__PURE__ */ jsxRuntime.jsx(TokenTile, { label: "To", pick: to, chainName: nameOf(to?.chainId), token: toToken2, disabled: submitting, btnRef: toTileRef, onClick: (
|
|
13796
|
+
mode === "offramp" ? /* @__PURE__ */ jsxRuntime.jsx(FiatTile, { label: "To", currency: fiatCurrency, onCurrency: setFiatCurrency }) : /* @__PURE__ */ jsxRuntime.jsx(TokenTile, { label: "To", pick: to, chainName: nameOf(to?.chainId), token: toToken2, disabled: submitting, btnRef: toTileRef, onClick: openPicker("to") })
|
|
12735
13797
|
] }),
|
|
12736
13798
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-pane", "data-kind": "send", children: [
|
|
12737
13799
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-pane-top", children: [
|