@inventreedb/ui 0.8.1 → 0.9.0

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 (56) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/.vite/manifest.json +32 -7
  3. package/dist/components/RowActions.js +4 -4
  4. package/dist/hooks/MonitorBackgroundTask.d.ts +20 -0
  5. package/dist/hooks/MonitorBackgroundTask.js +77 -0
  6. package/dist/hooks/MonitorBackgroundTask.js.map +1 -0
  7. package/dist/hooks/MonitorDataOutput.d.ts +6 -5
  8. package/dist/hooks/MonitorDataOutput.js +21 -26
  9. package/dist/hooks/MonitorDataOutput.js.map +1 -1
  10. package/dist/index.d.ts +2 -1
  11. package/dist/index.js +4 -2
  12. package/dist/index.js.map +1 -1
  13. package/dist/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +1 -1
  14. package/dist/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js.map +1 -1
  15. package/dist/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +1 -1
  16. package/dist/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js.map +1 -1
  17. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +1 -1
  18. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js.map +1 -1
  19. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleCheck.js +2 -2
  20. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleCheck.js.map +1 -1
  21. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleX.js +2 -2
  22. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleX.js.map +1 -1
  23. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +2 -2
  24. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js.map +1 -1
  25. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconDots.js +2 -2
  26. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconDots.js.map +1 -1
  27. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconEdit.js +2 -2
  28. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconEdit.js.map +1 -1
  29. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconExclamationCircle.js +2 -2
  30. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconExclamationCircle.js.map +1 -1
  31. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconPlus.js +1 -1
  32. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconPlus.js.map +1 -1
  33. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +2 -2
  34. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js.map +1 -1
  35. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js +1 -1
  36. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js.map +1 -1
  37. package/dist/node_modules/@tanstack/query-core/build/modern/notifyManager.js +2 -1
  38. package/dist/node_modules/@tanstack/query-core/build/modern/notifyManager.js.map +1 -1
  39. package/dist/node_modules/@tanstack/query-core/build/modern/query.js.map +1 -1
  40. package/dist/node_modules/@tanstack/query-core/build/modern/queryObserver.js +20 -14
  41. package/dist/node_modules/@tanstack/query-core/build/modern/queryObserver.js.map +1 -1
  42. package/dist/node_modules/@tanstack/query-core/build/modern/timeoutManager.js +69 -0
  43. package/dist/node_modules/@tanstack/query-core/build/modern/timeoutManager.js.map +1 -0
  44. package/dist/node_modules/@tanstack/query-core/build/modern/utils.js +3 -2
  45. package/dist/node_modules/@tanstack/query-core/build/modern/utils.js.map +1 -1
  46. package/dist/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js +3 -2
  47. package/dist/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js.map +1 -1
  48. package/dist/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js +4 -3
  49. package/dist/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js.map +1 -1
  50. package/dist/types/Icons.d.ts +2 -2
  51. package/dist/types/Plugins.js +3 -3
  52. package/lib/hooks/MonitorBackgroundTask.tsx +118 -0
  53. package/lib/hooks/MonitorDataOutput.tsx +27 -30
  54. package/lib/index.ts +8 -1
  55. package/lib/types/Icons.tsx +2 -4
  56. package/package.json +42 -39
@@ -1,11 +1,11 @@
1
1
  import createReactComponent from "../createReactComponent.js";
2
2
  /**
3
- * @license @tabler/icons-react v3.34.1 - MIT
3
+ * @license @tabler/icons-react v3.40.0 - MIT
4
4
  *
5
5
  * This source code is licensed under the MIT license.
6
6
  * See the LICENSE file in the root directory of this source tree.
7
7
  */
8
- const __iconNode = [["path", { "d": "M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1", "key": "svg-0" }], ["path", { "d": "M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z", "key": "svg-1" }], ["path", { "d": "M16 5l3 3", "key": "svg-2" }]];
8
+ const __iconNode = [["path", { "d": "M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1", "key": "svg-0" }], ["path", { "d": "M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415", "key": "svg-1" }], ["path", { "d": "M16 5l3 3", "key": "svg-2" }]];
9
9
  const IconEdit = createReactComponent("outline", "edit", "Edit", __iconNode);
10
10
  export {
11
11
  __iconNode,
@@ -1 +1 @@
1
- {"version":3,"file":"IconEdit.js","sources":["../../../../../../../node_modules/@tabler/icons-react/dist/esm/icons/IconEdit.mjs"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.34.1 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M16 5l3 3\", \"key\": \"svg-2\" }]];\nconst IconEdit = createReactComponent(\"outline\", \"edit\", \"Edit\", __iconNode);\n\nexport { __iconNode, IconEdit as default };\n//# sourceMappingURL=IconEdit.mjs.map\n"],"names":[],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASK,MAAC,aAAa,CAAC,CAAC,QAAQ,EAAE,KAAK,8DAA8D,OAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,KAAK,0EAA0E,OAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,KAAK,aAAa,OAAO,SAAS,CAAC;AAC3Q,MAAC,WAAW,qBAAqB,WAAW,QAAQ,QAAQ,UAAU;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"IconEdit.js","sources":["../../../../../../../node_modules/@tabler/icons-react/dist/esm/icons/IconEdit.mjs"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.40.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M16 5l3 3\", \"key\": \"svg-2\" }]];\nconst IconEdit = createReactComponent(\"outline\", \"edit\", \"Edit\", __iconNode);\n\nexport { __iconNode, IconEdit as default };\n//# sourceMappingURL=IconEdit.mjs.map\n"],"names":[],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASK,MAAC,aAAa,CAAC,CAAC,QAAQ,EAAE,KAAK,8DAA8D,OAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,KAAK,yEAAyE,OAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,KAAK,aAAa,OAAO,SAAS,CAAC;AAC1Q,MAAC,WAAW,qBAAqB,WAAW,QAAQ,QAAQ,UAAU;","x_google_ignoreList":[0]}
@@ -1,11 +1,11 @@
1
1
  import createReactComponent from "../createReactComponent.js";
2
2
  /**
3
- * @license @tabler/icons-react v3.34.1 - MIT
3
+ * @license @tabler/icons-react v3.40.0 - MIT
4
4
  *
5
5
  * This source code is licensed under the MIT license.
6
6
  * See the LICENSE file in the root directory of this source tree.
7
7
  */
8
- const __iconNode = [["path", { "d": "M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0", "key": "svg-0" }], ["path", { "d": "M12 9v4", "key": "svg-1" }], ["path", { "d": "M12 16v.01", "key": "svg-2" }]];
8
+ const __iconNode = [["path", { "d": "M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0", "key": "svg-0" }], ["path", { "d": "M12 9v4", "key": "svg-1" }], ["path", { "d": "M12 16v.01", "key": "svg-2" }]];
9
9
  const IconExclamationCircle = createReactComponent("outline", "exclamation-circle", "ExclamationCircle", __iconNode);
10
10
  export {
11
11
  __iconNode,
@@ -1 +1 @@
1
- {"version":3,"file":"IconExclamationCircle.js","sources":["../../../../../../../node_modules/@tabler/icons-react/dist/esm/icons/IconExclamationCircle.mjs"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.34.1 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M12 9v4\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M12 16v.01\", \"key\": \"svg-2\" }]];\nconst IconExclamationCircle = createReactComponent(\"outline\", \"exclamation-circle\", \"ExclamationCircle\", __iconNode);\n\nexport { __iconNode, IconExclamationCircle as default };\n//# sourceMappingURL=IconExclamationCircle.mjs.map\n"],"names":[],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASK,MAAC,aAAa,CAAC,CAAC,QAAQ,EAAE,KAAK,8CAA8C,OAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,KAAK,WAAW,OAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,KAAK,cAAc,OAAO,SAAS,CAAC;AAC7L,MAAC,wBAAwB,qBAAqB,WAAW,sBAAsB,qBAAqB,UAAU;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"IconExclamationCircle.js","sources":["../../../../../../../node_modules/@tabler/icons-react/dist/esm/icons/IconExclamationCircle.mjs"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.40.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M12 9v4\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M12 16v.01\", \"key\": \"svg-2\" }]];\nconst IconExclamationCircle = createReactComponent(\"outline\", \"exclamation-circle\", \"ExclamationCircle\", __iconNode);\n\nexport { __iconNode, IconExclamationCircle as default };\n//# sourceMappingURL=IconExclamationCircle.mjs.map\n"],"names":[],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASK,MAAC,aAAa,CAAC,CAAC,QAAQ,EAAE,KAAK,wCAAwC,OAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,KAAK,WAAW,OAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,KAAK,cAAc,OAAO,SAAS,CAAC;AACvL,MAAC,wBAAwB,qBAAqB,WAAW,sBAAsB,qBAAqB,UAAU;","x_google_ignoreList":[0]}
@@ -1,6 +1,6 @@
1
1
  import createReactComponent from "../createReactComponent.js";
2
2
  /**
3
- * @license @tabler/icons-react v3.34.1 - MIT
3
+ * @license @tabler/icons-react v3.40.0 - MIT
4
4
  *
5
5
  * This source code is licensed under the MIT license.
6
6
  * See the LICENSE file in the root directory of this source tree.
@@ -1 +1 @@
1
- {"version":3,"file":"IconPlus.js","sources":["../../../../../../../node_modules/@tabler/icons-react/dist/esm/icons/IconPlus.mjs"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.34.1 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M12 5l0 14\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M5 12l14 0\", \"key\": \"svg-1\" }]];\nconst IconPlus = createReactComponent(\"outline\", \"plus\", \"Plus\", __iconNode);\n\nexport { __iconNode, IconPlus as default };\n//# sourceMappingURL=IconPlus.mjs.map\n"],"names":[],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASK,MAAC,aAAa,CAAC,CAAC,QAAQ,EAAE,KAAK,cAAc,OAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,KAAK,cAAc,OAAO,SAAS,CAAC;AAC/G,MAAC,WAAW,qBAAqB,WAAW,QAAQ,QAAQ,UAAU;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"IconPlus.js","sources":["../../../../../../../node_modules/@tabler/icons-react/dist/esm/icons/IconPlus.mjs"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.40.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M12 5l0 14\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M5 12l14 0\", \"key\": \"svg-1\" }]];\nconst IconPlus = createReactComponent(\"outline\", \"plus\", \"Plus\", __iconNode);\n\nexport { __iconNode, IconPlus as default };\n//# sourceMappingURL=IconPlus.mjs.map\n"],"names":[],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASK,MAAC,aAAa,CAAC,CAAC,QAAQ,EAAE,KAAK,cAAc,OAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,KAAK,cAAc,OAAO,SAAS,CAAC;AAC/G,MAAC,WAAW,qBAAqB,WAAW,QAAQ,QAAQ,UAAU;","x_google_ignoreList":[0]}
@@ -1,11 +1,11 @@
1
1
  import createReactComponent from "../createReactComponent.js";
2
2
  /**
3
- * @license @tabler/icons-react v3.34.1 - MIT
3
+ * @license @tabler/icons-react v3.40.0 - MIT
4
4
  *
5
5
  * This source code is licensed under the MIT license.
6
6
  * See the LICENSE file in the root directory of this source tree.
7
7
  */
8
- const __iconNode = [["path", { "d": "M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0", "key": "svg-0" }], ["path", { "d": "M21 21l-6 -6", "key": "svg-1" }]];
8
+ const __iconNode = [["path", { "d": "M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0", "key": "svg-0" }], ["path", { "d": "M21 21l-6 -6", "key": "svg-1" }]];
9
9
  const IconSearch = createReactComponent("outline", "search", "Search", __iconNode);
10
10
  export {
11
11
  __iconNode,
@@ -1 +1 @@
1
- {"version":3,"file":"IconSearch.js","sources":["../../../../../../../node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.mjs"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.34.1 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M21 21l-6 -6\", \"key\": \"svg-1\" }]];\nconst IconSearch = createReactComponent(\"outline\", \"search\", \"Search\", __iconNode);\n\nexport { __iconNode, IconSearch as default };\n//# sourceMappingURL=IconSearch.mjs.map\n"],"names":[],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASK,MAAC,aAAa,CAAC,CAAC,QAAQ,EAAE,KAAK,8CAA8C,OAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,KAAK,gBAAgB,OAAO,SAAS,CAAC;AACjJ,MAAC,aAAa,qBAAqB,WAAW,UAAU,UAAU,UAAU;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"IconSearch.js","sources":["../../../../../../../node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.mjs"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.40.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M21 21l-6 -6\", \"key\": \"svg-1\" }]];\nconst IconSearch = createReactComponent(\"outline\", \"search\", \"Search\", __iconNode);\n\nexport { __iconNode, IconSearch as default };\n//# sourceMappingURL=IconSearch.mjs.map\n"],"names":[],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASK,MAAC,aAAa,CAAC,CAAC,QAAQ,EAAE,KAAK,wCAAwC,OAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,KAAK,gBAAgB,OAAO,SAAS,CAAC;AAC3I,MAAC,aAAa,qBAAqB,WAAW,UAAU,UAAU,UAAU;","x_google_ignoreList":[0]}
@@ -1,6 +1,6 @@
1
1
  import createReactComponent from "../createReactComponent.js";
2
2
  /**
3
- * @license @tabler/icons-react v3.34.1 - MIT
3
+ * @license @tabler/icons-react v3.40.0 - MIT
4
4
  *
5
5
  * This source code is licensed under the MIT license.
6
6
  * See the LICENSE file in the root directory of this source tree.
@@ -1 +1 @@
1
- {"version":3,"file":"IconTrash.js","sources":["../../../../../../../node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.mjs"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.34.1 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M4 7l16 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M10 11l0 6\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M14 11l0 6\", \"key\": \"svg-2\" }], [\"path\", { \"d\": \"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12\", \"key\": \"svg-3\" }], [\"path\", { \"d\": \"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3\", \"key\": \"svg-4\" }]];\nconst IconTrash = createReactComponent(\"outline\", \"trash\", \"Trash\", __iconNode);\n\nexport { __iconNode, IconTrash as default };\n//# sourceMappingURL=IconTrash.mjs.map\n"],"names":[],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASK,MAAC,aAAa,CAAC,CAAC,QAAQ,EAAE,KAAK,aAAa,OAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,KAAK,cAAc,OAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,KAAK,cAAc,OAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,KAAK,kDAAkD,OAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,KAAK,4CAA4C,OAAO,SAAS,CAAC;AACnU,MAAC,YAAY,qBAAqB,WAAW,SAAS,SAAS,UAAU;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"IconTrash.js","sources":["../../../../../../../node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.mjs"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.40.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M4 7l16 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M10 11l0 6\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M14 11l0 6\", \"key\": \"svg-2\" }], [\"path\", { \"d\": \"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12\", \"key\": \"svg-3\" }], [\"path\", { \"d\": \"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3\", \"key\": \"svg-4\" }]];\nconst IconTrash = createReactComponent(\"outline\", \"trash\", \"Trash\", __iconNode);\n\nexport { __iconNode, IconTrash as default };\n//# sourceMappingURL=IconTrash.mjs.map\n"],"names":[],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASK,MAAC,aAAa,CAAC,CAAC,QAAQ,EAAE,KAAK,aAAa,OAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,KAAK,cAAc,OAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,KAAK,cAAc,OAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,KAAK,kDAAkD,OAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,KAAK,4CAA4C,OAAO,SAAS,CAAC;AACnU,MAAC,YAAY,qBAAqB,WAAW,SAAS,SAAS,UAAU;","x_google_ignoreList":[0]}
@@ -1,4 +1,5 @@
1
- var defaultScheduler = (cb) => setTimeout(cb, 0);
1
+ import { systemSetTimeoutZero } from "./timeoutManager.js";
2
+ var defaultScheduler = systemSetTimeoutZero;
2
3
  function createNotifyManager() {
3
4
  let queue = [];
4
5
  let transactions = 0;
@@ -1 +1 @@
1
- {"version":3,"file":"notifyManager.js","sources":["../../../../../../node_modules/@tanstack/query-core/build/modern/notifyManager.js"],"sourcesContent":["// src/notifyManager.ts\nvar defaultScheduler = (cb) => setTimeout(cb, 0);\nfunction createNotifyManager() {\n let queue = [];\n let transactions = 0;\n let notifyFn = (callback) => {\n callback();\n };\n let batchNotifyFn = (callback) => {\n callback();\n };\n let scheduleFn = defaultScheduler;\n const schedule = (callback) => {\n if (transactions) {\n queue.push(callback);\n } else {\n scheduleFn(() => {\n notifyFn(callback);\n });\n }\n };\n const flush = () => {\n const originalQueue = queue;\n queue = [];\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback);\n });\n });\n });\n }\n };\n return {\n batch: (callback) => {\n let result;\n transactions++;\n try {\n result = callback();\n } finally {\n transactions--;\n if (!transactions) {\n flush();\n }\n }\n return result;\n },\n /**\n * All calls to the wrapped function will be batched.\n */\n batchCalls: (callback) => {\n return (...args) => {\n schedule(() => {\n callback(...args);\n });\n };\n },\n schedule,\n /**\n * Use this method to set a custom notify function.\n * This can be used to for example wrap notifications with `React.act` while running tests.\n */\n setNotifyFunction: (fn) => {\n notifyFn = fn;\n },\n /**\n * Use this method to set a custom function to batch notifications together into a single tick.\n * By default React Query will use the batch function provided by ReactDOM or React Native.\n */\n setBatchNotifyFunction: (fn) => {\n batchNotifyFn = fn;\n },\n setScheduler: (fn) => {\n scheduleFn = fn;\n }\n };\n}\nvar notifyManager = createNotifyManager();\nexport {\n createNotifyManager,\n defaultScheduler,\n notifyManager\n};\n//# sourceMappingURL=notifyManager.js.map"],"names":[],"mappings":"AACG,IAAC,mBAAmB,CAAC,OAAO,WAAW,IAAI,CAAC;AAC/C,SAAS,sBAAsB;AAC7B,MAAI,QAAQ,CAAA;AACZ,MAAI,eAAe;AACnB,MAAI,WAAW,CAAC,aAAa;AAC3B,aAAQ;AAAA,EACV;AACA,MAAI,gBAAgB,CAAC,aAAa;AAChC,aAAQ;AAAA,EACV;AACA,MAAI,aAAa;AACjB,QAAM,WAAW,CAAC,aAAa;AAC7B,QAAI,cAAc;AAChB,YAAM,KAAK,QAAQ;AAAA,IACrB,OAAO;AACL,iBAAW,MAAM;AACf,iBAAS,QAAQ;AAAA,MACnB,CAAC;AAAA,IACH;AAAA,EACF;AACA,QAAM,QAAQ,MAAM;AAClB,UAAM,gBAAgB;AACtB,YAAQ,CAAA;AACR,QAAI,cAAc,QAAQ;AACxB,iBAAW,MAAM;AACf,sBAAc,MAAM;AAClB,wBAAc,QAAQ,CAAC,aAAa;AAClC,qBAAS,QAAQ;AAAA,UACnB,CAAC;AAAA,QACH,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AAAA,EACF;AACA,SAAO;AAAA,IACL,OAAO,CAAC,aAAa;AACnB,UAAI;AACJ;AACA,UAAI;AACF,iBAAS,SAAQ;AAAA,MACnB,UAAC;AACC;AACA,YAAI,CAAC,cAAc;AACjB,gBAAK;AAAA,QACP;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAAA;AAAA;AAAA;AAAA,IAIA,YAAY,CAAC,aAAa;AACxB,aAAO,IAAI,SAAS;AAClB,iBAAS,MAAM;AACb,mBAAS,GAAG,IAAI;AAAA,QAClB,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,mBAAmB,CAAC,OAAO;AACzB,iBAAW;AAAA,IACb;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,wBAAwB,CAAC,OAAO;AAC9B,sBAAgB;AAAA,IAClB;AAAA,IACA,cAAc,CAAC,OAAO;AACpB,mBAAa;AAAA,IACf;AAAA,EACJ;AACA;AACG,IAAC,gBAAgB,oBAAmB;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"notifyManager.js","sources":["../../../../../../node_modules/@tanstack/query-core/build/modern/notifyManager.js"],"sourcesContent":["// src/notifyManager.ts\nimport { systemSetTimeoutZero } from \"./timeoutManager.js\";\nvar defaultScheduler = systemSetTimeoutZero;\nfunction createNotifyManager() {\n let queue = [];\n let transactions = 0;\n let notifyFn = (callback) => {\n callback();\n };\n let batchNotifyFn = (callback) => {\n callback();\n };\n let scheduleFn = defaultScheduler;\n const schedule = (callback) => {\n if (transactions) {\n queue.push(callback);\n } else {\n scheduleFn(() => {\n notifyFn(callback);\n });\n }\n };\n const flush = () => {\n const originalQueue = queue;\n queue = [];\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback);\n });\n });\n });\n }\n };\n return {\n batch: (callback) => {\n let result;\n transactions++;\n try {\n result = callback();\n } finally {\n transactions--;\n if (!transactions) {\n flush();\n }\n }\n return result;\n },\n /**\n * All calls to the wrapped function will be batched.\n */\n batchCalls: (callback) => {\n return (...args) => {\n schedule(() => {\n callback(...args);\n });\n };\n },\n schedule,\n /**\n * Use this method to set a custom notify function.\n * This can be used to for example wrap notifications with `React.act` while running tests.\n */\n setNotifyFunction: (fn) => {\n notifyFn = fn;\n },\n /**\n * Use this method to set a custom function to batch notifications together into a single tick.\n * By default React Query will use the batch function provided by ReactDOM or React Native.\n */\n setBatchNotifyFunction: (fn) => {\n batchNotifyFn = fn;\n },\n setScheduler: (fn) => {\n scheduleFn = fn;\n }\n };\n}\nvar notifyManager = createNotifyManager();\nexport {\n createNotifyManager,\n defaultScheduler,\n notifyManager\n};\n//# sourceMappingURL=notifyManager.js.map"],"names":[],"mappings":";AAEG,IAAC,mBAAmB;AACvB,SAAS,sBAAsB;AAC7B,MAAI,QAAQ,CAAA;AACZ,MAAI,eAAe;AACnB,MAAI,WAAW,CAAC,aAAa;AAC3B,aAAQ;AAAA,EACV;AACA,MAAI,gBAAgB,CAAC,aAAa;AAChC,aAAQ;AAAA,EACV;AACA,MAAI,aAAa;AACjB,QAAM,WAAW,CAAC,aAAa;AAC7B,QAAI,cAAc;AAChB,YAAM,KAAK,QAAQ;AAAA,IACrB,OAAO;AACL,iBAAW,MAAM;AACf,iBAAS,QAAQ;AAAA,MACnB,CAAC;AAAA,IACH;AAAA,EACF;AACA,QAAM,QAAQ,MAAM;AAClB,UAAM,gBAAgB;AACtB,YAAQ,CAAA;AACR,QAAI,cAAc,QAAQ;AACxB,iBAAW,MAAM;AACf,sBAAc,MAAM;AAClB,wBAAc,QAAQ,CAAC,aAAa;AAClC,qBAAS,QAAQ;AAAA,UACnB,CAAC;AAAA,QACH,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AAAA,EACF;AACA,SAAO;AAAA,IACL,OAAO,CAAC,aAAa;AACnB,UAAI;AACJ;AACA,UAAI;AACF,iBAAS,SAAQ;AAAA,MACnB,UAAC;AACC;AACA,YAAI,CAAC,cAAc;AACjB,gBAAK;AAAA,QACP;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAAA;AAAA;AAAA;AAAA,IAIA,YAAY,CAAC,aAAa;AACxB,aAAO,IAAI,SAAS;AAClB,iBAAS,MAAM;AACb,mBAAS,GAAG,IAAI;AAAA,QAClB,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,mBAAmB,CAAC,OAAO;AACzB,iBAAW;AAAA,IACb;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,wBAAwB,CAAC,OAAO;AAC9B,sBAAgB;AAAA,IAClB;AAAA,IACA,cAAc,CAAC,OAAO;AACpB,mBAAa;AAAA,IACf;AAAA,EACJ;AACA;AACG,IAAC,gBAAgB,oBAAmB;","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"query.js","sources":["../../../../../../node_modules/@tanstack/query-core/build/modern/query.js"],"sourcesContent":["// src/query.ts\nimport {\n ensureQueryFn,\n noop,\n replaceData,\n resolveEnabled,\n resolveStaleTime,\n skipToken,\n timeUntilStale\n} from \"./utils.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { CancelledError, canFetch, createRetryer } from \"./retryer.js\";\nimport { Removable } from \"./removable.js\";\nvar Query = class extends Removable {\n #initialState;\n #revertState;\n #cache;\n #client;\n #retryer;\n #defaultOptions;\n #abortSignalConsumed;\n constructor(config) {\n super();\n this.#abortSignalConsumed = false;\n this.#defaultOptions = config.defaultOptions;\n this.setOptions(config.options);\n this.observers = [];\n this.#client = config.client;\n this.#cache = this.#client.getQueryCache();\n this.queryKey = config.queryKey;\n this.queryHash = config.queryHash;\n this.#initialState = getDefaultState(this.options);\n this.state = config.state ?? this.#initialState;\n this.scheduleGc();\n }\n get meta() {\n return this.options.meta;\n }\n get promise() {\n return this.#retryer?.promise;\n }\n setOptions(options) {\n this.options = { ...this.#defaultOptions, ...options };\n this.updateGcTime(this.options.gcTime);\n }\n optionalRemove() {\n if (!this.observers.length && this.state.fetchStatus === \"idle\") {\n this.#cache.remove(this);\n }\n }\n setData(newData, options) {\n const data = replaceData(this.state.data, newData, this.options);\n this.#dispatch({\n data,\n type: \"success\",\n dataUpdatedAt: options?.updatedAt,\n manual: options?.manual\n });\n return data;\n }\n setState(state, setStateOptions) {\n this.#dispatch({ type: \"setState\", state, setStateOptions });\n }\n cancel(options) {\n const promise = this.#retryer?.promise;\n this.#retryer?.cancel(options);\n return promise ? promise.then(noop).catch(noop) : Promise.resolve();\n }\n destroy() {\n super.destroy();\n this.cancel({ silent: true });\n }\n reset() {\n this.destroy();\n this.setState(this.#initialState);\n }\n isActive() {\n return this.observers.some(\n (observer) => resolveEnabled(observer.options.enabled, this) !== false\n );\n }\n isDisabled() {\n if (this.getObserversCount() > 0) {\n return !this.isActive();\n }\n return this.options.queryFn === skipToken || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;\n }\n isStatic() {\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) => resolveStaleTime(observer.options.staleTime, this) === \"static\"\n );\n }\n return false;\n }\n isStale() {\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) => observer.getCurrentResult().isStale\n );\n }\n return this.state.data === void 0 || this.state.isInvalidated;\n }\n isStaleByTime(staleTime = 0) {\n if (this.state.data === void 0) {\n return true;\n }\n if (staleTime === \"static\") {\n return false;\n }\n if (this.state.isInvalidated) {\n return true;\n }\n return !timeUntilStale(this.state.dataUpdatedAt, staleTime);\n }\n onFocus() {\n const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus());\n observer?.refetch({ cancelRefetch: false });\n this.#retryer?.continue();\n }\n onOnline() {\n const observer = this.observers.find((x) => x.shouldFetchOnReconnect());\n observer?.refetch({ cancelRefetch: false });\n this.#retryer?.continue();\n }\n addObserver(observer) {\n if (!this.observers.includes(observer)) {\n this.observers.push(observer);\n this.clearGcTimeout();\n this.#cache.notify({ type: \"observerAdded\", query: this, observer });\n }\n }\n removeObserver(observer) {\n if (this.observers.includes(observer)) {\n this.observers = this.observers.filter((x) => x !== observer);\n if (!this.observers.length) {\n if (this.#retryer) {\n if (this.#abortSignalConsumed) {\n this.#retryer.cancel({ revert: true });\n } else {\n this.#retryer.cancelRetry();\n }\n }\n this.scheduleGc();\n }\n this.#cache.notify({ type: \"observerRemoved\", query: this, observer });\n }\n }\n getObserversCount() {\n return this.observers.length;\n }\n invalidate() {\n if (!this.state.isInvalidated) {\n this.#dispatch({ type: \"invalidate\" });\n }\n }\n async fetch(options, fetchOptions) {\n if (this.state.fetchStatus !== \"idle\" && // If the promise in the retyer is already rejected, we have to definitely\n // re-start the fetch; there is a chance that the query is still in a\n // pending state when that happens\n this.#retryer?.status() !== \"rejected\") {\n if (this.state.data !== void 0 && fetchOptions?.cancelRefetch) {\n this.cancel({ silent: true });\n } else if (this.#retryer) {\n this.#retryer.continueRetry();\n return this.#retryer.promise;\n }\n }\n if (options) {\n this.setOptions(options);\n }\n if (!this.options.queryFn) {\n const observer = this.observers.find((x) => x.options.queryFn);\n if (observer) {\n this.setOptions(observer.options);\n }\n }\n if (process.env.NODE_ENV !== \"production\") {\n if (!Array.isArray(this.options.queryKey)) {\n console.error(\n `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`\n );\n }\n }\n const abortController = new AbortController();\n const addSignalProperty = (object) => {\n Object.defineProperty(object, \"signal\", {\n enumerable: true,\n get: () => {\n this.#abortSignalConsumed = true;\n return abortController.signal;\n }\n });\n };\n const fetchFn = () => {\n const queryFn = ensureQueryFn(this.options, fetchOptions);\n const createQueryFnContext = () => {\n const queryFnContext2 = {\n client: this.#client,\n queryKey: this.queryKey,\n meta: this.meta\n };\n addSignalProperty(queryFnContext2);\n return queryFnContext2;\n };\n const queryFnContext = createQueryFnContext();\n this.#abortSignalConsumed = false;\n if (this.options.persister) {\n return this.options.persister(\n queryFn,\n queryFnContext,\n this\n );\n }\n return queryFn(queryFnContext);\n };\n const createFetchContext = () => {\n const context2 = {\n fetchOptions,\n options: this.options,\n queryKey: this.queryKey,\n client: this.#client,\n state: this.state,\n fetchFn\n };\n addSignalProperty(context2);\n return context2;\n };\n const context = createFetchContext();\n this.options.behavior?.onFetch(context, this);\n this.#revertState = this.state;\n if (this.state.fetchStatus === \"idle\" || this.state.fetchMeta !== context.fetchOptions?.meta) {\n this.#dispatch({ type: \"fetch\", meta: context.fetchOptions?.meta });\n }\n this.#retryer = createRetryer({\n initialPromise: fetchOptions?.initialPromise,\n fn: context.fetchFn,\n onCancel: (error) => {\n if (error instanceof CancelledError && error.revert) {\n this.setState({\n ...this.#revertState,\n fetchStatus: \"idle\"\n });\n }\n abortController.abort();\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: \"failed\", failureCount, error });\n },\n onPause: () => {\n this.#dispatch({ type: \"pause\" });\n },\n onContinue: () => {\n this.#dispatch({ type: \"continue\" });\n },\n retry: context.options.retry,\n retryDelay: context.options.retryDelay,\n networkMode: context.options.networkMode,\n canRun: () => true\n });\n try {\n const data = await this.#retryer.start();\n if (data === void 0) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(\n `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`\n );\n }\n throw new Error(`${this.queryHash} data is undefined`);\n }\n this.setData(data);\n this.#cache.config.onSuccess?.(data, this);\n this.#cache.config.onSettled?.(\n data,\n this.state.error,\n this\n );\n return data;\n } catch (error) {\n if (error instanceof CancelledError) {\n if (error.silent) {\n return this.#retryer.promise;\n } else if (error.revert) {\n if (this.state.data === void 0) {\n throw error;\n }\n return this.state.data;\n }\n }\n this.#dispatch({\n type: \"error\",\n error\n });\n this.#cache.config.onError?.(\n error,\n this\n );\n this.#cache.config.onSettled?.(\n this.state.data,\n error,\n this\n );\n throw error;\n } finally {\n this.scheduleGc();\n }\n }\n #dispatch(action) {\n const reducer = (state) => {\n switch (action.type) {\n case \"failed\":\n return {\n ...state,\n fetchFailureCount: action.failureCount,\n fetchFailureReason: action.error\n };\n case \"pause\":\n return {\n ...state,\n fetchStatus: \"paused\"\n };\n case \"continue\":\n return {\n ...state,\n fetchStatus: \"fetching\"\n };\n case \"fetch\":\n return {\n ...state,\n ...fetchState(state.data, this.options),\n fetchMeta: action.meta ?? null\n };\n case \"success\":\n const newState = {\n ...state,\n data: action.data,\n dataUpdateCount: state.dataUpdateCount + 1,\n dataUpdatedAt: action.dataUpdatedAt ?? Date.now(),\n error: null,\n isInvalidated: false,\n status: \"success\",\n ...!action.manual && {\n fetchStatus: \"idle\",\n fetchFailureCount: 0,\n fetchFailureReason: null\n }\n };\n this.#revertState = action.manual ? newState : void 0;\n return newState;\n case \"error\":\n const error = action.error;\n return {\n ...state,\n error,\n errorUpdateCount: state.errorUpdateCount + 1,\n errorUpdatedAt: Date.now(),\n fetchFailureCount: state.fetchFailureCount + 1,\n fetchFailureReason: error,\n fetchStatus: \"idle\",\n status: \"error\"\n };\n case \"invalidate\":\n return {\n ...state,\n isInvalidated: true\n };\n case \"setState\":\n return {\n ...state,\n ...action.state\n };\n }\n };\n this.state = reducer(this.state);\n notifyManager.batch(() => {\n this.observers.forEach((observer) => {\n observer.onQueryUpdate();\n });\n this.#cache.notify({ query: this, type: \"updated\", action });\n });\n }\n};\nfunction fetchState(data, options) {\n return {\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchStatus: canFetch(options.networkMode) ? \"fetching\" : \"paused\",\n ...data === void 0 && {\n error: null,\n status: \"pending\"\n }\n };\n}\nfunction getDefaultState(options) {\n const data = typeof options.initialData === \"function\" ? options.initialData() : options.initialData;\n const hasData = data !== void 0;\n const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === \"function\" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;\n return {\n data,\n dataUpdateCount: 0,\n dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchMeta: null,\n isInvalidated: false,\n status: hasData ? \"success\" : \"pending\",\n fetchStatus: \"idle\"\n };\n}\nexport {\n Query,\n fetchState\n};\n//# sourceMappingURL=query.js.map"],"names":[],"mappings":";AA8XA,SAAS,WAAW,MAAM,SAAS;AACjC,SAAO;AAAA,IACL,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,aAAa,SAAS,QAAQ,WAAW,IAAI,aAAa;AAAA,IAC1D,GAAG,SAAS,UAAU;AAAA,MACpB,OAAO;AAAA,MACP,QAAQ;AAAA,IACd;AAAA,EACA;AACA;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"query.js","sources":["../../../../../../node_modules/@tanstack/query-core/build/modern/query.js"],"sourcesContent":["// src/query.ts\nimport {\n ensureQueryFn,\n noop,\n replaceData,\n resolveEnabled,\n resolveStaleTime,\n skipToken,\n timeUntilStale\n} from \"./utils.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { CancelledError, canFetch, createRetryer } from \"./retryer.js\";\nimport { Removable } from \"./removable.js\";\nvar Query = class extends Removable {\n #initialState;\n #revertState;\n #cache;\n #client;\n #retryer;\n #defaultOptions;\n #abortSignalConsumed;\n constructor(config) {\n super();\n this.#abortSignalConsumed = false;\n this.#defaultOptions = config.defaultOptions;\n this.setOptions(config.options);\n this.observers = [];\n this.#client = config.client;\n this.#cache = this.#client.getQueryCache();\n this.queryKey = config.queryKey;\n this.queryHash = config.queryHash;\n this.#initialState = getDefaultState(this.options);\n this.state = config.state ?? this.#initialState;\n this.scheduleGc();\n }\n get meta() {\n return this.options.meta;\n }\n get promise() {\n return this.#retryer?.promise;\n }\n setOptions(options) {\n this.options = { ...this.#defaultOptions, ...options };\n this.updateGcTime(this.options.gcTime);\n if (this.state && this.state.data === void 0) {\n const defaultState = getDefaultState(this.options);\n if (defaultState.data !== void 0) {\n this.setState(\n successState(defaultState.data, defaultState.dataUpdatedAt)\n );\n this.#initialState = defaultState;\n }\n }\n }\n optionalRemove() {\n if (!this.observers.length && this.state.fetchStatus === \"idle\") {\n this.#cache.remove(this);\n }\n }\n setData(newData, options) {\n const data = replaceData(this.state.data, newData, this.options);\n this.#dispatch({\n data,\n type: \"success\",\n dataUpdatedAt: options?.updatedAt,\n manual: options?.manual\n });\n return data;\n }\n setState(state, setStateOptions) {\n this.#dispatch({ type: \"setState\", state, setStateOptions });\n }\n cancel(options) {\n const promise = this.#retryer?.promise;\n this.#retryer?.cancel(options);\n return promise ? promise.then(noop).catch(noop) : Promise.resolve();\n }\n destroy() {\n super.destroy();\n this.cancel({ silent: true });\n }\n reset() {\n this.destroy();\n this.setState(this.#initialState);\n }\n isActive() {\n return this.observers.some(\n (observer) => resolveEnabled(observer.options.enabled, this) !== false\n );\n }\n isDisabled() {\n if (this.getObserversCount() > 0) {\n return !this.isActive();\n }\n return this.options.queryFn === skipToken || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;\n }\n isStatic() {\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) => resolveStaleTime(observer.options.staleTime, this) === \"static\"\n );\n }\n return false;\n }\n isStale() {\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) => observer.getCurrentResult().isStale\n );\n }\n return this.state.data === void 0 || this.state.isInvalidated;\n }\n isStaleByTime(staleTime = 0) {\n if (this.state.data === void 0) {\n return true;\n }\n if (staleTime === \"static\") {\n return false;\n }\n if (this.state.isInvalidated) {\n return true;\n }\n return !timeUntilStale(this.state.dataUpdatedAt, staleTime);\n }\n onFocus() {\n const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus());\n observer?.refetch({ cancelRefetch: false });\n this.#retryer?.continue();\n }\n onOnline() {\n const observer = this.observers.find((x) => x.shouldFetchOnReconnect());\n observer?.refetch({ cancelRefetch: false });\n this.#retryer?.continue();\n }\n addObserver(observer) {\n if (!this.observers.includes(observer)) {\n this.observers.push(observer);\n this.clearGcTimeout();\n this.#cache.notify({ type: \"observerAdded\", query: this, observer });\n }\n }\n removeObserver(observer) {\n if (this.observers.includes(observer)) {\n this.observers = this.observers.filter((x) => x !== observer);\n if (!this.observers.length) {\n if (this.#retryer) {\n if (this.#abortSignalConsumed) {\n this.#retryer.cancel({ revert: true });\n } else {\n this.#retryer.cancelRetry();\n }\n }\n this.scheduleGc();\n }\n this.#cache.notify({ type: \"observerRemoved\", query: this, observer });\n }\n }\n getObserversCount() {\n return this.observers.length;\n }\n invalidate() {\n if (!this.state.isInvalidated) {\n this.#dispatch({ type: \"invalidate\" });\n }\n }\n async fetch(options, fetchOptions) {\n if (this.state.fetchStatus !== \"idle\" && // If the promise in the retryer is already rejected, we have to definitely\n // re-start the fetch; there is a chance that the query is still in a\n // pending state when that happens\n this.#retryer?.status() !== \"rejected\") {\n if (this.state.data !== void 0 && fetchOptions?.cancelRefetch) {\n this.cancel({ silent: true });\n } else if (this.#retryer) {\n this.#retryer.continueRetry();\n return this.#retryer.promise;\n }\n }\n if (options) {\n this.setOptions(options);\n }\n if (!this.options.queryFn) {\n const observer = this.observers.find((x) => x.options.queryFn);\n if (observer) {\n this.setOptions(observer.options);\n }\n }\n if (process.env.NODE_ENV !== \"production\") {\n if (!Array.isArray(this.options.queryKey)) {\n console.error(\n `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`\n );\n }\n }\n const abortController = new AbortController();\n const addSignalProperty = (object) => {\n Object.defineProperty(object, \"signal\", {\n enumerable: true,\n get: () => {\n this.#abortSignalConsumed = true;\n return abortController.signal;\n }\n });\n };\n const fetchFn = () => {\n const queryFn = ensureQueryFn(this.options, fetchOptions);\n const createQueryFnContext = () => {\n const queryFnContext2 = {\n client: this.#client,\n queryKey: this.queryKey,\n meta: this.meta\n };\n addSignalProperty(queryFnContext2);\n return queryFnContext2;\n };\n const queryFnContext = createQueryFnContext();\n this.#abortSignalConsumed = false;\n if (this.options.persister) {\n return this.options.persister(\n queryFn,\n queryFnContext,\n this\n );\n }\n return queryFn(queryFnContext);\n };\n const createFetchContext = () => {\n const context2 = {\n fetchOptions,\n options: this.options,\n queryKey: this.queryKey,\n client: this.#client,\n state: this.state,\n fetchFn\n };\n addSignalProperty(context2);\n return context2;\n };\n const context = createFetchContext();\n this.options.behavior?.onFetch(context, this);\n this.#revertState = this.state;\n if (this.state.fetchStatus === \"idle\" || this.state.fetchMeta !== context.fetchOptions?.meta) {\n this.#dispatch({ type: \"fetch\", meta: context.fetchOptions?.meta });\n }\n this.#retryer = createRetryer({\n initialPromise: fetchOptions?.initialPromise,\n fn: context.fetchFn,\n onCancel: (error) => {\n if (error instanceof CancelledError && error.revert) {\n this.setState({\n ...this.#revertState,\n fetchStatus: \"idle\"\n });\n }\n abortController.abort();\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: \"failed\", failureCount, error });\n },\n onPause: () => {\n this.#dispatch({ type: \"pause\" });\n },\n onContinue: () => {\n this.#dispatch({ type: \"continue\" });\n },\n retry: context.options.retry,\n retryDelay: context.options.retryDelay,\n networkMode: context.options.networkMode,\n canRun: () => true\n });\n try {\n const data = await this.#retryer.start();\n if (data === void 0) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(\n `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`\n );\n }\n throw new Error(`${this.queryHash} data is undefined`);\n }\n this.setData(data);\n this.#cache.config.onSuccess?.(data, this);\n this.#cache.config.onSettled?.(\n data,\n this.state.error,\n this\n );\n return data;\n } catch (error) {\n if (error instanceof CancelledError) {\n if (error.silent) {\n return this.#retryer.promise;\n } else if (error.revert) {\n if (this.state.data === void 0) {\n throw error;\n }\n return this.state.data;\n }\n }\n this.#dispatch({\n type: \"error\",\n error\n });\n this.#cache.config.onError?.(\n error,\n this\n );\n this.#cache.config.onSettled?.(\n this.state.data,\n error,\n this\n );\n throw error;\n } finally {\n this.scheduleGc();\n }\n }\n #dispatch(action) {\n const reducer = (state) => {\n switch (action.type) {\n case \"failed\":\n return {\n ...state,\n fetchFailureCount: action.failureCount,\n fetchFailureReason: action.error\n };\n case \"pause\":\n return {\n ...state,\n fetchStatus: \"paused\"\n };\n case \"continue\":\n return {\n ...state,\n fetchStatus: \"fetching\"\n };\n case \"fetch\":\n return {\n ...state,\n ...fetchState(state.data, this.options),\n fetchMeta: action.meta ?? null\n };\n case \"success\":\n const newState = {\n ...state,\n ...successState(action.data, action.dataUpdatedAt),\n dataUpdateCount: state.dataUpdateCount + 1,\n ...!action.manual && {\n fetchStatus: \"idle\",\n fetchFailureCount: 0,\n fetchFailureReason: null\n }\n };\n this.#revertState = action.manual ? newState : void 0;\n return newState;\n case \"error\":\n const error = action.error;\n return {\n ...state,\n error,\n errorUpdateCount: state.errorUpdateCount + 1,\n errorUpdatedAt: Date.now(),\n fetchFailureCount: state.fetchFailureCount + 1,\n fetchFailureReason: error,\n fetchStatus: \"idle\",\n status: \"error\",\n // flag existing data as invalidated if we get a background error\n // note that \"no data\" always means stale so we can set unconditionally here\n isInvalidated: true\n };\n case \"invalidate\":\n return {\n ...state,\n isInvalidated: true\n };\n case \"setState\":\n return {\n ...state,\n ...action.state\n };\n }\n };\n this.state = reducer(this.state);\n notifyManager.batch(() => {\n this.observers.forEach((observer) => {\n observer.onQueryUpdate();\n });\n this.#cache.notify({ query: this, type: \"updated\", action });\n });\n }\n};\nfunction fetchState(data, options) {\n return {\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchStatus: canFetch(options.networkMode) ? \"fetching\" : \"paused\",\n ...data === void 0 && {\n error: null,\n status: \"pending\"\n }\n };\n}\nfunction successState(data, dataUpdatedAt) {\n return {\n data,\n dataUpdatedAt: dataUpdatedAt ?? Date.now(),\n error: null,\n isInvalidated: false,\n status: \"success\"\n };\n}\nfunction getDefaultState(options) {\n const data = typeof options.initialData === \"function\" ? options.initialData() : options.initialData;\n const hasData = data !== void 0;\n const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === \"function\" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;\n return {\n data,\n dataUpdateCount: 0,\n dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchMeta: null,\n isInvalidated: false,\n status: hasData ? \"success\" : \"pending\",\n fetchStatus: \"idle\"\n };\n}\nexport {\n Query,\n fetchState\n};\n//# sourceMappingURL=query.js.map"],"names":[],"mappings":";AAsYA,SAAS,WAAW,MAAM,SAAS;AACjC,SAAO;AAAA,IACL,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,aAAa,SAAS,QAAQ,WAAW,IAAI,aAAa;AAAA,IAC1D,GAAG,SAAS,UAAU;AAAA,MACpB,OAAO;AAAA,MACP,QAAQ;AAAA,IACd;AAAA,EACA;AACA;","x_google_ignoreList":[0]}
@@ -4,6 +4,7 @@ import { fetchState } from "./query.js";
4
4
  import { Subscribable } from "./subscribable.js";
5
5
  import { pendingThenable } from "./thenable.js";
6
6
  import { resolveEnabled, shallowEqualObjects, resolveStaleTime, noop, isServer, isValidTimeout, timeUntilStale, replaceData } from "./utils.js";
7
+ import { timeoutManager } from "./timeoutManager.js";
7
8
  var QueryObserver = class extends Subscribable {
8
9
  constructor(client, options) {
9
10
  super();
@@ -124,12 +125,15 @@ var QueryObserver = class extends Subscribable {
124
125
  get: (target, key) => {
125
126
  this.trackProp(key);
126
127
  onPropTracked?.(key);
127
- if (key === "promise" && !this.options.experimental_prefetchInRender && this.#currentThenable.status === "pending") {
128
- this.#currentThenable.reject(
129
- new Error(
130
- "experimental_prefetchInRender feature flag is not enabled"
131
- )
132
- );
128
+ if (key === "promise") {
129
+ this.trackProp("data");
130
+ if (!this.options.experimental_prefetchInRender && this.#currentThenable.status === "pending") {
131
+ this.#currentThenable.reject(
132
+ new Error(
133
+ "experimental_prefetchInRender feature flag is not enabled"
134
+ )
135
+ );
136
+ }
133
137
  }
134
138
  return Reflect.get(target, key);
135
139
  }
@@ -182,7 +186,7 @@ var QueryObserver = class extends Subscribable {
182
186
  }
183
187
  const time = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime);
184
188
  const timeout = time + 1;
185
- this.#staleTimeoutId = setTimeout(() => {
189
+ this.#staleTimeoutId = timeoutManager.setTimeout(() => {
186
190
  if (!this.#currentResult.isStale) {
187
191
  this.updateResult();
188
192
  }
@@ -197,7 +201,7 @@ var QueryObserver = class extends Subscribable {
197
201
  if (isServer || resolveEnabled(this.options.enabled, this.#currentQuery) === false || !isValidTimeout(this.#currentRefetchInterval) || this.#currentRefetchInterval === 0) {
198
202
  return;
199
203
  }
200
- this.#refetchIntervalId = setInterval(() => {
204
+ this.#refetchIntervalId = timeoutManager.setInterval(() => {
201
205
  if (this.options.refetchIntervalInBackground || focusManager.isFocused()) {
202
206
  this.#executeFetch();
203
207
  }
@@ -209,13 +213,13 @@ var QueryObserver = class extends Subscribable {
209
213
  }
210
214
  #clearStaleTimeout() {
211
215
  if (this.#staleTimeoutId) {
212
- clearTimeout(this.#staleTimeoutId);
216
+ timeoutManager.clearTimeout(this.#staleTimeoutId);
213
217
  this.#staleTimeoutId = void 0;
214
218
  }
215
219
  }
216
220
  #clearRefetchInterval() {
217
221
  if (this.#refetchIntervalId) {
218
- clearInterval(this.#refetchIntervalId);
222
+ timeoutManager.clearInterval(this.#refetchIntervalId);
219
223
  this.#refetchIntervalId = void 0;
220
224
  }
221
225
  }
@@ -325,10 +329,12 @@ var QueryObserver = class extends Subscribable {
325
329
  };
326
330
  const nextResult = result;
327
331
  if (this.options.experimental_prefetchInRender) {
332
+ const hasResultData = nextResult.data !== void 0;
333
+ const isErrorWithoutData = nextResult.status === "error" && !hasResultData;
328
334
  const finalizeThenableIfPossible = (thenable) => {
329
- if (nextResult.status === "error") {
335
+ if (isErrorWithoutData) {
330
336
  thenable.reject(nextResult.error);
331
- } else if (nextResult.data !== void 0) {
337
+ } else if (hasResultData) {
332
338
  thenable.resolve(nextResult.data);
333
339
  }
334
340
  };
@@ -344,12 +350,12 @@ var QueryObserver = class extends Subscribable {
344
350
  }
345
351
  break;
346
352
  case "fulfilled":
347
- if (nextResult.status === "error" || nextResult.data !== prevThenable.value) {
353
+ if (isErrorWithoutData || nextResult.data !== prevThenable.value) {
348
354
  recreateThenable();
349
355
  }
350
356
  break;
351
357
  case "rejected":
352
- if (nextResult.status !== "error" || nextResult.error !== prevThenable.reason) {
358
+ if (!isErrorWithoutData || nextResult.error !== prevThenable.reason) {
353
359
  recreateThenable();
354
360
  }
355
361
  break;
@@ -1 +1 @@
1
- {"version":3,"file":"queryObserver.js","sources":["../../../../../../node_modules/@tanstack/query-core/build/modern/queryObserver.js"],"sourcesContent":["// src/queryObserver.ts\nimport { focusManager } from \"./focusManager.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { fetchState } from \"./query.js\";\nimport { Subscribable } from \"./subscribable.js\";\nimport { pendingThenable } from \"./thenable.js\";\nimport {\n isServer,\n isValidTimeout,\n noop,\n replaceData,\n resolveEnabled,\n resolveStaleTime,\n shallowEqualObjects,\n timeUntilStale\n} from \"./utils.js\";\nvar QueryObserver = class extends Subscribable {\n constructor(client, options) {\n super();\n this.options = options;\n this.#client = client;\n this.#selectError = null;\n this.#currentThenable = pendingThenable();\n this.bindMethods();\n this.setOptions(options);\n }\n #client;\n #currentQuery = void 0;\n #currentQueryInitialState = void 0;\n #currentResult = void 0;\n #currentResultState;\n #currentResultOptions;\n #currentThenable;\n #selectError;\n #selectFn;\n #selectResult;\n // This property keeps track of the last query with defined data.\n // It will be used to pass the previous data and query to the placeholder function between renders.\n #lastQueryWithDefinedData;\n #staleTimeoutId;\n #refetchIntervalId;\n #currentRefetchInterval;\n #trackedProps = /* @__PURE__ */ new Set();\n bindMethods() {\n this.refetch = this.refetch.bind(this);\n }\n onSubscribe() {\n if (this.listeners.size === 1) {\n this.#currentQuery.addObserver(this);\n if (shouldFetchOnMount(this.#currentQuery, this.options)) {\n this.#executeFetch();\n } else {\n this.updateResult();\n }\n this.#updateTimers();\n }\n }\n onUnsubscribe() {\n if (!this.hasListeners()) {\n this.destroy();\n }\n }\n shouldFetchOnReconnect() {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnReconnect\n );\n }\n shouldFetchOnWindowFocus() {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnWindowFocus\n );\n }\n destroy() {\n this.listeners = /* @__PURE__ */ new Set();\n this.#clearStaleTimeout();\n this.#clearRefetchInterval();\n this.#currentQuery.removeObserver(this);\n }\n setOptions(options) {\n const prevOptions = this.options;\n const prevQuery = this.#currentQuery;\n this.options = this.#client.defaultQueryOptions(options);\n if (this.options.enabled !== void 0 && typeof this.options.enabled !== \"boolean\" && typeof this.options.enabled !== \"function\" && typeof resolveEnabled(this.options.enabled, this.#currentQuery) !== \"boolean\") {\n throw new Error(\n \"Expected enabled to be a boolean or a callback that returns a boolean\"\n );\n }\n this.#updateQuery();\n this.#currentQuery.setOptions(this.options);\n if (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) {\n this.#client.getQueryCache().notify({\n type: \"observerOptionsUpdated\",\n query: this.#currentQuery,\n observer: this\n });\n }\n const mounted = this.hasListeners();\n if (mounted && shouldFetchOptionally(\n this.#currentQuery,\n prevQuery,\n this.options,\n prevOptions\n )) {\n this.#executeFetch();\n }\n this.updateResult();\n if (mounted && (this.#currentQuery !== prevQuery || resolveEnabled(this.options.enabled, this.#currentQuery) !== resolveEnabled(prevOptions.enabled, this.#currentQuery) || resolveStaleTime(this.options.staleTime, this.#currentQuery) !== resolveStaleTime(prevOptions.staleTime, this.#currentQuery))) {\n this.#updateStaleTimeout();\n }\n const nextRefetchInterval = this.#computeRefetchInterval();\n if (mounted && (this.#currentQuery !== prevQuery || resolveEnabled(this.options.enabled, this.#currentQuery) !== resolveEnabled(prevOptions.enabled, this.#currentQuery) || nextRefetchInterval !== this.#currentRefetchInterval)) {\n this.#updateRefetchInterval(nextRefetchInterval);\n }\n }\n getOptimisticResult(options) {\n const query = this.#client.getQueryCache().build(this.#client, options);\n const result = this.createResult(query, options);\n if (shouldAssignObserverCurrentProperties(this, result)) {\n this.#currentResult = result;\n this.#currentResultOptions = this.options;\n this.#currentResultState = this.#currentQuery.state;\n }\n return result;\n }\n getCurrentResult() {\n return this.#currentResult;\n }\n trackResult(result, onPropTracked) {\n return new Proxy(result, {\n get: (target, key) => {\n this.trackProp(key);\n onPropTracked?.(key);\n if (key === \"promise\" && !this.options.experimental_prefetchInRender && this.#currentThenable.status === \"pending\") {\n this.#currentThenable.reject(\n new Error(\n \"experimental_prefetchInRender feature flag is not enabled\"\n )\n );\n }\n return Reflect.get(target, key);\n }\n });\n }\n trackProp(key) {\n this.#trackedProps.add(key);\n }\n getCurrentQuery() {\n return this.#currentQuery;\n }\n refetch({ ...options } = {}) {\n return this.fetch({\n ...options\n });\n }\n fetchOptimistic(options) {\n const defaultedOptions = this.#client.defaultQueryOptions(options);\n const query = this.#client.getQueryCache().build(this.#client, defaultedOptions);\n return query.fetch().then(() => this.createResult(query, defaultedOptions));\n }\n fetch(fetchOptions) {\n return this.#executeFetch({\n ...fetchOptions,\n cancelRefetch: fetchOptions.cancelRefetch ?? true\n }).then(() => {\n this.updateResult();\n return this.#currentResult;\n });\n }\n #executeFetch(fetchOptions) {\n this.#updateQuery();\n let promise = this.#currentQuery.fetch(\n this.options,\n fetchOptions\n );\n if (!fetchOptions?.throwOnError) {\n promise = promise.catch(noop);\n }\n return promise;\n }\n #updateStaleTimeout() {\n this.#clearStaleTimeout();\n const staleTime = resolveStaleTime(\n this.options.staleTime,\n this.#currentQuery\n );\n if (isServer || this.#currentResult.isStale || !isValidTimeout(staleTime)) {\n return;\n }\n const time = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime);\n const timeout = time + 1;\n this.#staleTimeoutId = setTimeout(() => {\n if (!this.#currentResult.isStale) {\n this.updateResult();\n }\n }, timeout);\n }\n #computeRefetchInterval() {\n return (typeof this.options.refetchInterval === \"function\" ? this.options.refetchInterval(this.#currentQuery) : this.options.refetchInterval) ?? false;\n }\n #updateRefetchInterval(nextInterval) {\n this.#clearRefetchInterval();\n this.#currentRefetchInterval = nextInterval;\n if (isServer || resolveEnabled(this.options.enabled, this.#currentQuery) === false || !isValidTimeout(this.#currentRefetchInterval) || this.#currentRefetchInterval === 0) {\n return;\n }\n this.#refetchIntervalId = setInterval(() => {\n if (this.options.refetchIntervalInBackground || focusManager.isFocused()) {\n this.#executeFetch();\n }\n }, this.#currentRefetchInterval);\n }\n #updateTimers() {\n this.#updateStaleTimeout();\n this.#updateRefetchInterval(this.#computeRefetchInterval());\n }\n #clearStaleTimeout() {\n if (this.#staleTimeoutId) {\n clearTimeout(this.#staleTimeoutId);\n this.#staleTimeoutId = void 0;\n }\n }\n #clearRefetchInterval() {\n if (this.#refetchIntervalId) {\n clearInterval(this.#refetchIntervalId);\n this.#refetchIntervalId = void 0;\n }\n }\n createResult(query, options) {\n const prevQuery = this.#currentQuery;\n const prevOptions = this.options;\n const prevResult = this.#currentResult;\n const prevResultState = this.#currentResultState;\n const prevResultOptions = this.#currentResultOptions;\n const queryChange = query !== prevQuery;\n const queryInitialState = queryChange ? query.state : this.#currentQueryInitialState;\n const { state } = query;\n let newState = { ...state };\n let isPlaceholderData = false;\n let data;\n if (options._optimisticResults) {\n const mounted = this.hasListeners();\n const fetchOnMount = !mounted && shouldFetchOnMount(query, options);\n const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions);\n if (fetchOnMount || fetchOptionally) {\n newState = {\n ...newState,\n ...fetchState(state.data, query.options)\n };\n }\n if (options._optimisticResults === \"isRestoring\") {\n newState.fetchStatus = \"idle\";\n }\n }\n let { error, errorUpdatedAt, status } = newState;\n data = newState.data;\n let skipSelect = false;\n if (options.placeholderData !== void 0 && data === void 0 && status === \"pending\") {\n let placeholderData;\n if (prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData) {\n placeholderData = prevResult.data;\n skipSelect = true;\n } else {\n placeholderData = typeof options.placeholderData === \"function\" ? options.placeholderData(\n this.#lastQueryWithDefinedData?.state.data,\n this.#lastQueryWithDefinedData\n ) : options.placeholderData;\n }\n if (placeholderData !== void 0) {\n status = \"success\";\n data = replaceData(\n prevResult?.data,\n placeholderData,\n options\n );\n isPlaceholderData = true;\n }\n }\n if (options.select && data !== void 0 && !skipSelect) {\n if (prevResult && data === prevResultState?.data && options.select === this.#selectFn) {\n data = this.#selectResult;\n } else {\n try {\n this.#selectFn = options.select;\n data = options.select(data);\n data = replaceData(prevResult?.data, data, options);\n this.#selectResult = data;\n this.#selectError = null;\n } catch (selectError) {\n this.#selectError = selectError;\n }\n }\n }\n if (this.#selectError) {\n error = this.#selectError;\n data = this.#selectResult;\n errorUpdatedAt = Date.now();\n status = \"error\";\n }\n const isFetching = newState.fetchStatus === \"fetching\";\n const isPending = status === \"pending\";\n const isError = status === \"error\";\n const isLoading = isPending && isFetching;\n const hasData = data !== void 0;\n const result = {\n status,\n fetchStatus: newState.fetchStatus,\n isPending,\n isSuccess: status === \"success\",\n isError,\n isInitialLoading: isLoading,\n isLoading,\n data,\n dataUpdatedAt: newState.dataUpdatedAt,\n error,\n errorUpdatedAt,\n failureCount: newState.fetchFailureCount,\n failureReason: newState.fetchFailureReason,\n errorUpdateCount: newState.errorUpdateCount,\n isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0,\n isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount,\n isFetching,\n isRefetching: isFetching && !isPending,\n isLoadingError: isError && !hasData,\n isPaused: newState.fetchStatus === \"paused\",\n isPlaceholderData,\n isRefetchError: isError && hasData,\n isStale: isStale(query, options),\n refetch: this.refetch,\n promise: this.#currentThenable,\n isEnabled: resolveEnabled(options.enabled, query) !== false\n };\n const nextResult = result;\n if (this.options.experimental_prefetchInRender) {\n const finalizeThenableIfPossible = (thenable) => {\n if (nextResult.status === \"error\") {\n thenable.reject(nextResult.error);\n } else if (nextResult.data !== void 0) {\n thenable.resolve(nextResult.data);\n }\n };\n const recreateThenable = () => {\n const pending = this.#currentThenable = nextResult.promise = pendingThenable();\n finalizeThenableIfPossible(pending);\n };\n const prevThenable = this.#currentThenable;\n switch (prevThenable.status) {\n case \"pending\":\n if (query.queryHash === prevQuery.queryHash) {\n finalizeThenableIfPossible(prevThenable);\n }\n break;\n case \"fulfilled\":\n if (nextResult.status === \"error\" || nextResult.data !== prevThenable.value) {\n recreateThenable();\n }\n break;\n case \"rejected\":\n if (nextResult.status !== \"error\" || nextResult.error !== prevThenable.reason) {\n recreateThenable();\n }\n break;\n }\n }\n return nextResult;\n }\n updateResult() {\n const prevResult = this.#currentResult;\n const nextResult = this.createResult(this.#currentQuery, this.options);\n this.#currentResultState = this.#currentQuery.state;\n this.#currentResultOptions = this.options;\n if (this.#currentResultState.data !== void 0) {\n this.#lastQueryWithDefinedData = this.#currentQuery;\n }\n if (shallowEqualObjects(nextResult, prevResult)) {\n return;\n }\n this.#currentResult = nextResult;\n const shouldNotifyListeners = () => {\n if (!prevResult) {\n return true;\n }\n const { notifyOnChangeProps } = this.options;\n const notifyOnChangePropsValue = typeof notifyOnChangeProps === \"function\" ? notifyOnChangeProps() : notifyOnChangeProps;\n if (notifyOnChangePropsValue === \"all\" || !notifyOnChangePropsValue && !this.#trackedProps.size) {\n return true;\n }\n const includedProps = new Set(\n notifyOnChangePropsValue ?? this.#trackedProps\n );\n if (this.options.throwOnError) {\n includedProps.add(\"error\");\n }\n return Object.keys(this.#currentResult).some((key) => {\n const typedKey = key;\n const changed = this.#currentResult[typedKey] !== prevResult[typedKey];\n return changed && includedProps.has(typedKey);\n });\n };\n this.#notify({ listeners: shouldNotifyListeners() });\n }\n #updateQuery() {\n const query = this.#client.getQueryCache().build(this.#client, this.options);\n if (query === this.#currentQuery) {\n return;\n }\n const prevQuery = this.#currentQuery;\n this.#currentQuery = query;\n this.#currentQueryInitialState = query.state;\n if (this.hasListeners()) {\n prevQuery?.removeObserver(this);\n query.addObserver(this);\n }\n }\n onQueryUpdate() {\n this.updateResult();\n if (this.hasListeners()) {\n this.#updateTimers();\n }\n }\n #notify(notifyOptions) {\n notifyManager.batch(() => {\n if (notifyOptions.listeners) {\n this.listeners.forEach((listener) => {\n listener(this.#currentResult);\n });\n }\n this.#client.getQueryCache().notify({\n query: this.#currentQuery,\n type: \"observerResultsUpdated\"\n });\n });\n }\n};\nfunction shouldLoadOnMount(query, options) {\n return resolveEnabled(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === \"error\" && options.retryOnMount === false);\n}\nfunction shouldFetchOnMount(query, options) {\n return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount);\n}\nfunction shouldFetchOn(query, options, field) {\n if (resolveEnabled(options.enabled, query) !== false && resolveStaleTime(options.staleTime, query) !== \"static\") {\n const value = typeof field === \"function\" ? field(query) : field;\n return value === \"always\" || value !== false && isStale(query, options);\n }\n return false;\n}\nfunction shouldFetchOptionally(query, prevQuery, options, prevOptions) {\n return (query !== prevQuery || resolveEnabled(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== \"error\") && isStale(query, options);\n}\nfunction isStale(query, options) {\n return resolveEnabled(options.enabled, query) !== false && query.isStaleByTime(resolveStaleTime(options.staleTime, query));\n}\nfunction shouldAssignObserverCurrentProperties(observer, optimisticResult) {\n if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) {\n return true;\n }\n return false;\n}\nexport {\n QueryObserver\n};\n//# sourceMappingURL=queryObserver.js.map"],"names":[],"mappings":";;;;;;AAgBG,IAAC,gBAAgB,cAAc,aAAa;AAAA,EAC7C,YAAY,QAAQ,SAAS;AAC3B,UAAK;AACL,SAAK,UAAU;AACf,SAAK,UAAU;AACf,SAAK,eAAe;AACpB,SAAK,mBAAmB,gBAAe;AACvC,SAAK,YAAW;AAChB,SAAK,WAAW,OAAO;AAAA,EACzB;AAAA,EACA;AAAA,EACA,gBAAgB;AAAA,EAChB,4BAA4B;AAAA,EAC5B,iBAAiB;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,gBAAgC,oBAAI,IAAG;AAAA,EACvC,cAAc;AACZ,SAAK,UAAU,KAAK,QAAQ,KAAK,IAAI;AAAA,EACvC;AAAA,EACA,cAAc;AACZ,QAAI,KAAK,UAAU,SAAS,GAAG;AAC7B,WAAK,cAAc,YAAY,IAAI;AACnC,UAAI,mBAAmB,KAAK,eAAe,KAAK,OAAO,GAAG;AACxD,aAAK,cAAa;AAAA,MACpB,OAAO;AACL,aAAK,aAAY;AAAA,MACnB;AACA,WAAK,cAAa;AAAA,IACpB;AAAA,EACF;AAAA,EACA,gBAAgB;AACd,QAAI,CAAC,KAAK,gBAAgB;AACxB,WAAK,QAAO;AAAA,IACd;AAAA,EACF;AAAA,EACA,yBAAyB;AACvB,WAAO;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK,QAAQ;AAAA,IACnB;AAAA,EACE;AAAA,EACA,2B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M,WAAW,YAAY,QAAQ,OAAO,OAAO;AACzK;AACA,SAAS,QAAQ,OAAO,SAAS;AAC/B,SAAO,eAAe,QAAQ,SAAS,KAAK,MAAM,SAAS,MAAM,cAAc,iBAAiB,QAAQ,WAAW,KAAK,CAAC;AAC3H;AACA,SAAS,sCAAsC,UAAU,kBAAkB;AACzE,MAAI,CAAC,oBAAoB,SAAS,iBAAgB,GAAI,gBAAgB,GAAG;AACvE,WAAO;AAAA,EACT;AACA,SAAO;AACT;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"queryObserver.js","sources":["../../../../../../node_modules/@tanstack/query-core/build/modern/queryObserver.js"],"sourcesContent":["// src/queryObserver.ts\nimport { focusManager } from \"./focusManager.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { fetchState } from \"./query.js\";\nimport { Subscribable } from \"./subscribable.js\";\nimport { pendingThenable } from \"./thenable.js\";\nimport {\n isServer,\n isValidTimeout,\n noop,\n replaceData,\n resolveEnabled,\n resolveStaleTime,\n shallowEqualObjects,\n timeUntilStale\n} from \"./utils.js\";\nimport { timeoutManager } from \"./timeoutManager.js\";\nvar QueryObserver = class extends Subscribable {\n constructor(client, options) {\n super();\n this.options = options;\n this.#client = client;\n this.#selectError = null;\n this.#currentThenable = pendingThenable();\n this.bindMethods();\n this.setOptions(options);\n }\n #client;\n #currentQuery = void 0;\n #currentQueryInitialState = void 0;\n #currentResult = void 0;\n #currentResultState;\n #currentResultOptions;\n #currentThenable;\n #selectError;\n #selectFn;\n #selectResult;\n // This property keeps track of the last query with defined data.\n // It will be used to pass the previous data and query to the placeholder function between renders.\n #lastQueryWithDefinedData;\n #staleTimeoutId;\n #refetchIntervalId;\n #currentRefetchInterval;\n #trackedProps = /* @__PURE__ */ new Set();\n bindMethods() {\n this.refetch = this.refetch.bind(this);\n }\n onSubscribe() {\n if (this.listeners.size === 1) {\n this.#currentQuery.addObserver(this);\n if (shouldFetchOnMount(this.#currentQuery, this.options)) {\n this.#executeFetch();\n } else {\n this.updateResult();\n }\n this.#updateTimers();\n }\n }\n onUnsubscribe() {\n if (!this.hasListeners()) {\n this.destroy();\n }\n }\n shouldFetchOnReconnect() {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnReconnect\n );\n }\n shouldFetchOnWindowFocus() {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnWindowFocus\n );\n }\n destroy() {\n this.listeners = /* @__PURE__ */ new Set();\n this.#clearStaleTimeout();\n this.#clearRefetchInterval();\n this.#currentQuery.removeObserver(this);\n }\n setOptions(options) {\n const prevOptions = this.options;\n const prevQuery = this.#currentQuery;\n this.options = this.#client.defaultQueryOptions(options);\n if (this.options.enabled !== void 0 && typeof this.options.enabled !== \"boolean\" && typeof this.options.enabled !== \"function\" && typeof resolveEnabled(this.options.enabled, this.#currentQuery) !== \"boolean\") {\n throw new Error(\n \"Expected enabled to be a boolean or a callback that returns a boolean\"\n );\n }\n this.#updateQuery();\n this.#currentQuery.setOptions(this.options);\n if (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) {\n this.#client.getQueryCache().notify({\n type: \"observerOptionsUpdated\",\n query: this.#currentQuery,\n observer: this\n });\n }\n const mounted = this.hasListeners();\n if (mounted && shouldFetchOptionally(\n this.#currentQuery,\n prevQuery,\n this.options,\n prevOptions\n )) {\n this.#executeFetch();\n }\n this.updateResult();\n if (mounted && (this.#currentQuery !== prevQuery || resolveEnabled(this.options.enabled, this.#currentQuery) !== resolveEnabled(prevOptions.enabled, this.#currentQuery) || resolveStaleTime(this.options.staleTime, this.#currentQuery) !== resolveStaleTime(prevOptions.staleTime, this.#currentQuery))) {\n this.#updateStaleTimeout();\n }\n const nextRefetchInterval = this.#computeRefetchInterval();\n if (mounted && (this.#currentQuery !== prevQuery || resolveEnabled(this.options.enabled, this.#currentQuery) !== resolveEnabled(prevOptions.enabled, this.#currentQuery) || nextRefetchInterval !== this.#currentRefetchInterval)) {\n this.#updateRefetchInterval(nextRefetchInterval);\n }\n }\n getOptimisticResult(options) {\n const query = this.#client.getQueryCache().build(this.#client, options);\n const result = this.createResult(query, options);\n if (shouldAssignObserverCurrentProperties(this, result)) {\n this.#currentResult = result;\n this.#currentResultOptions = this.options;\n this.#currentResultState = this.#currentQuery.state;\n }\n return result;\n }\n getCurrentResult() {\n return this.#currentResult;\n }\n trackResult(result, onPropTracked) {\n return new Proxy(result, {\n get: (target, key) => {\n this.trackProp(key);\n onPropTracked?.(key);\n if (key === \"promise\") {\n this.trackProp(\"data\");\n if (!this.options.experimental_prefetchInRender && this.#currentThenable.status === \"pending\") {\n this.#currentThenable.reject(\n new Error(\n \"experimental_prefetchInRender feature flag is not enabled\"\n )\n );\n }\n }\n return Reflect.get(target, key);\n }\n });\n }\n trackProp(key) {\n this.#trackedProps.add(key);\n }\n getCurrentQuery() {\n return this.#currentQuery;\n }\n refetch({ ...options } = {}) {\n return this.fetch({\n ...options\n });\n }\n fetchOptimistic(options) {\n const defaultedOptions = this.#client.defaultQueryOptions(options);\n const query = this.#client.getQueryCache().build(this.#client, defaultedOptions);\n return query.fetch().then(() => this.createResult(query, defaultedOptions));\n }\n fetch(fetchOptions) {\n return this.#executeFetch({\n ...fetchOptions,\n cancelRefetch: fetchOptions.cancelRefetch ?? true\n }).then(() => {\n this.updateResult();\n return this.#currentResult;\n });\n }\n #executeFetch(fetchOptions) {\n this.#updateQuery();\n let promise = this.#currentQuery.fetch(\n this.options,\n fetchOptions\n );\n if (!fetchOptions?.throwOnError) {\n promise = promise.catch(noop);\n }\n return promise;\n }\n #updateStaleTimeout() {\n this.#clearStaleTimeout();\n const staleTime = resolveStaleTime(\n this.options.staleTime,\n this.#currentQuery\n );\n if (isServer || this.#currentResult.isStale || !isValidTimeout(staleTime)) {\n return;\n }\n const time = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime);\n const timeout = time + 1;\n this.#staleTimeoutId = timeoutManager.setTimeout(() => {\n if (!this.#currentResult.isStale) {\n this.updateResult();\n }\n }, timeout);\n }\n #computeRefetchInterval() {\n return (typeof this.options.refetchInterval === \"function\" ? this.options.refetchInterval(this.#currentQuery) : this.options.refetchInterval) ?? false;\n }\n #updateRefetchInterval(nextInterval) {\n this.#clearRefetchInterval();\n this.#currentRefetchInterval = nextInterval;\n if (isServer || resolveEnabled(this.options.enabled, this.#currentQuery) === false || !isValidTimeout(this.#currentRefetchInterval) || this.#currentRefetchInterval === 0) {\n return;\n }\n this.#refetchIntervalId = timeoutManager.setInterval(() => {\n if (this.options.refetchIntervalInBackground || focusManager.isFocused()) {\n this.#executeFetch();\n }\n }, this.#currentRefetchInterval);\n }\n #updateTimers() {\n this.#updateStaleTimeout();\n this.#updateRefetchInterval(this.#computeRefetchInterval());\n }\n #clearStaleTimeout() {\n if (this.#staleTimeoutId) {\n timeoutManager.clearTimeout(this.#staleTimeoutId);\n this.#staleTimeoutId = void 0;\n }\n }\n #clearRefetchInterval() {\n if (this.#refetchIntervalId) {\n timeoutManager.clearInterval(this.#refetchIntervalId);\n this.#refetchIntervalId = void 0;\n }\n }\n createResult(query, options) {\n const prevQuery = this.#currentQuery;\n const prevOptions = this.options;\n const prevResult = this.#currentResult;\n const prevResultState = this.#currentResultState;\n const prevResultOptions = this.#currentResultOptions;\n const queryChange = query !== prevQuery;\n const queryInitialState = queryChange ? query.state : this.#currentQueryInitialState;\n const { state } = query;\n let newState = { ...state };\n let isPlaceholderData = false;\n let data;\n if (options._optimisticResults) {\n const mounted = this.hasListeners();\n const fetchOnMount = !mounted && shouldFetchOnMount(query, options);\n const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions);\n if (fetchOnMount || fetchOptionally) {\n newState = {\n ...newState,\n ...fetchState(state.data, query.options)\n };\n }\n if (options._optimisticResults === \"isRestoring\") {\n newState.fetchStatus = \"idle\";\n }\n }\n let { error, errorUpdatedAt, status } = newState;\n data = newState.data;\n let skipSelect = false;\n if (options.placeholderData !== void 0 && data === void 0 && status === \"pending\") {\n let placeholderData;\n if (prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData) {\n placeholderData = prevResult.data;\n skipSelect = true;\n } else {\n placeholderData = typeof options.placeholderData === \"function\" ? options.placeholderData(\n this.#lastQueryWithDefinedData?.state.data,\n this.#lastQueryWithDefinedData\n ) : options.placeholderData;\n }\n if (placeholderData !== void 0) {\n status = \"success\";\n data = replaceData(\n prevResult?.data,\n placeholderData,\n options\n );\n isPlaceholderData = true;\n }\n }\n if (options.select && data !== void 0 && !skipSelect) {\n if (prevResult && data === prevResultState?.data && options.select === this.#selectFn) {\n data = this.#selectResult;\n } else {\n try {\n this.#selectFn = options.select;\n data = options.select(data);\n data = replaceData(prevResult?.data, data, options);\n this.#selectResult = data;\n this.#selectError = null;\n } catch (selectError) {\n this.#selectError = selectError;\n }\n }\n }\n if (this.#selectError) {\n error = this.#selectError;\n data = this.#selectResult;\n errorUpdatedAt = Date.now();\n status = \"error\";\n }\n const isFetching = newState.fetchStatus === \"fetching\";\n const isPending = status === \"pending\";\n const isError = status === \"error\";\n const isLoading = isPending && isFetching;\n const hasData = data !== void 0;\n const result = {\n status,\n fetchStatus: newState.fetchStatus,\n isPending,\n isSuccess: status === \"success\",\n isError,\n isInitialLoading: isLoading,\n isLoading,\n data,\n dataUpdatedAt: newState.dataUpdatedAt,\n error,\n errorUpdatedAt,\n failureCount: newState.fetchFailureCount,\n failureReason: newState.fetchFailureReason,\n errorUpdateCount: newState.errorUpdateCount,\n isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0,\n isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount,\n isFetching,\n isRefetching: isFetching && !isPending,\n isLoadingError: isError && !hasData,\n isPaused: newState.fetchStatus === \"paused\",\n isPlaceholderData,\n isRefetchError: isError && hasData,\n isStale: isStale(query, options),\n refetch: this.refetch,\n promise: this.#currentThenable,\n isEnabled: resolveEnabled(options.enabled, query) !== false\n };\n const nextResult = result;\n if (this.options.experimental_prefetchInRender) {\n const hasResultData = nextResult.data !== void 0;\n const isErrorWithoutData = nextResult.status === \"error\" && !hasResultData;\n const finalizeThenableIfPossible = (thenable) => {\n if (isErrorWithoutData) {\n thenable.reject(nextResult.error);\n } else if (hasResultData) {\n thenable.resolve(nextResult.data);\n }\n };\n const recreateThenable = () => {\n const pending = this.#currentThenable = nextResult.promise = pendingThenable();\n finalizeThenableIfPossible(pending);\n };\n const prevThenable = this.#currentThenable;\n switch (prevThenable.status) {\n case \"pending\":\n if (query.queryHash === prevQuery.queryHash) {\n finalizeThenableIfPossible(prevThenable);\n }\n break;\n case \"fulfilled\":\n if (isErrorWithoutData || nextResult.data !== prevThenable.value) {\n recreateThenable();\n }\n break;\n case \"rejected\":\n if (!isErrorWithoutData || nextResult.error !== prevThenable.reason) {\n recreateThenable();\n }\n break;\n }\n }\n return nextResult;\n }\n updateResult() {\n const prevResult = this.#currentResult;\n const nextResult = this.createResult(this.#currentQuery, this.options);\n this.#currentResultState = this.#currentQuery.state;\n this.#currentResultOptions = this.options;\n if (this.#currentResultState.data !== void 0) {\n this.#lastQueryWithDefinedData = this.#currentQuery;\n }\n if (shallowEqualObjects(nextResult, prevResult)) {\n return;\n }\n this.#currentResult = nextResult;\n const shouldNotifyListeners = () => {\n if (!prevResult) {\n return true;\n }\n const { notifyOnChangeProps } = this.options;\n const notifyOnChangePropsValue = typeof notifyOnChangeProps === \"function\" ? notifyOnChangeProps() : notifyOnChangeProps;\n if (notifyOnChangePropsValue === \"all\" || !notifyOnChangePropsValue && !this.#trackedProps.size) {\n return true;\n }\n const includedProps = new Set(\n notifyOnChangePropsValue ?? this.#trackedProps\n );\n if (this.options.throwOnError) {\n includedProps.add(\"error\");\n }\n return Object.keys(this.#currentResult).some((key) => {\n const typedKey = key;\n const changed = this.#currentResult[typedKey] !== prevResult[typedKey];\n return changed && includedProps.has(typedKey);\n });\n };\n this.#notify({ listeners: shouldNotifyListeners() });\n }\n #updateQuery() {\n const query = this.#client.getQueryCache().build(this.#client, this.options);\n if (query === this.#currentQuery) {\n return;\n }\n const prevQuery = this.#currentQuery;\n this.#currentQuery = query;\n this.#currentQueryInitialState = query.state;\n if (this.hasListeners()) {\n prevQuery?.removeObserver(this);\n query.addObserver(this);\n }\n }\n onQueryUpdate() {\n this.updateResult();\n if (this.hasListeners()) {\n this.#updateTimers();\n }\n }\n #notify(notifyOptions) {\n notifyManager.batch(() => {\n if (notifyOptions.listeners) {\n this.listeners.forEach((listener) => {\n listener(this.#currentResult);\n });\n }\n this.#client.getQueryCache().notify({\n query: this.#currentQuery,\n type: \"observerResultsUpdated\"\n });\n });\n }\n};\nfunction shouldLoadOnMount(query, options) {\n return resolveEnabled(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === \"error\" && options.retryOnMount === false);\n}\nfunction shouldFetchOnMount(query, options) {\n return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount);\n}\nfunction shouldFetchOn(query, options, field) {\n if (resolveEnabled(options.enabled, query) !== false && resolveStaleTime(options.staleTime, query) !== \"static\") {\n const value = typeof field === \"function\" ? field(query) : field;\n return value === \"always\" || value !== false && isStale(query, options);\n }\n return false;\n}\nfunction shouldFetchOptionally(query, prevQuery, options, prevOptions) {\n return (query !== prevQuery || resolveEnabled(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== \"error\") && isStale(query, options);\n}\nfunction isStale(query, options) {\n return resolveEnabled(options.enabled, query) !== false && query.isStaleByTime(resolveStaleTime(options.staleTime, query));\n}\nfunction shouldAssignObserverCurrentProperties(observer, optimisticResult) {\n if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) {\n return true;\n }\n return false;\n}\nexport {\n QueryObserver\n};\n//# sourceMappingURL=queryObserver.js.map"],"names":[],"mappings":";;;;;;;AAiBG,IAAC,gBAAgB,cAAc,aAAa;AAAA,EAC7C,YAAY,QAAQ,SAAS;AAC3B,UAAK;AACL,SAAK,UAAU;AACf,SAAK,UA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B,GAAG;AACvE,WAAO;AAAA,EACT;AACA,SAAO;AACT;","x_google_ignoreList":[0]}
@@ -0,0 +1,69 @@
1
+ var defaultTimeoutProvider = {
2
+ // We need the wrapper function syntax below instead of direct references to
3
+ // global setTimeout etc.
4
+ //
5
+ // BAD: `setTimeout: setTimeout`
6
+ // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`
7
+ //
8
+ // If we use direct references here, then anything that wants to spy on or
9
+ // replace the global setTimeout (like tests) won't work since we'll already
10
+ // have a hard reference to the original implementation at the time when this
11
+ // file was imported.
12
+ setTimeout: (callback, delay) => setTimeout(callback, delay),
13
+ clearTimeout: (timeoutId) => clearTimeout(timeoutId),
14
+ setInterval: (callback, delay) => setInterval(callback, delay),
15
+ clearInterval: (intervalId) => clearInterval(intervalId)
16
+ };
17
+ var TimeoutManager = class {
18
+ // We cannot have TimeoutManager<T> as we must instantiate it with a concrete
19
+ // type at app boot; and if we leave that type, then any new timer provider
20
+ // would need to support ReturnType<typeof setTimeout>, which is infeasible.
21
+ //
22
+ // We settle for type safety for the TimeoutProvider type, and accept that
23
+ // this class is unsafe internally to allow for extension.
24
+ #provider = defaultTimeoutProvider;
25
+ #providerCalled = false;
26
+ setTimeoutProvider(provider) {
27
+ if (process.env.NODE_ENV !== "production") {
28
+ if (this.#providerCalled && provider !== this.#provider) {
29
+ console.error(
30
+ `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`,
31
+ { previous: this.#provider, provider }
32
+ );
33
+ }
34
+ }
35
+ this.#provider = provider;
36
+ if (process.env.NODE_ENV !== "production") {
37
+ this.#providerCalled = false;
38
+ }
39
+ }
40
+ setTimeout(callback, delay) {
41
+ if (process.env.NODE_ENV !== "production") {
42
+ this.#providerCalled = true;
43
+ }
44
+ return this.#provider.setTimeout(callback, delay);
45
+ }
46
+ clearTimeout(timeoutId) {
47
+ this.#provider.clearTimeout(timeoutId);
48
+ }
49
+ setInterval(callback, delay) {
50
+ if (process.env.NODE_ENV !== "production") {
51
+ this.#providerCalled = true;
52
+ }
53
+ return this.#provider.setInterval(callback, delay);
54
+ }
55
+ clearInterval(intervalId) {
56
+ this.#provider.clearInterval(intervalId);
57
+ }
58
+ };
59
+ var timeoutManager = new TimeoutManager();
60
+ function systemSetTimeoutZero(callback) {
61
+ setTimeout(callback, 0);
62
+ }
63
+ export {
64
+ TimeoutManager,
65
+ defaultTimeoutProvider,
66
+ systemSetTimeoutZero,
67
+ timeoutManager
68
+ };
69
+ //# sourceMappingURL=timeoutManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeoutManager.js","sources":["../../../../../../node_modules/@tanstack/query-core/build/modern/timeoutManager.js"],"sourcesContent":["// src/timeoutManager.ts\nvar defaultTimeoutProvider = {\n // We need the wrapper function syntax below instead of direct references to\n // global setTimeout etc.\n //\n // BAD: `setTimeout: setTimeout`\n // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`\n //\n // If we use direct references here, then anything that wants to spy on or\n // replace the global setTimeout (like tests) won't work since we'll already\n // have a hard reference to the original implementation at the time when this\n // file was imported.\n setTimeout: (callback, delay) => setTimeout(callback, delay),\n clearTimeout: (timeoutId) => clearTimeout(timeoutId),\n setInterval: (callback, delay) => setInterval(callback, delay),\n clearInterval: (intervalId) => clearInterval(intervalId)\n};\nvar TimeoutManager = class {\n // We cannot have TimeoutManager<T> as we must instantiate it with a concrete\n // type at app boot; and if we leave that type, then any new timer provider\n // would need to support ReturnType<typeof setTimeout>, which is infeasible.\n //\n // We settle for type safety for the TimeoutProvider type, and accept that\n // this class is unsafe internally to allow for extension.\n #provider = defaultTimeoutProvider;\n #providerCalled = false;\n setTimeoutProvider(provider) {\n if (process.env.NODE_ENV !== \"production\") {\n if (this.#providerCalled && provider !== this.#provider) {\n console.error(\n `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`,\n { previous: this.#provider, provider }\n );\n }\n }\n this.#provider = provider;\n if (process.env.NODE_ENV !== \"production\") {\n this.#providerCalled = false;\n }\n }\n setTimeout(callback, delay) {\n if (process.env.NODE_ENV !== \"production\") {\n this.#providerCalled = true;\n }\n return this.#provider.setTimeout(callback, delay);\n }\n clearTimeout(timeoutId) {\n this.#provider.clearTimeout(timeoutId);\n }\n setInterval(callback, delay) {\n if (process.env.NODE_ENV !== \"production\") {\n this.#providerCalled = true;\n }\n return this.#provider.setInterval(callback, delay);\n }\n clearInterval(intervalId) {\n this.#provider.clearInterval(intervalId);\n }\n};\nvar timeoutManager = new TimeoutManager();\nfunction systemSetTimeoutZero(callback) {\n setTimeout(callback, 0);\n}\nexport {\n TimeoutManager,\n defaultTimeoutProvider,\n systemSetTimeoutZero,\n timeoutManager\n};\n//# sourceMappingURL=timeoutManager.js.map"],"names":[],"mappings":"AACG,IAAC,yBAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAW3B,YAAY,CAAC,UAAU,UAAU,WAAW,UAAU,KAAK;AAAA,EAC3D,cAAc,CAAC,cAAc,aAAa,SAAS;AAAA,EACnD,aAAa,CAAC,UAAU,UAAU,YAAY,UAAU,KAAK;AAAA,EAC7D,eAAe,CAAC,eAAe,cAAc,UAAU;AACzD;AACG,IAAC,iBAAiB,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOzB,YAAY;AAAA,EACZ,kBAAkB;AAAA,EAClB,mBAAmB,UAAU;AAC3B,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,UAAI,KAAK,mBAAmB,aAAa,KAAK,WAAW;AACvD,gBAAQ;AAAA,UACN;AAAA,UACA,EAAE,UAAU,KAAK,WAAW,SAAQ;AAAA,QAC9C;AAAA,MACM;AAAA,IACF;AACA,SAAK,YAAY;AACjB,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,WAAK,kBAAkB;AAAA,IACzB;AAAA,EACF;AAAA,EACA,WAAW,UAAU,OAAO;AAC1B,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,WAAK,kBAAkB;AAAA,IACzB;AACA,WAAO,KAAK,UAAU,WAAW,UAAU,KAAK;AAAA,EAClD;AAAA,EACA,aAAa,WAAW;AACtB,SAAK,UAAU,aAAa,SAAS;AAAA,EACvC;AAAA,EACA,YAAY,UAAU,OAAO;AAC3B,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,WAAK,kBAAkB;AAAA,IACzB;AACA,WAAO,KAAK,UAAU,YAAY,UAAU,KAAK;AAAA,EACnD;AAAA,EACA,cAAc,YAAY;AACxB,SAAK,UAAU,cAAc,UAAU;AAAA,EACzC;AACF;AACG,IAAC,iBAAiB,IAAI,eAAc;AACvC,SAAS,qBAAqB,UAAU;AACtC,aAAW,UAAU,CAAC;AACxB;","x_google_ignoreList":[0]}
@@ -14,10 +14,11 @@ function resolveEnabled(enabled, query) {
14
14
  return typeof enabled === "function" ? enabled(query) : enabled;
15
15
  }
16
16
  var hasOwn = Object.prototype.hasOwnProperty;
17
- function replaceEqualDeep(a, b) {
17
+ function replaceEqualDeep(a, b, depth = 0) {
18
18
  if (a === b) {
19
19
  return a;
20
20
  }
21
+ if (depth > 500) return b;
21
22
  const array = isPlainArray(a) && isPlainArray(b);
22
23
  if (!array && !(isPlainObject(a) && isPlainObject(b))) return b;
23
24
  const aItems = array ? a : Object.keys(a);
@@ -39,7 +40,7 @@ function replaceEqualDeep(a, b) {
39
40
  copy[key] = bItem;
40
41
  continue;
41
42
  }
42
- const v = replaceEqualDeep(aItem, bItem);
43
+ const v = replaceEqualDeep(aItem, bItem, depth + 1);
43
44
  copy[key] = v;
44
45
  if (v === aItem) equalItems++;
45
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../../../../node_modules/@tanstack/query-core/build/modern/utils.js"],"sourcesContent":["// src/utils.ts\nvar isServer = typeof window === \"undefined\" || \"Deno\" in globalThis;\nfunction noop() {\n}\nfunction functionalUpdate(updater, input) {\n return typeof updater === \"function\" ? updater(input) : updater;\n}\nfunction isValidTimeout(value) {\n return typeof value === \"number\" && value >= 0 && value !== Infinity;\n}\nfunction timeUntilStale(updatedAt, staleTime) {\n return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);\n}\nfunction resolveStaleTime(staleTime, query) {\n return typeof staleTime === \"function\" ? staleTime(query) : staleTime;\n}\nfunction resolveEnabled(enabled, query) {\n return typeof enabled === \"function\" ? enabled(query) : enabled;\n}\nfunction matchQuery(filters, query) {\n const {\n type = \"all\",\n exact,\n fetchStatus,\n predicate,\n queryKey,\n stale\n } = filters;\n if (queryKey) {\n if (exact) {\n if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {\n return false;\n }\n } else if (!partialMatchKey(query.queryKey, queryKey)) {\n return false;\n }\n }\n if (type !== \"all\") {\n const isActive = query.isActive();\n if (type === \"active\" && !isActive) {\n return false;\n }\n if (type === \"inactive\" && isActive) {\n return false;\n }\n }\n if (typeof stale === \"boolean\" && query.isStale() !== stale) {\n return false;\n }\n if (fetchStatus && fetchStatus !== query.state.fetchStatus) {\n return false;\n }\n if (predicate && !predicate(query)) {\n return false;\n }\n return true;\n}\nfunction matchMutation(filters, mutation) {\n const { exact, status, predicate, mutationKey } = filters;\n if (mutationKey) {\n if (!mutation.options.mutationKey) {\n return false;\n }\n if (exact) {\n if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) {\n return false;\n }\n } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {\n return false;\n }\n }\n if (status && mutation.state.status !== status) {\n return false;\n }\n if (predicate && !predicate(mutation)) {\n return false;\n }\n return true;\n}\nfunction hashQueryKeyByOptions(queryKey, options) {\n const hashFn = options?.queryKeyHashFn || hashKey;\n return hashFn(queryKey);\n}\nfunction hashKey(queryKey) {\n return JSON.stringify(\n queryKey,\n (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => {\n result[key] = val[key];\n return result;\n }, {}) : val\n );\n}\nfunction partialMatchKey(a, b) {\n if (a === b) {\n return true;\n }\n if (typeof a !== typeof b) {\n return false;\n }\n if (a && b && typeof a === \"object\" && typeof b === \"object\") {\n return Object.keys(b).every((key) => partialMatchKey(a[key], b[key]));\n }\n return false;\n}\nvar hasOwn = Object.prototype.hasOwnProperty;\nfunction replaceEqualDeep(a, b) {\n if (a === b) {\n return a;\n }\n const array = isPlainArray(a) && isPlainArray(b);\n if (!array && !(isPlainObject(a) && isPlainObject(b))) return b;\n const aItems = array ? a : Object.keys(a);\n const aSize = aItems.length;\n const bItems = array ? b : Object.keys(b);\n const bSize = bItems.length;\n const copy = array ? new Array(bSize) : {};\n let equalItems = 0;\n for (let i = 0; i < bSize; i++) {\n const key = array ? i : bItems[i];\n const aItem = a[key];\n const bItem = b[key];\n if (aItem === bItem) {\n copy[key] = aItem;\n if (array ? i < aSize : hasOwn.call(a, key)) equalItems++;\n continue;\n }\n if (aItem === null || bItem === null || typeof aItem !== \"object\" || typeof bItem !== \"object\") {\n copy[key] = bItem;\n continue;\n }\n const v = replaceEqualDeep(aItem, bItem);\n copy[key] = v;\n if (v === aItem) equalItems++;\n }\n return aSize === bSize && equalItems === aSize ? a : copy;\n}\nfunction shallowEqualObjects(a, b) {\n if (!b || Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n for (const key in a) {\n if (a[key] !== b[key]) {\n return false;\n }\n }\n return true;\n}\nfunction isPlainArray(value) {\n return Array.isArray(value) && value.length === Object.keys(value).length;\n}\nfunction isPlainObject(o) {\n if (!hasObjectPrototype(o)) {\n return false;\n }\n const ctor = o.constructor;\n if (ctor === void 0) {\n return true;\n }\n const prot = ctor.prototype;\n if (!hasObjectPrototype(prot)) {\n return false;\n }\n if (!prot.hasOwnProperty(\"isPrototypeOf\")) {\n return false;\n }\n if (Object.getPrototypeOf(o) !== Object.prototype) {\n return false;\n }\n return true;\n}\nfunction hasObjectPrototype(o) {\n return Object.prototype.toString.call(o) === \"[object Object]\";\n}\nfunction sleep(timeout) {\n return new Promise((resolve) => {\n setTimeout(resolve, timeout);\n });\n}\nfunction replaceData(prevData, data, options) {\n if (typeof options.structuralSharing === \"function\") {\n return options.structuralSharing(prevData, data);\n } else if (options.structuralSharing !== false) {\n if (process.env.NODE_ENV !== \"production\") {\n try {\n return replaceEqualDeep(prevData, data);\n } catch (error) {\n console.error(\n `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`\n );\n throw error;\n }\n }\n return replaceEqualDeep(prevData, data);\n }\n return data;\n}\nfunction keepPreviousData(previousData) {\n return previousData;\n}\nfunction addToEnd(items, item, max = 0) {\n const newItems = [...items, item];\n return max && newItems.length > max ? newItems.slice(1) : newItems;\n}\nfunction addToStart(items, item, max = 0) {\n const newItems = [item, ...items];\n return max && newItems.length > max ? newItems.slice(0, -1) : newItems;\n}\nvar skipToken = Symbol();\nfunction ensureQueryFn(options, fetchOptions) {\n if (process.env.NODE_ENV !== \"production\") {\n if (options.queryFn === skipToken) {\n console.error(\n `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'`\n );\n }\n }\n if (!options.queryFn && fetchOptions?.initialPromise) {\n return () => fetchOptions.initialPromise;\n }\n if (!options.queryFn || options.queryFn === skipToken) {\n return () => Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`));\n }\n return options.queryFn;\n}\nfunction shouldThrowError(throwOnError, params) {\n if (typeof throwOnError === \"function\") {\n return throwOnError(...params);\n }\n return !!throwOnError;\n}\nexport {\n addToEnd,\n addToStart,\n ensureQueryFn,\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n isPlainArray,\n isPlainObject,\n isServer,\n isValidTimeout,\n keepPreviousData,\n matchMutation,\n matchQuery,\n noop,\n partialMatchKey,\n replaceData,\n replaceEqualDeep,\n resolveEnabled,\n resolveStaleTime,\n shallowEqualObjects,\n shouldThrowError,\n skipToken,\n sleep,\n timeUntilStale\n};\n//# sourceMappingURL=utils.js.map"],"names":[],"mappings":"AACG,IAAC,WAAW,OAAO,WAAW,eAA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A,MACxC,SAAS,OAAO;AACd,gBAAQ;AAAA,UACN,0JAA0J,QAAQ,SAAS,MAAM,KAAK;AAAA,QAChM;AACQ,cAAM;AAAA,MACR;AAAA,IACF;AACA,WAAO,iBAAiB,UAAU,IAAI;AAAA,EACxC;AACA,SAAO;AACT;AA6BA,SAAS,iBAAiB,cAAc,QAAQ;AAC9C,MAAI,OAAO,iBAAiB,YAAY;AACtC,WAAO,aAAa,GAAG,MAAM;AAAA,EAC/B;AACA,SAAO,CAAC,CAAC;AACX;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"utils.js","sources":["../../../../../../node_modules/@tanstack/query-core/build/modern/utils.js"],"sourcesContent":["// src/utils.ts\nimport { timeoutManager } from \"./timeoutManager.js\";\nvar isServer = typeof window === \"undefined\" || \"Deno\" in globalThis;\nfunction noop() {\n}\nfunction functionalUpdate(updater, input) {\n return typeof updater === \"function\" ? updater(input) : updater;\n}\nfunction isValidTimeout(value) {\n return typeof value === \"number\" && value >= 0 && value !== Infinity;\n}\nfunction timeUntilStale(updatedAt, staleTime) {\n return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);\n}\nfunction resolveStaleTime(staleTime, query) {\n return typeof staleTime === \"function\" ? staleTime(query) : staleTime;\n}\nfunction resolveEnabled(enabled, query) {\n return typeof enabled === \"function\" ? enabled(query) : enabled;\n}\nfunction matchQuery(filters, query) {\n const {\n type = \"all\",\n exact,\n fetchStatus,\n predicate,\n queryKey,\n stale\n } = filters;\n if (queryKey) {\n if (exact) {\n if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {\n return false;\n }\n } else if (!partialMatchKey(query.queryKey, queryKey)) {\n return false;\n }\n }\n if (type !== \"all\") {\n const isActive = query.isActive();\n if (type === \"active\" && !isActive) {\n return false;\n }\n if (type === \"inactive\" && isActive) {\n return false;\n }\n }\n if (typeof stale === \"boolean\" && query.isStale() !== stale) {\n return false;\n }\n if (fetchStatus && fetchStatus !== query.state.fetchStatus) {\n return false;\n }\n if (predicate && !predicate(query)) {\n return false;\n }\n return true;\n}\nfunction matchMutation(filters, mutation) {\n const { exact, status, predicate, mutationKey } = filters;\n if (mutationKey) {\n if (!mutation.options.mutationKey) {\n return false;\n }\n if (exact) {\n if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) {\n return false;\n }\n } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {\n return false;\n }\n }\n if (status && mutation.state.status !== status) {\n return false;\n }\n if (predicate && !predicate(mutation)) {\n return false;\n }\n return true;\n}\nfunction hashQueryKeyByOptions(queryKey, options) {\n const hashFn = options?.queryKeyHashFn || hashKey;\n return hashFn(queryKey);\n}\nfunction hashKey(queryKey) {\n return JSON.stringify(\n queryKey,\n (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => {\n result[key] = val[key];\n return result;\n }, {}) : val\n );\n}\nfunction partialMatchKey(a, b) {\n if (a === b) {\n return true;\n }\n if (typeof a !== typeof b) {\n return false;\n }\n if (a && b && typeof a === \"object\" && typeof b === \"object\") {\n return Object.keys(b).every((key) => partialMatchKey(a[key], b[key]));\n }\n return false;\n}\nvar hasOwn = Object.prototype.hasOwnProperty;\nfunction replaceEqualDeep(a, b, depth = 0) {\n if (a === b) {\n return a;\n }\n if (depth > 500) return b;\n const array = isPlainArray(a) && isPlainArray(b);\n if (!array && !(isPlainObject(a) && isPlainObject(b))) return b;\n const aItems = array ? a : Object.keys(a);\n const aSize = aItems.length;\n const bItems = array ? b : Object.keys(b);\n const bSize = bItems.length;\n const copy = array ? new Array(bSize) : {};\n let equalItems = 0;\n for (let i = 0; i < bSize; i++) {\n const key = array ? i : bItems[i];\n const aItem = a[key];\n const bItem = b[key];\n if (aItem === bItem) {\n copy[key] = aItem;\n if (array ? i < aSize : hasOwn.call(a, key)) equalItems++;\n continue;\n }\n if (aItem === null || bItem === null || typeof aItem !== \"object\" || typeof bItem !== \"object\") {\n copy[key] = bItem;\n continue;\n }\n const v = replaceEqualDeep(aItem, bItem, depth + 1);\n copy[key] = v;\n if (v === aItem) equalItems++;\n }\n return aSize === bSize && equalItems === aSize ? a : copy;\n}\nfunction shallowEqualObjects(a, b) {\n if (!b || Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n for (const key in a) {\n if (a[key] !== b[key]) {\n return false;\n }\n }\n return true;\n}\nfunction isPlainArray(value) {\n return Array.isArray(value) && value.length === Object.keys(value).length;\n}\nfunction isPlainObject(o) {\n if (!hasObjectPrototype(o)) {\n return false;\n }\n const ctor = o.constructor;\n if (ctor === void 0) {\n return true;\n }\n const prot = ctor.prototype;\n if (!hasObjectPrototype(prot)) {\n return false;\n }\n if (!prot.hasOwnProperty(\"isPrototypeOf\")) {\n return false;\n }\n if (Object.getPrototypeOf(o) !== Object.prototype) {\n return false;\n }\n return true;\n}\nfunction hasObjectPrototype(o) {\n return Object.prototype.toString.call(o) === \"[object Object]\";\n}\nfunction sleep(timeout) {\n return new Promise((resolve) => {\n timeoutManager.setTimeout(resolve, timeout);\n });\n}\nfunction replaceData(prevData, data, options) {\n if (typeof options.structuralSharing === \"function\") {\n return options.structuralSharing(prevData, data);\n } else if (options.structuralSharing !== false) {\n if (process.env.NODE_ENV !== \"production\") {\n try {\n return replaceEqualDeep(prevData, data);\n } catch (error) {\n console.error(\n `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`\n );\n throw error;\n }\n }\n return replaceEqualDeep(prevData, data);\n }\n return data;\n}\nfunction keepPreviousData(previousData) {\n return previousData;\n}\nfunction addToEnd(items, item, max = 0) {\n const newItems = [...items, item];\n return max && newItems.length > max ? newItems.slice(1) : newItems;\n}\nfunction addToStart(items, item, max = 0) {\n const newItems = [item, ...items];\n return max && newItems.length > max ? newItems.slice(0, -1) : newItems;\n}\nvar skipToken = /* @__PURE__ */ Symbol();\nfunction ensureQueryFn(options, fetchOptions) {\n if (process.env.NODE_ENV !== \"production\") {\n if (options.queryFn === skipToken) {\n console.error(\n `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'`\n );\n }\n }\n if (!options.queryFn && fetchOptions?.initialPromise) {\n return () => fetchOptions.initialPromise;\n }\n if (!options.queryFn || options.queryFn === skipToken) {\n return () => Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`));\n }\n return options.queryFn;\n}\nfunction shouldThrowError(throwOnError, params) {\n if (typeof throwOnError === \"function\") {\n return throwOnError(...params);\n }\n return !!throwOnError;\n}\nfunction addConsumeAwareSignal(object, getSignal, onCancelled) {\n let consumed = false;\n let signal;\n Object.defineProperty(object, \"signal\", {\n enumerable: true,\n get: () => {\n signal ??= getSignal();\n if (consumed) {\n return signal;\n }\n consumed = true;\n if (signal.aborted) {\n onCancelled();\n } else {\n signal.addEventListener(\"abort\", onCancelled, { once: true });\n }\n return signal;\n }\n });\n return object;\n}\nexport {\n addConsumeAwareSignal,\n addToEnd,\n addToStart,\n ensureQueryFn,\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n isPlainArray,\n isPlainObject,\n isServer,\n isValidTimeout,\n keepPreviousData,\n matchMutation,\n matchQuery,\n noop,\n partialMatchKey,\n replaceData,\n replaceEqualDeep,\n resolveEnabled,\n resolveStaleTime,\n shallowEqualObjects,\n shouldThrowError,\n skipToken,\n sleep,\n timeUntilStale\n};\n//# sourceMappingURL=utils.js.map"],"names":[],"mappings":"AAEG,IAAC,WAAW,OAAO,WAAW,eAAe,UAAU;AAC1D,SAAS,OAAO;AAChB;AAIA,SAAS,eAAe,OAAO;AAC7B,SAAO,OAAO,UAAU,YAAY,SAAS,KAAK,UAAU;AAC9D;AACA,SAAS,eAAe,WAAW,WAAW;AAC5C,SAAO,KAAK,IAAI,aAAa,aAAa,KAAK,KAAK,IAAG,GAAI,CAAC;AAC9D;AACA,SAAS,iBAAiB,WAAW,OAAO;AAC1C,SAAO,OAAO,cAAc,aAAa,UAAU,KAAK,IAAI;AAC9D;AACA,SAAS,eAAe,SAAS,OAAO;AAC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;AAAA,EAC/B;AACA,SAAO,CAAC,CAAC;AACX;","x_google_ignoreList":[0]}
@@ -1,7 +1,8 @@
1
1
  import { shouldThrowError } from "../../../query-core/build/modern/utils.js";
2
2
  const React = window["React"];
3
- var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => {
4
- if (options.suspense || options.throwOnError || options.experimental_prefetchInRender) {
3
+ var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary, query) => {
4
+ const throwOnError = query?.state.error && typeof options.throwOnError === "function" ? shouldThrowError(options.throwOnError, [query.state.error, query]) : options.throwOnError;
5
+ if (options.suspense || options.experimental_prefetchInRender || throwOnError) {
5
6
  if (!errorResetBoundary.isReset()) {
6
7
  options.retryOnMount = false;
7
8
  }