@workflow/web 4.1.6 → 4.1.8

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.
@@ -14,7 +14,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
14
14
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
15
15
  var __superGet = (cls, obj, key) => __reflectGet(__getProtoOf(cls), key, obj);
16
16
  var _a2, _root, _hasMagic, _uflag, _parts, _parent, _parentIndex, _negs, _filledNegs, _options, _toString, _emptyExt, _AST_instances, fillNegs_fn, _AST_static, parseAST_fn, canAdoptWithSpace_fn, canAdopt_fn, canAdoptType_fn, adoptWithSpace_fn, adopt_fn, canUsurpType_fn, canUsurp_fn, usurp_fn, flatten_fn, partsToRegExp_fn, parseGlob_fn, _Minimatch_instances, matchGlobstar_fn, matchGlobStarBodySections_fn, matchOne_fn, _reader;
17
- import { a as requireReact, S as ServerRouter, c as createReadableStreamFromReadable, r as reactExports, g as getDefaultExportFromCjs, R as React, b as ReactExports, w as withComponentProps, d as withErrorBoundaryProps, M as Meta, L as Links, e as ScrollRestoration, f as Scripts, O as Outlet, u as useNavigate, h as useSearchParams, i as Link$1, j as useRouteError, k as isRouteErrorResponse, l as useLocation, m as useParams } from "./app-DZ5lj7U4.js";
17
+ import { a as requireReact, S as ServerRouter, c as createReadableStreamFromReadable, r as reactExports, g as getDefaultExportFromCjs, R as React, b as ReactExports, w as withComponentProps, d as withErrorBoundaryProps, M as Meta, L as Links, e as ScrollRestoration, f as Scripts, O as Outlet, u as useNavigate, h as useSearchParams, i as Link$1, j as useRouteError, k as isRouteErrorResponse, l as useLocation, m as useParams } from "./app-Bw7CxKyr.js";
18
18
  import require$$0$4, { PassThrough } from "node:stream";
19
19
  import require$$0 from "util";
20
20
  import require$$1 from "crypto";
@@ -48708,6 +48708,11 @@ const WorkflowInvokePayloadSchema = object$1({
48708
48708
  runId: string$3(),
48709
48709
  traceCarrier: TraceCarrierSchema.optional(),
48710
48710
  requestedAt: date$2().optional(),
48711
+ /** Consecutive replay divergences in this recovery chain and latest position. */
48712
+ replayDivergence: object$1({
48713
+ eventId: string$3(),
48714
+ count: number$3().int().positive()
48715
+ }).optional(),
48711
48716
  /** Number of times this message has been re-enqueued due to server errors (5xx) */
48712
48717
  serverErrorRetryCount: number$3().int().optional(),
48713
48718
  /** Run creation data, only present on the first queue delivery from start() */
@@ -48814,7 +48819,7 @@ const WorkflowRunBaseSchema = object$1({
48814
48819
  // Optional in database for backwards compatibility, defaults to 1 (legacy) when reading
48815
48820
  specVersion: number$3().optional(),
48816
48821
  executionContext: record(string$3(), any()).optional(),
48817
- input: SerializedDataSchema,
48822
+ input: SerializedDataSchema.optional(),
48818
48823
  output: SerializedDataSchema.optional(),
48819
48824
  error: StructuredErrorSchema.optional(),
48820
48825
  expiredAt: date$2().optional(),
@@ -48897,7 +48902,7 @@ const StepSchema = object$1({
48897
48902
  */
48898
48903
  stepName: string$3(),
48899
48904
  status: StepStatusSchema,
48900
- input: SerializedDataSchema,
48905
+ input: SerializedDataSchema.optional(),
48901
48906
  output: SerializedDataSchema.optional(),
48902
48907
  /**
48903
48908
  * The error from a step_retrying or step_failed event.
@@ -49314,6 +49319,33 @@ function hasEncryptedFields(resource) {
49314
49319
  }
49315
49320
  return false;
49316
49321
  }
49322
+ const WORKFLOW_ULID_BODY = "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}";
49323
+ const STEP_ID_PATTERN = new RegExp(`^step_(${WORKFLOW_ULID_BODY})$`, "i");
49324
+ const WAIT_ID_PATTERN = new RegExp(`^wait_(${WORKFLOW_ULID_BODY})$`, "i");
49325
+ const HOOK_ID_PATTERN = new RegExp(`^hook_(${WORKFLOW_ULID_BODY})$`, "i");
49326
+ const EVENT_ID_PATTERN = new RegExp(`^evnt_(${WORKFLOW_ULID_BODY})$`, "i");
49327
+ const WORKFLOW_ID_PREFIX_PATTERN = /^(step_|wait_|hook_|evnt_|wrun_)/i;
49328
+ function matchPrefixedId(pattern2, prefix, kind, query) {
49329
+ const match2 = query.match(pattern2);
49330
+ if (!match2) {
49331
+ return null;
49332
+ }
49333
+ return { kind, id: `${prefix}_${match2[1].toUpperCase()}` };
49334
+ }
49335
+ function parseExactWorkflowSearchId(query) {
49336
+ const trimmed = query.trim();
49337
+ if (!trimmed) {
49338
+ return null;
49339
+ }
49340
+ return matchPrefixedId(STEP_ID_PATTERN, "step", "step", trimmed) ?? matchPrefixedId(WAIT_ID_PATTERN, "wait", "wait", trimmed) ?? matchPrefixedId(HOOK_ID_PATTERN, "hook", "hook", trimmed) ?? matchPrefixedId(EVENT_ID_PATTERN, "evnt", "event", trimmed);
49341
+ }
49342
+ function looksLikeWorkflowIdSearchInput(query) {
49343
+ const trimmed = query.trim();
49344
+ if (!WORKFLOW_ID_PREFIX_PATTERN.test(trimmed)) {
49345
+ return false;
49346
+ }
49347
+ return /\d/.test(trimmed);
49348
+ }
49317
49349
  const KEYFRAMES = `@keyframes wf-spinner-fade{0%{opacity:1}100%{opacity:.15}}`;
49318
49350
  function Spinner({ size: size2 = 14, color: color5 }) {
49319
49351
  const config2 = size2 <= 12 ? {
@@ -49372,6 +49404,1095 @@ const STYLES$2 = `.wf-decrypt-btn{appearance:none;-webkit-appearance:none;border
49372
49404
  function DecryptButton({ decrypted = false, loading = false, onClick }) {
49373
49405
  return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx("style", { dangerouslySetInnerHTML: { __html: STYLES$2 } }), jsxRuntimeExports.jsxs("button", { type: "button", onClick: decrypted ? void 0 : onClick, disabled: decrypted || loading, className: `wf-decrypt-btn ${decrypted ? "wf-decrypt-done" : "wf-decrypt-idle"}`, children: [loading ? jsxRuntimeExports.jsx(Spinner, { size: 14 }) : decrypted ? jsxRuntimeExports.jsxs("svg", { width: 14, height: 14, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [jsxRuntimeExports.jsx("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2", ry: "2" }), jsxRuntimeExports.jsx("path", { d: "M7 11V7a5 5 0 0 1 9.9-1" })] }) : jsxRuntimeExports.jsxs("svg", { width: 14, height: 14, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [jsxRuntimeExports.jsx("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2", ry: "2" }), jsxRuntimeExports.jsx("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })] }), loading ? "Decrypting…" : decrypted ? "Decrypted" : "Decrypt"] })] });
49374
49406
  }
49407
+ function __insertCSS(code2) {
49408
+ if (typeof document == "undefined") return;
49409
+ let head = document.head || document.getElementsByTagName("head")[0];
49410
+ let style2 = document.createElement("style");
49411
+ style2.type = "text/css";
49412
+ head.appendChild(style2);
49413
+ style2.styleSheet ? style2.styleSheet.cssText = code2 : style2.appendChild(document.createTextNode(code2));
49414
+ }
49415
+ const getAsset = (type) => {
49416
+ switch (type) {
49417
+ case "success":
49418
+ return SuccessIcon;
49419
+ case "info":
49420
+ return InfoIcon;
49421
+ case "warning":
49422
+ return WarningIcon;
49423
+ case "error":
49424
+ return ErrorIcon;
49425
+ default:
49426
+ return null;
49427
+ }
49428
+ };
49429
+ const bars = Array(12).fill(0);
49430
+ const Loader = ({ visible, className }) => {
49431
+ return /* @__PURE__ */ ReactExports.createElement("div", {
49432
+ className: [
49433
+ "sonner-loading-wrapper",
49434
+ className
49435
+ ].filter(Boolean).join(" "),
49436
+ "data-visible": visible
49437
+ }, /* @__PURE__ */ ReactExports.createElement("div", {
49438
+ className: "sonner-spinner"
49439
+ }, bars.map((_2, i) => /* @__PURE__ */ ReactExports.createElement("div", {
49440
+ className: "sonner-loading-bar",
49441
+ key: `spinner-bar-${i}`
49442
+ }))));
49443
+ };
49444
+ const SuccessIcon = /* @__PURE__ */ ReactExports.createElement("svg", {
49445
+ xmlns: "http://www.w3.org/2000/svg",
49446
+ viewBox: "0 0 20 20",
49447
+ fill: "currentColor",
49448
+ height: "20",
49449
+ width: "20"
49450
+ }, /* @__PURE__ */ ReactExports.createElement("path", {
49451
+ fillRule: "evenodd",
49452
+ d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",
49453
+ clipRule: "evenodd"
49454
+ }));
49455
+ const WarningIcon = /* @__PURE__ */ ReactExports.createElement("svg", {
49456
+ xmlns: "http://www.w3.org/2000/svg",
49457
+ viewBox: "0 0 24 24",
49458
+ fill: "currentColor",
49459
+ height: "20",
49460
+ width: "20"
49461
+ }, /* @__PURE__ */ ReactExports.createElement("path", {
49462
+ fillRule: "evenodd",
49463
+ d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",
49464
+ clipRule: "evenodd"
49465
+ }));
49466
+ const InfoIcon = /* @__PURE__ */ ReactExports.createElement("svg", {
49467
+ xmlns: "http://www.w3.org/2000/svg",
49468
+ viewBox: "0 0 20 20",
49469
+ fill: "currentColor",
49470
+ height: "20",
49471
+ width: "20"
49472
+ }, /* @__PURE__ */ ReactExports.createElement("path", {
49473
+ fillRule: "evenodd",
49474
+ d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",
49475
+ clipRule: "evenodd"
49476
+ }));
49477
+ const ErrorIcon = /* @__PURE__ */ ReactExports.createElement("svg", {
49478
+ xmlns: "http://www.w3.org/2000/svg",
49479
+ viewBox: "0 0 20 20",
49480
+ fill: "currentColor",
49481
+ height: "20",
49482
+ width: "20"
49483
+ }, /* @__PURE__ */ ReactExports.createElement("path", {
49484
+ fillRule: "evenodd",
49485
+ d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",
49486
+ clipRule: "evenodd"
49487
+ }));
49488
+ const CloseIcon = /* @__PURE__ */ ReactExports.createElement("svg", {
49489
+ xmlns: "http://www.w3.org/2000/svg",
49490
+ width: "12",
49491
+ height: "12",
49492
+ viewBox: "0 0 24 24",
49493
+ fill: "none",
49494
+ stroke: "currentColor",
49495
+ strokeWidth: "1.5",
49496
+ strokeLinecap: "round",
49497
+ strokeLinejoin: "round"
49498
+ }, /* @__PURE__ */ ReactExports.createElement("line", {
49499
+ x1: "18",
49500
+ y1: "6",
49501
+ x2: "6",
49502
+ y2: "18"
49503
+ }), /* @__PURE__ */ ReactExports.createElement("line", {
49504
+ x1: "6",
49505
+ y1: "6",
49506
+ x2: "18",
49507
+ y2: "18"
49508
+ }));
49509
+ const useIsDocumentHidden = () => {
49510
+ const [isDocumentHidden, setIsDocumentHidden] = ReactExports.useState(document.hidden);
49511
+ ReactExports.useEffect(() => {
49512
+ const callback = () => {
49513
+ setIsDocumentHidden(document.hidden);
49514
+ };
49515
+ document.addEventListener("visibilitychange", callback);
49516
+ return () => window.removeEventListener("visibilitychange", callback);
49517
+ }, []);
49518
+ return isDocumentHidden;
49519
+ };
49520
+ let toastsCounter = 1;
49521
+ class Observer {
49522
+ constructor() {
49523
+ this.subscribe = (subscriber) => {
49524
+ this.subscribers.push(subscriber);
49525
+ return () => {
49526
+ const index2 = this.subscribers.indexOf(subscriber);
49527
+ this.subscribers.splice(index2, 1);
49528
+ };
49529
+ };
49530
+ this.publish = (data) => {
49531
+ this.subscribers.forEach((subscriber) => subscriber(data));
49532
+ };
49533
+ this.addToast = (data) => {
49534
+ this.publish(data);
49535
+ this.toasts = [
49536
+ ...this.toasts,
49537
+ data
49538
+ ];
49539
+ };
49540
+ this.create = (data) => {
49541
+ var _data_id;
49542
+ const { message: message2, ...rest } = data;
49543
+ const id2 = typeof (data == null ? void 0 : data.id) === "number" || ((_data_id = data.id) == null ? void 0 : _data_id.length) > 0 ? data.id : toastsCounter++;
49544
+ const alreadyExists = this.toasts.find((toast2) => {
49545
+ return toast2.id === id2;
49546
+ });
49547
+ const dismissible = data.dismissible === void 0 ? true : data.dismissible;
49548
+ if (this.dismissedToasts.has(id2)) {
49549
+ this.dismissedToasts.delete(id2);
49550
+ }
49551
+ if (alreadyExists) {
49552
+ this.toasts = this.toasts.map((toast2) => {
49553
+ if (toast2.id === id2) {
49554
+ this.publish({
49555
+ ...toast2,
49556
+ ...data,
49557
+ id: id2,
49558
+ title: message2
49559
+ });
49560
+ return {
49561
+ ...toast2,
49562
+ ...data,
49563
+ id: id2,
49564
+ dismissible,
49565
+ title: message2
49566
+ };
49567
+ }
49568
+ return toast2;
49569
+ });
49570
+ } else {
49571
+ this.addToast({
49572
+ title: message2,
49573
+ ...rest,
49574
+ dismissible,
49575
+ id: id2
49576
+ });
49577
+ }
49578
+ return id2;
49579
+ };
49580
+ this.dismiss = (id2) => {
49581
+ if (id2) {
49582
+ this.dismissedToasts.add(id2);
49583
+ requestAnimationFrame(() => this.subscribers.forEach((subscriber) => subscriber({
49584
+ id: id2,
49585
+ dismiss: true
49586
+ })));
49587
+ } else {
49588
+ this.toasts.forEach((toast2) => {
49589
+ this.subscribers.forEach((subscriber) => subscriber({
49590
+ id: toast2.id,
49591
+ dismiss: true
49592
+ }));
49593
+ });
49594
+ }
49595
+ return id2;
49596
+ };
49597
+ this.message = (message2, data) => {
49598
+ return this.create({
49599
+ ...data,
49600
+ message: message2
49601
+ });
49602
+ };
49603
+ this.error = (message2, data) => {
49604
+ return this.create({
49605
+ ...data,
49606
+ message: message2,
49607
+ type: "error"
49608
+ });
49609
+ };
49610
+ this.success = (message2, data) => {
49611
+ return this.create({
49612
+ ...data,
49613
+ type: "success",
49614
+ message: message2
49615
+ });
49616
+ };
49617
+ this.info = (message2, data) => {
49618
+ return this.create({
49619
+ ...data,
49620
+ type: "info",
49621
+ message: message2
49622
+ });
49623
+ };
49624
+ this.warning = (message2, data) => {
49625
+ return this.create({
49626
+ ...data,
49627
+ type: "warning",
49628
+ message: message2
49629
+ });
49630
+ };
49631
+ this.loading = (message2, data) => {
49632
+ return this.create({
49633
+ ...data,
49634
+ type: "loading",
49635
+ message: message2
49636
+ });
49637
+ };
49638
+ this.promise = (promise2, data) => {
49639
+ if (!data) {
49640
+ return;
49641
+ }
49642
+ let id2 = void 0;
49643
+ if (data.loading !== void 0) {
49644
+ id2 = this.create({
49645
+ ...data,
49646
+ promise: promise2,
49647
+ type: "loading",
49648
+ message: data.loading,
49649
+ description: typeof data.description !== "function" ? data.description : void 0
49650
+ });
49651
+ }
49652
+ const p2 = Promise.resolve(promise2 instanceof Function ? promise2() : promise2);
49653
+ let shouldDismiss = id2 !== void 0;
49654
+ let result;
49655
+ const originalPromise = p2.then(async (response2) => {
49656
+ result = [
49657
+ "resolve",
49658
+ response2
49659
+ ];
49660
+ const isReactElementResponse = ReactExports.isValidElement(response2);
49661
+ if (isReactElementResponse) {
49662
+ shouldDismiss = false;
49663
+ this.create({
49664
+ id: id2,
49665
+ type: "default",
49666
+ message: response2
49667
+ });
49668
+ } else if (isHttpResponse(response2) && !response2.ok) {
49669
+ shouldDismiss = false;
49670
+ const promiseData = typeof data.error === "function" ? await data.error(`HTTP error! status: ${response2.status}`) : data.error;
49671
+ const description = typeof data.description === "function" ? await data.description(`HTTP error! status: ${response2.status}`) : data.description;
49672
+ const isExtendedResult = typeof promiseData === "object" && !ReactExports.isValidElement(promiseData);
49673
+ const toastSettings = isExtendedResult ? promiseData : {
49674
+ message: promiseData
49675
+ };
49676
+ this.create({
49677
+ id: id2,
49678
+ type: "error",
49679
+ description,
49680
+ ...toastSettings
49681
+ });
49682
+ } else if (response2 instanceof Error) {
49683
+ shouldDismiss = false;
49684
+ const promiseData = typeof data.error === "function" ? await data.error(response2) : data.error;
49685
+ const description = typeof data.description === "function" ? await data.description(response2) : data.description;
49686
+ const isExtendedResult = typeof promiseData === "object" && !ReactExports.isValidElement(promiseData);
49687
+ const toastSettings = isExtendedResult ? promiseData : {
49688
+ message: promiseData
49689
+ };
49690
+ this.create({
49691
+ id: id2,
49692
+ type: "error",
49693
+ description,
49694
+ ...toastSettings
49695
+ });
49696
+ } else if (data.success !== void 0) {
49697
+ shouldDismiss = false;
49698
+ const promiseData = typeof data.success === "function" ? await data.success(response2) : data.success;
49699
+ const description = typeof data.description === "function" ? await data.description(response2) : data.description;
49700
+ const isExtendedResult = typeof promiseData === "object" && !ReactExports.isValidElement(promiseData);
49701
+ const toastSettings = isExtendedResult ? promiseData : {
49702
+ message: promiseData
49703
+ };
49704
+ this.create({
49705
+ id: id2,
49706
+ type: "success",
49707
+ description,
49708
+ ...toastSettings
49709
+ });
49710
+ }
49711
+ }).catch(async (error2) => {
49712
+ result = [
49713
+ "reject",
49714
+ error2
49715
+ ];
49716
+ if (data.error !== void 0) {
49717
+ shouldDismiss = false;
49718
+ const promiseData = typeof data.error === "function" ? await data.error(error2) : data.error;
49719
+ const description = typeof data.description === "function" ? await data.description(error2) : data.description;
49720
+ const isExtendedResult = typeof promiseData === "object" && !ReactExports.isValidElement(promiseData);
49721
+ const toastSettings = isExtendedResult ? promiseData : {
49722
+ message: promiseData
49723
+ };
49724
+ this.create({
49725
+ id: id2,
49726
+ type: "error",
49727
+ description,
49728
+ ...toastSettings
49729
+ });
49730
+ }
49731
+ }).finally(() => {
49732
+ if (shouldDismiss) {
49733
+ this.dismiss(id2);
49734
+ id2 = void 0;
49735
+ }
49736
+ data.finally == null ? void 0 : data.finally.call(data);
49737
+ });
49738
+ const unwrap = () => new Promise((resolve2, reject) => originalPromise.then(() => result[0] === "reject" ? reject(result[1]) : resolve2(result[1])).catch(reject));
49739
+ if (typeof id2 !== "string" && typeof id2 !== "number") {
49740
+ return {
49741
+ unwrap
49742
+ };
49743
+ } else {
49744
+ return Object.assign(id2, {
49745
+ unwrap
49746
+ });
49747
+ }
49748
+ };
49749
+ this.custom = (jsx, data) => {
49750
+ const id2 = (data == null ? void 0 : data.id) || toastsCounter++;
49751
+ this.create({
49752
+ jsx: jsx(id2),
49753
+ id: id2,
49754
+ ...data
49755
+ });
49756
+ return id2;
49757
+ };
49758
+ this.getActiveToasts = () => {
49759
+ return this.toasts.filter((toast2) => !this.dismissedToasts.has(toast2.id));
49760
+ };
49761
+ this.subscribers = [];
49762
+ this.toasts = [];
49763
+ this.dismissedToasts = /* @__PURE__ */ new Set();
49764
+ }
49765
+ }
49766
+ const ToastState = new Observer();
49767
+ const toastFunction = (message2, data) => {
49768
+ const id2 = (data == null ? void 0 : data.id) || toastsCounter++;
49769
+ ToastState.addToast({
49770
+ title: message2,
49771
+ ...data,
49772
+ id: id2
49773
+ });
49774
+ return id2;
49775
+ };
49776
+ const isHttpResponse = (data) => {
49777
+ return data && typeof data === "object" && "ok" in data && typeof data.ok === "boolean" && "status" in data && typeof data.status === "number";
49778
+ };
49779
+ const basicToast = toastFunction;
49780
+ const getHistory = () => ToastState.toasts;
49781
+ const getToasts = () => ToastState.getActiveToasts();
49782
+ const toast = Object.assign(basicToast, {
49783
+ success: ToastState.success,
49784
+ info: ToastState.info,
49785
+ warning: ToastState.warning,
49786
+ error: ToastState.error,
49787
+ custom: ToastState.custom,
49788
+ message: ToastState.message,
49789
+ promise: ToastState.promise,
49790
+ dismiss: ToastState.dismiss,
49791
+ loading: ToastState.loading
49792
+ }, {
49793
+ getHistory,
49794
+ getToasts
49795
+ });
49796
+ __insertCSS("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
49797
+ function isAction(action2) {
49798
+ return action2.label !== void 0;
49799
+ }
49800
+ const VISIBLE_TOASTS_AMOUNT = 3;
49801
+ const VIEWPORT_OFFSET = "24px";
49802
+ const MOBILE_VIEWPORT_OFFSET = "16px";
49803
+ const TOAST_LIFETIME = 4e3;
49804
+ const TOAST_WIDTH = 356;
49805
+ const GAP = 14;
49806
+ const SWIPE_THRESHOLD = 45;
49807
+ const TIME_BEFORE_UNMOUNT = 200;
49808
+ function cn$3(...classes) {
49809
+ return classes.filter(Boolean).join(" ");
49810
+ }
49811
+ function getDefaultSwipeDirections(position2) {
49812
+ const [y2, x2] = position2.split("-");
49813
+ const directions = [];
49814
+ if (y2) {
49815
+ directions.push(y2);
49816
+ }
49817
+ if (x2) {
49818
+ directions.push(x2);
49819
+ }
49820
+ return directions;
49821
+ }
49822
+ const Toast = (props) => {
49823
+ var _toast_classNames, _toast_classNames1, _toast_classNames2, _toast_classNames3, _toast_classNames4, _toast_classNames5, _toast_classNames6, _toast_classNames7, _toast_classNames8;
49824
+ const { invert: ToasterInvert, toast: toast2, unstyled, interacting, setHeights, visibleToasts, heights, index: index2, toasts, expanded: expanded2, removeToast, defaultRichColors, closeButton: closeButtonFromToaster, style: style2, cancelButtonStyle, actionButtonStyle, className = "", descriptionClassName = "", duration: durationFromToaster, position: position2, gap, expandByDefault, classNames, icons, closeButtonAriaLabel = "Close toast" } = props;
49825
+ const [swipeDirection, setSwipeDirection] = ReactExports.useState(null);
49826
+ const [swipeOutDirection, setSwipeOutDirection] = ReactExports.useState(null);
49827
+ const [mounted, setMounted] = ReactExports.useState(false);
49828
+ const [removed, setRemoved] = ReactExports.useState(false);
49829
+ const [swiping, setSwiping] = ReactExports.useState(false);
49830
+ const [swipeOut, setSwipeOut] = ReactExports.useState(false);
49831
+ const [isSwiped, setIsSwiped] = ReactExports.useState(false);
49832
+ const [offsetBeforeRemove, setOffsetBeforeRemove] = ReactExports.useState(0);
49833
+ const [initialHeight, setInitialHeight] = ReactExports.useState(0);
49834
+ const remainingTime = ReactExports.useRef(toast2.duration || durationFromToaster || TOAST_LIFETIME);
49835
+ const dragStartTime = ReactExports.useRef(null);
49836
+ const toastRef = ReactExports.useRef(null);
49837
+ const isFront = index2 === 0;
49838
+ const isVisible = index2 + 1 <= visibleToasts;
49839
+ const toastType = toast2.type;
49840
+ const dismissible = toast2.dismissible !== false;
49841
+ const toastClassname = toast2.className || "";
49842
+ const toastDescriptionClassname = toast2.descriptionClassName || "";
49843
+ const heightIndex = ReactExports.useMemo(() => heights.findIndex((height) => height.toastId === toast2.id) || 0, [
49844
+ heights,
49845
+ toast2.id
49846
+ ]);
49847
+ const closeButton = ReactExports.useMemo(() => {
49848
+ var _toast_closeButton;
49849
+ return (_toast_closeButton = toast2.closeButton) != null ? _toast_closeButton : closeButtonFromToaster;
49850
+ }, [
49851
+ toast2.closeButton,
49852
+ closeButtonFromToaster
49853
+ ]);
49854
+ const duration2 = ReactExports.useMemo(() => toast2.duration || durationFromToaster || TOAST_LIFETIME, [
49855
+ toast2.duration,
49856
+ durationFromToaster
49857
+ ]);
49858
+ const closeTimerStartTimeRef = ReactExports.useRef(0);
49859
+ const offset2 = ReactExports.useRef(0);
49860
+ const lastCloseTimerStartTimeRef = ReactExports.useRef(0);
49861
+ const pointerStartRef = ReactExports.useRef(null);
49862
+ const [y2, x2] = position2.split("-");
49863
+ const toastsHeightBefore = ReactExports.useMemo(() => {
49864
+ return heights.reduce((prev, curr, reducerIndex) => {
49865
+ if (reducerIndex >= heightIndex) {
49866
+ return prev;
49867
+ }
49868
+ return prev + curr.height;
49869
+ }, 0);
49870
+ }, [
49871
+ heights,
49872
+ heightIndex
49873
+ ]);
49874
+ const isDocumentHidden = useIsDocumentHidden();
49875
+ const invert = toast2.invert || ToasterInvert;
49876
+ const disabled = toastType === "loading";
49877
+ offset2.current = ReactExports.useMemo(() => heightIndex * gap + toastsHeightBefore, [
49878
+ heightIndex,
49879
+ toastsHeightBefore
49880
+ ]);
49881
+ ReactExports.useEffect(() => {
49882
+ remainingTime.current = duration2;
49883
+ }, [
49884
+ duration2
49885
+ ]);
49886
+ ReactExports.useEffect(() => {
49887
+ setMounted(true);
49888
+ }, []);
49889
+ ReactExports.useEffect(() => {
49890
+ const toastNode = toastRef.current;
49891
+ if (toastNode) {
49892
+ const height = toastNode.getBoundingClientRect().height;
49893
+ setInitialHeight(height);
49894
+ setHeights((h2) => [
49895
+ {
49896
+ toastId: toast2.id,
49897
+ height,
49898
+ position: toast2.position
49899
+ },
49900
+ ...h2
49901
+ ]);
49902
+ return () => setHeights((h2) => h2.filter((height2) => height2.toastId !== toast2.id));
49903
+ }
49904
+ }, [
49905
+ setHeights,
49906
+ toast2.id
49907
+ ]);
49908
+ ReactExports.useLayoutEffect(() => {
49909
+ if (!mounted) return;
49910
+ const toastNode = toastRef.current;
49911
+ const originalHeight = toastNode.style.height;
49912
+ toastNode.style.height = "auto";
49913
+ const newHeight = toastNode.getBoundingClientRect().height;
49914
+ toastNode.style.height = originalHeight;
49915
+ setInitialHeight(newHeight);
49916
+ setHeights((heights2) => {
49917
+ const alreadyExists = heights2.find((height) => height.toastId === toast2.id);
49918
+ if (!alreadyExists) {
49919
+ return [
49920
+ {
49921
+ toastId: toast2.id,
49922
+ height: newHeight,
49923
+ position: toast2.position
49924
+ },
49925
+ ...heights2
49926
+ ];
49927
+ } else {
49928
+ return heights2.map((height) => height.toastId === toast2.id ? {
49929
+ ...height,
49930
+ height: newHeight
49931
+ } : height);
49932
+ }
49933
+ });
49934
+ }, [
49935
+ mounted,
49936
+ toast2.title,
49937
+ toast2.description,
49938
+ setHeights,
49939
+ toast2.id,
49940
+ toast2.jsx,
49941
+ toast2.action,
49942
+ toast2.cancel
49943
+ ]);
49944
+ const deleteToast = ReactExports.useCallback(() => {
49945
+ setRemoved(true);
49946
+ setOffsetBeforeRemove(offset2.current);
49947
+ setHeights((h2) => h2.filter((height) => height.toastId !== toast2.id));
49948
+ setTimeout(() => {
49949
+ removeToast(toast2);
49950
+ }, TIME_BEFORE_UNMOUNT);
49951
+ }, [
49952
+ toast2,
49953
+ removeToast,
49954
+ setHeights,
49955
+ offset2
49956
+ ]);
49957
+ ReactExports.useEffect(() => {
49958
+ if (toast2.promise && toastType === "loading" || toast2.duration === Infinity || toast2.type === "loading") return;
49959
+ let timeoutId;
49960
+ const pauseTimer = () => {
49961
+ if (lastCloseTimerStartTimeRef.current < closeTimerStartTimeRef.current) {
49962
+ const elapsedTime = (/* @__PURE__ */ new Date()).getTime() - closeTimerStartTimeRef.current;
49963
+ remainingTime.current = remainingTime.current - elapsedTime;
49964
+ }
49965
+ lastCloseTimerStartTimeRef.current = (/* @__PURE__ */ new Date()).getTime();
49966
+ };
49967
+ const startTimer = () => {
49968
+ if (remainingTime.current === Infinity) return;
49969
+ closeTimerStartTimeRef.current = (/* @__PURE__ */ new Date()).getTime();
49970
+ timeoutId = setTimeout(() => {
49971
+ toast2.onAutoClose == null ? void 0 : toast2.onAutoClose.call(toast2, toast2);
49972
+ deleteToast();
49973
+ }, remainingTime.current);
49974
+ };
49975
+ if (expanded2 || interacting || isDocumentHidden) {
49976
+ pauseTimer();
49977
+ } else {
49978
+ startTimer();
49979
+ }
49980
+ return () => clearTimeout(timeoutId);
49981
+ }, [
49982
+ expanded2,
49983
+ interacting,
49984
+ toast2,
49985
+ toastType,
49986
+ isDocumentHidden,
49987
+ deleteToast
49988
+ ]);
49989
+ ReactExports.useEffect(() => {
49990
+ if (toast2.delete) {
49991
+ deleteToast();
49992
+ toast2.onDismiss == null ? void 0 : toast2.onDismiss.call(toast2, toast2);
49993
+ }
49994
+ }, [
49995
+ deleteToast,
49996
+ toast2.delete
49997
+ ]);
49998
+ function getLoadingIcon() {
49999
+ var _toast_classNames9;
50000
+ if (icons == null ? void 0 : icons.loading) {
50001
+ var _toast_classNames12;
50002
+ return /* @__PURE__ */ ReactExports.createElement("div", {
50003
+ className: cn$3(classNames == null ? void 0 : classNames.loader, toast2 == null ? void 0 : (_toast_classNames12 = toast2.classNames) == null ? void 0 : _toast_classNames12.loader, "sonner-loader"),
50004
+ "data-visible": toastType === "loading"
50005
+ }, icons.loading);
50006
+ }
50007
+ return /* @__PURE__ */ ReactExports.createElement(Loader, {
50008
+ className: cn$3(classNames == null ? void 0 : classNames.loader, toast2 == null ? void 0 : (_toast_classNames9 = toast2.classNames) == null ? void 0 : _toast_classNames9.loader),
50009
+ visible: toastType === "loading"
50010
+ });
50011
+ }
50012
+ const icon = toast2.icon || (icons == null ? void 0 : icons[toastType]) || getAsset(toastType);
50013
+ var _toast_richColors, _icons_close;
50014
+ return /* @__PURE__ */ ReactExports.createElement("li", {
50015
+ tabIndex: 0,
50016
+ ref: toastRef,
50017
+ className: cn$3(className, toastClassname, classNames == null ? void 0 : classNames.toast, toast2 == null ? void 0 : (_toast_classNames = toast2.classNames) == null ? void 0 : _toast_classNames.toast, classNames == null ? void 0 : classNames.default, classNames == null ? void 0 : classNames[toastType], toast2 == null ? void 0 : (_toast_classNames1 = toast2.classNames) == null ? void 0 : _toast_classNames1[toastType]),
50018
+ "data-sonner-toast": "",
50019
+ "data-rich-colors": (_toast_richColors = toast2.richColors) != null ? _toast_richColors : defaultRichColors,
50020
+ "data-styled": !Boolean(toast2.jsx || toast2.unstyled || unstyled),
50021
+ "data-mounted": mounted,
50022
+ "data-promise": Boolean(toast2.promise),
50023
+ "data-swiped": isSwiped,
50024
+ "data-removed": removed,
50025
+ "data-visible": isVisible,
50026
+ "data-y-position": y2,
50027
+ "data-x-position": x2,
50028
+ "data-index": index2,
50029
+ "data-front": isFront,
50030
+ "data-swiping": swiping,
50031
+ "data-dismissible": dismissible,
50032
+ "data-type": toastType,
50033
+ "data-invert": invert,
50034
+ "data-swipe-out": swipeOut,
50035
+ "data-swipe-direction": swipeOutDirection,
50036
+ "data-expanded": Boolean(expanded2 || expandByDefault && mounted),
50037
+ "data-testid": toast2.testId,
50038
+ style: {
50039
+ "--index": index2,
50040
+ "--toasts-before": index2,
50041
+ "--z-index": toasts.length - index2,
50042
+ "--offset": `${removed ? offsetBeforeRemove : offset2.current}px`,
50043
+ "--initial-height": expandByDefault ? "auto" : `${initialHeight}px`,
50044
+ ...style2,
50045
+ ...toast2.style
50046
+ },
50047
+ onDragEnd: () => {
50048
+ setSwiping(false);
50049
+ setSwipeDirection(null);
50050
+ pointerStartRef.current = null;
50051
+ },
50052
+ onPointerDown: (event) => {
50053
+ if (event.button === 2) return;
50054
+ if (disabled || !dismissible) return;
50055
+ dragStartTime.current = /* @__PURE__ */ new Date();
50056
+ setOffsetBeforeRemove(offset2.current);
50057
+ event.target.setPointerCapture(event.pointerId);
50058
+ if (event.target.tagName === "BUTTON") return;
50059
+ setSwiping(true);
50060
+ pointerStartRef.current = {
50061
+ x: event.clientX,
50062
+ y: event.clientY
50063
+ };
50064
+ },
50065
+ onPointerUp: () => {
50066
+ var _toastRef_current, _toastRef_current1, _dragStartTime_current;
50067
+ if (swipeOut || !dismissible) return;
50068
+ pointerStartRef.current = null;
50069
+ const swipeAmountX = Number(((_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0);
50070
+ const swipeAmountY = Number(((_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0);
50071
+ const timeTaken = (/* @__PURE__ */ new Date()).getTime() - ((_dragStartTime_current = dragStartTime.current) == null ? void 0 : _dragStartTime_current.getTime());
50072
+ const swipeAmount = swipeDirection === "x" ? swipeAmountX : swipeAmountY;
50073
+ const velocity = Math.abs(swipeAmount) / timeTaken;
50074
+ if (Math.abs(swipeAmount) >= SWIPE_THRESHOLD || velocity > 0.11) {
50075
+ setOffsetBeforeRemove(offset2.current);
50076
+ toast2.onDismiss == null ? void 0 : toast2.onDismiss.call(toast2, toast2);
50077
+ if (swipeDirection === "x") {
50078
+ setSwipeOutDirection(swipeAmountX > 0 ? "right" : "left");
50079
+ } else {
50080
+ setSwipeOutDirection(swipeAmountY > 0 ? "down" : "up");
50081
+ }
50082
+ deleteToast();
50083
+ setSwipeOut(true);
50084
+ return;
50085
+ } else {
50086
+ var _toastRef_current2, _toastRef_current3;
50087
+ (_toastRef_current2 = toastRef.current) == null ? void 0 : _toastRef_current2.style.setProperty("--swipe-amount-x", `0px`);
50088
+ (_toastRef_current3 = toastRef.current) == null ? void 0 : _toastRef_current3.style.setProperty("--swipe-amount-y", `0px`);
50089
+ }
50090
+ setIsSwiped(false);
50091
+ setSwiping(false);
50092
+ setSwipeDirection(null);
50093
+ },
50094
+ onPointerMove: (event) => {
50095
+ var _window_getSelection, _toastRef_current, _toastRef_current1;
50096
+ if (!pointerStartRef.current || !dismissible) return;
50097
+ const isHighlighted = ((_window_getSelection = window.getSelection()) == null ? void 0 : _window_getSelection.toString().length) > 0;
50098
+ if (isHighlighted) return;
50099
+ const yDelta = event.clientY - pointerStartRef.current.y;
50100
+ const xDelta = event.clientX - pointerStartRef.current.x;
50101
+ var _props_swipeDirections;
50102
+ const swipeDirections = (_props_swipeDirections = props.swipeDirections) != null ? _props_swipeDirections : getDefaultSwipeDirections(position2);
50103
+ if (!swipeDirection && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) {
50104
+ setSwipeDirection(Math.abs(xDelta) > Math.abs(yDelta) ? "x" : "y");
50105
+ }
50106
+ let swipeAmount = {
50107
+ x: 0,
50108
+ y: 0
50109
+ };
50110
+ const getDampening = (delta) => {
50111
+ const factor = Math.abs(delta) / 20;
50112
+ return 1 / (1.5 + factor);
50113
+ };
50114
+ if (swipeDirection === "y") {
50115
+ if (swipeDirections.includes("top") || swipeDirections.includes("bottom")) {
50116
+ if (swipeDirections.includes("top") && yDelta < 0 || swipeDirections.includes("bottom") && yDelta > 0) {
50117
+ swipeAmount.y = yDelta;
50118
+ } else {
50119
+ const dampenedDelta = yDelta * getDampening(yDelta);
50120
+ swipeAmount.y = Math.abs(dampenedDelta) < Math.abs(yDelta) ? dampenedDelta : yDelta;
50121
+ }
50122
+ }
50123
+ } else if (swipeDirection === "x") {
50124
+ if (swipeDirections.includes("left") || swipeDirections.includes("right")) {
50125
+ if (swipeDirections.includes("left") && xDelta < 0 || swipeDirections.includes("right") && xDelta > 0) {
50126
+ swipeAmount.x = xDelta;
50127
+ } else {
50128
+ const dampenedDelta = xDelta * getDampening(xDelta);
50129
+ swipeAmount.x = Math.abs(dampenedDelta) < Math.abs(xDelta) ? dampenedDelta : xDelta;
50130
+ }
50131
+ }
50132
+ }
50133
+ if (Math.abs(swipeAmount.x) > 0 || Math.abs(swipeAmount.y) > 0) {
50134
+ setIsSwiped(true);
50135
+ }
50136
+ (_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.setProperty("--swipe-amount-x", `${swipeAmount.x}px`);
50137
+ (_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.setProperty("--swipe-amount-y", `${swipeAmount.y}px`);
50138
+ }
50139
+ }, closeButton && !toast2.jsx && toastType !== "loading" ? /* @__PURE__ */ ReactExports.createElement("button", {
50140
+ "aria-label": closeButtonAriaLabel,
50141
+ "data-disabled": disabled,
50142
+ "data-close-button": true,
50143
+ onClick: disabled || !dismissible ? () => {
50144
+ } : () => {
50145
+ deleteToast();
50146
+ toast2.onDismiss == null ? void 0 : toast2.onDismiss.call(toast2, toast2);
50147
+ },
50148
+ className: cn$3(classNames == null ? void 0 : classNames.closeButton, toast2 == null ? void 0 : (_toast_classNames2 = toast2.classNames) == null ? void 0 : _toast_classNames2.closeButton)
50149
+ }, (_icons_close = icons == null ? void 0 : icons.close) != null ? _icons_close : CloseIcon) : null, (toastType || toast2.icon || toast2.promise) && toast2.icon !== null && ((icons == null ? void 0 : icons[toastType]) !== null || toast2.icon) ? /* @__PURE__ */ ReactExports.createElement("div", {
50150
+ "data-icon": "",
50151
+ className: cn$3(classNames == null ? void 0 : classNames.icon, toast2 == null ? void 0 : (_toast_classNames3 = toast2.classNames) == null ? void 0 : _toast_classNames3.icon)
50152
+ }, toast2.promise || toast2.type === "loading" && !toast2.icon ? toast2.icon || getLoadingIcon() : null, toast2.type !== "loading" ? icon : null) : null, /* @__PURE__ */ ReactExports.createElement("div", {
50153
+ "data-content": "",
50154
+ className: cn$3(classNames == null ? void 0 : classNames.content, toast2 == null ? void 0 : (_toast_classNames4 = toast2.classNames) == null ? void 0 : _toast_classNames4.content)
50155
+ }, /* @__PURE__ */ ReactExports.createElement("div", {
50156
+ "data-title": "",
50157
+ className: cn$3(classNames == null ? void 0 : classNames.title, toast2 == null ? void 0 : (_toast_classNames5 = toast2.classNames) == null ? void 0 : _toast_classNames5.title)
50158
+ }, toast2.jsx ? toast2.jsx : typeof toast2.title === "function" ? toast2.title() : toast2.title), toast2.description ? /* @__PURE__ */ ReactExports.createElement("div", {
50159
+ "data-description": "",
50160
+ className: cn$3(descriptionClassName, toastDescriptionClassname, classNames == null ? void 0 : classNames.description, toast2 == null ? void 0 : (_toast_classNames6 = toast2.classNames) == null ? void 0 : _toast_classNames6.description)
50161
+ }, typeof toast2.description === "function" ? toast2.description() : toast2.description) : null), /* @__PURE__ */ ReactExports.isValidElement(toast2.cancel) ? toast2.cancel : toast2.cancel && isAction(toast2.cancel) ? /* @__PURE__ */ ReactExports.createElement("button", {
50162
+ "data-button": true,
50163
+ "data-cancel": true,
50164
+ style: toast2.cancelButtonStyle || cancelButtonStyle,
50165
+ onClick: (event) => {
50166
+ if (!isAction(toast2.cancel)) return;
50167
+ if (!dismissible) return;
50168
+ toast2.cancel.onClick == null ? void 0 : toast2.cancel.onClick.call(toast2.cancel, event);
50169
+ deleteToast();
50170
+ },
50171
+ className: cn$3(classNames == null ? void 0 : classNames.cancelButton, toast2 == null ? void 0 : (_toast_classNames7 = toast2.classNames) == null ? void 0 : _toast_classNames7.cancelButton)
50172
+ }, toast2.cancel.label) : null, /* @__PURE__ */ ReactExports.isValidElement(toast2.action) ? toast2.action : toast2.action && isAction(toast2.action) ? /* @__PURE__ */ ReactExports.createElement("button", {
50173
+ "data-button": true,
50174
+ "data-action": true,
50175
+ style: toast2.actionButtonStyle || actionButtonStyle,
50176
+ onClick: (event) => {
50177
+ if (!isAction(toast2.action)) return;
50178
+ toast2.action.onClick == null ? void 0 : toast2.action.onClick.call(toast2.action, event);
50179
+ if (event.defaultPrevented) return;
50180
+ deleteToast();
50181
+ },
50182
+ className: cn$3(classNames == null ? void 0 : classNames.actionButton, toast2 == null ? void 0 : (_toast_classNames8 = toast2.classNames) == null ? void 0 : _toast_classNames8.actionButton)
50183
+ }, toast2.action.label) : null);
50184
+ };
50185
+ function getDocumentDirection() {
50186
+ if (typeof window === "undefined") return "ltr";
50187
+ if (typeof document === "undefined") return "ltr";
50188
+ const dirAttribute = document.documentElement.getAttribute("dir");
50189
+ if (dirAttribute === "auto" || !dirAttribute) {
50190
+ return window.getComputedStyle(document.documentElement).direction;
50191
+ }
50192
+ return dirAttribute;
50193
+ }
50194
+ function assignOffset(defaultOffset, mobileOffset) {
50195
+ const styles2 = {};
50196
+ [
50197
+ defaultOffset,
50198
+ mobileOffset
50199
+ ].forEach((offset2, index2) => {
50200
+ const isMobile = index2 === 1;
50201
+ const prefix = isMobile ? "--mobile-offset" : "--offset";
50202
+ const defaultValue = isMobile ? MOBILE_VIEWPORT_OFFSET : VIEWPORT_OFFSET;
50203
+ function assignAll(offset3) {
50204
+ [
50205
+ "top",
50206
+ "right",
50207
+ "bottom",
50208
+ "left"
50209
+ ].forEach((key) => {
50210
+ styles2[`${prefix}-${key}`] = typeof offset3 === "number" ? `${offset3}px` : offset3;
50211
+ });
50212
+ }
50213
+ if (typeof offset2 === "number" || typeof offset2 === "string") {
50214
+ assignAll(offset2);
50215
+ } else if (typeof offset2 === "object") {
50216
+ [
50217
+ "top",
50218
+ "right",
50219
+ "bottom",
50220
+ "left"
50221
+ ].forEach((key) => {
50222
+ if (offset2[key] === void 0) {
50223
+ styles2[`${prefix}-${key}`] = defaultValue;
50224
+ } else {
50225
+ styles2[`${prefix}-${key}`] = typeof offset2[key] === "number" ? `${offset2[key]}px` : offset2[key];
50226
+ }
50227
+ });
50228
+ } else {
50229
+ assignAll(defaultValue);
50230
+ }
50231
+ });
50232
+ return styles2;
50233
+ }
50234
+ const Toaster$1 = /* @__PURE__ */ ReactExports.forwardRef(function Toaster(props, ref) {
50235
+ const { id: id2, invert, position: position2 = "bottom-right", hotkey = [
50236
+ "altKey",
50237
+ "KeyT"
50238
+ ], expand: expand2, closeButton, className, offset: offset2, mobileOffset, theme: theme3 = "light", richColors, duration: duration2, style: style2, visibleToasts = VISIBLE_TOASTS_AMOUNT, toastOptions, dir = getDocumentDirection(), gap = GAP, icons, containerAriaLabel = "Notifications" } = props;
50239
+ const [toasts, setToasts] = ReactExports.useState([]);
50240
+ const filteredToasts = ReactExports.useMemo(() => {
50241
+ if (id2) {
50242
+ return toasts.filter((toast2) => toast2.toasterId === id2);
50243
+ }
50244
+ return toasts.filter((toast2) => !toast2.toasterId);
50245
+ }, [
50246
+ toasts,
50247
+ id2
50248
+ ]);
50249
+ const possiblePositions = ReactExports.useMemo(() => {
50250
+ return Array.from(new Set([
50251
+ position2
50252
+ ].concat(filteredToasts.filter((toast2) => toast2.position).map((toast2) => toast2.position))));
50253
+ }, [
50254
+ filteredToasts,
50255
+ position2
50256
+ ]);
50257
+ const [heights, setHeights] = ReactExports.useState([]);
50258
+ const [expanded2, setExpanded] = ReactExports.useState(false);
50259
+ const [interacting, setInteracting] = ReactExports.useState(false);
50260
+ const [actualTheme, setActualTheme] = ReactExports.useState(theme3 !== "system" ? theme3 : typeof window !== "undefined" ? window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : "light");
50261
+ const listRef = ReactExports.useRef(null);
50262
+ const hotkeyLabel = hotkey.join("+").replace(/Key/g, "").replace(/Digit/g, "");
50263
+ const lastFocusedElementRef = ReactExports.useRef(null);
50264
+ const isFocusWithinRef = ReactExports.useRef(false);
50265
+ const removeToast = ReactExports.useCallback((toastToRemove) => {
50266
+ setToasts((toasts2) => {
50267
+ var _toasts_find;
50268
+ if (!((_toasts_find = toasts2.find((toast2) => toast2.id === toastToRemove.id)) == null ? void 0 : _toasts_find.delete)) {
50269
+ ToastState.dismiss(toastToRemove.id);
50270
+ }
50271
+ return toasts2.filter(({ id: id3 }) => id3 !== toastToRemove.id);
50272
+ });
50273
+ }, []);
50274
+ ReactExports.useEffect(() => {
50275
+ return ToastState.subscribe((toast2) => {
50276
+ if (toast2.dismiss) {
50277
+ requestAnimationFrame(() => {
50278
+ setToasts((toasts2) => toasts2.map((t) => t.id === toast2.id ? {
50279
+ ...t,
50280
+ delete: true
50281
+ } : t));
50282
+ });
50283
+ return;
50284
+ }
50285
+ setTimeout(() => {
50286
+ ReactDOM.flushSync(() => {
50287
+ setToasts((toasts2) => {
50288
+ const indexOfExistingToast = toasts2.findIndex((t) => t.id === toast2.id);
50289
+ if (indexOfExistingToast !== -1) {
50290
+ return [
50291
+ ...toasts2.slice(0, indexOfExistingToast),
50292
+ {
50293
+ ...toasts2[indexOfExistingToast],
50294
+ ...toast2
50295
+ },
50296
+ ...toasts2.slice(indexOfExistingToast + 1)
50297
+ ];
50298
+ }
50299
+ return [
50300
+ toast2,
50301
+ ...toasts2
50302
+ ];
50303
+ });
50304
+ });
50305
+ });
50306
+ });
50307
+ }, [
50308
+ toasts
50309
+ ]);
50310
+ ReactExports.useEffect(() => {
50311
+ if (theme3 !== "system") {
50312
+ setActualTheme(theme3);
50313
+ return;
50314
+ }
50315
+ if (theme3 === "system") {
50316
+ if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) {
50317
+ setActualTheme("dark");
50318
+ } else {
50319
+ setActualTheme("light");
50320
+ }
50321
+ }
50322
+ if (typeof window === "undefined") return;
50323
+ const darkMediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
50324
+ try {
50325
+ darkMediaQuery.addEventListener("change", ({ matches }) => {
50326
+ if (matches) {
50327
+ setActualTheme("dark");
50328
+ } else {
50329
+ setActualTheme("light");
50330
+ }
50331
+ });
50332
+ } catch (error2) {
50333
+ darkMediaQuery.addListener(({ matches }) => {
50334
+ try {
50335
+ if (matches) {
50336
+ setActualTheme("dark");
50337
+ } else {
50338
+ setActualTheme("light");
50339
+ }
50340
+ } catch (e) {
50341
+ console.error(e);
50342
+ }
50343
+ });
50344
+ }
50345
+ }, [
50346
+ theme3
50347
+ ]);
50348
+ ReactExports.useEffect(() => {
50349
+ if (toasts.length <= 1) {
50350
+ setExpanded(false);
50351
+ }
50352
+ }, [
50353
+ toasts
50354
+ ]);
50355
+ ReactExports.useEffect(() => {
50356
+ const handleKeyDown = (event) => {
50357
+ var _listRef_current;
50358
+ const isHotkeyPressed = hotkey.every((key) => event[key] || event.code === key);
50359
+ if (isHotkeyPressed) {
50360
+ var _listRef_current1;
50361
+ setExpanded(true);
50362
+ (_listRef_current1 = listRef.current) == null ? void 0 : _listRef_current1.focus();
50363
+ }
50364
+ if (event.code === "Escape" && (document.activeElement === listRef.current || ((_listRef_current = listRef.current) == null ? void 0 : _listRef_current.contains(document.activeElement)))) {
50365
+ setExpanded(false);
50366
+ }
50367
+ };
50368
+ document.addEventListener("keydown", handleKeyDown);
50369
+ return () => document.removeEventListener("keydown", handleKeyDown);
50370
+ }, [
50371
+ hotkey
50372
+ ]);
50373
+ ReactExports.useEffect(() => {
50374
+ if (listRef.current) {
50375
+ return () => {
50376
+ if (lastFocusedElementRef.current) {
50377
+ lastFocusedElementRef.current.focus({
50378
+ preventScroll: true
50379
+ });
50380
+ lastFocusedElementRef.current = null;
50381
+ isFocusWithinRef.current = false;
50382
+ }
50383
+ };
50384
+ }
50385
+ }, [
50386
+ listRef.current
50387
+ ]);
50388
+ return (
50389
+ // Remove item from normal navigation flow, only available via hotkey
50390
+ /* @__PURE__ */ ReactExports.createElement("section", {
50391
+ ref,
50392
+ "aria-label": `${containerAriaLabel} ${hotkeyLabel}`,
50393
+ tabIndex: -1,
50394
+ "aria-live": "polite",
50395
+ "aria-relevant": "additions text",
50396
+ "aria-atomic": "false",
50397
+ suppressHydrationWarning: true
50398
+ }, possiblePositions.map((position3, index2) => {
50399
+ var _heights_;
50400
+ const [y2, x2] = position3.split("-");
50401
+ if (!filteredToasts.length) return null;
50402
+ return /* @__PURE__ */ ReactExports.createElement("ol", {
50403
+ key: position3,
50404
+ dir: dir === "auto" ? getDocumentDirection() : dir,
50405
+ tabIndex: -1,
50406
+ ref: listRef,
50407
+ className,
50408
+ "data-sonner-toaster": true,
50409
+ "data-sonner-theme": actualTheme,
50410
+ "data-y-position": y2,
50411
+ "data-x-position": x2,
50412
+ style: {
50413
+ "--front-toast-height": `${((_heights_ = heights[0]) == null ? void 0 : _heights_.height) || 0}px`,
50414
+ "--width": `${TOAST_WIDTH}px`,
50415
+ "--gap": `${gap}px`,
50416
+ ...style2,
50417
+ ...assignOffset(offset2, mobileOffset)
50418
+ },
50419
+ onBlur: (event) => {
50420
+ if (isFocusWithinRef.current && !event.currentTarget.contains(event.relatedTarget)) {
50421
+ isFocusWithinRef.current = false;
50422
+ if (lastFocusedElementRef.current) {
50423
+ lastFocusedElementRef.current.focus({
50424
+ preventScroll: true
50425
+ });
50426
+ lastFocusedElementRef.current = null;
50427
+ }
50428
+ }
50429
+ },
50430
+ onFocus: (event) => {
50431
+ const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === "false";
50432
+ if (isNotDismissible) return;
50433
+ if (!isFocusWithinRef.current) {
50434
+ isFocusWithinRef.current = true;
50435
+ lastFocusedElementRef.current = event.relatedTarget;
50436
+ }
50437
+ },
50438
+ onMouseEnter: () => setExpanded(true),
50439
+ onMouseMove: () => setExpanded(true),
50440
+ onMouseLeave: () => {
50441
+ if (!interacting) {
50442
+ setExpanded(false);
50443
+ }
50444
+ },
50445
+ onDragEnd: () => setExpanded(false),
50446
+ onPointerDown: (event) => {
50447
+ const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === "false";
50448
+ if (isNotDismissible) return;
50449
+ setInteracting(true);
50450
+ },
50451
+ onPointerUp: () => setInteracting(false)
50452
+ }, filteredToasts.filter((toast2) => !toast2.position && index2 === 0 || toast2.position === position3).map((toast2, index3) => {
50453
+ var _toastOptions_duration, _toastOptions_closeButton;
50454
+ return /* @__PURE__ */ ReactExports.createElement(Toast, {
50455
+ key: toast2.id,
50456
+ icons,
50457
+ index: index3,
50458
+ toast: toast2,
50459
+ defaultRichColors: richColors,
50460
+ duration: (_toastOptions_duration = toastOptions == null ? void 0 : toastOptions.duration) != null ? _toastOptions_duration : duration2,
50461
+ className: toastOptions == null ? void 0 : toastOptions.className,
50462
+ descriptionClassName: toastOptions == null ? void 0 : toastOptions.descriptionClassName,
50463
+ invert,
50464
+ visibleToasts,
50465
+ closeButton: (_toastOptions_closeButton = toastOptions == null ? void 0 : toastOptions.closeButton) != null ? _toastOptions_closeButton : closeButton,
50466
+ interacting,
50467
+ position: position3,
50468
+ style: toastOptions == null ? void 0 : toastOptions.style,
50469
+ unstyled: toastOptions == null ? void 0 : toastOptions.unstyled,
50470
+ classNames: toastOptions == null ? void 0 : toastOptions.classNames,
50471
+ cancelButtonStyle: toastOptions == null ? void 0 : toastOptions.cancelButtonStyle,
50472
+ actionButtonStyle: toastOptions == null ? void 0 : toastOptions.actionButtonStyle,
50473
+ closeButtonAriaLabel: toastOptions == null ? void 0 : toastOptions.closeButtonAriaLabel,
50474
+ removeToast,
50475
+ toasts: filteredToasts.filter((t) => t.position == toast2.position),
50476
+ heights: heights.filter((h2) => h2.position == toast2.position),
50477
+ setHeights,
50478
+ expandByDefault: expand2,
50479
+ gap,
50480
+ expanded: expanded2,
50481
+ swipeDirections: props.swipeDirections
50482
+ });
50483
+ }));
50484
+ }))
50485
+ );
50486
+ });
50487
+ const defaultAdapter = {
50488
+ success: (msg, opts) => toast.success(msg, opts),
50489
+ error: (msg, opts) => toast.error(msg, opts),
50490
+ info: (msg, opts) => toast.info(msg, opts)
50491
+ };
50492
+ const ToastContext = reactExports.createContext(defaultAdapter);
50493
+ function useToast() {
50494
+ return reactExports.useContext(ToastContext);
50495
+ }
49375
50496
  var __create = Object.create;
49376
50497
  var __defProp2 = Object.defineProperty;
49377
50498
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -50005,1512 +51126,423 @@ var ObjectValue = ({ object: object2, styles: styles2 }) => {
50005
51126
  }
50006
51127
  };
50007
51128
  var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
50008
- var propertyIsEnumerable = Object.prototype.propertyIsEnumerable;
50009
- function getPropertyValue(object2, propertyName) {
50010
- const propertyDescriptor = Object.getOwnPropertyDescriptor(object2, propertyName);
50011
- if (propertyDescriptor.get) {
50012
- try {
50013
- return propertyDescriptor.get();
50014
- } catch {
50015
- return propertyDescriptor.get;
50016
- }
50017
- }
50018
- return object2[propertyName];
50019
- }
50020
- function intersperse(arr, sep2) {
50021
- if (arr.length === 0) {
50022
- return [];
50023
- }
50024
- return arr.slice(1).reduce((xs, x2) => xs.concat([sep2, x2]), [arr[0]]);
50025
- }
50026
- var ObjectPreview = ({ data }) => {
50027
- const styles2 = useStyles("ObjectPreview");
50028
- const object2 = data;
50029
- if (typeof object2 !== "object" || object2 === null || object2 instanceof Date || object2 instanceof RegExp) {
50030
- return /* @__PURE__ */ ReactExports.createElement(ObjectValue, { object: object2 });
50031
- }
50032
- if (Array.isArray(object2)) {
50033
- const maxProperties = styles2.arrayMaxProperties;
50034
- const previewArray = object2.slice(0, maxProperties).map((element2, index2) => /* @__PURE__ */ ReactExports.createElement(ObjectValue, { key: index2, object: element2 }));
50035
- if (object2.length > maxProperties) {
50036
- previewArray.push(/* @__PURE__ */ ReactExports.createElement("span", { key: "ellipsis" }, "…"));
50037
- }
50038
- const arrayLength = object2.length;
50039
- return /* @__PURE__ */ ReactExports.createElement(ReactExports.Fragment, null, /* @__PURE__ */ ReactExports.createElement("span", { style: styles2.objectDescription }, arrayLength === 0 ? `` : `(${arrayLength}) `), /* @__PURE__ */ ReactExports.createElement("span", { style: styles2.preview }, "[", intersperse(previewArray, ", "), "]"));
50040
- } else {
50041
- const maxProperties = styles2.objectMaxProperties;
50042
- const propertyNodes = [];
50043
- for (const propertyName in object2) {
50044
- if (hasOwnProperty$1.call(object2, propertyName)) {
50045
- let ellipsis;
50046
- if (propertyNodes.length === maxProperties - 1 && Object.keys(object2).length > maxProperties) {
50047
- ellipsis = /* @__PURE__ */ ReactExports.createElement("span", { key: "ellipsis" }, "…");
50048
- }
50049
- const propertyValue2 = getPropertyValue(object2, propertyName);
50050
- propertyNodes.push(
50051
- /* @__PURE__ */ ReactExports.createElement("span", { key: propertyName }, /* @__PURE__ */ ReactExports.createElement(ObjectName, { name: propertyName || `""` }), ": ", /* @__PURE__ */ ReactExports.createElement(ObjectValue, { object: propertyValue2 }), ellipsis)
50052
- );
50053
- if (ellipsis) break;
50054
- }
50055
- }
50056
- const objectConstructorName = object2.constructor ? object2.constructor.name : "Object";
50057
- return /* @__PURE__ */ ReactExports.createElement(ReactExports.Fragment, null, /* @__PURE__ */ ReactExports.createElement("span", { style: styles2.objectDescription }, objectConstructorName === "Object" ? "" : `${objectConstructorName} `), /* @__PURE__ */ ReactExports.createElement("span", { style: styles2.preview }, "{", intersperse(propertyNodes, ", "), "}"));
50058
- }
50059
- };
50060
- var ObjectRootLabel = ({ name: name2, data }) => {
50061
- if (typeof name2 === "string") {
50062
- return /* @__PURE__ */ ReactExports.createElement("span", null, /* @__PURE__ */ ReactExports.createElement(ObjectName, { name: name2 }), /* @__PURE__ */ ReactExports.createElement("span", null, ": "), /* @__PURE__ */ ReactExports.createElement(ObjectPreview, { data }));
50063
- } else {
50064
- return /* @__PURE__ */ ReactExports.createElement(ObjectPreview, { data });
50065
- }
50066
- };
50067
- var ObjectLabel = ({ name: name2, data, isNonenumerable = false }) => {
50068
- const object2 = data;
50069
- return /* @__PURE__ */ ReactExports.createElement("span", null, typeof name2 === "string" ? /* @__PURE__ */ ReactExports.createElement(ObjectName, { name: name2, dimmed: isNonenumerable }) : /* @__PURE__ */ ReactExports.createElement(ObjectPreview, { data: name2 }), /* @__PURE__ */ ReactExports.createElement("span", null, ": "), /* @__PURE__ */ ReactExports.createElement(ObjectValue, { object: object2 }));
50070
- };
50071
- var createIterator = (showNonenumerable, sortObjectKeys) => {
50072
- const objectIterator = function* (data) {
50073
- const shouldIterate = typeof data === "object" && data !== null || typeof data === "function";
50074
- if (!shouldIterate) return;
50075
- const dataIsArray = Array.isArray(data);
50076
- if (!dataIsArray && data[Symbol.iterator]) {
50077
- let i = 0;
50078
- for (const entry2 of data) {
50079
- if (Array.isArray(entry2) && entry2.length === 2) {
50080
- const [k2, v2] = entry2;
50081
- yield {
50082
- name: k2,
50083
- data: v2
50084
- };
50085
- } else {
50086
- yield {
50087
- name: i.toString(),
50088
- data: entry2
50089
- };
50090
- }
50091
- i++;
50092
- }
50093
- } else {
50094
- const keys2 = Object.getOwnPropertyNames(data);
50095
- if (sortObjectKeys === true && !dataIsArray) {
50096
- keys2.sort();
50097
- } else if (typeof sortObjectKeys === "function") {
50098
- keys2.sort(sortObjectKeys);
50099
- }
50100
- for (const propertyName of keys2) {
50101
- if (propertyIsEnumerable.call(data, propertyName)) {
50102
- const propertyValue2 = getPropertyValue(data, propertyName);
50103
- yield {
50104
- name: propertyName || `""`,
50105
- data: propertyValue2
50106
- };
50107
- } else if (showNonenumerable) {
50108
- let propertyValue2;
50109
- try {
50110
- propertyValue2 = getPropertyValue(data, propertyName);
50111
- } catch (e) {
50112
- }
50113
- if (propertyValue2 !== void 0) {
50114
- yield {
50115
- name: propertyName,
50116
- data: propertyValue2,
50117
- isNonenumerable: true
50118
- };
50119
- }
50120
- }
50121
- }
50122
- if (showNonenumerable && data !== Object.prototype) {
50123
- yield {
50124
- name: "__proto__",
50125
- data: Object.getPrototypeOf(data),
50126
- isNonenumerable: true
50127
- };
50128
- }
50129
- }
50130
- };
50131
- return objectIterator;
50132
- };
50133
- var defaultNodeRenderer = ({ depth, name: name2, data, isNonenumerable }) => depth === 0 ? /* @__PURE__ */ ReactExports.createElement(ObjectRootLabel, { name: name2, data }) : /* @__PURE__ */ ReactExports.createElement(ObjectLabel, { name: name2, data, isNonenumerable });
50134
- var ObjectInspector = ({ showNonenumerable = false, sortObjectKeys, nodeRenderer, ...treeViewProps }) => {
50135
- const dataIterator = createIterator(showNonenumerable, sortObjectKeys);
50136
- const renderer = nodeRenderer ? nodeRenderer : defaultNodeRenderer;
50137
- return /* @__PURE__ */ ReactExports.createElement(TreeView, { nodeRenderer: renderer, dataIterator, ...treeViewProps });
50138
- };
50139
- var themedObjectInspector = themeAcceptor(ObjectInspector);
50140
- __toESM(require_is_dom());
50141
- const useDarkMode = () => {
50142
- const [isDark, setIsDark] = reactExports.useState(() => {
50143
- if (typeof document === "undefined")
50144
- return false;
50145
- return document.documentElement.classList.contains("dark");
50146
- });
50147
- reactExports.useEffect(() => {
50148
- if (typeof document === "undefined")
50149
- return;
50150
- const observer = new MutationObserver(() => {
50151
- setIsDark(document.documentElement.classList.contains("dark"));
50152
- });
50153
- observer.observe(document.documentElement, {
50154
- attributes: true,
50155
- attributeFilter: ["class"]
50156
- });
50157
- return () => observer.disconnect();
50158
- }, []);
50159
- return isDark;
50160
- };
50161
- const inspectorThemeExtendedLight = {
50162
- OBJECT_VALUE_DATE_COLOR: "#a21caf"
50163
- // fuchsia-700
50164
- };
50165
- const inspectorThemeExtendedDark = {
50166
- OBJECT_VALUE_DATE_COLOR: "#e879f9"
50167
- // fuchsia-400
50168
- };
50169
- const shared = {
50170
- BASE_FONT_SIZE: "11px",
50171
- BASE_LINE_HEIGHT: 1.4,
50172
- BASE_BACKGROUND_COLOR: "transparent",
50173
- OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES: 10,
50174
- OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES: 5,
50175
- HTML_TAGNAME_TEXT_TRANSFORM: "lowercase",
50176
- ARROW_MARGIN_RIGHT: 3,
50177
- ARROW_FONT_SIZE: 12,
50178
- TREENODE_FONT_FAMILY: "var(--font-mono)",
50179
- TREENODE_FONT_SIZE: "11px",
50180
- TREENODE_LINE_HEIGHT: 1.4,
50181
- TREENODE_PADDING_LEFT: 12,
50182
- TABLE_DATA_BACKGROUND_IMAGE: "none",
50183
- TABLE_DATA_BACKGROUND_SIZE: "0"
50184
- };
50185
- const inspectorThemeLight = {
50186
- ...shared,
50187
- // Base text
50188
- BASE_COLOR: "var(--ds-gray-1000)",
50189
- // Property names — unstyled, same as base foreground (Node: no style)
50190
- OBJECT_NAME_COLOR: "var(--ds-gray-900)",
50191
- // Strings & symbols — green (Node: 'green')
50192
- OBJECT_VALUE_STRING_COLOR: "#16a34a",
50193
- // green-600
50194
- OBJECT_VALUE_SYMBOL_COLOR: "#16a34a",
50195
- // Numbers & booleans — yellow/amber (Node: 'yellow')
50196
- OBJECT_VALUE_NUMBER_COLOR: "#b45309",
50197
- // amber-700 (readable on white)
50198
- OBJECT_VALUE_BOOLEAN_COLOR: "#b45309",
50199
- // null — bold foreground (Node: 'bold')
50200
- OBJECT_VALUE_NULL_COLOR: "var(--ds-gray-900)",
50201
- // undefined — grey (Node: 'grey')
50202
- OBJECT_VALUE_UNDEFINED_COLOR: "var(--ds-gray-500)",
50203
- // RegExp — red (Node regexp base uses green/red/yellow palette)
50204
- OBJECT_VALUE_REGEXP_COLOR: "#dc2626",
50205
- // red-600
50206
- // Functions — cyan (Node: 'special' → 'cyan')
50207
- OBJECT_VALUE_FUNCTION_PREFIX_COLOR: "#0891b2",
50208
- // cyan-600
50209
- // HTML (less relevant for data inspection, but reasonable defaults)
50210
- HTML_TAG_COLOR: "var(--ds-gray-500)",
50211
- HTML_TAGNAME_COLOR: "#0891b2",
50212
- HTML_ATTRIBUTE_NAME_COLOR: "#b45309",
50213
- HTML_ATTRIBUTE_VALUE_COLOR: "#16a34a",
50214
- HTML_COMMENT_COLOR: "var(--ds-gray-400)",
50215
- HTML_DOCTYPE_COLOR: "var(--ds-gray-400)",
50216
- // Structural
50217
- ARROW_COLOR: "var(--ds-gray-500)",
50218
- TABLE_BORDER_COLOR: "var(--ds-gray-300)",
50219
- TABLE_TH_BACKGROUND_COLOR: "var(--ds-gray-100)",
50220
- TABLE_TH_HOVER_COLOR: "var(--ds-gray-200)",
50221
- TABLE_SORT_ICON_COLOR: "var(--ds-gray-500)"
50222
- };
50223
- const inspectorThemeDark = {
50224
- ...shared,
50225
- // Base text
50226
- BASE_COLOR: "var(--ds-gray-1000)",
50227
- // Property names — white/light foreground (Node: unstyled = white in dark terminal)
50228
- OBJECT_NAME_COLOR: "var(--ds-gray-900)",
50229
- // Strings & symbols — green (Node: 'green')
50230
- OBJECT_VALUE_STRING_COLOR: "#4ade80",
50231
- // green-400
50232
- OBJECT_VALUE_SYMBOL_COLOR: "#4ade80",
50233
- // Numbers & booleans — yellow (Node: 'yellow')
50234
- OBJECT_VALUE_NUMBER_COLOR: "#facc15",
50235
- // yellow-400
50236
- OBJECT_VALUE_BOOLEAN_COLOR: "#facc15",
50237
- // null — bold foreground / white (Node: 'bold')
50238
- OBJECT_VALUE_NULL_COLOR: "var(--ds-gray-1000)",
50239
- // undefined — grey (Node: 'grey')
50240
- OBJECT_VALUE_UNDEFINED_COLOR: "var(--ds-gray-500)",
50241
- // RegExp — red (Node regexp palette)
50242
- OBJECT_VALUE_REGEXP_COLOR: "#f87171",
50243
- // red-400
50244
- // Functions — cyan (Node: 'special' → 'cyan')
50245
- OBJECT_VALUE_FUNCTION_PREFIX_COLOR: "#22d3ee",
50246
- // cyan-400
50247
- // HTML
50248
- HTML_TAG_COLOR: "var(--ds-gray-500)",
50249
- HTML_TAGNAME_COLOR: "#22d3ee",
50250
- HTML_ATTRIBUTE_NAME_COLOR: "#facc15",
50251
- HTML_ATTRIBUTE_VALUE_COLOR: "#4ade80",
50252
- HTML_COMMENT_COLOR: "var(--ds-gray-500)",
50253
- HTML_DOCTYPE_COLOR: "var(--ds-gray-500)",
50254
- // Structural
50255
- ARROW_COLOR: "var(--ds-gray-500)",
50256
- TABLE_BORDER_COLOR: "var(--ds-gray-300)",
50257
- TABLE_TH_BACKGROUND_COLOR: "var(--ds-gray-100)",
50258
- TABLE_TH_HOVER_COLOR: "var(--ds-gray-200)",
50259
- TABLE_SORT_ICON_COLOR: "var(--ds-gray-500)"
50260
- };
50261
- const STREAM_REF_TYPE = "__workflow_stream_ref__";
50262
- const CLASS_INSTANCE_REF_TYPE = "__workflow_class_instance_ref__";
50263
- function isStreamRef(value) {
50264
- return value !== null && typeof value === "object" && "__type" in value && value.__type === STREAM_REF_TYPE;
50265
- }
50266
- function isClassInstanceRef(value) {
50267
- return value !== null && typeof value === "object" && "__type" in value && value.__type === CLASS_INSTANCE_REF_TYPE;
50268
- }
50269
- const StreamClickContext = reactExports.createContext(void 0);
50270
- const DecryptClickContext = reactExports.createContext(void 0);
50271
- function EncryptedInlineLabel() {
50272
- const ctx = reactExports.useContext(DecryptClickContext);
50273
- if (ctx) {
50274
- return jsxRuntimeExports.jsxs("button", { type: "button", className: "inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[11px] cursor-pointer", style: {
50275
- backgroundColor: "var(--ds-gray-100)",
50276
- color: "var(--ds-gray-700)",
50277
- border: "1px solid var(--ds-gray-400)",
50278
- fontStyle: "italic",
50279
- opacity: ctx.isDecrypting ? 0.6 : 1
50280
- }, disabled: ctx.isDecrypting, onClick: (e) => {
50281
- e.stopPropagation();
50282
- ctx.onDecrypt();
50283
- }, title: "Click to decrypt", children: [ctx.isDecrypting ? jsxRuntimeExports.jsx(Spinner, { size: 12 }) : jsxRuntimeExports.jsx(Lock, { className: "h-3 w-3", style: { display: "inline", flexShrink: 0 } }), jsxRuntimeExports.jsx("span", { children: ctx.isDecrypting ? "Decrypting…" : "Decrypt" })] });
50284
- }
50285
- return jsxRuntimeExports.jsxs("span", { style: { color: "var(--ds-gray-600)", fontStyle: "italic" }, children: [jsxRuntimeExports.jsx(Lock, { className: "h-3 w-3", style: {
50286
- display: "inline",
50287
- verticalAlign: "middle",
50288
- marginRight: "3px",
50289
- marginTop: "-1px"
50290
- } }), "Encrypted"] });
50291
- }
50292
- function StreamRefInline({ streamRef }) {
50293
- const onStreamClick = reactExports.useContext(StreamClickContext);
50294
- return jsxRuntimeExports.jsxs("button", { type: "button", className: "inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-mono cursor-pointer", style: {
50295
- backgroundColor: "var(--ds-blue-100)",
50296
- color: "var(--ds-blue-800)",
50297
- border: "1px solid var(--ds-blue-300)"
50298
- }, onClick: () => onStreamClick == null ? void 0 : onStreamClick(streamRef.streamId), title: `View stream: ${streamRef.streamId}`, children: [jsxRuntimeExports.jsx("span", { children: "📡" }), jsxRuntimeExports.jsx("span", { children: streamRef.streamId })] });
50299
- }
50300
- const ExtendedThemeContext = reactExports.createContext(inspectorThemeExtendedLight);
50301
- function NodeRenderer$1({ depth, name: name2, data, isNonenumerable }) {
50302
- var _a3;
50303
- const extendedTheme = reactExports.useContext(ExtendedThemeContext);
50304
- if (data !== null && typeof data === "object" && ((_a3 = data.constructor) == null ? void 0 : _a3.name) === ENCRYPTED_DISPLAY_NAME) {
50305
- const label = jsxRuntimeExports.jsx(EncryptedInlineLabel, {});
50306
- if (depth === 0) {
50307
- return label;
50308
- }
50309
- return jsxRuntimeExports.jsxs("span", { children: [name2 != null && jsxRuntimeExports.jsx(ObjectName, { name: name2 }), name2 != null && jsxRuntimeExports.jsx("span", { children: ": " }), label] });
50310
- }
50311
- if (isStreamRef(data)) {
50312
- return jsxRuntimeExports.jsxs("span", { children: [name2 != null && jsxRuntimeExports.jsx(ObjectName, { name: name2 }), name2 != null && jsxRuntimeExports.jsx("span", { children: ": " }), jsxRuntimeExports.jsx(StreamRefInline, { streamRef: data })] });
50313
- }
50314
- if (isClassInstanceRef(data)) {
50315
- if (depth === 0) {
50316
- return jsxRuntimeExports.jsx(ObjectRootLabel, { name: data.className, data: data.data });
50317
- }
50318
- return jsxRuntimeExports.jsxs("span", { children: [name2 != null && jsxRuntimeExports.jsx(ObjectName, { name: name2 }), name2 != null && jsxRuntimeExports.jsx("span", { children: ": " }), jsxRuntimeExports.jsxs("span", { style: { fontStyle: "italic" }, children: [data.className, " "] }), jsxRuntimeExports.jsx(ObjectValue, { object: data.data })] });
50319
- }
50320
- if (data instanceof Date) {
50321
- const dateStr = data.toISOString();
50322
- if (depth === 0) {
50323
- return jsxRuntimeExports.jsx("span", { style: { color: extendedTheme.OBJECT_VALUE_DATE_COLOR }, children: dateStr });
50324
- }
50325
- return jsxRuntimeExports.jsxs("span", { children: [name2 != null && jsxRuntimeExports.jsx(ObjectName, { name: name2 }), name2 != null && jsxRuntimeExports.jsx("span", { children: ": " }), jsxRuntimeExports.jsx("span", { style: { color: extendedTheme.OBJECT_VALUE_DATE_COLOR }, children: dateStr })] });
50326
- }
50327
- if (depth === 0) {
50328
- return jsxRuntimeExports.jsx(ObjectRootLabel, { name: name2, data });
50329
- }
50330
- return jsxRuntimeExports.jsx(ObjectLabel, { name: name2, data, isNonenumerable });
50331
- }
50332
- function DataInspector({ data, expandLevel = 2, name: name2, onStreamClick, onDecrypt, isDecrypting = false }) {
50333
- const stableData = useStableInspectorData(data);
50334
- const [initialExpandLevel, setInitialExpandLevel] = reactExports.useState(expandLevel);
50335
- const isDark = useDarkMode();
50336
- const extendedTheme = isDark ? inspectorThemeExtendedDark : inspectorThemeExtendedLight;
50337
- reactExports.useEffect(() => {
50338
- setInitialExpandLevel(0);
50339
- }, []);
50340
- const content2 = jsxRuntimeExports.jsx(ExtendedThemeContext.Provider, { value: extendedTheme, children: jsxRuntimeExports.jsx(themedObjectInspector, {
50341
- data: stableData,
50342
- name: name2,
50343
- // @ts-expect-error react-inspector accepts theme objects at runtime despite
50344
- // types declaring string only — see https://github.com/storybookjs/react-inspector/blob/main/README.md#theme
50345
- theme: isDark ? inspectorThemeDark : inspectorThemeLight,
50346
- expandLevel: initialExpandLevel,
50347
- nodeRenderer: NodeRenderer$1
50348
- }) });
50349
- let wrapped = content2;
50350
- if (onStreamClick) {
50351
- wrapped = jsxRuntimeExports.jsx(StreamClickContext.Provider, { value: onStreamClick, children: wrapped });
50352
- }
50353
- if (onDecrypt) {
50354
- wrapped = jsxRuntimeExports.jsx(DecryptClickContext.Provider, { value: { onDecrypt, isDecrypting }, children: wrapped });
50355
- }
50356
- return wrapped;
50357
- }
50358
- function useStableInspectorData(next2) {
50359
- const previousRef = reactExports.useRef(next2);
50360
- if (!isDeepEqual(previousRef.current, next2)) {
50361
- previousRef.current = next2;
50362
- }
50363
- return previousRef.current;
50364
- }
50365
- function isObjectLike(value) {
50366
- return typeof value === "object" && value !== null;
50367
- }
50368
- function isDeepEqual(a2, b2, seen = /* @__PURE__ */ new WeakMap()) {
50369
- if (Object.is(a2, b2))
50370
- return true;
50371
- if (a2 instanceof Date && b2 instanceof Date) {
50372
- return a2.getTime() === b2.getTime();
50373
- }
50374
- if (a2 instanceof RegExp && b2 instanceof RegExp) {
50375
- return a2.source === b2.source && a2.flags === b2.flags;
50376
- }
50377
- if (a2 instanceof Map && b2 instanceof Map) {
50378
- if (a2.size !== b2.size)
50379
- return false;
50380
- for (const [key, value] of a2.entries()) {
50381
- if (!b2.has(key) || !isDeepEqual(value, b2.get(key), seen))
50382
- return false;
50383
- }
50384
- return true;
50385
- }
50386
- if (a2 instanceof Set && b2 instanceof Set) {
50387
- if (a2.size !== b2.size)
50388
- return false;
50389
- for (const value of a2.values()) {
50390
- if (!b2.has(value))
50391
- return false;
50392
- }
50393
- return true;
50394
- }
50395
- if (!isObjectLike(a2) || !isObjectLike(b2)) {
50396
- return false;
50397
- }
50398
- if (seen.get(a2) === b2)
50399
- return true;
50400
- seen.set(a2, b2);
50401
- const aIsArray = Array.isArray(a2);
50402
- const bIsArray = Array.isArray(b2);
50403
- if (aIsArray !== bIsArray)
50404
- return false;
50405
- if (aIsArray && bIsArray) {
50406
- if (a2.length !== b2.length)
50407
- return false;
50408
- for (let i = 0; i < a2.length; i += 1) {
50409
- if (!isDeepEqual(a2[i], b2[i], seen))
50410
- return false;
50411
- }
50412
- return true;
50413
- }
50414
- const aKeys = Object.keys(a2);
50415
- const bKeys = Object.keys(b2);
50416
- if (aKeys.length !== bKeys.length)
50417
- return false;
50418
- for (const key of aKeys) {
50419
- if (!Object.hasOwn(b2, key))
50420
- return false;
50421
- if (!isDeepEqual(a2[key], b2[key], seen))
50422
- return false;
50423
- }
50424
- return true;
50425
- }
50426
- function __insertCSS(code2) {
50427
- if (typeof document == "undefined") return;
50428
- let head = document.head || document.getElementsByTagName("head")[0];
50429
- let style2 = document.createElement("style");
50430
- style2.type = "text/css";
50431
- head.appendChild(style2);
50432
- style2.styleSheet ? style2.styleSheet.cssText = code2 : style2.appendChild(document.createTextNode(code2));
50433
- }
50434
- const getAsset = (type) => {
50435
- switch (type) {
50436
- case "success":
50437
- return SuccessIcon;
50438
- case "info":
50439
- return InfoIcon;
50440
- case "warning":
50441
- return WarningIcon;
50442
- case "error":
50443
- return ErrorIcon;
50444
- default:
50445
- return null;
50446
- }
50447
- };
50448
- const bars = Array(12).fill(0);
50449
- const Loader = ({ visible, className }) => {
50450
- return /* @__PURE__ */ ReactExports.createElement("div", {
50451
- className: [
50452
- "sonner-loading-wrapper",
50453
- className
50454
- ].filter(Boolean).join(" "),
50455
- "data-visible": visible
50456
- }, /* @__PURE__ */ ReactExports.createElement("div", {
50457
- className: "sonner-spinner"
50458
- }, bars.map((_2, i) => /* @__PURE__ */ ReactExports.createElement("div", {
50459
- className: "sonner-loading-bar",
50460
- key: `spinner-bar-${i}`
50461
- }))));
50462
- };
50463
- const SuccessIcon = /* @__PURE__ */ ReactExports.createElement("svg", {
50464
- xmlns: "http://www.w3.org/2000/svg",
50465
- viewBox: "0 0 20 20",
50466
- fill: "currentColor",
50467
- height: "20",
50468
- width: "20"
50469
- }, /* @__PURE__ */ ReactExports.createElement("path", {
50470
- fillRule: "evenodd",
50471
- d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",
50472
- clipRule: "evenodd"
50473
- }));
50474
- const WarningIcon = /* @__PURE__ */ ReactExports.createElement("svg", {
50475
- xmlns: "http://www.w3.org/2000/svg",
50476
- viewBox: "0 0 24 24",
50477
- fill: "currentColor",
50478
- height: "20",
50479
- width: "20"
50480
- }, /* @__PURE__ */ ReactExports.createElement("path", {
50481
- fillRule: "evenodd",
50482
- d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",
50483
- clipRule: "evenodd"
50484
- }));
50485
- const InfoIcon = /* @__PURE__ */ ReactExports.createElement("svg", {
50486
- xmlns: "http://www.w3.org/2000/svg",
50487
- viewBox: "0 0 20 20",
50488
- fill: "currentColor",
50489
- height: "20",
50490
- width: "20"
50491
- }, /* @__PURE__ */ ReactExports.createElement("path", {
50492
- fillRule: "evenodd",
50493
- d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",
50494
- clipRule: "evenodd"
50495
- }));
50496
- const ErrorIcon = /* @__PURE__ */ ReactExports.createElement("svg", {
50497
- xmlns: "http://www.w3.org/2000/svg",
50498
- viewBox: "0 0 20 20",
50499
- fill: "currentColor",
50500
- height: "20",
50501
- width: "20"
50502
- }, /* @__PURE__ */ ReactExports.createElement("path", {
50503
- fillRule: "evenodd",
50504
- d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",
50505
- clipRule: "evenodd"
50506
- }));
50507
- const CloseIcon = /* @__PURE__ */ ReactExports.createElement("svg", {
50508
- xmlns: "http://www.w3.org/2000/svg",
50509
- width: "12",
50510
- height: "12",
50511
- viewBox: "0 0 24 24",
50512
- fill: "none",
50513
- stroke: "currentColor",
50514
- strokeWidth: "1.5",
50515
- strokeLinecap: "round",
50516
- strokeLinejoin: "round"
50517
- }, /* @__PURE__ */ ReactExports.createElement("line", {
50518
- x1: "18",
50519
- y1: "6",
50520
- x2: "6",
50521
- y2: "18"
50522
- }), /* @__PURE__ */ ReactExports.createElement("line", {
50523
- x1: "6",
50524
- y1: "6",
50525
- x2: "18",
50526
- y2: "18"
50527
- }));
50528
- const useIsDocumentHidden = () => {
50529
- const [isDocumentHidden, setIsDocumentHidden] = ReactExports.useState(document.hidden);
50530
- ReactExports.useEffect(() => {
50531
- const callback = () => {
50532
- setIsDocumentHidden(document.hidden);
50533
- };
50534
- document.addEventListener("visibilitychange", callback);
50535
- return () => window.removeEventListener("visibilitychange", callback);
50536
- }, []);
50537
- return isDocumentHidden;
50538
- };
50539
- let toastsCounter = 1;
50540
- class Observer {
50541
- constructor() {
50542
- this.subscribe = (subscriber) => {
50543
- this.subscribers.push(subscriber);
50544
- return () => {
50545
- const index2 = this.subscribers.indexOf(subscriber);
50546
- this.subscribers.splice(index2, 1);
50547
- };
50548
- };
50549
- this.publish = (data) => {
50550
- this.subscribers.forEach((subscriber) => subscriber(data));
50551
- };
50552
- this.addToast = (data) => {
50553
- this.publish(data);
50554
- this.toasts = [
50555
- ...this.toasts,
50556
- data
50557
- ];
50558
- };
50559
- this.create = (data) => {
50560
- var _data_id;
50561
- const { message: message2, ...rest } = data;
50562
- const id2 = typeof (data == null ? void 0 : data.id) === "number" || ((_data_id = data.id) == null ? void 0 : _data_id.length) > 0 ? data.id : toastsCounter++;
50563
- const alreadyExists = this.toasts.find((toast2) => {
50564
- return toast2.id === id2;
50565
- });
50566
- const dismissible = data.dismissible === void 0 ? true : data.dismissible;
50567
- if (this.dismissedToasts.has(id2)) {
50568
- this.dismissedToasts.delete(id2);
50569
- }
50570
- if (alreadyExists) {
50571
- this.toasts = this.toasts.map((toast2) => {
50572
- if (toast2.id === id2) {
50573
- this.publish({
50574
- ...toast2,
50575
- ...data,
50576
- id: id2,
50577
- title: message2
50578
- });
50579
- return {
50580
- ...toast2,
50581
- ...data,
50582
- id: id2,
50583
- dismissible,
50584
- title: message2
50585
- };
50586
- }
50587
- return toast2;
50588
- });
50589
- } else {
50590
- this.addToast({
50591
- title: message2,
50592
- ...rest,
50593
- dismissible,
50594
- id: id2
50595
- });
50596
- }
50597
- return id2;
50598
- };
50599
- this.dismiss = (id2) => {
50600
- if (id2) {
50601
- this.dismissedToasts.add(id2);
50602
- requestAnimationFrame(() => this.subscribers.forEach((subscriber) => subscriber({
50603
- id: id2,
50604
- dismiss: true
50605
- })));
50606
- } else {
50607
- this.toasts.forEach((toast2) => {
50608
- this.subscribers.forEach((subscriber) => subscriber({
50609
- id: toast2.id,
50610
- dismiss: true
50611
- }));
50612
- });
50613
- }
50614
- return id2;
50615
- };
50616
- this.message = (message2, data) => {
50617
- return this.create({
50618
- ...data,
50619
- message: message2
50620
- });
50621
- };
50622
- this.error = (message2, data) => {
50623
- return this.create({
50624
- ...data,
50625
- message: message2,
50626
- type: "error"
50627
- });
50628
- };
50629
- this.success = (message2, data) => {
50630
- return this.create({
50631
- ...data,
50632
- type: "success",
50633
- message: message2
50634
- });
50635
- };
50636
- this.info = (message2, data) => {
50637
- return this.create({
50638
- ...data,
50639
- type: "info",
50640
- message: message2
50641
- });
50642
- };
50643
- this.warning = (message2, data) => {
50644
- return this.create({
50645
- ...data,
50646
- type: "warning",
50647
- message: message2
50648
- });
50649
- };
50650
- this.loading = (message2, data) => {
50651
- return this.create({
50652
- ...data,
50653
- type: "loading",
50654
- message: message2
50655
- });
50656
- };
50657
- this.promise = (promise2, data) => {
50658
- if (!data) {
50659
- return;
50660
- }
50661
- let id2 = void 0;
50662
- if (data.loading !== void 0) {
50663
- id2 = this.create({
50664
- ...data,
50665
- promise: promise2,
50666
- type: "loading",
50667
- message: data.loading,
50668
- description: typeof data.description !== "function" ? data.description : void 0
50669
- });
50670
- }
50671
- const p2 = Promise.resolve(promise2 instanceof Function ? promise2() : promise2);
50672
- let shouldDismiss = id2 !== void 0;
50673
- let result;
50674
- const originalPromise = p2.then(async (response2) => {
50675
- result = [
50676
- "resolve",
50677
- response2
50678
- ];
50679
- const isReactElementResponse = ReactExports.isValidElement(response2);
50680
- if (isReactElementResponse) {
50681
- shouldDismiss = false;
50682
- this.create({
50683
- id: id2,
50684
- type: "default",
50685
- message: response2
50686
- });
50687
- } else if (isHttpResponse(response2) && !response2.ok) {
50688
- shouldDismiss = false;
50689
- const promiseData = typeof data.error === "function" ? await data.error(`HTTP error! status: ${response2.status}`) : data.error;
50690
- const description = typeof data.description === "function" ? await data.description(`HTTP error! status: ${response2.status}`) : data.description;
50691
- const isExtendedResult = typeof promiseData === "object" && !ReactExports.isValidElement(promiseData);
50692
- const toastSettings = isExtendedResult ? promiseData : {
50693
- message: promiseData
50694
- };
50695
- this.create({
50696
- id: id2,
50697
- type: "error",
50698
- description,
50699
- ...toastSettings
50700
- });
50701
- } else if (response2 instanceof Error) {
50702
- shouldDismiss = false;
50703
- const promiseData = typeof data.error === "function" ? await data.error(response2) : data.error;
50704
- const description = typeof data.description === "function" ? await data.description(response2) : data.description;
50705
- const isExtendedResult = typeof promiseData === "object" && !ReactExports.isValidElement(promiseData);
50706
- const toastSettings = isExtendedResult ? promiseData : {
50707
- message: promiseData
50708
- };
50709
- this.create({
50710
- id: id2,
50711
- type: "error",
50712
- description,
50713
- ...toastSettings
50714
- });
50715
- } else if (data.success !== void 0) {
50716
- shouldDismiss = false;
50717
- const promiseData = typeof data.success === "function" ? await data.success(response2) : data.success;
50718
- const description = typeof data.description === "function" ? await data.description(response2) : data.description;
50719
- const isExtendedResult = typeof promiseData === "object" && !ReactExports.isValidElement(promiseData);
50720
- const toastSettings = isExtendedResult ? promiseData : {
50721
- message: promiseData
50722
- };
50723
- this.create({
50724
- id: id2,
50725
- type: "success",
50726
- description,
50727
- ...toastSettings
50728
- });
50729
- }
50730
- }).catch(async (error2) => {
50731
- result = [
50732
- "reject",
50733
- error2
50734
- ];
50735
- if (data.error !== void 0) {
50736
- shouldDismiss = false;
50737
- const promiseData = typeof data.error === "function" ? await data.error(error2) : data.error;
50738
- const description = typeof data.description === "function" ? await data.description(error2) : data.description;
50739
- const isExtendedResult = typeof promiseData === "object" && !ReactExports.isValidElement(promiseData);
50740
- const toastSettings = isExtendedResult ? promiseData : {
50741
- message: promiseData
50742
- };
50743
- this.create({
50744
- id: id2,
50745
- type: "error",
50746
- description,
50747
- ...toastSettings
50748
- });
50749
- }
50750
- }).finally(() => {
50751
- if (shouldDismiss) {
50752
- this.dismiss(id2);
50753
- id2 = void 0;
50754
- }
50755
- data.finally == null ? void 0 : data.finally.call(data);
50756
- });
50757
- const unwrap = () => new Promise((resolve2, reject) => originalPromise.then(() => result[0] === "reject" ? reject(result[1]) : resolve2(result[1])).catch(reject));
50758
- if (typeof id2 !== "string" && typeof id2 !== "number") {
50759
- return {
50760
- unwrap
50761
- };
50762
- } else {
50763
- return Object.assign(id2, {
50764
- unwrap
50765
- });
50766
- }
50767
- };
50768
- this.custom = (jsx, data) => {
50769
- const id2 = (data == null ? void 0 : data.id) || toastsCounter++;
50770
- this.create({
50771
- jsx: jsx(id2),
50772
- id: id2,
50773
- ...data
50774
- });
50775
- return id2;
50776
- };
50777
- this.getActiveToasts = () => {
50778
- return this.toasts.filter((toast2) => !this.dismissedToasts.has(toast2.id));
50779
- };
50780
- this.subscribers = [];
50781
- this.toasts = [];
50782
- this.dismissedToasts = /* @__PURE__ */ new Set();
50783
- }
50784
- }
50785
- const ToastState = new Observer();
50786
- const toastFunction = (message2, data) => {
50787
- const id2 = (data == null ? void 0 : data.id) || toastsCounter++;
50788
- ToastState.addToast({
50789
- title: message2,
50790
- ...data,
50791
- id: id2
50792
- });
50793
- return id2;
50794
- };
50795
- const isHttpResponse = (data) => {
50796
- return data && typeof data === "object" && "ok" in data && typeof data.ok === "boolean" && "status" in data && typeof data.status === "number";
50797
- };
50798
- const basicToast = toastFunction;
50799
- const getHistory = () => ToastState.toasts;
50800
- const getToasts = () => ToastState.getActiveToasts();
50801
- const toast = Object.assign(basicToast, {
50802
- success: ToastState.success,
50803
- info: ToastState.info,
50804
- warning: ToastState.warning,
50805
- error: ToastState.error,
50806
- custom: ToastState.custom,
50807
- message: ToastState.message,
50808
- promise: ToastState.promise,
50809
- dismiss: ToastState.dismiss,
50810
- loading: ToastState.loading
50811
- }, {
50812
- getHistory,
50813
- getToasts
50814
- });
50815
- __insertCSS("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
50816
- function isAction(action2) {
50817
- return action2.label !== void 0;
50818
- }
50819
- const VISIBLE_TOASTS_AMOUNT = 3;
50820
- const VIEWPORT_OFFSET = "24px";
50821
- const MOBILE_VIEWPORT_OFFSET = "16px";
50822
- const TOAST_LIFETIME = 4e3;
50823
- const TOAST_WIDTH = 356;
50824
- const GAP = 14;
50825
- const SWIPE_THRESHOLD = 45;
50826
- const TIME_BEFORE_UNMOUNT = 200;
50827
- function cn$3(...classes) {
50828
- return classes.filter(Boolean).join(" ");
50829
- }
50830
- function getDefaultSwipeDirections(position2) {
50831
- const [y2, x2] = position2.split("-");
50832
- const directions = [];
50833
- if (y2) {
50834
- directions.push(y2);
50835
- }
50836
- if (x2) {
50837
- directions.push(x2);
50838
- }
50839
- return directions;
50840
- }
50841
- const Toast = (props) => {
50842
- var _toast_classNames, _toast_classNames1, _toast_classNames2, _toast_classNames3, _toast_classNames4, _toast_classNames5, _toast_classNames6, _toast_classNames7, _toast_classNames8;
50843
- const { invert: ToasterInvert, toast: toast2, unstyled, interacting, setHeights, visibleToasts, heights, index: index2, toasts, expanded: expanded2, removeToast, defaultRichColors, closeButton: closeButtonFromToaster, style: style2, cancelButtonStyle, actionButtonStyle, className = "", descriptionClassName = "", duration: durationFromToaster, position: position2, gap, expandByDefault, classNames, icons, closeButtonAriaLabel = "Close toast" } = props;
50844
- const [swipeDirection, setSwipeDirection] = ReactExports.useState(null);
50845
- const [swipeOutDirection, setSwipeOutDirection] = ReactExports.useState(null);
50846
- const [mounted, setMounted] = ReactExports.useState(false);
50847
- const [removed, setRemoved] = ReactExports.useState(false);
50848
- const [swiping, setSwiping] = ReactExports.useState(false);
50849
- const [swipeOut, setSwipeOut] = ReactExports.useState(false);
50850
- const [isSwiped, setIsSwiped] = ReactExports.useState(false);
50851
- const [offsetBeforeRemove, setOffsetBeforeRemove] = ReactExports.useState(0);
50852
- const [initialHeight, setInitialHeight] = ReactExports.useState(0);
50853
- const remainingTime = ReactExports.useRef(toast2.duration || durationFromToaster || TOAST_LIFETIME);
50854
- const dragStartTime = ReactExports.useRef(null);
50855
- const toastRef = ReactExports.useRef(null);
50856
- const isFront = index2 === 0;
50857
- const isVisible = index2 + 1 <= visibleToasts;
50858
- const toastType = toast2.type;
50859
- const dismissible = toast2.dismissible !== false;
50860
- const toastClassname = toast2.className || "";
50861
- const toastDescriptionClassname = toast2.descriptionClassName || "";
50862
- const heightIndex = ReactExports.useMemo(() => heights.findIndex((height) => height.toastId === toast2.id) || 0, [
50863
- heights,
50864
- toast2.id
50865
- ]);
50866
- const closeButton = ReactExports.useMemo(() => {
50867
- var _toast_closeButton;
50868
- return (_toast_closeButton = toast2.closeButton) != null ? _toast_closeButton : closeButtonFromToaster;
50869
- }, [
50870
- toast2.closeButton,
50871
- closeButtonFromToaster
50872
- ]);
50873
- const duration2 = ReactExports.useMemo(() => toast2.duration || durationFromToaster || TOAST_LIFETIME, [
50874
- toast2.duration,
50875
- durationFromToaster
50876
- ]);
50877
- const closeTimerStartTimeRef = ReactExports.useRef(0);
50878
- const offset2 = ReactExports.useRef(0);
50879
- const lastCloseTimerStartTimeRef = ReactExports.useRef(0);
50880
- const pointerStartRef = ReactExports.useRef(null);
50881
- const [y2, x2] = position2.split("-");
50882
- const toastsHeightBefore = ReactExports.useMemo(() => {
50883
- return heights.reduce((prev, curr, reducerIndex) => {
50884
- if (reducerIndex >= heightIndex) {
50885
- return prev;
50886
- }
50887
- return prev + curr.height;
50888
- }, 0);
50889
- }, [
50890
- heights,
50891
- heightIndex
50892
- ]);
50893
- const isDocumentHidden = useIsDocumentHidden();
50894
- const invert = toast2.invert || ToasterInvert;
50895
- const disabled = toastType === "loading";
50896
- offset2.current = ReactExports.useMemo(() => heightIndex * gap + toastsHeightBefore, [
50897
- heightIndex,
50898
- toastsHeightBefore
50899
- ]);
50900
- ReactExports.useEffect(() => {
50901
- remainingTime.current = duration2;
50902
- }, [
50903
- duration2
50904
- ]);
50905
- ReactExports.useEffect(() => {
50906
- setMounted(true);
50907
- }, []);
50908
- ReactExports.useEffect(() => {
50909
- const toastNode = toastRef.current;
50910
- if (toastNode) {
50911
- const height = toastNode.getBoundingClientRect().height;
50912
- setInitialHeight(height);
50913
- setHeights((h2) => [
50914
- {
50915
- toastId: toast2.id,
50916
- height,
50917
- position: toast2.position
50918
- },
50919
- ...h2
50920
- ]);
50921
- return () => setHeights((h2) => h2.filter((height2) => height2.toastId !== toast2.id));
50922
- }
50923
- }, [
50924
- setHeights,
50925
- toast2.id
50926
- ]);
50927
- ReactExports.useLayoutEffect(() => {
50928
- if (!mounted) return;
50929
- const toastNode = toastRef.current;
50930
- const originalHeight = toastNode.style.height;
50931
- toastNode.style.height = "auto";
50932
- const newHeight = toastNode.getBoundingClientRect().height;
50933
- toastNode.style.height = originalHeight;
50934
- setInitialHeight(newHeight);
50935
- setHeights((heights2) => {
50936
- const alreadyExists = heights2.find((height) => height.toastId === toast2.id);
50937
- if (!alreadyExists) {
50938
- return [
50939
- {
50940
- toastId: toast2.id,
50941
- height: newHeight,
50942
- position: toast2.position
50943
- },
50944
- ...heights2
50945
- ];
50946
- } else {
50947
- return heights2.map((height) => height.toastId === toast2.id ? {
50948
- ...height,
50949
- height: newHeight
50950
- } : height);
50951
- }
50952
- });
50953
- }, [
50954
- mounted,
50955
- toast2.title,
50956
- toast2.description,
50957
- setHeights,
50958
- toast2.id,
50959
- toast2.jsx,
50960
- toast2.action,
50961
- toast2.cancel
50962
- ]);
50963
- const deleteToast = ReactExports.useCallback(() => {
50964
- setRemoved(true);
50965
- setOffsetBeforeRemove(offset2.current);
50966
- setHeights((h2) => h2.filter((height) => height.toastId !== toast2.id));
50967
- setTimeout(() => {
50968
- removeToast(toast2);
50969
- }, TIME_BEFORE_UNMOUNT);
50970
- }, [
50971
- toast2,
50972
- removeToast,
50973
- setHeights,
50974
- offset2
50975
- ]);
50976
- ReactExports.useEffect(() => {
50977
- if (toast2.promise && toastType === "loading" || toast2.duration === Infinity || toast2.type === "loading") return;
50978
- let timeoutId;
50979
- const pauseTimer = () => {
50980
- if (lastCloseTimerStartTimeRef.current < closeTimerStartTimeRef.current) {
50981
- const elapsedTime = (/* @__PURE__ */ new Date()).getTime() - closeTimerStartTimeRef.current;
50982
- remainingTime.current = remainingTime.current - elapsedTime;
50983
- }
50984
- lastCloseTimerStartTimeRef.current = (/* @__PURE__ */ new Date()).getTime();
50985
- };
50986
- const startTimer = () => {
50987
- if (remainingTime.current === Infinity) return;
50988
- closeTimerStartTimeRef.current = (/* @__PURE__ */ new Date()).getTime();
50989
- timeoutId = setTimeout(() => {
50990
- toast2.onAutoClose == null ? void 0 : toast2.onAutoClose.call(toast2, toast2);
50991
- deleteToast();
50992
- }, remainingTime.current);
50993
- };
50994
- if (expanded2 || interacting || isDocumentHidden) {
50995
- pauseTimer();
50996
- } else {
50997
- startTimer();
51129
+ var propertyIsEnumerable = Object.prototype.propertyIsEnumerable;
51130
+ function getPropertyValue(object2, propertyName) {
51131
+ const propertyDescriptor = Object.getOwnPropertyDescriptor(object2, propertyName);
51132
+ if (propertyDescriptor.get) {
51133
+ try {
51134
+ return propertyDescriptor.get();
51135
+ } catch {
51136
+ return propertyDescriptor.get;
50998
51137
  }
50999
- return () => clearTimeout(timeoutId);
51000
- }, [
51001
- expanded2,
51002
- interacting,
51003
- toast2,
51004
- toastType,
51005
- isDocumentHidden,
51006
- deleteToast
51007
- ]);
51008
- ReactExports.useEffect(() => {
51009
- if (toast2.delete) {
51010
- deleteToast();
51011
- toast2.onDismiss == null ? void 0 : toast2.onDismiss.call(toast2, toast2);
51138
+ }
51139
+ return object2[propertyName];
51140
+ }
51141
+ function intersperse(arr, sep2) {
51142
+ if (arr.length === 0) {
51143
+ return [];
51144
+ }
51145
+ return arr.slice(1).reduce((xs, x2) => xs.concat([sep2, x2]), [arr[0]]);
51146
+ }
51147
+ var ObjectPreview = ({ data }) => {
51148
+ const styles2 = useStyles("ObjectPreview");
51149
+ const object2 = data;
51150
+ if (typeof object2 !== "object" || object2 === null || object2 instanceof Date || object2 instanceof RegExp) {
51151
+ return /* @__PURE__ */ ReactExports.createElement(ObjectValue, { object: object2 });
51152
+ }
51153
+ if (Array.isArray(object2)) {
51154
+ const maxProperties = styles2.arrayMaxProperties;
51155
+ const previewArray = object2.slice(0, maxProperties).map((element2, index2) => /* @__PURE__ */ ReactExports.createElement(ObjectValue, { key: index2, object: element2 }));
51156
+ if (object2.length > maxProperties) {
51157
+ previewArray.push(/* @__PURE__ */ ReactExports.createElement("span", { key: "ellipsis" }, "…"));
51012
51158
  }
51013
- }, [
51014
- deleteToast,
51015
- toast2.delete
51016
- ]);
51017
- function getLoadingIcon() {
51018
- var _toast_classNames9;
51019
- if (icons == null ? void 0 : icons.loading) {
51020
- var _toast_classNames12;
51021
- return /* @__PURE__ */ ReactExports.createElement("div", {
51022
- className: cn$3(classNames == null ? void 0 : classNames.loader, toast2 == null ? void 0 : (_toast_classNames12 = toast2.classNames) == null ? void 0 : _toast_classNames12.loader, "sonner-loader"),
51023
- "data-visible": toastType === "loading"
51024
- }, icons.loading);
51159
+ const arrayLength = object2.length;
51160
+ return /* @__PURE__ */ ReactExports.createElement(ReactExports.Fragment, null, /* @__PURE__ */ ReactExports.createElement("span", { style: styles2.objectDescription }, arrayLength === 0 ? `` : `(${arrayLength}) `), /* @__PURE__ */ ReactExports.createElement("span", { style: styles2.preview }, "[", intersperse(previewArray, ", "), "]"));
51161
+ } else {
51162
+ const maxProperties = styles2.objectMaxProperties;
51163
+ const propertyNodes = [];
51164
+ for (const propertyName in object2) {
51165
+ if (hasOwnProperty$1.call(object2, propertyName)) {
51166
+ let ellipsis;
51167
+ if (propertyNodes.length === maxProperties - 1 && Object.keys(object2).length > maxProperties) {
51168
+ ellipsis = /* @__PURE__ */ ReactExports.createElement("span", { key: "ellipsis" }, "");
51169
+ }
51170
+ const propertyValue2 = getPropertyValue(object2, propertyName);
51171
+ propertyNodes.push(
51172
+ /* @__PURE__ */ ReactExports.createElement("span", { key: propertyName }, /* @__PURE__ */ ReactExports.createElement(ObjectName, { name: propertyName || `""` }), ": ", /* @__PURE__ */ ReactExports.createElement(ObjectValue, { object: propertyValue2 }), ellipsis)
51173
+ );
51174
+ if (ellipsis) break;
51175
+ }
51025
51176
  }
51026
- return /* @__PURE__ */ ReactExports.createElement(Loader, {
51027
- className: cn$3(classNames == null ? void 0 : classNames.loader, toast2 == null ? void 0 : (_toast_classNames9 = toast2.classNames) == null ? void 0 : _toast_classNames9.loader),
51028
- visible: toastType === "loading"
51029
- });
51177
+ const objectConstructorName = object2.constructor ? object2.constructor.name : "Object";
51178
+ return /* @__PURE__ */ ReactExports.createElement(ReactExports.Fragment, null, /* @__PURE__ */ ReactExports.createElement("span", { style: styles2.objectDescription }, objectConstructorName === "Object" ? "" : `${objectConstructorName} `), /* @__PURE__ */ ReactExports.createElement("span", { style: styles2.preview }, "{", intersperse(propertyNodes, ", "), "}"));
51030
51179
  }
51031
- const icon = toast2.icon || (icons == null ? void 0 : icons[toastType]) || getAsset(toastType);
51032
- var _toast_richColors, _icons_close;
51033
- return /* @__PURE__ */ ReactExports.createElement("li", {
51034
- tabIndex: 0,
51035
- ref: toastRef,
51036
- className: cn$3(className, toastClassname, classNames == null ? void 0 : classNames.toast, toast2 == null ? void 0 : (_toast_classNames = toast2.classNames) == null ? void 0 : _toast_classNames.toast, classNames == null ? void 0 : classNames.default, classNames == null ? void 0 : classNames[toastType], toast2 == null ? void 0 : (_toast_classNames1 = toast2.classNames) == null ? void 0 : _toast_classNames1[toastType]),
51037
- "data-sonner-toast": "",
51038
- "data-rich-colors": (_toast_richColors = toast2.richColors) != null ? _toast_richColors : defaultRichColors,
51039
- "data-styled": !Boolean(toast2.jsx || toast2.unstyled || unstyled),
51040
- "data-mounted": mounted,
51041
- "data-promise": Boolean(toast2.promise),
51042
- "data-swiped": isSwiped,
51043
- "data-removed": removed,
51044
- "data-visible": isVisible,
51045
- "data-y-position": y2,
51046
- "data-x-position": x2,
51047
- "data-index": index2,
51048
- "data-front": isFront,
51049
- "data-swiping": swiping,
51050
- "data-dismissible": dismissible,
51051
- "data-type": toastType,
51052
- "data-invert": invert,
51053
- "data-swipe-out": swipeOut,
51054
- "data-swipe-direction": swipeOutDirection,
51055
- "data-expanded": Boolean(expanded2 || expandByDefault && mounted),
51056
- "data-testid": toast2.testId,
51057
- style: {
51058
- "--index": index2,
51059
- "--toasts-before": index2,
51060
- "--z-index": toasts.length - index2,
51061
- "--offset": `${removed ? offsetBeforeRemove : offset2.current}px`,
51062
- "--initial-height": expandByDefault ? "auto" : `${initialHeight}px`,
51063
- ...style2,
51064
- ...toast2.style
51065
- },
51066
- onDragEnd: () => {
51067
- setSwiping(false);
51068
- setSwipeDirection(null);
51069
- pointerStartRef.current = null;
51070
- },
51071
- onPointerDown: (event) => {
51072
- if (event.button === 2) return;
51073
- if (disabled || !dismissible) return;
51074
- dragStartTime.current = /* @__PURE__ */ new Date();
51075
- setOffsetBeforeRemove(offset2.current);
51076
- event.target.setPointerCapture(event.pointerId);
51077
- if (event.target.tagName === "BUTTON") return;
51078
- setSwiping(true);
51079
- pointerStartRef.current = {
51080
- x: event.clientX,
51081
- y: event.clientY
51082
- };
51083
- },
51084
- onPointerUp: () => {
51085
- var _toastRef_current, _toastRef_current1, _dragStartTime_current;
51086
- if (swipeOut || !dismissible) return;
51087
- pointerStartRef.current = null;
51088
- const swipeAmountX = Number(((_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0);
51089
- const swipeAmountY = Number(((_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0);
51090
- const timeTaken = (/* @__PURE__ */ new Date()).getTime() - ((_dragStartTime_current = dragStartTime.current) == null ? void 0 : _dragStartTime_current.getTime());
51091
- const swipeAmount = swipeDirection === "x" ? swipeAmountX : swipeAmountY;
51092
- const velocity = Math.abs(swipeAmount) / timeTaken;
51093
- if (Math.abs(swipeAmount) >= SWIPE_THRESHOLD || velocity > 0.11) {
51094
- setOffsetBeforeRemove(offset2.current);
51095
- toast2.onDismiss == null ? void 0 : toast2.onDismiss.call(toast2, toast2);
51096
- if (swipeDirection === "x") {
51097
- setSwipeOutDirection(swipeAmountX > 0 ? "right" : "left");
51180
+ };
51181
+ var ObjectRootLabel = ({ name: name2, data }) => {
51182
+ if (typeof name2 === "string") {
51183
+ return /* @__PURE__ */ ReactExports.createElement("span", null, /* @__PURE__ */ ReactExports.createElement(ObjectName, { name: name2 }), /* @__PURE__ */ ReactExports.createElement("span", null, ": "), /* @__PURE__ */ ReactExports.createElement(ObjectPreview, { data }));
51184
+ } else {
51185
+ return /* @__PURE__ */ ReactExports.createElement(ObjectPreview, { data });
51186
+ }
51187
+ };
51188
+ var ObjectLabel = ({ name: name2, data, isNonenumerable = false }) => {
51189
+ const object2 = data;
51190
+ return /* @__PURE__ */ ReactExports.createElement("span", null, typeof name2 === "string" ? /* @__PURE__ */ ReactExports.createElement(ObjectName, { name: name2, dimmed: isNonenumerable }) : /* @__PURE__ */ ReactExports.createElement(ObjectPreview, { data: name2 }), /* @__PURE__ */ ReactExports.createElement("span", null, ": "), /* @__PURE__ */ ReactExports.createElement(ObjectValue, { object: object2 }));
51191
+ };
51192
+ var createIterator = (showNonenumerable, sortObjectKeys) => {
51193
+ const objectIterator = function* (data) {
51194
+ const shouldIterate = typeof data === "object" && data !== null || typeof data === "function";
51195
+ if (!shouldIterate) return;
51196
+ const dataIsArray = Array.isArray(data);
51197
+ if (!dataIsArray && data[Symbol.iterator]) {
51198
+ let i = 0;
51199
+ for (const entry2 of data) {
51200
+ if (Array.isArray(entry2) && entry2.length === 2) {
51201
+ const [k2, v2] = entry2;
51202
+ yield {
51203
+ name: k2,
51204
+ data: v2
51205
+ };
51098
51206
  } else {
51099
- setSwipeOutDirection(swipeAmountY > 0 ? "down" : "up");
51207
+ yield {
51208
+ name: i.toString(),
51209
+ data: entry2
51210
+ };
51100
51211
  }
51101
- deleteToast();
51102
- setSwipeOut(true);
51103
- return;
51104
- } else {
51105
- var _toastRef_current2, _toastRef_current3;
51106
- (_toastRef_current2 = toastRef.current) == null ? void 0 : _toastRef_current2.style.setProperty("--swipe-amount-x", `0px`);
51107
- (_toastRef_current3 = toastRef.current) == null ? void 0 : _toastRef_current3.style.setProperty("--swipe-amount-y", `0px`);
51212
+ i++;
51108
51213
  }
51109
- setIsSwiped(false);
51110
- setSwiping(false);
51111
- setSwipeDirection(null);
51112
- },
51113
- onPointerMove: (event) => {
51114
- var _window_getSelection, _toastRef_current, _toastRef_current1;
51115
- if (!pointerStartRef.current || !dismissible) return;
51116
- const isHighlighted = ((_window_getSelection = window.getSelection()) == null ? void 0 : _window_getSelection.toString().length) > 0;
51117
- if (isHighlighted) return;
51118
- const yDelta = event.clientY - pointerStartRef.current.y;
51119
- const xDelta = event.clientX - pointerStartRef.current.x;
51120
- var _props_swipeDirections;
51121
- const swipeDirections = (_props_swipeDirections = props.swipeDirections) != null ? _props_swipeDirections : getDefaultSwipeDirections(position2);
51122
- if (!swipeDirection && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) {
51123
- setSwipeDirection(Math.abs(xDelta) > Math.abs(yDelta) ? "x" : "y");
51214
+ } else {
51215
+ const keys2 = Object.getOwnPropertyNames(data);
51216
+ if (sortObjectKeys === true && !dataIsArray) {
51217
+ keys2.sort();
51218
+ } else if (typeof sortObjectKeys === "function") {
51219
+ keys2.sort(sortObjectKeys);
51124
51220
  }
51125
- let swipeAmount = {
51126
- x: 0,
51127
- y: 0
51128
- };
51129
- const getDampening = (delta) => {
51130
- const factor = Math.abs(delta) / 20;
51131
- return 1 / (1.5 + factor);
51132
- };
51133
- if (swipeDirection === "y") {
51134
- if (swipeDirections.includes("top") || swipeDirections.includes("bottom")) {
51135
- if (swipeDirections.includes("top") && yDelta < 0 || swipeDirections.includes("bottom") && yDelta > 0) {
51136
- swipeAmount.y = yDelta;
51137
- } else {
51138
- const dampenedDelta = yDelta * getDampening(yDelta);
51139
- swipeAmount.y = Math.abs(dampenedDelta) < Math.abs(yDelta) ? dampenedDelta : yDelta;
51221
+ for (const propertyName of keys2) {
51222
+ if (propertyIsEnumerable.call(data, propertyName)) {
51223
+ const propertyValue2 = getPropertyValue(data, propertyName);
51224
+ yield {
51225
+ name: propertyName || `""`,
51226
+ data: propertyValue2
51227
+ };
51228
+ } else if (showNonenumerable) {
51229
+ let propertyValue2;
51230
+ try {
51231
+ propertyValue2 = getPropertyValue(data, propertyName);
51232
+ } catch (e) {
51140
51233
  }
51141
- }
51142
- } else if (swipeDirection === "x") {
51143
- if (swipeDirections.includes("left") || swipeDirections.includes("right")) {
51144
- if (swipeDirections.includes("left") && xDelta < 0 || swipeDirections.includes("right") && xDelta > 0) {
51145
- swipeAmount.x = xDelta;
51146
- } else {
51147
- const dampenedDelta = xDelta * getDampening(xDelta);
51148
- swipeAmount.x = Math.abs(dampenedDelta) < Math.abs(xDelta) ? dampenedDelta : xDelta;
51234
+ if (propertyValue2 !== void 0) {
51235
+ yield {
51236
+ name: propertyName,
51237
+ data: propertyValue2,
51238
+ isNonenumerable: true
51239
+ };
51149
51240
  }
51150
51241
  }
51151
51242
  }
51152
- if (Math.abs(swipeAmount.x) > 0 || Math.abs(swipeAmount.y) > 0) {
51153
- setIsSwiped(true);
51243
+ if (showNonenumerable && data !== Object.prototype) {
51244
+ yield {
51245
+ name: "__proto__",
51246
+ data: Object.getPrototypeOf(data),
51247
+ isNonenumerable: true
51248
+ };
51154
51249
  }
51155
- (_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.setProperty("--swipe-amount-x", `${swipeAmount.x}px`);
51156
- (_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.setProperty("--swipe-amount-y", `${swipeAmount.y}px`);
51157
51250
  }
51158
- }, closeButton && !toast2.jsx && toastType !== "loading" ? /* @__PURE__ */ ReactExports.createElement("button", {
51159
- "aria-label": closeButtonAriaLabel,
51160
- "data-disabled": disabled,
51161
- "data-close-button": true,
51162
- onClick: disabled || !dismissible ? () => {
51163
- } : () => {
51164
- deleteToast();
51165
- toast2.onDismiss == null ? void 0 : toast2.onDismiss.call(toast2, toast2);
51166
- },
51167
- className: cn$3(classNames == null ? void 0 : classNames.closeButton, toast2 == null ? void 0 : (_toast_classNames2 = toast2.classNames) == null ? void 0 : _toast_classNames2.closeButton)
51168
- }, (_icons_close = icons == null ? void 0 : icons.close) != null ? _icons_close : CloseIcon) : null, (toastType || toast2.icon || toast2.promise) && toast2.icon !== null && ((icons == null ? void 0 : icons[toastType]) !== null || toast2.icon) ? /* @__PURE__ */ ReactExports.createElement("div", {
51169
- "data-icon": "",
51170
- className: cn$3(classNames == null ? void 0 : classNames.icon, toast2 == null ? void 0 : (_toast_classNames3 = toast2.classNames) == null ? void 0 : _toast_classNames3.icon)
51171
- }, toast2.promise || toast2.type === "loading" && !toast2.icon ? toast2.icon || getLoadingIcon() : null, toast2.type !== "loading" ? icon : null) : null, /* @__PURE__ */ ReactExports.createElement("div", {
51172
- "data-content": "",
51173
- className: cn$3(classNames == null ? void 0 : classNames.content, toast2 == null ? void 0 : (_toast_classNames4 = toast2.classNames) == null ? void 0 : _toast_classNames4.content)
51174
- }, /* @__PURE__ */ ReactExports.createElement("div", {
51175
- "data-title": "",
51176
- className: cn$3(classNames == null ? void 0 : classNames.title, toast2 == null ? void 0 : (_toast_classNames5 = toast2.classNames) == null ? void 0 : _toast_classNames5.title)
51177
- }, toast2.jsx ? toast2.jsx : typeof toast2.title === "function" ? toast2.title() : toast2.title), toast2.description ? /* @__PURE__ */ ReactExports.createElement("div", {
51178
- "data-description": "",
51179
- className: cn$3(descriptionClassName, toastDescriptionClassname, classNames == null ? void 0 : classNames.description, toast2 == null ? void 0 : (_toast_classNames6 = toast2.classNames) == null ? void 0 : _toast_classNames6.description)
51180
- }, typeof toast2.description === "function" ? toast2.description() : toast2.description) : null), /* @__PURE__ */ ReactExports.isValidElement(toast2.cancel) ? toast2.cancel : toast2.cancel && isAction(toast2.cancel) ? /* @__PURE__ */ ReactExports.createElement("button", {
51181
- "data-button": true,
51182
- "data-cancel": true,
51183
- style: toast2.cancelButtonStyle || cancelButtonStyle,
51184
- onClick: (event) => {
51185
- if (!isAction(toast2.cancel)) return;
51186
- if (!dismissible) return;
51187
- toast2.cancel.onClick == null ? void 0 : toast2.cancel.onClick.call(toast2.cancel, event);
51188
- deleteToast();
51189
- },
51190
- className: cn$3(classNames == null ? void 0 : classNames.cancelButton, toast2 == null ? void 0 : (_toast_classNames7 = toast2.classNames) == null ? void 0 : _toast_classNames7.cancelButton)
51191
- }, toast2.cancel.label) : null, /* @__PURE__ */ ReactExports.isValidElement(toast2.action) ? toast2.action : toast2.action && isAction(toast2.action) ? /* @__PURE__ */ ReactExports.createElement("button", {
51192
- "data-button": true,
51193
- "data-action": true,
51194
- style: toast2.actionButtonStyle || actionButtonStyle,
51195
- onClick: (event) => {
51196
- if (!isAction(toast2.action)) return;
51197
- toast2.action.onClick == null ? void 0 : toast2.action.onClick.call(toast2.action, event);
51198
- if (event.defaultPrevented) return;
51199
- deleteToast();
51200
- },
51201
- className: cn$3(classNames == null ? void 0 : classNames.actionButton, toast2 == null ? void 0 : (_toast_classNames8 = toast2.classNames) == null ? void 0 : _toast_classNames8.actionButton)
51202
- }, toast2.action.label) : null);
51251
+ };
51252
+ return objectIterator;
51203
51253
  };
51204
- function getDocumentDirection() {
51205
- if (typeof window === "undefined") return "ltr";
51206
- if (typeof document === "undefined") return "ltr";
51207
- const dirAttribute = document.documentElement.getAttribute("dir");
51208
- if (dirAttribute === "auto" || !dirAttribute) {
51209
- return window.getComputedStyle(document.documentElement).direction;
51254
+ var defaultNodeRenderer = ({ depth, name: name2, data, isNonenumerable }) => depth === 0 ? /* @__PURE__ */ ReactExports.createElement(ObjectRootLabel, { name: name2, data }) : /* @__PURE__ */ ReactExports.createElement(ObjectLabel, { name: name2, data, isNonenumerable });
51255
+ var ObjectInspector = ({ showNonenumerable = false, sortObjectKeys, nodeRenderer, ...treeViewProps }) => {
51256
+ const dataIterator = createIterator(showNonenumerable, sortObjectKeys);
51257
+ const renderer = nodeRenderer ? nodeRenderer : defaultNodeRenderer;
51258
+ return /* @__PURE__ */ ReactExports.createElement(TreeView, { nodeRenderer: renderer, dataIterator, ...treeViewProps });
51259
+ };
51260
+ var themedObjectInspector = themeAcceptor(ObjectInspector);
51261
+ __toESM(require_is_dom());
51262
+ const useDarkMode = () => {
51263
+ const [isDark, setIsDark] = reactExports.useState(() => {
51264
+ if (typeof document === "undefined")
51265
+ return false;
51266
+ return document.documentElement.classList.contains("dark");
51267
+ });
51268
+ reactExports.useEffect(() => {
51269
+ if (typeof document === "undefined")
51270
+ return;
51271
+ const observer = new MutationObserver(() => {
51272
+ setIsDark(document.documentElement.classList.contains("dark"));
51273
+ });
51274
+ observer.observe(document.documentElement, {
51275
+ attributes: true,
51276
+ attributeFilter: ["class"]
51277
+ });
51278
+ return () => observer.disconnect();
51279
+ }, []);
51280
+ return isDark;
51281
+ };
51282
+ const inspectorThemeExtendedLight = {
51283
+ OBJECT_VALUE_DATE_COLOR: "#a21caf"
51284
+ // fuchsia-700
51285
+ };
51286
+ const inspectorThemeExtendedDark = {
51287
+ OBJECT_VALUE_DATE_COLOR: "#e879f9"
51288
+ // fuchsia-400
51289
+ };
51290
+ const shared = {
51291
+ BASE_FONT_SIZE: "11px",
51292
+ BASE_LINE_HEIGHT: 1.4,
51293
+ BASE_BACKGROUND_COLOR: "transparent",
51294
+ OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES: 10,
51295
+ OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES: 5,
51296
+ HTML_TAGNAME_TEXT_TRANSFORM: "lowercase",
51297
+ ARROW_MARGIN_RIGHT: 3,
51298
+ ARROW_FONT_SIZE: 12,
51299
+ TREENODE_FONT_FAMILY: "var(--font-mono)",
51300
+ TREENODE_FONT_SIZE: "11px",
51301
+ TREENODE_LINE_HEIGHT: 1.4,
51302
+ TREENODE_PADDING_LEFT: 12,
51303
+ TABLE_DATA_BACKGROUND_IMAGE: "none",
51304
+ TABLE_DATA_BACKGROUND_SIZE: "0"
51305
+ };
51306
+ const inspectorThemeLight = {
51307
+ ...shared,
51308
+ // Base text
51309
+ BASE_COLOR: "var(--ds-gray-1000)",
51310
+ // Property names — unstyled, same as base foreground (Node: no style)
51311
+ OBJECT_NAME_COLOR: "var(--ds-gray-900)",
51312
+ // Strings & symbols — green (Node: 'green')
51313
+ OBJECT_VALUE_STRING_COLOR: "#16a34a",
51314
+ // green-600
51315
+ OBJECT_VALUE_SYMBOL_COLOR: "#16a34a",
51316
+ // Numbers & booleans — yellow/amber (Node: 'yellow')
51317
+ OBJECT_VALUE_NUMBER_COLOR: "#b45309",
51318
+ // amber-700 (readable on white)
51319
+ OBJECT_VALUE_BOOLEAN_COLOR: "#b45309",
51320
+ // null — bold foreground (Node: 'bold')
51321
+ OBJECT_VALUE_NULL_COLOR: "var(--ds-gray-900)",
51322
+ // undefined — grey (Node: 'grey')
51323
+ OBJECT_VALUE_UNDEFINED_COLOR: "var(--ds-gray-500)",
51324
+ // RegExp — red (Node regexp base uses green/red/yellow palette)
51325
+ OBJECT_VALUE_REGEXP_COLOR: "#dc2626",
51326
+ // red-600
51327
+ // Functions — cyan (Node: 'special' → 'cyan')
51328
+ OBJECT_VALUE_FUNCTION_PREFIX_COLOR: "#0891b2",
51329
+ // cyan-600
51330
+ // HTML (less relevant for data inspection, but reasonable defaults)
51331
+ HTML_TAG_COLOR: "var(--ds-gray-500)",
51332
+ HTML_TAGNAME_COLOR: "#0891b2",
51333
+ HTML_ATTRIBUTE_NAME_COLOR: "#b45309",
51334
+ HTML_ATTRIBUTE_VALUE_COLOR: "#16a34a",
51335
+ HTML_COMMENT_COLOR: "var(--ds-gray-400)",
51336
+ HTML_DOCTYPE_COLOR: "var(--ds-gray-400)",
51337
+ // Structural
51338
+ ARROW_COLOR: "var(--ds-gray-500)",
51339
+ TABLE_BORDER_COLOR: "var(--ds-gray-300)",
51340
+ TABLE_TH_BACKGROUND_COLOR: "var(--ds-gray-100)",
51341
+ TABLE_TH_HOVER_COLOR: "var(--ds-gray-200)",
51342
+ TABLE_SORT_ICON_COLOR: "var(--ds-gray-500)"
51343
+ };
51344
+ const inspectorThemeDark = {
51345
+ ...shared,
51346
+ // Base text
51347
+ BASE_COLOR: "var(--ds-gray-1000)",
51348
+ // Property names — white/light foreground (Node: unstyled = white in dark terminal)
51349
+ OBJECT_NAME_COLOR: "var(--ds-gray-900)",
51350
+ // Strings & symbols — green (Node: 'green')
51351
+ OBJECT_VALUE_STRING_COLOR: "#4ade80",
51352
+ // green-400
51353
+ OBJECT_VALUE_SYMBOL_COLOR: "#4ade80",
51354
+ // Numbers & booleans — yellow (Node: 'yellow')
51355
+ OBJECT_VALUE_NUMBER_COLOR: "#facc15",
51356
+ // yellow-400
51357
+ OBJECT_VALUE_BOOLEAN_COLOR: "#facc15",
51358
+ // null — bold foreground / white (Node: 'bold')
51359
+ OBJECT_VALUE_NULL_COLOR: "var(--ds-gray-1000)",
51360
+ // undefined — grey (Node: 'grey')
51361
+ OBJECT_VALUE_UNDEFINED_COLOR: "var(--ds-gray-500)",
51362
+ // RegExp — red (Node regexp palette)
51363
+ OBJECT_VALUE_REGEXP_COLOR: "#f87171",
51364
+ // red-400
51365
+ // Functions — cyan (Node: 'special' → 'cyan')
51366
+ OBJECT_VALUE_FUNCTION_PREFIX_COLOR: "#22d3ee",
51367
+ // cyan-400
51368
+ // HTML
51369
+ HTML_TAG_COLOR: "var(--ds-gray-500)",
51370
+ HTML_TAGNAME_COLOR: "#22d3ee",
51371
+ HTML_ATTRIBUTE_NAME_COLOR: "#facc15",
51372
+ HTML_ATTRIBUTE_VALUE_COLOR: "#4ade80",
51373
+ HTML_COMMENT_COLOR: "var(--ds-gray-500)",
51374
+ HTML_DOCTYPE_COLOR: "var(--ds-gray-500)",
51375
+ // Structural
51376
+ ARROW_COLOR: "var(--ds-gray-500)",
51377
+ TABLE_BORDER_COLOR: "var(--ds-gray-300)",
51378
+ TABLE_TH_BACKGROUND_COLOR: "var(--ds-gray-100)",
51379
+ TABLE_TH_HOVER_COLOR: "var(--ds-gray-200)",
51380
+ TABLE_SORT_ICON_COLOR: "var(--ds-gray-500)"
51381
+ };
51382
+ const STREAM_REF_TYPE = "__workflow_stream_ref__";
51383
+ const CLASS_INSTANCE_REF_TYPE = "__workflow_class_instance_ref__";
51384
+ function isStreamRef(value) {
51385
+ return value !== null && typeof value === "object" && "__type" in value && value.__type === STREAM_REF_TYPE;
51386
+ }
51387
+ function isClassInstanceRef(value) {
51388
+ return value !== null && typeof value === "object" && "__type" in value && value.__type === CLASS_INSTANCE_REF_TYPE;
51389
+ }
51390
+ const StreamClickContext = reactExports.createContext(void 0);
51391
+ const DecryptClickContext = reactExports.createContext(void 0);
51392
+ function EncryptedInlineLabel() {
51393
+ const ctx = reactExports.useContext(DecryptClickContext);
51394
+ if (ctx) {
51395
+ return jsxRuntimeExports.jsxs("button", { type: "button", className: "inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[11px] cursor-pointer", style: {
51396
+ backgroundColor: "var(--ds-gray-100)",
51397
+ color: "var(--ds-gray-700)",
51398
+ border: "1px solid var(--ds-gray-400)",
51399
+ fontStyle: "italic",
51400
+ opacity: ctx.isDecrypting ? 0.6 : 1
51401
+ }, disabled: ctx.isDecrypting, onClick: (e) => {
51402
+ e.stopPropagation();
51403
+ ctx.onDecrypt();
51404
+ }, title: "Click to decrypt", children: [ctx.isDecrypting ? jsxRuntimeExports.jsx(Spinner, { size: 12 }) : jsxRuntimeExports.jsx(Lock, { className: "h-3 w-3", style: { display: "inline", flexShrink: 0 } }), jsxRuntimeExports.jsx("span", { children: ctx.isDecrypting ? "Decrypting…" : "Decrypt" })] });
51210
51405
  }
51211
- return dirAttribute;
51406
+ return jsxRuntimeExports.jsxs("span", { style: { color: "var(--ds-gray-600)", fontStyle: "italic" }, children: [jsxRuntimeExports.jsx(Lock, { className: "h-3 w-3", style: {
51407
+ display: "inline",
51408
+ verticalAlign: "middle",
51409
+ marginRight: "3px",
51410
+ marginTop: "-1px"
51411
+ } }), "Encrypted"] });
51212
51412
  }
51213
- function assignOffset(defaultOffset, mobileOffset) {
51214
- const styles2 = {};
51215
- [
51216
- defaultOffset,
51217
- mobileOffset
51218
- ].forEach((offset2, index2) => {
51219
- const isMobile = index2 === 1;
51220
- const prefix = isMobile ? "--mobile-offset" : "--offset";
51221
- const defaultValue = isMobile ? MOBILE_VIEWPORT_OFFSET : VIEWPORT_OFFSET;
51222
- function assignAll(offset3) {
51223
- [
51224
- "top",
51225
- "right",
51226
- "bottom",
51227
- "left"
51228
- ].forEach((key) => {
51229
- styles2[`${prefix}-${key}`] = typeof offset3 === "number" ? `${offset3}px` : offset3;
51230
- });
51231
- }
51232
- if (typeof offset2 === "number" || typeof offset2 === "string") {
51233
- assignAll(offset2);
51234
- } else if (typeof offset2 === "object") {
51235
- [
51236
- "top",
51237
- "right",
51238
- "bottom",
51239
- "left"
51240
- ].forEach((key) => {
51241
- if (offset2[key] === void 0) {
51242
- styles2[`${prefix}-${key}`] = defaultValue;
51243
- } else {
51244
- styles2[`${prefix}-${key}`] = typeof offset2[key] === "number" ? `${offset2[key]}px` : offset2[key];
51245
- }
51246
- });
51247
- } else {
51248
- assignAll(defaultValue);
51249
- }
51250
- });
51251
- return styles2;
51413
+ function StreamRefInline({ streamRef }) {
51414
+ const onStreamClick = reactExports.useContext(StreamClickContext);
51415
+ return jsxRuntimeExports.jsxs("button", { type: "button", className: "inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-mono cursor-pointer", style: {
51416
+ backgroundColor: "var(--ds-blue-100)",
51417
+ color: "var(--ds-blue-800)",
51418
+ border: "1px solid var(--ds-blue-300)"
51419
+ }, onClick: () => onStreamClick == null ? void 0 : onStreamClick(streamRef.streamId), title: `View stream: ${streamRef.streamId}`, children: [jsxRuntimeExports.jsx("span", { children: "📡" }), jsxRuntimeExports.jsx("span", { children: streamRef.streamId })] });
51252
51420
  }
51253
- const Toaster$1 = /* @__PURE__ */ ReactExports.forwardRef(function Toaster(props, ref) {
51254
- const { id: id2, invert, position: position2 = "bottom-right", hotkey = [
51255
- "altKey",
51256
- "KeyT"
51257
- ], expand: expand2, closeButton, className, offset: offset2, mobileOffset, theme: theme3 = "light", richColors, duration: duration2, style: style2, visibleToasts = VISIBLE_TOASTS_AMOUNT, toastOptions, dir = getDocumentDirection(), gap = GAP, icons, containerAriaLabel = "Notifications" } = props;
51258
- const [toasts, setToasts] = ReactExports.useState([]);
51259
- const filteredToasts = ReactExports.useMemo(() => {
51260
- if (id2) {
51261
- return toasts.filter((toast2) => toast2.toasterId === id2);
51421
+ const ExtendedThemeContext = reactExports.createContext(inspectorThemeExtendedLight);
51422
+ function NodeRenderer$1({ depth, name: name2, data, isNonenumerable }) {
51423
+ var _a3;
51424
+ const extendedTheme = reactExports.useContext(ExtendedThemeContext);
51425
+ if (data !== null && typeof data === "object" && ((_a3 = data.constructor) == null ? void 0 : _a3.name) === ENCRYPTED_DISPLAY_NAME) {
51426
+ const label = jsxRuntimeExports.jsx(EncryptedInlineLabel, {});
51427
+ if (depth === 0) {
51428
+ return label;
51262
51429
  }
51263
- return toasts.filter((toast2) => !toast2.toasterId);
51264
- }, [
51265
- toasts,
51266
- id2
51267
- ]);
51268
- const possiblePositions = ReactExports.useMemo(() => {
51269
- return Array.from(new Set([
51270
- position2
51271
- ].concat(filteredToasts.filter((toast2) => toast2.position).map((toast2) => toast2.position))));
51272
- }, [
51273
- filteredToasts,
51274
- position2
51275
- ]);
51276
- const [heights, setHeights] = ReactExports.useState([]);
51277
- const [expanded2, setExpanded] = ReactExports.useState(false);
51278
- const [interacting, setInteracting] = ReactExports.useState(false);
51279
- const [actualTheme, setActualTheme] = ReactExports.useState(theme3 !== "system" ? theme3 : typeof window !== "undefined" ? window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : "light");
51280
- const listRef = ReactExports.useRef(null);
51281
- const hotkeyLabel = hotkey.join("+").replace(/Key/g, "").replace(/Digit/g, "");
51282
- const lastFocusedElementRef = ReactExports.useRef(null);
51283
- const isFocusWithinRef = ReactExports.useRef(false);
51284
- const removeToast = ReactExports.useCallback((toastToRemove) => {
51285
- setToasts((toasts2) => {
51286
- var _toasts_find;
51287
- if (!((_toasts_find = toasts2.find((toast2) => toast2.id === toastToRemove.id)) == null ? void 0 : _toasts_find.delete)) {
51288
- ToastState.dismiss(toastToRemove.id);
51289
- }
51290
- return toasts2.filter(({ id: id3 }) => id3 !== toastToRemove.id);
51291
- });
51292
- }, []);
51293
- ReactExports.useEffect(() => {
51294
- return ToastState.subscribe((toast2) => {
51295
- if (toast2.dismiss) {
51296
- requestAnimationFrame(() => {
51297
- setToasts((toasts2) => toasts2.map((t) => t.id === toast2.id ? {
51298
- ...t,
51299
- delete: true
51300
- } : t));
51301
- });
51302
- return;
51303
- }
51304
- setTimeout(() => {
51305
- ReactDOM.flushSync(() => {
51306
- setToasts((toasts2) => {
51307
- const indexOfExistingToast = toasts2.findIndex((t) => t.id === toast2.id);
51308
- if (indexOfExistingToast !== -1) {
51309
- return [
51310
- ...toasts2.slice(0, indexOfExistingToast),
51311
- {
51312
- ...toasts2[indexOfExistingToast],
51313
- ...toast2
51314
- },
51315
- ...toasts2.slice(indexOfExistingToast + 1)
51316
- ];
51317
- }
51318
- return [
51319
- toast2,
51320
- ...toasts2
51321
- ];
51322
- });
51323
- });
51324
- });
51325
- });
51326
- }, [
51327
- toasts
51328
- ]);
51329
- ReactExports.useEffect(() => {
51330
- if (theme3 !== "system") {
51331
- setActualTheme(theme3);
51332
- return;
51430
+ return jsxRuntimeExports.jsxs("span", { children: [name2 != null && jsxRuntimeExports.jsx(ObjectName, { name: name2 }), name2 != null && jsxRuntimeExports.jsx("span", { children: ": " }), label] });
51431
+ }
51432
+ if (isStreamRef(data)) {
51433
+ return jsxRuntimeExports.jsxs("span", { children: [name2 != null && jsxRuntimeExports.jsx(ObjectName, { name: name2 }), name2 != null && jsxRuntimeExports.jsx("span", { children: ": " }), jsxRuntimeExports.jsx(StreamRefInline, { streamRef: data })] });
51434
+ }
51435
+ if (isClassInstanceRef(data)) {
51436
+ if (depth === 0) {
51437
+ return jsxRuntimeExports.jsx(ObjectRootLabel, { name: data.className, data: data.data });
51333
51438
  }
51334
- if (theme3 === "system") {
51335
- if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) {
51336
- setActualTheme("dark");
51337
- } else {
51338
- setActualTheme("light");
51339
- }
51439
+ return jsxRuntimeExports.jsxs("span", { children: [name2 != null && jsxRuntimeExports.jsx(ObjectName, { name: name2 }), name2 != null && jsxRuntimeExports.jsx("span", { children: ": " }), jsxRuntimeExports.jsxs("span", { style: { fontStyle: "italic" }, children: [data.className, " "] }), jsxRuntimeExports.jsx(ObjectValue, { object: data.data })] });
51440
+ }
51441
+ if (data instanceof Date) {
51442
+ const dateStr = data.toISOString();
51443
+ if (depth === 0) {
51444
+ return jsxRuntimeExports.jsx("span", { style: { color: extendedTheme.OBJECT_VALUE_DATE_COLOR }, children: dateStr });
51340
51445
  }
51341
- if (typeof window === "undefined") return;
51342
- const darkMediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
51343
- try {
51344
- darkMediaQuery.addEventListener("change", ({ matches }) => {
51345
- if (matches) {
51346
- setActualTheme("dark");
51347
- } else {
51348
- setActualTheme("light");
51349
- }
51350
- });
51351
- } catch (error2) {
51352
- darkMediaQuery.addListener(({ matches }) => {
51353
- try {
51354
- if (matches) {
51355
- setActualTheme("dark");
51356
- } else {
51357
- setActualTheme("light");
51358
- }
51359
- } catch (e) {
51360
- console.error(e);
51361
- }
51362
- });
51446
+ return jsxRuntimeExports.jsxs("span", { children: [name2 != null && jsxRuntimeExports.jsx(ObjectName, { name: name2 }), name2 != null && jsxRuntimeExports.jsx("span", { children: ": " }), jsxRuntimeExports.jsx("span", { style: { color: extendedTheme.OBJECT_VALUE_DATE_COLOR }, children: dateStr })] });
51447
+ }
51448
+ if (depth === 0) {
51449
+ return jsxRuntimeExports.jsx(ObjectRootLabel, { name: name2, data });
51450
+ }
51451
+ return jsxRuntimeExports.jsx(ObjectLabel, { name: name2, data, isNonenumerable });
51452
+ }
51453
+ function DataInspector({ data, expandLevel = 2, name: name2, onStreamClick, onDecrypt, isDecrypting = false }) {
51454
+ const stableData = useStableInspectorData(data);
51455
+ const [initialExpandLevel, setInitialExpandLevel] = reactExports.useState(expandLevel);
51456
+ const isDark = useDarkMode();
51457
+ const extendedTheme = isDark ? inspectorThemeExtendedDark : inspectorThemeExtendedLight;
51458
+ reactExports.useEffect(() => {
51459
+ setInitialExpandLevel(0);
51460
+ }, []);
51461
+ const content2 = jsxRuntimeExports.jsx(ExtendedThemeContext.Provider, { value: extendedTheme, children: jsxRuntimeExports.jsx(themedObjectInspector, {
51462
+ data: stableData,
51463
+ name: name2,
51464
+ // @ts-expect-error react-inspector accepts theme objects at runtime despite
51465
+ // types declaring string only — see https://github.com/storybookjs/react-inspector/blob/main/README.md#theme
51466
+ theme: isDark ? inspectorThemeDark : inspectorThemeLight,
51467
+ expandLevel: initialExpandLevel,
51468
+ nodeRenderer: NodeRenderer$1
51469
+ }) });
51470
+ let wrapped = content2;
51471
+ if (onStreamClick) {
51472
+ wrapped = jsxRuntimeExports.jsx(StreamClickContext.Provider, { value: onStreamClick, children: wrapped });
51473
+ }
51474
+ if (onDecrypt) {
51475
+ wrapped = jsxRuntimeExports.jsx(DecryptClickContext.Provider, { value: { onDecrypt, isDecrypting }, children: wrapped });
51476
+ }
51477
+ return wrapped;
51478
+ }
51479
+ function useStableInspectorData(next2) {
51480
+ const previousRef = reactExports.useRef(next2);
51481
+ if (!isDeepEqual(previousRef.current, next2)) {
51482
+ previousRef.current = next2;
51483
+ }
51484
+ return previousRef.current;
51485
+ }
51486
+ function isObjectLike(value) {
51487
+ return typeof value === "object" && value !== null;
51488
+ }
51489
+ function isDeepEqual(a2, b2, seen = /* @__PURE__ */ new WeakMap()) {
51490
+ if (Object.is(a2, b2))
51491
+ return true;
51492
+ if (a2 instanceof Date && b2 instanceof Date) {
51493
+ return a2.getTime() === b2.getTime();
51494
+ }
51495
+ if (a2 instanceof RegExp && b2 instanceof RegExp) {
51496
+ return a2.source === b2.source && a2.flags === b2.flags;
51497
+ }
51498
+ if (a2 instanceof Map && b2 instanceof Map) {
51499
+ if (a2.size !== b2.size)
51500
+ return false;
51501
+ for (const [key, value] of a2.entries()) {
51502
+ if (!b2.has(key) || !isDeepEqual(value, b2.get(key), seen))
51503
+ return false;
51363
51504
  }
51364
- }, [
51365
- theme3
51366
- ]);
51367
- ReactExports.useEffect(() => {
51368
- if (toasts.length <= 1) {
51369
- setExpanded(false);
51505
+ return true;
51506
+ }
51507
+ if (a2 instanceof Set && b2 instanceof Set) {
51508
+ if (a2.size !== b2.size)
51509
+ return false;
51510
+ for (const value of a2.values()) {
51511
+ if (!b2.has(value))
51512
+ return false;
51370
51513
  }
51371
- }, [
51372
- toasts
51373
- ]);
51374
- ReactExports.useEffect(() => {
51375
- const handleKeyDown = (event) => {
51376
- var _listRef_current;
51377
- const isHotkeyPressed = hotkey.every((key) => event[key] || event.code === key);
51378
- if (isHotkeyPressed) {
51379
- var _listRef_current1;
51380
- setExpanded(true);
51381
- (_listRef_current1 = listRef.current) == null ? void 0 : _listRef_current1.focus();
51382
- }
51383
- if (event.code === "Escape" && (document.activeElement === listRef.current || ((_listRef_current = listRef.current) == null ? void 0 : _listRef_current.contains(document.activeElement)))) {
51384
- setExpanded(false);
51385
- }
51386
- };
51387
- document.addEventListener("keydown", handleKeyDown);
51388
- return () => document.removeEventListener("keydown", handleKeyDown);
51389
- }, [
51390
- hotkey
51391
- ]);
51392
- ReactExports.useEffect(() => {
51393
- if (listRef.current) {
51394
- return () => {
51395
- if (lastFocusedElementRef.current) {
51396
- lastFocusedElementRef.current.focus({
51397
- preventScroll: true
51398
- });
51399
- lastFocusedElementRef.current = null;
51400
- isFocusWithinRef.current = false;
51401
- }
51402
- };
51514
+ return true;
51515
+ }
51516
+ if (!isObjectLike(a2) || !isObjectLike(b2)) {
51517
+ return false;
51518
+ }
51519
+ if (seen.get(a2) === b2)
51520
+ return true;
51521
+ seen.set(a2, b2);
51522
+ const aIsArray = Array.isArray(a2);
51523
+ const bIsArray = Array.isArray(b2);
51524
+ if (aIsArray !== bIsArray)
51525
+ return false;
51526
+ if (aIsArray && bIsArray) {
51527
+ if (a2.length !== b2.length)
51528
+ return false;
51529
+ for (let i = 0; i < a2.length; i += 1) {
51530
+ if (!isDeepEqual(a2[i], b2[i], seen))
51531
+ return false;
51403
51532
  }
51404
- }, [
51405
- listRef.current
51406
- ]);
51407
- return (
51408
- // Remove item from normal navigation flow, only available via hotkey
51409
- /* @__PURE__ */ ReactExports.createElement("section", {
51410
- ref,
51411
- "aria-label": `${containerAriaLabel} ${hotkeyLabel}`,
51412
- tabIndex: -1,
51413
- "aria-live": "polite",
51414
- "aria-relevant": "additions text",
51415
- "aria-atomic": "false",
51416
- suppressHydrationWarning: true
51417
- }, possiblePositions.map((position3, index2) => {
51418
- var _heights_;
51419
- const [y2, x2] = position3.split("-");
51420
- if (!filteredToasts.length) return null;
51421
- return /* @__PURE__ */ ReactExports.createElement("ol", {
51422
- key: position3,
51423
- dir: dir === "auto" ? getDocumentDirection() : dir,
51424
- tabIndex: -1,
51425
- ref: listRef,
51426
- className,
51427
- "data-sonner-toaster": true,
51428
- "data-sonner-theme": actualTheme,
51429
- "data-y-position": y2,
51430
- "data-x-position": x2,
51431
- style: {
51432
- "--front-toast-height": `${((_heights_ = heights[0]) == null ? void 0 : _heights_.height) || 0}px`,
51433
- "--width": `${TOAST_WIDTH}px`,
51434
- "--gap": `${gap}px`,
51435
- ...style2,
51436
- ...assignOffset(offset2, mobileOffset)
51437
- },
51438
- onBlur: (event) => {
51439
- if (isFocusWithinRef.current && !event.currentTarget.contains(event.relatedTarget)) {
51440
- isFocusWithinRef.current = false;
51441
- if (lastFocusedElementRef.current) {
51442
- lastFocusedElementRef.current.focus({
51443
- preventScroll: true
51444
- });
51445
- lastFocusedElementRef.current = null;
51446
- }
51447
- }
51448
- },
51449
- onFocus: (event) => {
51450
- const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === "false";
51451
- if (isNotDismissible) return;
51452
- if (!isFocusWithinRef.current) {
51453
- isFocusWithinRef.current = true;
51454
- lastFocusedElementRef.current = event.relatedTarget;
51455
- }
51456
- },
51457
- onMouseEnter: () => setExpanded(true),
51458
- onMouseMove: () => setExpanded(true),
51459
- onMouseLeave: () => {
51460
- if (!interacting) {
51461
- setExpanded(false);
51462
- }
51463
- },
51464
- onDragEnd: () => setExpanded(false),
51465
- onPointerDown: (event) => {
51466
- const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === "false";
51467
- if (isNotDismissible) return;
51468
- setInteracting(true);
51469
- },
51470
- onPointerUp: () => setInteracting(false)
51471
- }, filteredToasts.filter((toast2) => !toast2.position && index2 === 0 || toast2.position === position3).map((toast2, index3) => {
51472
- var _toastOptions_duration, _toastOptions_closeButton;
51473
- return /* @__PURE__ */ ReactExports.createElement(Toast, {
51474
- key: toast2.id,
51475
- icons,
51476
- index: index3,
51477
- toast: toast2,
51478
- defaultRichColors: richColors,
51479
- duration: (_toastOptions_duration = toastOptions == null ? void 0 : toastOptions.duration) != null ? _toastOptions_duration : duration2,
51480
- className: toastOptions == null ? void 0 : toastOptions.className,
51481
- descriptionClassName: toastOptions == null ? void 0 : toastOptions.descriptionClassName,
51482
- invert,
51483
- visibleToasts,
51484
- closeButton: (_toastOptions_closeButton = toastOptions == null ? void 0 : toastOptions.closeButton) != null ? _toastOptions_closeButton : closeButton,
51485
- interacting,
51486
- position: position3,
51487
- style: toastOptions == null ? void 0 : toastOptions.style,
51488
- unstyled: toastOptions == null ? void 0 : toastOptions.unstyled,
51489
- classNames: toastOptions == null ? void 0 : toastOptions.classNames,
51490
- cancelButtonStyle: toastOptions == null ? void 0 : toastOptions.cancelButtonStyle,
51491
- actionButtonStyle: toastOptions == null ? void 0 : toastOptions.actionButtonStyle,
51492
- closeButtonAriaLabel: toastOptions == null ? void 0 : toastOptions.closeButtonAriaLabel,
51493
- removeToast,
51494
- toasts: filteredToasts.filter((t) => t.position == toast2.position),
51495
- heights: heights.filter((h2) => h2.position == toast2.position),
51496
- setHeights,
51497
- expandByDefault: expand2,
51498
- gap,
51499
- expanded: expanded2,
51500
- swipeDirections: props.swipeDirections
51501
- });
51502
- }));
51503
- }))
51504
- );
51505
- });
51506
- const defaultAdapter = {
51507
- success: (msg, opts) => toast.success(msg, opts),
51508
- error: (msg, opts) => toast.error(msg, opts),
51509
- info: (msg, opts) => toast.info(msg, opts)
51510
- };
51511
- const ToastContext = reactExports.createContext(defaultAdapter);
51512
- function useToast() {
51513
- return reactExports.useContext(ToastContext);
51533
+ return true;
51534
+ }
51535
+ const aKeys = Object.keys(a2);
51536
+ const bKeys = Object.keys(b2);
51537
+ if (aKeys.length !== bKeys.length)
51538
+ return false;
51539
+ for (const key of aKeys) {
51540
+ if (!Object.hasOwn(b2, key))
51541
+ return false;
51542
+ if (!isDeepEqual(a2[key], b2[key], seen))
51543
+ return false;
51544
+ }
51545
+ return true;
51514
51546
  }
51515
51547
  function isStructuredErrorWithStack(value) {
51516
51548
  return value != null && typeof value === "object" && "stack" in value && typeof value.stack === "string";
@@ -52068,7 +52100,7 @@ function RowsSkeleton() {
52068
52100
  marginLeft: i % 4 === 0 ? 5 : 6
52069
52101
  } })] }), jsxRuntimeExports.jsx("div", { className: "w-5 flex-shrink-0 flex items-center justify-center", children: jsxRuntimeExports.jsx(Skeleton$2, { className: "w-5 h-5", style: { borderRadius: 4 } }) }), jsxRuntimeExports.jsx("div", { className: "min-w-0 px-4", style: { flex: "2 1 0%" }, children: jsxRuntimeExports.jsx(Skeleton$2, { className: "h-3", style: { width: "70%" } }) }), jsxRuntimeExports.jsxs("div", { className: "min-w-0 px-4 flex items-center gap-1.5", style: { flex: "2 1 0%" }, children: [jsxRuntimeExports.jsx(Skeleton$2, { className: "flex-shrink-0", style: { width: 6, height: 6, borderRadius: "50%" } }), jsxRuntimeExports.jsx(Skeleton$2, { className: "h-3", style: { width: "60%" } })] }), jsxRuntimeExports.jsx("div", { className: "min-w-0 px-4", style: { flex: "2 1 0%" }, children: jsxRuntimeExports.jsx(Skeleton$2, { className: "h-3", style: { width: "50%" } }) }), jsxRuntimeExports.jsx("div", { className: "min-w-0 px-4", style: { flex: "3 1 0%" }, children: jsxRuntimeExports.jsx(Skeleton$2, { className: "h-3", style: { width: "75%" } }) }), jsxRuntimeExports.jsx("div", { className: "min-w-0 px-4", style: { flex: "3 1 0%" }, children: jsxRuntimeExports.jsx(Skeleton$2, { className: "h-3", style: { width: "75%" } }) })] }, i)) });
52070
52102
  }
52071
- function EventRow({ event, index: index2, isFirst, isLast, isExpanded, onToggleExpand, activeGroupKey, selectedGroupKey, selectedGroupRange, correlationNameMap, workflowName, durationMap, onSelectGroup, onHoverGroup, onLoadEventData, cachedEventData, onCacheEventData, encryptionKey, onEncryptedDataDetected }) {
52103
+ function EventRow({ event, index: index2, isFirst, isLast, isExpanded, onToggleExpand, activeGroupKey, selectedGroupKey, selectedGroupRange, correlationNameMap, workflowName, durationMap, onSelectGroup, onHoverGroup, onLoadEventData, cachedEventData, onCacheEventData, encryptionKey, onEncryptedDataDetected, suppressGroupDimming = false }) {
52072
52104
  const [isLoading, setIsLoading] = reactExports.useState(false);
52073
52105
  const [loadedEventData, setLoadedEventData] = reactExports.useState(cachedEventData);
52074
52106
  const [loadError, setLoadError] = reactExports.useState(null);
@@ -52088,7 +52120,7 @@ function EventRow({ event, index: index2, isFirst, isLast, isExpanded, onToggleE
52088
52120
  const durationInfo = durationKey ? durationMap.get(durationKey) : void 0;
52089
52121
  const hasActive = activeGroupKey !== void 0;
52090
52122
  const isRelated = rowGroupKey !== void 0 && rowGroupKey === activeGroupKey;
52091
- const isDimmed = hasActive && !isRelated;
52123
+ const isDimmed = hasActive && !isRelated && !suppressGroupDimming;
52092
52124
  const isPulsing = hasActive && isRelated;
52093
52125
  const showBranch = hasActive && isRelated && !isRun;
52094
52126
  const showLaneLine = selectedGroupRange !== null && index2 >= selectedGroupRange.first && index2 <= selectedGroupRange.last;
@@ -52213,7 +52245,8 @@ function EventRow({ event, index: index2, isFirst, isLast, isExpanded, onToggleE
52213
52245
  color: "var(--ds-red-900)"
52214
52246
  }, children: loadError }) : isLoading || loadedEventData === null && !hasAttemptedLoad && event.correlationId ? jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-2 p-3", children: [jsxRuntimeExports.jsx(Skeleton$2, { className: "h-3", style: { width: "75%" } }), jsxRuntimeExports.jsx(Skeleton$2, { className: "h-3", style: { width: "50%" } }), jsxRuntimeExports.jsx(Skeleton$2, { className: "h-3", style: { width: "60%" } })] }) : jsxRuntimeExports.jsx("div", { className: "p-2 text-xs", style: { color: "var(--ds-gray-900)" }, children: "No data" })] })] })] });
52215
52247
  }
52216
- function EventListView({ events: events2, run, onLoadEventData, hasMoreEvents = false, isLoadingMoreEvents = false, onLoadMoreEvents, encryptionKey, isLoading = false, sortOrder: sortOrderProp, onSortOrderChange, onDecrypt, isDecrypting = false, hasEncryptedData: hasEncryptedDataProp = false }) {
52248
+ function EventListView({ events: events2, run, onLoadEventData, hasMoreEvents = false, isLoadingMoreEvents = false, onLoadMoreEvents, encryptionKey, isLoading = false, sortOrder: sortOrderProp, onSortOrderChange, onDecrypt, isDecrypting = false, hasEncryptedData: hasEncryptedDataProp = false, onExactIdSearch }) {
52249
+ const toast2 = useToast();
52217
52250
  const [internalSortOrder, setInternalSortOrder] = reactExports.useState("asc");
52218
52251
  const effectiveSortOrder = sortOrderProp ?? internalSortOrder;
52219
52252
  const handleSortOrderChange = reactExports.useCallback((order2) => {
@@ -52223,28 +52256,40 @@ function EventListView({ events: events2, run, onLoadEventData, hasMoreEvents =
52223
52256
  setInternalSortOrder(order2);
52224
52257
  }
52225
52258
  }, [onSortOrderChange]);
52259
+ const [searchQuery, setSearchQuery] = reactExports.useState("");
52260
+ const [searchResults, setSearchResults] = reactExports.useState(null);
52261
+ const [searchResultsTruncated, setSearchResultsTruncated] = reactExports.useState(false);
52262
+ const [searchError, setSearchError] = reactExports.useState(null);
52263
+ const [searchLoading, setSearchLoading] = reactExports.useState(false);
52264
+ const [searchNotFound, setSearchNotFound] = reactExports.useState(false);
52265
+ const searchRequestRef = reactExports.useRef(0);
52266
+ const virtuosoRef = reactExports.useRef(null);
52267
+ const parsedSearchId = reactExports.useMemo(() => parseExactWorkflowSearchId(searchQuery), [searchQuery]);
52268
+ const isExactSearchActive = searchResults !== null;
52226
52269
  const sortedEvents2 = reactExports.useMemo(() => {
52227
- if (!events2 || events2.length === 0)
52270
+ const sourceEvents = isExactSearchActive ? searchResults : events2 ?? [];
52271
+ if (sourceEvents.length === 0)
52228
52272
  return [];
52229
52273
  const dir = effectiveSortOrder === "desc" ? -1 : 1;
52230
- return [...events2].sort((a2, b2) => dir * (new Date(a2.createdAt).getTime() - new Date(b2.createdAt).getTime()));
52231
- }, [events2, effectiveSortOrder]);
52274
+ return [...sourceEvents].sort((a2, b2) => dir * (new Date(a2.createdAt).getTime() - new Date(b2.createdAt).getTime()));
52275
+ }, [events2, effectiveSortOrder, isExactSearchActive, searchResults]);
52232
52276
  const hasEncryptedInlineData = reactExports.useMemo(() => {
52233
- if (!events2)
52277
+ const sourceEvents = isExactSearchActive ? searchResults : events2;
52278
+ if (!sourceEvents)
52234
52279
  return false;
52235
- for (const event of events2) {
52280
+ for (const event of sourceEvents) {
52236
52281
  const ed = event.eventData;
52237
52282
  if (hasEncryptedValues(ed))
52238
52283
  return true;
52239
52284
  }
52240
52285
  return false;
52241
- }, [events2]);
52286
+ }, [events2, isExactSearchActive, searchResults]);
52242
52287
  const [foundEncryptedInLazyData, setFoundEncryptedInLazyData] = reactExports.useState(false);
52243
52288
  const handleEncryptedDataDetected = reactExports.useCallback(() => {
52244
52289
  setFoundEncryptedInLazyData(true);
52245
52290
  }, []);
52246
52291
  const hasEncryptedData = hasEncryptedDataProp || hasEncryptedInlineData || foundEncryptedInLazyData;
52247
- const { correlationNameMap, workflowName } = reactExports.useMemo(() => buildNameMaps(events2 ?? null, run ?? null), [events2, run]);
52292
+ const { correlationNameMap, workflowName } = reactExports.useMemo(() => buildNameMaps(isExactSearchActive ? searchResults : events2 ?? null, run ?? null), [events2, isExactSearchActive, run, searchResults]);
52248
52293
  const durationMap = reactExports.useMemo(() => buildDurationMap(sortedEvents2), [sortedEvents2]);
52249
52294
  const [selectedGroupKey, setSelectedGroupKey] = reactExports.useState(void 0);
52250
52295
  const [hoveredGroupKey, setHoveredGroupKey] = reactExports.useState(void 0);
@@ -52312,58 +52357,100 @@ function EventListView({ events: events2, run, onLoadEventData, hasMoreEvents =
52312
52357
  }
52313
52358
  return first >= 0 ? { first, last } : null;
52314
52359
  }, [activeGroupKey, sortedEvents2]);
52315
- const [searchQuery, setSearchQuery] = reactExports.useState("");
52316
- const virtuosoRef = reactExports.useRef(null);
52317
- const searchIndex = reactExports.useMemo(() => {
52318
- const entries = [];
52319
- for (let i = 0; i < sortedEvents2.length; i++) {
52320
- const ev = sortedEvents2[i];
52321
- const isRun = isRunLevel(ev.eventType);
52322
- const name2 = isRun ? workflowName ?? "" : ev.correlationId ? correlationNameMap.get(ev.correlationId) ?? "" : "";
52323
- entries.push({
52324
- fields: [
52325
- ev.eventId,
52326
- ev.correlationId ?? "",
52327
- ev.eventType,
52328
- formatEventType(ev.eventType),
52329
- name2
52330
- ].map((f2) => f2.toLowerCase()),
52331
- groupKey: ev.correlationId ?? (isRun ? "__run__" : void 0),
52332
- eventId: ev.eventId,
52333
- index: i
52334
- });
52335
- }
52336
- return entries;
52337
- }, [sortedEvents2, correlationNameMap, workflowName]);
52338
52360
  reactExports.useEffect(() => {
52339
- var _a3;
52340
- const q2 = searchQuery.trim().toLowerCase();
52341
- if (!q2) {
52361
+ const trimmed = searchQuery.trim();
52362
+ if (!trimmed) {
52363
+ searchRequestRef.current += 1;
52364
+ setSearchResults(null);
52365
+ setSearchResultsTruncated(false);
52366
+ setSearchError(null);
52367
+ setSearchLoading(false);
52368
+ setSearchNotFound(false);
52342
52369
  setSelectedGroupKey(void 0);
52343
52370
  return;
52344
52371
  }
52345
- let bestMatch = null;
52346
- let bestScore = 0;
52347
- for (const entry2 of searchIndex) {
52348
- for (const field of entry2.fields) {
52349
- if (field && field.includes(q2)) {
52350
- const score = q2.length / field.length;
52351
- if (score > bestScore) {
52352
- bestScore = score;
52353
- bestMatch = entry2;
52372
+ const parsed = parseExactWorkflowSearchId(trimmed);
52373
+ if (!parsed || !onExactIdSearch) {
52374
+ setSearchResults(null);
52375
+ setSearchLoading(false);
52376
+ setSearchNotFound(false);
52377
+ return;
52378
+ }
52379
+ const requestId = ++searchRequestRef.current;
52380
+ setSearchLoading(true);
52381
+ setSearchNotFound(false);
52382
+ setSearchError(null);
52383
+ const abortController = new AbortController();
52384
+ const timer2 = setTimeout(() => {
52385
+ void (async () => {
52386
+ var _a3;
52387
+ try {
52388
+ const results = await onExactIdSearch(parsed.id, parsed.kind, abortController.signal);
52389
+ if (abortController.signal.aborted || searchRequestRef.current !== requestId) {
52390
+ return;
52391
+ }
52392
+ if (results.status === "error") {
52393
+ setSearchResults([]);
52394
+ setSearchResultsTruncated(false);
52395
+ setSearchNotFound(false);
52396
+ setSearchError(results.message);
52397
+ setSelectedGroupKey(void 0);
52398
+ return;
52399
+ }
52400
+ if (results.status === "not_found" || results.status === "ok" && results.events.length === 0) {
52401
+ setSearchResults([]);
52402
+ setSearchResultsTruncated(false);
52403
+ setSearchNotFound(true);
52404
+ setSearchError(null);
52405
+ setSelectedGroupKey(void 0);
52406
+ return;
52407
+ }
52408
+ setSearchResults(results.events);
52409
+ setSearchResultsTruncated(Boolean(results.truncated));
52410
+ setSearchNotFound(false);
52411
+ setSearchError(null);
52412
+ setSelectedGroupKey(parsed.kind === "event" ? (() => {
52413
+ const first = results.events[0];
52414
+ if (!first)
52415
+ return void 0;
52416
+ return isRunLevel(first.eventType) ? "__run__" : first.correlationId ?? void 0;
52417
+ })() : parsed.id);
52418
+ (_a3 = virtuosoRef.current) == null ? void 0 : _a3.scrollToIndex({
52419
+ index: 0,
52420
+ align: "start",
52421
+ behavior: "smooth"
52422
+ });
52423
+ } catch {
52424
+ if (abortController.signal.aborted || searchRequestRef.current !== requestId) {
52425
+ return;
52426
+ }
52427
+ setSearchResults([]);
52428
+ setSearchResultsTruncated(false);
52429
+ setSearchNotFound(false);
52430
+ setSearchError("Failed to search events. Try again.");
52431
+ setSelectedGroupKey(void 0);
52432
+ } finally {
52433
+ if (searchRequestRef.current === requestId && !abortController.signal.aborted) {
52434
+ setSearchLoading(false);
52354
52435
  }
52355
52436
  }
52356
- }
52437
+ })();
52438
+ }, 300);
52439
+ return () => {
52440
+ clearTimeout(timer2);
52441
+ abortController.abort();
52442
+ };
52443
+ }, [searchQuery, onExactIdSearch]);
52444
+ const handleSearchKeyDown = reactExports.useCallback((event) => {
52445
+ if (event.key !== "Enter") {
52446
+ return;
52357
52447
  }
52358
- if (bestMatch) {
52359
- setSelectedGroupKey(bestMatch.groupKey);
52360
- (_a3 = virtuosoRef.current) == null ? void 0 : _a3.scrollToIndex({
52361
- index: bestMatch.index,
52362
- align: "center",
52363
- behavior: "smooth"
52364
- });
52448
+ const trimmed = searchQuery.trim();
52449
+ if (!trimmed || parseExactWorkflowSearchId(trimmed) || !onExactIdSearch || !looksLikeWorkflowIdSearchInput(trimmed)) {
52450
+ return;
52365
52451
  }
52366
- }, [searchQuery, searchIndex]);
52452
+ toast2.info("Enter a full step ID, wait ID, hook ID, or event ID");
52453
+ }, [searchQuery, onExactIdSearch, toast2]);
52367
52454
  const hasHadEventsRef = reactExports.useRef(false);
52368
52455
  if (sortedEvents2.length > 0) {
52369
52456
  hasHadEventsRef.current = true;
@@ -52373,9 +52460,6 @@ function EventListView({ events: events2, run, onLoadEventData, hasMoreEvents =
52373
52460
  if (isInitialLoad) {
52374
52461
  return jsxRuntimeExports.jsxs("div", { className: "h-full flex flex-col overflow-hidden", children: [jsxRuntimeExports.jsx("div", { style: { padding: 6 }, children: jsxRuntimeExports.jsx(Skeleton$2, { style: { height: 40, borderRadius: 6 } }) }), jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-0 h-10 border-b flex-shrink-0", style: { borderColor: "var(--ds-gray-alpha-200)" }, children: [jsxRuntimeExports.jsx("div", { className: "flex-shrink-0", style: { width: GUTTER_WIDTH } }), jsxRuntimeExports.jsx("div", { className: "w-5 flex-shrink-0" }), jsxRuntimeExports.jsx("div", { className: "min-w-0 px-4", style: { flex: "2 1 0%" }, children: jsxRuntimeExports.jsx(Skeleton$2, { className: "h-3", style: { width: 40 } }) }), jsxRuntimeExports.jsx("div", { className: "min-w-0 px-4", style: { flex: "2 1 0%" }, children: jsxRuntimeExports.jsx(Skeleton$2, { className: "h-3", style: { width: 72 } }) }), jsxRuntimeExports.jsx("div", { className: "min-w-0 px-4", style: { flex: "2 1 0%" }, children: jsxRuntimeExports.jsx(Skeleton$2, { className: "h-3", style: { width: 44 } }) }), jsxRuntimeExports.jsx("div", { className: "min-w-0 px-4", style: { flex: "3 1 0%" }, children: jsxRuntimeExports.jsx(Skeleton$2, { className: "h-3", style: { width: 92 } }) }), jsxRuntimeExports.jsx("div", { className: "min-w-0 px-4", style: { flex: "3 1 0%" }, children: jsxRuntimeExports.jsx(Skeleton$2, { className: "h-3", style: { width: 60 } }) })] }), jsxRuntimeExports.jsx(RowsSkeleton, {})] });
52375
52462
  }
52376
- if (!isLoading && (!events2 || events2.length === 0)) {
52377
- return jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center h-full text-sm", style: { color: "var(--ds-gray-700)" }, children: "No events found" });
52378
- }
52379
52463
  return jsxRuntimeExports.jsx(DecryptClickContext.Provider, { value: onDecrypt ? { onDecrypt, isDecrypting } : void 0, children: jsxRuntimeExports.jsxs("div", { className: "h-full flex flex-col overflow-hidden", children: [jsxRuntimeExports.jsx("style", { children: `@keyframes workflow-dot-pulse{0%{transform:scale(1);opacity:.7}70%,100%{transform:scale(2.2);opacity:0}}` }), jsxRuntimeExports.jsxs("div", { style: {
52380
52464
  padding: 6,
52381
52465
  backgroundColor: "var(--ds-background-100)",
@@ -52399,7 +52483,7 @@ function EventListView({ events: events2, run, onLoadEventData, hasMoreEvents =
52399
52483
  justifyContent: "center",
52400
52484
  color: "var(--ds-gray-800)",
52401
52485
  flexShrink: 0
52402
- }, children: jsxRuntimeExports.jsxs("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", focusable: "false", children: [jsxRuntimeExports.jsx("circle", { cx: "7", cy: "7", r: "4.5", stroke: "currentColor", strokeWidth: "1.5" }), jsxRuntimeExports.jsx("path", { d: "M11.5 11.5L14 14", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })] }) }), jsxRuntimeExports.jsx("input", { type: "search", placeholder: "Search by name, event type, or ID…", value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), style: {
52486
+ }, children: jsxRuntimeExports.jsxs("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", focusable: "false", children: [jsxRuntimeExports.jsx("circle", { cx: "7", cy: "7", r: "4.5", stroke: "currentColor", strokeWidth: "1.5" }), jsxRuntimeExports.jsx("path", { d: "M11.5 11.5L14 14", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })] }) }), jsxRuntimeExports.jsx("input", { type: "search", placeholder: "Search by step ID, wait ID, hook ID, or event ID…", value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), onKeyDown: handleSearchKeyDown, disabled: !onExactIdSearch, title: onExactIdSearch ? void 0 : "Exact ID search is unavailable in this view.", style: {
52403
52487
  marginLeft: -16,
52404
52488
  paddingInline: 12,
52405
52489
  fontFamily: "inherit",
@@ -52408,24 +52492,26 @@ function EventListView({ events: events2, run, onLoadEventData, hasMoreEvents =
52408
52492
  border: "none",
52409
52493
  outline: "none",
52410
52494
  height: 40,
52411
- width: "100%"
52495
+ width: "100%",
52496
+ opacity: onExactIdSearch ? 1 : 0.5,
52497
+ cursor: onExactIdSearch ? "text" : "not-allowed"
52412
52498
  } })] }), jsxRuntimeExports.jsx(MenuDropdown, { options: SORT_OPTIONS, value: effectiveSortOrder, onChange: handleSortOrderChange }), (hasEncryptedData || encryptionKey) && onDecrypt && jsxRuntimeExports.jsx(DecryptButton, { decrypted: !!encryptionKey, loading: isDecrypting, onClick: onDecrypt })] }), jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-0 text-[13px] font-medium h-10 border-b flex-shrink-0", style: {
52413
52499
  borderColor: "var(--ds-gray-alpha-200)",
52414
52500
  color: "var(--ds-gray-900)",
52415
52501
  backgroundColor: "var(--ds-background-100)"
52416
- }, children: [jsxRuntimeExports.jsx("div", { className: "flex-shrink-0", style: { width: GUTTER_WIDTH } }), jsxRuntimeExports.jsx("div", { className: "w-5 flex-shrink-0" }), jsxRuntimeExports.jsx("div", { className: "min-w-0 px-4", style: { flex: "2 1 0%" }, children: "Time" }), jsxRuntimeExports.jsx("div", { className: "min-w-0 px-4", style: { flex: "2 1 0%" }, children: "Event Type" }), jsxRuntimeExports.jsx("div", { className: "min-w-0 px-4", style: { flex: "2 1 0%" }, children: "Name" }), jsxRuntimeExports.jsx("div", { className: "min-w-0 px-4", style: { flex: "3 1 0%" }, children: "Correlation ID" }), jsxRuntimeExports.jsx("div", { className: "min-w-0 px-4", style: { flex: "3 1 0%" }, children: "Event ID" })] }), isRefetching ? jsxRuntimeExports.jsx(RowsSkeleton, {}) : jsxRuntimeExports.jsx(Yr, { ref: virtuosoRef, totalCount: sortedEvents2.length, overscan: 20, defaultItemHeight: 40, endReached: () => {
52417
- if (!hasMoreEvents || isLoadingMoreEvents) {
52502
+ }, children: [jsxRuntimeExports.jsx("div", { className: "flex-shrink-0", style: { width: GUTTER_WIDTH } }), jsxRuntimeExports.jsx("div", { className: "w-5 flex-shrink-0" }), jsxRuntimeExports.jsx("div", { className: "min-w-0 px-4", style: { flex: "2 1 0%" }, children: "Time" }), jsxRuntimeExports.jsx("div", { className: "min-w-0 px-4", style: { flex: "2 1 0%" }, children: "Event Type" }), jsxRuntimeExports.jsx("div", { className: "min-w-0 px-4", style: { flex: "2 1 0%" }, children: "Name" }), jsxRuntimeExports.jsx("div", { className: "min-w-0 px-4", style: { flex: "3 1 0%" }, children: "Correlation ID" }), jsxRuntimeExports.jsx("div", { className: "min-w-0 px-4", style: { flex: "3 1 0%" }, children: "Event ID" })] }), isRefetching || searchLoading ? jsxRuntimeExports.jsx(RowsSkeleton, {}) : sortedEvents2.length === 0 ? jsxRuntimeExports.jsx("div", { className: "flex flex-1 items-center justify-center px-6 text-center text-sm", style: { color: "var(--ds-gray-700)" }, children: searchNotFound && searchQuery.trim() ? `No events found for ${searchQuery.trim()}` : searchError ? searchError : parsedSearchId && searchQuery.trim() && !onExactIdSearch ? "Exact ID search is unavailable in this view." : "No events found" }) : jsxRuntimeExports.jsx(Yr, { ref: virtuosoRef, totalCount: sortedEvents2.length, overscan: 20, defaultItemHeight: 40, endReached: () => {
52503
+ if (isExactSearchActive || !hasMoreEvents || isLoadingMoreEvents) {
52418
52504
  return;
52419
52505
  }
52420
52506
  void (onLoadMoreEvents == null ? void 0 : onLoadMoreEvents());
52421
52507
  }, itemContent: (index2) => {
52422
52508
  const ev = sortedEvents2[index2];
52423
- return jsxRuntimeExports.jsx(EventRow, { event: ev, index: index2, isFirst: index2 === 0, isLast: index2 === sortedEvents2.length - 1, isExpanded: expandedEventIds.has(ev.eventId), onToggleExpand: toggleEventExpanded, activeGroupKey, selectedGroupKey, selectedGroupRange, correlationNameMap, workflowName, durationMap, onSelectGroup, onHoverGroup, onLoadEventData, cachedEventData: eventDataCacheRef.current.get(ev.eventId) ?? null, onCacheEventData: cacheEventData, encryptionKey, onEncryptedDataDetected: handleEncryptedDataDetected });
52509
+ return jsxRuntimeExports.jsx(EventRow, { event: ev, index: index2, isFirst: index2 === 0, isLast: index2 === sortedEvents2.length - 1, isExpanded: expandedEventIds.has(ev.eventId), onToggleExpand: toggleEventExpanded, activeGroupKey, selectedGroupKey, selectedGroupRange, correlationNameMap, workflowName, durationMap, onSelectGroup, onHoverGroup, onLoadEventData, cachedEventData: eventDataCacheRef.current.get(ev.eventId) ?? null, onCacheEventData: cacheEventData, encryptionKey, onEncryptedDataDetected: handleEncryptedDataDetected, suppressGroupDimming: isExactSearchActive });
52424
52510
  }, style: { flex: 1, minHeight: 0 } }), jsxRuntimeExports.jsxs("div", { className: "relative flex-shrink-0 flex items-center h-10 border-t px-4 text-xs", style: {
52425
52511
  borderColor: "var(--ds-gray-alpha-200)",
52426
52512
  color: "var(--ds-gray-900)",
52427
52513
  backgroundColor: "var(--ds-background-100)"
52428
- }, children: [jsxRuntimeExports.jsxs("span", { children: [sortedEvents2.length, " event", sortedEvents2.length !== 1 ? "s" : "", " loaded"] }), hasMoreEvents && jsxRuntimeExports.jsx("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none", children: jsxRuntimeExports.jsx("div", { className: "pointer-events-auto", children: jsxRuntimeExports.jsx(LoadMoreButton, { loading: isLoadingMoreEvents, onClick: () => void (onLoadMoreEvents == null ? void 0 : onLoadMoreEvents()) }) }) })] })] }) });
52514
+ }, children: [jsxRuntimeExports.jsx("span", { children: isExactSearchActive ? searchError ? searchError : searchNotFound ? `No events found for ${searchQuery.trim()}` : `${sortedEvents2.length} event${sortedEvents2.length !== 1 ? "s" : ""} for ${searchQuery.trim()}${searchResultsTruncated ? " (results may be truncated)" : ""}` : `${sortedEvents2.length} event${sortedEvents2.length !== 1 ? "s" : ""} loaded` }), !isExactSearchActive && hasMoreEvents && jsxRuntimeExports.jsx("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none", children: jsxRuntimeExports.jsx("div", { className: "pointer-events-auto", children: jsxRuntimeExports.jsx(LoadMoreButton, { loading: isLoadingMoreEvents, onClick: () => void (onLoadMoreEvents == null ? void 0 : onLoadMoreEvents()) }) }) })] })] }) });
52429
52515
  }
52430
52516
  function ResolveHookModal({ isOpen, onClose, onSubmit, isSubmitting = false }) {
52431
52517
  var _a3;
@@ -79302,7 +79388,7 @@ var tn = f("block", "before:content-[counter(line)]", "before:inline-block", "be
79302
79388
  var et = ({ className: e, language: t, style: o, isIncomplete: n, ...s2 }) => jsxRuntimeExports.jsx("div", { className: f("my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2", e), "data-incomplete": n || void 0, "data-language": t, "data-streamdown": "code-block", style: { contentVisibility: "auto", containIntrinsicSize: "auto 200px", ...o }, ...s2 });
79303
79389
  var Se = reactExports.createContext({ code: "" }), de = () => reactExports.useContext(Se);
79304
79390
  var ot = ({ language: e }) => jsxRuntimeExports.jsx("div", { className: "flex h-8 items-center text-muted-foreground text-xs", "data-language": e, "data-streamdown": "code-block-header", children: jsxRuntimeExports.jsx("span", { className: "ml-1 font-mono lowercase", children: e }) });
79305
- var cn$1 = /\n+$/, dn = reactExports.lazy(() => import("./highlighted-body-B3W2YXNL-ByO-v0q1.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
79391
+ var cn$1 = /\n+$/, dn = reactExports.lazy(() => import("./highlighted-body-B3W2YXNL-KnZkHlP2.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
79306
79392
  let i = reactExports.useMemo(() => e.replace(cn$1, ""), [e]), c = reactExports.useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: i.split(`
79307
79393
  `).map((a2) => [{ content: a2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [i]);
79308
79394
  return jsxRuntimeExports.jsx(Se.Provider, { value: { code: e }, children: jsxRuntimeExports.jsxs(et, { isIncomplete: s2, language: t, children: [jsxRuntimeExports.jsx(ot, { language: t }), n ? jsxRuntimeExports.jsx("div", { className: "pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end", children: jsxRuntimeExports.jsx("div", { className: "pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur", "data-streamdown": "code-block-actions", children: n }) }) : null, jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: jsxRuntimeExports.jsx(Qe, { className: o, language: t, result: c, ...r2 }), children: jsxRuntimeExports.jsx(dn, { className: o, code: i, language: t, raw: c, ...r2 }) })] }) });
@@ -79624,7 +79710,7 @@ var Dt = ({ children: e, className: t, onDownload: o, onError: n }) => {
79624
79710
  }, []), jsxRuntimeExports.jsxs("div", { className: "relative", ref: i, children: [jsxRuntimeExports.jsx("button", { className: f("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50", t), disabled: c, onClick: () => r2(!s2), title: "Download table", type: "button", children: e != null ? e : jsxRuntimeExports.jsx(Z, { size: 14 }) }), s2 ? jsxRuntimeExports.jsxs("div", { className: "absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg", children: [jsxRuntimeExports.jsx("button", { className: "w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40", onClick: () => a2("csv"), title: "Download table as CSV", type: "button", children: "CSV" }), jsxRuntimeExports.jsx("button", { className: "w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40", onClick: () => a2("markdown"), title: "Download table as Markdown", type: "button", children: "Markdown" })] }) : null] });
79625
79711
  };
79626
79712
  var Vt = ({ children: e, className: t, showControls: o, ...n }) => jsxRuntimeExports.jsxs("div", { className: "my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2", "data-streamdown": "table-wrapper", children: [o ? jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-end gap-1", children: [jsxRuntimeExports.jsx(Ht, {}), jsxRuntimeExports.jsx(Dt, {})] }) : null, jsxRuntimeExports.jsx("div", { className: "border-collapse overflow-x-auto overscroll-y-auto rounded-md border border-border bg-background", children: jsxRuntimeExports.jsx("table", { className: f("w-full divide-y divide-border", t), "data-streamdown": "table", ...n, children: e }) })] });
79627
- var Jn = reactExports.lazy(() => import("./mermaid-3ZIDBTTL-CJpvg6rz.js").then((e) => ({ default: e.Mermaid }))), Kn = /language-([^\s]+)/;
79713
+ var Jn = reactExports.lazy(() => import("./mermaid-3ZIDBTTL-CvDmHqoa.js").then((e) => ({ default: e.Mermaid }))), Kn = /language-([^\s]+)/;
79628
79714
  function ke(e, t) {
79629
79715
  if (!(e != null && e.position || t != null && t.position)) return true;
79630
79716
  if (!(e != null && e.position && (t != null && t.position))) return false;
@@ -87789,6 +87875,13 @@ async function fetchEvents$1(worldEnv, runId, params) {
87789
87875
  async function fetchEvent$1(worldEnv, runId, eventId, resolveData = "all") {
87790
87876
  return rpc("fetchEvent", { worldEnv, runId, eventId, resolveData });
87791
87877
  }
87878
+ async function fetchEventsByCorrelationId$1(worldEnv, correlationId, params) {
87879
+ return rpc("fetchEventsByCorrelationId", {
87880
+ worldEnv,
87881
+ correlationId,
87882
+ params
87883
+ });
87884
+ }
87792
87885
  async function fetchHooks$1(worldEnv, params) {
87793
87886
  return rpc("fetchHooks", { worldEnv, params });
87794
87887
  }
@@ -88457,14 +88550,20 @@ const VERCEL_403_ERROR_MESSAGE = "Your current vercel account does not have acce
88457
88550
  const NONCE_LENGTH = 12;
88458
88551
  const TAG_LENGTH = 128;
88459
88552
  const KEY_LENGTH = 32;
88460
- async function importKey(raw2) {
88553
+ async function importKey(raw2, usages = ["encrypt", "decrypt"]) {
88461
88554
  if (raw2.byteLength !== KEY_LENGTH) {
88462
88555
  throw new Error(`Encryption key must be exactly ${KEY_LENGTH} bytes, got ${raw2.byteLength}`);
88463
88556
  }
88464
- return globalThis.crypto.subtle.importKey("raw", raw2, "AES-GCM", false, [
88465
- "encrypt",
88466
- "decrypt"
88467
- ]);
88557
+ return globalThis.crypto.subtle.importKey(
88558
+ "raw",
88559
+ raw2,
88560
+ "AES-GCM",
88561
+ false,
88562
+ // `KeyUsage` is a DOM-lib type that's not in scope under `es2022`.
88563
+ // The `ReadonlyArray<'encrypt' | 'decrypt'>` parameter type matches
88564
+ // a strict subset of `KeyUsage[]`, so this cast is sound.
88565
+ usages
88566
+ );
88468
88567
  }
88469
88568
  async function encrypt(key, data) {
88470
88569
  const nonce = globalThis.crypto.getRandomValues(new Uint8Array(NONCE_LENGTH));
@@ -89414,7 +89513,7 @@ createLogger("webhook");
89414
89513
  createLogger("events");
89415
89514
  createLogger("adapter");
89416
89515
  const MAX_QUEUE_DELIVERIES = 48;
89417
- const version$1 = "4.2.5";
89516
+ const version$1 = "4.3.0";
89418
89517
  const execFileAsync = promisify(execFile);
89419
89518
  function parsePort$1(value, radix = 10) {
89420
89519
  const port = parseInt(value, radix);
@@ -89849,6 +89948,16 @@ async function readBuffer(filePath) {
89849
89948
  const content2 = await promises.readFile(filePath);
89850
89949
  return content2;
89851
89950
  }
89951
+ async function readFirstByte(filePath) {
89952
+ const file2 = await promises.open(filePath, "r");
89953
+ try {
89954
+ const byte = Buffer.allocUnsafe(1);
89955
+ const { bytesRead } = await file2.read(byte, 0, 1, 0);
89956
+ return bytesRead === 0 ? void 0 : byte[0];
89957
+ } finally {
89958
+ await file2.close();
89959
+ }
89960
+ }
89852
89961
  async function deleteJSON(filePath) {
89853
89962
  try {
89854
89963
  await promises.unlink(filePath);
@@ -115534,40 +115643,50 @@ const monotonicUlid = monotonicFactory(() => Math.random());
115534
115643
  const RunStreamsSchema = object$1({
115535
115644
  streams: array$1(string$3())
115536
115645
  });
115646
+ const EOF_MARKER = 1;
115647
+ function isEofByte(byte) {
115648
+ return byte === EOF_MARKER;
115649
+ }
115537
115650
  function serializeChunk(chunk) {
115538
- const eofByte = Buffer.from([chunk.eof ? 1 : 0]);
115651
+ const eofByte = Buffer.from([chunk.eof ? EOF_MARKER : 0]);
115539
115652
  return Buffer.concat([eofByte, chunk.chunk]);
115540
115653
  }
115541
115654
  function isEofChunk(serialized) {
115542
- return serialized[0] === 1;
115655
+ return isEofByte(serialized[0]);
115543
115656
  }
115544
115657
  function deserializeChunk(serialized) {
115545
- const eof = serialized[0] === 1;
115658
+ const eof = isEofChunk(serialized);
115546
115659
  const chunk = Buffer.from(serialized.subarray(1));
115547
115660
  return { eof, chunk };
115548
115661
  }
115662
+ async function listChunkEntries(chunksDir) {
115663
+ try {
115664
+ return await fs$1.readdir(chunksDir);
115665
+ } catch (error2) {
115666
+ if (error2.code === "ENOENT")
115667
+ return [];
115668
+ throw error2;
115669
+ }
115670
+ }
115671
+ function addChunkFilesByExtension(extMap, entries, sourceExtension, fileExtension = sourceExtension, include = () => true) {
115672
+ for (const entry2 of entries) {
115673
+ if (!entry2.endsWith(sourceExtension))
115674
+ continue;
115675
+ const file2 = entry2.slice(0, -sourceExtension.length);
115676
+ if (include(file2))
115677
+ extMap.set(file2, fileExtension);
115678
+ }
115679
+ }
115549
115680
  async function listChunkFilesForStream(chunksDir, name2, tag) {
115550
115681
  assertSafeEntityId("streamName", name2);
115551
- const listPromises = [
115552
- listFilesByExtension(chunksDir, ".bin"),
115553
- listFilesByExtension(chunksDir, ".json")
115554
- ];
115555
- if (tag) {
115556
- listPromises.push(listFilesByExtension(chunksDir, `.${tag}.bin`));
115557
- }
115558
- const [binFiles, jsonFiles, ...taggedResults] = await Promise.all(listPromises);
115559
- const taggedBinFiles = taggedResults[0] ?? [];
115682
+ const entries = await listChunkEntries(chunksDir);
115560
115683
  const extMap = /* @__PURE__ */ new Map();
115561
- for (const f2 of jsonFiles)
115562
- extMap.set(f2, ".json");
115563
- const tagSfx = tag ? `.${tag}` : "";
115564
- for (const f2 of binFiles) {
115565
- if (tag && f2.endsWith(tagSfx))
115566
- continue;
115567
- extMap.set(f2, ".bin");
115684
+ addChunkFilesByExtension(extMap, entries, ".json");
115685
+ addChunkFilesByExtension(extMap, entries, ".bin", ".bin", tag ? (file2) => !file2.endsWith(`.${tag}`) : void 0);
115686
+ if (tag) {
115687
+ const taggedExtension = `.${tag}.bin`;
115688
+ addChunkFilesByExtension(extMap, entries, taggedExtension);
115568
115689
  }
115569
- for (const f2 of taggedBinFiles)
115570
- extMap.set(f2, `.${tag}.bin`);
115571
115690
  const files = [...extMap.keys()].filter((file2) => file2.startsWith(`${name2}-`)).sort();
115572
115691
  return { files, extMap };
115573
115692
  }
@@ -115681,7 +115800,7 @@ function createStreamer$1(basedir, tag) {
115681
115800
  const ext2 = fileExtMap.get(file2) ?? ".bin";
115682
115801
  const filePath = path$3.join(chunksDir, `${file2}${ext2}`);
115683
115802
  if (dataIndex < startIndex) {
115684
- if (isEofChunk(await readBuffer(filePath))) {
115803
+ if (isEofByte(await readFirstByte(filePath))) {
115685
115804
  streamDone = true;
115686
115805
  break;
115687
115806
  }
@@ -115689,7 +115808,7 @@ function createStreamer$1(basedir, tag) {
115689
115808
  continue;
115690
115809
  }
115691
115810
  if (resultChunks.length >= limit) {
115692
- if (isEofChunk(await readBuffer(filePath))) {
115811
+ if (isEofByte(await readFirstByte(filePath))) {
115693
115812
  streamDone = true;
115694
115813
  } else {
115695
115814
  dataIndex++;
@@ -115724,7 +115843,7 @@ function createStreamer$1(basedir, tag) {
115724
115843
  let dataCount = 0;
115725
115844
  for (const file2 of chunkFiles) {
115726
115845
  const ext2 = fileExtMap.get(file2) ?? ".bin";
115727
- if (isEofChunk(await readBuffer(path$3.join(chunksDir, `${file2}${ext2}`)))) {
115846
+ if (isEofByte(await readFirstByte(path$3.join(chunksDir, `${file2}${ext2}`)))) {
115728
115847
  streamDone = true;
115729
115848
  break;
115730
115849
  }
@@ -115785,8 +115904,7 @@ function createStreamer$1(basedir, tag) {
115785
115904
  if (typeof startIndex === "number" && startIndex < 0 && chunkFiles.length > 0) {
115786
115905
  const lastFile = chunkFiles[chunkFiles.length - 1];
115787
115906
  const lastExt = fileExtMap.get(lastFile) ?? ".bin";
115788
- const lastChunk = deserializeChunk(await readBuffer(path$3.join(chunksDir, `${lastFile}${lastExt}`)));
115789
- if ((lastChunk == null ? void 0 : lastChunk.eof) === true) {
115907
+ if (isEofByte(await readFirstByte(path$3.join(chunksDir, `${lastFile}${lastExt}`)))) {
115790
115908
  dataChunkCount--;
115791
115909
  }
115792
115910
  }
@@ -115932,7 +116050,7 @@ function createLocalWorld(args) {
115932
116050
  const basedir = mergedConfig.dataDir;
115933
116051
  const hooksDir = path$3.join(basedir, "hooks");
115934
116052
  const taggedHookFiles = await listTaggedFiles(hooksDir, tag);
115935
- const { HookSchema: HookSchema2 } = await import("./index-6XpyP-Zw.js");
116053
+ const { HookSchema: HookSchema2 } = await import("./index-D1onv-Hr.js");
115936
116054
  await Promise.all(taggedHookFiles.map(async (hookFile) => {
115937
116055
  const hook = await readJSON(path$3.join(hooksDir, hookFile), HookSchema2);
115938
116056
  if (hook == null ? void 0 : hook.token) {
@@ -116084,8 +116202,8 @@ function requireGetVercelOidcToken() {
116084
116202
  }
116085
116203
  try {
116086
116204
  const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([
116087
- await import("./token-util-Cv4v93wd.js").then((n) => n.t),
116088
- await import("./token-DLJYtB0F.js").then((n) => n.t)
116205
+ await import("./token-util-DoCTpdh_.js").then((n) => n.t),
116206
+ await import("./token-DUzouuf-.js").then((n) => n.t)
116089
116207
  ]);
116090
116208
  if (!token || isExpired(getTokenPayload(token), options == null ? void 0 : options.expirationBufferMs)) {
116091
116209
  await refreshToken(options);
@@ -121256,7 +121374,7 @@ var QueueClient = class {
121256
121374
  setApi(this, new ApiClient({ ...options, region }));
121257
121375
  }
121258
121376
  };
121259
- const version = "4.2.0";
121377
+ const version = "4.3.1";
121260
121378
  const HTTP_DEBUG_ENABLED = typeof process !== "undefined" && typeof process.env.DEBUG === "string" && (process.env.DEBUG.includes("workflow:") || process.env.DEBUG === "*");
121261
121379
  function httpLog(method, endpoint, status, ms2) {
121262
121380
  if (HTTP_DEBUG_ENABLED) {
@@ -122477,6 +122595,16 @@ async function fetchStreamMutation(url2, init2, operation) {
122477
122595
  throw err;
122478
122596
  }
122479
122597
  }
122598
+ function createStreamRequestError(operation, url2, response2, text2) {
122599
+ const context = [`PUT ${url2.origin}${url2.pathname}`];
122600
+ for (const header of ["x-vercel-id", "x-vercel-error"]) {
122601
+ const value = response2.headers.get(header);
122602
+ if (value) {
122603
+ context.push(`${header}=${value}`);
122604
+ }
122605
+ }
122606
+ return new Error(`Stream ${operation} failed: HTTP ${response2.status} (${context.join("; ")}): ${text2}`);
122607
+ }
122480
122608
  function encodeMultiChunks(chunks) {
122481
122609
  const encoder = new TextEncoder();
122482
122610
  const binaryChunks = [];
@@ -122515,14 +122643,15 @@ function createStreamer(config2) {
122515
122643
  async writeToStream(name2, runId, chunk) {
122516
122644
  const resolvedRunId = await runId;
122517
122645
  const httpConfig = await getHttpConfig(config2);
122518
- const response2 = await fetchStreamMutation(getStreamUrl(name2, resolvedRunId, httpConfig), {
122646
+ const url2 = getStreamUrl(name2, resolvedRunId, httpConfig);
122647
+ const response2 = await fetchStreamMutation(url2, {
122519
122648
  method: "PUT",
122520
122649
  body: chunk,
122521
122650
  headers: httpConfig.headers
122522
122651
  }, "write");
122523
122652
  const text2 = await response2.text();
122524
122653
  if (!response2.ok) {
122525
- throw new Error(`Stream write failed: HTTP ${response2.status}: ${text2}`);
122654
+ throw createStreamRequestError("write", url2, response2, text2);
122526
122655
  }
122527
122656
  },
122528
122657
  async writeToStreamMulti(name2, runId, chunks) {
@@ -122534,14 +122663,15 @@ function createStreamer(config2) {
122534
122663
  for (let i = 0; i < chunks.length; i += MAX_CHUNKS_PER_REQUEST) {
122535
122664
  const batch = chunks.slice(i, i + MAX_CHUNKS_PER_REQUEST);
122536
122665
  const body2 = encodeMultiChunks(batch);
122537
- const response2 = await fetchStreamMutation(getStreamUrl(name2, resolvedRunId, httpConfig), {
122666
+ const url2 = getStreamUrl(name2, resolvedRunId, httpConfig);
122667
+ const response2 = await fetchStreamMutation(url2, {
122538
122668
  method: "PUT",
122539
122669
  body: body2,
122540
122670
  headers: httpConfig.headers
122541
122671
  }, "write");
122542
122672
  const text2 = await response2.text();
122543
122673
  if (!response2.ok) {
122544
- throw new Error(`Stream write failed: HTTP ${response2.status}: ${text2}`);
122674
+ throw createStreamRequestError("write", url2, response2, text2);
122545
122675
  }
122546
122676
  }
122547
122677
  },
@@ -122549,13 +122679,14 @@ function createStreamer(config2) {
122549
122679
  const resolvedRunId = await runId;
122550
122680
  const httpConfig = await getHttpConfig(config2);
122551
122681
  httpConfig.headers.set("X-Stream-Done", "true");
122552
- const response2 = await fetchStreamMutation(getStreamUrl(name2, resolvedRunId, httpConfig), {
122682
+ const url2 = getStreamUrl(name2, resolvedRunId, httpConfig);
122683
+ const response2 = await fetchStreamMutation(url2, {
122553
122684
  method: "PUT",
122554
122685
  headers: httpConfig.headers
122555
122686
  }, "close");
122556
122687
  const text2 = await response2.text();
122557
122688
  if (!response2.ok) {
122558
- throw new Error(`Stream close failed: HTTP ${response2.status}: ${text2}`);
122689
+ throw createStreamRequestError("close", url2, response2, text2);
122559
122690
  }
122560
122691
  },
122561
122692
  async readFromStream(name2, startIndex) {
@@ -123980,6 +124111,8 @@ const WORKFLOW_DESERIALIZE = Symbol.for("workflow-deserialize");
123980
124111
  const STABLE_ULID = Symbol.for("WORKFLOW_STABLE_ULID");
123981
124112
  const STREAM_NAME_SYMBOL = Symbol.for("WORKFLOW_STREAM_NAME");
123982
124113
  const STREAM_TYPE_SYMBOL = Symbol.for("WORKFLOW_STREAM_TYPE");
124114
+ const STREAM_SERVER_RUN_ID_SYMBOL = Symbol.for("WORKFLOW_STREAM_SERVER_RUN_ID");
124115
+ const STREAM_SERVER_DEPLOYMENT_ID_SYMBOL = Symbol.for("WORKFLOW_STREAM_SERVER_DEPLOYMENT_ID");
123983
124116
  const BODY_INIT_SYMBOL = Symbol.for("BODY_INIT");
123984
124117
  const WEBHOOK_RESPONSE_WRITABLE = Symbol.for("WEBHOOK_RESPONSE_WRITABLE");
123985
124118
  const WORKFLOW_CLASS_REGISTRY = Symbol.for("workflow-class-registry");
@@ -123997,12 +124130,15 @@ function getSerializationClass(classId, global2) {
123997
124130
  }
123998
124131
  const LOCK_POLL_INTERVAL_MS = 100;
123999
124132
  function createFlushableState() {
124000
- return {
124133
+ const state = {
124001
124134
  ...withResolvers$1(),
124002
124135
  pendingOps: 0,
124003
124136
  doneResolved: false,
124004
124137
  streamEnded: false
124005
124138
  };
124139
+ state.promise.catch(() => {
124140
+ });
124141
+ return state;
124006
124142
  }
124007
124143
  function isWritableUnlockedNotClosed(writable) {
124008
124144
  if (writable.locked)
@@ -124666,6 +124802,19 @@ function getExternalReducers(global2 = globalThis, ops, runId, cryptoKey) {
124666
124802
  WritableStream: (value) => {
124667
124803
  if (!(value instanceof global2.WritableStream))
124668
124804
  return false;
124805
+ const existingName = value[STREAM_NAME_SYMBOL];
124806
+ const existingRunId = value[STREAM_SERVER_RUN_ID_SYMBOL];
124807
+ if (typeof existingName === "string" && typeof existingRunId === "string") {
124808
+ const descriptor = {
124809
+ name: existingName,
124810
+ runId: existingRunId
124811
+ };
124812
+ const existingDeploymentId = value[STREAM_SERVER_DEPLOYMENT_ID_SYMBOL];
124813
+ if (typeof existingDeploymentId === "string") {
124814
+ descriptor.deploymentId = existingDeploymentId;
124815
+ }
124816
+ return descriptor;
124817
+ }
124669
124818
  const streamId = (global2[STABLE_ULID] || defaultUlid)();
124670
124819
  const name2 = `strm_${streamId}`;
124671
124820
  const readable2 = new WorkflowServerReadableStream(name2);
@@ -124705,12 +124854,20 @@ function getStepReducers(global2 = globalThis, ops, runId, cryptoKey) {
124705
124854
  if (!(value instanceof global2.WritableStream))
124706
124855
  return false;
124707
124856
  let name2 = value[STREAM_NAME_SYMBOL];
124857
+ const foreignRunId = value[STREAM_SERVER_RUN_ID_SYMBOL];
124708
124858
  if (!name2) {
124709
124859
  const streamId = (global2[STABLE_ULID] || defaultUlid)();
124710
124860
  name2 = `strm_${streamId}`;
124711
124861
  ops.push(new WorkflowServerReadableStream(name2).pipeThrough(getDeserializeStream(getStepRevivers(global2, ops, runId, cryptoKey), cryptoKey)).pipeTo(value));
124712
124862
  }
124713
- return { name: name2 };
124863
+ const s2 = { name: name2 };
124864
+ if (typeof foreignRunId === "string")
124865
+ s2.runId = foreignRunId;
124866
+ const foreignDeploymentId = value[STREAM_SERVER_DEPLOYMENT_ID_SYMBOL];
124867
+ if (typeof foreignDeploymentId === "string") {
124868
+ s2.deploymentId = foreignDeploymentId;
124869
+ }
124870
+ return s2;
124714
124871
  }
124715
124872
  };
124716
124873
  }
@@ -124814,6 +124971,13 @@ function getCommonRevivers(global2 = globalThis) {
124814
124971
  }
124815
124972
  };
124816
124973
  }
124974
+ async function getForwardedWritableEncryptionKey(runId, deploymentId) {
124975
+ const world = getWorld();
124976
+ if (!world.getEncryptionKeyForRun)
124977
+ return void 0;
124978
+ const rawKey = deploymentId ? await world.getEncryptionKeyForRun(runId, { deploymentId }) : await world.getEncryptionKeyForRun(await world.runs.get(runId));
124979
+ return rawKey ? await importKey(rawKey, ["encrypt"]) : void 0;
124980
+ }
124817
124981
  function getExternalRevivers(global2 = globalThis, ops, runId, cryptoKey) {
124818
124982
  return {
124819
124983
  ...getCommonRevivers(global2),
@@ -124862,13 +125026,29 @@ function getExternalRevivers(global2 = globalThis, ops, runId, cryptoKey) {
124862
125026
  }
124863
125027
  },
124864
125028
  WritableStream: (value) => {
124865
- const serialize2 = getSerializeStream(getExternalReducers(global2, ops, runId, cryptoKey), cryptoKey);
124866
- const serverWritable = new WorkflowServerWritableStream(value.name, runId);
125029
+ const targetRunId = typeof value.runId === "string" ? value.runId : runId;
125030
+ const targetKey = targetRunId === runId ? cryptoKey : getForwardedWritableEncryptionKey(targetRunId, value.deploymentId);
125031
+ const serialize2 = getSerializeStream(getExternalReducers(global2, ops, targetRunId, targetKey), targetKey);
125032
+ const serverWritable = new WorkflowServerWritableStream(value.name, targetRunId);
124867
125033
  const state = createFlushableState();
124868
125034
  ops.push(state.promise);
124869
125035
  flushablePipe(serialize2.readable, serverWritable, state).catch(() => {
124870
125036
  });
124871
125037
  pollWritableLock(serialize2.writable, state);
125038
+ Object.defineProperty(serialize2.writable, STREAM_NAME_SYMBOL, {
125039
+ value: value.name,
125040
+ writable: false
125041
+ });
125042
+ Object.defineProperty(serialize2.writable, STREAM_SERVER_RUN_ID_SYMBOL, {
125043
+ value: targetRunId,
125044
+ writable: false
125045
+ });
125046
+ if (typeof value.deploymentId === "string") {
125047
+ Object.defineProperty(serialize2.writable, STREAM_SERVER_DEPLOYMENT_ID_SYMBOL, {
125048
+ value: value.deploymentId,
125049
+ writable: false
125050
+ });
125051
+ }
124872
125052
  return serialize2.writable;
124873
125053
  }
124874
125054
  };
@@ -124930,16 +125110,29 @@ function getWorkflowRevivers(global2 = globalThis) {
124930
125110
  });
124931
125111
  },
124932
125112
  WritableStream: (value) => {
124933
- return Object.create(global2.WritableStream.prototype, {
125113
+ const descriptor = {
124934
125114
  [STREAM_NAME_SYMBOL]: {
124935
125115
  value: value.name,
124936
125116
  writable: false
124937
125117
  }
124938
- });
125118
+ };
125119
+ if (typeof value.runId === "string") {
125120
+ descriptor[STREAM_SERVER_RUN_ID_SYMBOL] = {
125121
+ value: value.runId,
125122
+ writable: false
125123
+ };
125124
+ }
125125
+ if (typeof value.deploymentId === "string") {
125126
+ descriptor[STREAM_SERVER_DEPLOYMENT_ID_SYMBOL] = {
125127
+ value: value.deploymentId,
125128
+ writable: false
125129
+ };
125130
+ }
125131
+ return Object.create(global2.WritableStream.prototype, descriptor);
124939
125132
  }
124940
125133
  };
124941
125134
  }
124942
- function getStepRevivers(global2 = globalThis, ops, runId, cryptoKey) {
125135
+ function getStepRevivers(global2 = globalThis, ops, runId, cryptoKey, deploymentId) {
124943
125136
  return {
124944
125137
  ...getCommonRevivers(global2),
124945
125138
  // StepFunction reviver for step context - returns raw step function
@@ -125043,7 +125236,7 @@ function getStepRevivers(global2 = globalThis, ops, runId, cryptoKey) {
125043
125236
  pollReadableLock(userReadable, state);
125044
125237
  return userReadable;
125045
125238
  } else {
125046
- const transform2 = getDeserializeStream(getStepRevivers(global2, ops, runId, cryptoKey), cryptoKey);
125239
+ const transform2 = getDeserializeStream(getStepRevivers(global2, ops, runId, cryptoKey, deploymentId), cryptoKey);
125047
125240
  const state = createFlushableState();
125048
125241
  ops.push(state.promise);
125049
125242
  flushablePipe(readable2, transform2.writable, state).catch(() => {
@@ -125053,13 +125246,30 @@ function getStepRevivers(global2 = globalThis, ops, runId, cryptoKey) {
125053
125246
  }
125054
125247
  },
125055
125248
  WritableStream: (value) => {
125056
- const serialize2 = getSerializeStream(getStepReducers(global2, ops, runId, cryptoKey), cryptoKey);
125057
- const serverWritable = new WorkflowServerWritableStream(value.name, runId);
125249
+ const targetRunId = typeof value.runId === "string" ? value.runId : runId;
125250
+ const targetDeploymentId = typeof value.deploymentId === "string" ? value.deploymentId : targetRunId === runId ? deploymentId : void 0;
125251
+ const targetKey = targetRunId === runId ? cryptoKey : getForwardedWritableEncryptionKey(targetRunId, targetDeploymentId);
125252
+ const serialize2 = getSerializeStream(getStepReducers(global2, ops, targetRunId, targetKey), targetKey);
125253
+ const serverWritable = new WorkflowServerWritableStream(value.name, targetRunId);
125058
125254
  const state = createFlushableState();
125059
125255
  ops.push(state.promise);
125060
125256
  flushablePipe(serialize2.readable, serverWritable, state).catch(() => {
125061
125257
  });
125062
125258
  pollWritableLock(serialize2.writable, state);
125259
+ Object.defineProperty(serialize2.writable, STREAM_NAME_SYMBOL, {
125260
+ value: value.name,
125261
+ writable: false
125262
+ });
125263
+ Object.defineProperty(serialize2.writable, STREAM_SERVER_RUN_ID_SYMBOL, {
125264
+ value: targetRunId,
125265
+ writable: false
125266
+ });
125267
+ if (targetDeploymentId) {
125268
+ Object.defineProperty(serialize2.writable, STREAM_SERVER_DEPLOYMENT_ID_SYMBOL, {
125269
+ value: targetDeploymentId,
125270
+ writable: false
125271
+ });
125272
+ }
125063
125273
  return serialize2.writable;
125064
125274
  }
125065
125275
  };
@@ -125134,11 +125344,11 @@ async function hydrateWorkflowReturnValue(value, runId, key, ops = [], global2 =
125134
125344
  }
125135
125345
  throw new Error(`Unsupported serialization format: ${format2}`);
125136
125346
  }
125137
- async function hydrateStepArguments(value, runId, key, ops = [], global2 = globalThis, extraRevivers = {}) {
125347
+ async function hydrateStepArguments(value, runId, key, ops = [], global2 = globalThis, extraRevivers = {}, deploymentId) {
125138
125348
  const decrypted = await maybeDecrypt(value, key);
125139
125349
  if (!(decrypted instanceof Uint8Array)) {
125140
125350
  return unflatten(decrypted, {
125141
- ...getStepRevivers(global2, ops, runId, key),
125351
+ ...getStepRevivers(global2, ops, runId, key, deploymentId),
125142
125352
  ...extraRevivers
125143
125353
  });
125144
125354
  }
@@ -125146,7 +125356,7 @@ async function hydrateStepArguments(value, runId, key, ops = [], global2 = globa
125146
125356
  if (format2 === SerializationFormat.DEVALUE_V1) {
125147
125357
  const str = new TextDecoder().decode(payload);
125148
125358
  const obj = parse$7(str, {
125149
- ...getStepRevivers(global2, ops, runId, key),
125359
+ ...getStepRevivers(global2, ops, runId, key, deploymentId),
125150
125360
  ...extraRevivers
125151
125361
  });
125152
125362
  return obj;
@@ -128680,7 +128890,7 @@ createQueueHandler("__wkf_step_", async (message_, metadata) => {
128680
128890
  const encryptionKey = rawKey ? await importKey(rawKey) : void 0;
128681
128891
  const hydratedInput = await trace$2("step.hydrate", {}, async (hydrateSpan) => {
128682
128892
  const startTime = Date.now();
128683
- const result2 = await hydrateStepArguments(step.input, workflowRunId, encryptionKey, ops);
128893
+ const result2 = await hydrateStepArguments(step.input, workflowRunId, encryptionKey, ops, globalThis, {}, process.env.VERCEL_DEPLOYMENT_ID);
128684
128894
  const durationMs = Date.now() - startTime;
128685
128895
  hydrateSpan == null ? void 0 : hydrateSpan.setAttributes({
128686
128896
  ...StepArgumentsCount(result2.args.length),
@@ -128710,6 +128920,7 @@ createQueueHandler("__wkf_step_", async (message_, metadata) => {
128710
128920
  // solution only works for vercel + local worlds.
128711
128921
  url: isVercel ? `https://${process.env.VERCEL_URL}` : `http://localhost:${port ?? 3e3}`
128712
128922
  },
128923
+ workflowDeploymentId: process.env.VERCEL_DEPLOYMENT_ID,
128713
128924
  ops,
128714
128925
  closureVars: hydratedInput.closureVars,
128715
128926
  encryptionKey
@@ -129476,6 +129687,31 @@ async function fetchEvent(worldEnv, runId, eventId, resolveData = "all") {
129476
129687
  });
129477
129688
  }
129478
129689
  }
129690
+ async function fetchEventsByCorrelationId(worldEnv, correlationId, params) {
129691
+ const { cursor, sortOrder = "asc", limit = 100, withData = false } = params;
129692
+ try {
129693
+ const world = await getWorldFromEnv(worldEnv);
129694
+ const result = await world.events.listByCorrelationId({
129695
+ correlationId,
129696
+ pagination: { cursor, limit, sortOrder },
129697
+ resolveData: withData ? "all" : "none"
129698
+ });
129699
+ return createResponse({
129700
+ data: result.data,
129701
+ cursor: result.cursor ?? void 0,
129702
+ hasMore: result.hasMore
129703
+ });
129704
+ } catch (error2) {
129705
+ return createServerActionError(
129706
+ error2,
129707
+ "world.events.listByCorrelationId",
129708
+ {
129709
+ correlationId,
129710
+ ...params
129711
+ }
129712
+ );
129713
+ }
129714
+ }
129479
129715
  async function fetchHooks(worldEnv, params) {
129480
129716
  const { runId, cursor, sortOrder = "desc", limit = 10 } = params;
129481
129717
  try {
@@ -151397,6 +151633,7 @@ function useStreamReader(env2, streamId, runId, encryptionKey, runStatus) {
151397
151633
  }
151398
151634
  const INITIAL_PAGE_SIZE = 100;
151399
151635
  const LOAD_MORE_PAGE_SIZE = 100;
151636
+ const MAX_CORRELATION_SEARCH_PAGES = 30;
151400
151637
  function useEventsListData(env2, runId, options = {}) {
151401
151638
  const { sortOrder = "asc", encryptionKey, enabled = true } = options;
151402
151639
  const [events2, setEvents] = reactExports.useState([]);
@@ -151408,6 +151645,16 @@ function useEventsListData(env2, runId, options = {}) {
151408
151645
  const isFetchingRef = reactExports.useRef(false);
151409
151646
  const encryptionKeyRef = reactExports.useRef(encryptionKey);
151410
151647
  encryptionKeyRef.current = encryptionKey;
151648
+ const hydrateEvents = reactExports.useCallback(async (rawEvents) => {
151649
+ const hydrated = rawEvents.map(hydrateResourceIO);
151650
+ const key = encryptionKeyRef.current;
151651
+ if (key) {
151652
+ return Promise.all(
151653
+ hydrated.map((ev) => hydrateResourceIOWithKey(ev, key))
151654
+ );
151655
+ }
151656
+ return hydrated;
151657
+ }, []);
151411
151658
  const fetchInitial = reactExports.useCallback(async () => {
151412
151659
  if (isFetchingRef.current) return;
151413
151660
  isFetchingRef.current = true;
@@ -151427,16 +151674,7 @@ function useEventsListData(env2, runId, options = {}) {
151427
151674
  if (fetchError) {
151428
151675
  setError(fetchError);
151429
151676
  } else {
151430
- const hydrated = result.data.map(hydrateResourceIO);
151431
- const key = encryptionKeyRef.current;
151432
- if (key) {
151433
- const decrypted = await Promise.all(
151434
- hydrated.map((ev) => hydrateResourceIOWithKey(ev, key))
151435
- );
151436
- setEvents(decrypted);
151437
- } else {
151438
- setEvents(hydrated);
151439
- }
151677
+ setEvents(await hydrateEvents(result.data));
151440
151678
  setCursor(result.hasMore ? result.cursor : void 0);
151441
151679
  setHasMore(Boolean(result.hasMore));
151442
151680
  }
@@ -151446,7 +151684,7 @@ function useEventsListData(env2, runId, options = {}) {
151446
151684
  setLoading(false);
151447
151685
  isFetchingRef.current = false;
151448
151686
  }
151449
- }, [env2, runId, sortOrder]);
151687
+ }, [env2, runId, sortOrder, hydrateEvents]);
151450
151688
  reactExports.useEffect(() => {
151451
151689
  if (enabled) fetchInitial();
151452
151690
  }, [fetchInitial, enabled]);
@@ -151477,16 +151715,8 @@ function useEventsListData(env2, runId, options = {}) {
151477
151715
  setError(fetchError);
151478
151716
  } else {
151479
151717
  if (result.data.length > 0) {
151480
- const hydrated = result.data.map(hydrateResourceIO);
151481
- const key = encryptionKeyRef.current;
151482
- if (key) {
151483
- const decrypted = await Promise.all(
151484
- hydrated.map((ev) => hydrateResourceIOWithKey(ev, key))
151485
- );
151486
- setEvents((prev) => [...prev, ...decrypted]);
151487
- } else {
151488
- setEvents((prev) => [...prev, ...hydrated]);
151489
- }
151718
+ const hydrated = await hydrateEvents(result.data);
151719
+ setEvents((prev) => [...prev, ...hydrated]);
151490
151720
  }
151491
151721
  setCursor(result.hasMore ? result.cursor : void 0);
151492
151722
  setHasMore(Boolean(result.hasMore));
@@ -151496,14 +151726,65 @@ function useEventsListData(env2, runId, options = {}) {
151496
151726
  } finally {
151497
151727
  setLoadingMore(false);
151498
151728
  }
151499
- }, [env2, runId, sortOrder, cursor, loadingMore]);
151729
+ }, [env2, runId, sortOrder, cursor, loadingMore, hydrateEvents]);
151730
+ const searchByExactId = reactExports.useCallback(
151731
+ async (id2, kind, signal) => {
151732
+ if (signal == null ? void 0 : signal.aborted) {
151733
+ throw new DOMException("Aborted", "AbortError");
151734
+ }
151735
+ if (kind === "event") {
151736
+ const { error: fetchError, result } = await unwrapServerActionResult(
151737
+ fetchEvent$1(env2, runId, id2, "none")
151738
+ );
151739
+ if (fetchError || (signal == null ? void 0 : signal.aborted)) {
151740
+ return fetchError ? { status: "error", message: fetchError.message } : (() => {
151741
+ throw new DOMException("Aborted", "AbortError");
151742
+ })();
151743
+ }
151744
+ const [event] = await hydrateEvents([result]);
151745
+ return (event == null ? void 0 : event.runId) === runId ? { status: "ok", events: [event] } : { status: "not_found" };
151746
+ }
151747
+ const matched = [];
151748
+ let nextCursor;
151749
+ let pagesFetched = 0;
151750
+ let truncated = false;
151751
+ do {
151752
+ if (signal == null ? void 0 : signal.aborted) {
151753
+ throw new DOMException("Aborted", "AbortError");
151754
+ }
151755
+ const { error: fetchError, result } = await unwrapServerActionResult(
151756
+ fetchEventsByCorrelationId$1(env2, id2, {
151757
+ cursor: nextCursor,
151758
+ sortOrder,
151759
+ limit: 100,
151760
+ withData: false
151761
+ })
151762
+ );
151763
+ if (fetchError) {
151764
+ return { status: "error", message: fetchError.message };
151765
+ }
151766
+ if (signal == null ? void 0 : signal.aborted) {
151767
+ throw new DOMException("Aborted", "AbortError");
151768
+ }
151769
+ pagesFetched += 1;
151770
+ const hydrated = await hydrateEvents(result.data);
151771
+ matched.push(...hydrated.filter((event) => event.runId === runId));
151772
+ const hitPageCap = pagesFetched >= MAX_CORRELATION_SEARCH_PAGES;
151773
+ truncated = truncated || hitPageCap && Boolean(result.hasMore && result.cursor);
151774
+ nextCursor = !hitPageCap && result.hasMore && result.cursor ? result.cursor : void 0;
151775
+ } while (nextCursor);
151776
+ return matched.length > 0 ? { status: "ok", events: matched, truncated: truncated || void 0 } : { status: "not_found" };
151777
+ },
151778
+ [env2, runId, sortOrder, hydrateEvents]
151779
+ );
151500
151780
  return {
151501
151781
  events: events2,
151502
151782
  loading,
151503
151783
  error: error2,
151504
151784
  hasMore,
151505
151785
  loadingMore,
151506
- loadMore
151786
+ loadMore,
151787
+ searchByExactId
151507
151788
  };
151508
151789
  }
151509
151790
  function LiveStatus({ hasError, errorMessage }) {
@@ -151651,7 +151932,8 @@ function RunDetailView({
151651
151932
  loading: eventsListLoading,
151652
151933
  hasMore: hasMoreEventsTab,
151653
151934
  loadingMore: loadingMoreEventsTab,
151654
- loadMore: loadMoreEventsTab
151935
+ loadMore: loadMoreEventsTab,
151936
+ searchByExactId
151655
151937
  } = useEventsListData(env2, runId, {
151656
151938
  sortOrder: eventsSortOrder,
151657
151939
  encryptionKey: encryptionKey ?? void 0,
@@ -151932,7 +152214,8 @@ function RunDetailView({
151932
152214
  onSortOrderChange: setEventsSortOrder,
151933
152215
  onDecrypt: handleDecrypt,
151934
152216
  isDecrypting,
151935
- hasEncryptedData
152217
+ hasEncryptedData,
152218
+ onExactIdSearch: searchByExactId
151936
152219
  }
151937
152220
  ) }) }) }),
151938
152221
  /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "streams", className: "mt-0 flex-1 min-h-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary$1, { title: "Failed to load stream data", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "h-full flex gap-4", children: [
@@ -152079,6 +152362,7 @@ const handlers = {
152079
152362
  fetchStep: (p2) => fetchStep(p2.worldEnv ?? {}, p2.runId, p2.stepId, p2.resolveData),
152080
152363
  fetchEvents: (p2) => fetchEvents(p2.worldEnv ?? {}, p2.runId, p2.params ?? {}),
152081
152364
  fetchEvent: (p2) => fetchEvent(p2.worldEnv ?? {}, p2.runId, p2.eventId, p2.resolveData),
152365
+ fetchEventsByCorrelationId: (p2) => fetchEventsByCorrelationId(p2.worldEnv ?? {}, p2.correlationId, p2.params ?? {}),
152082
152366
  fetchHooks: (p2) => fetchHooks(p2.worldEnv ?? {}, p2.params ?? {}),
152083
152367
  fetchHook: (p2) => fetchHook(p2.worldEnv ?? {}, p2.hookId, p2.resolveData),
152084
152368
  cancelRun: (p2) => cancelRun$1(p2.worldEnv ?? {}, p2.runId),
@@ -152226,7 +152510,7 @@ const route4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
152226
152510
  __proto__: null,
152227
152511
  loader
152228
152512
  }, Symbol.toStringTag, { value: "Module" }));
152229
- const serverManifest = { "entry": { "module": "/assets/entry.client-BWsSsWQm.js", "imports": ["/assets/index-DQa-BExo.js"], "css": [] }, "routes": { "root": { "id": "root", "parentId": void 0, "path": "", "index": void 0, "caseSensitive": void 0, "hasAction": true, "hasLoader": true, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": true, "hasErrorBoundary": true, "module": "/assets/root-Cr0bUIN7.js", "imports": ["/assets/index-DQa-BExo.js", "/assets/mermaid-3ZIDBTTL-BE1h5qUK.js"], "css": ["/assets/root-aMfmV5uh.css", "/assets/mermaid-3ZIDBTTL-DKxHcEOp.css"], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 }, "routes/home": { "id": "routes/home", "parentId": "root", "path": void 0, "index": true, "caseSensitive": void 0, "hasAction": false, "hasLoader": false, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": true, "hasErrorBoundary": false, "module": "/assets/home-CI2sZzZZ.js", "imports": ["/assets/index-DQa-BExo.js", "/assets/workflow-graph-viewer-fudq4EvS.js", "/assets/mermaid-3ZIDBTTL-BE1h5qUK.js"], "css": ["/assets/workflow-graph-viewer-yls6qlc0.css", "/assets/mermaid-3ZIDBTTL-DKxHcEOp.css"], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 }, "routes/run-detail": { "id": "routes/run-detail", "parentId": "root", "path": "run/:runId", "index": void 0, "caseSensitive": void 0, "hasAction": false, "hasLoader": false, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": true, "hasErrorBoundary": false, "module": "/assets/run-detail-gIcQ-2KJ.js", "imports": ["/assets/index-DQa-BExo.js", "/assets/workflow-graph-viewer-fudq4EvS.js", "/assets/mermaid-3ZIDBTTL-BE1h5qUK.js", "/assets/encryption-80GMP4r0.js"], "css": ["/assets/workflow-graph-viewer-yls6qlc0.css", "/assets/mermaid-3ZIDBTTL-DKxHcEOp.css"], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 }, "routes/api.rpc": { "id": "routes/api.rpc", "parentId": "root", "path": "api/rpc", "index": void 0, "caseSensitive": void 0, "hasAction": true, "hasLoader": true, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": false, "hasErrorBoundary": false, "module": "/assets/api.rpc-l0sNRNKZ.js", "imports": [], "css": [], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 }, "routes/api.stream.$streamId": { "id": "routes/api.stream.$streamId", "parentId": "root", "path": "api/stream/:streamId", "index": void 0, "caseSensitive": void 0, "hasAction": false, "hasLoader": true, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": false, "hasErrorBoundary": false, "module": "/assets/api.stream._streamId-l0sNRNKZ.js", "imports": [], "css": [], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 } }, "url": "/assets/manifest-c3c3f64e.js", "version": "c3c3f64e", "sri": void 0 };
152513
+ const serverManifest = { "entry": { "module": "/assets/entry.client-BWsSsWQm.js", "imports": ["/assets/index-DQa-BExo.js"], "css": [] }, "routes": { "root": { "id": "root", "parentId": void 0, "path": "", "index": void 0, "caseSensitive": void 0, "hasAction": true, "hasLoader": true, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": true, "hasErrorBoundary": true, "module": "/assets/root--_OYilvb.js", "imports": ["/assets/index-DQa-BExo.js", "/assets/mermaid-3ZIDBTTL-CjHrXABH.js"], "css": ["/assets/root-aMfmV5uh.css", "/assets/mermaid-3ZIDBTTL-DKxHcEOp.css"], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 }, "routes/home": { "id": "routes/home", "parentId": "root", "path": void 0, "index": true, "caseSensitive": void 0, "hasAction": false, "hasLoader": false, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": true, "hasErrorBoundary": false, "module": "/assets/home-D6JmZfUp.js", "imports": ["/assets/index-DQa-BExo.js", "/assets/workflow-graph-viewer-BNsGQIfR.js", "/assets/mermaid-3ZIDBTTL-CjHrXABH.js"], "css": ["/assets/workflow-graph-viewer-yls6qlc0.css", "/assets/mermaid-3ZIDBTTL-DKxHcEOp.css"], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 }, "routes/run-detail": { "id": "routes/run-detail", "parentId": "root", "path": "run/:runId", "index": void 0, "caseSensitive": void 0, "hasAction": false, "hasLoader": false, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": true, "hasErrorBoundary": false, "module": "/assets/run-detail-BeA7fQfA.js", "imports": ["/assets/index-DQa-BExo.js", "/assets/workflow-graph-viewer-BNsGQIfR.js", "/assets/mermaid-3ZIDBTTL-CjHrXABH.js", "/assets/encryption-5eom23r0.js"], "css": ["/assets/workflow-graph-viewer-yls6qlc0.css", "/assets/mermaid-3ZIDBTTL-DKxHcEOp.css"], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 }, "routes/api.rpc": { "id": "routes/api.rpc", "parentId": "root", "path": "api/rpc", "index": void 0, "caseSensitive": void 0, "hasAction": true, "hasLoader": true, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": false, "hasErrorBoundary": false, "module": "/assets/api.rpc-l0sNRNKZ.js", "imports": [], "css": [], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 }, "routes/api.stream.$streamId": { "id": "routes/api.stream.$streamId", "parentId": "root", "path": "api/stream/:streamId", "index": void 0, "caseSensitive": void 0, "hasAction": false, "hasLoader": true, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": false, "hasErrorBoundary": false, "module": "/assets/api.stream._streamId-l0sNRNKZ.js", "imports": [], "css": [], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 } }, "url": "/assets/manifest-3243993f.js", "version": "3243993f", "sri": void 0 };
152230
152514
  const assetsBuildDirectory = "build/client";
152231
152515
  const basename = "/";
152232
152516
  const future = { "unstable_optimizeDeps": false, "unstable_subResourceIntegrity": false, "unstable_trailingSlashAwareDataRequests": false, "unstable_previewServerPrerendering": false, "v8_middleware": false, "v8_splitRouteModules": false, "v8_viteEnvironmentApi": false };