msw-dev-tool 1.1.3 → 1.1.5

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 (80) hide show
  1. package/dist/cjs/index.js +28242 -4
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/msw-dev-tool.css +1 -1
  4. package/dist/esm/index.js +28226 -2
  5. package/dist/esm/index.js.map +1 -1
  6. package/dist/esm/msw-dev-tool.css +1 -1
  7. package/dist/types/index.d.ts +1 -1
  8. package/package.json +7 -4
  9. package/dist/cjs/_virtual/_commonjsHelpers.js +0 -6
  10. package/dist/cjs/_virtual/_commonjsHelpers.js.map +0 -1
  11. package/dist/cjs/_virtual/lodash.js +0 -6
  12. package/dist/cjs/_virtual/lodash.js.map +0 -1
  13. package/dist/cjs/const/handler.js +0 -10
  14. package/dist/cjs/const/handler.js.map +0 -1
  15. package/dist/cjs/hook/useFlattenHandlersTable.js +0 -71
  16. package/dist/cjs/hook/useFlattenHandlersTable.js.map +0 -1
  17. package/dist/cjs/lib/handlerStore.js +0 -66
  18. package/dist/cjs/lib/handlerStore.js.map +0 -1
  19. package/dist/cjs/lib/util.js +0 -64
  20. package/dist/cjs/lib/util.js.map +0 -1
  21. package/dist/cjs/node_modules/@tanstack/react-table/build/lib/index.js +0 -137
  22. package/dist/cjs/node_modules/@tanstack/react-table/build/lib/index.js.map +0 -1
  23. package/dist/cjs/node_modules/@tanstack/table-core/build/lib/index.js +0 -3012
  24. package/dist/cjs/node_modules/@tanstack/table-core/build/lib/index.js.map +0 -1
  25. package/dist/cjs/node_modules/lodash/lodash.js +0 -17209
  26. package/dist/cjs/node_modules/lodash/lodash.js.map +0 -1
  27. package/dist/cjs/store/uiControlStore.js +0 -13
  28. package/dist/cjs/store/uiControlStore.js.map +0 -1
  29. package/dist/cjs/ui/DevToolContent/DevToolContentContainer.js +0 -18
  30. package/dist/cjs/ui/DevToolContent/DevToolContentContainer.js.map +0 -1
  31. package/dist/cjs/ui/DevToolContent/HttpControl.js +0 -21
  32. package/dist/cjs/ui/DevToolContent/HttpControl.js.map +0 -1
  33. package/dist/cjs/ui/MSWDevTool.js +0 -16
  34. package/dist/cjs/ui/MSWDevTool.js.map +0 -1
  35. package/dist/cjs/ui/Table/PreviewHandler/KeyValueInputList.js +0 -73
  36. package/dist/cjs/ui/Table/PreviewHandler/KeyValueInputList.js.map +0 -1
  37. package/dist/cjs/ui/Table/PreviewHandler/PathParamSetter.js +0 -22
  38. package/dist/cjs/ui/Table/PreviewHandler/PathParamSetter.js.map +0 -1
  39. package/dist/cjs/ui/Table/PreviewHandler/RequestPreview.js +0 -68
  40. package/dist/cjs/ui/Table/PreviewHandler/RequestPreview.js.map +0 -1
  41. package/dist/cjs/ui/Table/PreviewHandler/index.js +0 -61
  42. package/dist/cjs/ui/Table/PreviewHandler/index.js.map +0 -1
  43. package/dist/cjs/utils/url.js +0 -43
  44. package/dist/cjs/utils/url.js.map +0 -1
  45. package/dist/esm/_virtual/_commonjsHelpers.js +0 -4
  46. package/dist/esm/_virtual/_commonjsHelpers.js.map +0 -1
  47. package/dist/esm/_virtual/lodash.js +0 -4
  48. package/dist/esm/_virtual/lodash.js.map +0 -1
  49. package/dist/esm/const/handler.js +0 -7
  50. package/dist/esm/const/handler.js.map +0 -1
  51. package/dist/esm/hook/useFlattenHandlersTable.js +0 -69
  52. package/dist/esm/hook/useFlattenHandlersTable.js.map +0 -1
  53. package/dist/esm/lib/handlerStore.js +0 -63
  54. package/dist/esm/lib/handlerStore.js.map +0 -1
  55. package/dist/esm/lib/util.js +0 -58
  56. package/dist/esm/lib/util.js.map +0 -1
  57. package/dist/esm/node_modules/@tanstack/react-table/build/lib/index.js +0 -75
  58. package/dist/esm/node_modules/@tanstack/react-table/build/lib/index.js.map +0 -1
  59. package/dist/esm/node_modules/@tanstack/table-core/build/lib/index.js +0 -2970
  60. package/dist/esm/node_modules/@tanstack/table-core/build/lib/index.js.map +0 -1
  61. package/dist/esm/node_modules/lodash/lodash.js +0 -17207
  62. package/dist/esm/node_modules/lodash/lodash.js.map +0 -1
  63. package/dist/esm/store/uiControlStore.js +0 -11
  64. package/dist/esm/store/uiControlStore.js.map +0 -1
  65. package/dist/esm/ui/DevToolContent/DevToolContentContainer.js +0 -16
  66. package/dist/esm/ui/DevToolContent/DevToolContentContainer.js.map +0 -1
  67. package/dist/esm/ui/DevToolContent/HttpControl.js +0 -19
  68. package/dist/esm/ui/DevToolContent/HttpControl.js.map +0 -1
  69. package/dist/esm/ui/MSWDevTool.js +0 -14
  70. package/dist/esm/ui/MSWDevTool.js.map +0 -1
  71. package/dist/esm/ui/Table/PreviewHandler/KeyValueInputList.js +0 -71
  72. package/dist/esm/ui/Table/PreviewHandler/KeyValueInputList.js.map +0 -1
  73. package/dist/esm/ui/Table/PreviewHandler/PathParamSetter.js +0 -20
  74. package/dist/esm/ui/Table/PreviewHandler/PathParamSetter.js.map +0 -1
  75. package/dist/esm/ui/Table/PreviewHandler/RequestPreview.js +0 -66
  76. package/dist/esm/ui/Table/PreviewHandler/RequestPreview.js.map +0 -1
  77. package/dist/esm/ui/Table/PreviewHandler/index.js +0 -59
  78. package/dist/esm/ui/Table/PreviewHandler/index.js.map +0 -1
  79. package/dist/esm/utils/url.js +0 -39
  80. package/dist/esm/utils/url.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"handlerStore.js","sources":["../../../src/lib/handlerStore.ts"],"sourcesContent":["import { SetupWorker } from \"msw/browser\";\nimport { create } from \"zustand\";\nimport { FlattenHandler, Handler } from \"./type\";\nimport {\n convertHandlers,\n getTotalEnableHandlers,\n initMSWDevToolStore,\n updateEnableHandlers,\n} from \"./util\";\nimport { OnChangeFn, RowSelectionState, Updater } from \"@tanstack/react-table\";\nimport { isFunction } from \"lodash\";\n\nexport interface HandlerStoreState {\n /**\n * @remarks ⚠️ To be safe, access `getWorker()` rather than `get().worker` directly.\n */\n worker: SetupWorker | null;\n /**\n * GraphQL or WebSocketHandler\n *\n * **Currently not supported**\n */\n restHandlers: Handler[];\n flattenHandlers: FlattenHandler[];\n handlerRowSelection: RowSelectionState;\n initMSWDevTool: (worker: SetupWorker) => SetupWorker;\n resetMSWDevTool: () => void;\n handleHandlerRowSelectionChange: OnChangeFn<RowSelectionState>;\n getWorker: () => SetupWorker;\n}\nexport const useHandlerStore = create<HandlerStoreState>((set, get) => ({\n flattenHandlers: [],\n worker: null,\n restHandlers: [],\n handlerRowSelection: {},\n initMSWDevTool: (_worker) => {\n const {\n worker,\n flattenHandlers,\n handlerRowSelection,\n unsupportedHandlers,\n } = initMSWDevToolStore(_worker);\n\n set({ worker });\n set({ flattenHandlers });\n set({\n handlerRowSelection,\n });\n set({ restHandlers: unsupportedHandlers });\n\n return worker;\n },\n resetMSWDevTool: () => {\n const _worker = get().getWorker();\n _worker.resetHandlers();\n \n const {\n worker,\n flattenHandlers,\n handlerRowSelection,\n unsupportedHandlers,\n } = initMSWDevToolStore(_worker);\n\n set({ worker });\n set({ flattenHandlers });\n set({\n handlerRowSelection,\n });\n set({ restHandlers: unsupportedHandlers });\n },\n handleHandlerRowSelectionChange: (updater) => {\n const worker = get().getWorker();\n\n if (isFunction(updater)) {\n set(({ handlerRowSelection }) => {\n const next = updater(handlerRowSelection);\n const current = get().flattenHandlers.map((handler) =>\n next[handler.id]\n ? { ...handler, enabled: true }\n : { ...handler, enabled: false }\n );\n return { handlerRowSelection: next, flattenHandlers: current };\n });\n } else {\n const current = get().flattenHandlers.map((handler) =>\n updater[handler.id]\n ? { ...handler, enabled: true }\n : { ...handler, enabled: false }\n );\n set({ handlerRowSelection: updater, flattenHandlers: current });\n }\n\n const flattenHandlers = get().flattenHandlers;\n const restHandlers = get().restHandlers;\n const totalEnableHandlers = getTotalEnableHandlers(\n flattenHandlers,\n restHandlers\n );\n updateEnableHandlers(worker, totalEnableHandlers);\n },\n getWorker: () => {\n const worker = get().worker;\n if (!worker) throw new Error(\"Worker is not initialized\");\n return worker;\n },\n}));\n\nexport const initMSWDevTool =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C,MAAM,CAAC;AAC5B,QAAA,IAAI,CAAC,MAAM;AAAE,YAAA,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;AAC1D,QAAA,OAAO,MAAM,CAAC;KACf;AACF,CAAA,CAAC,EAAE;AAES,MAAA,cAAc,GAAG,eAAe,CAAC,QAAQ,EAAE,CAAC;;;;"}
@@ -1,58 +0,0 @@
1
- import { dummyHandler } from '../const/handler.js';
2
-
3
- const getRowId = ({ path, method }) => JSON.stringify({
4
- path,
5
- method,
6
- });
7
- const convertHandlers = (handlers) => {
8
- const unsupportedHandlers = [];
9
- const flattenHandlers = handlers.reduce((acc, _handler) => {
10
- // Current, GraphQL & WebSocketHandler is not supported.
11
- const handler = _handler;
12
- if (!("info" in handler && handler.info.method && handler.info.path)) {
13
- unsupportedHandlers.push(handler);
14
- return acc;
15
- }
16
- const { method: _method, path: _path } = handler.info;
17
- const [method, path] = [_method.toString(), _path.toString()];
18
- acc.push({
19
- id: getRowId({ path, method }),
20
- path,
21
- method,
22
- enabled: true,
23
- handler,
24
- });
25
- return acc;
26
- }, []);
27
- return { flattenHandlers, unsupportedHandlers };
28
- };
29
- const getTotalEnableHandlers = (flattenHandlers, restHandlers) => {
30
- const checkedHttpHandlers = flattenHandlers
31
- .filter((h) => h.enabled)
32
- .map((h) => h.handler);
33
- return [...checkedHttpHandlers, ...restHandlers];
34
- };
35
- /**
36
- * This has to do with `msw` internal workings.
37
- * If I spread an empty array in `resetHandlers`, it will be replaced by `initialHandler`.
38
- * Therefore, I proposed the `clear` method, but unfortunately it was not accepted!
39
- */
40
- const updateEnableHandlers = (worker, totalEnableHandlers) => {
41
- if (totalEnableHandlers.length === 0) {
42
- worker.resetHandlers(dummyHandler);
43
- return;
44
- }
45
- worker.resetHandlers(...totalEnableHandlers);
46
- };
47
- const initMSWDevToolStore = (worker) => {
48
- const handlers = worker.listHandlers();
49
- const { flattenHandlers, unsupportedHandlers } = convertHandlers(handlers);
50
- const handlerRowSelection = flattenHandlers.reduce((acc, handler) => {
51
- acc[handler.id] = handler.enabled;
52
- return acc;
53
- }, {});
54
- return { worker, flattenHandlers, unsupportedHandlers, handlerRowSelection };
55
- };
56
-
57
- export { convertHandlers, getRowId, getTotalEnableHandlers, initMSWDevToolStore, updateEnableHandlers };
58
- //# sourceMappingURL=util.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"util.js","sources":["../../../src/lib/util.ts"],"sourcesContent":["import { HttpHandler } from \"msw\";\nimport { FlattenHandler, Handler } from \"./type\";\nimport { dummyHandler } from \"../const/handler\";\nimport { SetupWorker } from \"msw/lib/browser\";\nimport { initial } from \"lodash\";\nimport { RowSelectionState } from \"@tanstack/react-table\";\n\nexport const getRowId = ({ path, method }: { path: string; method: string }) =>\n JSON.stringify({\n path,\n method,\n });\n\nexport const getObjFromRowId = (rowId: string) =>\n JSON.parse(rowId) as { path: string; method: string };\n\nexport const convertHandlers = (handlers: Handler[]) => {\n const unsupportedHandlers: Handler[] = [];\n const flattenHandlers: FlattenHandler[] = handlers.reduce((acc, _handler) => {\n // Current, GraphQL & WebSocketHandler is not supported.\n const handler = _handler as HttpHandler;\n if (!(\"info\" in handler && handler.info.method && handler.info.path)) {\n unsupportedHandlers.push(handler);\n return acc;\n }\n\n const { method: _method, path: _path } = handler.info;\n const [method, path] = [_method.toString(), _path.toString()];\n acc.push({\n id: getRowId({ path, method }),\n path,\n method,\n enabled: true,\n handler,\n });\n\n return acc;\n }, [] as FlattenHandler[]);\n return { flattenHandlers, unsupportedHandlers };\n};\n\nexport const getTotalEnableHandlers = (\n flattenHandlers: FlattenHandler[],\n restHandlers: Handler[]\n) => {\n const checkedHttpHandlers = flattenHandlers\n .filter((h) => h.enabled)\n .map((h) => h.handler);\n return [...checkedHttpHandlers, ...restHandlers];\n};\n\n/**\n * This has to do with `msw` internal workings.\n * If I spread an empty array in `resetHandlers`, it will be replaced by `initialHandler`.\n * Therefore, I proposed the `clear` method, but unfortunately it was not accepted!\n */\nexport const updateEnableHandlers = (\n worker: SetupWorker,\n totalEnableHandlers: Handler[]\n) => {\n if (totalEnableHandlers.length === 0) {\n worker.resetHandlers(dummyHandler);\n return;\n }\n\n worker.resetHandlers(...totalEnableHandlers);\n};\n\nexport const initMSWDevToolStore = (worker: SetupWorker) => {\n const handlers = worker.listHandlers() as Handler[];\n const { flattenHandlers, unsupportedHandlers } = convertHandlers(handlers);\n const handlerRowSelection = flattenHandlers.reduce((acc, handler) => {\n acc[handler.id] = handler.enabled;\n return acc;\n }, {} as RowSelectionState);\n\n return { worker, flattenHandlers, unsupportedHandlers, handlerRowSelection };\n};\n"],"names":[],"mappings":";;AAOa,MAAA,QAAQ,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,EAAoC,KACzE,IAAI,CAAC,SAAS,CAAC;IACb,IAAI;IACJ,MAAM;AACP,CAAA,EAAE;AAKQ,MAAA,eAAe,GAAG,CAAC,QAAmB,KAAI;IACrD,MAAM,mBAAmB,GAAc,EAAE,CAAC;IAC1C,MAAM,eAAe,GAAqB,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,QAAQ,KAAI;;QAE1E,MAAM,OAAO,GAAG,QAAuB,CAAC;AACxC,QAAA,IAAI,EAAE,MAAM,IAAI,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;AACpE,YAAA,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAClC,YAAA,OAAO,GAAG,CAAC;SACZ;AAED,QAAA,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;AACtD,QAAA,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC9D,GAAG,CAAC,IAAI,CAAC;YACP,EAAE,EAAE,QAAQ,C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,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,CAAC;AAC/E;;;;"}
@@ -1,75 +0,0 @@
1
- import * as React from 'react';
2
- import { createTable } from '../../../table-core/build/lib/index.js';
3
- export { ColumnFaceting, ColumnFiltering, ColumnGrouping, ColumnOrdering, ColumnPinning, ColumnSizing, ColumnVisibility, GlobalFaceting, GlobalFiltering, Headers, RowExpanding, RowPagination, RowPinning, RowSelection, RowSorting, _getVisibleLeafColumns, aggregationFns, buildHeaderGroups, createCell, createColumn, createColumnHelper, createRow, defaultColumnSizing, filterFns, flattenBy, functionalUpdate, getCoreRowModel, getMemoOptions, isFunction, isNumberArray, isRowSelected, isSubRowSelected, makeStateUpdater, memo, orderColumns, passiveEventSupported, reSplitAlphaNumeric, selectRowsFn, shouldAutoRemoveFilter, sortingFns } from '../../../table-core/build/lib/index.js';
4
-
5
- /**
6
- * react-table
7
- *
8
- * Copyright (c) TanStack
9
- *
10
- * This source code is licensed under the MIT license found in the
11
- * LICENSE.md file in the root directory of this source tree.
12
- *
13
- * @license MIT
14
- */
15
-
16
- //
17
-
18
- /**
19
- * If rendering headers, cells, or footers with custom markup, use flexRender instead of `cell.getValue()` or `cell.renderValue()`.
20
- */
21
- function flexRender(Comp, props) {
22
- return !Comp ? null : isReactComponent(Comp) ? /*#__PURE__*/React.createElement(Comp, props) : Comp;
23
- }
24
- function isReactComponent(component) {
25
- return isClassComponent(component) || typeof component === 'function' || isExoticComponent(component);
26
- }
27
- function isClassComponent(component) {
28
- return typeof component === 'function' && (() => {
29
- const proto = Object.getPrototypeOf(component);
30
- return proto.prototype && proto.prototype.isReactComponent;
31
- })();
32
- }
33
- function isExoticComponent(component) {
34
- return typeof component === 'object' && typeof component.$$typeof === 'symbol' && ['react.memo', 'react.forward_ref'].includes(component.$$typeof.description);
35
- }
36
- function useReactTable(options) {
37
- // Compose in the generic options to the user options
38
- const resolvedOptions = {
39
- state: {},
40
- // Dummy state
41
- onStateChange: () => {},
42
- // noop
43
- renderFallbackValue: null,
44
- ...options
45
- };
46
-
47
- // Create a new table and store it in state
48
- const [tableRef] = React.useState(() => ({
49
- current: createTable(resolvedOptions)
50
- }));
51
-
52
- // By default, manage table state here using the table's initial state
53
- const [state, setState] = React.useState(() => tableRef.current.initialState);
54
-
55
- // Compose the default state above with any user state. This will allow the user
56
- // to only control a subset of the state if desired.
57
- tableRef.current.setOptions(prev => ({
58
- ...prev,
59
- ...options,
60
- state: {
61
- ...state,
62
- ...options.state
63
- },
64
- // Similarly, we'll maintain both our internal state and any user-provided
65
- // state.
66
- onStateChange: updater => {
67
- setState(updater);
68
- options.onStateChange == null || options.onStateChange(updater);
69
- }
70
- }));
71
- return tableRef.current;
72
- }
73
-
74
- export { createTable, flexRender, useReactTable };
75
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../../node_modules/@tanstack/react-table/build/lib/index.mjs"],"sourcesContent":["/**\n * react-table\n *\n * Copyright (c) TanStack\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nimport * as React from 'react';\nimport { createTable } from '@tanstack/table-core';\nexport * from '@tanstack/table-core';\n\n//\n\n/**\n * If rendering headers, cells, or footers with custom markup, use flexRender instead of `cell.getValue()` or `cell.renderValue()`.\n */\nfunction flexRender(Comp, props) {\n return !Comp ? null : isReactComponent(Comp) ? /*#__PURE__*/React.createElement(Comp, props) : Comp;\n}\nfunction isReactComponent(component) {\n return isClassComponent(component) || typeof component === 'function' || isExoticComponent(component);\n}\nfunction isClassComponent(component) {\n return typeof component === 'function' && (() => {\n const proto = Object.getPrototypeOf(component);\n return proto.prototype && proto.prototype.isReactComponent;\n })();\n}\nfunction isExoticComponent(component) {\n return typeof component === 'object' && typeof component.$$typeof === 'symbol' && ['react.memo', 'react.forward_ref'].includes(component.$$typeof.description);\n}\nfunction useReactTable(options) {\n // Compose in the generic options to the user options\n const resolvedOptions = {\n state: {},\n // Dummy state\n onStateChange: () => {},\n // noop\n renderFallbackValue: null,\n ...options\n };\n\n // Create a new table and store it in state\n const [tableRef] = React.useState(() => ({\n current: createTable(resolvedOptions)\n }));\n\n // By default, manage table state here using the table's initial state\n const [state, setState] = React.useState(() => tableRef.current.initialState);\n\n // Compose the default state above with any user state. This will allow the user\n // to only control a subset of the state if desired.\n tableRef.current.setOptions(prev => ({\n ...prev,\n ...options,\n state: {\n ...state,\n ...options.state\n },\n // Similarly, we'll maintain both our internal state and any user-provided\n // state.\n onStateChange: updater => {\n setState(updater);\n options.onStateChange == null || options.onStateChange(updater);\n }\n }));\n return tableRef.current;\n}\n\nexport { flexRender, useReactTable };\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE;AACjC,EAAE,OAAO,CAAC,IAAI,GAAG,IAAI,GAAG,gBAAgB,CAAC,IAAI,CAAC,gBAAgB,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC;AACtG,CAAC;AACD,SAAS,gBAAgB,CAAC,SAAS,EAAE;AACrC,EAAE,OAAO,gBAAgB,CAAC,SAAS,CAAC,IAAI,OAAO,SAAS,KAAK,UAAU,IAAI,iBAAiB,CAAC,SAAS,CAAC,CAAC;AACxG,CAAC;AACD,SAAS,gBAAgB,CAAC,SAAS,EAAE;AACrC,EAAE,OAAO,OAAO,SAAS,KAAK,UAAU,IAAI,CAAC,MAAM;AACnD,IAAI,MAAM,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;AACnD,IAAI,OAAO,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC;AAC/D,GAAG,GAAG,CAAC;AACP,CAAC;AACD,SAAS,iB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