@webiny/app 5.36.2 → 5.37.0-beta.1

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 (75) hide show
  1. package/App.js.map +1 -1
  2. package/apollo-client/InMemoryCache.js +0 -3
  3. package/apollo-client/InMemoryCache.js.map +1 -1
  4. package/components/Image.js +2 -2
  5. package/components/Image.js.map +1 -1
  6. package/components/Routes.js.map +1 -1
  7. package/components/View.js.map +1 -1
  8. package/components/index.js.map +1 -1
  9. package/config.js.map +1 -1
  10. package/contexts/Ui/index.js.map +1 -1
  11. package/core/AddRoute.js.map +1 -1
  12. package/core/DebounceRender.js +2 -2
  13. package/core/DebounceRender.js.map +1 -1
  14. package/core/Plugin.js.map +1 -1
  15. package/core/Plugins.js.map +1 -1
  16. package/core/Provider.js.map +1 -1
  17. package/core/Routes.js.map +1 -1
  18. package/core/createProvider.js.map +1 -1
  19. package/core/createProviderPlugin.js.map +1 -1
  20. package/hooks/useAutocomplete/index.js.map +1 -1
  21. package/hooks/useAutocomplete/useAutocomplete.js +2 -2
  22. package/hooks/useAutocomplete/useAutocomplete.js.map +1 -1
  23. package/hooks/useDataList/functions/getData.js.map +1 -1
  24. package/hooks/useDataList/functions/getError.js.map +1 -1
  25. package/hooks/useDataList/functions/getMeta.js.map +1 -1
  26. package/hooks/useDataList/functions/index.js.map +1 -1
  27. package/hooks/useDataList/functions/searchDataByKey.js.map +1 -1
  28. package/hooks/useDataList/index.js.map +1 -1
  29. package/hooks/useDataList/useDataList.js +6 -6
  30. package/hooks/useDataList/useDataList.js.map +1 -1
  31. package/hooks/useDataList/utils/index.js.map +1 -1
  32. package/hooks/useDataList/utils/prepareLoadListParams.js.map +1 -1
  33. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js.map +1 -1
  34. package/hooks/useHandler.js +4 -0
  35. package/hooks/useHandler.js.map +1 -1
  36. package/hooks/useHandlers.js.map +1 -1
  37. package/hooks/useUi.js.map +1 -1
  38. package/i18n/i18n.js.map +1 -1
  39. package/i18n/index.js.map +1 -1
  40. package/index.js.map +1 -1
  41. package/package.json +17 -19
  42. package/plugins/AddQuerySelectionPlugin.js +0 -3
  43. package/plugins/AddQuerySelectionPlugin.js.map +1 -1
  44. package/plugins/ApolloCacheObjectIdPlugin.js +0 -2
  45. package/plugins/ApolloCacheObjectIdPlugin.js.map +1 -1
  46. package/plugins/ApolloDynamicLink.js.map +1 -1
  47. package/plugins/ApolloLinkPlugin.js +0 -4
  48. package/plugins/ApolloLinkPlugin.js.map +1 -1
  49. package/plugins/ConsoleLinkPlugin.js.map +1 -1
  50. package/plugins/LocaleHeaderLinkPlugin.js +0 -3
  51. package/plugins/LocaleHeaderLinkPlugin.js.map +1 -1
  52. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js.map +1 -1
  53. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js.map +1 -1
  54. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js.map +1 -1
  55. package/plugins/NetworkErrorLinkPlugin.js.map +1 -1
  56. package/plugins/OmitTypenameLinkPlugin.js.map +1 -1
  57. package/plugins/RoutePlugin.js +0 -2
  58. package/plugins/RoutePlugin.js.map +1 -1
  59. package/plugins/TenantHeaderLinkPlugin.js +0 -3
  60. package/plugins/TenantHeaderLinkPlugin.js.map +1 -1
  61. package/plugins/ViewPlugin.js +0 -2
  62. package/plugins/ViewPlugin.js.map +1 -1
  63. package/plugins/image.js.map +1 -1
  64. package/plugins/index.js.map +1 -1
  65. package/types.d.ts +0 -16
  66. package/types.js.map +1 -1
  67. package/utils/getApiUrl.js.map +1 -1
  68. package/utils/getGqlApiUrl.js.map +1 -1
  69. package/utils/getHeadlessCmsGqlApiUrl.js.map +1 -1
  70. package/utils/getLocaleCode.js.map +1 -1
  71. package/utils/getPrerenderId.js.map +1 -1
  72. package/utils/getTenantId.js.map +1 -1
  73. package/utils/index.js.map +1 -1
  74. package/utils/isLocalhost.js.map +1 -1
  75. package/utils/isPrerendering.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["useHandlers","props","factories","propsRef","useRef","handlersRef","names","Object","keys","reduce","handlers","name","handler","current","useEffect"],"sources":["useHandlers.ts"],"sourcesContent":["import { useRef, useEffect } from \"react\";\n\ntype HandlerProps = { [key: string]: any };\ntype HandlerFactories = { [key: string]: (props: HandlerProps) => (...params: any[]) => any };\ntype Handlers = {\n [K in keyof HandlerFactories]: (...params: any[]) => any;\n};\n\nexport function useHandlers<H = Handlers>(props: HandlerProps, factories: HandlerFactories) {\n const propsRef = useRef(props);\n\n const handlersRef = useRef(\n (() => {\n const names = Object.keys(factories);\n return names.reduce((handlers, name) => {\n /**\n * TODO: figure out args types\n */\n handlers[name] = (...args: any) => {\n const handler = factories[name](propsRef.current);\n return handler(...args);\n };\n return handlers;\n }, {} as Record<string, any>);\n })()\n );\n\n useEffect(() => {\n propsRef.current = props;\n });\n\n return handlersRef.current as H;\n}\n"],"mappings":";;;;;;AAAA;AAQO,SAASA,WAAW,CAAeC,KAAmB,EAAEC,SAA2B,EAAE;EACxF,IAAMC,QAAQ,GAAG,IAAAC,aAAM,EAACH,KAAK,CAAC;EAE9B,IAAMI,WAAW,GAAG,IAAAD,aAAM,EACrB,YAAM;IACH,IAAME,KAAK,GAAGC,MAAM,CAACC,IAAI,CAACN,SAAS,CAAC;IACpC,OAAOI,KAAK,CAACG,MAAM,CAAC,UAACC,QAAQ,EAAEC,IAAI,EAAK;MACpC;AAChB;AACA;MACgBD,QAAQ,CAACC,IAAI,CAAC,GAAG,YAAkB;QAC/B,IAAMC,OAAO,GAAGV,SAAS,CAACS,IAAI,CAAC,CAACR,QAAQ,CAACU,OAAO,CAAC;QACjD,OAAOD,OAAO,yBAAS;MAC3B,CAAC;MACD,OAAOF,QAAQ;IACnB,CAAC,EAAE,CAAC,CAAC,CAAwB;EACjC,CAAC,EAAG,CACP;EAED,IAAAI,gBAAS,EAAC,YAAM;IACZX,QAAQ,CAACU,OAAO,GAAGZ,KAAK;EAC5B,CAAC,CAAC;EAEF,OAAOI,WAAW,CAACQ,OAAO;AAC9B"}
1
+ {"version":3,"names":["_react","require","useHandlers","props","factories","propsRef","useRef","handlersRef","names","Object","keys","reduce","handlers","name","handler","current","apply","arguments","useEffect"],"sources":["useHandlers.ts"],"sourcesContent":["import { useRef, useEffect } from \"react\";\n\ntype HandlerProps = { [key: string]: any };\ntype HandlerFactories = { [key: string]: (props: HandlerProps) => (...params: any[]) => any };\ntype Handlers = {\n [K in keyof HandlerFactories]: (...params: any[]) => any;\n};\n\nexport function useHandlers<H = Handlers>(props: HandlerProps, factories: HandlerFactories) {\n const propsRef = useRef(props);\n\n const handlersRef = useRef(\n (() => {\n const names = Object.keys(factories);\n return names.reduce((handlers, name) => {\n /**\n * TODO: figure out args types\n */\n handlers[name] = (...args: any) => {\n const handler = factories[name](propsRef.current);\n return handler(...args);\n };\n return handlers;\n }, {} as Record<string, any>);\n })()\n );\n\n useEffect(() => {\n propsRef.current = props;\n });\n\n return handlersRef.current as H;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAQO,SAASC,WAAWA,CAAeC,KAAmB,EAAEC,SAA2B,EAAE;EACxF,IAAMC,QAAQ,GAAG,IAAAC,aAAM,EAACH,KAAK,CAAC;EAE9B,IAAMI,WAAW,GAAG,IAAAD,aAAM,EACrB,YAAM;IACH,IAAME,KAAK,GAAGC,MAAM,CAACC,IAAI,CAACN,SAAS,CAAC;IACpC,OAAOI,KAAK,CAACG,MAAM,CAAC,UAACC,QAAQ,EAAEC,IAAI,EAAK;MACpC;AAChB;AACA;MACgBD,QAAQ,CAACC,IAAI,CAAC,GAAG,YAAkB;QAC/B,IAAMC,OAAO,GAAGV,SAAS,CAACS,IAAI,CAAC,CAACR,QAAQ,CAACU,OAAO,CAAC;QACjD,OAAOD,OAAO,CAAAE,KAAA,SAAAC,SAAQ,CAAC;MAC3B,CAAC;MACD,OAAOL,QAAQ;IACnB,CAAC,EAAE,CAAC,CAAwB,CAAC;EACjC,CAAC,CAAE,CACP,CAAC;EAED,IAAAM,gBAAS,EAAC,YAAM;IACZb,QAAQ,CAACU,OAAO,GAAGZ,KAAK;EAC5B,CAAC,CAAC;EAEF,OAAOI,WAAW,CAACQ,OAAO;AAC9B"}
@@ -1 +1 @@
1
- {"version":3,"names":["useUi","useContext","UiContext"],"sources":["useUi.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { UiContext, UiContextValue } from \"./../contexts/Ui\";\n\nexport const useUi = () => {\n return useContext(UiContext) as UiContextValue;\n};\n"],"mappings":";;;;;;AAAA;AACA;AAEO,IAAMA,KAAK,GAAG,SAARA,KAAK,GAAS;EACvB,OAAO,IAAAC,iBAAU,EAACC,aAAS,CAAC;AAChC,CAAC;AAAC"}
1
+ {"version":3,"names":["_react","require","_Ui","useUi","useContext","UiContext","exports"],"sources":["useUi.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { UiContext, UiContextValue } from \"./../contexts/Ui\";\n\nexport const useUi = () => {\n return useContext(UiContext) as UiContextValue;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,GAAA,GAAAD,OAAA;AAEO,IAAME,KAAK,GAAG,SAARA,KAAKA,CAAA,EAAS;EACvB,OAAO,IAAAC,iBAAU,EAACC,aAAS,CAAC;AAChC,CAAC;AAACC,OAAA,CAAAH,KAAA,GAAAA,KAAA"}
package/i18n/i18n.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["i18n","registerProcessors","defaultProcessor","reactProcessor","registerModifiers","defaultModifiers"],"sources":["i18n.ts"],"sourcesContent":["import i18n, { defaultProcessor, defaultModifiers } from \"@webiny/i18n\";\nimport reactProcessor from \"@webiny/i18n-react\";\n\ni18n.registerProcessors([defaultProcessor, reactProcessor]);\ni18n.registerModifiers(defaultModifiers);\n\nexport default i18n;\n"],"mappings":";;;;;;;;AAAA;AACA;AAEAA,aAAI,CAACC,kBAAkB,CAAC,CAACC,sBAAgB,EAAEC,kBAAc,CAAC,CAAC;AAC3DH,aAAI,CAACI,iBAAiB,CAACC,sBAAgB,CAAC;AAAC,eAE1BL,aAAI;AAAA"}
1
+ {"version":3,"names":["_i18n","_interopRequireWildcard","require","_i18nReact","_interopRequireDefault","i18n","registerProcessors","defaultProcessor","reactProcessor","registerModifiers","defaultModifiers","_default","exports","default"],"sources":["i18n.ts"],"sourcesContent":["import i18n, { defaultProcessor, defaultModifiers } from \"@webiny/i18n\";\nimport reactProcessor from \"@webiny/i18n-react\";\n\ni18n.registerProcessors([defaultProcessor, reactProcessor]);\ni18n.registerModifiers(defaultModifiers);\n\nexport default i18n;\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEAG,aAAI,CAACC,kBAAkB,CAAC,CAACC,sBAAgB,EAAEC,kBAAc,CAAC,CAAC;AAC3DH,aAAI,CAACI,iBAAiB,CAACC,sBAAgB,CAAC;AAAC,IAAAC,QAAA,GAE1BN,aAAI;AAAAO,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
package/i18n/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default as i18n } from \"./i18n\";\n"],"mappings":";;;;;;;;;;;;AAAA"}
1
+ {"version":3,"names":["_i18n","_interopRequireDefault","require"],"sources":["index.ts"],"sourcesContent":["export { default as i18n } from \"./i18n\";\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA"}
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { AddQuerySelectionPlugin } from \"./plugins/AddQuerySelectionPlugin\";\nexport { ApolloLinkPlugin } from \"./plugins/ApolloLinkPlugin\";\nexport { RoutePlugin } from \"./plugins/RoutePlugin\";\nexport { ApolloCacheObjectIdPlugin } from \"./plugins/ApolloCacheObjectIdPlugin\";\n\n// Composition - we re-export this for ease of use\nexport * from \"@webiny/react-composition\";\nexport type { HigherOrderComponent, ComposeProps, ComposableFC } from \"@webiny/react-composition\";\n\n// App framework\nexport * from \"./App\";\nexport type { AppProps } from \"./App\";\nexport * from \"./core/Plugins\";\nexport * from \"./core/Plugin\";\nexport * from \"./core/Provider\";\nexport * from \"./core/AddRoute\";\nexport * from \"./core/DebounceRender\";\nexport * from \"./core/createProvider\";\nexport * from \"./core/createProviderPlugin\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AAGA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AAIA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AAEA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"names":["_AddQuerySelectionPlugin","require","_ApolloLinkPlugin","_RoutePlugin","_ApolloCacheObjectIdPlugin","_reactComposition","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_App","_Plugins","_Plugin","_Provider","_AddRoute","_DebounceRender","_createProvider","_createProviderPlugin"],"sources":["index.ts"],"sourcesContent":["export { AddQuerySelectionPlugin } from \"./plugins/AddQuerySelectionPlugin\";\nexport { ApolloLinkPlugin } from \"./plugins/ApolloLinkPlugin\";\nexport { RoutePlugin } from \"./plugins/RoutePlugin\";\nexport { ApolloCacheObjectIdPlugin } from \"./plugins/ApolloCacheObjectIdPlugin\";\n\n// Composition - we re-export this for ease of use\nexport * from \"@webiny/react-composition\";\nexport type { HigherOrderComponent, ComposeProps, ComposableFC } from \"@webiny/react-composition\";\n\n// App framework\nexport * from \"./App\";\nexport type { AppProps } from \"./App\";\nexport * from \"./core/Plugins\";\nexport * from \"./core/Plugin\";\nexport * from \"./core/Provider\";\nexport * from \"./core/AddRoute\";\nexport * from \"./core/DebounceRender\";\nexport * from \"./core/createProvider\";\nexport * from \"./core/createProviderPlugin\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,0BAAA,GAAAH,OAAA;AAGA,IAAAI,iBAAA,GAAAJ,OAAA;AAAAK,MAAA,CAAAC,IAAA,CAAAF,iBAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,iBAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAZ,iBAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAIA,IAAAS,IAAA,GAAAjB,OAAA;AAAAK,MAAA,CAAAC,IAAA,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,16 +15,16 @@
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
17
  "@apollo/react-hooks": "3.1.5",
18
- "@babel/runtime": "7.20.13",
18
+ "@babel/runtime": "7.22.6",
19
19
  "@emotion/styled": "11.10.6",
20
20
  "@types/react": "17.0.39",
21
21
  "@types/web": "0.0.61",
22
- "@webiny/i18n": "5.36.2",
23
- "@webiny/i18n-react": "5.36.2",
24
- "@webiny/plugins": "5.36.2",
25
- "@webiny/react-composition": "5.36.2",
26
- "@webiny/react-router": "5.36.2",
27
- "@webiny/ui": "5.36.2",
22
+ "@webiny/i18n": "5.37.0-beta.1",
23
+ "@webiny/i18n-react": "5.37.0-beta.1",
24
+ "@webiny/plugins": "5.37.0-beta.1",
25
+ "@webiny/react-composition": "5.37.0-beta.1",
26
+ "@webiny/react-router": "5.37.0-beta.1",
27
+ "@webiny/ui": "5.37.0-beta.1",
28
28
  "apollo-cache": "1.3.5",
29
29
  "apollo-cache-inmemory": "1.6.6",
30
30
  "apollo-client": "2.6.10",
@@ -37,24 +37,22 @@
37
37
  "graphql": "15.8.0",
38
38
  "invariant": "2.2.4",
39
39
  "lodash": "4.17.21",
40
- "lodash.debounce": "4.0.8",
41
40
  "nanoid": "3.3.4",
42
41
  "react": "17.0.2",
43
42
  "react-dom": "17.0.2",
44
43
  "warning": "4.0.3"
45
44
  },
46
45
  "devDependencies": {
47
- "@babel/cli": "7.20.7",
48
- "@babel/core": "7.20.12",
46
+ "@babel/cli": "7.22.6",
47
+ "@babel/core": "7.22.8",
49
48
  "@babel/plugin-proposal-class-properties": "7.18.6",
50
- "@babel/preset-env": "7.20.2",
51
- "@babel/preset-react": "7.18.6",
52
- "@babel/preset-typescript": "7.18.6",
53
- "@types/lodash.debounce": "4.0.7",
49
+ "@babel/preset-env": "7.22.7",
50
+ "@babel/preset-react": "7.22.5",
51
+ "@babel/preset-typescript": "7.22.5",
52
+ "@types/lodash": "4.14.195",
54
53
  "@types/warning": "3.0.0",
55
- "@webiny/cli": "5.36.2",
56
- "@webiny/project-utils": "5.36.2",
57
- "babel-plugin-lodash": "3.3.4",
54
+ "@webiny/cli": "5.37.0-beta.1",
55
+ "@webiny/project-utils": "5.37.0-beta.1",
58
56
  "rimraf": "3.0.2",
59
57
  "typescript": "4.7.4"
60
58
  },
@@ -74,5 +72,5 @@
74
72
  ]
75
73
  }
76
74
  },
77
- "gitHead": "908c591cd08d81da267ed6152e880b52e1157c8b"
75
+ "gitHead": "176c29425477d1daaca1b7da79bacc79a1d35f6e"
78
76
  }
@@ -9,10 +9,8 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
9
9
  var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelper"));
10
10
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
11
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
12
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
13
12
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
14
13
  var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
15
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
14
  var _apolloLink = require("apollo-link");
17
15
  var _graphql = require("graphql");
18
16
  var _ApolloLinkPlugin2 = require("./ApolloLinkPlugin");
@@ -23,7 +21,6 @@ var AddQuerySelectionPlugin = /*#__PURE__*/function (_ApolloLinkPlugin) {
23
21
  var _this;
24
22
  (0, _classCallCheck2.default)(this, AddQuerySelectionPlugin);
25
23
  _this = _super.call(this);
26
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "config", void 0);
27
24
  _this.config = config;
28
25
  return _this;
29
26
  }
@@ -1 +1 @@
1
- {"version":3,"names":["AddQuerySelectionPlugin","config","ApolloLink","operation","forward","operationName","addSelectionToQuery","query","document","isProcessed","markProcessed","addSelection","selectionPath","firstQueryDefinition","definitions","selectionSet","tree","selections","fields","split","fieldLoop","field","selection","name","value","push","hasOwnProperty","__webiny__","Set","has","cacheKey","add","ApolloLinkPlugin"],"sources":["AddQuerySelectionPlugin.ts"],"sourcesContent":["import { ApolloLink } from \"apollo-link\";\nimport { DocumentNode } from \"graphql\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\nimport { ExecutableDefinitionNode, FieldNode } from \"graphql/language/ast\";\n\ndeclare module \"graphql\" {\n interface DocumentNode {\n __webiny__: Set<string>;\n }\n}\n\ninterface Config {\n operationName: string;\n selectionPath: string;\n addSelection: DocumentNode;\n}\n\nexport class AddQuerySelectionPlugin extends ApolloLinkPlugin {\n private readonly config: Config;\n\n constructor(config: Config) {\n super();\n this.config = config;\n }\n\n public override createLink(): ApolloLink {\n return new ApolloLink((operation, forward) => {\n if (operation.operationName !== this.config.operationName) {\n return forward(operation);\n }\n\n this.addSelectionToQuery(operation.operationName, operation.query);\n\n return forward(operation);\n });\n }\n\n public addSelectionToQuery(operationName: string, document: DocumentNode): void {\n if (operationName !== this.config.operationName) {\n return;\n }\n\n // If this plugin already processed the given document (documents are always passed by reference),\n // then we don't want to apply the selection again, to avoid adding duplicate selections.\n if (this.isProcessed(document)) {\n return;\n }\n\n this.markProcessed(document);\n\n const { addSelection, selectionPath } = this.config;\n\n const firstQueryDefinition = document.definitions[0] as ExecutableDefinitionNode;\n if (!firstQueryDefinition) {\n return;\n } else if (!firstQueryDefinition.selectionSet) {\n return;\n }\n\n let tree = firstQueryDefinition.selectionSet.selections as FieldNode[];\n const fields = selectionPath.split(\".\");\n\n fieldLoop: for (const field of fields) {\n for (const selection of tree) {\n if (!selection.selectionSet) {\n continue;\n }\n if (selection.name.value === field) {\n tree = selection.selectionSet.selections as FieldNode[];\n continue fieldLoop;\n }\n }\n // If we get here, it means we didn't find the necessary selection\n return;\n }\n /**\n * We must cast because there are a lot of types that are not intertwined and TS is complaining\n */\n tree.push(\n ...((addSelection.definitions[0] as ExecutableDefinitionNode).selectionSet\n .selections as FieldNode[])\n );\n }\n\n private isProcessed(document: DocumentNode) {\n if (!document.hasOwnProperty(\"__webiny__\")) {\n document.__webiny__ = new Set();\n }\n\n return document.__webiny__.has(this.cacheKey);\n }\n\n private markProcessed(document: DocumentNode) {\n if (!document.hasOwnProperty(\"__webiny__\")) {\n document.__webiny__ = new Set();\n }\n\n document.__webiny__.add(this.cacheKey);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AAAsD,IAezCA,uBAAuB;EAAA;EAAA;EAGhC,iCAAYC,MAAc,EAAE;IAAA;IAAA;IACxB;IAAQ;IACR,MAAKA,MAAM,GAAGA,MAAM;IAAC;EACzB;EAAC;IAAA;IAAA,OAED,sBAAyC;MAAA;MACrC,OAAO,IAAIC,sBAAU,CAAC,UAACC,SAAS,EAAEC,OAAO,EAAK;QAC1C,IAAID,SAAS,CAACE,aAAa,KAAK,MAAI,CAACJ,MAAM,CAACI,aAAa,EAAE;UACvD,OAAOD,OAAO,CAACD,SAAS,CAAC;QAC7B;QAEA,MAAI,CAACG,mBAAmB,CAACH,SAAS,CAACE,aAAa,EAAEF,SAAS,CAACI,KAAK,CAAC;QAElE,OAAOH,OAAO,CAACD,SAAS,CAAC;MAC7B,CAAC,CAAC;IACN;EAAC;IAAA;IAAA,OAED,6BAA2BE,aAAqB,EAAEG,QAAsB,EAAQ;MAAA;MAC5E,IAAIH,aAAa,KAAK,IAAI,CAACJ,MAAM,CAACI,aAAa,EAAE;QAC7C;MACJ;;MAEA;MACA;MACA,IAAI,IAAI,CAACI,WAAW,CAACD,QAAQ,CAAC,EAAE;QAC5B;MACJ;MAEA,IAAI,CAACE,aAAa,CAACF,QAAQ,CAAC;MAE5B,mBAAwC,IAAI,CAACP,MAAM;QAA3CU,YAAY,gBAAZA,YAAY;QAAEC,aAAa,gBAAbA,aAAa;MAEnC,IAAMC,oBAAoB,GAAGL,QAAQ,CAACM,WAAW,CAAC,CAAC,CAA6B;MA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ACI,GAAG,CAAC,IAAI,CAACD,QAAQ,CAAC;IAC1C;EAAC;EAAA;AAAA,EAjFwCE,mCAAgB;AAAA"}
1
+ {"version":3,"names":["_apolloLink","require","_graphql","_ApolloLinkPlugin2","AddQuerySelectionPlugin","_ApolloLinkPlugin","_inherits2","default","_super","_createSuper2","config","_this","_classCallCheck2","call","_createClass2","key","value","createLink","_this2","ApolloLink","operation","forward","operationName","addSelectionToQuery","query","document","_tree","isProcessed","markProcessed","_this$config","addSelection","selectionPath","firstQueryDefinition","definitions","selectionSet","tree","selections","fields","split","_iterator","_createForOfIteratorHelper2","_step","fieldLoop","s","n","done","field","_iterator2","_step2","selection","name","err","e","f","push","apply","_toConsumableArray2","hasOwnProperty","__webiny__","Set","has","cacheKey","add","ApolloLinkPlugin","exports"],"sources":["AddQuerySelectionPlugin.ts"],"sourcesContent":["import { ApolloLink } from \"apollo-link\";\nimport { DocumentNode } from \"graphql\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\nimport { ExecutableDefinitionNode, FieldNode } from \"graphql/language/ast\";\n\ndeclare module \"graphql\" {\n interface DocumentNode {\n __webiny__: Set<string>;\n }\n}\n\ninterface Config {\n operationName: string;\n selectionPath: string;\n addSelection: DocumentNode;\n}\n\nexport class AddQuerySelectionPlugin extends ApolloLinkPlugin {\n private readonly config: Config;\n\n constructor(config: Config) {\n super();\n this.config = config;\n }\n\n public override createLink(): ApolloLink {\n return new ApolloLink((operation, forward) => {\n if (operation.operationName !== this.config.operationName) {\n return forward(operation);\n }\n\n this.addSelectionToQuery(operation.operationName, operation.query);\n\n return forward(operation);\n });\n }\n\n public addSelectionToQuery(operationName: string, document: DocumentNode): void {\n if (operationName !== this.config.operationName) {\n return;\n }\n\n // If this plugin already processed the given document (documents are always passed by reference),\n // then we don't want to apply the selection again, to avoid adding duplicate selections.\n if (this.isProcessed(document)) {\n return;\n }\n\n this.markProcessed(document);\n\n const { addSelection, selectionPath } = this.config;\n\n const firstQueryDefinition = document.definitions[0] as ExecutableDefinitionNode;\n if (!firstQueryDefinition) {\n return;\n } else if (!firstQueryDefinition.selectionSet) {\n return;\n }\n\n let tree = firstQueryDefinition.selectionSet.selections as FieldNode[];\n const fields = selectionPath.split(\".\");\n\n fieldLoop: for (const field of fields) {\n for (const selection of tree) {\n if (!selection.selectionSet) {\n continue;\n }\n if (selection.name.value === field) {\n tree = selection.selectionSet.selections as FieldNode[];\n continue fieldLoop;\n }\n }\n // If we get here, it means we didn't find the necessary selection\n return;\n }\n /**\n * We must cast because there are a lot of types that are not intertwined and TS is complaining\n */\n tree.push(\n ...((addSelection.definitions[0] as ExecutableDefinitionNode).selectionSet\n .selections as FieldNode[])\n );\n }\n\n private isProcessed(document: DocumentNode) {\n if (!document.hasOwnProperty(\"__webiny__\")) {\n document.__webiny__ = new Set();\n }\n\n return document.__webiny__.has(this.cacheKey);\n }\n\n private markProcessed(document: DocumentNode) {\n if (!document.hasOwnProperty(\"__webiny__\")) {\n document.__webiny__ = new Set();\n }\n\n document.__webiny__.add(this.cacheKey);\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAF,OAAA;AAAsD,IAezCG,uBAAuB,0BAAAC,iBAAA;EAAA,IAAAC,UAAA,CAAAC,OAAA,EAAAH,uBAAA,EAAAC,iBAAA;EAAA,IAAAG,MAAA,OAAAC,aAAA,CAAAF,OAAA,EAAAH,uBAAA;EAGhC,SAAAA,wBAAYM,MAAc,EAAE;IAAA,IAAAC,KAAA;IAAA,IAAAC,gBAAA,CAAAL,OAAA,QAAAH,uBAAA;IACxBO,KAAA,GAAAH,MAAA,CAAAK,IAAA;IACAF,KAAA,CAAKD,MAAM,GAAGA,MAAM;IAAC,OAAAC,KAAA;EACzB;EAAC,IAAAG,aAAA,CAAAP,OAAA,EAAAH,uBAAA;IAAAW,GAAA;IAAAC,KAAA,EAED,SAAAC,WAAA,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C,GAAA;IAAAC,KAAA,EAED,SAAAY,cAAsBH,QAAsB,EAAE;MAC1C,IAAI,CAACA,QAAQ,CAACgC,cAAc,CAAC,YAAY,CAAC,EAAE;QACxChC,QAAQ,CAACiC,UAAU,GAAG,IAAIC,GAAG,CAAC,CAAC;MACnC;MAEAlC,QAAQ,CAACiC,UAAU,CAACI,GAAG,CAAC,IAAI,CAACD,QAAQ,CAAC;IAC1C;EAAC;EAAA,OAAAzD,uBAAA;AAAA,EAjFwC2D,mCAAgB;AAAAC,OAAA,CAAA5D,uBAAA,GAAAA,uBAAA"}
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.ApolloCacheObjectIdPlugin = void 0;
8
8
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
11
10
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
12
11
  var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
13
12
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
@@ -19,7 +18,6 @@ var ApolloCacheObjectIdPlugin = /*#__PURE__*/function (_Plugin) {
19
18
  var _this;
20
19
  (0, _classCallCheck2.default)(this, ApolloCacheObjectIdPlugin);
21
20
  _this = _super.call(this);
22
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_getObjectId", void 0);
23
21
  _this._getObjectId = getObjectId;
24
22
  return _this;
25
23
  }
@@ -1 +1 @@
1
- {"version":3,"names":["ApolloCacheObjectIdPlugin","getObjectId","_getObjectId","data","Error","Plugin"],"sources":["ApolloCacheObjectIdPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\n\nexport interface ApolloCacheObject {\n __typename?: string;\n [key: string]: any;\n}\n\ninterface ApolloCacheObjectIdPluginCallable<T> {\n // A value for `id`, null to prevent normalization, or undefined to continue with defaults.\n (data: T): string | null | undefined;\n}\n\nexport class ApolloCacheObjectIdPlugin<\n T extends ApolloCacheObject = ApolloCacheObject\n> extends Plugin {\n public static override readonly type: string = \"cache-get-object-id\";\n private readonly _getObjectId?: ApolloCacheObjectIdPluginCallable<T>;\n\n public constructor(getObjectId?: ApolloCacheObjectIdPluginCallable<T>) {\n super();\n this._getObjectId = getObjectId;\n }\n\n public getObjectId(data: T) {\n if (typeof this._getObjectId !== \"function\") {\n throw Error(\n `You must provide a \"getObjectId\" callable to the plugin constructor or extend the ApolloCacheObjectIdPlugin.`\n );\n }\n\n return this._getObjectId(data);\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAAA;AAAyC,IAY5BA,yBAAyB;EAAA;EAAA;EAMlC,mCAAmBC,WAAkD,EAAE;IAAA;IAAA;IACnE;IAAQ;IACR,MAAKC,YAAY,GAAGD,WAAW;IAAC;EACpC;EAAC;IAAA;IAAA,OAED,qBAAmBE,IAAO,EAAE;MACxB,IAAI,OAAO,IAAI,CAACD,YAAY,KAAK,UAAU,EAAE;QACzC,MAAME,KAAK,kHAEV;MACL;MAEA,OAAO,IAAI,CAACF,YAAY,CAACC,IAAI,CAAC;IAClC;EAAC;EAAA;AAAA,EAjBKE,eAAM;AAAA;AAAA,8BAFHL,yBAAyB,UAGa,qBAAqB"}
1
+ {"version":3,"names":["_plugins","require","ApolloCacheObjectIdPlugin","_Plugin","_inherits2","default","_super","_createSuper2","getObjectId","_this","_classCallCheck2","call","_getObjectId","_createClass2","key","value","data","Error","Plugin","exports","_defineProperty2"],"sources":["ApolloCacheObjectIdPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\n\nexport interface ApolloCacheObject {\n __typename?: string;\n [key: string]: any;\n}\n\ninterface ApolloCacheObjectIdPluginCallable<T> {\n // A value for `id`, null to prevent normalization, or undefined to continue with defaults.\n (data: T): string | null | undefined;\n}\n\nexport class ApolloCacheObjectIdPlugin<\n T extends ApolloCacheObject = ApolloCacheObject\n> extends Plugin {\n public static override readonly type: string = \"cache-get-object-id\";\n private readonly _getObjectId?: ApolloCacheObjectIdPluginCallable<T>;\n\n public constructor(getObjectId?: ApolloCacheObjectIdPluginCallable<T>) {\n super();\n this._getObjectId = getObjectId;\n }\n\n public getObjectId(data: T) {\n if (typeof this._getObjectId !== \"function\") {\n throw Error(\n `You must provide a \"getObjectId\" callable to the plugin constructor or extend the ApolloCacheObjectIdPlugin.`\n );\n }\n\n return this._getObjectId(data);\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAAyC,IAY5BC,yBAAyB,0BAAAC,OAAA;EAAA,IAAAC,UAAA,CAAAC,OAAA,EAAAH,yBAAA,EAAAC,OAAA;EAAA,IAAAG,MAAA,OAAAC,aAAA,CAAAF,OAAA,EAAAH,yBAAA;EAMlC,SAAAA,0BAAmBM,WAAkD,EAAE;IAAA,IAAAC,KAAA;IAAA,IAAAC,gBAAA,CAAAL,OAAA,QAAAH,yBAAA;IACnEO,KAAA,GAAAH,MAAA,CAAAK,IAAA;IACAF,KAAA,CAAKG,YAAY,GAAGJ,WAAW;IAAC,OAAAC,KAAA;EACpC;EAAC,IAAAI,aAAA,CAAAR,OAAA,EAAAH,yBAAA;IAAAY,GAAA;IAAAC,KAAA,EAED,SAAAP,YAAmBQ,IAAO,EAAE;MACxB,IAAI,OAAO,IAAI,CAACJ,YAAY,KAAK,UAAU,EAAE;QACzC,MAAMK,KAAK,iHAEX,CAAC;MACL;MAEA,OAAO,IAAI,CAACL,YAAY,CAACI,IAAI,CAAC;IAClC;EAAC;EAAA,OAAAd,yBAAA;AAAA,EAjBKgB,eAAM;AAAAC,OAAA,CAAAjB,yBAAA,GAAAA,yBAAA;AAAA,IAAAkB,gBAAA,CAAAf,OAAA,EAFHH,yBAAyB,UAGa,qBAAqB"}
@@ -1 +1 @@
1
- {"version":3,"names":["createLink","plugin","e","console","error","ApolloDynamicLink","Map","operation","forward","linkPlugins","plugins","byType","length","cacheKey","map","pl","join","cache","has","links","filter","Boolean","set","ApolloLink","from","get","request"],"sources":["ApolloDynamicLink.ts"],"sourcesContent":["import { ApolloLink, NextLink } from \"apollo-link\";\nimport { plugins } from \"@webiny/plugins\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\nimport { Operation } from \"apollo-link/lib/types\";\n\nfunction createLink(plugin: ApolloLinkPlugin) {\n try {\n return plugin.createLink();\n } catch (e) {\n console.error(`Caught an error while executing \"createLink\" on plugin`, plugin);\n console.error(e);\n }\n return null;\n}\n\nexport class ApolloDynamicLink extends ApolloLink {\n private cache = new Map();\n\n public override request(operation: Operation, forward: NextLink) {\n const linkPlugins = plugins.byType<ApolloLinkPlugin>(\"apollo-link\");\n\n if (!linkPlugins.length) {\n return forward(operation);\n }\n\n const cacheKey = linkPlugins.map(pl => pl.cacheKey).join(\",\");\n\n if (!this.cache.has(cacheKey)) {\n /**\n * We filter out falsy items from the linkPlugins because there might be some error while creating link.\n */\n const links = linkPlugins.map(createLink).filter(Boolean) as ApolloLink[];\n this.cache.set(cacheKey, ApolloLink.from(links));\n }\n\n return this.cache.get(cacheKey).request(operation, forward);\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AAIA,SAASA,UAAU,CAACC,MAAwB,EAAE;EAC1C,IAAI;IACA,OAAOA,MAAM,CAACD,UAAU,EAAE;EAC9B,CAAC,CAAC,OAAOE,CAAC,EAAE;IACRC,OAAO,CAACC,KAAK,6DAA2DH,MAAM,CAAC;IAC/EE,OAAO,CAACC,KAAK,CAACF,CAAC,CAAC;EACpB;EACA,OAAO,IAAI;AACf;AAAC,IAEYG,iBAAiB;EAAA;EAAA;EAAA;IAAA;IAAA;IAAA;MAAA;IAAA;IAAA;IAAA,oFACV,IAAIC,GAAG,EAAE;IAAA;EAAA;EAAA;IAAA;IAAA,OAEzB,iBAAwBC,SAAoB,EAAEC,OAAiB,EAAE;MAC7D,IAAMC,WAAW,GAAGC,gBAAO,CAACC,MAAM,CAAmB,aAAa,CAAC;MAEnE,IAAI,CAACF,WAAW,CAACG,MAAM,EAAE;QACrB,OAAOJ,OAAO,CAACD,SAAS,CAAC;MAC7B;MAEA,IAAMM,QAAQ,GAAGJ,WAAW,CAACK,GAAG,CAAC,UAAAC,EAAE;QAAA,OAAIA,EAAE,CAACF,QAAQ;MAAA,EAAC,CAACG,IAAI,CAAC,GAAG,CAAC;MAE7D,IAAI,CAAC,IAAI,CAACC,KAAK,CAACC,GAAG,CAACL,QAAQ,CAAC,EAAE;QAC3B;AACZ;AACA;QACY,IAAMM,KAAK,GAAGV,WAAW,CAACK,GAAG,CAACd,UAAU,CAAC,CAACoB,MAAM,CAACC,OAAO,CAAiB;QACzE,IAAI,CAACJ,KAAK,CAACK,GAAG,CAACT,QAAQ,EAAEU,sBAAU,CAACC,IAAI,CAACL,KAAK,CAAC,CAAC;MACpD;MAEA,OAAO,IAAI,CAACF,KAAK,CAACQ,GAAG,CAACZ,QAAQ,CAAC,CAACa,OAAO,CAACnB,SAAS,EAAEC,OAAO,CAAC;IAC/D;EAAC;EAAA;AAAA,EArBkCe,sBAAU;AAAA"}
1
+ {"version":3,"names":["_apolloLink","require","_plugins","createLink","plugin","e","console","error","ApolloDynamicLink","_ApolloLink","_inherits2","default","_super","_createSuper2","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty2","_assertThisInitialized2","Map","_createClass2","key","value","request","operation","forward","linkPlugins","plugins","byType","cacheKey","map","pl","join","cache","has","links","filter","Boolean","set","ApolloLink","from","get","exports"],"sources":["ApolloDynamicLink.ts"],"sourcesContent":["import { ApolloLink, NextLink } from \"apollo-link\";\nimport { plugins } from \"@webiny/plugins\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\nimport { Operation } from \"apollo-link/lib/types\";\n\nfunction createLink(plugin: ApolloLinkPlugin) {\n try {\n return plugin.createLink();\n } catch (e) {\n console.error(`Caught an error while executing \"createLink\" on plugin`, plugin);\n console.error(e);\n }\n return null;\n}\n\nexport class ApolloDynamicLink extends ApolloLink {\n private cache = new Map();\n\n public override request(operation: Operation, forward: NextLink) {\n const linkPlugins = plugins.byType<ApolloLinkPlugin>(\"apollo-link\");\n\n if (!linkPlugins.length) {\n return forward(operation);\n }\n\n const cacheKey = linkPlugins.map(pl => pl.cacheKey).join(\",\");\n\n if (!this.cache.has(cacheKey)) {\n /**\n * We filter out falsy items from the linkPlugins because there might be some error while creating link.\n */\n const links = linkPlugins.map(createLink).filter(Boolean) as ApolloLink[];\n this.cache.set(cacheKey, ApolloLink.from(links));\n }\n\n return this.cache.get(cacheKey).request(operation, forward);\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAIA,SAASE,UAAUA,CAACC,MAAwB,EAAE;EAC1C,IAAI;IACA,OAAOA,MAAM,CAACD,UAAU,CAAC,CAAC;EAC9B,CAAC,CAAC,OAAOE,CAAC,EAAE;IACRC,OAAO,CAACC,KAAK,6DAA2DH,MAAM,CAAC;IAC/EE,OAAO,CAACC,KAAK,CAACF,CAAC,CAAC;EACpB;EACA,OAAO,IAAI;AACf;AAAC,IAEYG,iBAAiB,0BAAAC,WAAA;EAAA,IAAAC,UAAA,CAAAC,OAAA,EAAAH,iBAAA,EAAAC,WAAA;EAAA,IAAAG,MAAA,OAAAC,aAAA,CAAAF,OAAA,EAAAH,iBAAA;EAAA,SAAAA,kBAAA;IAAA,IAAAM,KAAA;IAAA,IAAAC,gBAAA,CAAAJ,OAAA,QAAAH,iBAAA;IAAA,SAAAQ,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAC,IAAA,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;MAAAF,IAAA,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;IA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var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
11
10
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
12
11
  var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
13
12
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
@@ -20,9 +19,6 @@ var ApolloLinkPlugin = /*#__PURE__*/function (_Plugin) {
20
19
  var _this;
21
20
  (0, _classCallCheck2.default)(this, ApolloLinkPlugin);
22
21
  _this = _super.call(this);
23
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "cacheKey", void 0);
24
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "factory", void 0);
25
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "cache", void 0);
26
22
  _this.factory = factory;
27
23
  _this.cacheKey = (0, _nanoid.nanoid)();
28
24
  return _this;
@@ -1 +1 @@
1
- {"version":3,"names":["ApolloLinkPlugin","factory","cacheKey","nanoid","cache","Error","name","Plugin"],"sources":["ApolloLinkPlugin.ts"],"sourcesContent":["import { ApolloLink } from \"apollo-link\";\nimport { nanoid } from \"nanoid\";\nimport { Plugin } from \"@webiny/plugins\";\n\nexport interface ApolloLinkFactory {\n (): ApolloLink;\n}\n\nexport class ApolloLinkPlugin extends Plugin {\n public static override readonly type: string = \"apollo-link\";\n public readonly cacheKey;\n private readonly factory?: ApolloLinkFactory;\n private cache?: ApolloLink;\n\n constructor(factory?: ApolloLinkFactory) {\n super();\n this.factory = factory;\n this.cacheKey = nanoid();\n }\n\n public createLink(): ApolloLink {\n if (this.cache) {\n return this.cache;\n }\n\n if (typeof this.factory === \"function\") {\n this.cache = this.factory();\n\n return this.cache;\n }\n\n throw Error(\n `Missing ApolloLinkFactory in plugin \"${this.name}\"! Either pass a factory to ApolloLinkPlugin constructor or extend the class and override the \"createLink\" method.`\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;AACA;AACA;AAAyC,IAM5BA,gBAAgB;EAAA;EAAA;EAMzB,0BAAYC,OAA2B,EAAE;IAAA;IAAA;IACrC;IAAQ;IAAA;IAAA;IACR,MAAKA,OAAO,GAAGA,OAAO;IACtB,MAAKC,QAAQ,GAAG,IAAAC,cAAM,GAAE;IAAC;EAC7B;EAAC;IAAA;IAAA,OAED,sBAAgC;MAC5B,IAAI,IAAI,CAACC,KAAK,EAAE;QACZ,OAAO,IAAI,CAACA,KAAK;MACrB;MAEA,IAAI,OAAO,IAAI,CAACH,OAAO,KAAK,UAAU,EAAE;QACpC,IAAI,CAACG,KAAK,GAAG,IAAI,CAACH,OAAO,EAAE;QAE3B,OAAO,IAAI,CAACG,KAAK;MACrB;MAEA,MAAMC,KAAK,iDACiC,IAAI,CAACC,IAAI,2HACpD;IACL;EAAC;EAAA;AAAA,EA1BiCC,eAAM;AAAA;AAAA,8BAA/BP,gBAAgB,UACsB,aAAa"}
1
+ {"version":3,"names":["_nanoid","require","_plugins","ApolloLinkPlugin","_Plugin","_inherits2","default","_super","_createSuper2","factory","_this","_classCallCheck2","call","cacheKey","nanoid","_createClass2","key","value","createLink","cache","Error","concat","name","Plugin","exports","_defineProperty2"],"sources":["ApolloLinkPlugin.ts"],"sourcesContent":["import { ApolloLink } from \"apollo-link\";\nimport { nanoid } from \"nanoid\";\nimport { Plugin } from \"@webiny/plugins\";\n\nexport interface ApolloLinkFactory {\n (): ApolloLink;\n}\n\nexport class ApolloLinkPlugin extends Plugin {\n public static override readonly type: string = \"apollo-link\";\n public readonly cacheKey;\n private readonly factory?: ApolloLinkFactory;\n private cache?: ApolloLink;\n\n constructor(factory?: ApolloLinkFactory) {\n super();\n this.factory = factory;\n this.cacheKey = nanoid();\n }\n\n public createLink(): ApolloLink {\n if (this.cache) {\n return this.cache;\n }\n\n if (typeof this.factory === \"function\") {\n this.cache = this.factory();\n\n return this.cache;\n }\n\n throw Error(\n `Missing ApolloLinkFactory in plugin \"${this.name}\"! Either pass a factory to ApolloLinkPlugin constructor or extend the class and override the \"createLink\" method.`\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAAyC,IAM5BE,gBAAgB,0BAAAC,OAAA;EAAA,IAAAC,UAAA,CAAAC,OAAA,EAAAH,gBAAA,EAAAC,OAAA;EAAA,IAAAG,MAAA,OAAAC,aAAA,CAAAF,OAAA,EAAAH,gBAAA;EAMzB,SAAAA,iBAAYM,OAA2B,EAAE;IAAA,IAAAC,KAAA;IAAA,IAAAC,gBAAA,CAAAL,OAAA,QAAAH,gBAAA;IACrCO,KAAA,GAAAH,MAAA,CAAAK,IAAA;IACAF,KAAA,CAAKD,OAAO,GAAGA,OAAO;IACtBC,KAAA,CAAKG,QAAQ,GAAG,IAAAC,cAAM,EAAC,CAAC;IAAC,OAAAJ,KAAA;EAC7B;EAAC,IAAAK,aAAA,CAAAT,OAAA,EAAAH,gBAAA;IAAAa,GAAA;IAAAC,KAAA,EAED,SAAAC,WAAA,EAAgC;MAC5B,IAAI,IAAI,CAACC,KAAK,EAAE;QACZ,OAAO,IAAI,CAACA,KAAK;MACrB;MAEA,IAAI,OAAO,IAAI,CAACV,OAAO,KAAK,UAAU,EAAE;QACpC,IAAI,CAACU,KAAK,GAAG,IAAI,CAACV,OAAO,CAAC,CAAC;QAE3B,OAAO,IAAI,CAACU,KAAK;MACrB;MAEA,MAAMC,KAAK,0CAAAC,MAAA,CACiC,IAAI,CAACC,IAAI,0HACrD,CAAC;IACL;EAAC;EAAA,OAAAnB,gBAAA;AAAA,EA1BiCoB,eAAM;AAAAC,OAAA,CAAArB,gBAAA,GAAAA,gBAAA;AAAA,IAAAsB,gBAAA,CAAAnB,OAAA,EAA/BH,gBAAgB,UACsB,aAAa"}
@@ -1 +1 @@
1
- {"version":3,"names":["ConsoleLinkPlugin","ApolloLink","operation","forward","firstDefinition","query","definitions","isQuery","map","data","extensions","Array","isArray","console","length","variables","JSON","stringify","groupCollapsed","operationName","forEach","log","method","args","groupEnd","ApolloLinkPlugin"],"sources":["ConsoleLinkPlugin.ts"],"sourcesContent":["import { ApolloLink, FetchResult as BaseFetchResult } from \"apollo-link\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\nimport { OperationDefinitionNode } from \"graphql/language/ast\";\n\ninterface Log {\n args: any[];\n method: \"error\" | \"info\" | \"log\" | \"warn\";\n}\n\ninterface FetchResult extends BaseFetchResult {\n extensions?: {\n console?: Log[];\n };\n}\n\n/**\n * This link checks for presence of `extensions.console` in the response and logs all items to browser console.\n */\nexport class ConsoleLinkPlugin extends ApolloLinkPlugin {\n public override createLink() {\n return new ApolloLink((operation, forward) => {\n const firstDefinition = operation.query.definitions[0] as OperationDefinitionNode;\n const isQuery = firstDefinition[\"operation\"] === \"query\";\n\n return forward(operation).map((data: FetchResult) => {\n if (\n data.extensions &&\n Array.isArray(data.extensions.console) &&\n data.extensions.console.length\n ) {\n const variables = isQuery\n ? JSON.stringify(operation.variables)\n : \"{ see request details in the Network tab }\";\n console.groupCollapsed(\n `Logs for graphQL ${isQuery ? \"query\" : \"mutation\"}: %c${\n operation.operationName || \"anonymous operation\"\n } %c${variables}%c`,\n \"color: #fa5a28\",\n \"color: #6b6b6b\",\n \"color: black\"\n );\n data.extensions.console.forEach((log: Log) => {\n console[log.method](...log.args);\n });\n console.groupEnd();\n }\n\n return data;\n });\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA;AACA;AAcA;AACA;AACA;AAFA,IAGaA,iBAAiB;EAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA,OAC1B,sBAA6B;MACzB,OAAO,IAAIC,sBAAU,CAAC,UAACC,SAAS,EAAEC,OAAO,EAAK;QAC1C,IAAMC,eAAe,GAAGF,SAAS,CAACG,KAAK,CAACC,WAAW,CAAC,CAAC,CAA4B;QACjF,IAAMC,OAAO,GAAGH,eAAe,CAAC,WAAW,CAAC,KAAK,OAAO;QAExD,OAAOD,OAAO,CAACD,SAAS,CAAC,CAACM,GAAG,CAAC,UAACC,IAAiB,EAAK;UACjD,IACIA,IAAI,CAACC,UAAU,IACfC,KAAK,CAACC,OAAO,CAACH,IAAI,CAACC,UAAU,CAACG,OAAO,CAAC,IACtCJ,IAAI,CAACC,UAAU,CAACG,OAAO,CAACC,MAAM,EAChC;YACE,IAAMC,SAAS,GAAGR,OAAO,GACnBS,IAAI,CAACC,SAAS,CAACf,SAAS,CAACa,SAAS,CAAC,GACnC,4CAA4C;YAClDF,OAAO,CAACK,cAAc,4BACEX,OAAO,GAAG,OAAO,GAAG,UAAU,iBAC9CL,SAAS,CAACiB,aAAa,IAAI,qBAAqB,gBAC9CJ,SAAS,SACf,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,CACjB;YACDN,IAAI,CAACC,UAAU,CAACG,OAAO,CAACO,OAAO,CAAC,UAACC,GAAQ,EAAK;cAAA;cAC1C,YAAAR,OAAO,EAACQ,GAAG,CAACC,MAAM,CAAC,kDAAID,GAAG,CAACE,IAAI,EAAC;YACpC,CAAC,CAAC;YACFV,OAAO,CAACW,QAAQ,EAAE;UACtB;UAEA,OAAOf,IAAI;QACf,CAAC,CAAC;MACN,CAAC,CAAC;IACN;EAAC;EAAA;AAAA,EAhCkCgB,mCAAgB;AAAA"}
1
+ {"version":3,"names":["_apolloLink","require","_ApolloLinkPlugin2","ConsoleLinkPlugin","_ApolloLinkPlugin","_inherits2","default","_super","_createSuper2","_classCallCheck2","apply","arguments","_createClass2","key","value","createLink","ApolloLink","operation","forward","firstDefinition","query","definitions","isQuery","map","data","extensions","Array","isArray","console","length","variables","JSON","stringify","groupCollapsed","concat","operationName","forEach","log","_console","method","_toConsumableArray2","args","groupEnd","ApolloLinkPlugin","exports"],"sources":["ConsoleLinkPlugin.ts"],"sourcesContent":["import { ApolloLink, FetchResult as BaseFetchResult } from \"apollo-link\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\nimport { OperationDefinitionNode } from \"graphql/language/ast\";\n\ninterface Log {\n args: any[];\n method: \"error\" | \"info\" | \"log\" | \"warn\";\n}\n\ninterface FetchResult extends BaseFetchResult {\n extensions?: {\n console?: Log[];\n };\n}\n\n/**\n * This link checks for presence of `extensions.console` in the response and logs all items to browser console.\n */\nexport class ConsoleLinkPlugin extends ApolloLinkPlugin {\n public override createLink() {\n return new ApolloLink((operation, forward) => {\n const firstDefinition = operation.query.definitions[0] as OperationDefinitionNode;\n const isQuery = firstDefinition[\"operation\"] === \"query\";\n\n return forward(operation).map((data: FetchResult) => {\n if (\n data.extensions &&\n Array.isArray(data.extensions.console) &&\n data.extensions.console.length\n ) {\n const variables = isQuery\n ? JSON.stringify(operation.variables)\n : \"{ see request details in the Network tab }\";\n console.groupCollapsed(\n `Logs for graphQL ${isQuery ? \"query\" : \"mutation\"}: %c${\n operation.operationName || \"anonymous operation\"\n } %c${variables}%c`,\n \"color: #fa5a28\",\n \"color: #6b6b6b\",\n \"color: black\"\n );\n data.extensions.console.forEach((log: Log) => {\n console[log.method](...log.args);\n });\n console.groupEnd();\n }\n\n return data;\n });\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAcA;AACA;AACA;AAFA,IAGaE,iBAAiB,0BAAAC,iBAAA;EAAA,IAAAC,UAAA,CAAAC,OAAA,EAAAH,iBAAA,EAAAC,iBAAA;EAAA,IAAAG,MAAA,OAAAC,aAAA,CAAAF,OAAA,EAAAH,iBAAA;EAAA,SAAAA,kBAAA;IAAA,IAAAM,gBAAA,CAAAH,OAAA,QAAAH,iBAAA;IAAA,OAAAI,MAAA,CAAAG,KAAA,OAAAC,SAAA;EAAA;EAAA,IAAAC,aAAA,CAAAN,OAAA,EAAAH,iBAA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AAzC,iBAAA,GAAAA,iBAAA"}
@@ -8,10 +8,8 @@ exports.LocaleHeaderLinkPlugin = void 0;
8
8
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
9
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
10
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
12
11
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
12
  var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
14
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
13
  var _apolloLinkContext = require("apollo-link-context");
16
14
  var _ApolloLinkPlugin2 = require("./ApolloLinkPlugin");
17
15
  var _utils = require("../utils");
@@ -25,7 +23,6 @@ var LocaleHeaderLinkPlugin = /*#__PURE__*/function (_ApolloLinkPlugin) {
25
23
  var _this;
26
24
  (0, _classCallCheck2.default)(this, LocaleHeaderLinkPlugin);
27
25
  _this = _super.call(this);
28
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "locale", void 0);
29
26
  _this.locale = locale || (0, _utils.getLocaleCode)();
30
27
  return _this;
31
28
  }
@@ -1 +1 @@
1
- {"version":3,"names":["LocaleHeaderLinkPlugin","locale","getLocaleCode","setContext","_","headers","ApolloLinkPlugin"],"sources":["LocaleHeaderLinkPlugin.ts"],"sourcesContent":["import { setContext } from \"apollo-link-context\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\nimport { ApolloLink } from \"apollo-link\";\nimport { getLocaleCode } from \"~/utils\";\n\n/**\n * Append `x-i18n-locale` header from URL query (necessary for prerendering service).\n */\nexport class LocaleHeaderLinkPlugin extends ApolloLinkPlugin {\n private readonly locale: string;\n\n constructor(locale?: string) {\n super();\n\n this.locale = locale || (getLocaleCode() as string);\n }\n\n public override createLink(): ApolloLink {\n return setContext((_, { headers }) => {\n if (this.locale) {\n return {\n headers: {\n ...headers,\n \"x-i18n-locale\": `content:${this.locale};`\n }\n };\n }\n\n return { headers };\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AACA;AAEA;AAEA;AACA;AACA;AAFA,IAGaA,sBAAsB;EAAA;EAAA;EAG/B,gCAAYC,MAAe,EAAE;IAAA;IAAA;IACzB;IAAQ;IAER,MAAKA,MAAM,GAAGA,MAAM,IAAK,IAAAC,oBAAa,GAAa;IAAC;EACxD;EAAC;IAAA;IAAA,OAED,sBAAyC;MAAA;MACrC,OAAO,IAAAC,6BAAU,EAAC,UAACC,CAAC,QAAkB;QAAA,IAAdC,OAAO,QAAPA,OAAO;QAC3B,IAAI,MAAI,CAACJ,MAAM,EAAE;UACb,OAAO;YACHI,OAAO,8DACAA,OAAO;cACV,eAAe,oBAAa,MAAI,CAACJ,MAAM;YAAG;UAElD,CAAC;QACL;QAEA,OAAO;UAAEI,OAAO,EAAPA;QAAQ,CAAC;MACtB,CAAC,CAAC;IACN;EAAC;EAAA;AAAA,EAtBuCC,mCAAgB;AAAA"}
1
+ {"version":3,"names":["_apolloLinkContext","require","_ApolloLinkPlugin2","_utils","LocaleHeaderLinkPlugin","_ApolloLinkPlugin","_inherits2","default","_super","_createSuper2","locale","_this","_classCallCheck2","call","getLocaleCode","_createClass2","key","value","createLink","_this2","setContext","_","_ref","headers","_objectSpread2","concat","ApolloLinkPlugin","exports"],"sources":["LocaleHeaderLinkPlugin.ts"],"sourcesContent":["import { setContext } from \"apollo-link-context\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\nimport { ApolloLink } from \"apollo-link\";\nimport { getLocaleCode } from \"~/utils\";\n\n/**\n * Append `x-i18n-locale` header from URL query (necessary for prerendering service).\n */\nexport class LocaleHeaderLinkPlugin extends ApolloLinkPlugin {\n private readonly locale: string;\n\n constructor(locale?: string) {\n super();\n\n this.locale = locale || (getLocaleCode() as string);\n }\n\n public override createLink(): ApolloLink {\n return setContext((_, { headers }) => {\n if (this.locale) {\n return {\n headers: {\n ...headers,\n \"x-i18n-locale\": `content:${this.locale};`\n }\n };\n }\n\n return { headers };\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAEA;AACA;AACA;AAFA,IAGaG,sBAAsB,0BAAAC,iBAAA;EAAA,IAAAC,UAAA,CAAAC,OAAA,EAAAH,sBAAA,EAAAC,iBAAA;EAAA,IAAAG,MAAA,OAAAC,aAAA,CAAAF,OAAA,EAAAH,sBAAA;EAG/B,SAAAA,uBAAYM,MAAe,EAAE;IAAA,IAAAC,KAAA;IAAA,IAAAC,gBAAA,CAAAL,OAAA,QAAAH,sBAAA;IACzBO,KAAA,GAAAH,MAAA,CAAAK,IAAA;IAEAF,KAAA,CAAKD,MAAM,GAAGA,MAAM,IAAK,IAAAI,oBAAa,EAAC,CAAY;IAAC,OAAAH,KAAA;EACxD;EAAC,IAAAI,aAAA,CAAAR,OAAA,EAAAH,sBAAA;IAAAY,GAAA;IAAAC,KAAA,EAED,SAAAC,WAAA,EAAyC;MAAA,IAAAC,MAAA;MACrC,OAAO,IAAAC,6BAAU,EAAC,UAACC,CAAC,EAAAC,IAAA,EAAkB;QAAA,IAAdC,OAAO,GAAAD,IAAA,CAAPC,OAAO;QAC3B,IAAIJ,MAAI,CAACT,MAAM,EAAE;UACb,OAAO;YACHa,OAAO,MAAAC,cAAA,CAAAjB,OAAA,MAAAiB,cAAA,CAAAjB,OAAA,MACAgB,OAAO;cACV,eAAe,aAAAE,MAAA,CAAaN,MAAI,CAACT,MAAM;YAAG;UAElD,CAAC;QACL;QAEA,OAAO;UAAEa,OAAO,EAAPA;QAAQ,CAAC;MACtB,CAAC,CAAC;IACN;EAAC;EAAA,OAAAnB,sBAAA;AAAA,EAtBuCsB,mCAAgB;AAAAC,OAAA,CAAAvB,sBAAA,GAAAA,sBAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":["t","i18n","ns","ENVIRONMENT_VARIABLES_ARTICLE_LINK","ErrorOverlay","props","query","networkError","useState","open","setOpen","console","error","stackTrace","get","message","link"],"sources":["ErrorOverlay.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport get from \"lodash/get\";\nimport { IconButton } from \"@webiny/ui/Button\";\nimport { Typography } from \"@webiny/ui/Typography\";\nimport { i18n } from \"../../i18n\";\nimport { OverlayWrapper, Pre } from \"./StyledComponents\";\nimport { ReactComponent as CloseIcon } from \"./assets/close_24px.svg\";\n\nconst t = i18n.ns(\"app/graphql/error-overlay\");\n\nconst ENVIRONMENT_VARIABLES_ARTICLE_LINK =\n \"https://www.webiny.com/docs/how-to-guides/environment-variables\";\n\ninterface ErrorOverlayProps {\n query: string;\n networkError: {\n message: string;\n result?: {\n error?: {\n stack?: string;\n };\n };\n };\n}\nconst ErrorOverlay: React.FC<ErrorOverlayProps> = props => {\n const { query, networkError } = props;\n const [open, setOpen] = useState(true);\n // Log error in browser's developer console for further inspection.\n console.error({ networkError });\n\n if (!open) {\n return null;\n }\n\n const stackTrace = get(networkError, \"result.error.stack\");\n\n return (\n <OverlayWrapper>\n <div className=\"inner\">\n <div className=\"header\">\n <div className=\"header__title\">\n <Typography use={\"headline4\"}>{networkError.message}</Typography>\n </div>\n <div className=\"header__action\">\n <IconButton icon={<CloseIcon />} onClick={() => setOpen(false)} />\n </div>\n </div>\n <div className=\"body\">\n <div className=\"body__summary\">\n <Typography\n use={\"subtitle1\"}\n >{t`Error occurred while executing operation:`}</Typography>\n <Pre>\n <code>{query}</code>\n </Pre>\n </div>\n {stackTrace && (\n <div className=\"body__description\">\n <Typography use={\"subtitle1\"}>{t`Complete stack trace:`}</Typography>\n <Pre>\n <code>{stackTrace}</code>\n </Pre>\n </div>\n )}\n </div>\n <div className=\"footer\">\n <Typography use={\"body2\"}>\n {t`\n This screen is only visible if {message} environment variable is set.\n Read more about it in the {link}. `({\n message: <span className={\"highlight\"}>`REACT_APP_DEBUG=true`</span>,\n link: (\n <a\n href={ENVIRONMENT_VARIABLES_ARTICLE_LINK}\n target={\"_blank\"}\n rel={\"noreferrer noopener\"}\n >\n environment variables article\n </a>\n )\n })}\n <br />\n {t`Open your browser's developer console to further inspect this error.`}\n </Typography>\n </div>\n </div>\n </OverlayWrapper>\n );\n};\n\nexport default ErrorOverlay;\n"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAsE;AAEtE,IAAMA,CAAC,GAAGC,UAAI,CAACC,EAAE,CAAC,2BAA2B,CAAC;AAE9C,IAAMC,kCAAkC,GACpC,iEAAiE;AAarE,IAAMC,YAAyC,GAAG,SAA5CA,YAAyC,CAAGC,KAAK,EAAI;EACvD,IAAQC,KAAK,GAAmBD,KAAK,CAA7BC,KAAK;IAAEC,YAAY,GAAKF,KAAK,CAAtBE,YAAY;EAC3B,gBAAwB,IAAAC,eAAQ,EAAC,IAAI,CAAC;IAAA;IAA/BC,IAAI;IAAEC,OAAO;EACpB;EACAC,OAAO,CAACC,KAAK,CAAC;IAAEL,YAAY,EAAZA;EAAa,CAAC,CAAC;EAE/B,IAAI,CAACE,IAAI,EAAE;IACP,OAAO,IAAI;EACf;EAEA,IAAMI,UAAU,GAAG,IAAAC,YAAG,EAACP,YAAY,EAAE,oBAAoB,CAAC;EAE1D,oBACI,6BAAC,gCAAc,qBACX;IAAK,SAAS,EAAC;EAAO,gBAClB;IAAK,SAAS,EAAC;EAAQ,gBACnB;IAAK,SAAS,EAAC;EAAe,gBAC1B,6BAAC,sBAAU;IAAC,GAAG,EAAE;EAAY,GAAEA,YAAY,CAACQ,OAAO,CAAc,CAC/D,eACN;IAAK,SAAS,EAAC;EAAgB,gBAC3B,6BAAC,kBAAU;IAAC,IAAI,eAAE,6BAAC,0BAAS,OAAI;IAAC,OAAO,EAAE;MAAA,OAAML,OAAO,CAAC,KAAK,CAAC;IAAA;EAAC,EAAG,CAChE,CACJ,eACN;IAAK,SAAS,EAAC;EAAM,gBACjB;IAAK,SAAS,EAAC;EAAe,gBAC1B,6BAAC,sBAAU;IACP,GAAG,EAAE;EAAY,GACnBV,CAAC,6HAAyD,eAC5D,6BAAC,qBAAG,qBACA,2CAAOM,KAAK,CAAQ,CAClB,CACJ,EACLO,UAAU,iBACP;IAAK,SAAS,EAAC;EAAmB,gBAC9B,6BAAC,sBAAU;IAAC,GAAG,EAAE;EAAY,GAAEb,CAAC,2GAAqC,eACrE,6BAAC,qBAAG,qBACA,2CAAOa,UAAU,CAAQ,CACvB,CAEb,CACC,eACN;IAAK,SAAS,EAAC;EAAQ,gBACnB,6BAAC,sBAAU;IAAC,GAAG,EAAE;EAAQ,GACpBb,CAAC,iPAEkC;IAChCe,OAAO,eAAE;MAAM,SAAS,EAAE;IAAY,GAAC,wBAAsB,CAAO;IACpEC,IAAI,eACA;MACI,IAAI,EAAEb,kCAAmC;MACzC,MAAM,EAAE,QAAS;MACjB,GAAG,EAAE;IAAsB,GAC9B,+BAED;EAER,CAAC,CAAC,eACF,wCAAM,EACLH,CAAC,0JACO,CACX,CACJ,CACO;AAEzB,CAAC;AAAC,eAEaI,YAAY;AAAA"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_get","_interopRequireDefault","_Button","_Typography","_i18n","_StyledComponents","_close_24px","_templateObject","_templateObject2","_templateObject3","_templateObject4","t","i18n","ns","ENVIRONMENT_VARIABLES_ARTICLE_LINK","ErrorOverlay","props","query","networkError","_useState","useState","_useState2","_slicedToArray2","default","open","setOpen","console","error","stackTrace","get","createElement","OverlayWrapper","className","Typography","use","message","IconButton","icon","ReactComponent","onClick","_taggedTemplateLiteral2","Pre","link","href","target","rel","_default","exports"],"sources":["ErrorOverlay.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport get from \"lodash/get\";\nimport { IconButton } from \"@webiny/ui/Button\";\nimport { Typography } from \"@webiny/ui/Typography\";\nimport { i18n } from \"../../i18n\";\nimport { OverlayWrapper, Pre } from \"./StyledComponents\";\nimport { ReactComponent as CloseIcon } from \"./assets/close_24px.svg\";\n\nconst t = i18n.ns(\"app/graphql/error-overlay\");\n\nconst ENVIRONMENT_VARIABLES_ARTICLE_LINK =\n \"https://www.webiny.com/docs/how-to-guides/environment-variables\";\n\ninterface ErrorOverlayProps {\n query: string;\n networkError: {\n message: string;\n result?: {\n error?: {\n stack?: string;\n };\n };\n };\n}\nconst ErrorOverlay: React.FC<ErrorOverlayProps> = props => {\n const { query, networkError } = props;\n const [open, setOpen] = useState(true);\n // Log error in browser's developer console for further inspection.\n console.error({ networkError });\n\n if (!open) {\n return null;\n }\n\n const stackTrace = get(networkError, \"result.error.stack\");\n\n return (\n <OverlayWrapper>\n <div className=\"inner\">\n <div className=\"header\">\n <div className=\"header__title\">\n <Typography use={\"headline4\"}>{networkError.message}</Typography>\n </div>\n <div className=\"header__action\">\n <IconButton icon={<CloseIcon />} onClick={() => setOpen(false)} />\n </div>\n </div>\n <div className=\"body\">\n <div className=\"body__summary\">\n <Typography\n use={\"subtitle1\"}\n >{t`Error occurred while executing operation:`}</Typography>\n <Pre>\n <code>{query}</code>\n </Pre>\n </div>\n {stackTrace && (\n <div className=\"body__description\">\n <Typography use={\"subtitle1\"}>{t`Complete stack trace:`}</Typography>\n <Pre>\n <code>{stackTrace}</code>\n </Pre>\n </div>\n )}\n </div>\n <div className=\"footer\">\n <Typography use={\"body2\"}>\n {t`\n This screen is only visible if {message} environment variable is set.\n Read more about it in the {link}. `({\n message: <span className={\"highlight\"}>`REACT_APP_DEBUG=true`</span>,\n link: (\n <a\n href={ENVIRONMENT_VARIABLES_ARTICLE_LINK}\n target={\"_blank\"}\n rel={\"noreferrer noopener\"}\n >\n environment variables article\n </a>\n )\n })}\n <br />\n {t`Open your browser's developer console to further inspect this error.`}\n </Typography>\n </div>\n </div>\n </OverlayWrapper>\n );\n};\n\nexport default ErrorOverlay;\n"],"mappings":";;;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AA,CAAAO,aAAA,CAACzB,iBAAA,CAAAoC,GAAG,qBACA5C,MAAA,CAAA0B,OAAA,CAAAO,aAAA,eAAOF,UAAiB,CACvB,CACJ,CAER,CAAC,eACN/B,MAAA,CAAA0B,OAAA,CAAAO,aAAA;IAAKE,SAAS,EAAC;EAAQ,gBACnBnC,MAAA,CAAA0B,OAAA,CAAAO,aAAA,CAAC3B,WAAA,CAAA8B,UAAU;IAACC,GAAG,EAAE;EAAQ,GACpBvB,CAAC,CAAAF,gBAAA,KAAAA,gBAAA,OAAA+B,uBAAA,CAAAjB,OAAA,qKAEkC;IAChCY,OAAO,eAAEtC,MAAA,CAAA0B,OAAA,CAAAO,aAAA;MAAME,SAAS,EAAE;IAAY,GAAC,wBAA4B,CAAC;IACpEU,IAAI,eACA7C,MAAA,CAAA0B,OAAA,CAAAO,aAAA;MACIa,IAAI,EAAE7B,kCAAmC;MACzC8B,MAAM,EAAE,QAAS;MACjBC,GAAG,EAAE;IAAsB,GAC9B,+BAEE;EAEX,CAAC,CAAC,eACFhD,MAAA,CAAA0B,OAAA,CAAAO,aAAA,WAAK,CAAC,EACLnB,CAAC,CAAAD,gBAAA,KAAAA,gBAAA,OAAA8B,uBAAA,CAAAjB,OAAA,6EACM,CACX,CACJ,CACO,CAAC;AAEzB,CAAC;AAAC,IAAAuB,QAAA,GAEa/B,YAAY;AAAAgC,OAAA,CAAAxB,OAAA,GAAAuB,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":["OverlayWrapper","styled","Pre"],"sources":["StyledComponents.tsx"],"sourcesContent":["import styled from \"@emotion/styled\";\n\nexport const OverlayWrapper = styled(\"div\")(`\n width: 100vw;\n height: 100vh;\n position: fixed;\n top: 0;\n left: 0;\n z-index: 105; // The highest z-index value is 100 for Dialogs\n \n .inner {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n overflow: auto;\n background-color: white;\n padding: 1rem;\n }\n \n .header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 1rem;\n .header__title {\n color: var(--mdc-theme-error);\n }\n }\n \n .body {\n flex-grow: 1;\n .body__summary {\n margin-bottom: 1rem;\n }\n }\n \n .footer {\n color: var(--mdc-theme-text-secondary-on-background);\n \n .highlight {\n background-color: rgba(251, 245, 180, 0.5);\n padding: 0 4px;\n border-radius: 6px;\n font-family: monospace;\n }\n }\n`);\n\nexport const Pre = styled(\"pre\")(`\n position: relative;\n display: block;\n padding: 0.5em;\n margin-top: 0.5em;\n margin-bottom: 0.5em;\n overflow-x: auto;\n white-space: pre-wrap;\n border-radius: 0.25rem;\n background-color: rgba(251, 245, 180, 0.3);\n color: inherit;\n \n code {\n font-family: monospace;\n font-size: 0.85rem;\n line-height: 1rem;\n }\n`);\n"],"mappings":";;;;;;;AAAA;AAEO,IAAMA,cAAc,oBAAGC,eAAM,EAAC,KAAK;EAAA;EAAA;AAAA,4hCA8CxC;AAAC;AAEI,IAAMC,GAAG,oBAAGD,eAAM,EAAC,KAAK;EAAA;EAAA;AAAA,uYAiB7B;AAAC"}
1
+ {"version":3,"names":["_styled","_interopRequireDefault","require","OverlayWrapper","styled","target","label","exports","Pre"],"sources":["StyledComponents.tsx"],"sourcesContent":["import styled from \"@emotion/styled\";\n\nexport const OverlayWrapper = styled(\"div\")(`\n width: 100vw;\n height: 100vh;\n position: fixed;\n top: 0;\n left: 0;\n z-index: 105; // The highest z-index value is 100 for Dialogs\n \n .inner {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n overflow: auto;\n background-color: white;\n padding: 1rem;\n }\n \n .header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 1rem;\n .header__title {\n color: var(--mdc-theme-error);\n }\n }\n \n .body {\n flex-grow: 1;\n .body__summary {\n margin-bottom: 1rem;\n }\n }\n \n .footer {\n color: var(--mdc-theme-text-secondary-on-background);\n \n .highlight {\n background-color: rgba(251, 245, 180, 0.5);\n padding: 0 4px;\n border-radius: 6px;\n font-family: monospace;\n }\n }\n`);\n\nexport const Pre = styled(\"pre\")(`\n position: relative;\n display: block;\n padding: 0.5em;\n margin-top: 0.5em;\n margin-bottom: 0.5em;\n overflow-x: auto;\n white-space: pre-wrap;\n border-radius: 0.25rem;\n background-color: rgba(251, 245, 180, 0.3);\n color: inherit;\n \n code {\n font-family: monospace;\n font-size: 0.85rem;\n line-height: 1rem;\n }\n`);\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEO,IAAMC,cAAc,oBAAGC,eAAM,EAAC,KAAK;EAAAC,MAAA;EAAAC,KAAA;AAAA,4hCA8CxC;AAACC,OAAA,CAAAJ,cAAA,GAAAA,cAAA;AAEI,IAAMK,GAAG,oBAAGJ,eAAM,EAAC,KAAK;EAAAC,MAAA;EAAAC,KAAA;AAAA,uYAiB7B;AAACC,OAAA,CAAAC,GAAA,GAAAA,GAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":["createErrorOverlay","params","query","networkError","document","getElementById","container","createElement","id","body","getElementsByTagName","appendChild","render"],"sources":["createErrorOverlay.tsx"],"sourcesContent":["import React from \"react\";\nimport { render } from \"react-dom\";\nimport ErrorOverlay from \"./ErrorOverlay\";\nimport { ServerError, ServerParseError } from \"apollo-link-http-common\";\n\ninterface CreateErrorOverlayParams {\n query: string;\n networkError: Error | ServerError | ServerParseError;\n}\nconst createErrorOverlay = (params: CreateErrorOverlayParams): void => {\n const { query, networkError } = params;\n // If the element already present in DOM, return immediately.\n if (document.getElementById(\"overlay-root\")) {\n return;\n }\n // Create root element to hold React tree.\n const container: HTMLDivElement = document.createElement(\"div\");\n container.id = \"overlay-root\";\n // Insert root element into body.\n const body: HTMLBodyElement = document.getElementsByTagName(\"body\")[0];\n body.appendChild(container);\n // Mount the ErrorOverlay component into root element.\n render(<ErrorOverlay query={query} networkError={networkError} />, container);\n};\n\nexport default createErrorOverlay;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAOA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAkB,CAAIC,MAAgC,EAAW;EACnE,IAAQC,KAAK,GAAmBD,MAAM,CAA9BC,KAAK;IAAEC,YAAY,GAAKF,MAAM,CAAvBE,YAAY;EAC3B;EACA,IAAIC,QAAQ,CAACC,cAAc,CAAC,cAAc,CAAC,EAAE;IACzC;EACJ;EACA;EACA,IAAMC,SAAyB,GAAGF,QAAQ,CAACG,aAAa,CAAC,KAAK,CAAC;EAC/DD,SAAS,CAACE,EAAE,GAAG,cAAc;EAC7B;EACA,IAAMC,IAAqB,GAAGL,QAAQ,CAACM,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;EACtED,IAAI,CAACE,WAAW,CAACL,SAAS,CAAC;EAC3B;EACA,IAAAM,gBAAM,gBAAC,6BAAC,qBAAY;IAAC,KAAK,EAAEV,KAAM;IAAC,YAAY,EAAEC;EAAa,EAAG,EAAEG,SAAS,CAAC;AACjF,CAAC;AAAC,eAEaN,kBAAkB;AAAA"}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactDom","_ErrorOverlay","createErrorOverlay","params","query","networkError","document","getElementById","container","createElement","id","body","getElementsByTagName","appendChild","render","default","_default","exports"],"sources":["createErrorOverlay.tsx"],"sourcesContent":["import React from \"react\";\nimport { render } from \"react-dom\";\nimport ErrorOverlay from \"./ErrorOverlay\";\nimport { ServerError, ServerParseError } from \"apollo-link-http-common\";\n\ninterface CreateErrorOverlayParams {\n query: string;\n networkError: Error | ServerError | ServerParseError;\n}\nconst createErrorOverlay = (params: CreateErrorOverlayParams): void => {\n const { query, networkError } = params;\n // If the element already present in DOM, return immediately.\n if (document.getElementById(\"overlay-root\")) {\n return;\n }\n // Create root element to hold React tree.\n const container: HTMLDivElement = document.createElement(\"div\");\n container.id = \"overlay-root\";\n // Insert root element into body.\n const body: HTMLBodyElement = document.getElementsByTagName(\"body\")[0];\n body.appendChild(container);\n // Mount the ErrorOverlay component into root element.\n render(<ErrorOverlay query={query} networkError={networkError} />, container);\n};\n\nexport default createErrorOverlay;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAH,sBAAA,CAAAC,OAAA;AAOA,IAAMG,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAIC,MAAgC,EAAW;EACnE,IAAQC,KAAK,GAAmBD,MAAM,CAA9BC,KAAK;IAAEC,YAAY,GAAKF,MAAM,CAAvBE,YAAY;EAC3B;EACA,IAAIC,QAAQ,CAACC,cAAc,CAAC,cAAc,CAAC,EAAE;IACzC;EACJ;EACA;EACA,IAAMC,SAAyB,GAAGF,QAAQ,CAACG,aAAa,CAAC,KAAK,CAAC;EAC/DD,SAAS,CAACE,EAAE,GAAG,cAAc;EAC7B;EACA,IAAMC,IAAqB,GAAGL,QAAQ,CAACM,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;EACtED,IAAI,CAACE,WAAW,CAACL,SAAS,CAAC;EAC3B;EACA,IAAAM,gBAAM,gBAACjB,MAAA,CAAAkB,OAAA,CAAAN,aAAA,CAACR,aAAA,CAAAc,OAAY;IAACX,KAAK,EAAEA,KAAM;IAACC,YAAY,EAAEA;EAAa,CAAE,CAAC,EAAEG,SAAS,CAAC;AACjF,CAAC;AAAC,IAAAQ,QAAA,GAEad,kBAAkB;AAAAe,OAAA,CAAAF,OAAA,GAAAC,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":["NetworkErrorLinkPlugin","onError","networkError","operation","debug","appConfig","getKey","boolean","process","env","REACT_APP_DEBUG","createErrorOverlay","query","print","ApolloLinkPlugin"],"sources":["NetworkErrorLinkPlugin.ts"],"sourcesContent":["import { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\nimport { onError } from \"apollo-link-error\";\nimport { print } from \"graphql/language\";\nimport createErrorOverlay from \"./NetworkErrorLinkPlugin/createErrorOverlay\";\nimport { boolean } from \"boolean\";\nimport { config as appConfig } from \"~/config\";\n\n/**\n * This plugin creates an ApolloLink that checks for `NetworkError` and shows an ErrorOverlay in the browser.\n */\nexport class NetworkErrorLinkPlugin extends ApolloLinkPlugin {\n public override createLink() {\n return onError(({ networkError, operation }) => {\n const debug = appConfig.getKey(\"DEBUG\", boolean(process.env.REACT_APP_DEBUG));\n\n if (networkError && debug) {\n createErrorOverlay({ query: print(operation.query), networkError });\n }\n\n // TODO: also print graphQLErrors\n });\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAFA,IAGaA,sBAAsB;EAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA,OAC/B,sBAA6B;MACzB,OAAO,IAAAC,wBAAO,EAAC,gBAAiC;QAAA,IAA9BC,YAAY,QAAZA,YAAY;UAAEC,SAAS,QAATA,SAAS;QACrC,IAAMC,KAAK,GAAGC,cAAS,CAACC,MAAM,CAAC,OAAO,EAAE,IAAAC,gBAAO,EAACC,OAAO,CAACC,GAAG,CAACC,eAAe,CAAC,CAAC;QAE7E,IAAIR,YAAY,IAAIE,KAAK,EAAE;UACvB,IAAAO,2BAAkB,EAAC;YAAEC,KAAK,EAAE,IAAAC,eAAK,EAACV,SAAS,CAACS,KAAK,CAAC;YAAEV,YAAY,EAAZA;UAAa,CAAC,CAAC;QACvE;;QAEA;MACJ,CAAC,CAAC;IACN;EAAC;EAAA;AAAA,EAXuCY,mCAAgB;AAAA"}
1
+ {"version":3,"names":["_ApolloLinkPlugin2","require","_apolloLinkError","_language","_createErrorOverlay","_interopRequireDefault","_boolean","_config","NetworkErrorLinkPlugin","_ApolloLinkPlugin","_inherits2","default","_super","_createSuper2","_classCallCheck2","apply","arguments","_createClass2","key","value","createLink","onError","_ref","networkError","operation","debug","appConfig","getKey","boolean","process","env","REACT_APP_DEBUG","createErrorOverlay","query","print","ApolloLinkPlugin","exports"],"sources":["NetworkErrorLinkPlugin.ts"],"sourcesContent":["import { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\nimport { onError } from \"apollo-link-error\";\nimport { print } from \"graphql/language\";\nimport createErrorOverlay from \"./NetworkErrorLinkPlugin/createErrorOverlay\";\nimport { boolean } from \"boolean\";\nimport { config as appConfig } from \"~/config\";\n\n/**\n * This plugin creates an ApolloLink that checks for `NetworkError` and shows an ErrorOverlay in the browser.\n */\nexport class NetworkErrorLinkPlugin extends ApolloLinkPlugin {\n public override createLink() {\n return onError(({ networkError, operation }) => {\n const debug = appConfig.getKey(\"DEBUG\", boolean(process.env.REACT_APP_DEBUG));\n\n if (networkError && debug) {\n createErrorOverlay({ query: print(operation.query), networkError });\n }\n\n // TODO: also print graphQLErrors\n });\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAEA;AACA;AACA;AAFA,IAGaO,sBAAsB,0BAAAC,iBAAA;EAAA,IAAAC,UAAA,CAAAC,OAAA,EAAAH,sBAAA,EAAAC,iBAAA;EAAA,IAAAG,MAAA,OAAAC,aAAA,CAAAF,OAAA,EAAAH,sBAAA;EAAA,SAAAA,uBAAA;IAAA,IAAAM,gBAAA,CAAAH,OAAA,QAAAH,sBAAA;IAAA,OAAAI,MAAA,CAAAG,KAAA,OAAAC,SAAA;EAAA;EAAA,IAAAC,aAAA,CAAAN,OAAA,EAAAH,sBAAA;IAAAU,GAAA;IAAAC,KAAA,EAC/B,SAAAC,WAAA,EAA6B;MACzB,OAAO,IAAAC,wBAAO,EAAC,UAAAC,IAAA,EAAiC;QAAA,IAA9BC,YAAY,GAAAD,IAAA,CAAZC,YAAY;UAAEC,SAAS,GAAAF,IAAA,CAATE,SAAS;QACrC,IAAMC,KAAK,GAAGC,cAAS,CAACC,MAAM,CAAC,OAAO,EAAE,IAAAC,gBAAO,EAACC,OAAO,CAACC,GAAG,CAACC,eAAe,CAAC,CAAC;QAE7E,IAAIR,YAAY,IAAIE,KAAK,EAAE;UACvB,IAAAO,2BAAkB,EAAC;YAAEC,KAAK,EAAE,IAAAC,eAAK,EAACV,SAAS,CAACS,KAAK,CAAC;YAAEV,YAAY,EAAZA;UAAa,CAAC,CAAC;QACvE;;QAEA;MACJ,CAAC,CAAC;IACN;EAAC;EAAA,OAAAf,sBAAA;AAAA,EAXuC2B,mCAAgB;AAAAC,OAAA,CAAA5B,sBAAA,GAAAA,sBAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":["omitTypename","key","value","undefined","OmitTypenameLinkPlugin","ApolloLink","operation","forward","variables","JSON","parse","stringify","ApolloLinkPlugin"],"sources":["OmitTypenameLinkPlugin.ts"],"sourcesContent":["import { ApolloLink } from \"apollo-link\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\n\nfunction omitTypename(key: string, value: string): string | undefined {\n return key === \"__typename\" ? undefined : value;\n}\n\n/**\n * This link removes `__typename` from the variables being sent to the API.\n */\nexport class OmitTypenameLinkPlugin extends ApolloLinkPlugin {\n public override createLink(): ApolloLink {\n return new ApolloLink((operation, forward) => {\n if (operation.variables) {\n operation.variables = JSON.parse(JSON.stringify(operation.variables), omitTypename);\n }\n return forward(operation);\n });\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA;AACA;AAEA,SAASA,YAAY,CAACC,GAAW,EAAEC,KAAa,EAAsB;EAClE,OAAOD,GAAG,KAAK,YAAY,GAAGE,SAAS,GAAGD,KAAK;AACnD;;AAEA;AACA;AACA;AAFA,IAGaE,sBAAsB;EAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA,OAC/B,sBAAyC;MACrC,OAAO,IAAIC,sBAAU,CAAC,UAACC,SAAS,EAAEC,OAAO,EAAK;QAC1C,IAAID,SAAS,CAACE,SAAS,EAAE;UACrBF,SAAS,CAACE,SAAS,GAAGC,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,SAAS,CAACL,SAAS,CAACE,SAAS,CAAC,EAAER,YAAY,CAAC;QACvF;QACA,OAAOO,OAAO,CAACD,SAAS,CAAC;MAC7B,CAAC,CAAC;IACN;EAAC;EAAA;AAAA,EARuCM,mCAAgB;AAAA"}
1
+ {"version":3,"names":["_apolloLink","require","_ApolloLinkPlugin2","omitTypename","key","value","undefined","OmitTypenameLinkPlugin","_ApolloLinkPlugin","_inherits2","default","_super","_createSuper2","_classCallCheck2","apply","arguments","_createClass2","createLink","ApolloLink","operation","forward","variables","JSON","parse","stringify","ApolloLinkPlugin","exports"],"sources":["OmitTypenameLinkPlugin.ts"],"sourcesContent":["import { ApolloLink } from \"apollo-link\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\n\nfunction omitTypename(key: string, value: string): string | undefined {\n return key === \"__typename\" ? undefined : value;\n}\n\n/**\n * This link removes `__typename` from the variables being sent to the API.\n */\nexport class OmitTypenameLinkPlugin extends ApolloLinkPlugin {\n public override createLink(): ApolloLink {\n return new ApolloLink((operation, forward) => {\n if (operation.variables) {\n operation.variables = JSON.parse(JSON.stringify(operation.variables), omitTypename);\n }\n return forward(operation);\n });\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAEA,SAASE,YAAYA,CAACC,GAAW,EAAEC,KAAa,EAAsB;EAClE,OAAOD,GAAG,KAAK,YAAY,GAAGE,SAAS,GAAGD,KAAK;AACnD;;AAEA;AACA;AACA;AAFA,IAGaE,sBAAsB,0BAAAC,iBAAA;EAAA,IAAAC,UAAA,CAAAC,OAAA,EAAAH,sBAAA,EAAAC,iBAAA;EAAA,IAAAG,MAAA,OAAAC,aAAA,CAAAF,OAAA,EAAAH,sBAAA;EAAA,SAAAA,uBAAA;IAAA,IAAAM,gBAAA,CAAAH,OAAA,QAAAH,sBAAA;IAAA,OAAAI,MAAA,CAAAG,KAAA,OAAAC,SAAA;EAAA;EAAA,IAAAC,aAAA,CAAAN,OAAA,EAAAH,sBAAA;IAAAH,GAAA;IAAAC,KAAA,EAC/B,SAAAY,WAAA,EAAyC;MACrC,OAAO,IAAIC,sBAAU,CAAC,UAACC,SAAS,EAAEC,OAAO,EAAK;QAC1C,IAAID,SAAS,CAACE,SAAS,EAAE;UACrBF,SAAS,CAACE,SAAS,GAAGC,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,SAAS,CAACL,SAAS,CAACE,SAAS,CAAC,EAAElB,YAAY,CAAC;QACvF;QACA,OAAOiB,OAAO,CAACD,SAAS,CAAC;MAC7B,CAAC,CAAC;IACN;EAAC;EAAA,OAAAZ,sBAAA;AAAA,EARuCkB,mCAAgB;AAAAC,OAAA,CAAAnB,sBAAA,GAAAA,sBAAA"}
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.RoutePlugin = void 0;
8
8
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
11
10
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
12
11
  var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
13
12
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
@@ -19,7 +18,6 @@ var RoutePlugin = /*#__PURE__*/function (_Plugin) {
19
18
  var _this;
20
19
  (0, _classCallCheck2.default)(this, RoutePlugin);
21
20
  _this = _super.call(this);
22
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_config", void 0);
23
21
  _this._config = config || {};
24
22
  return _this;
25
23
  }
@@ -1 +1 @@
1
- {"version":3,"names":["RoutePlugin","config","_config","route","Plugin"],"sources":["RoutePlugin.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Plugin } from \"@webiny/plugins\";\n\ninterface Config {\n route: React.ReactElement | null;\n}\n\nexport class RoutePlugin extends Plugin {\n public static override readonly type: string = \"route\";\n private _config: Partial<Config>;\n\n constructor(config?: Config) {\n super();\n this._config = config || {};\n }\n\n get route(): Config[\"route\"] {\n if (!this._config.route) {\n return null;\n }\n return this._config.route;\n }\n}\n"],"mappings":";;;;;;;;;;;;;AACA;AAAyC,IAM5BA,WAAW;EAAA;EAAA;EAIpB,qBAAYC,MAAe,EAAE;IAAA;IAAA;IACzB;IAAQ;IACR,MAAKC,OAAO,GAAGD,MAAM,IAAI,CAAC,CAAC;IAAC;EAChC;EAAC;IAAA;IAAA,KAED,eAA6B;MACzB,IAAI,CAAC,IAAI,CAACC,OAAO,CAACC,KAAK,EAAE;QACrB,OAAO,IAAI;MACf;MACA,OAAO,IAAI,CAACD,OAAO,CAACC,KAAK;IAC7B;EAAC;EAAA;AAAA,EAd4BC,eAAM;AAAA;AAAA,8BAA1BJ,WAAW,UAC2B,OAAO"}
1
+ {"version":3,"names":["_plugins","require","RoutePlugin","_Plugin","_inherits2","default","_super","_createSuper2","config","_this","_classCallCheck2","call","_config","_createClass2","key","get","route","Plugin","exports","_defineProperty2"],"sources":["RoutePlugin.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Plugin } from \"@webiny/plugins\";\n\ninterface Config {\n route: React.ReactElement | null;\n}\n\nexport class RoutePlugin extends Plugin {\n public static override readonly type: string = \"route\";\n private _config: Partial<Config>;\n\n constructor(config?: Config) {\n super();\n this._config = config || {};\n }\n\n get route(): Config[\"route\"] {\n if (!this._config.route) {\n return null;\n }\n return this._config.route;\n }\n}\n"],"mappings":";;;;;;;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAAyC,IAM5BC,WAAW,0BAAAC,OAAA;EAAA,IAAAC,UAAA,CAAAC,OAAA,EAAAH,WAAA,EAAAC,OAAA;EAAA,IAAAG,MAAA,OAAAC,aAAA,CAAAF,OAAA,EAAAH,WAAA;EAIpB,SAAAA,YAAYM,MAAe,EAAE;IAAA,IAAAC,KAAA;IAAA,IAAAC,gBAAA,CAAAL,OAAA,QAAAH,WAAA;IACzBO,KAAA,GAAAH,MAAA,CAAAK,IAAA;IACAF,KAAA,CAAKG,OAAO,GAAGJ,MAAM,IAAI,CAAC,CAAC;IAAC,OAAAC,KAAA;EAChC;EAAC,IAAAI,aAAA,CAAAR,OAAA,EAAAH,WAAA;IAAAY,GAAA;IAAAC,GAAA,EAED,SAAAA,IAAA,EAA6B;MACzB,IAAI,CAAC,IAAI,CAACH,OAAO,CAACI,KAAK,EAAE;QACrB,OAAO,IAAI;MACf;MACA,OAAO,IAAI,CAACJ,OAAO,CAACI,KAAK;IAC7B;EAAC;EAAA,OAAAd,WAAA;AAAA,EAd4Be,eAAM;AAAAC,OAAA,CAAAhB,WAAA,GAAAA,WAAA;AAAA,IAAAiB,gBAAA,CAAAd,OAAA,EAA1BH,WAAW,UAC2B,OAAO"}
@@ -8,10 +8,8 @@ exports.TenantHeaderLinkPlugin = void 0;
8
8
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
9
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
10
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
12
11
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
12
  var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
14
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
13
  var _apolloLinkContext = require("apollo-link-context");
16
14
  var _ApolloLinkPlugin2 = require("./ApolloLinkPlugin");
17
15
  var _utils = require("../utils");
@@ -25,7 +23,6 @@ var TenantHeaderLinkPlugin = /*#__PURE__*/function (_ApolloLinkPlugin) {
25
23
  var _this;
26
24
  (0, _classCallCheck2.default)(this, TenantHeaderLinkPlugin);
27
25
  _this = _super.call(this);
28
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "tenant", void 0);
29
26
  _this.name = "tenant-header-link";
30
27
  _this.tenant = tenant || (0, _utils.getTenantId)();
31
28
  return _this;
@@ -1 +1 @@
1
- {"version":3,"names":["TenantHeaderLinkPlugin","tenant","name","getTenantId","setContext","_","headers","ApolloLinkPlugin"],"sources":["TenantHeaderLinkPlugin.ts"],"sourcesContent":["import { setContext } from \"apollo-link-context\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\nimport { ApolloLink } from \"apollo-link\";\nimport { getTenantId } from \"~/utils\";\n\n/**\n * Append `x-tenant` header from URL query (necessary for prerendering service).\n */\nexport class TenantHeaderLinkPlugin extends ApolloLinkPlugin {\n private readonly tenant: string;\n\n public constructor(tenant?: string) {\n super();\n this.name = \"tenant-header-link\";\n\n this.tenant = tenant || (getTenantId() as string);\n }\n\n public override createLink(): ApolloLink {\n return setContext((_, { headers }) => {\n // If tenant header is already set, do not overwrite it.\n if (headers && \"x-tenant\" in headers) {\n return { headers };\n }\n\n if (this.tenant) {\n return {\n headers: {\n ...headers,\n \"x-tenant\": this.tenant\n }\n };\n }\n\n return { headers };\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AACA;AAEA;AAEA;AACA;AACA;AAFA,IAGaA,sBAAsB;EAAA;EAAA;EAG/B,gCAAmBC,MAAe,EAAE;IAAA;IAAA;IAChC;IAAQ;IACR,MAAKC,IAAI,GAAG,oBAAoB;IAEhC,MAAKD,MAAM,GAAGA,MAAM,IAAK,IAAAE,kBAAW,GAAa;IAAC;EACtD;EAAC;IAAA;IAAA,OAED,sBAAyC;MAAA;MACrC,OAAO,IAAAC,6BAAU,EAAC,UAACC,CAAC,QAAkB;QAAA,IAAdC,OAAO,QAAPA,OAAO;QAC3B;QACA,IAAIA,OAAO,IAAI,UAAU,IAAIA,OAAO,EAAE;UAClC,OAAO;YAAEA,OAAO,EAAPA;UAAQ,CAAC;QACtB;QAEA,IAAI,MAAI,CAACL,MAAM,EAAE;UACb,OAAO;YACHK,OAAO,8DACAA,OAAO;cACV,UAAU,EAAE,MAAI,CAACL;YAAM;UAE/B,CAAC;QACL;QAEA,OAAO;UAAEK,OAAO,EAAPA;QAAQ,CAAC;MACtB,CAAC,CAAC;IACN;EAAC;EAAA;AAAA,EA5BuCC,mCAAgB;AAAA"}
1
+ {"version":3,"names":["_apolloLinkContext","require","_ApolloLinkPlugin2","_utils","TenantHeaderLinkPlugin","_ApolloLinkPlugin","_inherits2","default","_super","_createSuper2","tenant","_this","_classCallCheck2","call","name","getTenantId","_createClass2","key","value","createLink","_this2","setContext","_","_ref","headers","_objectSpread2","ApolloLinkPlugin","exports"],"sources":["TenantHeaderLinkPlugin.ts"],"sourcesContent":["import { setContext } from \"apollo-link-context\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\nimport { ApolloLink } from \"apollo-link\";\nimport { getTenantId } from \"~/utils\";\n\n/**\n * Append `x-tenant` header from URL query (necessary for prerendering service).\n */\nexport class TenantHeaderLinkPlugin extends ApolloLinkPlugin {\n private readonly tenant: string;\n\n public constructor(tenant?: string) {\n super();\n this.name = \"tenant-header-link\";\n\n this.tenant = tenant || (getTenantId() as string);\n }\n\n public override createLink(): ApolloLink {\n return setContext((_, { headers }) => {\n // If tenant header is already set, do not overwrite it.\n if (headers && \"x-tenant\" in headers) {\n return { headers };\n }\n\n if (this.tenant) {\n return {\n headers: {\n ...headers,\n \"x-tenant\": this.tenant\n }\n };\n }\n\n return { headers };\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAEA;AACA;AACA;AAFA,IAGaG,sBAAsB,0BAAAC,iBAAA;EAAA,IAAAC,UAAA,CAAAC,OAAA,EAAAH,sBAAA,EAAAC,iBAAA;EAAA,IAAAG,MAAA,OAAAC,aAAA,CAAAF,OAAA,EAAAH,sBAAA;EAG/B,SAAAA,uBAAmBM,MAAe,EAAE;IAAA,IAAAC,KAAA;IAAA,IAAAC,gBAAA,CAAAL,OAAA,QAAAH,sBAAA;IAChCO,KAAA,GAAAH,MAAA,CAAAK,IAAA;IACAF,KAAA,CAAKG,IAAI,GAAG,oBAAoB;IAEhCH,KAAA,CAAKD,MAAM,GAAGA,MAAM,IAAK,IAAAK,kBAAW,EAAC,CAAY;IAAC,OAAAJ,KAAA;EACtD;EAAC,IAAAK,aAAA,CAAAT,OAAA,EAAAH,sBAAA;IAAAa,GAAA;IAAAC,KAAA,EAED,SAAAC,WAAA,EAAyC;MAAA,IAAAC,MAAA;MACrC,OAAO,IAAAC,6BAAU,EAAC,UAACC,CAAC,EAAAC,IAAA,EAAkB;QAAA,IAAdC,OAAO,GAAAD,IAAA,CAAPC,OAAO;QAC3B;QACA,IAAIA,OAAO,IAAI,UAAU,IAAIA,OAAO,EAAE;UAClC,OAAO;YAAEA,OAAO,EAAPA;UAAQ,CAAC;QACtB;QAEA,IAAIJ,MAAI,CAACV,MAAM,EAAE;UACb,OAAO;YACHc,OAAO,MAAAC,cAAA,CAAAlB,OAAA,MAAAkB,cAAA,CAAAlB,OAAA,MACAiB,OAAO;cACV,UAAU,EAAEJ,MAAI,CAACV;YAAM;UAE/B,CAAC;QACL;QAEA,OAAO;UAAEc,OAAO,EAAPA;QAAQ,CAAC;MACtB,CAAC,CAAC;IACN;EAAC;EAAA,OAAApB,sBAAA;AAAA,EA5BuCsB,mCAAgB;AAAAC,OAAA,CAAAvB,sBAAA,GAAAA,sBAAA"}
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.ViewPlugin = void 0;
8
8
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
11
10
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
12
11
  var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
13
12
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
@@ -19,7 +18,6 @@ var ViewPlugin = /*#__PURE__*/function (_Plugin) {
19
18
  var _this;
20
19
  (0, _classCallCheck2.default)(this, ViewPlugin);
21
20
  _this = _super.call(this);
22
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_config", void 0);
23
21
  _this._config = config || {};
24
22
  return _this;
25
23
  }
@@ -1 +1 @@
1
- {"version":3,"names":["ViewPlugin","config","_config","name","props","render","Plugin"],"sources":["ViewPlugin.ts"],"sourcesContent":["import * as React from \"react\";\nimport { Plugin } from \"@webiny/plugins\";\n\ninterface Config<Props> {\n name: string;\n render(props: Props): React.ReactElement | null;\n}\n\nexport class ViewPlugin<Props = any> extends Plugin {\n public static override readonly type: string = \"view\";\n private readonly _config: Partial<Config<Props>>;\n\n public constructor(config?: Config<Props>) {\n super();\n this._config = config || {};\n }\n\n get key() {\n return this._config.name;\n }\n\n public render(props: Props) {\n if (!this._config.render) {\n return null;\n }\n return this._config.render(props);\n }\n}\n"],"mappings":";;;;;;;;;;;;;AACA;AAAyC,IAO5BA,UAAU;EAAA;EAAA;EAInB,oBAAmBC,MAAsB,EAAE;IAAA;IAAA;IACvC;IAAQ;IACR,MAAKC,OAAO,GAAGD,MAAM,IAAI,CAAC,CAAC;IAAC;EAChC;EAAC;IAAA;IAAA,KAED,eAAU;MACN,OAAO,IAAI,CAACC,OAAO,CAACC,IAAI;IAC5B;EAAC;IAAA;IAAA,OAED,gBAAcC,KAAY,EAAE;MACxB,IAAI,CAAC,IAAI,CAACF,OAAO,CAACG,MAAM,EAAE;QACtB,OAAO,IAAI;MACf;MACA,OAAO,IAAI,CAACH,OAAO,CAACG,MAAM,CAACD,KAAK,CAAC;IACrC;EAAC;EAAA;AAAA,EAlBwCE,eAAM;AAAA;AAAA,8BAAtCN,UAAU,UAC4B,MAAM"}
1
+ {"version":3,"names":["_plugins","require","ViewPlugin","_Plugin","_inherits2","default","_super","_createSuper2","config","_this","_classCallCheck2","call","_config","_createClass2","key","get","name","value","render","props","Plugin","exports","_defineProperty2"],"sources":["ViewPlugin.ts"],"sourcesContent":["import * as React from \"react\";\nimport { Plugin } from \"@webiny/plugins\";\n\ninterface Config<Props> {\n name: string;\n render(props: Props): React.ReactElement | null;\n}\n\nexport class ViewPlugin<Props = any> extends Plugin {\n public static override readonly type: string = \"view\";\n private readonly _config: Partial<Config<Props>>;\n\n public constructor(config?: Config<Props>) {\n super();\n this._config = config || {};\n }\n\n get key() {\n return this._config.name;\n }\n\n public render(props: Props) {\n if (!this._config.render) {\n return null;\n }\n return this._config.render(props);\n }\n}\n"],"mappings":";;;;;;;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAAyC,IAO5BC,UAAU,0BAAAC,OAAA;EAAA,IAAAC,UAAA,CAAAC,OAAA,EAAAH,UAAA,EAAAC,OAAA;EAAA,IAAAG,MAAA,OAAAC,aAAA,CAAAF,OAAA,EAAAH,UAAA;EAInB,SAAAA,WAAmBM,MAAsB,EAAE;IAAA,IAAAC,KAAA;IAAA,IAAAC,gBAAA,CAAAL,OAAA,QAAAH,UAAA;IACvCO,KAAA,GAAAH,MAAA,CAAAK,IAAA;IACAF,KAAA,CAAKG,OAAO,GAAGJ,MAAM,IAAI,CAAC,CAAC;IAAC,OAAAC,KAAA;EAChC;EAAC,IAAAI,aAAA,CAAAR,OAAA,EAAAH,UAAA;IAAAY,GAAA;IAAAC,GAAA,EAED,SAAAA,IAAA,EAAU;MACN,OAAO,IAAI,CAACH,OAAO,CAACI,IAAI;IAC5B;EAAC;IAAAF,GAAA;IAAAG,KAAA,EAED,SAAAC,OAAcC,KAAY,EAAE;MACxB,IAAI,CAAC,IAAI,CAACP,OAAO,CAACM,MAAM,EAAE;QACtB,OAAO,IAAI;MACf;MACA,OAAO,IAAI,CAACN,OAAO,CAACM,MAAM,CAACC,KAAK,CAAC;IACrC;EAAC;EAAA,OAAAjB,UAAA;AAAA,EAlBwCkB,eAAM;AAAAC,OAAA,CAAAnB,UAAA,GAAAA,UAAA;AAAA,IAAAoB,gBAAA,CAAAjB,OAAA,EAAtCH,UAAU,UAC4B,MAAM"}