@motiadev/plugin-observability 0.14.0-beta.165-454838 → 0.14.0-beta.165-210612
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1374 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +89 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2027 -5061
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +6 -2
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +36 -36
- package/dist/plugin.js.map +1 -0
- package/package.json +24 -29
- package/dist/api.d.ts +0 -3
- package/dist/api.d.ts.map +0 -1
- package/dist/components/events/code/argument.d.ts +0 -7
- package/dist/components/events/code/argument.d.ts.map +0 -1
- package/dist/components/events/code/closing-parenthesis.d.ts +0 -7
- package/dist/components/events/code/closing-parenthesis.d.ts.map +0 -1
- package/dist/components/events/code/function-call-content.d.ts +0 -9
- package/dist/components/events/code/function-call-content.d.ts.map +0 -1
- package/dist/components/events/code/function-call.d.ts +0 -10
- package/dist/components/events/code/function-call.d.ts.map +0 -1
- package/dist/components/events/code/utils.d.ts +0 -2
- package/dist/components/events/code/utils.d.ts.map +0 -1
- package/dist/components/events/event-icon.d.ts +0 -8
- package/dist/components/events/event-icon.d.ts.map +0 -1
- package/dist/components/events/trace-emit-event.d.ts +0 -6
- package/dist/components/events/trace-emit-event.d.ts.map +0 -1
- package/dist/components/events/trace-event.d.ts +0 -6
- package/dist/components/events/trace-event.d.ts.map +0 -1
- package/dist/components/events/trace-log-event.d.ts +0 -6
- package/dist/components/events/trace-log-event.d.ts.map +0 -1
- package/dist/components/events/trace-state-event.d.ts +0 -6
- package/dist/components/events/trace-state-event.d.ts.map +0 -1
- package/dist/components/events/trace-stream-event.d.ts +0 -6
- package/dist/components/events/trace-stream-event.d.ts.map +0 -1
- package/dist/components/hooks/use-get-endtime.d.ts +0 -3
- package/dist/components/hooks/use-get-endtime.d.ts.map +0 -1
- package/dist/components/observability-page.d.ts +0 -2
- package/dist/components/observability-page.d.ts.map +0 -1
- package/dist/components/observability-tab-label.d.ts +0 -2
- package/dist/components/observability-tab-label.d.ts.map +0 -1
- package/dist/components/search-bar.d.ts +0 -2
- package/dist/components/search-bar.d.ts.map +0 -1
- package/dist/components/trace-empty-state.d.ts +0 -2
- package/dist/components/trace-empty-state.d.ts.map +0 -1
- package/dist/components/trace-group-item.d.ts +0 -14
- package/dist/components/trace-group-item.d.ts.map +0 -1
- package/dist/components/trace-item/trace-event-item.d.ts +0 -9
- package/dist/components/trace-item/trace-event-item.d.ts.map +0 -1
- package/dist/components/trace-item/trace-item-detail.d.ts +0 -9
- package/dist/components/trace-item/trace-item-detail.d.ts.map +0 -1
- package/dist/components/trace-item/trace-item.d.ts +0 -14
- package/dist/components/trace-item/trace-item.d.ts.map +0 -1
- package/dist/components/trace-status.d.ts +0 -9
- package/dist/components/trace-status.d.ts.map +0 -1
- package/dist/components/trace-timeline.d.ts +0 -3
- package/dist/components/trace-timeline.d.ts.map +0 -1
- package/dist/components/traces-groups.d.ts +0 -3
- package/dist/components/traces-groups.d.ts.map +0 -1
- package/dist/components/ui/copy-button.d.ts +0 -8
- package/dist/components/ui/copy-button.d.ts.map +0 -1
- package/dist/components/ui/popover.d.ts +0 -7
- package/dist/components/ui/popover.d.ts.map +0 -1
- package/dist/hooks/use-filtered-trace-groups.d.ts +0 -3
- package/dist/hooks/use-filtered-trace-groups.d.ts.map +0 -1
- package/dist/hooks/use-get-endtime.d.ts +0 -3
- package/dist/hooks/use-get-endtime.d.ts.map +0 -1
- package/dist/index.cjs +0 -142
- package/dist/lib/utils.d.ts +0 -2
- package/dist/lib/utils.d.ts.map +0 -1
- package/dist/plugin-observability.css +0 -1
- package/dist/plugin.cjs +0 -1
- package/dist/stores/use-observability-store.d.ts +0 -11
- package/dist/stores/use-observability-store.d.ts.map +0 -1
- package/dist/types/observability.d.ts +0 -79
- package/dist/types/observability.d.ts.map +0 -1
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
interface TraceGroupItemProps {
|
|
3
|
-
groupId: string;
|
|
4
|
-
groupName: string;
|
|
5
|
-
groupStatus: 'running' | 'completed' | 'failed';
|
|
6
|
-
groupStartTime: number;
|
|
7
|
-
groupEndTime: number | undefined;
|
|
8
|
-
totalSteps: number;
|
|
9
|
-
activeSteps: number;
|
|
10
|
-
isSelected: boolean;
|
|
11
|
-
}
|
|
12
|
-
export declare const TraceGroupItem: React.FC<TraceGroupItemProps>;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=trace-group-item.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trace-group-item.d.ts","sourceRoot":"","sources":["../../src/components/trace-group-item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,UAAU,mBAAmB;IAC3B,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAA;IAC/C,cAAc,EAAE,MAAM,CAAA;IACtB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,OAAO,CAAA;CACpB;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA4CxD,CAAA"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { TraceEvent as TraceEventType } from '../../types/observability';
|
|
3
|
-
type Props = {
|
|
4
|
-
event: TraceEventType;
|
|
5
|
-
traceStartTime: number;
|
|
6
|
-
};
|
|
7
|
-
export declare const TraceEventItem: React.FC<Props>;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=trace-event-item.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trace-event-item.d.ts","sourceRoot":"","sources":["../../../src/components/trace-item/trace-event-item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAI7E,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,cAAc,CAAA;IACrB,cAAc,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAmBzC,CAAA"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { Trace } from '../../types/observability';
|
|
3
|
-
type Props = {
|
|
4
|
-
trace: Trace;
|
|
5
|
-
onClose: () => void;
|
|
6
|
-
};
|
|
7
|
-
export declare const TraceItemDetail: React.FC<Props>;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=trace-item-detail.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trace-item-detail.d.ts","sourceRoot":"","sources":["../../../src/components/trace-item/trace-item-detail.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AAGtD,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,KAAK,CAAA;IACZ,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAgC1C,CAAA"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
type Props = {
|
|
3
|
-
traceId: string;
|
|
4
|
-
traceName: string;
|
|
5
|
-
traceStatus: 'running' | 'completed' | 'failed';
|
|
6
|
-
traceStartTime: number;
|
|
7
|
-
traceEndTime: number | undefined;
|
|
8
|
-
groupStartTime: number;
|
|
9
|
-
groupEndTime: number;
|
|
10
|
-
onExpand: (traceId: string) => void;
|
|
11
|
-
};
|
|
12
|
-
export declare const TraceItem: React.FC<Props>;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=trace-item.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trace-item.d.ts","sourceRoot":"","sources":["../../../src/components/trace-item/trace-item.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAS9B,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAA;IAC/C,cAAc,EAAE,MAAM,CAAA;IACtB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,cAAc,EAAE,MAAM,CAAA;IACtB,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CACpC,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAsCrC,CAAA"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { TraceGroup } from '../types/observability';
|
|
3
|
-
type Props = {
|
|
4
|
-
status: TraceGroup['status'];
|
|
5
|
-
duration?: string;
|
|
6
|
-
};
|
|
7
|
-
export declare const TraceStatusBadge: React.FC<Props>;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=trace-status.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trace-status.d.ts","sourceRoot":"","sources":["../../src/components/trace-status.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAEvD,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAA;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AASD,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAI3C,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trace-timeline.d.ts","sourceRoot":"","sources":["../../src/components/trace-timeline.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAS9B,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAIhC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"traces-groups.d.ts","sourceRoot":"","sources":["../../src/components/traces-groups.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EA2C/B,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"copy-button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/copy-button.tsx"],"names":[],"mappings":"AAKA,KAAK,eAAe,GAAG;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAwBhD,CAAA"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ComponentProps, FC } from 'react';
|
|
2
|
-
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
3
|
-
export declare const Popover: FC<ComponentProps<typeof PopoverPrimitive.Root>>;
|
|
4
|
-
export declare const PopoverTrigger: FC<ComponentProps<typeof PopoverPrimitive.Trigger>>;
|
|
5
|
-
export declare const PopoverContent: FC<ComponentProps<typeof PopoverPrimitive.Content>>;
|
|
6
|
-
export declare const PopoverAnchor: FC<ComponentProps<typeof PopoverPrimitive.Anchor>>;
|
|
7
|
-
//# sourceMappingURL=popover.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../src/components/ui/popover.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAE/C,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAEpE,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAE9E,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAoB9E,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAE5E,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-filtered-trace-groups.d.ts","sourceRoot":"","sources":["../../src/hooks/use-filtered-trace-groups.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAExD,eAAO,MAAM,sBAAsB,oBAelC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-get-endtime.d.ts","sourceRoot":"","sources":["../../src/hooks/use-get-endtime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAExD,eAAO,MAAM,aAAa,GAAI,OAAO,UAAU,GAAG,SAAS,GAAG,IAAI,WA0BjE,CAAA"}
|
package/dist/index.cjs
DELETED
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react"),G=require("@motiadev/ui"),St=require("@motiadev/stream-client-react"),sr=require("react-dom");function ar(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const m=ar(b),ir=ar(sr);var Ve={exports:{}},_e={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var un;function Mo(){if(un)return _e;un=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var a=null;if(s!==void 0&&(a=""+s),o.key!==void 0&&(a=""+o.key),"key"in o){s={};for(var i in o)i!=="key"&&(s[i]=o[i])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:a,ref:o!==void 0?o:null,props:s}}return _e.Fragment=t,_e.jsx=n,_e.jsxs=n,_e}var De={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.development.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var fn;function _o(){return fn||(fn=1,process.env.NODE_ENV!=="production"&&function(){function e(y){if(y==null)return null;if(typeof y=="function")return y.$$typeof===I?null:y.displayName||y.name||null;if(typeof y=="string")return y;switch(y){case h:return"Fragment";case w:return"Profiler";case x:return"StrictMode";case C:return"Suspense";case P:return"SuspenseList";case M:return"Activity"}if(typeof y=="object")switch(typeof y.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),y.$$typeof){case v:return"Portal";case S:return(y.displayName||"Context")+".Provider";case A:return(y._context.displayName||"Context")+".Consumer";case j:var O=y.render;return y=y.displayName,y||(y=O.displayName||O.name||"",y=y!==""?"ForwardRef("+y+")":"ForwardRef"),y;case E:return O=y.displayName||null,O!==null?O:e(y.type)||"Memo";case k:O=y._payload,y=y._init;try{return e(y(O))}catch{}}return null}function t(y){return""+y}function n(y){try{t(y);var O=!1}catch{O=!0}if(O){O=console;var W=O.error,N=typeof Symbol=="function"&&Symbol.toStringTag&&y[Symbol.toStringTag]||y.constructor.name||"Object";return W.call(O,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",N),t(y)}}function r(y){if(y===h)return"<>";if(typeof y=="object"&&y!==null&&y.$$typeof===k)return"<...>";try{var O=e(y);return O?"<"+O+">":"<...>"}catch{return"<...>"}}function o(){var y=B.A;return y===null?null:y.getOwner()}function s(){return Error("react-stack-top-frame")}function a(y){if(H.call(y,"key")){var O=Object.getOwnPropertyDescriptor(y,"key").get;if(O&&O.isReactWarning)return!1}return y.key!==void 0}function i(y,O){function W(){D||(D=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",O))}W.isReactWarning=!0,Object.defineProperty(y,"key",{get:W,configurable:!0})}function u(){var y=e(this.type);return F[y]||(F[y]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),y=this.props.ref,y!==void 0?y:null}function l(y,O,W,N,L,Y,ke,oe){return W=Y.ref,y={$$typeof:g,type:y,key:O,props:Y,_owner:L},(W!==void 0?W:null)!==null?Object.defineProperty(y,"ref",{enumerable:!1,get:u}):Object.defineProperty(y,"ref",{enumerable:!1,value:null}),y._store={},Object.defineProperty(y._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(y,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(y,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ke}),Object.defineProperty(y,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:oe}),Object.freeze&&(Object.freeze(y.props),Object.freeze(y)),y}function f(y,O,W,N,L,Y,ke,oe){var V=O.children;if(V!==void 0)if(N)if($(V)){for(N=0;N<V.length;N++)d(V[N]);Object.freeze&&Object.freeze(V)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else d(V);if(H.call(O,"key")){V=e(y);var ce=Object.keys(O).filter(function(pt){return pt!=="key"});N=0<ce.length?"{key: someKey, "+ce.join(": ..., ")+": ...}":"{key: someKey}",z[V+N]||(ce=0<ce.length?"{"+ce.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
|
-
let props = %s;
|
|
19
|
-
<%s {...props} />
|
|
20
|
-
React keys must be passed directly to JSX without using spread:
|
|
21
|
-
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,N,V,ce,V),z[V+N]=!0)}if(V=null,W!==void 0&&(n(W),V=""+W),a(O)&&(n(O.key),V=""+O.key),"key"in O){W={};for(var Me in O)Me!=="key"&&(W[Me]=O[Me])}else W=O;return V&&i(W,typeof y=="function"?y.displayName||y.name||"Unknown":y),l(y,V,Y,L,o(),W,ke,oe)}function d(y){typeof y=="object"&&y!==null&&y.$$typeof===g&&y._store&&(y._store.validated=1)}var p=b,g=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),S=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),I=Symbol.for("react.client.reference"),B=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=Object.prototype.hasOwnProperty,$=Array.isArray,_=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(y){return y()}};var D,F={},T=p.react_stack_bottom_frame.bind(p,s)(),R=_(r(s)),z={};De.Fragment=h,De.jsx=function(y,O,W,N,L){var Y=1e4>B.recentlyCreatedOwnerStacks++;return f(y,O,W,!1,N,L,Y?Error("react-stack-top-frame"):T,Y?_(r(y)):R)},De.jsxs=function(y,O,W,N,L){var Y=1e4>B.recentlyCreatedOwnerStacks++;return f(y,O,W,!0,N,L,Y?Error("react-stack-top-frame"):T,Y?_(r(y)):R)}}()),De}var dn;function Do(){return dn||(dn=1,process.env.NODE_ENV==="production"?Ve.exports=Mo():Ve.exports=_o()),Ve.exports}var c=Do();/**
|
|
23
|
-
* @license lucide-react v0.545.0 - ISC
|
|
24
|
-
*
|
|
25
|
-
* This source code is licensed under the ISC license.
|
|
26
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/const Fo=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Lo=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),mn=e=>{const t=Lo(e);return t.charAt(0).toUpperCase()+t.slice(1)},cr=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Io=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
|
|
28
|
-
* @license lucide-react v0.545.0 - ISC
|
|
29
|
-
*
|
|
30
|
-
* This source code is licensed under the ISC license.
|
|
31
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
32
|
-
*/var $o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
33
|
-
* @license lucide-react v0.545.0 - ISC
|
|
34
|
-
*
|
|
35
|
-
* This source code is licensed under the ISC license.
|
|
36
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
37
|
-
*/const Wo=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:a,...i},u)=>b.createElement("svg",{ref:u,...$o,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:cr("lucide",o),...!s&&!Io(i)&&{"aria-hidden":"true"},...i},[...a.map(([l,f])=>b.createElement(l,f)),...Array.isArray(s)?s:[s]]));/**
|
|
38
|
-
* @license lucide-react v0.545.0 - ISC
|
|
39
|
-
*
|
|
40
|
-
* This source code is licensed under the ISC license.
|
|
41
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/const q=(e,t)=>{const n=b.forwardRef(({className:r,...o},s)=>b.createElement(Wo,{ref:s,iconNode:t,className:cr(`lucide-${Fo(mn(e))}`,`lucide-${e}`,r),...o}));return n.displayName=mn(e),n};/**
|
|
43
|
-
* @license lucide-react v0.545.0 - ISC
|
|
44
|
-
*
|
|
45
|
-
* This source code is licensed under the ISC license.
|
|
46
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
47
|
-
*/const Bo=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Ho=q("search",Bo);/**
|
|
48
|
-
* @license lucide-react v0.545.0 - ISC
|
|
49
|
-
*
|
|
50
|
-
* This source code is licensed under the ISC license.
|
|
51
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
52
|
-
*/const zo=[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Vo=q("trash",zo);/**
|
|
53
|
-
* @license lucide-react v0.545.0 - ISC
|
|
54
|
-
*
|
|
55
|
-
* This source code is licensed under the ISC license.
|
|
56
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
57
|
-
*/const Uo=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],lr=q("x",Uo),pn=e=>{let t;const n=new Set,r=(l,f)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const p=t;t=f??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(g=>g(t,p))}},o=()=>t,i={setState:r,getState:o,getInitialState:()=>u,subscribe:l=>(n.add(l),()=>n.delete(l))},u=t=e(r,o,i);return i},Yo=e=>e?pn(e):pn,Go=e=>e;function Zo(e,t=Go){const n=b.useSyncExternalStore(e.subscribe,b.useCallback(()=>t(e.getState()),[e,t]),b.useCallback(()=>t(e.getInitialState()),[e,t]));return b.useDebugValue(n),n}const Xo=e=>{const t=Yo(e),n=r=>Zo(t,r);return Object.assign(n,t),n},qo=e=>Xo,J=qo()(e=>({selectedTraceGroupId:"",selectedTraceId:void 0,search:"",selectTraceGroupId:t=>e({selectedTraceGroupId:t}),selectTraceId:t=>e({selectedTraceId:t}),setSearch:t=>e({search:t}),clearTraces:()=>{fetch("/__motia/trace/clear",{method:"POST"})}})),ur=b.memo(()=>{const e=J(r=>r.search),t=J(r=>r.setSearch),n=J(r=>r.clearTraces);return c.jsxs("div",{className:"flex p-2 border-b gap-2","data-testid":"logs-search-container",children:[c.jsxs("div",{className:"flex-1 relative",children:[c.jsx(G.Input,{variant:"shade",value:e,onChange:r=>t(r.target.value),className:"px-9! font-medium",placeholder:"Search by Trace ID or Step Name"}),c.jsx(Ho,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/50"}),c.jsx(lr,{className:G.cn("cursor-pointer absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/50 hover:text-muted-foreground",{visible:e!=="",invisible:e===""}),onClick:()=>t("")})]}),c.jsxs(G.Button,{variant:"default",onClick:n,className:"h-[34px]",children:[c.jsx(Vo,{})," Clear"]})]})});ur.displayName="SearchBar";const fr=b.memo(()=>J(t=>t.selectedTraceGroupId)?null:c.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-center",children:"Select a trace or trace group to view the timeline"}));fr.displayName="TraceEmptyState";/**
|
|
58
|
-
* @license lucide-react v0.545.0 - ISC
|
|
59
|
-
*
|
|
60
|
-
* This source code is licensed under the ISC license.
|
|
61
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
62
|
-
*/const Jo=[["path",{d:"M5 12h14",key:"1ays0h"}]],Ko=q("minus",Jo);/**
|
|
63
|
-
* @license lucide-react v0.545.0 - ISC
|
|
64
|
-
*
|
|
65
|
-
* This source code is licensed under the ISC license.
|
|
66
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
67
|
-
*/const Qo=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],es=q("plus",Qo),ts=e=>{const t=e?.endTime,[n,r]=b.useState(()=>t||Date.now()),o=b.useRef(null);return b.useEffect(()=>(o.current&&(clearInterval(o.current),o.current=null),t?r(t):o.current=setInterval(()=>r(Date.now()),100),()=>{o.current&&(clearInterval(o.current),o.current=null)}),[t]),n},xe=e=>e==null?"N/A":e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:e<36e5?`${(e/6e4).toFixed(1)}min`:`${(e/36e5).toFixed(1)}h`,ns={running:"bg-[repeating-linear-gradient(140deg,#BEFE29,#BEFE29_8px,#ABE625_8px,#ABE625_16px)]",completed:"bg-[repeating-linear-gradient(140deg,#2862FE,#2862FE_8px,#2358E5_8px,#2358E5_16px)]",failed:"bg-[repeating-linear-gradient(140deg,#EA2069,#EA2069_8px,#D41E60_8px,#D41E60_16px)]"},dr=b.memo(({traceId:e,traceName:t,traceStatus:n,traceStartTime:r,traceEndTime:o,groupStartTime:s,groupEndTime:a,onExpand:i})=>{const u=b.useCallback(()=>{i(e)},[i,e]),l=b.useMemo(()=>G.cn("h-[24px] rounded-[4px] hover:opacity-80 transition-all duration-200",ns[n]),[n]),f=b.useMemo(()=>({marginLeft:`${(r-s)/(a-s)*100}%`,width:o?`${(o-r)/(a-s)*100}%`:`${(Date.now()-r)/(a-s)*100}%`}),[r,o,s,a]);return c.jsxs("div",{className:"flex hover:bg-muted-foreground/10 relative cursor-pointer",onClick:u,"data-testid":"trace-timeline-item",children:[c.jsx("div",{className:"flex items-center min-w-[200px] max-w-[200px] h-[32px] max-h-[32px] py-4 px-2 text-sm font-semibold text-foreground truncate sticky left-0 bg-card z-9",children:t}),c.jsx("div",{className:"flex w-full flex-row items-center hover:bg-muted/50 rounded-md",children:c.jsx("div",{className:"relative w-full h-[32px] flex items-center",children:c.jsx("div",{className:l,style:f})})})]})});dr.displayName="TraceItem";/**
|
|
68
|
-
* @license lucide-react v0.545.0 - ISC
|
|
69
|
-
*
|
|
70
|
-
* This source code is licensed under the ISC license.
|
|
71
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
72
|
-
*/const rs=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],os=q("message-circle",rs);/**
|
|
73
|
-
* @license lucide-react v0.545.0 - ISC
|
|
74
|
-
*
|
|
75
|
-
* This source code is licensed under the ISC license.
|
|
76
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
77
|
-
*/const ss=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],as=q("package",ss);/**
|
|
78
|
-
* @license lucide-react v0.545.0 - ISC
|
|
79
|
-
*
|
|
80
|
-
* This source code is licensed under the ISC license.
|
|
81
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
82
|
-
*/const is=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],cs=q("radio",is);/**
|
|
83
|
-
* @license lucide-react v0.545.0 - ISC
|
|
84
|
-
*
|
|
85
|
-
* This source code is licensed under the ISC license.
|
|
86
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
87
|
-
*/const ls=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],us=q("scroll-text",ls),fs=({event:e})=>{if(e.type==="log")return c.jsx(us,{className:"w-4 h-4 text-muted-foreground"});if(e.type==="emit")return c.jsx(os,{className:"w-4 h-4 text-muted-foreground"});if(e.type==="state")return c.jsx(as,{className:"w-4 h-4 text-muted-foreground"});if(e.type==="stream")return c.jsx(cs,{className:"w-4 h-4 text-muted-foreground"})};/**
|
|
88
|
-
* @license lucide-react v0.545.0 - ISC
|
|
89
|
-
*
|
|
90
|
-
* This source code is licensed under the ISC license.
|
|
91
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
-
*/const ds=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ms=q("check",ds);/**
|
|
93
|
-
* @license lucide-react v0.545.0 - ISC
|
|
94
|
-
*
|
|
95
|
-
* This source code is licensed under the ISC license.
|
|
96
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
-
*/const ps=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],hs=q("copy",ps),At=({textToCopy:e,className:t,title:n})=>{const[r,o]=b.useState(!1),s=b.useCallback(async()=>{try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),2e3)}catch(a){console.error("Failed to copy:",a)}},[e]);return c.jsx(G.Button,{variant:"icon",size:"icon",onClick:s,className:G.cn("cursor-pointer p-3 rounded-full",t),title:n??(r?"Copied!":"Copy"),children:r?c.jsx(ms,{className:"w-4 h-4 text-green-500"}):c.jsx(hs,{className:"w-4 h-4 text-gray-400"})})};function ue(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function hn(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function mr(...e){return t=>{let n=!1;const r=e.map(o=>{const s=hn(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():hn(e[o],null)}}}}function he(...e){return m.useCallback(mr(...e),e)}function pr(e,t=[]){let n=[];function r(s,a){const i=m.createContext(a),u=n.length;n=[...n,a];const l=d=>{const{scope:p,children:g,...v}=d,h=p?.[e]?.[u]||i,x=m.useMemo(()=>v,Object.values(v));return c.jsx(h.Provider,{value:x,children:g})};l.displayName=s+"Provider";function f(d,p){const g=p?.[e]?.[u]||i,v=m.useContext(g);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[l,f]}const o=()=>{const s=n.map(a=>m.createContext(a));return function(i){const u=i?.[e]||s;return m.useMemo(()=>({[`__scope${e}`]:{...i,[e]:u}}),[i,u])}};return o.scopeName=e,[r,gs(o,...t)]}function gs(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=r.reduce((i,{useScope:u,scopeName:l})=>{const d=u(s)[`__scope${l}`];return{...i,...d}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function hr(e){const t=vs(e),n=m.forwardRef((r,o)=>{const{children:s,...a}=r,i=m.Children.toArray(s),u=i.find(xs);if(u){const l=u.props.children,f=i.map(d=>d===u?m.Children.count(l)>1?m.Children.only(null):m.isValidElement(l)?l.props.children:null:d);return c.jsx(t,{...a,ref:o,children:m.isValidElement(l)?m.cloneElement(l,void 0,f):null})}return c.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function vs(e){const t=m.forwardRef((n,r)=>{const{children:o,...s}=n;if(m.isValidElement(o)){const a=ws(o),i=bs(s,o.props);return o.type!==m.Fragment&&(i.ref=r?mr(r,a):a),m.cloneElement(o,i)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ys=Symbol("radix.slottable");function xs(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ys}function bs(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...i)=>{const u=s(...i);return o(...i),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function ws(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var js=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ie=js.reduce((e,t)=>{const n=hr(`Primitive.${t}`),r=m.forwardRef((o,s)=>{const{asChild:a,...i}=o,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Cs(e,t){e&&ir.flushSync(()=>e.dispatchEvent(t))}function Pe(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>t.current?.(...n),[])}function Es(e,t=globalThis?.document){const n=Pe(e);m.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Ss="DismissableLayer",Pt="dismissableLayer.update",As="dismissableLayer.pointerDownOutside",Ps="dismissableLayer.focusOutside",gn,gr=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),vr=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:i,...u}=e,l=m.useContext(gr),[f,d]=m.useState(null),p=f?.ownerDocument??globalThis?.document,[,g]=m.useState({}),v=he(t,E=>d(E)),h=Array.from(l.layers),[x]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),w=h.indexOf(x),A=f?h.indexOf(f):-1,S=l.layersWithOutsidePointerEventsDisabled.size>0,j=A>=w,C=Rs(E=>{const k=E.target,M=[...l.branches].some(I=>I.contains(k));!j||M||(o?.(E),a?.(E),E.defaultPrevented||i?.())},p),P=Ts(E=>{const k=E.target;[...l.branches].some(I=>I.contains(k))||(s?.(E),a?.(E),E.defaultPrevented||i?.())},p);return Es(E=>{A===l.layers.size-1&&(r?.(E),!E.defaultPrevented&&i&&(E.preventDefault(),i()))},p),m.useEffect(()=>{if(f)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(gn=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),vn(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=gn)}},[f,p,n,l]),m.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),vn())},[f,l]),m.useEffect(()=>{const E=()=>g({});return document.addEventListener(Pt,E),()=>document.removeEventListener(Pt,E)},[]),c.jsx(ie.div,{...u,ref:v,style:{pointerEvents:S?j?"auto":"none":void 0,...e.style},onFocusCapture:ue(e.onFocusCapture,P.onFocusCapture),onBlurCapture:ue(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:ue(e.onPointerDownCapture,C.onPointerDownCapture)})});vr.displayName=Ss;var Ns="DismissableLayerBranch",Os=m.forwardRef((e,t)=>{const n=m.useContext(gr),r=m.useRef(null),o=he(t,r);return m.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),c.jsx(ie.div,{...e,ref:o})});Os.displayName=Ns;function Rs(e,t=globalThis?.document){const n=Pe(e),r=m.useRef(!1),o=m.useRef(()=>{});return m.useEffect(()=>{const s=i=>{if(i.target&&!r.current){let u=function(){yr(As,n,l,{discrete:!0})};const l={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Ts(e,t=globalThis?.document){const n=Pe(e),r=m.useRef(!1);return m.useEffect(()=>{const o=s=>{s.target&&!r.current&&yr(Ps,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function vn(){const e=new CustomEvent(Pt);document.dispatchEvent(e)}function yr(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Cs(o,s):o.dispatchEvent(s)}var ht=0;function ks(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??yn()),document.body.insertAdjacentElement("beforeend",e[1]??yn()),ht++,()=>{ht===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ht--}},[])}function yn(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var gt="focusScope.autoFocusOnMount",vt="focusScope.autoFocusOnUnmount",xn={bubbles:!1,cancelable:!0},Ms="FocusScope",xr=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...a}=e,[i,u]=m.useState(null),l=Pe(o),f=Pe(s),d=m.useRef(null),p=he(t,h=>u(h)),g=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let h=function(S){if(g.paused||!i)return;const j=S.target;i.contains(j)?d.current=j:le(d.current,{select:!0})},x=function(S){if(g.paused||!i)return;const j=S.relatedTarget;j!==null&&(i.contains(j)||le(d.current,{select:!0}))},w=function(S){if(document.activeElement===document.body)for(const C of S)C.removedNodes.length>0&&le(i)};document.addEventListener("focusin",h),document.addEventListener("focusout",x);const A=new MutationObserver(w);return i&&A.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",x),A.disconnect()}}},[r,i,g.paused]),m.useEffect(()=>{if(i){wn.add(g);const h=document.activeElement;if(!i.contains(h)){const w=new CustomEvent(gt,xn);i.addEventListener(gt,l),i.dispatchEvent(w),w.defaultPrevented||(_s($s(br(i)),{select:!0}),document.activeElement===h&&le(i))}return()=>{i.removeEventListener(gt,l),setTimeout(()=>{const w=new CustomEvent(vt,xn);i.addEventListener(vt,f),i.dispatchEvent(w),w.defaultPrevented||le(h??document.body,{select:!0}),i.removeEventListener(vt,f),wn.remove(g)},0)}}},[i,l,f,g]);const v=m.useCallback(h=>{if(!n&&!r||g.paused)return;const x=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,w=document.activeElement;if(x&&w){const A=h.currentTarget,[S,j]=Ds(A);S&&j?!h.shiftKey&&w===j?(h.preventDefault(),n&&le(S,{select:!0})):h.shiftKey&&w===S&&(h.preventDefault(),n&&le(j,{select:!0})):w===A&&h.preventDefault()}},[n,r,g.paused]);return c.jsx(ie.div,{tabIndex:-1,...a,ref:p,onKeyDown:v})});xr.displayName=Ms;function _s(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(le(r,{select:t}),document.activeElement!==n)return}function Ds(e){const t=br(e),n=bn(t,e),r=bn(t.reverse(),e);return[n,r]}function br(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function bn(e,t){for(const n of e)if(!Fs(n,{upTo:t}))return n}function Fs(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Ls(e){return e instanceof HTMLInputElement&&"select"in e}function le(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ls(e)&&t&&e.select()}}var wn=Is();function Is(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=jn(e,t),e.unshift(t)},remove(t){e=jn(e,t),e[0]?.resume()}}}function jn(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function $s(e){return e.filter(t=>t.tagName!=="A")}var fe=globalThis?.document?m.useLayoutEffect:()=>{},Ws=m[" useId ".trim().toString()]||(()=>{}),Bs=0;function Hs(e){const[t,n]=m.useState(Ws());return fe(()=>{n(r=>r??String(Bs++))},[e]),e||(t?`radix-${t}`:"")}const zs=["top","right","bottom","left"],de=Math.min,Z=Math.max,nt=Math.round,Ue=Math.floor,te=e=>({x:e,y:e}),Vs={left:"right",right:"left",bottom:"top",top:"bottom"},Us={start:"end",end:"start"};function Nt(e,t,n){return Z(e,de(t,n))}function se(e,t){return typeof e=="function"?e(t):e}function ae(e){return e.split("-")[0]}function Re(e){return e.split("-")[1]}function Ut(e){return e==="x"?"y":"x"}function Yt(e){return e==="y"?"height":"width"}function me(e){return["top","bottom"].includes(ae(e))?"y":"x"}function Gt(e){return Ut(me(e))}function Ys(e,t,n){n===void 0&&(n=!1);const r=Re(e),o=Gt(e),s=Yt(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=rt(a)),[a,rt(a)]}function Gs(e){const t=rt(e);return[Ot(e),t,Ot(t)]}function Ot(e){return e.replace(/start|end/g,t=>Us[t])}function Zs(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:a;default:return[]}}function Xs(e,t,n,r){const o=Re(e);let s=Zs(ae(e),n==="start",r);return o&&(s=s.map(a=>a+"-"+o),t&&(s=s.concat(s.map(Ot)))),s}function rt(e){return e.replace(/left|right|bottom|top/g,t=>Vs[t])}function qs(e){return{top:0,right:0,bottom:0,left:0,...e}}function wr(e){return typeof e!="number"?qs(e):{top:e,right:e,bottom:e,left:e}}function ot(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Cn(e,t,n){let{reference:r,floating:o}=e;const s=me(t),a=Gt(t),i=Yt(a),u=ae(t),l=s==="y",f=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[i]/2-o[i]/2;let g;switch(u){case"top":g={x:f,y:r.y-o.height};break;case"bottom":g={x:f,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:d};break;case"left":g={x:r.x-o.width,y:d};break;default:g={x:r.x,y:r.y}}switch(Re(t)){case"start":g[a]-=p*(n&&l?-1:1);break;case"end":g[a]+=p*(n&&l?-1:1);break}return g}const Js=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:a}=n,i=s.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:d}=Cn(l,r,u),p=r,g={},v=0;for(let h=0;h<i.length;h++){const{name:x,fn:w}=i[h],{x:A,y:S,data:j,reset:C}=await w({x:f,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:g,rects:l,platform:a,elements:{reference:e,floating:t}});f=A??f,d=S??d,g={...g,[x]:{...g[x],...j}},C&&v<=50&&(v++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(l=C.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:f,y:d}=Cn(l,p,u)),h=-1)}return{x:f,y:d,placement:p,strategy:o,middlewareData:g}};async function $e(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:a,elements:i,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:p=!1,padding:g=0}=se(t,e),v=wr(g),x=i[p?d==="floating"?"reference":"floating":d],w=ot(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(x)))==null||n?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(i.floating)),boundary:l,rootBoundary:f,strategy:u})),A=d==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(i.floating)),j=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},C=ot(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:A,offsetParent:S,strategy:u}):A);return{top:(w.top-C.top+v.top)/j.y,bottom:(C.bottom-w.bottom+v.bottom)/j.y,left:(w.left-C.left+v.left)/j.x,right:(C.right-w.right+v.right)/j.x}}const Ks=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:a,elements:i,middlewareData:u}=t,{element:l,padding:f=0}=se(e,t)||{};if(l==null)return{};const d=wr(f),p={x:n,y:r},g=Gt(o),v=Yt(g),h=await a.getDimensions(l),x=g==="y",w=x?"top":"left",A=x?"bottom":"right",S=x?"clientHeight":"clientWidth",j=s.reference[v]+s.reference[g]-p[g]-s.floating[v],C=p[g]-s.reference[g],P=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let E=P?P[S]:0;(!E||!await(a.isElement==null?void 0:a.isElement(P)))&&(E=i.floating[S]||s.floating[v]);const k=j/2-C/2,M=E/2-h[v]/2-1,I=de(d[w],M),B=de(d[A],M),H=I,$=E-h[v]-B,_=E/2-h[v]/2+k,D=Nt(H,_,$),F=!u.arrow&&Re(o)!=null&&_!==D&&s.reference[v]/2-(_<H?I:B)-h[v]/2<0,T=F?_<H?_-H:_-$:0;return{[g]:p[g]+T,data:{[g]:D,centerOffset:_-D-T,...F&&{alignmentOffset:T}},reset:F}}}),Qs=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:a,initialPlacement:i,platform:u,elements:l}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:h=!0,...x}=se(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=ae(o),A=me(i),S=ae(i)===i,j=await(u.isRTL==null?void 0:u.isRTL(l.floating)),C=p||(S||!h?[rt(i)]:Gs(i)),P=v!=="none";!p&&P&&C.push(...Xs(i,h,v,j));const E=[i,...C],k=await $e(t,x),M=[];let I=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&M.push(k[w]),d){const _=Ys(o,a,j);M.push(k[_[0]],k[_[1]])}if(I=[...I,{placement:o,overflows:M}],!M.every(_=>_<=0)){var B,H;const _=(((B=s.flip)==null?void 0:B.index)||0)+1,D=E[_];if(D)return{data:{index:_,overflows:I},reset:{placement:D}};let F=(H=I.filter(T=>T.overflows[0]<=0).sort((T,R)=>T.overflows[1]-R.overflows[1])[0])==null?void 0:H.placement;if(!F)switch(g){case"bestFit":{var $;const T=($=I.filter(R=>{if(P){const z=me(R.placement);return z===A||z==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(z=>z>0).reduce((z,y)=>z+y,0)]).sort((R,z)=>R[1]-z[1])[0])==null?void 0:$[0];T&&(F=T);break}case"initialPlacement":F=i;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function En(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Sn(e){return zs.some(t=>e[t]>=0)}const ea=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=se(e,t);switch(r){case"referenceHidden":{const s=await $e(t,{...o,elementContext:"reference"}),a=En(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Sn(a)}}}case"escaped":{const s=await $e(t,{...o,altBoundary:!0}),a=En(s,n.floating);return{data:{escapedOffsets:a,escaped:Sn(a)}}}default:return{}}}}};async function ta(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=ae(n),i=Re(n),u=me(n)==="y",l=["left","top"].includes(a)?-1:1,f=s&&u?-1:1,d=se(t,e);let{mainAxis:p,crossAxis:g,alignmentAxis:v}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return i&&typeof v=="number"&&(g=i==="end"?v*-1:v),u?{x:g*f,y:p*l}:{x:p*l,y:g*f}}const na=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:a,middlewareData:i}=t,u=await ta(t,e);return a===((n=i.offset)==null?void 0:n.placement)&&(r=i.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:s+u.y,data:{...u,placement:a}}}}},ra=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:i={fn:x=>{let{x:w,y:A}=x;return{x:w,y:A}}},...u}=se(e,t),l={x:n,y:r},f=await $e(t,u),d=me(ae(o)),p=Ut(d);let g=l[p],v=l[d];if(s){const x=p==="y"?"top":"left",w=p==="y"?"bottom":"right",A=g+f[x],S=g-f[w];g=Nt(A,g,S)}if(a){const x=d==="y"?"top":"left",w=d==="y"?"bottom":"right",A=v+f[x],S=v-f[w];v=Nt(A,v,S)}const h=i.fn({...t,[p]:g,[d]:v});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[p]:s,[d]:a}}}}}},oa=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:a}=t,{offset:i=0,mainAxis:u=!0,crossAxis:l=!0}=se(e,t),f={x:n,y:r},d=me(o),p=Ut(d);let g=f[p],v=f[d];const h=se(i,t),x=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(u){const S=p==="y"?"height":"width",j=s.reference[p]-s.floating[S]+x.mainAxis,C=s.reference[p]+s.reference[S]-x.mainAxis;g<j?g=j:g>C&&(g=C)}if(l){var w,A;const S=p==="y"?"width":"height",j=["top","left"].includes(ae(o)),C=s.reference[d]-s.floating[S]+(j&&((w=a.offset)==null?void 0:w[d])||0)+(j?0:x.crossAxis),P=s.reference[d]+s.reference[S]+(j?0:((A=a.offset)==null?void 0:A[d])||0)-(j?x.crossAxis:0);v<C?v=C:v>P&&(v=P)}return{[p]:g,[d]:v}}}},sa=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:a,elements:i}=t,{apply:u=()=>{},...l}=se(e,t),f=await $e(t,l),d=ae(o),p=Re(o),g=me(o)==="y",{width:v,height:h}=s.floating;let x,w;d==="top"||d==="bottom"?(x=d,w=p===(await(a.isRTL==null?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(w=d,x=p==="end"?"top":"bottom");const A=h-f.top-f.bottom,S=v-f.left-f.right,j=de(h-f[x],A),C=de(v-f[w],S),P=!t.middlewareData.shift;let E=j,k=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(k=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=A),P&&!p){const I=Z(f.left,0),B=Z(f.right,0),H=Z(f.top,0),$=Z(f.bottom,0);g?k=v-2*(I!==0||B!==0?I+B:Z(f.left,f.right)):E=h-2*(H!==0||$!==0?H+$:Z(f.top,f.bottom))}await u({...t,availableWidth:k,availableHeight:E});const M=await a.getDimensions(i.floating);return v!==M.width||h!==M.height?{reset:{rects:!0}}:{}}}};function at(){return typeof window<"u"}function Te(e){return jr(e)?(e.nodeName||"").toLowerCase():"#document"}function X(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function re(e){var t;return(t=(jr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function jr(e){return at()?e instanceof Node||e instanceof X(e).Node:!1}function K(e){return at()?e instanceof Element||e instanceof X(e).Element:!1}function ne(e){return at()?e instanceof HTMLElement||e instanceof X(e).HTMLElement:!1}function An(e){return!at()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof X(e).ShadowRoot}function Be(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Q(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function aa(e){return["table","td","th"].includes(Te(e))}function it(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Zt(e){const t=Xt(),n=K(e)?Q(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function ia(e){let t=pe(e);for(;ne(t)&&!Ne(t);){if(Zt(t))return t;if(it(t))return null;t=pe(t)}return null}function Xt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ne(e){return["html","body","#document"].includes(Te(e))}function Q(e){return X(e).getComputedStyle(e)}function ct(e){return K(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function pe(e){if(Te(e)==="html")return e;const t=e.assignedSlot||e.parentNode||An(e)&&e.host||re(e);return An(t)?t.host:t}function Cr(e){const t=pe(e);return Ne(t)?e.ownerDocument?e.ownerDocument.body:e.body:ne(t)&&Be(t)?t:Cr(t)}function We(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Cr(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),a=X(o);if(s){const i=Rt(a);return t.concat(a,a.visualViewport||[],Be(o)?o:[],i&&n?We(i):[])}return t.concat(o,We(o,[],n))}function Rt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Er(e){const t=Q(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ne(e),s=o?e.offsetWidth:n,a=o?e.offsetHeight:r,i=nt(n)!==s||nt(r)!==a;return i&&(n=s,r=a),{width:n,height:r,$:i}}function qt(e){return K(e)?e:e.contextElement}function Ee(e){const t=qt(e);if(!ne(t))return te(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Er(t);let a=(s?nt(n.width):n.width)/r,i=(s?nt(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!i||!Number.isFinite(i))&&(i=1),{x:a,y:i}}const ca=te(0);function Sr(e){const t=X(e);return!Xt()||!t.visualViewport?ca:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function la(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==X(e)?!1:t}function be(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=qt(e);let a=te(1);t&&(r?K(r)&&(a=Ee(r)):a=Ee(e));const i=la(s,n,r)?Sr(s):te(0);let u=(o.left+i.x)/a.x,l=(o.top+i.y)/a.y,f=o.width/a.x,d=o.height/a.y;if(s){const p=X(s),g=r&&K(r)?X(r):r;let v=p,h=Rt(v);for(;h&&r&&g!==v;){const x=Ee(h),w=h.getBoundingClientRect(),A=Q(h),S=w.left+(h.clientLeft+parseFloat(A.paddingLeft))*x.x,j=w.top+(h.clientTop+parseFloat(A.paddingTop))*x.y;u*=x.x,l*=x.y,f*=x.x,d*=x.y,u+=S,l+=j,v=X(h),h=Rt(v)}}return ot({width:f,height:d,x:u,y:l})}function Jt(e,t){const n=ct(e).scrollLeft;return t?t.left+n:be(re(e)).left+n}function Ar(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Jt(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function ua(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",a=re(r),i=t?it(t.floating):!1;if(r===a||i&&s)return n;let u={scrollLeft:0,scrollTop:0},l=te(1);const f=te(0),d=ne(r);if((d||!d&&!s)&&((Te(r)!=="body"||Be(a))&&(u=ct(r)),ne(r))){const g=be(r);l=Ee(r),f.x=g.x+r.clientLeft,f.y=g.y+r.clientTop}const p=a&&!d&&!s?Ar(a,u,!0):te(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-u.scrollLeft*l.x+f.x+p.x,y:n.y*l.y-u.scrollTop*l.y+f.y+p.y}}function fa(e){return Array.from(e.getClientRects())}function da(e){const t=re(e),n=ct(e),r=e.ownerDocument.body,o=Z(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Z(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Jt(e);const i=-n.scrollTop;return Q(r).direction==="rtl"&&(a+=Z(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:a,y:i}}function ma(e,t){const n=X(e),r=re(e),o=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,i=0,u=0;if(o){s=o.width,a=o.height;const l=Xt();(!l||l&&t==="fixed")&&(i=o.offsetLeft,u=o.offsetTop)}return{width:s,height:a,x:i,y:u}}function pa(e,t){const n=be(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=ne(e)?Ee(e):te(1),a=e.clientWidth*s.x,i=e.clientHeight*s.y,u=o*s.x,l=r*s.y;return{width:a,height:i,x:u,y:l}}function Pn(e,t,n){let r;if(t==="viewport")r=ma(e,n);else if(t==="document")r=da(re(e));else if(K(t))r=pa(t,n);else{const o=Sr(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ot(r)}function Pr(e,t){const n=pe(e);return n===t||!K(n)||Ne(n)?!1:Q(n).position==="fixed"||Pr(n,t)}function ha(e,t){const n=t.get(e);if(n)return n;let r=We(e,[],!1).filter(i=>K(i)&&Te(i)!=="body"),o=null;const s=Q(e).position==="fixed";let a=s?pe(e):e;for(;K(a)&&!Ne(a);){const i=Q(a),u=Zt(a);!u&&i.position==="fixed"&&(o=null),(s?!u&&!o:!u&&i.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Be(a)&&!u&&Pr(e,a))?r=r.filter(f=>f!==a):o=i,a=pe(a)}return t.set(e,r),r}function ga(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?it(t)?[]:ha(t,this._c):[].concat(n),r],i=a[0],u=a.reduce((l,f)=>{const d=Pn(t,f,o);return l.top=Z(d.top,l.top),l.right=de(d.right,l.right),l.bottom=de(d.bottom,l.bottom),l.left=Z(d.left,l.left),l},Pn(t,i,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function va(e){const{width:t,height:n}=Er(e);return{width:t,height:n}}function ya(e,t,n){const r=ne(t),o=re(t),s=n==="fixed",a=be(e,!0,s,t);let i={scrollLeft:0,scrollTop:0};const u=te(0);if(r||!r&&!s)if((Te(t)!=="body"||Be(o))&&(i=ct(t)),r){const p=be(t,!0,s,t);u.x=p.x+t.clientLeft,u.y=p.y+t.clientTop}else o&&(u.x=Jt(o));const l=o&&!r&&!s?Ar(o,i):te(0),f=a.left+i.scrollLeft-u.x-l.x,d=a.top+i.scrollTop-u.y-l.y;return{x:f,y:d,width:a.width,height:a.height}}function yt(e){return Q(e).position==="static"}function Nn(e,t){if(!ne(e)||Q(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return re(e)===n&&(n=n.ownerDocument.body),n}function Nr(e,t){const n=X(e);if(it(e))return n;if(!ne(e)){let o=pe(e);for(;o&&!Ne(o);){if(K(o)&&!yt(o))return o;o=pe(o)}return n}let r=Nn(e,t);for(;r&&aa(r)&&yt(r);)r=Nn(r,t);return r&&Ne(r)&&yt(r)&&!Zt(r)?n:r||ia(e)||n}const xa=async function(e){const t=this.getOffsetParent||Nr,n=this.getDimensions,r=await n(e.floating);return{reference:ya(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ba(e){return Q(e).direction==="rtl"}const wa={convertOffsetParentRelativeRectToViewportRelativeRect:ua,getDocumentElement:re,getClippingRect:ga,getOffsetParent:Nr,getElementRects:xa,getClientRects:fa,getDimensions:va,getScale:Ee,isElement:K,isRTL:ba};function Or(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ja(e,t){let n=null,r;const o=re(e);function s(){var i;clearTimeout(r),(i=n)==null||i.disconnect(),n=null}function a(i,u){i===void 0&&(i=!1),u===void 0&&(u=1),s();const l=e.getBoundingClientRect(),{left:f,top:d,width:p,height:g}=l;if(i||t(),!p||!g)return;const v=Ue(d),h=Ue(o.clientWidth-(f+p)),x=Ue(o.clientHeight-(d+g)),w=Ue(f),S={rootMargin:-v+"px "+-h+"px "+-x+"px "+-w+"px",threshold:Z(0,de(1,u))||1};let j=!0;function C(P){const E=P[0].intersectionRatio;if(E!==u){if(!j)return a();E?a(!1,E):r=setTimeout(()=>{a(!1,1e-7)},1e3)}E===1&&!Or(l,e.getBoundingClientRect())&&a(),j=!1}try{n=new IntersectionObserver(C,{...S,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,S)}n.observe(e)}return a(!0),s}function Ca(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,l=qt(e),f=o||s?[...l?We(l):[],...We(t)]:[];f.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const d=l&&i?ja(l,n):null;let p=-1,g=null;a&&(g=new ResizeObserver(w=>{let[A]=w;A&&A.target===l&&g&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var S;(S=g)==null||S.observe(t)})),n()}),l&&!u&&g.observe(l),g.observe(t));let v,h=u?be(e):null;u&&x();function x(){const w=be(e);h&&!Or(h,w)&&n(),h=w,v=requestAnimationFrame(x)}return n(),()=>{var w;f.forEach(A=>{o&&A.removeEventListener("scroll",n),s&&A.removeEventListener("resize",n)}),d?.(),(w=g)==null||w.disconnect(),g=null,u&&cancelAnimationFrame(v)}}const Ea=na,Sa=ra,Aa=Qs,Pa=sa,Na=ea,On=Ks,Oa=oa,Ra=(e,t,n)=>{const r=new Map,o={platform:wa,...n},s={...o.platform,_c:r};return Js(e,t,{...o,platform:s})};var Ke=typeof document<"u"?b.useLayoutEffect:b.useEffect;function st(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!st(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!st(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Rr(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Rn(e,t){const n=Rr(e);return Math.round(t*n)/n}function xt(e){const t=m.useRef(e);return Ke(()=>{t.current=e}),t}function Ta(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:a}={},transform:i=!0,whileElementsMounted:u,open:l}=e,[f,d]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,g]=m.useState(r);st(p,r)||g(r);const[v,h]=m.useState(null),[x,w]=m.useState(null),A=m.useCallback(R=>{R!==P.current&&(P.current=R,h(R))},[]),S=m.useCallback(R=>{R!==E.current&&(E.current=R,w(R))},[]),j=s||v,C=a||x,P=m.useRef(null),E=m.useRef(null),k=m.useRef(f),M=u!=null,I=xt(u),B=xt(o),H=xt(l),$=m.useCallback(()=>{if(!P.current||!E.current)return;const R={placement:t,strategy:n,middleware:p};B.current&&(R.platform=B.current),Ra(P.current,E.current,R).then(z=>{const y={...z,isPositioned:H.current!==!1};_.current&&!st(k.current,y)&&(k.current=y,ir.flushSync(()=>{d(y)}))})},[p,t,n,B,H]);Ke(()=>{l===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,d(R=>({...R,isPositioned:!1})))},[l]);const _=m.useRef(!1);Ke(()=>(_.current=!0,()=>{_.current=!1}),[]),Ke(()=>{if(j&&(P.current=j),C&&(E.current=C),j&&C){if(I.current)return I.current(j,C,$);$()}},[j,C,$,I,M]);const D=m.useMemo(()=>({reference:P,floating:E,setReference:A,setFloating:S}),[A,S]),F=m.useMemo(()=>({reference:j,floating:C}),[j,C]),T=m.useMemo(()=>{const R={position:n,left:0,top:0};if(!F.floating)return R;const z=Rn(F.floating,f.x),y=Rn(F.floating,f.y);return i?{...R,transform:"translate("+z+"px, "+y+"px)",...Rr(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:z,top:y}},[n,i,F.floating,f.x,f.y]);return m.useMemo(()=>({...f,update:$,refs:D,elements:F,floatingStyles:T}),[f,$,D,F,T])}const ka=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?On({element:r.current,padding:o}).fn(n):{}:r?On({element:r,padding:o}).fn(n):{}}}},Ma=(e,t)=>({...Ea(e),options:[e,t]}),_a=(e,t)=>({...Sa(e),options:[e,t]}),Da=(e,t)=>({...Oa(e),options:[e,t]}),Fa=(e,t)=>({...Aa(e),options:[e,t]}),La=(e,t)=>({...Pa(e),options:[e,t]}),Ia=(e,t)=>({...Na(e),options:[e,t]}),$a=(e,t)=>({...ka(e),options:[e,t]});var Wa="Arrow",Tr=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return c.jsx(ie.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});Tr.displayName=Wa;var Ba=Tr;function Ha(e){const[t,n]=m.useState(void 0);return fe(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let a,i;if("borderBoxSize"in s){const u=s.borderBoxSize,l=Array.isArray(u)?u[0]:u;a=l.inlineSize,i=l.blockSize}else a=e.offsetWidth,i=e.offsetHeight;n({width:a,height:i})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Kt="Popper",[kr,Mr]=pr(Kt),[za,_r]=kr(Kt),Dr=e=>{const{__scopePopper:t,children:n}=e,[r,o]=m.useState(null);return c.jsx(za,{scope:t,anchor:r,onAnchorChange:o,children:n})};Dr.displayName=Kt;var Fr="PopperAnchor",Lr=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=_r(Fr,n),a=m.useRef(null),i=he(t,a),u=m.useRef(null);return m.useEffect(()=>{const l=u.current;u.current=r?.current||a.current,l!==u.current&&s.onAnchorChange(u.current)}),r?null:c.jsx(ie.div,{...o,ref:i})});Lr.displayName=Fr;var Qt="PopperContent",[Va,Ua]=kr(Qt),Ir=m.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:a=0,arrowPadding:i=0,avoidCollisions:u=!0,collisionBoundary:l=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:g="optimized",onPlaced:v,...h}=e,x=_r(Qt,n),[w,A]=m.useState(null),S=he(t,oe=>A(oe)),[j,C]=m.useState(null),P=Ha(j),E=P?.width??0,k=P?.height??0,M=r+(s!=="center"?"-"+s:""),I=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},B=Array.isArray(l)?l:[l],H=B.length>0,$={padding:I,boundary:B.filter(Ga),altBoundary:H},{refs:_,floatingStyles:D,placement:F,isPositioned:T,middlewareData:R}=Ta({strategy:"fixed",placement:M,whileElementsMounted:(...oe)=>Ca(...oe,{animationFrame:g==="always"}),elements:{reference:x.anchor},middleware:[Ma({mainAxis:o+k,alignmentAxis:a}),u&&_a({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Da():void 0,...$}),u&&Fa({...$}),La({...$,apply:({elements:oe,rects:V,availableWidth:ce,availableHeight:Me})=>{const{width:pt,height:ko}=V.reference,ze=oe.floating.style;ze.setProperty("--radix-popper-available-width",`${ce}px`),ze.setProperty("--radix-popper-available-height",`${Me}px`),ze.setProperty("--radix-popper-anchor-width",`${pt}px`),ze.setProperty("--radix-popper-anchor-height",`${ko}px`)}}),j&&$a({element:j,padding:i}),Za({arrowWidth:E,arrowHeight:k}),p&&Ia({strategy:"referenceHidden",...$})]}),[z,y]=Br(F),O=Pe(v);fe(()=>{T&&O?.()},[T,O]);const W=R.arrow?.x,N=R.arrow?.y,L=R.arrow?.centerOffset!==0,[Y,ke]=m.useState();return fe(()=>{w&&ke(window.getComputedStyle(w).zIndex)},[w]),c.jsx("div",{ref:_.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:T?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[R.transformOrigin?.x,R.transformOrigin?.y].join(" "),...R.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(Va,{scope:n,placedSide:z,onArrowChange:C,arrowX:W,arrowY:N,shouldHideArrow:L,children:c.jsx(ie.div,{"data-side":z,"data-align":y,...h,ref:S,style:{...h.style,animation:T?void 0:"none"}})})})});Ir.displayName=Qt;var $r="PopperArrow",Ya={top:"bottom",right:"left",bottom:"top",left:"right"},Wr=m.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=Ua($r,r),a=Ya[s.placedSide];return c.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:c.jsx(Ba,{...o,ref:n,style:{...o.style,display:"block"}})})});Wr.displayName=$r;function Ga(e){return e!==null}var Za=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=o.arrow?.centerOffset!==0,i=a?0:e.arrowWidth,u=a?0:e.arrowHeight,[l,f]=Br(n),d={start:"0%",center:"50%",end:"100%"}[f],p=(o.arrow?.x??0)+i/2,g=(o.arrow?.y??0)+u/2;let v="",h="";return l==="bottom"?(v=a?d:`${p}px`,h=`${-u}px`):l==="top"?(v=a?d:`${p}px`,h=`${r.floating.height+u}px`):l==="right"?(v=`${-u}px`,h=a?d:`${g}px`):l==="left"&&(v=`${r.floating.width+u}px`,h=a?d:`${g}px`),{data:{x:v,y:h}}}});function Br(e){const[t,n="center"]=e.split("-");return[t,n]}var Xa=Dr,Hr=Lr,qa=Ir,Ja=Wr,Ka="Portal",zr=m.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=m.useState(!1);fe(()=>s(!0),[]);const a=n||o&&globalThis?.document?.body;return a?sr.createPortal(c.jsx(ie.div,{...r,ref:t}),a):null});zr.displayName=Ka;function Qa(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var en=e=>{const{present:t,children:n}=e,r=ei(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),s=he(r.ref,ti(o));return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:s}):null};en.displayName="Presence";function ei(e){const[t,n]=m.useState(),r=m.useRef(null),o=m.useRef(e),s=m.useRef("none"),a=e?"mounted":"unmounted",[i,u]=Qa(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const l=Ye(r.current);s.current=i==="mounted"?l:"none"},[i]),fe(()=>{const l=r.current,f=o.current;if(f!==e){const p=s.current,g=Ye(l);e?u("MOUNT"):g==="none"||l?.display==="none"?u("UNMOUNT"):u(f&&p!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),fe(()=>{if(t){let l;const f=t.ownerDocument.defaultView??window,d=g=>{const h=Ye(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&h&&(u("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",l=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},p=g=>{g.target===t&&(s.current=Ye(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(l),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:m.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function Ye(e){return e?.animationName||"none"}function ti(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ni=m[" useInsertionEffect ".trim().toString()]||fe;function ri({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,a]=oi({defaultProp:t,onChange:n}),i=e!==void 0,u=i?e:o;{const f=m.useRef(e!==void 0);m.useEffect(()=>{const d=f.current;d!==i&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=i},[i,r])}const l=m.useCallback(f=>{if(i){const d=si(f)?f(e):f;d!==e&&a.current?.(d)}else s(f)},[i,e,s,a]);return[u,l]}function oi({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),o=m.useRef(n),s=m.useRef(t);return ni(()=>{s.current=t},[t]),m.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function si(e){return typeof e=="function"}var ai=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},we=new WeakMap,Ge=new WeakMap,Ze={},bt=0,Vr=function(e){return e&&(e.host||Vr(e.parentNode))},ii=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Vr(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ci=function(e,t,n,r){var o=ii(t,Array.isArray(e)?e:[e]);Ze[n]||(Ze[n]=new WeakMap);var s=Ze[n],a=[],i=new Set,u=new Set(o),l=function(d){!d||i.has(d)||(i.add(d),l(d.parentNode))};o.forEach(l);var f=function(d){!d||u.has(d)||Array.prototype.forEach.call(d.children,function(p){if(i.has(p))f(p);else try{var g=p.getAttribute(r),v=g!==null&&g!=="false",h=(we.get(p)||0)+1,x=(s.get(p)||0)+1;we.set(p,h),s.set(p,x),a.push(p),h===1&&v&&Ge.set(p,!0),x===1&&p.setAttribute(n,"true"),v||p.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",p,w)}})};return f(t),i.clear(),bt++,function(){a.forEach(function(d){var p=we.get(d)-1,g=s.get(d)-1;we.set(d,p),s.set(d,g),p||(Ge.has(d)||d.removeAttribute(r),Ge.delete(d)),g||d.removeAttribute(n)}),bt--,bt||(we=new WeakMap,we=new WeakMap,Ge=new WeakMap,Ze={})}},li=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=ai(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),ci(r,o,n,"aria-hidden")):function(){return null}},ee=function(){return ee=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},ee.apply(this,arguments)};function Ur(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function ui(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Qe="right-scroll-bar-position",et="width-before-scroll-bar",fi="with-scroll-bars-hidden",di="--removed-body-scroll-bar-size";function wt(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function mi(e,t){var n=b.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var pi=typeof window<"u"?m.useLayoutEffect:m.useEffect,Tn=new WeakMap;function hi(e,t){var n=mi(null,function(r){return e.forEach(function(o){return wt(o,r)})});return pi(function(){var r=Tn.get(n);if(r){var o=new Set(r),s=new Set(e),a=n.current;o.forEach(function(i){s.has(i)||wt(i,null)}),s.forEach(function(i){o.has(i)||wt(i,a)})}Tn.set(n,e)},[e]),n}function gi(e){return e}function vi(e,t){t===void 0&&(t=gi);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var a=t(s,r);return n.push(a),function(){n=n.filter(function(i){return i!==a})}},assignSyncMedium:function(s){for(r=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(i){return s(i)},filter:function(){return n}}},assignMedium:function(s){r=!0;var a=[];if(n.length){var i=n;n=[],i.forEach(s),a=n}var u=function(){var f=a;a=[],f.forEach(s)},l=function(){return Promise.resolve().then(u)};l(),n={push:function(f){a.push(f),l()},filter:function(f){return a=a.filter(f),n}}}};return o}function yi(e){e===void 0&&(e={});var t=vi(null);return t.options=ee({async:!0,ssr:!1},e),t}var Yr=function(e){var t=e.sideCar,n=Ur(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return m.createElement(r,ee({},n))};Yr.isSideCarExport=!0;function xi(e,t){return e.useMedium(t),Yr}var Gr=yi(),jt=function(){},lt=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:jt,onWheelCapture:jt,onTouchMoveCapture:jt}),o=r[0],s=r[1],a=e.forwardProps,i=e.children,u=e.className,l=e.removeScrollBar,f=e.enabled,d=e.shards,p=e.sideCar,g=e.noIsolation,v=e.inert,h=e.allowPinchZoom,x=e.as,w=x===void 0?"div":x,A=e.gapMode,S=Ur(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=p,C=hi([n,t]),P=ee(ee({},S),o);return m.createElement(m.Fragment,null,f&&m.createElement(j,{sideCar:Gr,removeScrollBar:l,shards:d,noIsolation:g,inert:v,setCallbacks:s,allowPinchZoom:!!h,lockRef:n,gapMode:A}),a?m.cloneElement(m.Children.only(i),ee(ee({},P),{ref:C})):m.createElement(w,ee({},P,{className:u,ref:C}),i))});lt.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};lt.classNames={fullWidth:et,zeroRight:Qe};var bi=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function wi(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=bi();return t&&e.setAttribute("nonce",t),e}function ji(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ci(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ei=function(){var e=0,t=null;return{add:function(n){e==0&&(t=wi())&&(ji(t,n),Ci(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Si=function(){var e=Ei();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Zr=function(){var e=Si(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Ai={left:0,top:0,right:0,gap:0},Ct=function(e){return parseInt(e||"",10)||0},Pi=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Ct(n),Ct(r),Ct(o)]},Ni=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Ai;var t=Pi(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Oi=Zr(),Se="data-scroll-locked",Ri=function(e,t,n,r){var o=e.left,s=e.top,a=e.right,i=e.gap;return n===void 0&&(n="margin"),`
|
|
98
|
-
.`.concat(fi,` {
|
|
99
|
-
overflow: hidden `).concat(r,`;
|
|
100
|
-
padding-right: `).concat(i,"px ").concat(r,`;
|
|
101
|
-
}
|
|
102
|
-
body[`).concat(Se,`] {
|
|
103
|
-
overflow: hidden `).concat(r,`;
|
|
104
|
-
overscroll-behavior: contain;
|
|
105
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
106
|
-
padding-left: `.concat(o,`px;
|
|
107
|
-
padding-top: `).concat(s,`px;
|
|
108
|
-
padding-right: `).concat(a,`px;
|
|
109
|
-
margin-left:0;
|
|
110
|
-
margin-top:0;
|
|
111
|
-
margin-right: `).concat(i,"px ").concat(r,`;
|
|
112
|
-
`),n==="padding"&&"padding-right: ".concat(i,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.`).concat(Qe,` {
|
|
116
|
-
right: `).concat(i,"px ").concat(r,`;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.`).concat(et,` {
|
|
120
|
-
margin-right: `).concat(i,"px ").concat(r,`;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.`).concat(Qe," .").concat(Qe,` {
|
|
124
|
-
right: 0 `).concat(r,`;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.`).concat(et," .").concat(et,` {
|
|
128
|
-
margin-right: 0 `).concat(r,`;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
body[`).concat(Se,`] {
|
|
132
|
-
`).concat(di,": ").concat(i,`px;
|
|
133
|
-
}
|
|
134
|
-
`)},kn=function(){var e=parseInt(document.body.getAttribute(Se)||"0",10);return isFinite(e)?e:0},Ti=function(){m.useEffect(function(){return document.body.setAttribute(Se,(kn()+1).toString()),function(){var e=kn()-1;e<=0?document.body.removeAttribute(Se):document.body.setAttribute(Se,e.toString())}},[])},ki=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Ti();var s=m.useMemo(function(){return Ni(o)},[o]);return m.createElement(Oi,{styles:Ri(s,!t,o,n?"":"!important")})},Tt=!1;if(typeof window<"u")try{var Xe=Object.defineProperty({},"passive",{get:function(){return Tt=!0,!0}});window.addEventListener("test",Xe,Xe),window.removeEventListener("test",Xe,Xe)}catch{Tt=!1}var je=Tt?{passive:!1}:!1,Mi=function(e){return e.tagName==="TEXTAREA"},Xr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Mi(e)&&n[t]==="visible")},_i=function(e){return Xr(e,"overflowY")},Di=function(e){return Xr(e,"overflowX")},Mn=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=qr(e,r);if(o){var s=Jr(e,r),a=s[1],i=s[2];if(a>i)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Fi=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Li=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},qr=function(e,t){return e==="v"?_i(t):Di(t)},Jr=function(e,t){return e==="v"?Fi(t):Li(t)},Ii=function(e,t){return e==="h"&&t==="rtl"?-1:1},$i=function(e,t,n,r,o){var s=Ii(e,window.getComputedStyle(t).direction),a=s*r,i=n.target,u=t.contains(i),l=!1,f=a>0,d=0,p=0;do{var g=Jr(e,i),v=g[0],h=g[1],x=g[2],w=h-x-s*v;(v||w)&&qr(e,i)&&(d+=w,p+=v),i instanceof ShadowRoot?i=i.host:i=i.parentNode}while(!u&&i!==document.body||u&&(t.contains(i)||t===i));return(f&&Math.abs(d)<1||!f&&Math.abs(p)<1)&&(l=!0),l},qe=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},_n=function(e){return[e.deltaX,e.deltaY]},Dn=function(e){return e&&"current"in e?e.current:e},Wi=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Bi=function(e){return`
|
|
135
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
136
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
137
|
-
`)},Hi=0,Ce=[];function zi(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),o=m.useState(Hi++)[0],s=m.useState(Zr)[0],a=m.useRef(e);m.useEffect(function(){a.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=ui([e.lockRef.current],(e.shards||[]).map(Dn),!0).filter(Boolean);return h.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),h.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=m.useCallback(function(h,x){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!a.current.allowPinchZoom;var w=qe(h),A=n.current,S="deltaX"in h?h.deltaX:A[0]-w[0],j="deltaY"in h?h.deltaY:A[1]-w[1],C,P=h.target,E=Math.abs(S)>Math.abs(j)?"h":"v";if("touches"in h&&E==="h"&&P.type==="range")return!1;var k=Mn(E,P);if(!k)return!0;if(k?C=E:(C=E==="v"?"h":"v",k=Mn(E,P)),!k)return!1;if(!r.current&&"changedTouches"in h&&(S||j)&&(r.current=C),!C)return!0;var M=r.current||C;return $i(M,x,h,M==="h"?S:j)},[]),u=m.useCallback(function(h){var x=h;if(!(!Ce.length||Ce[Ce.length-1]!==s)){var w="deltaY"in x?_n(x):qe(x),A=t.current.filter(function(C){return C.name===x.type&&(C.target===x.target||x.target===C.shadowParent)&&Wi(C.delta,w)})[0];if(A&&A.should){x.cancelable&&x.preventDefault();return}if(!A){var S=(a.current.shards||[]).map(Dn).filter(Boolean).filter(function(C){return C.contains(x.target)}),j=S.length>0?i(x,S[0]):!a.current.noIsolation;j&&x.cancelable&&x.preventDefault()}}},[]),l=m.useCallback(function(h,x,w,A){var S={name:h,delta:x,target:w,should:A,shadowParent:Vi(w)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(j){return j!==S})},1)},[]),f=m.useCallback(function(h){n.current=qe(h),r.current=void 0},[]),d=m.useCallback(function(h){l(h.type,_n(h),h.target,i(h,e.lockRef.current))},[]),p=m.useCallback(function(h){l(h.type,qe(h),h.target,i(h,e.lockRef.current))},[]);m.useEffect(function(){return Ce.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",u,je),document.addEventListener("touchmove",u,je),document.addEventListener("touchstart",f,je),function(){Ce=Ce.filter(function(h){return h!==s}),document.removeEventListener("wheel",u,je),document.removeEventListener("touchmove",u,je),document.removeEventListener("touchstart",f,je)}},[]);var g=e.removeScrollBar,v=e.inert;return m.createElement(m.Fragment,null,v?m.createElement(s,{styles:Bi(o)}):null,g?m.createElement(ki,{gapMode:e.gapMode}):null)}function Vi(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ui=xi(Gr,zi);var Kr=m.forwardRef(function(e,t){return m.createElement(lt,ee({},e,{ref:t,sideCar:Ui}))});Kr.classNames=lt.classNames;var ut="Popover",[Qr]=pr(ut,[Mr]),He=Mr(),[Yi,ge]=Qr(ut),eo=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:a=!1}=e,i=He(t),u=m.useRef(null),[l,f]=m.useState(!1),[d,p]=ri({prop:r,defaultProp:o??!1,onChange:s,caller:ut});return c.jsx(Xa,{...i,children:c.jsx(Yi,{scope:t,contentId:Hs(),triggerRef:u,open:d,onOpenChange:p,onOpenToggle:m.useCallback(()=>p(g=>!g),[p]),hasCustomAnchor:l,onCustomAnchorAdd:m.useCallback(()=>f(!0),[]),onCustomAnchorRemove:m.useCallback(()=>f(!1),[]),modal:a,children:n})})};eo.displayName=ut;var to="PopoverAnchor",Gi=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=ge(to,n),s=He(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:i}=o;return m.useEffect(()=>(a(),()=>i()),[a,i]),c.jsx(Hr,{...s,...r,ref:t})});Gi.displayName=to;var no="PopoverTrigger",ro=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=ge(no,n),s=He(n),a=he(t,o.triggerRef),i=c.jsx(ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":co(o.open),...r,ref:a,onClick:ue(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:c.jsx(Hr,{asChild:!0,...s,children:i})});ro.displayName=no;var tn="PopoverPortal",[Zi,Xi]=Qr(tn,{forceMount:void 0}),oo=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=ge(tn,t);return c.jsx(Zi,{scope:t,forceMount:n,children:c.jsx(en,{present:n||s.open,children:c.jsx(zr,{asChild:!0,container:o,children:r})})})};oo.displayName=tn;var Oe="PopoverContent",so=m.forwardRef((e,t)=>{const n=Xi(Oe,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=ge(Oe,e.__scopePopover);return c.jsx(en,{present:r||s.open,children:s.modal?c.jsx(Ji,{...o,ref:t}):c.jsx(Ki,{...o,ref:t})})});so.displayName=Oe;var qi=hr("PopoverContent.RemoveScroll"),Ji=m.forwardRef((e,t)=>{const n=ge(Oe,e.__scopePopover),r=m.useRef(null),o=he(t,r),s=m.useRef(!1);return m.useEffect(()=>{const a=r.current;if(a)return li(a)},[]),c.jsx(Kr,{as:qi,allowPinchZoom:!0,children:c.jsx(ao,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ue(e.onCloseAutoFocus,a=>{a.preventDefault(),s.current||n.triggerRef.current?.focus()}),onPointerDownOutside:ue(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,u=i.button===0&&i.ctrlKey===!0,l=i.button===2||u;s.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:ue(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),Ki=m.forwardRef((e,t)=>{const n=ge(Oe,e.__scopePopover),r=m.useRef(!1),o=m.useRef(!1);return c.jsx(ao,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=s.target;n.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),ao=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:i,onPointerDownOutside:u,onFocusOutside:l,onInteractOutside:f,...d}=e,p=ge(Oe,n),g=He(n);return ks(),c.jsx(xr,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:c.jsx(vr,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:i,onPointerDownOutside:u,onFocusOutside:l,onDismiss:()=>p.onOpenChange(!1),children:c.jsx(qa,{"data-state":co(p.open),role:"dialog",id:p.contentId,...g,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),io="PopoverClose",Qi=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=ge(io,n);return c.jsx(ie.button,{type:"button",...r,ref:t,onClick:ue(e.onClick,()=>o.onOpenChange(!1))})});Qi.displayName=io;var ec="PopoverArrow",tc=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=He(n);return c.jsx(Ja,{...o,...r,ref:t})});tc.displayName=ec;function co(e){return e?"open":"closed"}var nc=eo,rc=ro,oc=oo,sc=so;const lo=({...e})=>c.jsx(nc,{"data-slot":"popover",...e}),uo=({...e})=>c.jsx(rc,{"data-slot":"popover-trigger",...e}),fo=({className:e,align:t="center",sideOffset:n=4,...r})=>c.jsx(oc,{children:c.jsx(sc,{"data-slot":"popover-content",align:t,sideOffset:n,className:G.cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})});function ac(e,t,n,r){function o(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function i(f){try{l(r.next(f))}catch(d){a(d)}}function u(f){try{l(r.throw(f))}catch(d){a(d)}}function l(f){f.done?s(f.value):o(f.value).then(i,u)}l((r=r.apply(e,[])).next())})}var ic=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||n.forEach(function(o){e.addRange(o)}),t&&t.focus()}},cc=ic,Fn={"text/plain":"Text","text/html":"Url",default:"Text"},lc="Copy to clipboard: #{key}, Enter";function uc(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function fc(e,t){var n,r,o,s,a,i,u=!1;t||(t={}),n=t.debug||!1;try{o=cc(),s=document.createRange(),a=document.getSelection(),i=document.createElement("span"),i.textContent=e,i.ariaHidden="true",i.style.all="unset",i.style.position="fixed",i.style.top=0,i.style.clip="rect(0, 0, 0, 0)",i.style.whiteSpace="pre",i.style.webkitUserSelect="text",i.style.MozUserSelect="text",i.style.msUserSelect="text",i.style.userSelect="text",i.addEventListener("copy",function(f){if(f.stopPropagation(),t.format)if(f.preventDefault(),typeof f.clipboardData>"u"){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var d=Fn[t.format]||Fn.default;window.clipboardData.setData(d,e)}else f.clipboardData.clearData(),f.clipboardData.setData(t.format,e);t.onCopy&&(f.preventDefault(),t.onCopy(f.clipboardData))}),document.body.appendChild(i),s.selectNodeContents(i),a.addRange(s);var l=document.execCommand("copy");if(!l)throw new Error("copy command was unsuccessful");u=!0}catch(f){n&&console.error("unable to copy using execCommand: ",f),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),u=!0}catch(d){n&&console.error("unable to copy using clipboardData: ",d),n&&console.error("falling back to prompt"),r=uc("message"in t?t.message:lc),window.prompt(r,e)}}finally{a&&(typeof a.removeRange=="function"?a.removeRange(s):a.removeAllRanges()),i&&document.body.removeChild(i),o()}return u}var dc=fc;function ve(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ie(e){return Array.isArray(e)?e.length:ve(e)?Object.keys(e).length:0}function mc(e,t){if(typeof e=="string")return e;try{return JSON.stringify(e,(n,r)=>{switch(typeof r){case"bigint":return String(r)+"n";case"number":case"boolean":case"object":case"string":return r;default:return String(r)}},t)}catch(n){return`${n.name}: ${n.message}`||"JSON.stringify failed"}}function pc(e){return ac(this,void 0,void 0,function*(){try{yield navigator.clipboard.writeText(e)}catch{dc(e)}})}function Ln(e,t,n,r,o,s){if(s&&s.collapsed!==void 0)return!!s.collapsed;if(typeof r=="boolean")return r;if(typeof r=="number"&&t>r)return!0;const a=Ie(e);if(typeof r=="function"){const i=nn(r,[{node:e,depth:t,indexOrName:n,size:a}]);if(typeof i=="boolean")return i}return!!(Array.isArray(e)&&a>o||ve(e)&&a>o)}function In(e,t,n,r,o,s){if(s&&s.collapsed!==void 0)return!!s.collapsed;if(typeof r=="boolean")return r;if(typeof r=="number"&&t>r)return!0;const a=Math.ceil(e.length/100);if(typeof r=="function"){const i=nn(r,[{node:e,depth:t,indexOrName:n,size:a}]);if(typeof i=="boolean")return i}return!!(Array.isArray(e)&&a>o||ve(e)&&a>o)}function Ae(e,t,n){return typeof e=="boolean"?e:!!(typeof e=="number"&&t>e||e==="collapsed"&&n||e==="expanded"&&!n)}function nn(e,t){try{return e(...t)}catch(n){reportError(n)}}function mo(e){if(e===!0||ve(e)&&e.add===!0)return!0}function $n(e){if(e===!0||ve(e)&&e.edit===!0)return!0}function rn(e){if(e===!0||ve(e)&&e.delete===!0)return!0}function hc(e){return typeof e=="function"}function po(e){return!e||e.add===void 0||!!e.add}function Wn(e){return!e||e.edit===void 0||!!e.edit}function on(e){return!e||e.delete===void 0||!!e.delete}function ft(e){return!e||e.enableClipboard===void 0||!!e.enableClipboard}function gc(e){return!e||e.matchesURL===void 0||!!e.matchesURL}function vc(e,t){return e==="string"?t.trim().replace(/^\"([\s\S]+?)\"$/,"$1"):t}var Bn;function kt(){return kt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kt.apply(this,arguments)}var sn=function(t){return m.createElement("svg",kt({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},t),Bn||(Bn=m.createElement("path",{fill:"currentColor",d:"M12.473 5.806a.666.666 0 0 0-.946 0L8.473 8.86a.667.667 0 0 1-.946 0L4.473 5.806a.667.667 0 1 0-.946.94l3.06 3.06a2 2 0 0 0 2.826 0l3.06-3.06a.667.667 0 0 0 0-.94Z"})))},Hn;function Mt(){return Mt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mt.apply(this,arguments)}var yc=function(t){return m.createElement("svg",Mt({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),Hn||(Hn=m.createElement("path",{fill:"currentColor",d:"M17.542 2.5h-4.75a3.963 3.963 0 0 0-3.959 3.958v4.75a3.963 3.963 0 0 0 3.959 3.959h4.75a3.963 3.963 0 0 0 3.958-3.959v-4.75A3.963 3.963 0 0 0 17.542 2.5Zm2.375 8.708a2.378 2.378 0 0 1-2.375 2.375h-4.75a2.378 2.378 0 0 1-2.375-2.375v-4.75a2.378 2.378 0 0 1 2.375-2.375h4.75a2.378 2.378 0 0 1 2.375 2.375v4.75Zm-4.75 6.334a3.963 3.963 0 0 1-3.959 3.958h-4.75A3.963 3.963 0 0 1 2.5 17.542v-4.75a3.963 3.963 0 0 1 3.958-3.959.791.791 0 1 1 0 1.584 2.378 2.378 0 0 0-2.375 2.375v4.75a2.378 2.378 0 0 0 2.375 2.375h4.75a2.378 2.378 0 0 0 2.375-2.375.792.792 0 1 1 1.584 0Z"})))},zn,Vn;function _t(){return _t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_t.apply(this,arguments)}var xc=function(t){return m.createElement("svg",_t({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),zn||(zn=m.createElement("path",{fill:"currentColor",d:"M17.25 3H6.75A3.755 3.755 0 0 0 3 6.75v10.5A3.754 3.754 0 0 0 6.75 21h10.5A3.754 3.754 0 0 0 21 17.25V6.75A3.755 3.755 0 0 0 17.25 3Zm2.25 14.25a2.25 2.25 0 0 1-2.25 2.25H6.75a2.25 2.25 0 0 1-2.25-2.25V6.75A2.25 2.25 0 0 1 6.75 4.5h10.5a2.25 2.25 0 0 1 2.25 2.25v10.5Z"})),Vn||(Vn=m.createElement("path",{fill:"#14C786",d:"M10.312 14.45 7.83 11.906a.625.625 0 0 0-.896 0 .659.659 0 0 0 0 .918l2.481 2.546a1.264 1.264 0 0 0 .896.381 1.237 1.237 0 0 0 .895-.38l5.858-6.011a.658.658 0 0 0 0-.919.625.625 0 0 0-.896 0l-5.857 6.01Z"})))};function dt({node:e,nodeMeta:t}){const{customizeCopy:n,CopyComponent:r,CopiedComponent:o}=b.useContext(ye),[s,a]=b.useState(!1),i=u=>{u.stopPropagation();const l=n(e,t);typeof l=="string"&&l&&pc(l),a(!0),setTimeout(()=>a(!1),3e3)};return s?typeof o=="function"?c.jsx(o,{className:"json-view--copy",style:{display:"inline-block"}}):c.jsx(xc,{className:"json-view--copy",style:{display:"inline-block"}}):typeof r=="function"?c.jsx(r,{onClick:i,className:"json-view--copy"}):c.jsx(yc,{onClick:i,className:"json-view--copy"})}function Dt({indexOrName:e,value:t,depth:n,deleteHandle:r,editHandle:o,parent:s,parentPath:a}){const{displayArrayIndex:i}=b.useContext(ye),u=Array.isArray(s);return c.jsxs("div",Object.assign({className:"json-view--pair"},{children:[!u||u&&i?c.jsxs(c.Fragment,{children:[c.jsx("span",Object.assign({className:typeof e=="number"?"json-view--index":"json-view--property"},{children:e})),":"," "]}):c.jsx(c.Fragment,{}),c.jsx(go,{node:t,depth:n+1,deleteHandle:(l,f)=>r(l,f),editHandle:(l,f,d,p)=>o(l,f,d,p),parent:s,indexOrName:e,parentPath:a})]}))}var Un,Yn;function Ft(){return Ft=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ft.apply(this,arguments)}var an=function(t){return m.createElement("svg",Ft({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),Un||(Un=m.createElement("path",{fill:"currentColor",d:"M18.75 6h-2.325a3.757 3.757 0 0 0-3.675-3h-1.5a3.757 3.757 0 0 0-3.675 3H5.25a.75.75 0 0 0 0 1.5H6v9.75A3.754 3.754 0 0 0 9.75 21h4.5A3.754 3.754 0 0 0 18 17.25V7.5h.75a.75.75 0 1 0 0-1.5Zm-7.5-1.5h1.5A2.255 2.255 0 0 1 14.872 6H9.128a2.255 2.255 0 0 1 2.122-1.5Zm5.25 12.75a2.25 2.25 0 0 1-2.25 2.25h-4.5a2.25 2.25 0 0 1-2.25-2.25V7.5h9v9.75Z"})),Yn||(Yn=m.createElement("path",{fill:"#DA0000",d:"M10.5 16.5a.75.75 0 0 0 .75-.75v-4.5a.75.75 0 1 0-1.5 0v4.5a.75.75 0 0 0 .75.75ZM13.5 16.5a.75.75 0 0 0 .75-.75v-4.5a.75.75 0 1 0-1.5 0v4.5a.75.75 0 0 0 .75.75Z"})))},Gn,Zn;function Lt(){return Lt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lt.apply(this,arguments)}var ho=function(t){return m.createElement("svg",Lt({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),Gn||(Gn=m.createElement("path",{fill:"currentColor",d:"M21 6.75v10.5A3.754 3.754 0 0 1 17.25 21H6.75A3.754 3.754 0 0 1 3 17.25V6.75A3.754 3.754 0 0 1 6.75 3h10.5A3.754 3.754 0 0 1 21 6.75Zm-1.5 0c0-1.24-1.01-2.25-2.25-2.25H6.75C5.51 4.5 4.5 5.51 4.5 6.75v10.5c0 1.24 1.01 2.25 2.25 2.25h10.5c1.24 0 2.25-1.01 2.25-2.25V6.75Z"})),Zn||(Zn=m.createElement("path",{fill:"#14C786",d:"M15 12.75a.75.75 0 1 0 0-1.5h-2.25V9a.75.75 0 1 0-1.5 0v2.25H9a.75.75 0 1 0 0 1.5h2.25V15a.75.75 0 1 0 1.5 0v-2.25H15Z"})))},Xn,qn;function It(){return It=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},It.apply(this,arguments)}var cn=function(t){return m.createElement("svg",It({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),Xn||(Xn=m.createElement("path",{fill:"currentColor",d:"M12 3a9 9 0 1 0 9 9 9.01 9.01 0 0 0-9-9Zm0 16.5a7.5 7.5 0 1 1 7.5-7.5 7.509 7.509 0 0 1-7.5 7.5Z"})),qn||(qn=m.createElement("path",{fill:"#14C786",d:"m10.85 13.96-1.986-2.036a.5.5 0 0 0-.716 0 .527.527 0 0 0 0 .735l1.985 2.036a1.01 1.01 0 0 0 .717.305.99.99 0 0 0 .716-.305l4.686-4.808a.526.526 0 0 0 0-.735.5.5 0 0 0-.716 0l-4.687 4.809Z"})))},Jn,Kn;function $t(){return $t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$t.apply(this,arguments)}var ln=function(t){return m.createElement("svg",$t({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),Jn||(Jn=m.createElement("path",{fill:"#DA0000",d:"M15 9a.75.75 0 0 0-1.06 0L12 10.94 10.06 9A.75.75 0 0 0 9 10.06L10.94 12 9 13.94A.75.75 0 0 0 10.06 15L12 13.06 13.94 15A.75.75 0 0 0 15 13.94L13.06 12 15 10.06A.75.75 0 0 0 15 9Z"})),Kn||(Kn=m.createElement("path",{fill:"currentColor",d:"M12 3a9 9 0 1 0 9 9 9.01 9.01 0 0 0-9-9Zm0 16.5a7.5 7.5 0 1 1 7.5-7.5 7.509 7.509 0 0 1-7.5 7.5Z"})))};function bc({originNode:e,node:t,depth:n,index:r,deleteHandle:o,customOptions:s,startIndex:a,parent:i,parentPath:u}){const{enableClipboard:l,src:f,onEdit:d,onChange:p,forceUpdate:g,displaySize:v,CustomOperation:h}=b.useContext(ye),x=[...u,String(r)],[w,A]=b.useState(!0),S=b.useCallback((P,E,k)=>{e[P]=E,d&&d({newValue:E,oldValue:k,depth:n,src:f,indexOrName:P,parentType:"array",parentPath:u}),p&&p({type:"edit",depth:n,src:f,indexOrName:P,parentType:"array",parentPath:u}),g()},[t,d,p,g]),j=P=>{e.splice(P,1),o&&o(P,u),g()},C=c.jsxs(c.Fragment,{children:[!w&&c.jsxs("span",Object.assign({onClick:()=>A(!0),className:"jv-size-chevron"},{children:[Ae(v,n,w)&&c.jsxs("span",Object.assign({className:"jv-size"},{children:[Ie(t)," Items"]})),c.jsx(sn,{className:"jv-chevron"})]})),!w&&l&&ft(s)&&c.jsx(dt,{node:t,nodeMeta:{depth:n,indexOrName:r,parent:i,parentPath:u,currentPath:x}}),typeof h=="function"?c.jsx(h,{node:t}):null]});return c.jsxs("div",{children:[c.jsx("span",{children:"["}),C,w?c.jsxs("button",Object.assign({onClick:()=>A(!1),className:"jv-button"},{children:[a," ... ",a+t.length-1]})):c.jsx("div",Object.assign({className:"jv-indent"},{children:t.map((P,E)=>c.jsx(Dt,{indexOrName:E+a,value:P,depth:n,parent:t,deleteHandle:j,editHandle:S,parentPath:u},String(r)+String(E)))})),c.jsx("span",{children:"]"})]})}function wc({node:e,depth:t,deleteHandle:n,indexOrName:r,customOptions:o,parent:s,parentPath:a}){const i=typeof r<"u"?[...a,String(r)]:a,u=[];for(let D=0;D<e.length;D+=100)u.push(e.slice(D,D+100));const{collapsed:l,enableClipboard:f,collapseObjectsAfterLength:d,editable:p,onDelete:g,src:v,onAdd:h,CustomOperation:x,onChange:w,forceUpdate:A,displaySize:S}=b.useContext(ye),[j,C]=b.useState(In(e,t,r,l,d,o));b.useEffect(()=>{C(In(e,t,r,l,d,o))},[l,d]);const[P,E]=b.useState(!1),k=()=>{E(!1),n&&n(r,a),g&&g({value:e,depth:t,src:v,indexOrName:r,parentType:"array",parentPath:a}),w&&w({type:"delete",depth:t,src:v,indexOrName:r,parentType:"array",parentPath:a})},[M,I]=b.useState(!1),B=()=>{const D=e;D.push(null),h&&h({indexOrName:D.length-1,depth:t,src:v,parentType:"array",parentPath:a}),w&&w({type:"add",indexOrName:D.length-1,depth:t,src:v,parentType:"array",parentPath:a}),A()},H=P||M,$=()=>{E(!1),I(!1)},_=c.jsxs(c.Fragment,{children:[!j&&!H&&c.jsxs("span",Object.assign({onClick:()=>C(!0),className:"jv-size-chevron"},{children:[Ae(S,t,j)&&c.jsxs("span",Object.assign({className:"jv-size"},{children:[e.length," Items"]})),c.jsx(sn,{className:"jv-chevron"})]})),H&&c.jsx(cn,{className:"json-view--edit",style:{display:"inline-block"},onClick:M?B:k}),H&&c.jsx(ln,{className:"json-view--edit",style:{display:"inline-block"},onClick:$}),!j&&!H&&f&&ft(o)&&c.jsx(dt,{node:e,nodeMeta:{depth:t,indexOrName:r,parent:s,parentPath:a,currentPath:i}}),!j&&!H&&mo(p)&&po(o)&&c.jsx(ho,{className:"json-view--edit",onClick:()=>{B()}}),!j&&!H&&rn(p)&&on(o)&&n&&c.jsx(an,{className:"json-view--edit",onClick:()=>E(!0)}),typeof x=="function"?c.jsx(x,{node:e}):null]});return c.jsxs(c.Fragment,{children:[c.jsx("span",{children:"["}),_,j?c.jsx("button",Object.assign({onClick:()=>C(!1),className:"jv-button"},{children:"..."})):c.jsx("div",Object.assign({className:"jv-indent"},{children:u.map((D,F)=>c.jsx(bc,{originNode:e,node:D,depth:t,index:F,startIndex:F*100,deleteHandle:n,customOptions:o,parentPath:a},String(r)+String(F)))})),c.jsx("span",{children:"]"}),j&&Ae(S,t,j)&&c.jsxs("span",Object.assign({onClick:()=>C(!1),className:"jv-size"},{children:[e.length," Items"]}))]})}function jc({node:e,depth:t,indexOrName:n,deleteHandle:r,customOptions:o,parent:s,parentPath:a}){const{collapsed:i,onCollapse:u,enableClipboard:l,ignoreLargeArray:f,collapseObjectsAfterLength:d,editable:p,onDelete:g,src:v,onAdd:h,onEdit:x,onChange:w,forceUpdate:A,displaySize:S,CustomOperation:j}=b.useContext(ye),C=typeof n<"u"?[...a,String(n)]:a;if(!f&&Array.isArray(e)&&e.length>100)return c.jsx(wc,{node:e,depth:t,indexOrName:n,deleteHandle:r,customOptions:o,parentPath:C});const P=ve(e),[E,k]=b.useState(Ln(e,t,n,i,d,o)),M=N=>{u?.({isCollapsing:!N,node:e,depth:t,indexOrName:n}),k(N)};b.useEffect(()=>{M(Ln(e,t,n,i,d,o))},[i,d]);const I=b.useCallback((N,L,Y)=>{Array.isArray(e)?e[+N]=L:e&&(e[N]=L),x&&x({newValue:L,oldValue:Y,depth:t,src:v,indexOrName:N,parentType:P?"object":"array",parentPath:C}),w&&w({type:"edit",depth:t,src:v,indexOrName:N,parentType:P?"object":"array",parentPath:C}),A()},[e,x,w,A]),B=N=>{Array.isArray(e)?e.splice(+N,1):e&&delete e[N],A()},[H,$]=b.useState(!1),_=()=>{$(!1),r&&r(n,C),g&&g({value:e,depth:t,src:v,indexOrName:n,parentType:P?"object":"array",parentPath:C}),w&&w({type:"delete",depth:t,src:v,indexOrName:n,parentType:P?"object":"array",parentPath:C})},[D,F]=b.useState(!1),T=b.useRef(null),R=()=>{var N;if(P){const L=(N=T.current)===null||N===void 0?void 0:N.value;L&&(e[L]=null,T.current&&(T.current.value=""),F(!1),h&&h({indexOrName:L,depth:t,src:v,parentType:"object",parentPath:C}),w&&w({type:"add",indexOrName:L,depth:t,src:v,parentType:"object",parentPath:C}))}else if(Array.isArray(e)){const L=e;L.push(null),h&&h({indexOrName:L.length-1,depth:t,src:v,parentType:"array",parentPath:C}),w&&w({type:"add",indexOrName:L.length-1,depth:t,src:v,parentType:"array",parentPath:C})}A()},z=N=>{N.key==="Enter"?(N.preventDefault(),R()):N.key==="Escape"&&O()},y=H||D,O=()=>{$(!1),F(!1)},W=c.jsxs(c.Fragment,{children:[!E&&!y&&c.jsxs("span",Object.assign({onClick:()=>M(!0),className:"jv-size-chevron"},{children:[Ae(S,t,E)&&c.jsxs("span",Object.assign({className:"jv-size"},{children:[Ie(e)," Items"]})),c.jsx(sn,{className:"jv-chevron"})]})),D&&P&&c.jsx("input",{className:"json-view--input",placeholder:"property",ref:T,onKeyDown:z}),y&&c.jsx(cn,{className:"json-view--edit",style:{display:"inline-block"},onClick:D?R:_}),y&&c.jsx(ln,{className:"json-view--edit",style:{display:"inline-block"},onClick:O}),!E&&!y&&l&&ft(o)&&c.jsx(dt,{node:e,nodeMeta:{depth:t,indexOrName:n,parent:s,parentPath:a,currentPath:C}}),!E&&!y&&mo(p)&&po(o)&&c.jsx(ho,{className:"json-view--edit",onClick:()=>{P?(F(!0),setTimeout(()=>{var N;return(N=T.current)===null||N===void 0?void 0:N.focus()})):R()}}),!E&&!y&&rn(p)&&on(o)&&r&&c.jsx(an,{className:"json-view--edit",onClick:()=>$(!0)}),typeof j=="function"?c.jsx(j,{node:e}):null]});return Array.isArray(e)?c.jsxs(c.Fragment,{children:[c.jsx("span",{children:"["}),W,E?c.jsx("button",Object.assign({onClick:()=>M(!1),className:"jv-button"},{children:"..."})):c.jsx("div",Object.assign({className:"jv-indent"},{children:e.map((N,L)=>c.jsx(Dt,{indexOrName:L,value:N,depth:t,parent:e,deleteHandle:B,editHandle:I,parentPath:C},String(n)+String(L)))})),c.jsx("span",{children:"]"}),E&&Ae(S,t,E)&&c.jsxs("span",Object.assign({onClick:()=>M(!1),className:"jv-size"},{children:[Ie(e)," Items"]}))]}):P?c.jsxs(c.Fragment,{children:[c.jsx("span",{children:"{"}),W,E?c.jsx("button",Object.assign({onClick:()=>M(!1),className:"jv-button"},{children:"..."})):c.jsx("div",Object.assign({className:"jv-indent"},{children:Object.entries(e).map(([N,L])=>c.jsx(Dt,{indexOrName:N,value:L,depth:t,parent:e,deleteHandle:B,editHandle:I,parentPath:C},String(n)+String(N)))})),c.jsx("span",{children:"}"}),E&&Ae(S,t,E)&&c.jsxs("span",Object.assign({onClick:()=>M(!1),className:"jv-size"},{children:[Ie(e)," Items"]}))]}):c.jsx("span",{children:String(e)})}const Cc=b.forwardRef(({str:e,className:t,ctrlClick:n},r)=>{let{collapseStringMode:o,collapseStringsAfterLength:s,customizeCollapseStringUI:a}=b.useContext(ye);const[i,u]=b.useState(!0),l=b.useRef(null);s=s>0?s:0;const f=e.replace(/\s+/g," "),d=typeof a=="function"?a(f,i):typeof a=="string"?a:"...",p=g=>{var v;if((g.ctrlKey||g.metaKey)&&n)n(g);else{const h=window.getSelection();if(h&&h.anchorOffset!==h.focusOffset&&((v=h.anchorNode)===null||v===void 0?void 0:v.parentElement)===l.current)return;u(!i)}};if(e.length<=s)return c.jsxs("span",Object.assign({ref:l,className:t,onClick:n},{children:['"',e,'"']}));if(o==="address")return e.length<=10?c.jsxs("span",Object.assign({ref:l,className:t,onClick:n},{children:['"',e,'"']})):c.jsxs("span",Object.assign({ref:l,onClick:p,className:t+" cursor-pointer"},{children:['"',i?[f.slice(0,6),d,f.slice(-4)]:e,'"']}));if(o==="directly")return c.jsxs("span",Object.assign({ref:l,onClick:p,className:t+" cursor-pointer"},{children:['"',i?[f.slice(0,s),d]:e,'"']}));if(o==="word"){let g=s,v=s+1,h=f,x=1;for(;;){if(/\W/.test(e[g])){h=e.slice(0,g);break}if(/\W/.test(e[v])){h=e.slice(0,v);break}if(x===6){h=e.slice(0,s);break}x++,g--,v++}return c.jsxs("span",Object.assign({ref:l,onClick:p,className:t+" cursor-pointer"},{children:['"',i?[h,d]:e,'"']}))}return c.jsxs("span",Object.assign({ref:l,className:t},{children:['"',e,'"']}))});var Qn;function Wt(){return Wt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wt.apply(this,arguments)}var Ec=function(t){return m.createElement("svg",Wt({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),Qn||(Qn=m.createElement("path",{fill:"currentColor",d:"M17.25 3H6.75A3.754 3.754 0 0 0 3 6.75v10.5A3.754 3.754 0 0 0 6.75 21h10.5A3.754 3.754 0 0 0 21 17.25V6.75A3.754 3.754 0 0 0 17.25 3Zm2.25 14.25c0 1.24-1.01 2.25-2.25 2.25H6.75c-1.24 0-2.25-1.01-2.25-2.25V6.75c0-1.24 1.01-2.25 2.25-2.25h10.5c1.24 0 2.25 1.01 2.25 2.25v10.5Zm-6.09-9.466-5.031 5.03a2.981 2.981 0 0 0-.879 2.121v1.19c0 .415.336.75.75.75h1.19c.8 0 1.554-.312 2.12-.879l5.03-5.03a2.252 2.252 0 0 0 0-3.182c-.85-.85-2.331-.85-3.18 0Zm-2.91 7.151c-.28.28-.666.44-1.06.44H9v-.44c0-.4.156-.777.44-1.06l3.187-3.188 1.06 1.061-3.187 3.188Zm5.03-5.03-.782.783-1.06-1.061.782-.782a.766.766 0 0 1 1.06 0 .75.75 0 0 1 0 1.06Z"})))},er,tr;function Bt(){return Bt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bt.apply(this,arguments)}var Sc=function(t){return m.createElement("svg",Bt({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),er||(er=m.createElement("path",{fill:"currentColor",d:"M6.75 3h5.5v1.5h-5.5C5.51 4.5 4.5 5.51 4.5 6.75v10.5c0 1.24 1.01 2.25 2.25 2.25h10.5c1.24 0 2.25-1.01 2.25-2.25v-5.5H21v5.5A3.754 3.754 0 0 1 17.25 21H6.75A3.754 3.754 0 0 1 3 17.25V6.75A3.754 3.754 0 0 1 6.75 3Z"})),tr||(tr=m.createElement("path",{fill:"currentColor",d:"M20.013 3h-3.946a.987.987 0 0 0 0 1.973h1.564l-6.342 6.342a1.004 1.004 0 0 0 0 1.396 1.004 1.004 0 0 0 1.396 0l6.342-6.342v1.564a.987.987 0 0 0 1.973 0V3.987A.987.987 0 0 0 20.013 3Z"})))};function go({node:e,depth:t,deleteHandle:n,indexOrName:r,parent:o,editHandle:s,parentPath:a}){const{collapseStringsAfterLength:i,enableClipboard:u,editable:l,src:f,onDelete:d,onChange:p,customizeNode:g,matchesURL:v,urlRegExp:h,EditComponent:x,DoneComponent:w,CancelComponent:A,CustomOperation:S}=b.useContext(ye);let j;if(typeof g=="function"&&(j=nn(g,[{node:e,depth:t,indexOrName:r}])),j){if(b.isValidElement(j))return j;if(hc(j)){const C=j;return c.jsx(C,{node:e,depth:t,indexOrName:r})}}if(Array.isArray(e)||ve(e))return c.jsx(jc,{parent:o,node:e,depth:t,indexOrName:r,deleteHandle:n,parentPath:a,customOptions:typeof j=="object"?j:void 0});{const C=typeof e,P=typeof r<"u"?[...a,String(r)]:a,[E,k]=b.useState(!1),[M,I]=b.useState(!1),B=b.useRef(null),H=()=>{k(!0),setTimeout(()=>{var N,L;(N=window.getSelection())===null||N===void 0||N.selectAllChildren(B.current),(L=B.current)===null||L===void 0||L.focus()})},$=b.useCallback(()=>{let N=B.current.innerText;try{const L=JSON.parse(N);s&&s(r,L,e,a)}catch{const Y=vc(C,N);s&&s(r,Y,e,a)}k(!1)},[s,r,e,a,C]),_=()=>{k(!1),I(!1)},D=()=>{I(!1),n&&n(r,a),d&&d({value:e,depth:t,src:f,indexOrName:r,parentType:Array.isArray(o)?"array":"object",parentPath:a}),p&&p({depth:t,src:f,indexOrName:r,parentType:Array.isArray(o)?"array":"object",type:"delete",parentPath:a})},F=b.useCallback(N=>{N.key==="Enter"?(N.preventDefault(),$()):N.key==="Escape"&&_()},[$]),T=E||M,R=!T&&$n(l)&&Wn(j)&&s?N=>{(N.ctrlKey||N.metaKey)&&H()}:void 0,z=c.jsxs(c.Fragment,{children:[T&&(typeof w=="function"?c.jsx(w,{className:"json-view--edit",style:{display:"inline-block"},onClick:M?D:$}):c.jsx(cn,{className:"json-view--edit",style:{display:"inline-block"},onClick:M?D:$})),T&&(typeof A=="function"?c.jsx(A,{className:"json-view--edit",style:{display:"inline-block"},onClick:_}):c.jsx(ln,{className:"json-view--edit",style:{display:"inline-block"},onClick:_})),!T&&u&&ft(j)&&c.jsx(dt,{node:e,nodeMeta:{depth:t,indexOrName:r,parent:o,parentPath:a,currentPath:P}}),!T&&v&&C==="string"&&h.test(e)&&gc(j)&&c.jsx("a",Object.assign({href:e,target:"_blank",className:"json-view--link"},{children:c.jsx(Sc,{})})),!T&&$n(l)&&Wn(j)&&s&&(typeof x=="function"?c.jsx(x,{className:"json-view--edit",onClick:H}):c.jsx(Ec,{className:"json-view--edit",onClick:H})),!T&&rn(l)&&on(j)&&n&&c.jsx(an,{className:"json-view--edit",onClick:()=>I(!0)}),typeof S=="function"?c.jsx(S,{node:e}):null]});let y="json-view--string";switch(C){case"number":case"bigint":y="json-view--number";break;case"boolean":y="json-view--boolean";break;case"object":y="json-view--null";break}typeof j?.className=="string"&&(y+=" "+j.className),M&&(y+=" json-view--deleting");let O=String(e);C==="bigint"&&(O+="n");const W=b.useMemo(()=>c.jsx("span",{contentEditable:!0,className:y,dangerouslySetInnerHTML:{__html:C==="string"?`"${O}"`:O},ref:B,onKeyDown:F}),[O,C,F]);return C==="string"?c.jsxs(c.Fragment,{children:[E?W:e.length>i?c.jsx(Cc,{str:e,ref:B,className:y,ctrlClick:R}):c.jsxs("span",Object.assign({className:y,onClick:R},{children:['"',O,'"']})),z]}):c.jsxs(c.Fragment,{children:[E?W:c.jsx("span",Object.assign({className:y,onClick:R},{children:O})),z]})}}const vo=/^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[a-z]{2,6}\/?/,ye=b.createContext({src:void 0,collapseStringsAfterLength:99,collapseStringMode:"directly",customizeCollapseStringUI:void 0,collapseObjectsAfterLength:20,collapsed:!1,onCollapse:void 0,enableClipboard:!0,editable:!1,onEdit:void 0,onDelete:void 0,onAdd:void 0,onChange:void 0,forceUpdate:()=>{},customizeNode:void 0,customizeCopy:()=>{},displaySize:void 0,displayArrayIndex:!0,matchesURL:!1,urlRegExp:vo,ignoreLargeArray:!1,CopyComponent:void 0,CopiedComponent:void 0,EditComponent:void 0,CancelComponent:void 0,DoneComponent:void 0,CustomOperation:void 0});function nr({src:e,collapseStringsAfterLength:t=99,collapseStringMode:n="directly",customizeCollapseStringUI:r,collapseObjectsAfterLength:o=99,collapsed:s,onCollapse:a,enableClipboard:i=!0,editable:u=!1,onEdit:l,onDelete:f,onAdd:d,onChange:p,dark:g=!1,theme:v="default",customizeNode:h,customizeCopy:x=_=>mc(_),displaySize:w,displayArrayIndex:A=!0,style:S,className:j,matchesURL:C=!1,urlRegExp:P=vo,ignoreLargeArray:E=!1,CopyComponent:k,CopiedComponent:M,EditComponent:I,CancelComponent:B,DoneComponent:H,CustomOperation:$}){const[_,D]=b.useState(0),F=b.useCallback(()=>D(z=>++z),[]),[T,R]=b.useState(e);return b.useEffect(()=>R(e),[e]),c.jsx(ye.Provider,Object.assign({value:{src:T,collapseStringsAfterLength:t,collapseStringMode:n,customizeCollapseStringUI:r,collapseObjectsAfterLength:o,collapsed:s,onCollapse:a,enableClipboard:i,editable:u,onEdit:l,onDelete:f,onAdd:d,onChange:p,forceUpdate:F,customizeNode:h,customizeCopy:x,displaySize:w,displayArrayIndex:A,matchesURL:C,urlRegExp:P,ignoreLargeArray:E,CopyComponent:k,CopiedComponent:M,EditComponent:I,CancelComponent:B,DoneComponent:H,CustomOperation:$}},{children:c.jsx("code",Object.assign({className:"json-view"+(g?" dark":"")+(v&&v!=="default"?" json-view_"+v:"")+(j?" "+j:""),style:S},{children:c.jsx(go,{node:T,depth:1,editHandle:(z,y,O,W)=>{R(y),l&&l({newValue:y,oldValue:O,depth:1,src:T,indexOrName:z,parentType:null,parentPath:W}),p&&p({type:"edit",depth:1,src:T,indexOrName:z,parentType:null,parentPath:W})},deleteHandle:(z,y)=>{R(void 0),f&&f({value:T,depth:1,src:T,indexOrName:z,parentType:null,parentPath:y}),p&&p({depth:1,src:T,indexOrName:z,parentType:null,type:"delete",parentPath:y})},parentPath:[]})}))}))}const Ac=e=>typeof e=="object"&&e!==null?JSON.stringify(e,null,1):e===null?"null":e.toString(),Ht=b.memo(({arg:e,popover:t=!0})=>{const n=b.useMemo(()=>typeof e=="object"&&e!==null,[e]),r=b.useMemo(()=>Ac(e),[e]),o=b.useMemo(()=>JSON.stringify(e,null,2),[e]);return t?c.jsxs(lo,{children:[c.jsx(uo,{asChild:!0,children:c.jsx("span",{className:"truncate font-mono text-blue-500 cursor-pointer inline-block",children:r})}),c.jsx(fo,{className:"backdrop-blur-md w-auto max-w-2xl relative max-h-[50vh] overflow-y-auto",hideWhenDetached:!0,children:n?c.jsxs("div",{children:[c.jsx(At,{textToCopy:o,className:"absolute top-4 right-4",title:"Copy JSON"}),c.jsx(nr,{src:e,theme:"default",enableClipboard:!1,style:{padding:0}})]}):c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{children:r}),c.jsx(At,{textToCopy:o,className:"ml-2",title:"Copy JSON"})]})})]}):c.jsx(c.Fragment,{children:n?c.jsx(nr,{src:e,theme:"default",enableClipboard:!1,style:{padding:0}}):c.jsx("span",{className:"font-mono text-blue-500",children:r})})});Ht.displayName="Argument";const zt=b.memo(({callsQuantity:e,noQuantity:t=!1})=>{const n=e&&e>1;return c.jsxs("div",{className:"flex items-center",children:[c.jsx("span",{className:"font-mono text-emerald-500",children:")"}),!t&&n&&c.jsxs("span",{className:"font-mono text-muted-foreground",children:[" x",e]})]})});zt.displayName="ClosingParenthesis";const Vt=b.forwardRef(({topLevelClassName:e,objectName:t,functionName:n,className:r,...o},s)=>c.jsxs("div",{ref:s,className:G.cn("flex items-center",r),...o,children:[e&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"font-mono text-pink-500",children:e}),c.jsx("span",{children:"."})]}),t&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"font-mono text-pink-500",children:t}),c.jsx("span",{children:"."})]}),c.jsx("span",{className:"font-mono text-pink-500",children:n}),c.jsx("span",{className:"font-mono text-emerald-500",children:"("})]}));Vt.displayName="FunctionCallContent";const Pc={gridTemplateColumns:"max-content 1fr max-content"},mt=b.memo(({topLevelClassName:e,objectName:t,functionName:n,args:r,callsQuantity:o})=>{const s=b.useMemo(()=>r.filter(u=>u!==void 0),[r]),a=b.useMemo(()=>({gridTemplateColumns:`repeat(${s.length*2}, minmax(0, auto))`}),[s.length]),i=b.useMemo(()=>{const u=[e,t].filter(Boolean).join("."),l=u?`${u}.`:"",f=s.map(d=>typeof d=="object"&&d!==null?JSON.stringify(d,null,2):d===null?"null":typeof d=="string"?`'${d}'`:String(d)).join(", ");return`${l}${n}(${f})`},[e,t,n,s]);return c.jsxs("div",{className:"grid overflow-hidden items-center",style:Pc,children:[c.jsxs(lo,{children:[c.jsx(uo,{asChild:!0,children:c.jsx(Vt,{className:"cursor-pointer",functionName:n,topLevelClassName:e,objectName:t})}),c.jsxs(fo,{className:"grid grid-rows-auto backdrop-blur-md w-auto max-w-2xl max-h-[50vh] overflow-y-auto",hideWhenDetached:!0,children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx(Vt,{functionName:n,topLevelClassName:e,objectName:t}),c.jsx(At,{textToCopy:i})]}),s.map((u,l)=>c.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-center pl-4",children:[c.jsx(Ht,{arg:u,popover:!1}),l<s.length-1&&c.jsx("span",{children:", "})]},l)),c.jsx(zt,{callsQuantity:o,noQuantity:!0})]})]}),c.jsx("div",{className:"grid items-center min-w-0",style:a,children:s.map((u,l)=>c.jsxs(b.Fragment,{children:[c.jsx(Ht,{arg:u}),l<s.length-1&&c.jsx("span",{children:", "})]},l))}),c.jsx(zt,{callsQuantity:o})]})});mt.displayName="FunctionCall";const yo=b.memo(({event:e})=>{const t=b.useMemo(()=>[{topic:e.topic,data:e.data}],[e]);return c.jsx(mt,{functionName:"emit",args:t})});yo.displayName="TraceEmitEvent";const xo=b.memo(({event:e})=>c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(G.LevelDot,{level:e.level})," ",e.message]}));xo.displayName="TraceLogEvent";const bo=b.memo(({event:e})=>{const t=b.useMemo(()=>[e.data.traceId,e.data.key,e.data.value],[e]);return c.jsx(mt,{objectName:"state",functionName:e.operation,args:t})});bo.displayName="TraceStateEvent";const wo=b.memo(({event:e})=>{const t=b.useMemo(()=>[e.data.groupId,e.data.id,e.data.data],[e]);return c.jsx(mt,{topLevelClassName:"streams",objectName:e.streamName,functionName:e.operation,args:t,callsQuantity:e.calls})});wo.displayName="TraceStreamEvent";const jo=b.memo(({event:e})=>{if(e.type==="log")return c.jsx(xo,{event:e});if(e.type==="emit")return c.jsx(yo,{event:e});if(e.type==="state")return c.jsx(bo,{event:e});if(e.type==="stream")return c.jsx(wo,{event:e})});jo.displayName="TraceEvent";const Co=b.memo(({event:e,traceStartTime:t})=>c.jsxs(b.Fragment,{children:[c.jsx("div",{className:"grid place-items-center",children:c.jsx("div",{className:"w-1 h-1 rounded-full bg-emerald-500 outline outline-2 outline-emerald-500/50 -ml-[26px]"})}),c.jsx("div",{className:"grid place-items-center",children:c.jsx(fs,{event:e})}),c.jsx("div",{className:"grid place-items-center",children:c.jsxs("span",{className:"text-sm font-mono text-muted-foreground",children:["+",xe(Math.floor(e.timestamp-t))]})}),c.jsx("div",{className:"grid place-items-start",children:c.jsx(jo,{event:e})})]}));Co.displayName="TraceEventItem";const Eo=b.memo(({trace:e,onClose:t})=>{const n=b.useMemo(()=>[{icon:c.jsx(lr,{}),onClick:t,label:"Close"}],[t]);return c.jsxs(G.Sidebar,{onClose:t,initialWidth:600,title:"Trace Details",subtitle:`Viewing details from step ${e.name}`,actions:n,children:[c.jsxs("div",{className:"px-2 overflow-auto",children:[c.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground mb-4",children:[e.endTime&&c.jsxs("span",{children:["Duration: ",xe(e.endTime-e.startTime)]}),c.jsx("div",{className:"bg-blue-500 font-bold text-xs px-[4px] py-[2px] rounded-sm text-blue-100",children:e.entryPoint.type}),e.correlationId&&c.jsxs(G.Badge,{variant:"outline",children:["Correlated: ",e.correlationId]})]}),c.jsx("div",{className:"grid grid-cols-[auto_auto_auto_1fr] gap-x-2 gap-y-3 font-mono text-xs border-l-1 border-gray-500/40 pl-6",children:e.events.map((r,o)=>c.jsx(Co,{event:r,traceStartTime:e.startTime},o))})]}),e.error&&c.jsxs("div",{className:"p-4 bg-red-800/10",children:[c.jsx("div",{className:"text-sm text-red-800 dark:text-red-400 font-semibold",children:e.error.message}),c.jsx("div",{className:"text-sm text-red-800 dark:text-red-400 pl-4",children:e.error.stack})]})]})});Eo.displayName="TraceItemDetail";const So=b.memo(()=>{const e=J(t=>t.selectedTraceGroupId);return e?c.jsx(Ao,{groupId:e}):null});So.displayName="TraceTimeline";const Ao=b.memo(({groupId:e})=>{const t=b.useMemo(()=>({streamName:"motia-trace-group",groupId:"default"}),[]),{data:n}=St.useStreamGroup(t),r=b.useMemo(()=>n.find(v=>v.id===e),[n,e]),o=b.useMemo(()=>({streamName:"motia-trace",groupId:e}),[e]),{data:s}=St.useStreamGroup(o),a=ts(r),[i,u]=b.useState(100),l=J(v=>v.selectedTraceId),f=J(v=>v.selectTraceId),d=b.useMemo(()=>s?.find(v=>v.id===l),[s,l]),p=()=>i>100&&u(v=>v-10),g=()=>i<200&&u(v=>v+10);return r?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"flex flex-col flex-1 relative min-h-full min-w-[1000px]",children:c.jsxs("div",{className:"flex flex-col",style:{width:`${i}%`},children:[c.jsxs("div",{className:"flex flex-1 bg-background",style:{width:`${i}%`},children:[c.jsxs("div",{className:"shrink-0 w-[200px] h-[37px] flex items-center justify-center gap-2 sticky left-0 top-0 z-10 bg-card backdrop-blur-xs backdrop-filter",children:[c.jsx(G.Button,{variant:"icon",size:"sm",className:"px-2",onClick:p,disabled:i<=100,children:c.jsx(Ko,{className:"w-4 h-4 cursor-pointer"})}),c.jsxs("span",{className:"min-w-12 text-center select-none text-sm font-bold text-muted-foreground",children:[i,"%"]}),c.jsx(G.Button,{variant:"icon",size:"sm",className:"px-2",onClick:g,disabled:i>=200,children:c.jsx(es,{className:"w-4 h-4 cursor-pointer"})})]}),c.jsxs("div",{className:"flex justify-between font-mono p-2 w-full text-xs text-muted-foreground bg-card",children:[c.jsx("span",{children:"0ms"}),c.jsx("span",{children:xe(Math.floor((a-r.startTime)*.25))}),c.jsx("span",{children:xe(Math.floor((a-r.startTime)*.5))}),c.jsx("span",{children:xe(Math.floor((a-r.startTime)*.75))}),c.jsx("span",{children:xe(Math.floor(a-r.startTime))})]})]}),c.jsx("div",{className:"flex flex-col h-full",style:{width:`${i}%`},children:s?.map(v=>c.jsx(dr,{traceId:v.id,traceName:v.name,traceStatus:v.status,traceStartTime:v.startTime,traceEndTime:v.endTime,groupStartTime:r.startTime,groupEndTime:a,onExpand:f},v.id))})]})}),d&&c.jsx(Eo,{trace:d,onClose:()=>f(void 0)})]}):null});Ao.displayName="TraceTimelineComponent";const Nc=()=>{const e=b.useMemo(()=>({streamName:"motia-trace-group",groupId:"default"}),[]),{data:t}=St.useStreamGroup(e),n=J(r=>r.search);return b.useMemo(()=>t?.filter(r=>r.name.toLowerCase().includes(n.toLowerCase())||r.id.toLowerCase().includes(n.toLowerCase())),[t,n])};function U(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Oc(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const Je=43200,rr=1440;let Rc={};function Tc(){return Rc}function or(e){const t=U(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function tt(e,t){const n=U(e),r=U(t),o=n.getTime()-r.getTime();return o<0?-1:o>0?1:o}function kc(e){return Oc(e,Date.now())}function Mc(e,t){const n=U(e),r=U(t),o=n.getFullYear()-r.getFullYear(),s=n.getMonth()-r.getMonth();return o*12+s}function _c(e){return t=>{const n=Math.trunc,r=n(t);return r===0?0:r}}function Dc(e,t){return+U(e)-+U(t)}function Fc(e){const t=U(e);return t.setHours(23,59,59,999),t}function Lc(e){const t=U(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function Ic(e){const t=U(e);return+Fc(t)==+Lc(t)}function $c(e,t){const n=U(e),r=U(t),o=tt(n,r),s=Math.abs(Mc(n,r));let a;if(s<1)a=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-o*s);let i=tt(n,r)===-o;Ic(U(e))&&s===1&&tt(e,r)===1&&(i=!1),a=o*(s-Number(i))}return a===0?0:a}function Wc(e,t,n){const r=Dc(e,t)/1e3;return _c()(r)}const Bc={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Hc=(e,t,n)=>{let r;const o=Bc[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Et(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const zc={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Vc={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Uc={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Yc={date:Et({formats:zc,defaultWidth:"full"}),time:Et({formats:Vc,defaultWidth:"full"}),dateTime:Et({formats:Uc,defaultWidth:"full"})},Gc={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Zc=(e,t,n,r)=>Gc[e];function Fe(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,i=n?.width?String(n.width):a;o=e.formattingValues[i]||e.formattingValues[a]}else{const a=e.defaultWidth,i=n?.width?String(n.width):e.defaultWidth;o=e.values[i]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return o[s]}}const Xc={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},qc={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Jc={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Kc={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Qc={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},el={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},tl=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},nl={ordinalNumber:tl,era:Fe({values:Xc,defaultWidth:"wide"}),quarter:Fe({values:qc,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Fe({values:Jc,defaultWidth:"wide"}),day:Fe({values:Kc,defaultWidth:"wide"}),dayPeriod:Fe({values:Qc,defaultWidth:"wide",formattingValues:el,defaultFormattingWidth:"wide"})};function Le(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(o);if(!s)return null;const a=s[0],i=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(i)?ol(i,d=>d.test(a)):rl(i,d=>d.test(a));let l;l=e.valueCallback?e.valueCallback(u):u,l=n.valueCallback?n.valueCallback(l):l;const f=t.slice(a.length);return{value:l,rest:f}}}function rl(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function ol(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function sl(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const i=t.slice(o.length);return{value:a,rest:i}}}const al=/^(\d+)(th|st|nd|rd)?/i,il=/\d+/i,cl={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ll={any:[/^b/i,/^(a|c)/i]},ul={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},fl={any:[/1/i,/2/i,/3/i,/4/i]},dl={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},ml={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},pl={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},hl={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},gl={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},vl={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},yl={ordinalNumber:sl({matchPattern:al,parsePattern:il,valueCallback:e=>parseInt(e,10)}),era:Le({matchPatterns:cl,defaultMatchWidth:"wide",parsePatterns:ll,defaultParseWidth:"any"}),quarter:Le({matchPatterns:ul,defaultMatchWidth:"wide",parsePatterns:fl,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Le({matchPatterns:dl,defaultMatchWidth:"wide",parsePatterns:ml,defaultParseWidth:"any"}),day:Le({matchPatterns:pl,defaultMatchWidth:"wide",parsePatterns:hl,defaultParseWidth:"any"}),dayPeriod:Le({matchPatterns:gl,defaultMatchWidth:"any",parsePatterns:vl,defaultParseWidth:"any"})},xl={code:"en-US",formatDistance:Hc,formatLong:Yc,formatRelative:Zc,localize:nl,match:yl,options:{weekStartsOn:0,firstWeekContainsDate:1}};function bl(e,t,n){const r=Tc(),o=n?.locale??r.locale??xl,s=2520,a=tt(e,t);if(isNaN(a))throw new RangeError("Invalid time value");const i=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a});let u,l;a>0?(u=U(t),l=U(e)):(u=U(e),l=U(t));const f=Wc(l,u),d=(or(l)-or(u))/1e3,p=Math.round((f-d)/60);let g;if(p<2)return p===0?o.formatDistance("lessThanXMinutes",1,i):o.formatDistance("xMinutes",p,i);if(p<45)return o.formatDistance("xMinutes",p,i);if(p<90)return o.formatDistance("aboutXHours",1,i);if(p<rr){const v=Math.round(p/60);return o.formatDistance("aboutXHours",v,i)}else{if(p<s)return o.formatDistance("xDays",1,i);if(p<Je){const v=Math.round(p/rr);return o.formatDistance("xDays",v,i)}else if(p<Je*2)return g=Math.round(p/Je),o.formatDistance("aboutXMonths",g,i)}if(g=$c(l,u),g<12){const v=Math.round(p/Je);return o.formatDistance("xMonths",v,i)}else{const v=g%12,h=Math.trunc(g/12);return v<3?o.formatDistance("aboutXYears",h,i):v<9?o.formatDistance("overXYears",h,i):o.formatDistance("almostXYears",h+1,i)}}function wl(e,t){return bl(e,kc(e),t)}const jl={running:"info",completed:"success",failed:"error",default:"default"},Po=b.memo(({status:e,duration:t})=>c.jsx(G.Badge,{variant:jl[e],children:t&&e!=="failed"?t:e}));Po.displayName="TraceStatusBadge";const No=b.memo(({groupId:e,groupName:t,groupStatus:n,groupStartTime:r,groupEndTime:o,totalSteps:s,activeSteps:a,isSelected:i})=>{const u=J(d=>d.selectTraceGroupId),l=b.useMemo(()=>o?xe(o-r):void 0,[o,r]),f=b.useCallback(()=>{u(e)},[e,u]);return c.jsx("button",{type:"button","data-testid":`trace-${e}`,className:G.cn("motia-trace-group cursor-pointer transition-colors w-full text-left",i?"bg-muted-foreground/10":"hover:bg-muted/70"),onClick:f,children:c.jsxs("div",{className:"p-3 flex flex-col gap-1",children:[c.jsxs("div",{className:"flex flex-row justify-between items-center gap-2",children:[c.jsx("span",{className:"font-semibold text-lg truncate flex-1 min-w-0",children:t}),c.jsx(Po,{status:n,duration:l})]}),c.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[c.jsxs("div",{className:"flex justify-between",children:[c.jsx("div",{"data-testid":"trace-id",className:"text-xs text-muted-foreground font-mono tracking-[1px]",children:e}),c.jsxs("span",{children:[s," steps"]})]}),c.jsxs("div",{className:"flex justify-between",children:[wl(r)," ago"]}),a>0&&c.jsxs("div",{className:"text-blue-600",children:[a," active"]})]})]})},e)});No.displayName="TraceGroupItem";const Oo=b.memo(()=>{const e=Nc(),t=J(a=>a.selectedTraceGroupId),n=J(a=>a.selectTraceGroupId),r=b.useMemo(()=>e?.length||0,[e]),o=b.useMemo(()=>{if(!e||e.length===0)return"";const a=e[e.length-1];return a?.status==="running"?a.id:""},[e]);b.useEffect(()=>{o&&o!==t?n(o):!o&&!r&&t&&n("")},[o,r]);const s=b.useMemo(()=>[...e].reverse(),[e]);return!e||e.length===0?null:c.jsx("div",{className:"overflow-auto",children:s.map(a=>c.jsx(No,{groupId:a.id,groupName:a.name,groupStatus:a.status,groupStartTime:a.startTime,groupEndTime:a.endTime,totalSteps:a.metadata.totalSteps,activeSteps:a.metadata.activeSteps,isSelected:t===a.id},a.id))})});Oo.displayName="TracesGroups";const Ro=b.memo(()=>c.jsxs("div",{className:"grid grid-rows-[auto_1fr] h-full",children:[c.jsx(ur,{}),c.jsxs("div",{className:"grid grid-cols-[300px_1fr] overflow-hidden",children:[c.jsx("div",{className:"w-[300px] border-r border-border overflow-auto h-full","data-testid":"traces-container",children:c.jsx(Oo,{})}),c.jsxs("div",{className:"overflow-auto","data-testid":"trace-details",children:[c.jsx(So,{}),c.jsx(fr,{})]})]})]}));Ro.displayName="ObservabilityPage";/**
|
|
138
|
-
* @license lucide-react v0.545.0 - ISC
|
|
139
|
-
*
|
|
140
|
-
* This source code is licensed under the ISC license.
|
|
141
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
-
*/const Cl=[["path",{d:"M6 5h12",key:"fvfigv"}],["path",{d:"M4 12h10",key:"oujl3d"}],["path",{d:"M12 19h8",key:"baeox8"}]],El=q("chart-no-axes-gantt",Cl),To=b.memo(()=>c.jsxs("div",{"data-testid":"observability-link",children:[c.jsx(El,{"aria-hidden":"true"}),c.jsx("span",{children:"Tracing"})]}));To.displayName="ObservabilityTabLabel";exports.ObservabilityPage=Ro;exports.ObservabilityTabLabel=To;
|