@har-analyzer/components 0.0.15 → 0.0.17

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.
Files changed (59) hide show
  1. package/README.md +59 -28
  2. package/dist/chunks/collapsible-key-value-list.js +24 -0
  3. package/dist/chunks/collapsible-section.js +22 -0
  4. package/dist/chunks/content-viewer.js +3056 -0
  5. package/dist/chunks/context.js +5 -0
  6. package/dist/chunks/headers-viewer.js +32 -0
  7. package/dist/chunks/index.js +2265 -174
  8. package/dist/chunks/index2.js +49 -0
  9. package/dist/chunks/payload-viewer.js +15 -0
  10. package/dist/chunks/provider.js +11 -0
  11. package/dist/chunks/response-viewer.js +10 -0
  12. package/dist/chunks/vertical-gap.js +1 -1
  13. package/dist/components/collapsible-section.d.ts +2 -1
  14. package/dist/components/enhanced-board/constants/i18n.d.ts +11 -6
  15. package/dist/components/enhanced-board/index.d.ts +7 -9
  16. package/dist/components/enhanced-table.d.ts +14 -2
  17. package/dist/components/horizontal-padding.d.ts +2 -0
  18. package/dist/components/inline-copy-to-clipboard.d.ts +6 -0
  19. package/dist/components/lazy-load.d.ts +2 -0
  20. package/dist/context/user-preferences/index.d.ts +6 -0
  21. package/dist/context/user-preferences/provider.d.ts +9 -0
  22. package/dist/context/user-preferences-store/context.d.ts +5 -0
  23. package/dist/context/user-preferences-store/hooks.d.ts +1 -0
  24. package/dist/context/user-preferences-store/provider.d.ts +5 -0
  25. package/dist/features/har-analyzer/components/app-layout.d.ts +7 -0
  26. package/dist/features/har-analyzer/components/preferences/index.d.ts +1 -0
  27. package/dist/features/har-analyzer/components/top-navigation.d.ts +8 -0
  28. package/dist/features/har-analyzer/context/preferences.d.ts +2 -0
  29. package/dist/features/har-analyzer-preferences-store/index.d.ts +2 -0
  30. package/dist/features/har-entries-viewer/index.d.ts +1 -1
  31. package/dist/features/list-har-entries/components/compare-mode-switcher.d.ts +1 -0
  32. package/dist/features/list-har-entries/components/content-type-filter.d.ts +1 -0
  33. package/dist/features/list-har-entries/components/errors-filter.d.ts +1 -0
  34. package/dist/features/list-har-entries/components/har-entries-table.d.ts +8 -0
  35. package/dist/features/list-har-entries/context/preferences.d.ts +5 -0
  36. package/dist/features/list-har-entries/index.d.ts +3 -7
  37. package/dist/har-analyzer-preferences-store.js +4 -0
  38. package/dist/har-analyzer.js +94 -81
  39. package/dist/har-entries-viewer.js +167 -7
  40. package/dist/index.d.ts +7 -2
  41. package/dist/index.js +12 -13
  42. package/dist/list-har-entries.js +3 -2126
  43. package/dist/utils/har.d.ts +1 -1
  44. package/dist/view-har-entry.js +5 -3128
  45. package/package.json +1 -1
  46. package/dist/chunks/json.js +0 -10
  47. package/dist/components/enhanced-top-navigation.d.ts +0 -7
  48. package/dist/components/simple-app-layout.d.ts +0 -6
  49. package/dist/components/simple-app-preferences/index.d.ts +0 -1
  50. package/dist/features/har-analyzer-preferences/index.d.ts +0 -7
  51. package/dist/features/har-entries-viewer/components/har-entries-filters/components/content-type-filter.d.ts +0 -7
  52. package/dist/features/har-entries-viewer/components/har-entries-filters/components/errors-filter.d.ts +0 -6
  53. package/dist/features/har-entries-viewer/components/har-entries-filters/index.d.ts +0 -1
  54. package/dist/features/har-entries-viewer/hooks/preferences.d.ts +0 -2
  55. package/dist/har-analyzer-preferences.js +0 -25
  56. package/dist/hooks/app-preferences.d.ts +0 -2
  57. package/dist/hooks/table-preferences.d.ts +0 -12
  58. /package/dist/{components/simple-app-preferences → features/har-analyzer/components/preferences/components}/content-width-switcher.d.ts +0 -0
  59. /package/dist/{components/simple-app-preferences → features/har-analyzer/components/preferences/components}/theme-switcher.d.ts +0 -0
@@ -0,0 +1,49 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import r from "@cloudscape-design/components/tabs";
3
+ import { Suspense as s, lazy as t, useMemo as a } from "react";
4
+ import l from "@cloudscape-design/components/box";
5
+ import d from "@cloudscape-design/components/spinner";
6
+ function c({ children: n }) {
7
+ return /* @__PURE__ */ e(l, { padding: { horizontal: "m" }, children: n });
8
+ }
9
+ function m({ children: n }) {
10
+ return /* @__PURE__ */ e(s, { fallback: /* @__PURE__ */ e(d, { size: "large" }), children: n });
11
+ }
12
+ const p = t(() => import("./headers-viewer.js")), f = t(() => import("./payload-viewer.js")), u = t(() => import("./response-viewer.js")), b = t(() => import("./content-viewer.js"));
13
+ function o({ children: n }) {
14
+ return /* @__PURE__ */ e(m, { children: /* @__PURE__ */ e(c, { children: n }) });
15
+ }
16
+ function z({ harEntry: n }) {
17
+ const i = a(() => JSON.stringify(n), [n]);
18
+ return /* @__PURE__ */ e(
19
+ r,
20
+ {
21
+ tabs: [
22
+ {
23
+ label: "Headers",
24
+ id: "headers",
25
+ content: /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(p, { harEntry: n }) })
26
+ },
27
+ {
28
+ label: "Payload",
29
+ id: "payload",
30
+ content: /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(f, { harEntry: n }) })
31
+ },
32
+ {
33
+ label: "Response",
34
+ id: "response",
35
+ content: /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(u, { harEntry: n }) })
36
+ },
37
+ {
38
+ label: "HAR Entry",
39
+ id: "har-entry",
40
+ content: /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(b, { content: i, mimeType: "json" }) })
41
+ }
42
+ ]
43
+ }
44
+ );
45
+ }
46
+ export {
47
+ c as H,
48
+ z as V
49
+ };
@@ -0,0 +1,15 @@
1
+ import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
+ import { C as s } from "./collapsible-key-value-list.js";
3
+ import { C as a } from "./collapsible-section.js";
4
+ import { V as m } from "./vertical-gap.js";
5
+ import l from "./content-viewer.js";
6
+ function d({ harEntry: e }) {
7
+ const o = e.request.postData?.text ?? "", r = e.request.postData?.mimeType;
8
+ return /* @__PURE__ */ i(m, { children: [
9
+ /* @__PURE__ */ t(s, { title: "Query Parameters", items: e.request.queryString }),
10
+ /* @__PURE__ */ t(a, { title: "Request Payload", children: /* @__PURE__ */ t(l, { content: o, mimeType: r }) })
11
+ ] });
12
+ }
13
+ export {
14
+ d as default
15
+ };
@@ -0,0 +1,11 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { U as t } from "./context.js";
3
+ function f({
4
+ userPreferencesStore: e,
5
+ children: r
6
+ }) {
7
+ return /* @__PURE__ */ o(t, { value: e, children: r });
8
+ }
9
+ export {
10
+ f as U
11
+ };
@@ -0,0 +1,10 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { C as i } from "./collapsible-section.js";
3
+ import c from "./content-viewer.js";
4
+ function l({ harEntry: e }) {
5
+ const o = e.response.content.text ?? "", t = e.response.content.encoding, s = e.response.content.mimeType;
6
+ return /* @__PURE__ */ n(i, { title: "Response", children: /* @__PURE__ */ n(c, { content: o, encoding: t, mimeType: s }) });
7
+ }
8
+ export {
9
+ l as default
10
+ };
@@ -1,7 +1,7 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import o from "@cloudscape-design/components/space-between";
3
3
  function a({ children: e, ...r }) {
4
- return /* @__PURE__ */ t(o, { size: "xxl", ...r, children: e });
4
+ return /* @__PURE__ */ t(o, { size: "l", ...r, children: e });
5
5
  }
6
6
  export {
7
7
  a as V
@@ -1,5 +1,6 @@
1
1
  type CollapsibleSectionProps = React.PropsWithChildren<{
2
2
  title: string;
3
+ variant?: 'default' | 'container' | 'inline';
3
4
  }>;
4
- export default function CollapsibleSection({ title, children }: CollapsibleSectionProps): import("react/jsx-runtime").JSX.Element;
5
+ export default function CollapsibleSection({ title, children, variant, }: CollapsibleSectionProps): import("react/jsx-runtime").JSX.Element;
5
6
  export {};
@@ -1,5 +1,9 @@
1
1
  import { BoardProps } from '@cloudscape-design/board-components';
2
- export type EnhancedBoardDefinition = Omit<BoardProps.Item, 'data'>;
2
+ interface EnhancedBoardItemData {
3
+ componentKey: string;
4
+ instanceId: string;
5
+ }
6
+ export type EnhancedBoardDefinition = BoardProps.Item<EnhancedBoardItemData>;
3
7
  export type EnhancedBoardDefinitions = ReadonlyArray<EnhancedBoardDefinition>;
4
8
  export declare const boardItemI18nStrings: {
5
9
  dragHandleAriaLabel: string;
@@ -9,13 +13,14 @@ export declare const boardItemI18nStrings: {
9
13
  };
10
14
  export declare const boardI18nStrings: {
11
15
  liveAnnouncementDndStarted: (operationType: BoardProps.DndOperationType) => "Resizing" | "Dragging";
12
- liveAnnouncementDndItemReordered: (operation: BoardProps.DndReorderState<undefined>) => string;
13
- liveAnnouncementDndItemResized: (operation: BoardProps.DndResizeState<undefined>) => string;
14
- liveAnnouncementDndItemInserted: (operation: BoardProps.DndInsertState<undefined>) => string;
16
+ liveAnnouncementDndItemReordered: (operation: BoardProps.DndReorderState<EnhancedBoardItemData>) => string;
17
+ liveAnnouncementDndItemResized: (operation: BoardProps.DndResizeState<EnhancedBoardItemData>) => string;
18
+ liveAnnouncementDndItemInserted: (operation: BoardProps.DndInsertState<EnhancedBoardItemData>) => string;
15
19
  liveAnnouncementDndCommitted: (operationType: BoardProps.DndOperationType) => string;
16
20
  liveAnnouncementDndDiscarded: (operationType: BoardProps.DndOperationType) => string;
17
- liveAnnouncementItemRemoved: (op: BoardProps.ItemRemovedState<undefined>) => string;
21
+ liveAnnouncementItemRemoved: (op: BoardProps.ItemRemovedState<EnhancedBoardItemData>) => string;
18
22
  navigationAriaLabel: string;
19
23
  navigationAriaDescription: string;
20
- navigationItemAriaLabel: (item: BoardProps.Item<undefined> | null) => string;
24
+ navigationItemAriaLabel: (item: BoardProps.Item<EnhancedBoardItemData> | null) => string;
21
25
  };
26
+ export {};
@@ -1,15 +1,13 @@
1
- import { HeaderProps } from '@cloudscape-design/components/header';
2
- import { EnhancedBoardDefinitions } from './constants/i18n';
1
+ import { EnhancedBoardDefinition, EnhancedBoardDefinitions } from './constants/i18n';
2
+ interface ComponentDefinition {
3
+ content: React.ReactNode;
4
+ onRemove?: () => void;
5
+ }
3
6
  export interface EnhancedBoardProps {
4
- components: Record<string, {
5
- title: string;
6
- content: React.ReactNode;
7
- counter?: string;
8
- actions?: HeaderProps['actions'];
9
- canRemove?: boolean;
10
- }>;
7
+ components: Record<string, ComponentDefinition | ((instanceId: EnhancedBoardDefinition['data']['instanceId']) => ComponentDefinition)>;
11
8
  definitions: EnhancedBoardDefinitions;
12
9
  onDefinitionsChange: (definitions: EnhancedBoardDefinitions) => void;
13
10
  empty?: React.ReactNode;
14
11
  }
15
12
  export default function EnhancedBoard(props: EnhancedBoardProps): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -1,3 +1,4 @@
1
+ import { CollectionPreferencesProps } from '@cloudscape-design/components/collection-preferences';
1
2
  interface BaseColumnDefinition {
2
3
  header: string;
3
4
  width?: number;
@@ -34,14 +35,25 @@ interface ListColumnDefinition<TItem> {
34
35
  }
35
36
  type EnhancedColumnDefinition<TItem> = BaseColumnDefinition & (DefaultColumnDefinition<TItem> | NumericColumnDefinition<TItem> | DateColumnDefinition<TItem> | ListColumnDefinition<TItem>);
36
37
  export type EnhancedTableColumnsDefinition<TItem> = Record<string, EnhancedColumnDefinition<TItem>>;
38
+ export interface EnhancedTablePreferences {
39
+ collectionPreferences: CollectionPreferencesProps.Preferences | undefined;
40
+ preferredColumnWidths: {
41
+ id: string;
42
+ width?: number;
43
+ }[];
44
+ }
37
45
  interface EnhancedTableProps<TItem> {
38
- id: string;
39
46
  items: TItem[];
40
47
  getRowId: (item: TItem) => string;
41
48
  columnsDefinition: EnhancedTableColumnsDefinition<TItem>;
49
+ useTablePreferences: () => [EnhancedTablePreferences, (preferences: EnhancedTablePreferences) => void];
42
50
  empty?: React.ReactNode;
43
51
  selectionType?: 'single' | 'multi';
52
+ isEntireRowSelectable?: boolean;
53
+ selectedItems?: TItem[];
44
54
  onSelectionChange?: (selectedItems: TItem[]) => void;
55
+ contentDensity?: 'compact' | 'comfortable';
56
+ header?: React.ReactNode;
45
57
  }
46
- export default function EnhancedTable<TItem>({ id, items: originalItems, getRowId, columnsDefinition: enhancedColumnDefinitions, empty, selectionType, onSelectionChange, }: EnhancedTableProps<TItem>): import("react/jsx-runtime").JSX.Element;
58
+ export default function EnhancedTable<TItem>({ items: originalItems, getRowId, columnsDefinition: enhancedColumnDefinitions, useTablePreferences, empty, selectionType, isEntireRowSelectable, selectedItems, onSelectionChange, contentDensity, header, }: EnhancedTableProps<TItem>): import("react/jsx-runtime").JSX.Element;
47
59
  export {};
@@ -0,0 +1,2 @@
1
+ import { PropsWithChildren } from 'react';
2
+ export declare function HorizontalPadding({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ interface InlineCopyToClipboardProps {
2
+ textToCopy: string;
3
+ textToDisplay?: string;
4
+ }
5
+ export default function InlineCopyToClipboard(props: InlineCopyToClipboardProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,2 @@
1
+ import { PropsWithChildren } from 'react';
2
+ export default function LazyLoad({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { UserPreferencesContextValue } from './provider';
3
+ export declare function createUserPreferencesContext<T>(preferenceKey: string, defaultPreferenceValue: T): {
4
+ useUserPreferences: () => UserPreferencesContextValue<T>;
5
+ Provider: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
6
+ };
@@ -0,0 +1,9 @@
1
+ import { Context, PropsWithChildren } from 'react';
2
+ export type UserPreferencesContextValue<T> = [T, (preference: T) => void];
3
+ interface UserPreferencesProviderProps<T> {
4
+ context: Context<UserPreferencesContextValue<T>>;
5
+ preferenceKey: string;
6
+ defaultPreferenceValue: T;
7
+ }
8
+ export declare function UserPreferencesProvider<T>(props: PropsWithChildren<UserPreferencesProviderProps<T>>): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,5 @@
1
+ export interface UserPreferencesStore {
2
+ getPreference: (key: string) => Promise<string | undefined>;
3
+ setPreference: (key: string, value: string) => Promise<void>;
4
+ }
5
+ export declare const UserPreferencesStoreContext: import('react').Context<UserPreferencesStore | undefined>;
@@ -0,0 +1 @@
1
+ export declare function useUserPreferencesStore(): import('./context').UserPreferencesStore | undefined;
@@ -0,0 +1,5 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { UserPreferencesStore } from './context';
3
+ export declare function UserPreferencesStoreProvider({ userPreferencesStore, children, }: PropsWithChildren<{
4
+ userPreferencesStore: UserPreferencesStore;
5
+ }>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ interface AppLayoutProps {
2
+ logo?: React.ReactNode;
3
+ appName: string;
4
+ content: React.ReactNode;
5
+ }
6
+ export default function AppLayout({ logo, appName, content, }: AppLayoutProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1 @@
1
+ export default function AppPreferences(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ export declare const TOP_NAVIGATION_ID = "top-navigation";
2
+ interface TopNavigationProps {
3
+ logo?: React.ReactNode;
4
+ appName: string;
5
+ utilities?: React.ReactNode;
6
+ }
7
+ export default function TopNavigation({ logo, appName, utilities, }: TopNavigationProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const useAppContentWidthPreference: () => import('../../../context/user-preferences/provider').UserPreferencesContextValue<boolean>, AppContentWidthProvider: ({ children }: import('react').PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const useThemePreference: () => import('../../../context/user-preferences/provider').UserPreferencesContextValue<boolean>, ThemeProvider: ({ children }: import('react').PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export type { UserPreferencesStore } from '../../context/user-preferences-store/context';
2
+ export { UserPreferencesStoreProvider as default } from '../../context/user-preferences-store/provider';
@@ -1,7 +1,7 @@
1
1
  import { HAREntry } from '../../utils/har';
2
2
  interface HAREntriesViewerProps {
3
- title?: string;
4
3
  harEntries: HAREntry[];
4
+ tableTitle?: string;
5
5
  }
6
6
  export default function HAREntriesViewer(props: HAREntriesViewerProps): import("react/jsx-runtime").JSX.Element;
7
7
  export {};
@@ -0,0 +1 @@
1
+ export default function CompareModeSwitcher(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export default function ContentTypeFilter(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export default function ErrorsFilter(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { HAREntry } from '../../../utils/har';
2
+ export interface HAREntriesTableProps {
3
+ title?: string;
4
+ harEntries: HAREntry[];
5
+ selectedHAREntries: HAREntry[];
6
+ onSelectionChange: (selectedHAREntries: HAREntry[]) => void;
7
+ }
8
+ export default function HAREntriesTable({ title, harEntries, selectedHAREntries, onSelectionChange, }: HAREntriesTableProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { EnhancedTablePreferences } from '../../../components/enhanced-table';
2
+ export declare const useTablePreferences: () => import('../../../context/user-preferences/provider').UserPreferencesContextValue<EnhancedTablePreferences>, TablePreferencesProvider: ({ children }: import('react').PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const useCompareModePreference: () => import('../../../context/user-preferences/provider').UserPreferencesContextValue<boolean>, CompareModeProvider: ({ children }: import('react').PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const useErrorsFilterPreference: () => import('../../../context/user-preferences/provider').UserPreferencesContextValue<boolean>, ErrorsFilterProvider: ({ children }: import('react').PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
5
+ export declare const useContentTypeFiltersPreference: () => import('../../../context/user-preferences/provider').UserPreferencesContextValue<("JSON" | "XML" | "JS" | "CSS" | "HTML" | "Doc" | "Img" | "Font" | "Media" | "Other")[]>, ContentTypeFiltersProvider: ({ children }: import('react').PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,4 @@
1
- import { HAREntry } from '../../utils/har';
2
- interface ListHAREntriesProps {
3
- id?: string;
4
- harEntries: HAREntry[];
5
- onChange: (selectedHAREntries: HAREntry[]) => void;
1
+ import { HAREntriesTableProps } from './components/har-entries-table';
2
+ export interface ListHAREntriesProps extends HAREntriesTableProps {
6
3
  }
7
- export default function ListHAREntries({ id, harEntries, onChange, }: ListHAREntriesProps): import("react/jsx-runtime").JSX.Element;
8
- export {};
4
+ export default function ListHAREntries(props: ListHAREntriesProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { U as f } from "./chunks/provider.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1,27 +1,69 @@
1
- import { jsx as e, jsxs as i, Fragment as h } from "react/jsx-runtime";
2
- import { useEffect as F, useState as a } from "react";
3
- import N from "@cloudscape-design/components/app-layout";
4
- import { useHARAnalyzerPreferences as p } from "./har-analyzer-preferences.js";
5
- import R from "@cloudscape-design/components/header";
6
- import { borderWidthAlert as b, colorBorderDividerDefault as y } from "@cloudscape-design/design-tokens";
7
- import { b as D, H as T } from "./chunks/index.js";
8
- import s from "@cloudscape-design/components/box";
1
+ import { jsx as e, jsxs as n, Fragment as h } from "react/jsx-runtime";
2
+ import { useEffect as P, useState as s } from "react";
3
+ import { V as m } from "./chunks/vertical-gap.js";
4
+ import E from "./har-entries-viewer.js";
5
+ import F from "./har-file-uploader.js";
6
+ import R from "@cloudscape-design/components/app-layout";
7
+ import { c as p, H as T } from "./chunks/index.js";
8
+ import a from "@cloudscape-design/components/box";
9
9
  import c from "@cloudscape-design/components/button";
10
- import v from "@cloudscape-design/components/modal";
11
- import { V as u } from "./chunks/vertical-gap.js";
10
+ import U from "@cloudscape-design/components/modal";
12
11
  import f from "@cloudscape-design/components/toggle";
13
- import { Mode as l, applyMode as W } from "@cloudscape-design/global-styles";
14
- import M from "./har-file-uploader.js";
15
- function A() {
16
- return p("isFullContentWidth", !0);
17
- }
12
+ import { Mode as l, applyMode as b } from "@cloudscape-design/global-styles";
13
+ import y from "@cloudscape-design/components/header";
14
+ import { borderWidthAlert as N, colorBorderDividerDefault as W } from "@cloudscape-design/design-tokens";
15
+ const u = "har-analyzer", {
16
+ useUserPreferences: A,
17
+ Provider: x
18
+ } = p(`${u}.isFullContentWidth`, !1), {
19
+ useUserPreferences: D,
20
+ Provider: M
21
+ } = p(`${u}.isDarkTheme`, !1);
18
22
  function S() {
19
- return p("isDarkTheme", !1);
23
+ const [r, o] = A();
24
+ return /* @__PURE__ */ e(f, { onChange: ({ detail: t }) => {
25
+ o(t.checked);
26
+ }, checked: r, children: "Use entire screen width" });
27
+ }
28
+ function V() {
29
+ const [r, o] = D();
30
+ return P(() => {
31
+ const t = r ? l.Dark : l.Light;
32
+ b(t);
33
+ }, [r]), /* @__PURE__ */ e(f, { onChange: ({ detail: t }) => {
34
+ o(t.checked);
35
+ }, checked: r, children: "Use dark theme" });
36
+ }
37
+ function z() {
38
+ const [r, o] = s(!1), t = () => {
39
+ o(!0);
40
+ }, i = () => {
41
+ o(!1);
42
+ };
43
+ return /* @__PURE__ */ n(h, { children: [
44
+ /* @__PURE__ */ e(c, { iconName: "settings", variant: "icon", onClick: t }),
45
+ /* @__PURE__ */ n(
46
+ U,
47
+ {
48
+ visible: r,
49
+ onDismiss: i,
50
+ header: "Manage your preferences",
51
+ footer: /* @__PURE__ */ e(a, { float: "right", children: /* @__PURE__ */ e(c, { variant: "primary", onClick: i, children: "Ok" }) }),
52
+ children: [
53
+ /* @__PURE__ */ e(a, { margin: { top: "m" } }),
54
+ /* @__PURE__ */ n(m, { size: "m", children: [
55
+ /* @__PURE__ */ e(V, {}),
56
+ /* @__PURE__ */ e(S, {})
57
+ ] })
58
+ ]
59
+ }
60
+ )
61
+ ] });
20
62
  }
21
63
  const k = "top-navigation", d = "blur(16px)";
22
- function U({
64
+ function B({
23
65
  logo: r,
24
- appName: n,
66
+ appName: o,
25
67
  utilities: t
26
68
  }) {
27
69
  return /* @__PURE__ */ e(
@@ -33,96 +75,67 @@ function U({
33
75
  top: 0,
34
76
  zIndex: 1002,
35
77
  padding: "0.5rem 1rem",
36
- borderBlockEnd: `${b} solid ${y}`,
78
+ borderBlockEnd: `${N} solid ${W}`,
37
79
  backdropFilter: d,
38
80
  WebkitBackdropFilter: d
39
81
  // for Safari
40
82
  },
41
- children: /* @__PURE__ */ e(R, { actions: t, children: /* @__PURE__ */ i(D, { children: [
83
+ children: /* @__PURE__ */ e(y, { actions: t, children: /* @__PURE__ */ n(T, { children: [
42
84
  r,
43
- n
85
+ o
44
86
  ] }) })
45
87
  }
46
88
  );
47
89
  }
48
- function _() {
49
- const [r, n] = A();
50
- return /* @__PURE__ */ e(f, { onChange: ({ detail: t }) => {
51
- n(t.checked);
52
- }, checked: r, children: "Use entire screen width" });
53
- }
54
- function x() {
55
- const [r, n] = S();
56
- return F(() => {
57
- const t = r ? l.Dark : l.Light;
58
- W(t);
59
- }, [r]), /* @__PURE__ */ e(f, { onChange: ({ detail: t }) => {
60
- n(t.checked);
61
- }, checked: r, children: "Use dark theme" });
62
- }
63
- function I() {
64
- const [r, n] = a(!1), t = () => {
65
- n(!0);
66
- }, o = () => {
67
- n(!1);
68
- };
69
- return /* @__PURE__ */ i(h, { children: [
70
- /* @__PURE__ */ e(c, { iconName: "settings", variant: "icon", onClick: t }),
71
- /* @__PURE__ */ i(
72
- v,
73
- {
74
- visible: r,
75
- onDismiss: o,
76
- header: "Manage your preferences",
77
- footer: /* @__PURE__ */ e(s, { float: "right", children: /* @__PURE__ */ e(c, { variant: "primary", onClick: o, children: "Ok" }) }),
78
- children: [
79
- /* @__PURE__ */ e(s, { margin: { top: "m" } }),
80
- /* @__PURE__ */ i(u, { size: "m", children: [
81
- /* @__PURE__ */ e(x, {}),
82
- /* @__PURE__ */ e(_, {})
83
- ] })
84
- ]
85
- }
86
- )
87
- ] });
88
- }
89
- function L({
90
+ function I({
90
91
  logo: r,
91
- appName: n,
92
+ appName: o,
92
93
  content: t
93
94
  }) {
94
- const [o] = A();
95
- return /* @__PURE__ */ i(h, { children: [
96
- /* @__PURE__ */ e(U, { logo: r, appName: n, utilities: /* @__PURE__ */ e(I, {}) }),
95
+ const [i] = A();
96
+ return /* @__PURE__ */ n(h, { children: [
97
97
  /* @__PURE__ */ e(
98
- N,
98
+ B,
99
+ {
100
+ logo: r,
101
+ appName: o,
102
+ utilities: /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(z, {}) })
103
+ }
104
+ ),
105
+ /* @__PURE__ */ e(
106
+ R,
99
107
  {
100
108
  headerSelector: `#${k}`,
101
109
  navigationHide: !0,
102
110
  toolsHide: !0,
103
- maxContentWidth: o ? Number.MAX_VALUE : void 0,
111
+ maxContentWidth: i ? Number.MAX_VALUE : void 0,
104
112
  content: t
105
113
  }
106
114
  )
107
115
  ] });
108
116
  }
109
- const m = "unknown.har";
110
- function Z({ logo: r, appName: n = "HAR Analyzer" }) {
111
- const [t, o] = a(m), [H, g] = a([]);
112
- return /* @__PURE__ */ e(
113
- L,
117
+ function re({ logo: r, appName: o = "HAR Analyzer" }) {
118
+ const [t, i] = s(), [C, g] = s([]);
119
+ return /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(
120
+ I,
114
121
  {
115
122
  logo: r,
116
- appName: n,
117
- content: /* @__PURE__ */ i(u, { children: [
118
- /* @__PURE__ */ e(M, { onChange: ({ harEntries: C, harFileName: E }) => {
119
- g(C), o(E ?? m);
123
+ appName: o,
124
+ content: /* @__PURE__ */ n(m, { children: [
125
+ /* @__PURE__ */ e(F, { onChange: ({ harEntries: v, harFileName: H }) => {
126
+ g(v), i(H);
120
127
  } }),
121
- /* @__PURE__ */ e(T, { title: t, harEntries: H })
128
+ /* @__PURE__ */ e(
129
+ E,
130
+ {
131
+ tableTitle: t,
132
+ harEntries: C
133
+ }
134
+ )
122
135
  ] })
123
136
  }
124
- );
137
+ ) });
125
138
  }
126
139
  export {
127
- Z as default
140
+ re as default
128
141
  };