| @@ -1,1578 +1,6750 @@ | ||
| 1 | -(function(_wordpress_i18n, react, react_dom, _elementor_ui, _elementor_query, _elementor_icons, _elementor_editor_app_bar, _elementor_icons_SpeakerphoneIcon) { | |
| 1 | +/*! elementor - v3.19.0 - 07-02-2024 */ | |
| 2 | +/******/ (() => { // webpackBootstrap | |
| 3 | +/******/ var __webpack_modules__ = ({ | |
| 2 | 4 | |
| 3 | -//#region \0rolldown/runtime.js | |
| 4 | - var __create = Object.create; | |
| 5 | - var __defProp = Object.defineProperty; | |
| 6 | - var __name = (target, value) => __defProp(target, "name", { | |
| 7 | - value, | |
| 8 | - configurable: true | |
| 9 | - }); | |
| 10 | - var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 11 | - var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 12 | - var __getProtoOf = Object.getPrototypeOf; | |
| 13 | - var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 14 | - var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports); | |
| 15 | - var __copyProps = (to, from, except, desc) => { | |
| 16 | - if (from && typeof from === "object" || typeof from === "function") { | |
| 17 | - for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) { | |
| 18 | - key = keys[i]; | |
| 19 | - if (!__hasOwnProp.call(to, key) && key !== except) { | |
| 20 | - __defProp(to, key, { | |
| 21 | - get: ((k) => from[k]).bind(null, key), | |
| 22 | - enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable | |
| 23 | - }); | |
| 24 | - } | |
| 25 | - } | |
| 5 | +/***/ "../node_modules/@elementor/query/dist/index.js": | |
| 6 | +/*!******************************************************!*\ | |
| 7 | + !*** ../node_modules/@elementor/query/dist/index.js ***! | |
| 8 | + \******************************************************/ | |
| 9 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 10 | + | |
| 11 | +"use strict"; | |
| 12 | + | |
| 13 | +var __defProp = Object.defineProperty; | |
| 14 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 15 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 16 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 17 | +var __export = (target, all) => { | |
| 18 | + for (var name in all) | |
| 19 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 20 | +}; | |
| 21 | +var __copyProps = (to, from, except, desc) => { | |
| 22 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 23 | + for (let key of __getOwnPropNames(from)) | |
| 24 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 25 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 26 | + } | |
| 27 | + return to; | |
| 28 | +}; | |
| 29 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 30 | + | |
| 31 | +// src/index.ts | |
| 32 | +var src_exports = {}; | |
| 33 | +__export(src_exports, { | |
| 34 | + QueryClient: () => import_react_query2.QueryClient, | |
| 35 | + QueryClientProvider: () => import_react_query2.QueryClientProvider, | |
| 36 | + createQueryClient: () => createQueryClient, | |
| 37 | + useMutation: () => import_react_query2.useMutation, | |
| 38 | + useQuery: () => import_react_query2.useQuery, | |
| 39 | + useQueryClient: () => import_react_query2.useQueryClient | |
| 40 | +}); | |
| 41 | +module.exports = __toCommonJS(src_exports); | |
| 42 | +var import_react_query = __webpack_require__(/*! @tanstack/react-query */ "../node_modules/@tanstack/react-query/build/modern/index.cjs"); | |
| 43 | +var import_react_query2 = __webpack_require__(/*! @tanstack/react-query */ "../node_modules/@tanstack/react-query/build/modern/index.cjs"); | |
| 44 | +function createQueryClient() { | |
| 45 | + return new import_react_query.QueryClient({ | |
| 46 | + defaultOptions: { | |
| 47 | + queries: { | |
| 48 | + refetchOnWindowFocus: false, | |
| 49 | + refetchOnReconnect: false | |
| 50 | + } | |
| 51 | + } | |
| 52 | + }); | |
| 53 | +} | |
| 54 | +// Annotate the CommonJS export names for ESM import in node: | |
| 55 | +0 && (0); | |
| 56 | +//# sourceMappingURL=index.js.map | |
| 57 | + | |
| 58 | +/***/ }), | |
| 59 | + | |
| 60 | +/***/ "../modules/notifications/assets/js/api/index.js": | |
| 61 | +/*!*******************************************************!*\ | |
| 62 | + !*** ../modules/notifications/assets/js/api/index.js ***! | |
| 63 | + \*******************************************************/ | |
| 64 | +/***/ ((__unused_webpack_module, exports) => { | |
| 65 | + | |
| 66 | +"use strict"; | |
| 67 | + | |
| 68 | + | |
| 69 | +Object.defineProperty(exports, "__esModule", ({ | |
| 70 | + value: true | |
| 71 | +})); | |
| 72 | +exports.getNotifications = void 0; | |
| 73 | +var request = function request(endpoint) { | |
| 74 | + var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
| 75 | + return new Promise(function (resolve, reject) { | |
| 76 | + elementorCommon.ajax.addRequest(endpoint, { | |
| 77 | + success: resolve, | |
| 78 | + error: reject, | |
| 79 | + data: data | |
| 80 | + }); | |
| 81 | + }); | |
| 82 | +}; | |
| 83 | +var getNotifications = function getNotifications() { | |
| 84 | + return request('notifications_get'); | |
| 85 | +}; | |
| 86 | +exports.getNotifications = getNotifications; | |
| 87 | + | |
| 88 | +/***/ }), | |
| 89 | + | |
| 90 | +/***/ "../modules/notifications/assets/js/components/editor-v1.js": | |
| 91 | +/*!******************************************************************!*\ | |
| 92 | + !*** ../modules/notifications/assets/js/components/editor-v1.js ***! | |
| 93 | + \******************************************************************/ | |
| 94 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 95 | + | |
| 96 | +"use strict"; | |
| 97 | + | |
| 98 | + | |
| 99 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 100 | +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 101 | +Object.defineProperty(exports, "__esModule", ({ | |
| 102 | + value: true | |
| 103 | +})); | |
| 104 | +exports.EditorV1 = void 0; | |
| 105 | +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); | |
| 106 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 107 | +var _whatsNew = __webpack_require__(/*! ./whats-new */ "../modules/notifications/assets/js/components/whats-new.js"); | |
| 108 | +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | |
| 109 | +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | |
| 110 | +var EditorV1 = function EditorV1() { | |
| 111 | + var _useState = (0, _react.useState)(true), | |
| 112 | + _useState2 = (0, _slicedToArray2.default)(_useState, 2), | |
| 113 | + isOpen = _useState2[0], | |
| 114 | + setIsOpen = _useState2[1]; | |
| 115 | + var _useState3 = (0, _react.useState)(false), | |
| 116 | + _useState4 = (0, _slicedToArray2.default)(_useState3, 2), | |
| 117 | + isRead = _useState4[0], | |
| 118 | + setIsRead = _useState4[1]; | |
| 119 | + (0, _react.useEffect)(function () { | |
| 120 | + elementor.on('elementor/editor/panel/whats-new/clicked', function () { | |
| 121 | + return setIsOpen(true); | |
| 122 | + }); | |
| 123 | + }, []); | |
| 124 | + (0, _react.useEffect)(function () { | |
| 125 | + document.body.classList.remove('e-has-notification'); | |
| 126 | + }, [isRead]); | |
| 127 | + return /*#__PURE__*/_react.default.createElement(_whatsNew.WhatsNew, { | |
| 128 | + isOpen: isOpen, | |
| 129 | + setIsOpen: setIsOpen, | |
| 130 | + setIsRead: setIsRead, | |
| 131 | + anchorPosition: "left" | |
| 132 | + }); | |
| 133 | +}; | |
| 134 | +exports.EditorV1 = EditorV1; | |
| 135 | + | |
| 136 | +/***/ }), | |
| 137 | + | |
| 138 | +/***/ "../modules/notifications/assets/js/components/whats-new-drawer-content.js": | |
| 139 | +/*!*********************************************************************************!*\ | |
| 140 | + !*** ../modules/notifications/assets/js/components/whats-new-drawer-content.js ***! | |
| 141 | + \*********************************************************************************/ | |
| 142 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 143 | + | |
| 144 | +"use strict"; | |
| 145 | + | |
| 146 | + | |
| 147 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 148 | +Object.defineProperty(exports, "__esModule", ({ | |
| 149 | + value: true | |
| 150 | +})); | |
| 151 | +exports.WhatsNewDrawerContent = void 0; | |
| 152 | +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 153 | +var _query = __webpack_require__(/*! @elementor/query */ "../node_modules/@elementor/query/dist/index.js"); | |
| 154 | +var _api = __webpack_require__(/*! ../api */ "../modules/notifications/assets/js/api/index.js"); | |
| 155 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 156 | +var _whatsNewItem = __webpack_require__(/*! ./whats-new-item */ "../modules/notifications/assets/js/components/whats-new-item.js"); | |
| 157 | +var WhatsNewDrawerContent = function WhatsNewDrawerContent() { | |
| 158 | + var _useQuery = (0, _query.useQuery)({ | |
| 159 | + queryKey: ['e-notifications'], | |
| 160 | + queryFn: _api.getNotifications | |
| 161 | + }), | |
| 162 | + isPending = _useQuery.isPending, | |
| 163 | + error = _useQuery.error, | |
| 164 | + items = _useQuery.data; | |
| 165 | + if (isPending) { | |
| 166 | + return /*#__PURE__*/_react.default.createElement(_ui.Box, null, /*#__PURE__*/_react.default.createElement(_ui.LinearProgress, { | |
| 167 | + color: "secondary" | |
| 168 | + })); | |
| 169 | + } | |
| 170 | + if (error) { | |
| 171 | + return /*#__PURE__*/_react.default.createElement(_ui.Box, null, "An error has occurred: ", error); | |
| 172 | + } | |
| 173 | + return items.map(function (item, itemIndex) { | |
| 174 | + return /*#__PURE__*/_react.default.createElement(_whatsNewItem.WhatsNewItem, { | |
| 175 | + key: itemIndex, | |
| 176 | + item: item, | |
| 177 | + itemIndex: itemIndex, | |
| 178 | + itemsLength: items.length | |
| 179 | + }); | |
| 180 | + }); | |
| 181 | +}; | |
| 182 | +exports.WhatsNewDrawerContent = WhatsNewDrawerContent; | |
| 183 | + | |
| 184 | +/***/ }), | |
| 185 | + | |
| 186 | +/***/ "../modules/notifications/assets/js/components/whats-new-item-chips.js": | |
| 187 | +/*!*****************************************************************************!*\ | |
| 188 | + !*** ../modules/notifications/assets/js/components/whats-new-item-chips.js ***! | |
| 189 | + \*****************************************************************************/ | |
| 190 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 191 | + | |
| 192 | +"use strict"; | |
| 193 | +/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 194 | + | |
| 195 | + | |
| 196 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 197 | +Object.defineProperty(exports, "__esModule", ({ | |
| 198 | + value: true | |
| 199 | +})); | |
| 200 | +exports.WhatsNewItemChips = void 0; | |
| 201 | +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 202 | +var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); | |
| 203 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 204 | +var WhatsNewItemChips = function WhatsNewItemChips(_ref) { | |
| 205 | + var chipPlan = _ref.chipPlan, | |
| 206 | + chipTags = _ref.chipTags, | |
| 207 | + itemIndex = _ref.itemIndex; | |
| 208 | + var chips = []; | |
| 209 | + if (chipPlan) { | |
| 210 | + chips.push({ | |
| 211 | + color: 'promotion', | |
| 212 | + size: 'small', | |
| 213 | + label: chipPlan | |
| 214 | + }); | |
| 215 | + } | |
| 216 | + if (chipTags) { | |
| 217 | + chipTags.forEach(function (chipTag) { | |
| 218 | + chips.push({ | |
| 219 | + variant: 'outlined', | |
| 220 | + size: 'small', | |
| 221 | + label: chipTag | |
| 222 | + }); | |
| 223 | + }); | |
| 224 | + } | |
| 225 | + if (!chips.length) { | |
| 226 | + return null; | |
| 227 | + } | |
| 228 | + return /*#__PURE__*/_react.default.createElement(_ui.Stack, { | |
| 229 | + direction: "row", | |
| 230 | + flexWrap: "wrap", | |
| 231 | + gap: 1, | |
| 232 | + sx: { | |
| 233 | + pb: 1 | |
| 234 | + } | |
| 235 | + }, chips.map(function (chip, chipIndex) { | |
| 236 | + return /*#__PURE__*/_react.default.createElement(_ui.Chip, (0, _extends2.default)({ | |
| 237 | + key: "chip-".concat(itemIndex).concat(chipIndex) | |
| 238 | + }, chip)); | |
| 239 | + })); | |
| 240 | +}; | |
| 241 | +exports.WhatsNewItemChips = WhatsNewItemChips; | |
| 242 | +WhatsNewItemChips.propTypes = { | |
| 243 | + chipPlan: PropTypes.string, | |
| 244 | + chipTags: PropTypes.array, | |
| 245 | + itemIndex: PropTypes.number.isRequired | |
| 246 | +}; | |
| 247 | + | |
| 248 | +/***/ }), | |
| 249 | + | |
| 250 | +/***/ "../modules/notifications/assets/js/components/whats-new-item-thumbnail.js": | |
| 251 | +/*!*********************************************************************************!*\ | |
| 252 | + !*** ../modules/notifications/assets/js/components/whats-new-item-thumbnail.js ***! | |
| 253 | + \*********************************************************************************/ | |
| 254 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 255 | + | |
| 256 | +"use strict"; | |
| 257 | +/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 258 | + | |
| 259 | + | |
| 260 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 261 | +Object.defineProperty(exports, "__esModule", ({ | |
| 262 | + value: true | |
| 263 | +})); | |
| 264 | +exports.WhatsNewItemThumbnail = void 0; | |
| 265 | +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 266 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 267 | +var _wrapperWithLink = __webpack_require__(/*! ./wrapper-with-link */ "../modules/notifications/assets/js/components/wrapper-with-link.js"); | |
| 268 | +var WhatsNewItemThumbnail = function WhatsNewItemThumbnail(_ref) { | |
| 269 | + var imageSrc = _ref.imageSrc, | |
| 270 | + title = _ref.title, | |
| 271 | + link = _ref.link; | |
| 272 | + return /*#__PURE__*/_react.default.createElement(_ui.Box, { | |
| 273 | + sx: { | |
| 274 | + pb: 2 | |
| 275 | + } | |
| 276 | + }, /*#__PURE__*/_react.default.createElement(_wrapperWithLink.WrapperWithLink, { | |
| 277 | + link: link | |
| 278 | + }, /*#__PURE__*/_react.default.createElement("img", { | |
| 279 | + src: imageSrc, | |
| 280 | + alt: title, | |
| 281 | + style: { | |
| 282 | + maxWidth: '100%' | |
| 283 | + } | |
| 284 | + }))); | |
| 285 | +}; | |
| 286 | +exports.WhatsNewItemThumbnail = WhatsNewItemThumbnail; | |
| 287 | +WhatsNewItemThumbnail.propTypes = { | |
| 288 | + imageSrc: PropTypes.string.isRequired, | |
| 289 | + title: PropTypes.string.isRequired, | |
| 290 | + link: PropTypes.string | |
| 291 | +}; | |
| 292 | + | |
| 293 | +/***/ }), | |
| 294 | + | |
| 295 | +/***/ "../modules/notifications/assets/js/components/whats-new-item-topic-line.js": | |
| 296 | +/*!**********************************************************************************!*\ | |
| 297 | + !*** ../modules/notifications/assets/js/components/whats-new-item-topic-line.js ***! | |
| 298 | + \**********************************************************************************/ | |
| 299 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 300 | + | |
| 301 | +"use strict"; | |
| 302 | +/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 303 | + | |
| 304 | + | |
| 305 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 306 | +Object.defineProperty(exports, "__esModule", ({ | |
| 307 | + value: true | |
| 308 | +})); | |
| 309 | +exports.WhatsNewItemTopicLine = void 0; | |
| 310 | +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 311 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 312 | +var WhatsNewItemTopicLine = function WhatsNewItemTopicLine(_ref) { | |
| 313 | + var topic = _ref.topic, | |
| 314 | + date = _ref.date; | |
| 315 | + return /*#__PURE__*/_react.default.createElement(_ui.Stack, { | |
| 316 | + direction: "row", | |
| 317 | + divider: /*#__PURE__*/_react.default.createElement(_ui.Divider, { | |
| 318 | + orientation: "vertical", | |
| 319 | + flexItem: true | |
| 320 | + }), | |
| 321 | + spacing: 1, | |
| 322 | + color: "text.tertiary", | |
| 323 | + sx: { | |
| 324 | + pb: 1 | |
| 325 | + } | |
| 326 | + }, topic && /*#__PURE__*/_react.default.createElement(_ui.Box, null, topic), date && /*#__PURE__*/_react.default.createElement(_ui.Box, null, date)); | |
| 327 | +}; | |
| 328 | +exports.WhatsNewItemTopicLine = WhatsNewItemTopicLine; | |
| 329 | +WhatsNewItemTopicLine.propTypes = { | |
| 330 | + topic: PropTypes.string, | |
| 331 | + date: PropTypes.string | |
| 332 | +}; | |
| 333 | + | |
| 334 | +/***/ }), | |
| 335 | + | |
| 336 | +/***/ "../modules/notifications/assets/js/components/whats-new-item.js": | |
| 337 | +/*!***********************************************************************!*\ | |
| 338 | + !*** ../modules/notifications/assets/js/components/whats-new-item.js ***! | |
| 339 | + \***********************************************************************/ | |
| 340 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 341 | + | |
| 342 | +"use strict"; | |
| 343 | +/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 344 | + | |
| 345 | + | |
| 346 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 347 | +Object.defineProperty(exports, "__esModule", ({ | |
| 348 | + value: true | |
| 349 | +})); | |
| 350 | +exports.WhatsNewItem = void 0; | |
| 351 | +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 352 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 353 | +var _whatsNewItemTopicLine = __webpack_require__(/*! ./whats-new-item-topic-line */ "../modules/notifications/assets/js/components/whats-new-item-topic-line.js"); | |
| 354 | +var _wrapperWithLink = __webpack_require__(/*! ./wrapper-with-link */ "../modules/notifications/assets/js/components/wrapper-with-link.js"); | |
| 355 | +var _whatsNewItemThumbnail = __webpack_require__(/*! ./whats-new-item-thumbnail */ "../modules/notifications/assets/js/components/whats-new-item-thumbnail.js"); | |
| 356 | +var _whatsNewItemChips = __webpack_require__(/*! ./whats-new-item-chips */ "../modules/notifications/assets/js/components/whats-new-item-chips.js"); | |
| 357 | +var WhatsNewItem = function WhatsNewItem(_ref) { | |
| 358 | + var item = _ref.item, | |
| 359 | + itemIndex = _ref.itemIndex, | |
| 360 | + itemsLength = _ref.itemsLength; | |
| 361 | + return /*#__PURE__*/_react.default.createElement(_ui.Box, { | |
| 362 | + key: itemIndex, | |
| 363 | + display: "flex", | |
| 364 | + flexDirection: "column", | |
| 365 | + sx: { | |
| 366 | + pt: 2 | |
| 367 | + } | |
| 368 | + }, (item.topic || item.date) && /*#__PURE__*/_react.default.createElement(_whatsNewItemTopicLine.WhatsNewItemTopicLine, { | |
| 369 | + topic: item.topic, | |
| 370 | + date: item.date | |
| 371 | + }), /*#__PURE__*/_react.default.createElement(_wrapperWithLink.WrapperWithLink, { | |
| 372 | + link: item.link | |
| 373 | + }, /*#__PURE__*/_react.default.createElement(_ui.Typography, { | |
| 374 | + variant: "subtitle1", | |
| 375 | + sx: { | |
| 376 | + pb: 2 | |
| 377 | + } | |
| 378 | + }, item.title)), item.imageSrc && /*#__PURE__*/_react.default.createElement(_whatsNewItemThumbnail.WhatsNewItemThumbnail, { | |
| 379 | + imageSrc: item.imageSrc, | |
| 380 | + link: item.link, | |
| 381 | + title: item.title | |
| 382 | + }), /*#__PURE__*/_react.default.createElement(_whatsNewItemChips.WhatsNewItemChips, { | |
| 383 | + chipPlan: item.chipPlan, | |
| 384 | + chipTags: item.chipTags, | |
| 385 | + itemIndex: itemIndex | |
| 386 | + }), item.description && /*#__PURE__*/_react.default.createElement(_ui.Typography, { | |
| 387 | + variant: "body2", | |
| 388 | + color: "text.secondary", | |
| 389 | + sx: { | |
| 390 | + pb: 2 | |
| 391 | + } | |
| 392 | + }, item.description, item.readMoreText && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, ' ', /*#__PURE__*/_react.default.createElement(_ui.Link, { | |
| 393 | + href: item.link, | |
| 394 | + color: "info.main", | |
| 395 | + target: "_blank" | |
| 396 | + }, item.readMoreText))), item.cta && item.ctaLink && /*#__PURE__*/_react.default.createElement(_ui.Box, { | |
| 397 | + sx: { | |
| 398 | + pb: 2 | |
| 399 | + } | |
| 400 | + }, /*#__PURE__*/_react.default.createElement(_ui.Button, { | |
| 401 | + href: item.ctaLink, | |
| 402 | + target: "_blank", | |
| 403 | + variant: "contained", | |
| 404 | + size: "small", | |
| 405 | + color: "promotion" | |
| 406 | + }, item.cta)), itemIndex !== itemsLength - 1 && /*#__PURE__*/_react.default.createElement(_ui.Divider, { | |
| 407 | + sx: { | |
| 408 | + my: 1 | |
| 409 | + } | |
| 410 | + })); | |
| 411 | +}; | |
| 412 | +exports.WhatsNewItem = WhatsNewItem; | |
| 413 | +WhatsNewItem.propTypes = { | |
| 414 | + item: PropTypes.object.isRequired, | |
| 415 | + itemIndex: PropTypes.number.isRequired, | |
| 416 | + itemsLength: PropTypes.number.isRequired | |
| 417 | +}; | |
| 418 | + | |
| 419 | +/***/ }), | |
| 420 | + | |
| 421 | +/***/ "../modules/notifications/assets/js/components/whats-new-top-bar.js": | |
| 422 | +/*!**************************************************************************!*\ | |
| 423 | + !*** ../modules/notifications/assets/js/components/whats-new-top-bar.js ***! | |
| 424 | + \**************************************************************************/ | |
| 425 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 426 | + | |
| 427 | +"use strict"; | |
| 428 | +/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 429 | + | |
| 430 | + | |
| 431 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 432 | +Object.defineProperty(exports, "__esModule", ({ | |
| 433 | + value: true | |
| 434 | +})); | |
| 435 | +exports.WhatsNewTopBar = void 0; | |
| 436 | +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 437 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 438 | +var _i18n = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); | |
| 439 | +var _xIcon = __webpack_require__(/*! ../icons/x-icon */ "../modules/notifications/assets/js/icons/x-icon.js"); | |
| 440 | +var WhatsNewTopBar = function WhatsNewTopBar(props) { | |
| 441 | + var setIsOpen = props.setIsOpen; | |
| 442 | + return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ui.AppBar, { | |
| 443 | + elevation: 0, | |
| 444 | + position: "sticky", | |
| 445 | + sx: { | |
| 446 | + backgroundColor: 'background.default' | |
| 447 | + } | |
| 448 | + }, /*#__PURE__*/_react.default.createElement(_ui.Toolbar, { | |
| 449 | + variant: "dense" | |
| 450 | + }, /*#__PURE__*/_react.default.createElement(_ui.Typography, { | |
| 451 | + variant: "overline", | |
| 452 | + sx: { | |
| 453 | + flexGrow: 1 | |
| 454 | + } | |
| 455 | + }, (0, _i18n.__)('What\'s New', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.IconButton, { | |
| 456 | + "aria-label": 'close', | |
| 457 | + size: "small", | |
| 458 | + onClick: function onClick() { | |
| 459 | + return setIsOpen(false); | |
| 460 | + } | |
| 461 | + }, /*#__PURE__*/_react.default.createElement(_xIcon.XIcon, null)))), /*#__PURE__*/_react.default.createElement(_ui.Divider, null)); | |
| 462 | +}; | |
| 463 | +exports.WhatsNewTopBar = WhatsNewTopBar; | |
| 464 | +WhatsNewTopBar.propTypes = { | |
| 465 | + setIsOpen: PropTypes.func.isRequired | |
| 466 | +}; | |
| 467 | + | |
| 468 | +/***/ }), | |
| 469 | + | |
| 470 | +/***/ "../modules/notifications/assets/js/components/whats-new.js": | |
| 471 | +/*!******************************************************************!*\ | |
| 472 | + !*** ../modules/notifications/assets/js/components/whats-new.js ***! | |
| 473 | + \******************************************************************/ | |
| 474 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 475 | + | |
| 476 | +"use strict"; | |
| 477 | +/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 478 | + | |
| 479 | + | |
| 480 | +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 481 | +Object.defineProperty(exports, "__esModule", ({ | |
| 482 | + value: true | |
| 483 | +})); | |
| 484 | +exports.WhatsNew = void 0; | |
| 485 | +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); | |
| 486 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 487 | +var _query = __webpack_require__(/*! @elementor/query */ "../node_modules/@elementor/query/dist/index.js"); | |
| 488 | +var _whatsNewTopBar = __webpack_require__(/*! ./whats-new-top-bar */ "../modules/notifications/assets/js/components/whats-new-top-bar.js"); | |
| 489 | +var _whatsNewDrawerContent = __webpack_require__(/*! ./whats-new-drawer-content */ "../modules/notifications/assets/js/components/whats-new-drawer-content.js"); | |
| 490 | +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | |
| 491 | +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | |
| 492 | +var queryClient = new _query.QueryClient({ | |
| 493 | + defaultOptions: { | |
| 494 | + queries: { | |
| 495 | + refetchOnWindowFocus: false, | |
| 496 | + retry: false, | |
| 497 | + staleTime: 1000 * 60 * 30 // 30 minutes | |
| 498 | + } | |
| 499 | + } | |
| 500 | +}); | |
| 501 | + | |
| 502 | +var WhatsNew = function WhatsNew(props) { | |
| 503 | + var isOpen = props.isOpen, | |
| 504 | + setIsOpen = props.setIsOpen, | |
| 505 | + setIsRead = props.setIsRead, | |
| 506 | + _props$anchorPosition = props.anchorPosition, | |
| 507 | + anchorPosition = _props$anchorPosition === void 0 ? 'right' : _props$anchorPosition; | |
| 508 | + (0, _react.useEffect)(function () { | |
| 509 | + if (!isOpen) { | |
| 510 | + return; | |
| 511 | + } | |
| 512 | + setIsRead(true); | |
| 513 | + }, [isOpen, setIsRead]); | |
| 514 | + return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_query.QueryClientProvider, { | |
| 515 | + client: queryClient | |
| 516 | + }, /*#__PURE__*/_react.default.createElement(_ui.ThemeProvider, { | |
| 517 | + colorScheme: "auto" | |
| 518 | + }, /*#__PURE__*/_react.default.createElement(_ui.Drawer, { | |
| 519 | + anchor: anchorPosition, | |
| 520 | + open: isOpen, | |
| 521 | + onClose: function onClose() { | |
| 522 | + return setIsOpen(false); | |
| 523 | + }, | |
| 524 | + ModalProps: { | |
| 525 | + style: { | |
| 526 | + // Above the WordPress Admin Top Bar. | |
| 527 | + zIndex: 999999 | |
| 528 | + } | |
| 529 | + } | |
| 530 | + }, /*#__PURE__*/_react.default.createElement(_ui.Box, { | |
| 531 | + sx: { | |
| 532 | + width: 320, | |
| 533 | + backgroundColor: 'background.default' | |
| 534 | + }, | |
| 535 | + role: "presentation" | |
| 536 | + }, /*#__PURE__*/_react.default.createElement(_whatsNewTopBar.WhatsNewTopBar, { | |
| 537 | + setIsOpen: setIsOpen | |
| 538 | + }), /*#__PURE__*/_react.default.createElement(_ui.Box, { | |
| 539 | + sx: { | |
| 540 | + padding: '16px' | |
| 541 | + } | |
| 542 | + }, /*#__PURE__*/_react.default.createElement(_whatsNewDrawerContent.WhatsNewDrawerContent, null))))))); | |
| 543 | +}; | |
| 544 | +exports.WhatsNew = WhatsNew; | |
| 545 | +WhatsNew.propTypes = { | |
| 546 | + isOpen: PropTypes.bool.isRequired, | |
| 547 | + setIsOpen: PropTypes.func.isRequired, | |
| 548 | + setIsRead: PropTypes.func.isRequired, | |
| 549 | + anchorPosition: PropTypes.oneOf(['left', 'top', 'right', 'bottom']) | |
| 550 | +}; | |
| 551 | + | |
| 552 | +/***/ }), | |
| 553 | + | |
| 554 | +/***/ "../modules/notifications/assets/js/components/wrapper-with-link.js": | |
| 555 | +/*!**************************************************************************!*\ | |
| 556 | + !*** ../modules/notifications/assets/js/components/wrapper-with-link.js ***! | |
| 557 | + \**************************************************************************/ | |
| 558 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 559 | + | |
| 560 | +"use strict"; | |
| 561 | +/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 562 | + | |
| 563 | + | |
| 564 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 565 | +Object.defineProperty(exports, "__esModule", ({ | |
| 566 | + value: true | |
| 567 | +})); | |
| 568 | +exports.WrapperWithLink = void 0; | |
| 569 | +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 570 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 571 | +var WrapperWithLink = function WrapperWithLink(props) { | |
| 572 | + var link = props.link, | |
| 573 | + children = props.children; | |
| 574 | + if (!link) { | |
| 575 | + return children; | |
| 576 | + } | |
| 577 | + return /*#__PURE__*/_react.default.createElement(_ui.Link, { | |
| 578 | + href: link, | |
| 579 | + target: "_blank", | |
| 580 | + underline: "none", | |
| 581 | + color: "inherit", | |
| 582 | + sx: { | |
| 583 | + '&:hover': { | |
| 584 | + color: 'inherit' | |
| 585 | + } | |
| 586 | + } | |
| 587 | + }, children); | |
| 588 | +}; | |
| 589 | +exports.WrapperWithLink = WrapperWithLink; | |
| 590 | +WrapperWithLink.propTypes = { | |
| 591 | + link: PropTypes.string, | |
| 592 | + children: PropTypes.any.isRequired | |
| 593 | +}; | |
| 594 | + | |
| 595 | +/***/ }), | |
| 596 | + | |
| 597 | +/***/ "../modules/notifications/assets/js/icons/x-icon.js": | |
| 598 | +/*!**********************************************************!*\ | |
| 599 | + !*** ../modules/notifications/assets/js/icons/x-icon.js ***! | |
| 600 | + \**********************************************************/ | |
| 601 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 602 | + | |
| 603 | +"use strict"; | |
| 604 | + | |
| 605 | + | |
| 606 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 607 | +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 608 | +Object.defineProperty(exports, "__esModule", ({ | |
| 609 | + value: true | |
| 610 | +})); | |
| 611 | +exports.XIcon = void 0; | |
| 612 | +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); | |
| 613 | +var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); | |
| 614 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 615 | +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | |
| 616 | +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | |
| 617 | +var XIcon = (0, _react.forwardRef)(function (props, ref) { | |
| 618 | + return /*#__PURE__*/_react.default.createElement(_ui.SvgIcon, (0, _extends2.default)({ | |
| 619 | + viewBox: "0 0 24 24" | |
| 620 | + }, props, { | |
| 621 | + ref: ref | |
| 622 | + }), /*#__PURE__*/_react.default.createElement("path", { | |
| 623 | + fillRule: "evenodd", | |
| 624 | + clipRule: "evenodd", | |
| 625 | + d: "M18.5303 5.46967C18.8232 5.76256 18.8232 6.23744 18.5303 6.53033L6.53033 18.5303C6.23744 18.8232 5.76256 18.8232 5.46967 18.5303C5.17678 18.2374 5.17678 17.7626 5.46967 17.4697L17.4697 5.46967C17.7626 5.17678 18.2374 5.17678 18.5303 5.46967Z" | |
| 626 | + }), /*#__PURE__*/_react.default.createElement("path", { | |
| 627 | + fillRule: "evenodd", | |
| 628 | + clipRule: "evenodd", | |
| 629 | + d: "M5.46967 5.46967C5.76256 5.17678 6.23744 5.17678 6.53033 5.46967L18.5303 17.4697C18.8232 17.7626 18.8232 18.2374 18.5303 18.5303C18.2374 18.8232 17.7626 18.8232 17.4697 18.5303L5.46967 6.53033C5.17678 6.23744 5.17678 5.76256 5.46967 5.46967Z" | |
| 630 | + })); | |
| 631 | +}); | |
| 632 | +exports.XIcon = XIcon; | |
| 633 | + | |
| 634 | +/***/ }), | |
| 635 | + | |
| 636 | +/***/ "../node_modules/object-assign/index.js": | |
| 637 | +/*!**********************************************!*\ | |
| 638 | + !*** ../node_modules/object-assign/index.js ***! | |
| 639 | + \**********************************************/ | |
| 640 | +/***/ ((module) => { | |
| 641 | + | |
| 642 | +"use strict"; | |
| 643 | +/* | |
| 644 | +object-assign | |
| 645 | +(c) Sindre Sorhus | |
| 646 | +@license MIT | |
| 647 | +*/ | |
| 648 | + | |
| 649 | + | |
| 650 | +/* eslint-disable no-unused-vars */ | |
| 651 | +var getOwnPropertySymbols = Object.getOwnPropertySymbols; | |
| 652 | +var hasOwnProperty = Object.prototype.hasOwnProperty; | |
| 653 | +var propIsEnumerable = Object.prototype.propertyIsEnumerable; | |
| 654 | + | |
| 655 | +function toObject(val) { | |
| 656 | + if (val === null || val === undefined) { | |
| 657 | + throw new TypeError('Object.assign cannot be called with null or undefined'); | |
| 658 | + } | |
| 659 | + | |
| 660 | + return Object(val); | |
| 661 | +} | |
| 662 | + | |
| 663 | +function shouldUseNative() { | |
| 664 | + try { | |
| 665 | + if (!Object.assign) { | |
| 666 | + return false; | |
| 26 | 667 | } |
| 27 | - return to; | |
| 28 | - }; | |
| 29 | - var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { | |
| 30 | - value: mod, | |
| 31 | - enumerable: true | |
| 32 | - }) : target, mod)); | |
| 33 | 668 | |
| 34 | -//#endregion | |
| 35 | -react = __toESM(react); | |
| 36 | -react_dom = __toESM(react_dom); | |
| 37 | -_elementor_editor_app_bar = __toESM(_elementor_editor_app_bar); | |
| 38 | -_elementor_icons_SpeakerphoneIcon = __toESM(_elementor_icons_SpeakerphoneIcon); | |
| 669 | + // Detect buggy property enumeration order in older V8 versions. | |
| 39 | 670 | |
| 40 | -//#region node_modules/react-dom/client.js | |
| 41 | - var require_client = /* @__PURE__ */ __commonJSMin(((exports) => { | |
| 42 | - var m = (globalThis.ReactDOM); | |
| 43 | - var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | |
| 44 | - exports.createRoot = function(c, o) { | |
| 45 | - i.usingClientEntryPoint = true; | |
| 46 | - try { | |
| 47 | - return m.createRoot(c, o); | |
| 48 | - } finally { | |
| 49 | - i.usingClientEntryPoint = false; | |
| 50 | - } | |
| 51 | - }; | |
| 52 | - })); | |
| 671 | + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 | |
| 672 | + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers | |
| 673 | + test1[5] = 'de'; | |
| 674 | + if (Object.getOwnPropertyNames(test1)[0] === '5') { | |
| 675 | + return false; | |
| 676 | + } | |
| 53 | 677 | |
| 54 | -//#endregion | |
| 55 | -//#region assets/dev/js/utils/react.js | |
| 56 | - var import_client = require_client(); | |
| 57 | - /** | |
| 58 | - * Support conditional rendering of a React App to the DOM, based on the React version. | |
| 59 | - * We use `createRoot` when available, but fallback to `ReactDOM.render` for older versions. | |
| 60 | - * | |
| 61 | - * @param {Promise.resolve(React).ReactElement} app The app to render. | |
| 62 | - * @param {HTMLElement} domElement The DOM element to render the app into. | |
| 63 | - * | |
| 64 | - * @return {{ unmount: () => void }} The unmount function. | |
| 65 | - */ | |
| 66 | - function render(app, domElement) { | |
| 67 | - var unmountFunction; | |
| 68 | - try { | |
| 69 | - var root = (0, import_client.createRoot)(domElement); | |
| 70 | - root.render(app); | |
| 71 | - unmountFunction = function unmountFunction() { | |
| 72 | - root.unmount(); | |
| 73 | - }; | |
| 74 | - } catch (e) { | |
| 75 | - react_dom.render(app, domElement); | |
| 76 | - unmountFunction = function unmountFunction() { | |
| 77 | - react_dom.unmountComponentAtNode(domElement); | |
| 78 | - }; | |
| 678 | + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 | |
| 679 | + var test2 = {}; | |
| 680 | + for (var i = 0; i < 10; i++) { | |
| 681 | + test2['_' + String.fromCharCode(i)] = i; | |
| 79 | 682 | } |
| 80 | - return { unmount: unmountFunction }; | |
| 683 | + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { | |
| 684 | + return test2[n]; | |
| 685 | + }); | |
| 686 | + if (order2.join('') !== '0123456789') { | |
| 687 | + return false; | |
| 688 | + } | |
| 689 | + | |
| 690 | + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 | |
| 691 | + var test3 = {}; | |
| 692 | + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { | |
| 693 | + test3[letter] = letter; | |
| 694 | + }); | |
| 695 | + if (Object.keys(Object.assign({}, test3)).join('') !== | |
| 696 | + 'abcdefghijklmnopqrst') { | |
| 697 | + return false; | |
| 698 | + } | |
| 699 | + | |
| 700 | + return true; | |
| 701 | + } catch (err) { | |
| 702 | + // We don't expect any of the above to throw, but better to be safe. | |
| 703 | + return false; | |
| 81 | 704 | } |
| 82 | - var react_default = { render }; | |
| 705 | +} | |
| 83 | 706 | |
| 84 | -//#endregion | |
| 85 | -//#region node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js | |
| 86 | -/** @license React v16.13.1 | |
| 87 | - * react-is.development.js | |
| 88 | - * | |
| 89 | - * Copyright (c) Facebook, Inc. and its affiliates. | |
| 90 | - * | |
| 91 | - * This source code is licensed under the MIT license found in the | |
| 92 | - * LICENSE file in the root directory of this source tree. | |
| 93 | - */ | |
| 94 | - var require_react_is_development = /* @__PURE__ */ __commonJSMin(((exports) => { | |
| 95 | - (function() { | |
| 96 | - "use strict"; | |
| 97 | - var hasSymbol = typeof Symbol === "function" && Symbol.for; | |
| 98 | - var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103; | |
| 99 | - var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106; | |
| 100 | - var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107; | |
| 101 | - var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108; | |
| 102 | - var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114; | |
| 103 | - var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109; | |
| 104 | - var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110; | |
| 105 | - var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111; | |
| 106 | - var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111; | |
| 107 | - var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112; | |
| 108 | - var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113; | |
| 109 | - var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120; | |
| 110 | - var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115; | |
| 111 | - var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116; | |
| 112 | - var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121; | |
| 113 | - var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117; | |
| 114 | - var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118; | |
| 115 | - var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119; | |
| 116 | - function isValidElementType(type) { | |
| 117 | - return typeof type === "string" || typeof type === "function" || type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); | |
| 118 | - } | |
| 119 | - function typeOf(object) { | |
| 120 | - if (typeof object === "object" && object !== null) { | |
| 121 | - var $$typeof = object.$$typeof; | |
| 122 | - switch ($$typeof) { | |
| 123 | - case REACT_ELEMENT_TYPE: | |
| 124 | - var type = object.type; | |
| 125 | - switch (type) { | |
| 126 | - case REACT_ASYNC_MODE_TYPE: | |
| 127 | - case REACT_CONCURRENT_MODE_TYPE: | |
| 128 | - case REACT_FRAGMENT_TYPE: | |
| 129 | - case REACT_PROFILER_TYPE: | |
| 130 | - case REACT_STRICT_MODE_TYPE: | |
| 131 | - case REACT_SUSPENSE_TYPE: return type; | |
| 132 | - default: | |
| 133 | - var $$typeofType = type && type.$$typeof; | |
| 134 | - switch ($$typeofType) { | |
| 135 | - case REACT_CONTEXT_TYPE: | |
| 136 | - case REACT_FORWARD_REF_TYPE: | |
| 137 | - case REACT_LAZY_TYPE: | |
| 138 | - case REACT_MEMO_TYPE: | |
| 139 | - case REACT_PROVIDER_TYPE: return $$typeofType; | |
| 140 | - default: return $$typeof; | |
| 141 | - } | |
| 142 | - } | |
| 143 | - case REACT_PORTAL_TYPE: return $$typeof; | |
| 144 | - } | |
| 145 | - } | |
| 146 | - } | |
| 147 | - var AsyncMode = REACT_ASYNC_MODE_TYPE; | |
| 148 | - var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; | |
| 149 | - var ContextConsumer = REACT_CONTEXT_TYPE; | |
| 150 | - var ContextProvider = REACT_PROVIDER_TYPE; | |
| 151 | - var Element = REACT_ELEMENT_TYPE; | |
| 152 | - var ForwardRef = REACT_FORWARD_REF_TYPE; | |
| 153 | - var Fragment = REACT_FRAGMENT_TYPE; | |
| 154 | - var Lazy = REACT_LAZY_TYPE; | |
| 155 | - var Memo = REACT_MEMO_TYPE; | |
| 156 | - var Portal = REACT_PORTAL_TYPE; | |
| 157 | - var Profiler = REACT_PROFILER_TYPE; | |
| 158 | - var StrictMode = REACT_STRICT_MODE_TYPE; | |
| 159 | - var Suspense = REACT_SUSPENSE_TYPE; | |
| 160 | - var hasWarnedAboutDeprecatedIsAsyncMode = false; | |
| 161 | - function isAsyncMode(object) { | |
| 162 | - if (!hasWarnedAboutDeprecatedIsAsyncMode) { | |
| 163 | - hasWarnedAboutDeprecatedIsAsyncMode = true; | |
| 164 | - console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API."); | |
| 165 | - } | |
| 166 | - return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; | |
| 167 | - } | |
| 168 | - function isConcurrentMode(object) { | |
| 169 | - return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; | |
| 170 | - } | |
| 171 | - function isContextConsumer(object) { | |
| 172 | - return typeOf(object) === REACT_CONTEXT_TYPE; | |
| 173 | - } | |
| 174 | - function isContextProvider(object) { | |
| 175 | - return typeOf(object) === REACT_PROVIDER_TYPE; | |
| 176 | - } | |
| 177 | - function isElement(object) { | |
| 178 | - return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; | |
| 179 | - } | |
| 180 | - function isForwardRef(object) { | |
| 181 | - return typeOf(object) === REACT_FORWARD_REF_TYPE; | |
| 182 | - } | |
| 183 | - function isFragment(object) { | |
| 184 | - return typeOf(object) === REACT_FRAGMENT_TYPE; | |
| 185 | - } | |
| 186 | - function isLazy(object) { | |
| 187 | - return typeOf(object) === REACT_LAZY_TYPE; | |
| 188 | - } | |
| 189 | - function isMemo(object) { | |
| 190 | - return typeOf(object) === REACT_MEMO_TYPE; | |
| 191 | - } | |
| 192 | - function isPortal(object) { | |
| 193 | - return typeOf(object) === REACT_PORTAL_TYPE; | |
| 194 | - } | |
| 195 | - function isProfiler(object) { | |
| 196 | - return typeOf(object) === REACT_PROFILER_TYPE; | |
| 197 | - } | |
| 198 | - function isStrictMode(object) { | |
| 199 | - return typeOf(object) === REACT_STRICT_MODE_TYPE; | |
| 200 | - } | |
| 201 | - function isSuspense(object) { | |
| 202 | - return typeOf(object) === REACT_SUSPENSE_TYPE; | |
| 203 | - } | |
| 204 | - exports.AsyncMode = AsyncMode; | |
| 205 | - exports.ConcurrentMode = ConcurrentMode; | |
| 206 | - exports.ContextConsumer = ContextConsumer; | |
| 207 | - exports.ContextProvider = ContextProvider; | |
| 208 | - exports.Element = Element; | |
| 209 | - exports.ForwardRef = ForwardRef; | |
| 210 | - exports.Fragment = Fragment; | |
| 211 | - exports.Lazy = Lazy; | |
| 212 | - exports.Memo = Memo; | |
| 213 | - exports.Portal = Portal; | |
| 214 | - exports.Profiler = Profiler; | |
| 215 | - exports.StrictMode = StrictMode; | |
| 216 | - exports.Suspense = Suspense; | |
| 217 | - exports.isAsyncMode = isAsyncMode; | |
| 218 | - exports.isConcurrentMode = isConcurrentMode; | |
| 219 | - exports.isContextConsumer = isContextConsumer; | |
| 220 | - exports.isContextProvider = isContextProvider; | |
| 221 | - exports.isElement = isElement; | |
| 222 | - exports.isForwardRef = isForwardRef; | |
| 223 | - exports.isFragment = isFragment; | |
| 224 | - exports.isLazy = isLazy; | |
| 225 | - exports.isMemo = isMemo; | |
| 226 | - exports.isPortal = isPortal; | |
| 227 | - exports.isProfiler = isProfiler; | |
| 228 | - exports.isStrictMode = isStrictMode; | |
| 229 | - exports.isSuspense = isSuspense; | |
| 230 | - exports.isValidElementType = isValidElementType; | |
| 231 | - exports.typeOf = typeOf; | |
| 232 | - })(); | |
| 233 | - })); | |
| 707 | +module.exports = shouldUseNative() ? Object.assign : function (target, source) { | |
| 708 | + var from; | |
| 709 | + var to = toObject(target); | |
| 710 | + var symbols; | |
| 234 | 711 | |
| 235 | -//#endregion | |
| 236 | -//#region node_modules/prop-types/node_modules/react-is/index.js | |
| 237 | - var require_react_is = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 238 | - module.exports = require_react_is_development(); | |
| 239 | - })); | |
| 712 | + for (var s = 1; s < arguments.length; s++) { | |
| 713 | + from = Object(arguments[s]); | |
| 240 | 714 | |
| 241 | -//#endregion | |
| 242 | -//#region node_modules/object-assign/index.js | |
| 243 | -/* | |
| 244 | - object-assign | |
| 245 | - (c) Sindre Sorhus | |
| 246 | - @license MIT | |
| 247 | - */ | |
| 248 | - var require_object_assign = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 249 | - var getOwnPropertySymbols = Object.getOwnPropertySymbols; | |
| 250 | - var hasOwnProperty = Object.prototype.hasOwnProperty; | |
| 251 | - var propIsEnumerable = Object.prototype.propertyIsEnumerable; | |
| 252 | - function toObject(val) { | |
| 253 | - if (val === null || val === void 0) throw new TypeError("Object.assign cannot be called with null or undefined"); | |
| 254 | - return Object(val); | |
| 255 | - } | |
| 256 | - function shouldUseNative() { | |
| 257 | - try { | |
| 258 | - if (!Object.assign) return false; | |
| 259 | - var test1 = /* @__PURE__ */ new String("abc"); | |
| 260 | - test1[5] = "de"; | |
| 261 | - if (Object.getOwnPropertyNames(test1)[0] === "5") return false; | |
| 262 | - var test2 = {}; | |
| 263 | - for (var i = 0; i < 10; i++) test2["_" + String.fromCharCode(i)] = i; | |
| 264 | - if (Object.getOwnPropertyNames(test2).map(function(n) { | |
| 265 | - return test2[n]; | |
| 266 | - }).join("") !== "0123456789") return false; | |
| 267 | - var test3 = {}; | |
| 268 | - "abcdefghijklmnopqrst".split("").forEach(function(letter) { | |
| 269 | - test3[letter] = letter; | |
| 270 | - }); | |
| 271 | - if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") return false; | |
| 272 | - return true; | |
| 273 | - } catch (err) { | |
| 274 | - return false; | |
| 715 | + for (var key in from) { | |
| 716 | + if (hasOwnProperty.call(from, key)) { | |
| 717 | + to[key] = from[key]; | |
| 275 | 718 | } |
| 276 | 719 | } |
| 277 | - module.exports = shouldUseNative() ? Object.assign : function(target, source) { | |
| 278 | - var from; | |
| 279 | - var to = toObject(target); | |
| 280 | - var symbols; | |
| 281 | - for (var s = 1; s < arguments.length; s++) { | |
| 282 | - from = Object(arguments[s]); | |
| 283 | - for (var key in from) if (hasOwnProperty.call(from, key)) to[key] = from[key]; | |
| 284 | - if (getOwnPropertySymbols) { | |
| 285 | - symbols = getOwnPropertySymbols(from); | |
| 286 | - for (var i = 0; i < symbols.length; i++) if (propIsEnumerable.call(from, symbols[i])) to[symbols[i]] = from[symbols[i]]; | |
| 720 | + | |
| 721 | + if (getOwnPropertySymbols) { | |
| 722 | + symbols = getOwnPropertySymbols(from); | |
| 723 | + for (var i = 0; i < symbols.length; i++) { | |
| 724 | + if (propIsEnumerable.call(from, symbols[i])) { | |
| 725 | + to[symbols[i]] = from[symbols[i]]; | |
| 287 | 726 | } |
| 288 | 727 | } |
| 289 | - return to; | |
| 290 | - }; | |
| 291 | - })); | |
| 728 | + } | |
| 729 | + } | |
| 292 | 730 | |
| 293 | -//#endregion | |
| 294 | -//#region node_modules/prop-types/lib/ReactPropTypesSecret.js | |
| 731 | + return to; | |
| 732 | +}; | |
| 733 | + | |
| 734 | + | |
| 735 | +/***/ }), | |
| 736 | + | |
| 737 | +/***/ "../node_modules/prop-types/checkPropTypes.js": | |
| 738 | +/*!****************************************************!*\ | |
| 739 | + !*** ../node_modules/prop-types/checkPropTypes.js ***! | |
| 740 | + \****************************************************/ | |
| 741 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 742 | + | |
| 743 | +"use strict"; | |
| 295 | 744 | /** |
| 296 | - * Copyright (c) 2013-present, Facebook, Inc. | |
| 297 | - * | |
| 298 | - * This source code is licensed under the MIT license found in the | |
| 299 | - * LICENSE file in the root directory of this source tree. | |
| 300 | - */ | |
| 301 | - var require_ReactPropTypesSecret = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 302 | - var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; | |
| 303 | - module.exports = ReactPropTypesSecret; | |
| 304 | - })); | |
| 745 | + * Copyright (c) 2013-present, Facebook, Inc. | |
| 746 | + * | |
| 747 | + * This source code is licensed under the MIT license found in the | |
| 748 | + * LICENSE file in the root directory of this source tree. | |
| 749 | + */ | |
| 305 | 750 | |
| 306 | -//#endregion | |
| 307 | -//#region node_modules/prop-types/lib/has.js | |
| 308 | - var require_has = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 309 | - module.exports = Function.call.bind(Object.prototype.hasOwnProperty); | |
| 310 | - })); | |
| 311 | 751 | |
| 312 | -//#endregion | |
| 313 | -//#region node_modules/prop-types/checkPropTypes.js | |
| 752 | + | |
| 753 | +var printWarning = function() {}; | |
| 754 | + | |
| 755 | +if (true) { | |
| 756 | + var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "../node_modules/prop-types/lib/ReactPropTypesSecret.js"); | |
| 757 | + var loggedTypeFailures = {}; | |
| 758 | + var has = __webpack_require__(/*! ./lib/has */ "../node_modules/prop-types/lib/has.js"); | |
| 759 | + | |
| 760 | + printWarning = function(text) { | |
| 761 | + var message = 'Warning: ' + text; | |
| 762 | + if (typeof console !== 'undefined') { | |
| 763 | + console.error(message); | |
| 764 | + } | |
| 765 | + try { | |
| 766 | + // --- Welcome to debugging React --- | |
| 767 | + // This error was thrown as a convenience so that you can use this stack | |
| 768 | + // to find the callsite that caused this warning to fire. | |
| 769 | + throw new Error(message); | |
| 770 | + } catch (x) { /**/ } | |
| 771 | + }; | |
| 772 | +} | |
| 773 | + | |
| 314 | 774 | /** |
| 315 | - * Copyright (c) 2013-present, Facebook, Inc. | |
| 316 | - * | |
| 317 | - * This source code is licensed under the MIT license found in the | |
| 318 | - * LICENSE file in the root directory of this source tree. | |
| 319 | - */ | |
| 320 | - var require_checkPropTypes = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 321 | - var printWarning = function() {}; | |
| 322 | - var ReactPropTypesSecret = require_ReactPropTypesSecret(); | |
| 323 | - var loggedTypeFailures = {}; | |
| 324 | - var has = require_has(); | |
| 325 | - printWarning = function(text) { | |
| 326 | - var message = "Warning: " + text; | |
| 327 | - if (typeof console !== "undefined") console.error(message); | |
| 328 | - try { | |
| 329 | - throw new Error(message); | |
| 330 | - } catch (x) {} | |
| 331 | - }; | |
| 332 | - /** | |
| 333 | - * Assert that the values match with the type specs. | |
| 334 | - * Error messages are memorized and will only be shown once. | |
| 335 | - * | |
| 336 | - * @param {object} typeSpecs Map of name to a ReactPropType | |
| 337 | - * @param {object} values Runtime values that need to be type-checked | |
| 338 | - * @param {string} location e.g. "prop", "context", "child context" | |
| 339 | - * @param {string} componentName Name of the component for error messages. | |
| 340 | - * @param {?Function} getStack Returns the component stack. | |
| 341 | - * @private | |
| 342 | - */ | |
| 343 | - function checkPropTypes(typeSpecs, values, location, componentName, getStack) { | |
| 344 | - for (var typeSpecName in typeSpecs) if (has(typeSpecs, typeSpecName)) { | |
| 345 | - var error; | |
| 346 | - try { | |
| 347 | - if (typeof typeSpecs[typeSpecName] !== "function") { | |
| 348 | - var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); | |
| 349 | - err.name = "Invariant Violation"; | |
| 350 | - throw err; | |
| 351 | - } | |
| 352 | - error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); | |
| 353 | - } catch (ex) { | |
| 354 | - error = ex; | |
| 355 | - } | |
| 356 | - if (error && !(error instanceof Error)) printWarning((componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."); | |
| 357 | - if (error instanceof Error && !(error.message in loggedTypeFailures)) { | |
| 358 | - loggedTypeFailures[error.message] = true; | |
| 359 | - var stack = getStack ? getStack() : ""; | |
| 360 | - printWarning("Failed " + location + " type: " + error.message + (stack != null ? stack : "")); | |
| 361 | - } | |
| 362 | - } | |
| 363 | - } | |
| 364 | - /** | |
| 365 | - * Resets warning cache when testing. | |
| 366 | - * | |
| 367 | - * @private | |
| 368 | - */ | |
| 369 | - checkPropTypes.resetWarningCache = function() { | |
| 370 | - loggedTypeFailures = {}; | |
| 371 | - }; | |
| 372 | - module.exports = checkPropTypes; | |
| 373 | - })); | |
| 775 | + * Assert that the values match with the type specs. | |
| 776 | + * Error messages are memorized and will only be shown once. | |
| 777 | + * | |
| 778 | + * @param {object} typeSpecs Map of name to a ReactPropType | |
| 779 | + * @param {object} values Runtime values that need to be type-checked | |
| 780 | + * @param {string} location e.g. "prop", "context", "child context" | |
| 781 | + * @param {string} componentName Name of the component for error messages. | |
| 782 | + * @param {?Function} getStack Returns the component stack. | |
| 783 | + * @private | |
| 784 | + */ | |
| 785 | +function checkPropTypes(typeSpecs, values, location, componentName, getStack) { | |
| 786 | + if (true) { | |
| 787 | + for (var typeSpecName in typeSpecs) { | |
| 788 | + if (has(typeSpecs, typeSpecName)) { | |
| 789 | + var error; | |
| 790 | + // Prop type validation may throw. In case they do, we don't want to | |
| 791 | + // fail the render phase where it didn't fail before. So we log it. | |
| 792 | + // After these have been cleaned up, we'll let them throw. | |
| 793 | + try { | |
| 794 | + // This is intentionally an invariant that gets caught. It's the same | |
| 795 | + // behavior as without this statement except with a better message. | |
| 796 | + if (typeof typeSpecs[typeSpecName] !== 'function') { | |
| 797 | + var err = Error( | |
| 798 | + (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + | |
| 799 | + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + | |
| 800 | + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.' | |
| 801 | + ); | |
| 802 | + err.name = 'Invariant Violation'; | |
| 803 | + throw err; | |
| 804 | + } | |
| 805 | + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); | |
| 806 | + } catch (ex) { | |
| 807 | + error = ex; | |
| 808 | + } | |
| 809 | + if (error && !(error instanceof Error)) { | |
| 810 | + printWarning( | |
| 811 | + (componentName || 'React class') + ': type specification of ' + | |
| 812 | + location + ' `' + typeSpecName + '` is invalid; the type checker ' + | |
| 813 | + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + | |
| 814 | + 'You may have forgotten to pass an argument to the type checker ' + | |
| 815 | + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + | |
| 816 | + 'shape all require an argument).' | |
| 817 | + ); | |
| 818 | + } | |
| 819 | + if (error instanceof Error && !(error.message in loggedTypeFailures)) { | |
| 820 | + // Only monitor this failure once because there tends to be a lot of the | |
| 821 | + // same error. | |
| 822 | + loggedTypeFailures[error.message] = true; | |
| 374 | 823 | |
| 375 | -//#endregion | |
| 376 | -//#region node_modules/prop-types/factoryWithTypeCheckers.js | |
| 824 | + var stack = getStack ? getStack() : ''; | |
| 825 | + | |
| 826 | + printWarning( | |
| 827 | + 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') | |
| 828 | + ); | |
| 829 | + } | |
| 830 | + } | |
| 831 | + } | |
| 832 | + } | |
| 833 | +} | |
| 834 | + | |
| 377 | 835 | /** |
| 378 | - * Copyright (c) 2013-present, Facebook, Inc. | |
| 379 | - * | |
| 380 | - * This source code is licensed under the MIT license found in the | |
| 381 | - * LICENSE file in the root directory of this source tree. | |
| 382 | - */ | |
| 383 | - var require_factoryWithTypeCheckers = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 384 | - var ReactIs = require_react_is(); | |
| 385 | - var assign = require_object_assign(); | |
| 386 | - var ReactPropTypesSecret = require_ReactPropTypesSecret(); | |
| 387 | - var has = require_has(); | |
| 388 | - var checkPropTypes = require_checkPropTypes(); | |
| 389 | - var printWarning = function() {}; | |
| 390 | - printWarning = function(text) { | |
| 391 | - var message = "Warning: " + text; | |
| 392 | - if (typeof console !== "undefined") console.error(message); | |
| 393 | - try { | |
| 394 | - throw new Error(message); | |
| 395 | - } catch (x) {} | |
| 396 | - }; | |
| 397 | - function emptyFunctionThatReturnsNull() { | |
| 398 | - return null; | |
| 399 | - } | |
| 400 | - module.exports = function(isValidElement, throwOnDirectAccess) { | |
| 401 | - var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator; | |
| 402 | - var FAUX_ITERATOR_SYMBOL = "@@iterator"; | |
| 403 | - /** | |
| 404 | - * Returns the iterator method function contained on the iterable object. | |
| 405 | - * | |
| 406 | - * Be sure to invoke the function with the iterable as context: | |
| 407 | - * | |
| 408 | - * var iteratorFn = getIteratorFn(myIterable); | |
| 409 | - * if (iteratorFn) { | |
| 410 | - * var iterator = iteratorFn.call(myIterable); | |
| 411 | - * ... | |
| 412 | - * } | |
| 413 | - * | |
| 414 | - * @param {?object} maybeIterable | |
| 415 | - * @return {?function} | |
| 416 | - */ | |
| 417 | - function getIteratorFn(maybeIterable) { | |
| 418 | - var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); | |
| 419 | - if (typeof iteratorFn === "function") return iteratorFn; | |
| 420 | - } | |
| 421 | - /** | |
| 422 | - * Collection of methods that allow declaration and validation of props that are | |
| 423 | - * supplied to React components. Example usage: | |
| 424 | - * | |
| 425 | - * var Props = require('ReactPropTypes'); | |
| 426 | - * var MyArticle = React.createClass({ | |
| 427 | - * propTypes: { | |
| 428 | - * // An optional string prop named "description". | |
| 429 | - * description: Props.string, | |
| 430 | - * | |
| 431 | - * // A required enum prop named "category". | |
| 432 | - * category: Props.oneOf(['News','Photos']).isRequired, | |
| 433 | - * | |
| 434 | - * // A prop named "dialog" that requires an instance of Dialog. | |
| 435 | - * dialog: Props.instanceOf(Dialog).isRequired | |
| 436 | - * }, | |
| 437 | - * render: function() { ... } | |
| 438 | - * }); | |
| 439 | - * | |
| 440 | - * A more formal specification of how these methods are used: | |
| 441 | - * | |
| 442 | - * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) | |
| 443 | - * decl := ReactPropTypes.{type}(.isRequired)? | |
| 444 | - * | |
| 445 | - * Each and every declaration produces a function with the same signature. This | |
| 446 | - * allows the creation of custom validation functions. For example: | |
| 447 | - * | |
| 448 | - * var MyLink = React.createClass({ | |
| 449 | - * propTypes: { | |
| 450 | - * // An optional string or URI prop named "href". | |
| 451 | - * href: function(props, propName, componentName) { | |
| 452 | - * var propValue = props[propName]; | |
| 453 | - * if (propValue != null && typeof propValue !== 'string' && | |
| 454 | - * !(propValue instanceof URI)) { | |
| 455 | - * return new Error( | |
| 456 | - * 'Expected a string or an URI for ' + propName + ' in ' + | |
| 457 | - * componentName | |
| 458 | - * ); | |
| 459 | - * } | |
| 460 | - * } | |
| 461 | - * }, | |
| 462 | - * render: function() {...} | |
| 463 | - * }); | |
| 464 | - * | |
| 465 | - * @internal | |
| 466 | - */ | |
| 467 | - var ANONYMOUS = "<<anonymous>>"; | |
| 468 | - var ReactPropTypes = { | |
| 469 | - array: createPrimitiveTypeChecker("array"), | |
| 470 | - bigint: createPrimitiveTypeChecker("bigint"), | |
| 471 | - bool: createPrimitiveTypeChecker("boolean"), | |
| 472 | - func: createPrimitiveTypeChecker("function"), | |
| 473 | - number: createPrimitiveTypeChecker("number"), | |
| 474 | - object: createPrimitiveTypeChecker("object"), | |
| 475 | - string: createPrimitiveTypeChecker("string"), | |
| 476 | - symbol: createPrimitiveTypeChecker("symbol"), | |
| 477 | - any: createAnyTypeChecker(), | |
| 478 | - arrayOf: createArrayOfTypeChecker, | |
| 479 | - element: createElementTypeChecker(), | |
| 480 | - elementType: createElementTypeTypeChecker(), | |
| 481 | - instanceOf: createInstanceTypeChecker, | |
| 482 | - node: createNodeChecker(), | |
| 483 | - objectOf: createObjectOfTypeChecker, | |
| 484 | - oneOf: createEnumTypeChecker, | |
| 485 | - oneOfType: createUnionTypeChecker, | |
| 486 | - shape: createShapeTypeChecker, | |
| 487 | - exact: createStrictShapeTypeChecker | |
| 488 | - }; | |
| 489 | - /** | |
| 490 | - * inlined Object.is polyfill to avoid requiring consumers ship their own | |
| 491 | - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is | |
| 492 | - */ | |
| 493 | - function is(x, y) { | |
| 494 | - if (x === y) return x !== 0 || 1 / x === 1 / y; | |
| 495 | - else return x !== x && y !== y; | |
| 496 | - } | |
| 497 | - /** | |
| 498 | - * We use an Error-like object for backward compatibility as people may call | |
| 499 | - * PropTypes directly and inspect their output. However, we don't use real | |
| 500 | - * Errors anymore. We don't inspect their stack anyway, and creating them | |
| 501 | - * is prohibitively expensive if they are created too often, such as what | |
| 502 | - * happens in oneOfType() for any type before the one that matched. | |
| 503 | - */ | |
| 504 | - function PropTypeError(message, data) { | |
| 505 | - this.message = message; | |
| 506 | - this.data = data && typeof data === "object" ? data : {}; | |
| 507 | - this.stack = ""; | |
| 508 | - } | |
| 509 | - PropTypeError.prototype = Error.prototype; | |
| 510 | - function createChainableTypeChecker(validate) { | |
| 511 | - var manualPropTypeCallCache = {}; | |
| 512 | - var manualPropTypeWarningCount = 0; | |
| 513 | - function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { | |
| 514 | - componentName = componentName || ANONYMOUS; | |
| 515 | - propFullName = propFullName || propName; | |
| 516 | - if (secret !== ReactPropTypesSecret) { | |
| 517 | - if (throwOnDirectAccess) { | |
| 518 | - var err = /* @__PURE__ */ new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"); | |
| 519 | - err.name = "Invariant Violation"; | |
| 520 | - throw err; | |
| 521 | - } else if (typeof console !== "undefined") { | |
| 522 | - var cacheKey = componentName + ":" + propName; | |
| 523 | - if (!manualPropTypeCallCache[cacheKey] && manualPropTypeWarningCount < 3) { | |
| 524 | - printWarning("You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."); | |
| 525 | - manualPropTypeCallCache[cacheKey] = true; | |
| 526 | - manualPropTypeWarningCount++; | |
| 527 | - } | |
| 528 | - } | |
| 529 | - } | |
| 530 | - if (props[propName] == null) { | |
| 531 | - if (isRequired) { | |
| 532 | - if (props[propName] === null) return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`.")); | |
| 533 | - return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`.")); | |
| 534 | - } | |
| 535 | - return null; | |
| 536 | - } else return validate(props, propName, componentName, location, propFullName); | |
| 537 | - } | |
| 538 | - var chainedCheckType = checkType.bind(null, false); | |
| 539 | - chainedCheckType.isRequired = checkType.bind(null, true); | |
| 540 | - return chainedCheckType; | |
| 541 | - } | |
| 542 | - function createPrimitiveTypeChecker(expectedType) { | |
| 543 | - function validate(props, propName, componentName, location, propFullName, secret) { | |
| 544 | - var propValue = props[propName]; | |
| 545 | - if (getPropType(propValue) !== expectedType) { | |
| 546 | - var preciseType = getPreciseType(propValue); | |
| 547 | - return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."), { expectedType }); | |
| 548 | - } | |
| 549 | - return null; | |
| 550 | - } | |
| 551 | - return createChainableTypeChecker(validate); | |
| 552 | - } | |
| 553 | - function createAnyTypeChecker() { | |
| 554 | - return createChainableTypeChecker(emptyFunctionThatReturnsNull); | |
| 555 | - } | |
| 556 | - function createArrayOfTypeChecker(typeChecker) { | |
| 557 | - function validate(props, propName, componentName, location, propFullName) { | |
| 558 | - if (typeof typeChecker !== "function") return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf."); | |
| 559 | - var propValue = props[propName]; | |
| 560 | - if (!Array.isArray(propValue)) { | |
| 561 | - var propType = getPropType(propValue); | |
| 562 | - return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array.")); | |
| 563 | - } | |
| 564 | - for (var i = 0; i < propValue.length; i++) { | |
| 565 | - var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret); | |
| 566 | - if (error instanceof Error) return error; | |
| 567 | - } | |
| 568 | - return null; | |
| 569 | - } | |
| 570 | - return createChainableTypeChecker(validate); | |
| 571 | - } | |
| 572 | - function createElementTypeChecker() { | |
| 573 | - function validate(props, propName, componentName, location, propFullName) { | |
| 574 | - var propValue = props[propName]; | |
| 575 | - if (!isValidElement(propValue)) { | |
| 576 | - var propType = getPropType(propValue); | |
| 577 | - return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement.")); | |
| 578 | - } | |
| 579 | - return null; | |
| 580 | - } | |
| 581 | - return createChainableTypeChecker(validate); | |
| 582 | - } | |
| 583 | - function createElementTypeTypeChecker() { | |
| 584 | - function validate(props, propName, componentName, location, propFullName) { | |
| 585 | - var propValue = props[propName]; | |
| 586 | - if (!ReactIs.isValidElementType(propValue)) { | |
| 587 | - var propType = getPropType(propValue); | |
| 588 | - return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type.")); | |
| 589 | - } | |
| 590 | - return null; | |
| 591 | - } | |
| 592 | - return createChainableTypeChecker(validate); | |
| 593 | - } | |
| 594 | - function createInstanceTypeChecker(expectedClass) { | |
| 595 | - function validate(props, propName, componentName, location, propFullName) { | |
| 596 | - if (!(props[propName] instanceof expectedClass)) { | |
| 597 | - var expectedClassName = expectedClass.name || ANONYMOUS; | |
| 598 | - var actualClassName = getClassName(props[propName]); | |
| 599 | - return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`.")); | |
| 600 | - } | |
| 601 | - return null; | |
| 602 | - } | |
| 603 | - return createChainableTypeChecker(validate); | |
| 604 | - } | |
| 605 | - function createEnumTypeChecker(expectedValues) { | |
| 606 | - if (!Array.isArray(expectedValues)) { | |
| 607 | - if (arguments.length > 1) printWarning("Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."); | |
| 608 | - else printWarning("Invalid argument supplied to oneOf, expected an array."); | |
| 609 | - return emptyFunctionThatReturnsNull; | |
| 610 | - } | |
| 611 | - function validate(props, propName, componentName, location, propFullName) { | |
| 612 | - var propValue = props[propName]; | |
| 613 | - for (var i = 0; i < expectedValues.length; i++) if (is(propValue, expectedValues[i])) return null; | |
| 614 | - var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { | |
| 615 | - if (getPreciseType(value) === "symbol") return String(value); | |
| 616 | - return value; | |
| 617 | - }); | |
| 618 | - return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + ".")); | |
| 619 | - } | |
| 620 | - return createChainableTypeChecker(validate); | |
| 621 | - } | |
| 622 | - function createObjectOfTypeChecker(typeChecker) { | |
| 623 | - function validate(props, propName, componentName, location, propFullName) { | |
| 624 | - if (typeof typeChecker !== "function") return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf."); | |
| 625 | - var propValue = props[propName]; | |
| 626 | - var propType = getPropType(propValue); | |
| 627 | - if (propType !== "object") return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object.")); | |
| 628 | - for (var key in propValue) if (has(propValue, key)) { | |
| 629 | - var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret); | |
| 630 | - if (error instanceof Error) return error; | |
| 631 | - } | |
| 632 | - return null; | |
| 633 | - } | |
| 634 | - return createChainableTypeChecker(validate); | |
| 635 | - } | |
| 636 | - function createUnionTypeChecker(arrayOfTypeCheckers) { | |
| 637 | - if (!Array.isArray(arrayOfTypeCheckers)) { | |
| 638 | - printWarning("Invalid argument supplied to oneOfType, expected an instance of array."); | |
| 639 | - return emptyFunctionThatReturnsNull; | |
| 640 | - } | |
| 641 | - for (var i = 0; i < arrayOfTypeCheckers.length; i++) { | |
| 642 | - var checker = arrayOfTypeCheckers[i]; | |
| 643 | - if (typeof checker !== "function") { | |
| 644 | - printWarning("Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + "."); | |
| 645 | - return emptyFunctionThatReturnsNull; | |
| 646 | - } | |
| 647 | - } | |
| 648 | - function validate(props, propName, componentName, location, propFullName) { | |
| 649 | - var expectedTypes = []; | |
| 650 | - for (var i = 0; i < arrayOfTypeCheckers.length; i++) { | |
| 651 | - var checker = arrayOfTypeCheckers[i]; | |
| 652 | - var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret); | |
| 653 | - if (checkerResult == null) return null; | |
| 654 | - if (checkerResult.data && has(checkerResult.data, "expectedType")) expectedTypes.push(checkerResult.data.expectedType); | |
| 655 | - } | |
| 656 | - var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : ""; | |
| 657 | - return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + ".")); | |
| 658 | - } | |
| 659 | - return createChainableTypeChecker(validate); | |
| 660 | - } | |
| 661 | - function createNodeChecker() { | |
| 662 | - function validate(props, propName, componentName, location, propFullName) { | |
| 663 | - if (!isNode(props[propName])) return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode.")); | |
| 664 | - return null; | |
| 665 | - } | |
| 666 | - return createChainableTypeChecker(validate); | |
| 667 | - } | |
| 668 | - function invalidValidatorError(componentName, location, propFullName, key, type) { | |
| 669 | - return new PropTypeError((componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`."); | |
| 670 | - } | |
| 671 | - function createShapeTypeChecker(shapeTypes) { | |
| 672 | - function validate(props, propName, componentName, location, propFullName) { | |
| 673 | - var propValue = props[propName]; | |
| 674 | - var propType = getPropType(propValue); | |
| 675 | - if (propType !== "object") return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`.")); | |
| 676 | - for (var key in shapeTypes) { | |
| 677 | - var checker = shapeTypes[key]; | |
| 678 | - if (typeof checker !== "function") return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); | |
| 679 | - var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret); | |
| 680 | - if (error) return error; | |
| 681 | - } | |
| 682 | - return null; | |
| 683 | - } | |
| 684 | - return createChainableTypeChecker(validate); | |
| 685 | - } | |
| 686 | - function createStrictShapeTypeChecker(shapeTypes) { | |
| 687 | - function validate(props, propName, componentName, location, propFullName) { | |
| 688 | - var propValue = props[propName]; | |
| 689 | - var propType = getPropType(propValue); | |
| 690 | - if (propType !== "object") return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`.")); | |
| 691 | - for (var key in assign({}, props[propName], shapeTypes)) { | |
| 692 | - var checker = shapeTypes[key]; | |
| 693 | - if (has(shapeTypes, key) && typeof checker !== "function") return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); | |
| 694 | - if (!checker) return new PropTypeError("Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ")); | |
| 695 | - var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret); | |
| 696 | - if (error) return error; | |
| 697 | - } | |
| 698 | - return null; | |
| 699 | - } | |
| 700 | - return createChainableTypeChecker(validate); | |
| 701 | - } | |
| 702 | - function isNode(propValue) { | |
| 703 | - switch (typeof propValue) { | |
| 704 | - case "number": | |
| 705 | - case "string": | |
| 706 | - case "undefined": return true; | |
| 707 | - case "boolean": return !propValue; | |
| 708 | - case "object": | |
| 709 | - if (Array.isArray(propValue)) return propValue.every(isNode); | |
| 710 | - if (propValue === null || isValidElement(propValue)) return true; | |
| 711 | - var iteratorFn = getIteratorFn(propValue); | |
| 712 | - if (iteratorFn) { | |
| 713 | - var iterator = iteratorFn.call(propValue); | |
| 714 | - var step; | |
| 715 | - if (iteratorFn !== propValue.entries) { | |
| 716 | - while (!(step = iterator.next()).done) if (!isNode(step.value)) return false; | |
| 717 | - } else while (!(step = iterator.next()).done) { | |
| 718 | - var entry = step.value; | |
| 719 | - if (entry) { | |
| 720 | - if (!isNode(entry[1])) return false; | |
| 721 | - } | |
| 722 | - } | |
| 723 | - } else return false; | |
| 724 | - return true; | |
| 725 | - default: return false; | |
| 726 | - } | |
| 727 | - } | |
| 728 | - function isSymbol(propType, propValue) { | |
| 729 | - if (propType === "symbol") return true; | |
| 730 | - if (!propValue) return false; | |
| 731 | - if (propValue["@@toStringTag"] === "Symbol") return true; | |
| 732 | - if (typeof Symbol === "function" && propValue instanceof Symbol) return true; | |
| 733 | - return false; | |
| 734 | - } | |
| 735 | - function getPropType(propValue) { | |
| 736 | - var propType = typeof propValue; | |
| 737 | - if (Array.isArray(propValue)) return "array"; | |
| 738 | - if (propValue instanceof RegExp) return "object"; | |
| 739 | - if (isSymbol(propType, propValue)) return "symbol"; | |
| 740 | - return propType; | |
| 741 | - } | |
| 742 | - function getPreciseType(propValue) { | |
| 743 | - if (typeof propValue === "undefined" || propValue === null) return "" + propValue; | |
| 744 | - var propType = getPropType(propValue); | |
| 745 | - if (propType === "object") { | |
| 746 | - if (propValue instanceof Date) return "date"; | |
| 747 | - else if (propValue instanceof RegExp) return "regexp"; | |
| 748 | - } | |
| 749 | - return propType; | |
| 750 | - } | |
| 751 | - function getPostfixForTypeWarning(value) { | |
| 752 | - var type = getPreciseType(value); | |
| 753 | - switch (type) { | |
| 754 | - case "array": | |
| 755 | - case "object": return "an " + type; | |
| 756 | - case "boolean": | |
| 757 | - case "date": | |
| 758 | - case "regexp": return "a " + type; | |
| 759 | - default: return type; | |
| 760 | - } | |
| 761 | - } | |
| 762 | - function getClassName(propValue) { | |
| 763 | - if (!propValue.constructor || !propValue.constructor.name) return ANONYMOUS; | |
| 764 | - return propValue.constructor.name; | |
| 765 | - } | |
| 766 | - ReactPropTypes.checkPropTypes = checkPropTypes; | |
| 767 | - ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; | |
| 768 | - ReactPropTypes.PropTypes = ReactPropTypes; | |
| 769 | - return ReactPropTypes; | |
| 770 | - }; | |
| 771 | - })); | |
| 836 | + * Resets warning cache when testing. | |
| 837 | + * | |
| 838 | + * @private | |
| 839 | + */ | |
| 840 | +checkPropTypes.resetWarningCache = function() { | |
| 841 | + if (true) { | |
| 842 | + loggedTypeFailures = {}; | |
| 843 | + } | |
| 844 | +} | |
| 772 | 845 | |
| 773 | -//#endregion | |
| 774 | -//#region node_modules/prop-types/index.js | |
| 775 | - var require_prop_types = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 776 | - var ReactIs = require_react_is(); | |
| 777 | - var throwOnDirectAccess = true; | |
| 778 | - module.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess); | |
| 779 | - })); | |
| 846 | +module.exports = checkPropTypes; | |
| 780 | 847 | |
| 781 | -//#endregion | |
| 782 | -//#region node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js | |
| 783 | -var import_prop_types = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 784 | - function _arrayWithHoles(r) { | |
| 785 | - if (Array.isArray(r)) return r; | |
| 786 | - } | |
| 787 | 848 | |
| 788 | -//#endregion | |
| 789 | -//#region node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js | |
| 790 | - function _iterableToArrayLimit(r, l) { | |
| 791 | - var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; | |
| 792 | - if (null != t) { | |
| 793 | - var e; | |
| 794 | - var n; | |
| 795 | - var i; | |
| 796 | - var u; | |
| 797 | - var a = []; | |
| 798 | - var f = !0; | |
| 799 | - var o = !1; | |
| 800 | - try { | |
| 801 | - if (i = (t = t.call(r)).next, 0 === l) { | |
| 802 | - if (Object(t) !== t) return; | |
| 803 | - f = !1; | |
| 804 | - } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); | |
| 805 | - } catch (r) { | |
| 806 | - o = !0, n = r; | |
| 807 | - } finally { | |
| 808 | - try { | |
| 809 | - if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; | |
| 810 | - } finally { | |
| 811 | - if (o) throw n; | |
| 812 | - } | |
| 813 | - } | |
| 814 | - return a; | |
| 815 | - } | |
| 816 | - } | |
| 849 | +/***/ }), | |
| 817 | 850 | |
| 818 | -//#endregion | |
| 819 | -//#region node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js | |
| 820 | - function _arrayLikeToArray(r, a) { | |
| 821 | - (null == a || a > r.length) && (a = r.length); | |
| 822 | - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; | |
| 823 | - return n; | |
| 824 | - } | |
| 851 | +/***/ "../node_modules/prop-types/factoryWithTypeCheckers.js": | |
| 852 | +/*!*************************************************************!*\ | |
| 853 | + !*** ../node_modules/prop-types/factoryWithTypeCheckers.js ***! | |
| 854 | + \*************************************************************/ | |
| 855 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 825 | 856 | |
| 826 | -//#endregion | |
| 827 | -//#region node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js | |
| 828 | - function _unsupportedIterableToArray(r, a) { | |
| 829 | - if (r) { | |
| 830 | - if ("string" == typeof r) return _arrayLikeToArray(r, a); | |
| 831 | - var t = {}.toString.call(r).slice(8, -1); | |
| 832 | - return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; | |
| 833 | - } | |
| 834 | - } | |
| 857 | +"use strict"; | |
| 858 | +/** | |
| 859 | + * Copyright (c) 2013-present, Facebook, Inc. | |
| 860 | + * | |
| 861 | + * This source code is licensed under the MIT license found in the | |
| 862 | + * LICENSE file in the root directory of this source tree. | |
| 863 | + */ | |
| 835 | 864 | |
| 836 | -//#endregion | |
| 837 | -//#region node_modules/@babel/runtime/helpers/esm/nonIterableRest.js | |
| 838 | - function _nonIterableRest() { | |
| 839 | - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | |
| 840 | - } | |
| 841 | 865 | |
| 842 | -//#endregion | |
| 843 | -//#region node_modules/@babel/runtime/helpers/esm/slicedToArray.js | |
| 844 | - function _slicedToArray(r, e) { | |
| 845 | - return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); | |
| 846 | - } | |
| 847 | 866 | |
| 848 | -//#endregion | |
| 849 | -//#region node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js | |
| 850 | - function _arrayWithoutHoles(r) { | |
| 851 | - if (Array.isArray(r)) return _arrayLikeToArray(r); | |
| 852 | - } | |
| 867 | +var ReactIs = __webpack_require__(/*! react-is */ "../node_modules/prop-types/node_modules/react-is/index.js"); | |
| 868 | +var assign = __webpack_require__(/*! object-assign */ "../node_modules/object-assign/index.js"); | |
| 853 | 869 | |
| 854 | -//#endregion | |
| 855 | -//#region node_modules/@babel/runtime/helpers/esm/iterableToArray.js | |
| 856 | - function _iterableToArray(r) { | |
| 857 | - if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); | |
| 858 | - } | |
| 870 | +var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "../node_modules/prop-types/lib/ReactPropTypesSecret.js"); | |
| 871 | +var has = __webpack_require__(/*! ./lib/has */ "../node_modules/prop-types/lib/has.js"); | |
| 872 | +var checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ "../node_modules/prop-types/checkPropTypes.js"); | |
| 859 | 873 | |
| 860 | -//#endregion | |
| 861 | -//#region node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js | |
| 862 | - function _nonIterableSpread() { | |
| 863 | - throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | |
| 864 | - } | |
| 874 | +var printWarning = function() {}; | |
| 865 | 875 | |
| 866 | -//#endregion | |
| 867 | -//#region node_modules/@babel/runtime/helpers/esm/toConsumableArray.js | |
| 868 | - function _toConsumableArray(r) { | |
| 869 | - return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); | |
| 870 | - } | |
| 876 | +if (true) { | |
| 877 | + printWarning = function(text) { | |
| 878 | + var message = 'Warning: ' + text; | |
| 879 | + if (typeof console !== 'undefined') { | |
| 880 | + console.error(message); | |
| 881 | + } | |
| 882 | + try { | |
| 883 | + // --- Welcome to debugging React --- | |
| 884 | + // This error was thrown as a convenience so that you can use this stack | |
| 885 | + // to find the callsite that caused this warning to fire. | |
| 886 | + throw new Error(message); | |
| 887 | + } catch (x) {} | |
| 888 | + }; | |
| 889 | +} | |
| 871 | 890 | |
| 872 | -//#endregion | |
| 873 | -//#region node_modules/@babel/runtime/helpers/esm/extends.js | |
| 874 | - function _extends() { | |
| 875 | - return _extends = Object.assign ? Object.assign.bind() : function(n) { | |
| 876 | - for (var e = 1; e < arguments.length; e++) { | |
| 877 | - var t = arguments[e]; | |
| 878 | - for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); | |
| 879 | - } | |
| 880 | - return n; | |
| 881 | - }, _extends.apply(null, arguments); | |
| 882 | - } | |
| 891 | +function emptyFunctionThatReturnsNull() { | |
| 892 | + return null; | |
| 893 | +} | |
| 883 | 894 | |
| 884 | -//#endregion | |
| 885 | -//#region modules/notifications/assets/js/icons/x-icon.js | |
| 886 | - var XIcon = (0, react.forwardRef)(function(props, ref) { | |
| 887 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.SvgIcon, _extends({ viewBox: "0 0 24 24" }, props, { ref }), /*#__PURE__*/ react.default.createElement("path", { | |
| 888 | - fillRule: "evenodd", | |
| 889 | - clipRule: "evenodd", | |
| 890 | - d: "M18.5303 5.46967C18.8232 5.76256 18.8232 6.23744 18.5303 6.53033L6.53033 18.5303C6.23744 18.8232 5.76256 18.8232 5.46967 18.5303C5.17678 18.2374 5.17678 17.7626 5.46967 17.4697L17.4697 5.46967C17.7626 5.17678 18.2374 5.17678 18.5303 5.46967Z" | |
| 891 | - }), /*#__PURE__*/ react.default.createElement("path", { | |
| 892 | - fillRule: "evenodd", | |
| 893 | - clipRule: "evenodd", | |
| 894 | - d: "M5.46967 5.46967C5.76256 5.17678 6.23744 5.17678 6.53033 5.46967L18.5303 17.4697C18.8232 17.7626 18.8232 18.2374 18.5303 18.5303C18.2374 18.8232 17.7626 18.8232 17.4697 18.5303L5.46967 6.53033C5.17678 6.23744 5.17678 5.76256 5.46967 5.46967Z" | |
| 895 | - })); | |
| 896 | - }); | |
| 895 | +module.exports = function(isValidElement, throwOnDirectAccess) { | |
| 896 | + /* global Symbol */ | |
| 897 | + var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; | |
| 898 | + var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. | |
| 897 | 899 | |
| 898 | -//#endregion | |
| 899 | -//#region modules/notifications/assets/js/components/whats-new-top-bar.js | |
| 900 | - var WhatsNewTopBar = function WhatsNewTopBar(props) { | |
| 901 | - var setIsOpen = props.setIsOpen; | |
| 902 | - return /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, /*#__PURE__*/ react.default.createElement(_elementor_ui.AppBar, { | |
| 903 | - elevation: 0, | |
| 904 | - position: "sticky", | |
| 905 | - sx: { backgroundColor: "background.default" } | |
| 906 | - }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Toolbar, { variant: "dense" }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { | |
| 907 | - variant: "overline", | |
| 908 | - sx: { flexGrow: 1 } | |
| 909 | - }, (0, _wordpress_i18n.__)("What's New", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_ui.IconButton, { | |
| 910 | - "aria-label": "close", | |
| 911 | - size: "small", | |
| 912 | - onClick: function onClick() { | |
| 913 | - return setIsOpen(false); | |
| 914 | - } | |
| 915 | - }, /*#__PURE__*/ react.default.createElement(XIcon, null)))), /*#__PURE__*/ react.default.createElement(_elementor_ui.Divider, null)); | |
| 916 | - }; | |
| 917 | - WhatsNewTopBar.propTypes = { setIsOpen: import_prop_types.default.func.isRequired }; | |
| 900 | + /** | |
| 901 | + * Returns the iterator method function contained on the iterable object. | |
| 902 | + * | |
| 903 | + * Be sure to invoke the function with the iterable as context: | |
| 904 | + * | |
| 905 | + * var iteratorFn = getIteratorFn(myIterable); | |
| 906 | + * if (iteratorFn) { | |
| 907 | + * var iterator = iteratorFn.call(myIterable); | |
| 908 | + * ... | |
| 909 | + * } | |
| 910 | + * | |
| 911 | + * @param {?object} maybeIterable | |
| 912 | + * @return {?function} | |
| 913 | + */ | |
| 914 | + function getIteratorFn(maybeIterable) { | |
| 915 | + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); | |
| 916 | + if (typeof iteratorFn === 'function') { | |
| 917 | + return iteratorFn; | |
| 918 | + } | |
| 919 | + } | |
| 918 | 920 | |
| 919 | -//#endregion | |
| 920 | -//#region modules/notifications/assets/js/api/index.js | |
| 921 | - var request = function request(endpoint) { | |
| 922 | - var data = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; | |
| 923 | - return new Promise(function(resolve, reject) { | |
| 924 | - elementorCommon.ajax.addRequest(endpoint, { | |
| 925 | - success: resolve, | |
| 926 | - error: reject, | |
| 927 | - data | |
| 928 | - }); | |
| 929 | - }); | |
| 930 | - }; | |
| 931 | - var getNotifications = function getNotifications() { | |
| 932 | - return request("notifications_get"); | |
| 933 | - }; | |
| 921 | + /** | |
| 922 | + * Collection of methods that allow declaration and validation of props that are | |
| 923 | + * supplied to React components. Example usage: | |
| 924 | + * | |
| 925 | + * var Props = require('ReactPropTypes'); | |
| 926 | + * var MyArticle = React.createClass({ | |
| 927 | + * propTypes: { | |
| 928 | + * // An optional string prop named "description". | |
| 929 | + * description: Props.string, | |
| 930 | + * | |
| 931 | + * // A required enum prop named "category". | |
| 932 | + * category: Props.oneOf(['News','Photos']).isRequired, | |
| 933 | + * | |
| 934 | + * // A prop named "dialog" that requires an instance of Dialog. | |
| 935 | + * dialog: Props.instanceOf(Dialog).isRequired | |
| 936 | + * }, | |
| 937 | + * render: function() { ... } | |
| 938 | + * }); | |
| 939 | + * | |
| 940 | + * A more formal specification of how these methods are used: | |
| 941 | + * | |
| 942 | + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) | |
| 943 | + * decl := ReactPropTypes.{type}(.isRequired)? | |
| 944 | + * | |
| 945 | + * Each and every declaration produces a function with the same signature. This | |
| 946 | + * allows the creation of custom validation functions. For example: | |
| 947 | + * | |
| 948 | + * var MyLink = React.createClass({ | |
| 949 | + * propTypes: { | |
| 950 | + * // An optional string or URI prop named "href". | |
| 951 | + * href: function(props, propName, componentName) { | |
| 952 | + * var propValue = props[propName]; | |
| 953 | + * if (propValue != null && typeof propValue !== 'string' && | |
| 954 | + * !(propValue instanceof URI)) { | |
| 955 | + * return new Error( | |
| 956 | + * 'Expected a string or an URI for ' + propName + ' in ' + | |
| 957 | + * componentName | |
| 958 | + * ); | |
| 959 | + * } | |
| 960 | + * } | |
| 961 | + * }, | |
| 962 | + * render: function() {...} | |
| 963 | + * }); | |
| 964 | + * | |
| 965 | + * @internal | |
| 966 | + */ | |
| 934 | 967 | |
| 935 | -//#endregion | |
| 936 | -//#region node_modules/@babel/runtime/helpers/esm/typeof.js | |
| 937 | - function _typeof(o) { | |
| 938 | - "@babel/helpers - typeof"; | |
| 939 | - return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) { | |
| 940 | - return typeof o; | |
| 941 | - } : function(o) { | |
| 942 | - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; | |
| 943 | - }, _typeof(o); | |
| 944 | - } | |
| 968 | + var ANONYMOUS = '<<anonymous>>'; | |
| 945 | 969 | |
| 946 | -//#endregion | |
| 947 | -//#region node_modules/@babel/runtime/helpers/esm/toPrimitive.js | |
| 948 | - function toPrimitive(t, r) { | |
| 949 | - if ("object" != _typeof(t) || !t) return t; | |
| 950 | - var e = t[Symbol.toPrimitive]; | |
| 951 | - if (void 0 !== e) { | |
| 952 | - var i = e.call(t, r || "default"); | |
| 953 | - if ("object" != _typeof(i)) return i; | |
| 954 | - throw new TypeError("@@toPrimitive must return a primitive value."); | |
| 955 | - } | |
| 956 | - return ("string" === r ? String : Number)(t); | |
| 957 | - } | |
| 970 | + // Important! | |
| 971 | + // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. | |
| 972 | + var ReactPropTypes = { | |
| 973 | + array: createPrimitiveTypeChecker('array'), | |
| 974 | + bigint: createPrimitiveTypeChecker('bigint'), | |
| 975 | + bool: createPrimitiveTypeChecker('boolean'), | |
| 976 | + func: createPrimitiveTypeChecker('function'), | |
| 977 | + number: createPrimitiveTypeChecker('number'), | |
| 978 | + object: createPrimitiveTypeChecker('object'), | |
| 979 | + string: createPrimitiveTypeChecker('string'), | |
| 980 | + symbol: createPrimitiveTypeChecker('symbol'), | |
| 958 | 981 | |
| 959 | -//#endregion | |
| 960 | -//#region node_modules/@babel/runtime/helpers/esm/toPropertyKey.js | |
| 961 | - function toPropertyKey(t) { | |
| 962 | - var i = toPrimitive(t, "string"); | |
| 963 | - return "symbol" == _typeof(i) ? i : i + ""; | |
| 964 | - } | |
| 982 | + any: createAnyTypeChecker(), | |
| 983 | + arrayOf: createArrayOfTypeChecker, | |
| 984 | + element: createElementTypeChecker(), | |
| 985 | + elementType: createElementTypeTypeChecker(), | |
| 986 | + instanceOf: createInstanceTypeChecker, | |
| 987 | + node: createNodeChecker(), | |
| 988 | + objectOf: createObjectOfTypeChecker, | |
| 989 | + oneOf: createEnumTypeChecker, | |
| 990 | + oneOfType: createUnionTypeChecker, | |
| 991 | + shape: createShapeTypeChecker, | |
| 992 | + exact: createStrictShapeTypeChecker, | |
| 993 | + }; | |
| 965 | 994 | |
| 966 | -//#endregion | |
| 967 | -//#region node_modules/@babel/runtime/helpers/esm/defineProperty.js | |
| 968 | - function _defineProperty(e, r, t) { | |
| 969 | - return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { | |
| 970 | - value: t, | |
| 971 | - enumerable: !0, | |
| 972 | - configurable: !0, | |
| 973 | - writable: !0 | |
| 974 | - }) : e[r] = t, e; | |
| 975 | - } | |
| 995 | + /** | |
| 996 | + * inlined Object.is polyfill to avoid requiring consumers ship their own | |
| 997 | + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is | |
| 998 | + */ | |
| 999 | + /*eslint-disable no-self-compare*/ | |
| 1000 | + function is(x, y) { | |
| 1001 | + // SameValue algorithm | |
| 1002 | + if (x === y) { | |
| 1003 | + // Steps 1-5, 7-10 | |
| 1004 | + // Steps 6.b-6.e: +0 != -0 | |
| 1005 | + return x !== 0 || 1 / x === 1 / y; | |
| 1006 | + } else { | |
| 1007 | + // Step 6.a: NaN == NaN | |
| 1008 | + return x !== x && y !== y; | |
| 1009 | + } | |
| 1010 | + } | |
| 1011 | + /*eslint-enable no-self-compare*/ | |
| 976 | 1012 | |
| 977 | -//#endregion | |
| 978 | -//#region modules/notifications/assets/js/components/whats-new-item-topic-line.js | |
| 979 | - var WhatsNewItemTopicLine = function WhatsNewItemTopicLine(_ref) { | |
| 980 | - var topic = _ref.topic; | |
| 981 | - var date = _ref.date; | |
| 982 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { | |
| 983 | - direction: "row", | |
| 984 | - divider: /*#__PURE__*/ react.default.createElement(_elementor_ui.Divider, { | |
| 985 | - orientation: "vertical", | |
| 986 | - flexItem: true | |
| 987 | - }), | |
| 988 | - spacing: 1, | |
| 989 | - color: "text.tertiary", | |
| 990 | - sx: { pb: 1 } | |
| 991 | - }, topic && /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, null, topic), date && /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, null, date)); | |
| 992 | - }; | |
| 993 | - WhatsNewItemTopicLine.propTypes = { | |
| 994 | - topic: import_prop_types.default.string, | |
| 995 | - date: import_prop_types.default.string | |
| 996 | - }; | |
| 1013 | + /** | |
| 1014 | + * We use an Error-like object for backward compatibility as people may call | |
| 1015 | + * PropTypes directly and inspect their output. However, we don't use real | |
| 1016 | + * Errors anymore. We don't inspect their stack anyway, and creating them | |
| 1017 | + * is prohibitively expensive if they are created too often, such as what | |
| 1018 | + * happens in oneOfType() for any type before the one that matched. | |
| 1019 | + */ | |
| 1020 | + function PropTypeError(message, data) { | |
| 1021 | + this.message = message; | |
| 1022 | + this.data = data && typeof data === 'object' ? data: {}; | |
| 1023 | + this.stack = ''; | |
| 1024 | + } | |
| 1025 | + // Make `instanceof Error` still work for returned errors. | |
| 1026 | + PropTypeError.prototype = Error.prototype; | |
| 997 | 1027 | |
| 998 | -//#endregion | |
| 999 | -//#region modules/notifications/assets/js/components/wrapper-with-link.js | |
| 1000 | - var WrapperWithLink = function WrapperWithLink(props) { | |
| 1001 | - var link = props.link; | |
| 1002 | - var children = props.children; | |
| 1003 | - if (!link) return children; | |
| 1004 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Link, { | |
| 1005 | - href: link, | |
| 1006 | - target: "_blank", | |
| 1007 | - underline: "none", | |
| 1008 | - color: "inherit", | |
| 1009 | - sx: { "&:hover": { color: "inherit" } } | |
| 1010 | - }, children); | |
| 1011 | - }; | |
| 1012 | - WrapperWithLink.propTypes = { | |
| 1013 | - link: import_prop_types.default.string, | |
| 1014 | - children: import_prop_types.default.any.isRequired | |
| 1015 | - }; | |
| 1028 | + function createChainableTypeChecker(validate) { | |
| 1029 | + if (true) { | |
| 1030 | + var manualPropTypeCallCache = {}; | |
| 1031 | + var manualPropTypeWarningCount = 0; | |
| 1032 | + } | |
| 1033 | + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { | |
| 1034 | + componentName = componentName || ANONYMOUS; | |
| 1035 | + propFullName = propFullName || propName; | |
| 1016 | 1036 | |
| 1017 | -//#endregion | |
| 1018 | -//#region modules/notifications/assets/js/components/whats-new-item-thumbnail.js | |
| 1019 | - var WhatsNewItemThumbnail = function WhatsNewItemThumbnail(_ref) { | |
| 1020 | - var imageSrc = _ref.imageSrc; | |
| 1021 | - var title = _ref.title; | |
| 1022 | - var link = _ref.link; | |
| 1023 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { pb: 2 } }, /*#__PURE__*/ react.default.createElement(WrapperWithLink, { link }, /*#__PURE__*/ react.default.createElement("img", { | |
| 1024 | - src: imageSrc, | |
| 1025 | - alt: title || "", | |
| 1026 | - style: { maxWidth: "100%" } | |
| 1027 | - }))); | |
| 1028 | - }; | |
| 1029 | - WhatsNewItemThumbnail.propTypes = { | |
| 1030 | - imageSrc: import_prop_types.default.string.isRequired, | |
| 1031 | - title: import_prop_types.default.string, | |
| 1032 | - link: import_prop_types.default.string | |
| 1033 | - }; | |
| 1037 | + if (secret !== ReactPropTypesSecret) { | |
| 1038 | + if (throwOnDirectAccess) { | |
| 1039 | + // New behavior only for users of `prop-types` package | |
| 1040 | + var err = new Error( | |
| 1041 | + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + | |
| 1042 | + 'Use `PropTypes.checkPropTypes()` to call them. ' + | |
| 1043 | + 'Read more at http://fb.me/use-check-prop-types' | |
| 1044 | + ); | |
| 1045 | + err.name = 'Invariant Violation'; | |
| 1046 | + throw err; | |
| 1047 | + } else if ( true && typeof console !== 'undefined') { | |
| 1048 | + // Old behavior for people using React.PropTypes | |
| 1049 | + var cacheKey = componentName + ':' + propName; | |
| 1050 | + if ( | |
| 1051 | + !manualPropTypeCallCache[cacheKey] && | |
| 1052 | + // Avoid spamming the console because they are often not actionable except for lib authors | |
| 1053 | + manualPropTypeWarningCount < 3 | |
| 1054 | + ) { | |
| 1055 | + printWarning( | |
| 1056 | + 'You are manually calling a React.PropTypes validation ' + | |
| 1057 | + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + | |
| 1058 | + 'and will throw in the standalone `prop-types` package. ' + | |
| 1059 | + 'You may be seeing this warning due to a third-party PropTypes ' + | |
| 1060 | + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.' | |
| 1061 | + ); | |
| 1062 | + manualPropTypeCallCache[cacheKey] = true; | |
| 1063 | + manualPropTypeWarningCount++; | |
| 1064 | + } | |
| 1065 | + } | |
| 1066 | + } | |
| 1067 | + if (props[propName] == null) { | |
| 1068 | + if (isRequired) { | |
| 1069 | + if (props[propName] === null) { | |
| 1070 | + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); | |
| 1071 | + } | |
| 1072 | + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); | |
| 1073 | + } | |
| 1074 | + return null; | |
| 1075 | + } else { | |
| 1076 | + return validate(props, propName, componentName, location, propFullName); | |
| 1077 | + } | |
| 1078 | + } | |
| 1034 | 1079 | |
| 1035 | -//#endregion | |
| 1036 | -//#region modules/notifications/assets/js/components/whats-new-item-media.js | |
| 1037 | - var WhatsNewItemMedia = function WhatsNewItemMedia(_ref) { | |
| 1038 | - var item = _ref.item; | |
| 1039 | - if (item.youtubeEmbedId) { | |
| 1040 | - var videoId = item.youtubeEmbedId.split("?")[0]; | |
| 1041 | - var src = "https://www.youtube.com/embed/".concat(videoId).concat(item.youtubeAutoplay ? "?autoplay=1&mute=1" : ""); | |
| 1042 | - var allow = "encrypted-media; picture-in-picture".concat(item.youtubeAutoplay ? "; autoplay" : ""); | |
| 1043 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { pb: 2 } }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { | |
| 1044 | - component: "iframe", | |
| 1045 | - src, | |
| 1046 | - title: item.title || "Video", | |
| 1047 | - allow, | |
| 1048 | - allowFullScreen: true, | |
| 1049 | - sx: { | |
| 1050 | - aspectRatio: "16/9", | |
| 1051 | - width: "100%", | |
| 1052 | - display: "block", | |
| 1053 | - border: "none" | |
| 1054 | - } | |
| 1055 | - })); | |
| 1056 | - } | |
| 1057 | - var mediaSrc = item.gifSrc || item.imageSrc; | |
| 1058 | - if (!mediaSrc) return null; | |
| 1059 | - return /*#__PURE__*/ react.default.createElement(WhatsNewItemThumbnail, { | |
| 1060 | - imageSrc: mediaSrc, | |
| 1061 | - link: item.link, | |
| 1062 | - title: item.title | |
| 1063 | - }); | |
| 1064 | - }; | |
| 1080 | + var chainedCheckType = checkType.bind(null, false); | |
| 1081 | + chainedCheckType.isRequired = checkType.bind(null, true); | |
| 1065 | 1082 | |
| 1066 | -//#endregion | |
| 1067 | -//#region modules/notifications/assets/js/components/whats-new-item-chips.js | |
| 1068 | - var WhatsNewItemChips = function WhatsNewItemChips(_ref) { | |
| 1069 | - var chipPlan = _ref.chipPlan; | |
| 1070 | - var chipTags = _ref.chipTags; | |
| 1071 | - var itemIndex = _ref.itemIndex; | |
| 1072 | - var chips = []; | |
| 1073 | - if (chipPlan) chips.push({ | |
| 1074 | - color: "promotion", | |
| 1075 | - size: "small", | |
| 1076 | - label: chipPlan | |
| 1077 | - }); | |
| 1078 | - if (chipTags) chipTags.forEach(function(chipTag) { | |
| 1079 | - chips.push({ | |
| 1080 | - variant: "outlined", | |
| 1081 | - size: "small", | |
| 1082 | - label: chipTag | |
| 1083 | - }); | |
| 1084 | - }); | |
| 1085 | - if (!chips.length) return null; | |
| 1086 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { | |
| 1087 | - direction: "row", | |
| 1088 | - flexWrap: "wrap", | |
| 1089 | - gap: 1, | |
| 1090 | - sx: { pb: 1 } | |
| 1091 | - }, chips.map(function(chip, chipIndex) { | |
| 1092 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Chip, _extends({ key: "chip-".concat(itemIndex).concat(chipIndex) }, chip)); | |
| 1093 | - })); | |
| 1094 | - }; | |
| 1095 | - WhatsNewItemChips.propTypes = { | |
| 1096 | - chipPlan: import_prop_types.default.string, | |
| 1097 | - chipTags: import_prop_types.default.array, | |
| 1098 | - itemIndex: import_prop_types.default.number.isRequired | |
| 1099 | - }; | |
| 1083 | + return chainedCheckType; | |
| 1084 | + } | |
| 1100 | 1085 | |
| 1101 | -//#endregion | |
| 1102 | -//#region modules/notifications/assets/js/components/is-image-only.js | |
| 1103 | - var isImageOnly = function isImageOnly(item) { | |
| 1104 | - return !item.title && !item.description && (item.imageSrc || item.gifSrc || item.youtubeEmbedId); | |
| 1105 | - }; | |
| 1086 | + function createPrimitiveTypeChecker(expectedType) { | |
| 1087 | + function validate(props, propName, componentName, location, propFullName, secret) { | |
| 1088 | + var propValue = props[propName]; | |
| 1089 | + var propType = getPropType(propValue); | |
| 1090 | + if (propType !== expectedType) { | |
| 1091 | + // `propValue` being instance of, say, date/regexp, pass the 'object' | |
| 1092 | + // check, but we can offer a more precise error message here rather than | |
| 1093 | + // 'of type `object`'. | |
| 1094 | + var preciseType = getPreciseType(propValue); | |
| 1106 | 1095 | |
| 1107 | -//#endregion | |
| 1108 | -//#region modules/notifications/assets/js/components/whats-new-item.js | |
| 1109 | - function ownKeys(e, r) { | |
| 1110 | - var t = Object.keys(e); | |
| 1111 | - if (Object.getOwnPropertySymbols) { | |
| 1112 | - var o = Object.getOwnPropertySymbols(e); | |
| 1113 | - r && (o = o.filter(function(r) { | |
| 1114 | - return Object.getOwnPropertyDescriptor(e, r).enumerable; | |
| 1115 | - })), t.push.apply(t, o); | |
| 1116 | - } | |
| 1117 | - return t; | |
| 1118 | - } | |
| 1119 | - function _objectSpread(e) { | |
| 1120 | - for (var r = 1; r < arguments.length; r++) { | |
| 1121 | - var t = null != arguments[r] ? arguments[r] : {}; | |
| 1122 | - r % 2 ? ownKeys(Object(t), !0).forEach(function(r) { | |
| 1123 | - _defineProperty(e, r, t[r]); | |
| 1124 | - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) { | |
| 1125 | - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); | |
| 1126 | - }); | |
| 1127 | - } | |
| 1128 | - return e; | |
| 1129 | - } | |
| 1130 | - var WhatsNewItem = function WhatsNewItem(_ref) { | |
| 1131 | - var item = _ref.item; | |
| 1132 | - var itemIndex = _ref.itemIndex; | |
| 1133 | - var itemsLength = _ref.itemsLength; | |
| 1134 | - var setIsOpen = _ref.setIsOpen; | |
| 1135 | - var _ref$featured = _ref.featured; | |
| 1136 | - var featured = _ref$featured === void 0 ? false : _ref$featured; | |
| 1137 | - var hasMedia = item.imageSrc || item.gifSrc || item.youtubeEmbedId; | |
| 1138 | - if (isImageOnly(item)) return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { | |
| 1139 | - key: itemIndex, | |
| 1140 | - display: "flex", | |
| 1141 | - flexDirection: "column", | |
| 1142 | - sx: _objectSpread({ pt: 2 }, featured && { px: 1 }) | |
| 1143 | - }, /*#__PURE__*/ react.default.createElement(WhatsNewItemMedia, { item }), itemIndex !== itemsLength - 1 && /*#__PURE__*/ react.default.createElement(_elementor_ui.Divider, { sx: { my: 1 } })); | |
| 1144 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { | |
| 1145 | - key: itemIndex, | |
| 1146 | - display: "flex", | |
| 1147 | - flexDirection: "column", | |
| 1148 | - sx: _objectSpread({ pt: 2 }, featured && { px: 1 }) | |
| 1149 | - }, (item.topic || item.date) && /*#__PURE__*/ react.default.createElement(WhatsNewItemTopicLine, { | |
| 1150 | - topic: item.topic, | |
| 1151 | - date: item.date | |
| 1152 | - }), /*#__PURE__*/ react.default.createElement(WrapperWithLink, { link: item.link }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { | |
| 1153 | - variant: featured ? "h6" : "subtitle1", | |
| 1154 | - sx: { pb: 2 } | |
| 1155 | - }, item.title)), /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { position: "relative" } }, /*#__PURE__*/ react.default.createElement(WhatsNewItemMedia, { item }), featured && item.chipPlan && hasMedia && /*#__PURE__*/ react.default.createElement(_elementor_ui.Chip, { | |
| 1156 | - label: item.chipPlan, | |
| 1157 | - color: "promotion", | |
| 1158 | - size: "small", | |
| 1159 | - sx: { | |
| 1160 | - position: "absolute", | |
| 1161 | - top: 8, | |
| 1162 | - insetInlineStart: 8 | |
| 1163 | - } | |
| 1164 | - })), /*#__PURE__*/ react.default.createElement(WhatsNewItemChips, { | |
| 1165 | - chipPlan: featured && hasMedia ? null : item.chipPlan, | |
| 1166 | - chipTags: item.chipTags, | |
| 1167 | - itemIndex | |
| 1168 | - }), item.description && /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { | |
| 1169 | - variant: "body2", | |
| 1170 | - color: "text.secondary", | |
| 1171 | - sx: { pb: 2 } | |
| 1172 | - }, item.description, item.readMoreText && /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, " ", /*#__PURE__*/ react.default.createElement(_elementor_ui.Link, { | |
| 1173 | - href: item.link, | |
| 1174 | - color: "info.main", | |
| 1175 | - target: "_blank" | |
| 1176 | - }, item.readMoreText))), item.cta && item.ctaLink && /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { pb: 2 } }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { | |
| 1177 | - href: item.ctaLink, | |
| 1178 | - target: item.ctaLink.startsWith("#") ? "_self" : "_blank", | |
| 1179 | - variant: "contained", | |
| 1180 | - size: "small", | |
| 1181 | - color: "promotion", | |
| 1182 | - onClick: item.ctaLink.startsWith("#") ? function() { | |
| 1183 | - return setIsOpen(false); | |
| 1184 | - } : void 0 | |
| 1185 | - }, item.cta)), itemIndex !== itemsLength - 1 && /*#__PURE__*/ react.default.createElement(_elementor_ui.Divider, { sx: { my: 1 } })); | |
| 1186 | - }; | |
| 1187 | - WhatsNewItem.propTypes = { | |
| 1188 | - item: import_prop_types.default.object.isRequired, | |
| 1189 | - itemIndex: import_prop_types.default.number.isRequired, | |
| 1190 | - itemsLength: import_prop_types.default.number.isRequired, | |
| 1191 | - setIsOpen: import_prop_types.default.func.isRequired, | |
| 1192 | - featured: import_prop_types.default.bool | |
| 1193 | - }; | |
| 1096 | + return new PropTypeError( | |
| 1097 | + 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), | |
| 1098 | + {expectedType: expectedType} | |
| 1099 | + ); | |
| 1100 | + } | |
| 1101 | + return null; | |
| 1102 | + } | |
| 1103 | + return createChainableTypeChecker(validate); | |
| 1104 | + } | |
| 1194 | 1105 | |
| 1195 | -//#endregion | |
| 1196 | -//#region modules/notifications/assets/js/components/whats-new-item-collapsed.js | |
| 1197 | - var WhatsNewItemCollapsed = function WhatsNewItemCollapsed(_ref) { | |
| 1198 | - var item = _ref.item; | |
| 1199 | - var itemIndex = _ref.itemIndex; | |
| 1200 | - var isNew = _ref.isNew; | |
| 1201 | - var onSeen = _ref.onSeen; | |
| 1202 | - var setIsOpen = _ref.setIsOpen; | |
| 1203 | - var _useState2 = _slicedToArray((0, react.useState)(false), 2); | |
| 1204 | - var expanded = _useState2[0]; | |
| 1205 | - var setExpanded = _useState2[1]; | |
| 1206 | - var handleToggle = function handleToggle() { | |
| 1207 | - if (!expanded && isNew && onSeen) onSeen(item.id); | |
| 1208 | - setExpanded(!expanded); | |
| 1209 | - }; | |
| 1210 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, null, /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { | |
| 1211 | - role: "button", | |
| 1212 | - tabIndex: 0, | |
| 1213 | - "aria-expanded": expanded, | |
| 1214 | - onClick: handleToggle, | |
| 1215 | - onKeyDown: function handleKeyDown(event) { | |
| 1216 | - if ("Enter" === event.key || " " === event.key) { | |
| 1217 | - event.preventDefault(); | |
| 1218 | - handleToggle(); | |
| 1219 | - } | |
| 1220 | - }, | |
| 1221 | - sx: { | |
| 1222 | - position: "relative", | |
| 1223 | - display: "flex", | |
| 1224 | - alignItems: "flex-start", | |
| 1225 | - gap: 1, | |
| 1226 | - cursor: "pointer", | |
| 1227 | - py: 2, | |
| 1228 | - paddingInlineStart: 1 | |
| 1229 | - } | |
| 1230 | - }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { | |
| 1231 | - component: "span", | |
| 1232 | - sx: { | |
| 1233 | - position: "absolute", | |
| 1234 | - insetInlineStart: "-6px", | |
| 1235 | - top: "23px", | |
| 1236 | - width: 6, | |
| 1237 | - height: 6, | |
| 1238 | - borderRadius: "50%", | |
| 1239 | - backgroundColor: "primary.main", | |
| 1240 | - opacity: isNew ? 1 : 0, | |
| 1241 | - transition: "opacity 0.2s ease", | |
| 1242 | - pointerEvents: "none" | |
| 1243 | - } | |
| 1244 | - }), /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { | |
| 1245 | - flex: 1, | |
| 1246 | - minWidth: 0 | |
| 1247 | - } }, item.topic && /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { | |
| 1248 | - variant: "caption", | |
| 1249 | - color: "text.tertiary", | |
| 1250 | - display: "block" | |
| 1251 | - }, item.topic), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { | |
| 1252 | - variant: "subtitle2", | |
| 1253 | - noWrap: true | |
| 1254 | - }, item.title), item.description && /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { | |
| 1255 | - maxHeight: expanded ? 0 : "3em", | |
| 1256 | - opacity: expanded ? 0 : 1, | |
| 1257 | - overflow: "hidden", | |
| 1258 | - transition: "max-height 0.2s ease, opacity 0.15s ease" | |
| 1259 | - } }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { | |
| 1260 | - variant: "caption", | |
| 1261 | - color: "text.secondary", | |
| 1262 | - sx: { | |
| 1263 | - display: "-webkit-box", | |
| 1264 | - WebkitLineClamp: 2, | |
| 1265 | - WebkitBoxOrient: "vertical", | |
| 1266 | - overflow: "hidden" | |
| 1267 | - } | |
| 1268 | - }, item.description))), /*#__PURE__*/ react.default.createElement(_elementor_icons.ChevronDownIcon, { sx: { | |
| 1269 | - flexShrink: 0, | |
| 1270 | - color: "secondary.main", | |
| 1271 | - fontSize: "small", | |
| 1272 | - mt: .25, | |
| 1273 | - transform: expanded ? "rotate(180deg)" : "rotate(0deg)", | |
| 1274 | - transition: "transform 0.2s" | |
| 1275 | - } })), /*#__PURE__*/ react.default.createElement(_elementor_ui.Collapse, { in: expanded }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { | |
| 1276 | - pb: 2, | |
| 1277 | - paddingInlineStart: 1 | |
| 1278 | - } }, /*#__PURE__*/ react.default.createElement(WhatsNewItemMedia, { item }), /*#__PURE__*/ react.default.createElement(WhatsNewItemChips, { | |
| 1279 | - chipPlan: item.chipPlan, | |
| 1280 | - chipTags: item.chipTags, | |
| 1281 | - itemIndex | |
| 1282 | - }), item.description && /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { | |
| 1283 | - variant: "body2", | |
| 1284 | - color: "text.secondary", | |
| 1285 | - sx: { pb: 2 } | |
| 1286 | - }, item.description, item.readMoreText && /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, " ", /*#__PURE__*/ react.default.createElement(_elementor_ui.Link, { | |
| 1287 | - href: item.link, | |
| 1288 | - color: "info.main", | |
| 1289 | - target: "_blank" | |
| 1290 | - }, item.readMoreText))), item.cta && item.ctaLink && /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { pb: 2 } }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { | |
| 1291 | - href: item.ctaLink, | |
| 1292 | - target: item.ctaLink.startsWith("#") ? "_self" : "_blank", | |
| 1293 | - variant: "contained", | |
| 1294 | - size: "small", | |
| 1295 | - color: "promotion", | |
| 1296 | - onClick: item.ctaLink.startsWith("#") ? function() { | |
| 1297 | - return setIsOpen === null || setIsOpen === void 0 ? void 0 : setIsOpen(false); | |
| 1298 | - } : void 0 | |
| 1299 | - }, item.cta)))), /*#__PURE__*/ react.default.createElement(_elementor_ui.Divider, null)); | |
| 1300 | - }; | |
| 1301 | - WhatsNewItemCollapsed.propTypes = { | |
| 1302 | - item: import_prop_types.default.object.isRequired, | |
| 1303 | - itemIndex: import_prop_types.default.number.isRequired, | |
| 1304 | - isNew: import_prop_types.default.bool, | |
| 1305 | - onSeen: import_prop_types.default.func, | |
| 1306 | - setIsOpen: import_prop_types.default.func | |
| 1307 | - }; | |
| 1106 | + function createAnyTypeChecker() { | |
| 1107 | + return createChainableTypeChecker(emptyFunctionThatReturnsNull); | |
| 1108 | + } | |
| 1308 | 1109 | |
| 1309 | -//#endregion | |
| 1310 | -//#region modules/notifications/assets/js/components/whats-new-drawer-content.js | |
| 1311 | - var WhatsNewDrawerContent = function WhatsNewDrawerContent(_ref) { | |
| 1312 | - var _items$find$listLabel; | |
| 1313 | - var _items$find; | |
| 1314 | - var setIsOpen = _ref.setIsOpen; | |
| 1315 | - var seenItemIds = _ref.seenItemIds; | |
| 1316 | - var onSeen = _ref.onSeen; | |
| 1317 | - var initialHasUnread = _ref.initialHasUnread; | |
| 1318 | - var _useQuery = (0, _elementor_query.useQuery)({ | |
| 1319 | - queryKey: ["e-notifications"], | |
| 1320 | - queryFn: getNotifications | |
| 1321 | - }); | |
| 1322 | - var isPending = _useQuery.isPending; | |
| 1323 | - var error = _useQuery.error; | |
| 1324 | - var items = _useQuery.data; | |
| 1325 | - var seenItemIdsRef = (0, react.useRef)(seenItemIds); | |
| 1326 | - seenItemIdsRef.current = seenItemIds; | |
| 1327 | - (0, react.useEffect)(function() { | |
| 1328 | - if (!items) return; | |
| 1329 | - (items.some(function(item) { | |
| 1330 | - return item.featured; | |
| 1331 | - }) ? items.filter(function(item) { | |
| 1332 | - return item.featured; | |
| 1333 | - }) : items).filter(function(item) { | |
| 1334 | - return !seenItemIdsRef.current.has(item.id); | |
| 1335 | - }).forEach(function(item) { | |
| 1336 | - return onSeen(item.id); | |
| 1337 | - }); | |
| 1338 | - }, [items, onSeen]); | |
| 1339 | - if (isPending) return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, null, /*#__PURE__*/ react.default.createElement(_elementor_ui.LinearProgress, { color: "secondary" })); | |
| 1340 | - if (error) return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, null, "An error has occurred: ", error); | |
| 1341 | - var featuredItems = items.filter(function(item) { | |
| 1342 | - return item.featured; | |
| 1343 | - }); | |
| 1344 | - var nonFeaturedItems = items.filter(function(item) { | |
| 1345 | - return !item.featured && !isImageOnly(item); | |
| 1346 | - }); | |
| 1347 | - var listLabel = (_items$find$listLabel = (_items$find = items.find(function(item) { | |
| 1348 | - return item.listLabel; | |
| 1349 | - })) === null || _items$find === void 0 ? void 0 : _items$find.listLabel) !== null && _items$find$listLabel !== void 0 ? _items$find$listLabel : null; | |
| 1350 | - return /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, featuredItems.map(function(item, index) { | |
| 1351 | - return /*#__PURE__*/ react.default.createElement(WhatsNewItem, { | |
| 1352 | - key: item.id, | |
| 1353 | - item, | |
| 1354 | - itemIndex: index, | |
| 1355 | - itemsLength: featuredItems.length, | |
| 1356 | - setIsOpen, | |
| 1357 | - featured: true | |
| 1358 | - }); | |
| 1359 | - }), featuredItems.length > 0 && nonFeaturedItems.length > 0 && /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, listLabel ? /*#__PURE__*/ react.default.createElement(_elementor_ui.Divider, { sx: { my: 1.5 } }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { | |
| 1360 | - variant: "caption", | |
| 1361 | - color: "text.secondary", | |
| 1362 | - sx: { | |
| 1363 | - px: 1, | |
| 1364 | - textTransform: "uppercase", | |
| 1365 | - letterSpacing: "0.08em" | |
| 1366 | - } | |
| 1367 | - }, listLabel)) : /*#__PURE__*/ react.default.createElement(_elementor_ui.Divider, { sx: { my: 1.5 } }), nonFeaturedItems.map(function(item, index) { | |
| 1368 | - return /*#__PURE__*/ react.default.createElement(WhatsNewItemCollapsed, { | |
| 1369 | - key: item.id, | |
| 1370 | - item, | |
| 1371 | - itemIndex: index, | |
| 1372 | - isNew: initialHasUnread && !seenItemIds.has(item.id), | |
| 1373 | - onSeen, | |
| 1374 | - setIsOpen | |
| 1375 | - }); | |
| 1376 | - })), 0 === featuredItems.length && nonFeaturedItems.map(function(item, itemIndex) { | |
| 1377 | - return /*#__PURE__*/ react.default.createElement(WhatsNewItem, { | |
| 1378 | - key: item.id, | |
| 1379 | - item, | |
| 1380 | - itemIndex, | |
| 1381 | - itemsLength: nonFeaturedItems.length, | |
| 1382 | - setIsOpen | |
| 1383 | - }); | |
| 1384 | - })); | |
| 1385 | - }; | |
| 1386 | - WhatsNewDrawerContent.propTypes = { | |
| 1387 | - setIsOpen: import_prop_types.default.func.isRequired, | |
| 1388 | - seenItemIds: import_prop_types.default.instanceOf(Set).isRequired, | |
| 1389 | - onSeen: import_prop_types.default.func.isRequired, | |
| 1390 | - initialHasUnread: import_prop_types.default.bool.isRequired | |
| 1391 | - }; | |
| 1110 | + function createArrayOfTypeChecker(typeChecker) { | |
| 1111 | + function validate(props, propName, componentName, location, propFullName) { | |
| 1112 | + if (typeof typeChecker !== 'function') { | |
| 1113 | + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); | |
| 1114 | + } | |
| 1115 | + var propValue = props[propName]; | |
| 1116 | + if (!Array.isArray(propValue)) { | |
| 1117 | + var propType = getPropType(propValue); | |
| 1118 | + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); | |
| 1119 | + } | |
| 1120 | + for (var i = 0; i < propValue.length; i++) { | |
| 1121 | + var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); | |
| 1122 | + if (error instanceof Error) { | |
| 1123 | + return error; | |
| 1124 | + } | |
| 1125 | + } | |
| 1126 | + return null; | |
| 1127 | + } | |
| 1128 | + return createChainableTypeChecker(validate); | |
| 1129 | + } | |
| 1392 | 1130 | |
| 1393 | -//#endregion | |
| 1394 | -//#region modules/notifications/assets/js/components/whats-new.js | |
| 1395 | - var _window$elementorNoti; | |
| 1396 | - var _window$elementorNoti2; | |
| 1397 | - var queryClient = new _elementor_query.QueryClient({ defaultOptions: { queries: { | |
| 1398 | - refetchOnWindowFocus: false, | |
| 1399 | - retry: false, | |
| 1400 | - staleTime: 1e3 * 60 * 30 | |
| 1401 | - } } }); | |
| 1402 | - var initialHasUnread = ((_window$elementorNoti = (_window$elementorNoti2 = window.elementorNotifications) === null || _window$elementorNoti2 === void 0 ? void 0 : _window$elementorNoti2.unread_count) !== null && _window$elementorNoti !== void 0 ? _window$elementorNoti : 0) > 0; | |
| 1403 | - var WhatsNew = function WhatsNew(props) { | |
| 1404 | - var _window$elementor; | |
| 1405 | - var _window$elementor$get; | |
| 1406 | - var isOpen = props.isOpen; | |
| 1407 | - var setIsOpen = props.setIsOpen; | |
| 1408 | - var _props$setIsRead = props.setIsRead; | |
| 1409 | - var setIsRead = _props$setIsRead === void 0 ? function() {} : _props$setIsRead; | |
| 1410 | - var _props$anchorPosition = props.anchorPosition; | |
| 1411 | - var anchorPosition = _props$anchorPosition === void 0 ? "right" : _props$anchorPosition; | |
| 1412 | - var _useState2 = _slicedToArray((0, react.useState)(function() { | |
| 1413 | - return /* @__PURE__ */ new Set(); | |
| 1414 | - }), 2); | |
| 1415 | - var seenItemIds = _useState2[0]; | |
| 1416 | - var setSeenItemIds = _useState2[1]; | |
| 1417 | - (0, react.useEffect)(function() { | |
| 1418 | - if (!isOpen) return; | |
| 1419 | - setIsRead(true); | |
| 1420 | - }, [isOpen, setIsRead]); | |
| 1421 | - var handleSeen = (0, react.useCallback)(function(itemId) { | |
| 1422 | - setSeenItemIds(function(prev) { | |
| 1423 | - if (prev.has(itemId)) return prev; | |
| 1424 | - window.dispatchEvent(new CustomEvent("e-notification-item-seen")); | |
| 1425 | - return new Set([].concat(_toConsumableArray(prev), [itemId])); | |
| 1426 | - }); | |
| 1427 | - }, []); | |
| 1428 | - return /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, /*#__PURE__*/ react.default.createElement(_elementor_query.QueryClientProvider, { client: queryClient }, /*#__PURE__*/ react.default.createElement(_elementor_ui.DirectionProvider, { rtl: elementorCommon.config.isRTL }, /*#__PURE__*/ react.default.createElement(_elementor_ui.ThemeProvider, { colorScheme: ((_window$elementor = window.elementor) === null || _window$elementor === void 0 || (_window$elementor$get = _window$elementor.getPreferences) === null || _window$elementor$get === void 0 ? void 0 : _window$elementor$get.call(_window$elementor, "ui_theme")) || "auto" }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Drawer, { | |
| 1429 | - anchor: anchorPosition, | |
| 1430 | - open: isOpen, | |
| 1431 | - onClose: function onClose() { | |
| 1432 | - return setIsOpen(false); | |
| 1433 | - }, | |
| 1434 | - BackdropProps: { invisible: true }, | |
| 1435 | - ModalProps: { style: { zIndex: 999999 } } | |
| 1436 | - }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { | |
| 1437 | - sx: { | |
| 1438 | - width: 360, | |
| 1439 | - backgroundColor: "background.default" | |
| 1440 | - }, | |
| 1441 | - role: "presentation" | |
| 1442 | - }, /*#__PURE__*/ react.default.createElement(WhatsNewTopBar, { setIsOpen }), /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { padding: "16px" } }, /*#__PURE__*/ react.default.createElement(WhatsNewDrawerContent, { | |
| 1443 | - setIsOpen, | |
| 1444 | - seenItemIds, | |
| 1445 | - onSeen: handleSeen, | |
| 1446 | - initialHasUnread | |
| 1447 | - })))))))); | |
| 1448 | - }; | |
| 1449 | - WhatsNew.propTypes = { | |
| 1450 | - isOpen: import_prop_types.default.bool.isRequired, | |
| 1451 | - setIsOpen: import_prop_types.default.func.isRequired, | |
| 1452 | - setIsRead: import_prop_types.default.func, | |
| 1453 | - anchorPosition: import_prop_types.default.oneOf([ | |
| 1454 | - "left", | |
| 1455 | - "top", | |
| 1456 | - "right", | |
| 1457 | - "bottom" | |
| 1458 | - ]) | |
| 1459 | - }; | |
| 1131 | + function createElementTypeChecker() { | |
| 1132 | + function validate(props, propName, componentName, location, propFullName) { | |
| 1133 | + var propValue = props[propName]; | |
| 1134 | + if (!isValidElement(propValue)) { | |
| 1135 | + var propType = getPropType(propValue); | |
| 1136 | + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); | |
| 1137 | + } | |
| 1138 | + return null; | |
| 1139 | + } | |
| 1140 | + return createChainableTypeChecker(validate); | |
| 1141 | + } | |
| 1460 | 1142 | |
| 1461 | -//#endregion | |
| 1462 | -//#region modules/notifications/assets/js/components/editor-drawer.js | |
| 1463 | - var EditorDrawer = function EditorDrawer(_ref) { | |
| 1464 | - var _ref$anchorPosition = _ref.anchorPosition; | |
| 1465 | - var anchorPosition = _ref$anchorPosition === void 0 ? "left" : _ref$anchorPosition; | |
| 1466 | - var _useState2 = _slicedToArray((0, react.useState)(true), 2); | |
| 1467 | - var isOpen = _useState2[0]; | |
| 1468 | - var setIsOpen = _useState2[1]; | |
| 1469 | - (0, react.useEffect)(function() { | |
| 1470 | - elementor.on("elementor/editor/panel/whats-new/clicked", function() { | |
| 1471 | - return setIsOpen(true); | |
| 1472 | - }); | |
| 1473 | - }, []); | |
| 1474 | - return /*#__PURE__*/ react.default.createElement(WhatsNew, { | |
| 1475 | - isOpen, | |
| 1476 | - setIsOpen, | |
| 1477 | - setIsRead: function setIsRead() { | |
| 1478 | - return document.body.classList.remove("e-has-notification"); | |
| 1479 | - }, | |
| 1480 | - anchorPosition | |
| 1481 | - }); | |
| 1482 | - }; | |
| 1483 | - EditorDrawer.propTypes = { anchorPosition: import_prop_types.default.oneOf([ | |
| 1484 | - "left", | |
| 1485 | - "top", | |
| 1486 | - "right", | |
| 1487 | - "bottom" | |
| 1488 | - ]) }; | |
| 1143 | + function createElementTypeTypeChecker() { | |
| 1144 | + function validate(props, propName, componentName, location, propFullName) { | |
| 1145 | + var propValue = props[propName]; | |
| 1146 | + if (!ReactIs.isValidElementType(propValue)) { | |
| 1147 | + var propType = getPropType(propValue); | |
| 1148 | + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.')); | |
| 1149 | + } | |
| 1150 | + return null; | |
| 1151 | + } | |
| 1152 | + return createChainableTypeChecker(validate); | |
| 1153 | + } | |
| 1489 | 1154 | |
| 1490 | -//#endregion | |
| 1491 | -//#region modules/notifications/assets/js/components/editor-on-button-clicked.js | |
| 1492 | - var isRendered = false; | |
| 1493 | - var editorOnButtonClicked = function editorOnButtonClicked() { | |
| 1494 | - var anchorPosition = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "left"; | |
| 1495 | - if (!isRendered) { | |
| 1496 | - isRendered = true; | |
| 1497 | - var container = document.createElement("div"); | |
| 1498 | - document.body.append(container); | |
| 1499 | - react_default.render(/*#__PURE__*/ react.default.createElement(EditorDrawer, { anchorPosition }), container); | |
| 1500 | - return; | |
| 1501 | - } | |
| 1502 | - elementor.trigger("elementor/editor/panel/whats-new/clicked"); | |
| 1503 | - }; | |
| 1155 | + function createInstanceTypeChecker(expectedClass) { | |
| 1156 | + function validate(props, propName, componentName, location, propFullName) { | |
| 1157 | + if (!(props[propName] instanceof expectedClass)) { | |
| 1158 | + var expectedClassName = expectedClass.name || ANONYMOUS; | |
| 1159 | + var actualClassName = getClassName(props[propName]); | |
| 1160 | + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); | |
| 1161 | + } | |
| 1162 | + return null; | |
| 1163 | + } | |
| 1164 | + return createChainableTypeChecker(validate); | |
| 1165 | + } | |
| 1504 | 1166 | |
| 1505 | -//#endregion | |
| 1506 | -//#region modules/notifications/assets/js/components/editor-v1.js | |
| 1507 | - var editorV1 = function editorV1() { | |
| 1508 | - elementor.on("panel:init", function() { | |
| 1509 | - if (elementorNotifications.is_unread) document.body.classList.add("e-has-notification"); | |
| 1510 | - elementor.getPanelView().getPages("menu").view.addItem({ | |
| 1511 | - name: "notification-center", | |
| 1512 | - icon: "eicon-speakerphone", | |
| 1513 | - title: (0, _wordpress_i18n.__)("What's New", "elementor"), | |
| 1514 | - callback: editorOnButtonClicked | |
| 1515 | - }, "navigate_from_page", "view-page"); | |
| 1516 | - }); | |
| 1517 | - }; | |
| 1167 | + function createEnumTypeChecker(expectedValues) { | |
| 1168 | + if (!Array.isArray(expectedValues)) { | |
| 1169 | + if (true) { | |
| 1170 | + if (arguments.length > 1) { | |
| 1171 | + printWarning( | |
| 1172 | + 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + | |
| 1173 | + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).' | |
| 1174 | + ); | |
| 1175 | + } else { | |
| 1176 | + printWarning('Invalid argument supplied to oneOf, expected an array.'); | |
| 1177 | + } | |
| 1178 | + } | |
| 1179 | + return emptyFunctionThatReturnsNull; | |
| 1180 | + } | |
| 1518 | 1181 | |
| 1519 | -//#endregion | |
| 1520 | -//#region modules/notifications/assets/js/components/editor-app-bar-link.js | |
| 1521 | - var IconWithBadge = function IconWithBadge(_ref) { | |
| 1522 | - var count = _ref.count; | |
| 1523 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Badge, { | |
| 1524 | - color: "primary", | |
| 1525 | - badgeContent: count, | |
| 1526 | - invisible: 0 === count | |
| 1527 | - }, /*#__PURE__*/ react.default.createElement(_elementor_icons_SpeakerphoneIcon.default, null)); | |
| 1528 | - }; | |
| 1529 | - IconWithBadge.propTypes = { count: import_prop_types.default.number }; | |
| 1530 | - var useWhatsNewLinkProps = function useWhatsNewLinkProps() { | |
| 1531 | - var _window$elementorNoti; | |
| 1532 | - var _useState2 = _slicedToArray((0, react.useState)(parseInt((_window$elementorNoti = window.elementorNotifications) === null || _window$elementorNoti === void 0 ? void 0 : _window$elementorNoti.unread_count, 10) || 0), 2); | |
| 1533 | - var unreadCount = _useState2[0]; | |
| 1534 | - var setUnreadCount = _useState2[1]; | |
| 1535 | - (0, react.useEffect)(function() { | |
| 1536 | - var handler = function handler() { | |
| 1537 | - return setUnreadCount(function(prev) { | |
| 1538 | - return Math.max(0, prev - 1); | |
| 1539 | - }); | |
| 1540 | - }; | |
| 1541 | - window.addEventListener("e-notification-item-seen", handler); | |
| 1542 | - return function() { | |
| 1543 | - return window.removeEventListener("e-notification-item-seen", handler); | |
| 1544 | - }; | |
| 1545 | - }, []); | |
| 1546 | - return { | |
| 1547 | - title: (0, _wordpress_i18n.__)("What's New", "elementor"), | |
| 1548 | - icon: function icon() { | |
| 1549 | - return /*#__PURE__*/ react.default.createElement(IconWithBadge, { count: unreadCount }); | |
| 1550 | - }, | |
| 1551 | - onClick: function onClick() { | |
| 1552 | - editorOnButtonClicked("right"); | |
| 1553 | - elementorCommon.eventsManager.dispatchEvent(elementorCommon.eventsManager.config.names.topBar.whatsNew, { | |
| 1554 | - location: elementorCommon.eventsManager.config.locations.topBar, | |
| 1555 | - secondaryLocation: elementorCommon.eventsManager.config.secondaryLocations["whats-new"], | |
| 1556 | - trigger: elementorCommon.eventsManager.config.triggers.click, | |
| 1557 | - element: elementorCommon.eventsManager.config.elements.buttonIcon | |
| 1558 | - }); | |
| 1559 | - } | |
| 1560 | - }; | |
| 1561 | - }; | |
| 1562 | - var editorAppBarLink = function editorAppBarLink() { | |
| 1563 | - _elementor_editor_app_bar.utilitiesMenu.registerLink({ | |
| 1564 | - id: "app-bar-menu-item-whats-new", | |
| 1565 | - priority: 10, | |
| 1566 | - useProps: useWhatsNewLinkProps | |
| 1567 | - }); | |
| 1568 | - }; | |
| 1182 | + function validate(props, propName, componentName, location, propFullName) { | |
| 1183 | + var propValue = props[propName]; | |
| 1184 | + for (var i = 0; i < expectedValues.length; i++) { | |
| 1185 | + if (is(propValue, expectedValues[i])) { | |
| 1186 | + return null; | |
| 1187 | + } | |
| 1188 | + } | |
| 1569 | 1189 | |
| 1570 | -//#endregion | |
| 1571 | -//#region modules/notifications/assets/js/editor.js | |
| 1572 | - var _window; | |
| 1573 | - if ((_window = window) !== null && _window !== void 0 && (_window = _window.elementorV2) !== null && _window !== void 0 && _window.editorAppBar) editorAppBarLink(); | |
| 1574 | - else editorV1(); | |
| 1190 | + var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { | |
| 1191 | + var type = getPreciseType(value); | |
| 1192 | + if (type === 'symbol') { | |
| 1193 | + return String(value); | |
| 1194 | + } | |
| 1195 | + return value; | |
| 1196 | + }); | |
| 1197 | + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); | |
| 1198 | + } | |
| 1199 | + return createChainableTypeChecker(validate); | |
| 1200 | + } | |
| 1575 | 1201 | |
| 1576 | -//#endregion | |
| 1577 | -})(wp.i18n, React, ReactDOM, elementorV2.ui, elementorV2.query, elementorV2.icons, elementorV2.editorAppBar, elementorV2.icons['SpeakerphoneIcon']); | |
| 1202 | + function createObjectOfTypeChecker(typeChecker) { | |
| 1203 | + function validate(props, propName, componentName, location, propFullName) { | |
| 1204 | + if (typeof typeChecker !== 'function') { | |
| 1205 | + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); | |
| 1206 | + } | |
| 1207 | + var propValue = props[propName]; | |
| 1208 | + var propType = getPropType(propValue); | |
| 1209 | + if (propType !== 'object') { | |
| 1210 | + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); | |
| 1211 | + } | |
| 1212 | + for (var key in propValue) { | |
| 1213 | + if (has(propValue, key)) { | |
| 1214 | + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); | |
| 1215 | + if (error instanceof Error) { | |
| 1216 | + return error; | |
| 1217 | + } | |
| 1218 | + } | |
| 1219 | + } | |
| 1220 | + return null; | |
| 1221 | + } | |
| 1222 | + return createChainableTypeChecker(validate); | |
| 1223 | + } | |
| 1224 | + | |
| 1225 | + function createUnionTypeChecker(arrayOfTypeCheckers) { | |
| 1226 | + if (!Array.isArray(arrayOfTypeCheckers)) { | |
| 1227 | + true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : 0; | |
| 1228 | + return emptyFunctionThatReturnsNull; | |
| 1229 | + } | |
| 1230 | + | |
| 1231 | + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { | |
| 1232 | + var checker = arrayOfTypeCheckers[i]; | |
| 1233 | + if (typeof checker !== 'function') { | |
| 1234 | + printWarning( | |
| 1235 | + 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + | |
| 1236 | + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.' | |
| 1237 | + ); | |
| 1238 | + return emptyFunctionThatReturnsNull; | |
| 1239 | + } | |
| 1240 | + } | |
| 1241 | + | |
| 1242 | + function validate(props, propName, componentName, location, propFullName) { | |
| 1243 | + var expectedTypes = []; | |
| 1244 | + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { | |
| 1245 | + var checker = arrayOfTypeCheckers[i]; | |
| 1246 | + var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret); | |
| 1247 | + if (checkerResult == null) { | |
| 1248 | + return null; | |
| 1249 | + } | |
| 1250 | + if (checkerResult.data && has(checkerResult.data, 'expectedType')) { | |
| 1251 | + expectedTypes.push(checkerResult.data.expectedType); | |
| 1252 | + } | |
| 1253 | + } | |
| 1254 | + var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': ''; | |
| 1255 | + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.')); | |
| 1256 | + } | |
| 1257 | + return createChainableTypeChecker(validate); | |
| 1258 | + } | |
| 1259 | + | |
| 1260 | + function createNodeChecker() { | |
| 1261 | + function validate(props, propName, componentName, location, propFullName) { | |
| 1262 | + if (!isNode(props[propName])) { | |
| 1263 | + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); | |
| 1264 | + } | |
| 1265 | + return null; | |
| 1266 | + } | |
| 1267 | + return createChainableTypeChecker(validate); | |
| 1268 | + } | |
| 1269 | + | |
| 1270 | + function invalidValidatorError(componentName, location, propFullName, key, type) { | |
| 1271 | + return new PropTypeError( | |
| 1272 | + (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + | |
| 1273 | + 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.' | |
| 1274 | + ); | |
| 1275 | + } | |
| 1276 | + | |
| 1277 | + function createShapeTypeChecker(shapeTypes) { | |
| 1278 | + function validate(props, propName, componentName, location, propFullName) { | |
| 1279 | + var propValue = props[propName]; | |
| 1280 | + var propType = getPropType(propValue); | |
| 1281 | + if (propType !== 'object') { | |
| 1282 | + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); | |
| 1283 | + } | |
| 1284 | + for (var key in shapeTypes) { | |
| 1285 | + var checker = shapeTypes[key]; | |
| 1286 | + if (typeof checker !== 'function') { | |
| 1287 | + return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); | |
| 1288 | + } | |
| 1289 | + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); | |
| 1290 | + if (error) { | |
| 1291 | + return error; | |
| 1292 | + } | |
| 1293 | + } | |
| 1294 | + return null; | |
| 1295 | + } | |
| 1296 | + return createChainableTypeChecker(validate); | |
| 1297 | + } | |
| 1298 | + | |
| 1299 | + function createStrictShapeTypeChecker(shapeTypes) { | |
| 1300 | + function validate(props, propName, componentName, location, propFullName) { | |
| 1301 | + var propValue = props[propName]; | |
| 1302 | + var propType = getPropType(propValue); | |
| 1303 | + if (propType !== 'object') { | |
| 1304 | + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); | |
| 1305 | + } | |
| 1306 | + // We need to check all keys in case some are required but missing from props. | |
| 1307 | + var allKeys = assign({}, props[propName], shapeTypes); | |
| 1308 | + for (var key in allKeys) { | |
| 1309 | + var checker = shapeTypes[key]; | |
| 1310 | + if (has(shapeTypes, key) && typeof checker !== 'function') { | |
| 1311 | + return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); | |
| 1312 | + } | |
| 1313 | + if (!checker) { | |
| 1314 | + return new PropTypeError( | |
| 1315 | + 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + | |
| 1316 | + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + | |
| 1317 | + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') | |
| 1318 | + ); | |
| 1319 | + } | |
| 1320 | + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); | |
| 1321 | + if (error) { | |
| 1322 | + return error; | |
| 1323 | + } | |
| 1324 | + } | |
| 1325 | + return null; | |
| 1326 | + } | |
| 1327 | + | |
| 1328 | + return createChainableTypeChecker(validate); | |
| 1329 | + } | |
| 1330 | + | |
| 1331 | + function isNode(propValue) { | |
| 1332 | + switch (typeof propValue) { | |
| 1333 | + case 'number': | |
| 1334 | + case 'string': | |
| 1335 | + case 'undefined': | |
| 1336 | + return true; | |
| 1337 | + case 'boolean': | |
| 1338 | + return !propValue; | |
| 1339 | + case 'object': | |
| 1340 | + if (Array.isArray(propValue)) { | |
| 1341 | + return propValue.every(isNode); | |
| 1342 | + } | |
| 1343 | + if (propValue === null || isValidElement(propValue)) { | |
| 1344 | + return true; | |
| 1345 | + } | |
| 1346 | + | |
| 1347 | + var iteratorFn = getIteratorFn(propValue); | |
| 1348 | + if (iteratorFn) { | |
| 1349 | + var iterator = iteratorFn.call(propValue); | |
| 1350 | + var step; | |
| 1351 | + if (iteratorFn !== propValue.entries) { | |
| 1352 | + while (!(step = iterator.next()).done) { | |
| 1353 | + if (!isNode(step.value)) { | |
| 1354 | + return false; | |
| 1355 | + } | |
| 1356 | + } | |
| 1357 | + } else { | |
| 1358 | + // Iterator will provide entry [k,v] tuples rather than values. | |
| 1359 | + while (!(step = iterator.next()).done) { | |
| 1360 | + var entry = step.value; | |
| 1361 | + if (entry) { | |
| 1362 | + if (!isNode(entry[1])) { | |
| 1363 | + return false; | |
| 1364 | + } | |
| 1365 | + } | |
| 1366 | + } | |
| 1367 | + } | |
| 1368 | + } else { | |
| 1369 | + return false; | |
| 1370 | + } | |
| 1371 | + | |
| 1372 | + return true; | |
| 1373 | + default: | |
| 1374 | + return false; | |
| 1375 | + } | |
| 1376 | + } | |
| 1377 | + | |
| 1378 | + function isSymbol(propType, propValue) { | |
| 1379 | + // Native Symbol. | |
| 1380 | + if (propType === 'symbol') { | |
| 1381 | + return true; | |
| 1382 | + } | |
| 1383 | + | |
| 1384 | + // falsy value can't be a Symbol | |
| 1385 | + if (!propValue) { | |
| 1386 | + return false; | |
| 1387 | + } | |
| 1388 | + | |
| 1389 | + // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' | |
| 1390 | + if (propValue['@@toStringTag'] === 'Symbol') { | |
| 1391 | + return true; | |
| 1392 | + } | |
| 1393 | + | |
| 1394 | + // Fallback for non-spec compliant Symbols which are polyfilled. | |
| 1395 | + if (typeof Symbol === 'function' && propValue instanceof Symbol) { | |
| 1396 | + return true; | |
| 1397 | + } | |
| 1398 | + | |
| 1399 | + return false; | |
| 1400 | + } | |
| 1401 | + | |
| 1402 | + // Equivalent of `typeof` but with special handling for array and regexp. | |
| 1403 | + function getPropType(propValue) { | |
| 1404 | + var propType = typeof propValue; | |
| 1405 | + if (Array.isArray(propValue)) { | |
| 1406 | + return 'array'; | |
| 1407 | + } | |
| 1408 | + if (propValue instanceof RegExp) { | |
| 1409 | + // Old webkits (at least until Android 4.0) return 'function' rather than | |
| 1410 | + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ | |
| 1411 | + // passes PropTypes.object. | |
| 1412 | + return 'object'; | |
| 1413 | + } | |
| 1414 | + if (isSymbol(propType, propValue)) { | |
| 1415 | + return 'symbol'; | |
| 1416 | + } | |
| 1417 | + return propType; | |
| 1418 | + } | |
| 1419 | + | |
| 1420 | + // This handles more types than `getPropType`. Only used for error messages. | |
| 1421 | + // See `createPrimitiveTypeChecker`. | |
| 1422 | + function getPreciseType(propValue) { | |
| 1423 | + if (typeof propValue === 'undefined' || propValue === null) { | |
| 1424 | + return '' + propValue; | |
| 1425 | + } | |
| 1426 | + var propType = getPropType(propValue); | |
| 1427 | + if (propType === 'object') { | |
| 1428 | + if (propValue instanceof Date) { | |
| 1429 | + return 'date'; | |
| 1430 | + } else if (propValue instanceof RegExp) { | |
| 1431 | + return 'regexp'; | |
| 1432 | + } | |
| 1433 | + } | |
| 1434 | + return propType; | |
| 1435 | + } | |
| 1436 | + | |
| 1437 | + // Returns a string that is postfixed to a warning about an invalid type. | |
| 1438 | + // For example, "undefined" or "of type array" | |
| 1439 | + function getPostfixForTypeWarning(value) { | |
| 1440 | + var type = getPreciseType(value); | |
| 1441 | + switch (type) { | |
| 1442 | + case 'array': | |
| 1443 | + case 'object': | |
| 1444 | + return 'an ' + type; | |
| 1445 | + case 'boolean': | |
| 1446 | + case 'date': | |
| 1447 | + case 'regexp': | |
| 1448 | + return 'a ' + type; | |
| 1449 | + default: | |
| 1450 | + return type; | |
| 1451 | + } | |
| 1452 | + } | |
| 1453 | + | |
| 1454 | + // Returns class name of the object, if any. | |
| 1455 | + function getClassName(propValue) { | |
| 1456 | + if (!propValue.constructor || !propValue.constructor.name) { | |
| 1457 | + return ANONYMOUS; | |
| 1458 | + } | |
| 1459 | + return propValue.constructor.name; | |
| 1460 | + } | |
| 1461 | + | |
| 1462 | + ReactPropTypes.checkPropTypes = checkPropTypes; | |
| 1463 | + ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; | |
| 1464 | + ReactPropTypes.PropTypes = ReactPropTypes; | |
| 1465 | + | |
| 1466 | + return ReactPropTypes; | |
| 1467 | +}; | |
| 1468 | + | |
| 1469 | + | |
| 1470 | +/***/ }), | |
| 1471 | + | |
| 1472 | +/***/ "../node_modules/prop-types/index.js": | |
| 1473 | +/*!*******************************************!*\ | |
| 1474 | + !*** ../node_modules/prop-types/index.js ***! | |
| 1475 | + \*******************************************/ | |
| 1476 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1477 | + | |
| 1478 | +/** | |
| 1479 | + * Copyright (c) 2013-present, Facebook, Inc. | |
| 1480 | + * | |
| 1481 | + * This source code is licensed under the MIT license found in the | |
| 1482 | + * LICENSE file in the root directory of this source tree. | |
| 1483 | + */ | |
| 1484 | + | |
| 1485 | +if (true) { | |
| 1486 | + var ReactIs = __webpack_require__(/*! react-is */ "../node_modules/prop-types/node_modules/react-is/index.js"); | |
| 1487 | + | |
| 1488 | + // By explicitly using `prop-types` you are opting into new development behavior. | |
| 1489 | + // http://fb.me/prop-types-in-prod | |
| 1490 | + var throwOnDirectAccess = true; | |
| 1491 | + module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ "../node_modules/prop-types/factoryWithTypeCheckers.js")(ReactIs.isElement, throwOnDirectAccess); | |
| 1492 | +} else {} | |
| 1493 | + | |
| 1494 | + | |
| 1495 | +/***/ }), | |
| 1496 | + | |
| 1497 | +/***/ "../node_modules/prop-types/lib/ReactPropTypesSecret.js": | |
| 1498 | +/*!**************************************************************!*\ | |
| 1499 | + !*** ../node_modules/prop-types/lib/ReactPropTypesSecret.js ***! | |
| 1500 | + \**************************************************************/ | |
| 1501 | +/***/ ((module) => { | |
| 1502 | + | |
| 1503 | +"use strict"; | |
| 1504 | +/** | |
| 1505 | + * Copyright (c) 2013-present, Facebook, Inc. | |
| 1506 | + * | |
| 1507 | + * This source code is licensed under the MIT license found in the | |
| 1508 | + * LICENSE file in the root directory of this source tree. | |
| 1509 | + */ | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | +var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; | |
| 1514 | + | |
| 1515 | +module.exports = ReactPropTypesSecret; | |
| 1516 | + | |
| 1517 | + | |
| 1518 | +/***/ }), | |
| 1519 | + | |
| 1520 | +/***/ "../node_modules/prop-types/lib/has.js": | |
| 1521 | +/*!*********************************************!*\ | |
| 1522 | + !*** ../node_modules/prop-types/lib/has.js ***! | |
| 1523 | + \*********************************************/ | |
| 1524 | +/***/ ((module) => { | |
| 1525 | + | |
| 1526 | +module.exports = Function.call.bind(Object.prototype.hasOwnProperty); | |
| 1527 | + | |
| 1528 | + | |
| 1529 | +/***/ }), | |
| 1530 | + | |
| 1531 | +/***/ "../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js": | |
| 1532 | +/*!************************************************************************************!*\ | |
| 1533 | + !*** ../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js ***! | |
| 1534 | + \************************************************************************************/ | |
| 1535 | +/***/ ((__unused_webpack_module, exports) => { | |
| 1536 | + | |
| 1537 | +"use strict"; | |
| 1538 | +/** @license React v16.13.1 | |
| 1539 | + * react-is.development.js | |
| 1540 | + * | |
| 1541 | + * Copyright (c) Facebook, Inc. and its affiliates. | |
| 1542 | + * | |
| 1543 | + * This source code is licensed under the MIT license found in the | |
| 1544 | + * LICENSE file in the root directory of this source tree. | |
| 1545 | + */ | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | +if (true) { | |
| 1552 | + (function() { | |
| 1553 | +'use strict'; | |
| 1554 | + | |
| 1555 | +// The Symbol used to tag the ReactElement-like types. If there is no native Symbol | |
| 1556 | +// nor polyfill, then a plain number is used for performance. | |
| 1557 | +var hasSymbol = typeof Symbol === 'function' && Symbol.for; | |
| 1558 | +var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; | |
| 1559 | +var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; | |
| 1560 | +var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; | |
| 1561 | +var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; | |
| 1562 | +var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; | |
| 1563 | +var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; | |
| 1564 | +var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary | |
| 1565 | +// (unstable) APIs that have been removed. Can we remove the symbols? | |
| 1566 | + | |
| 1567 | +var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf; | |
| 1568 | +var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; | |
| 1569 | +var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; | |
| 1570 | +var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; | |
| 1571 | +var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8; | |
| 1572 | +var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; | |
| 1573 | +var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; | |
| 1574 | +var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9; | |
| 1575 | +var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5; | |
| 1576 | +var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6; | |
| 1577 | +var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7; | |
| 1578 | + | |
| 1579 | +function isValidElementType(type) { | |
| 1580 | + return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. | |
| 1581 | + type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); | |
| 1582 | +} | |
| 1583 | + | |
| 1584 | +function typeOf(object) { | |
| 1585 | + if (typeof object === 'object' && object !== null) { | |
| 1586 | + var $$typeof = object.$$typeof; | |
| 1587 | + | |
| 1588 | + switch ($$typeof) { | |
| 1589 | + case REACT_ELEMENT_TYPE: | |
| 1590 | + var type = object.type; | |
| 1591 | + | |
| 1592 | + switch (type) { | |
| 1593 | + case REACT_ASYNC_MODE_TYPE: | |
| 1594 | + case REACT_CONCURRENT_MODE_TYPE: | |
| 1595 | + case REACT_FRAGMENT_TYPE: | |
| 1596 | + case REACT_PROFILER_TYPE: | |
| 1597 | + case REACT_STRICT_MODE_TYPE: | |
| 1598 | + case REACT_SUSPENSE_TYPE: | |
| 1599 | + return type; | |
| 1600 | + | |
| 1601 | + default: | |
| 1602 | + var $$typeofType = type && type.$$typeof; | |
| 1603 | + | |
| 1604 | + switch ($$typeofType) { | |
| 1605 | + case REACT_CONTEXT_TYPE: | |
| 1606 | + case REACT_FORWARD_REF_TYPE: | |
| 1607 | + case REACT_LAZY_TYPE: | |
| 1608 | + case REACT_MEMO_TYPE: | |
| 1609 | + case REACT_PROVIDER_TYPE: | |
| 1610 | + return $$typeofType; | |
| 1611 | + | |
| 1612 | + default: | |
| 1613 | + return $$typeof; | |
| 1614 | + } | |
| 1615 | + | |
| 1616 | + } | |
| 1617 | + | |
| 1618 | + case REACT_PORTAL_TYPE: | |
| 1619 | + return $$typeof; | |
| 1620 | + } | |
| 1621 | + } | |
| 1622 | + | |
| 1623 | + return undefined; | |
| 1624 | +} // AsyncMode is deprecated along with isAsyncMode | |
| 1625 | + | |
| 1626 | +var AsyncMode = REACT_ASYNC_MODE_TYPE; | |
| 1627 | +var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; | |
| 1628 | +var ContextConsumer = REACT_CONTEXT_TYPE; | |
| 1629 | +var ContextProvider = REACT_PROVIDER_TYPE; | |
| 1630 | +var Element = REACT_ELEMENT_TYPE; | |
| 1631 | +var ForwardRef = REACT_FORWARD_REF_TYPE; | |
| 1632 | +var Fragment = REACT_FRAGMENT_TYPE; | |
| 1633 | +var Lazy = REACT_LAZY_TYPE; | |
| 1634 | +var Memo = REACT_MEMO_TYPE; | |
| 1635 | +var Portal = REACT_PORTAL_TYPE; | |
| 1636 | +var Profiler = REACT_PROFILER_TYPE; | |
| 1637 | +var StrictMode = REACT_STRICT_MODE_TYPE; | |
| 1638 | +var Suspense = REACT_SUSPENSE_TYPE; | |
| 1639 | +var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated | |
| 1640 | + | |
| 1641 | +function isAsyncMode(object) { | |
| 1642 | + { | |
| 1643 | + if (!hasWarnedAboutDeprecatedIsAsyncMode) { | |
| 1644 | + hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint | |
| 1645 | + | |
| 1646 | + console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.'); | |
| 1647 | + } | |
| 1648 | + } | |
| 1649 | + | |
| 1650 | + return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; | |
| 1651 | +} | |
| 1652 | +function isConcurrentMode(object) { | |
| 1653 | + return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; | |
| 1654 | +} | |
| 1655 | +function isContextConsumer(object) { | |
| 1656 | + return typeOf(object) === REACT_CONTEXT_TYPE; | |
| 1657 | +} | |
| 1658 | +function isContextProvider(object) { | |
| 1659 | + return typeOf(object) === REACT_PROVIDER_TYPE; | |
| 1660 | +} | |
| 1661 | +function isElement(object) { | |
| 1662 | + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; | |
| 1663 | +} | |
| 1664 | +function isForwardRef(object) { | |
| 1665 | + return typeOf(object) === REACT_FORWARD_REF_TYPE; | |
| 1666 | +} | |
| 1667 | +function isFragment(object) { | |
| 1668 | + return typeOf(object) === REACT_FRAGMENT_TYPE; | |
| 1669 | +} | |
| 1670 | +function isLazy(object) { | |
| 1671 | + return typeOf(object) === REACT_LAZY_TYPE; | |
| 1672 | +} | |
| 1673 | +function isMemo(object) { | |
| 1674 | + return typeOf(object) === REACT_MEMO_TYPE; | |
| 1675 | +} | |
| 1676 | +function isPortal(object) { | |
| 1677 | + return typeOf(object) === REACT_PORTAL_TYPE; | |
| 1678 | +} | |
| 1679 | +function isProfiler(object) { | |
| 1680 | + return typeOf(object) === REACT_PROFILER_TYPE; | |
| 1681 | +} | |
| 1682 | +function isStrictMode(object) { | |
| 1683 | + return typeOf(object) === REACT_STRICT_MODE_TYPE; | |
| 1684 | +} | |
| 1685 | +function isSuspense(object) { | |
| 1686 | + return typeOf(object) === REACT_SUSPENSE_TYPE; | |
| 1687 | +} | |
| 1688 | + | |
| 1689 | +exports.AsyncMode = AsyncMode; | |
| 1690 | +exports.ConcurrentMode = ConcurrentMode; | |
| 1691 | +exports.ContextConsumer = ContextConsumer; | |
| 1692 | +exports.ContextProvider = ContextProvider; | |
| 1693 | +exports.Element = Element; | |
| 1694 | +exports.ForwardRef = ForwardRef; | |
| 1695 | +exports.Fragment = Fragment; | |
| 1696 | +exports.Lazy = Lazy; | |
| 1697 | +exports.Memo = Memo; | |
| 1698 | +exports.Portal = Portal; | |
| 1699 | +exports.Profiler = Profiler; | |
| 1700 | +exports.StrictMode = StrictMode; | |
| 1701 | +exports.Suspense = Suspense; | |
| 1702 | +exports.isAsyncMode = isAsyncMode; | |
| 1703 | +exports.isConcurrentMode = isConcurrentMode; | |
| 1704 | +exports.isContextConsumer = isContextConsumer; | |
| 1705 | +exports.isContextProvider = isContextProvider; | |
| 1706 | +exports.isElement = isElement; | |
| 1707 | +exports.isForwardRef = isForwardRef; | |
| 1708 | +exports.isFragment = isFragment; | |
| 1709 | +exports.isLazy = isLazy; | |
| 1710 | +exports.isMemo = isMemo; | |
| 1711 | +exports.isPortal = isPortal; | |
| 1712 | +exports.isProfiler = isProfiler; | |
| 1713 | +exports.isStrictMode = isStrictMode; | |
| 1714 | +exports.isSuspense = isSuspense; | |
| 1715 | +exports.isValidElementType = isValidElementType; | |
| 1716 | +exports.typeOf = typeOf; | |
| 1717 | + })(); | |
| 1718 | +} | |
| 1719 | + | |
| 1720 | + | |
| 1721 | +/***/ }), | |
| 1722 | + | |
| 1723 | +/***/ "../node_modules/prop-types/node_modules/react-is/index.js": | |
| 1724 | +/*!*****************************************************************!*\ | |
| 1725 | + !*** ../node_modules/prop-types/node_modules/react-is/index.js ***! | |
| 1726 | + \*****************************************************************/ | |
| 1727 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1728 | + | |
| 1729 | +"use strict"; | |
| 1730 | + | |
| 1731 | + | |
| 1732 | +if (false) {} else { | |
| 1733 | + module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js"); | |
| 1734 | +} | |
| 1735 | + | |
| 1736 | + | |
| 1737 | +/***/ }), | |
| 1738 | + | |
| 1739 | +/***/ "react": | |
| 1740 | +/*!************************!*\ | |
| 1741 | + !*** external "React" ***! | |
| 1742 | + \************************/ | |
| 1743 | +/***/ ((module) => { | |
| 1744 | + | |
| 1745 | +"use strict"; | |
| 1746 | +module.exports = React; | |
| 1747 | + | |
| 1748 | +/***/ }), | |
| 1749 | + | |
| 1750 | +/***/ "react-dom": | |
| 1751 | +/*!***************************!*\ | |
| 1752 | + !*** external "ReactDOM" ***! | |
| 1753 | + \***************************/ | |
| 1754 | +/***/ ((module) => { | |
| 1755 | + | |
| 1756 | +"use strict"; | |
| 1757 | +module.exports = ReactDOM; | |
| 1758 | + | |
| 1759 | +/***/ }), | |
| 1760 | + | |
| 1761 | +/***/ "@elementor/ui": | |
| 1762 | +/*!*********************************!*\ | |
| 1763 | + !*** external "elementorV2.ui" ***! | |
| 1764 | + \*********************************/ | |
| 1765 | +/***/ ((module) => { | |
| 1766 | + | |
| 1767 | +"use strict"; | |
| 1768 | +module.exports = elementorV2.ui; | |
| 1769 | + | |
| 1770 | +/***/ }), | |
| 1771 | + | |
| 1772 | +/***/ "@wordpress/i18n": | |
| 1773 | +/*!**************************!*\ | |
| 1774 | + !*** external "wp.i18n" ***! | |
| 1775 | + \**************************/ | |
| 1776 | +/***/ ((module) => { | |
| 1777 | + | |
| 1778 | +"use strict"; | |
| 1779 | +module.exports = wp.i18n; | |
| 1780 | + | |
| 1781 | +/***/ }), | |
| 1782 | + | |
| 1783 | +/***/ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js": | |
| 1784 | +/*!******************************************************************!*\ | |
| 1785 | + !*** ../node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***! | |
| 1786 | + \******************************************************************/ | |
| 1787 | +/***/ ((module) => { | |
| 1788 | + | |
| 1789 | +function _arrayLikeToArray(arr, len) { | |
| 1790 | + if (len == null || len > arr.length) len = arr.length; | |
| 1791 | + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | |
| 1792 | + return arr2; | |
| 1793 | +} | |
| 1794 | +module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1795 | + | |
| 1796 | +/***/ }), | |
| 1797 | + | |
| 1798 | +/***/ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js": | |
| 1799 | +/*!****************************************************************!*\ | |
| 1800 | + !*** ../node_modules/@babel/runtime/helpers/arrayWithHoles.js ***! | |
| 1801 | + \****************************************************************/ | |
| 1802 | +/***/ ((module) => { | |
| 1803 | + | |
| 1804 | +function _arrayWithHoles(arr) { | |
| 1805 | + if (Array.isArray(arr)) return arr; | |
| 1806 | +} | |
| 1807 | +module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1808 | + | |
| 1809 | +/***/ }), | |
| 1810 | + | |
| 1811 | +/***/ "../node_modules/@babel/runtime/helpers/extends.js": | |
| 1812 | +/*!*********************************************************!*\ | |
| 1813 | + !*** ../node_modules/@babel/runtime/helpers/extends.js ***! | |
| 1814 | + \*********************************************************/ | |
| 1815 | +/***/ ((module) => { | |
| 1816 | + | |
| 1817 | +function _extends() { | |
| 1818 | + module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) { | |
| 1819 | + for (var i = 1; i < arguments.length; i++) { | |
| 1820 | + var source = arguments[i]; | |
| 1821 | + for (var key in source) { | |
| 1822 | + if (Object.prototype.hasOwnProperty.call(source, key)) { | |
| 1823 | + target[key] = source[key]; | |
| 1824 | + } | |
| 1825 | + } | |
| 1826 | + } | |
| 1827 | + return target; | |
| 1828 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1829 | + return _extends.apply(this, arguments); | |
| 1830 | +} | |
| 1831 | +module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1832 | + | |
| 1833 | +/***/ }), | |
| 1834 | + | |
| 1835 | +/***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js": | |
| 1836 | +/*!***********************************************************************!*\ | |
| 1837 | + !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***! | |
| 1838 | + \***********************************************************************/ | |
| 1839 | +/***/ ((module) => { | |
| 1840 | + | |
| 1841 | +function _interopRequireDefault(obj) { | |
| 1842 | + return obj && obj.__esModule ? obj : { | |
| 1843 | + "default": obj | |
| 1844 | + }; | |
| 1845 | +} | |
| 1846 | +module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1847 | + | |
| 1848 | +/***/ }), | |
| 1849 | + | |
| 1850 | +/***/ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js": | |
| 1851 | +/*!**********************************************************************!*\ | |
| 1852 | + !*** ../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***! | |
| 1853 | + \**********************************************************************/ | |
| 1854 | +/***/ ((module) => { | |
| 1855 | + | |
| 1856 | +function _iterableToArrayLimit(r, l) { | |
| 1857 | + var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; | |
| 1858 | + if (null != t) { | |
| 1859 | + var e, | |
| 1860 | + n, | |
| 1861 | + i, | |
| 1862 | + u, | |
| 1863 | + a = [], | |
| 1864 | + f = !0, | |
| 1865 | + o = !1; | |
| 1866 | + try { | |
| 1867 | + if (i = (t = t.call(r)).next, 0 === l) { | |
| 1868 | + if (Object(t) !== t) return; | |
| 1869 | + f = !1; | |
| 1870 | + } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); | |
| 1871 | + } catch (r) { | |
| 1872 | + o = !0, n = r; | |
| 1873 | + } finally { | |
| 1874 | + try { | |
| 1875 | + if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; | |
| 1876 | + } finally { | |
| 1877 | + if (o) throw n; | |
| 1878 | + } | |
| 1879 | + } | |
| 1880 | + return a; | |
| 1881 | + } | |
| 1882 | +} | |
| 1883 | +module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1884 | + | |
| 1885 | +/***/ }), | |
| 1886 | + | |
| 1887 | +/***/ "../node_modules/@babel/runtime/helpers/nonIterableRest.js": | |
| 1888 | +/*!*****************************************************************!*\ | |
| 1889 | + !*** ../node_modules/@babel/runtime/helpers/nonIterableRest.js ***! | |
| 1890 | + \*****************************************************************/ | |
| 1891 | +/***/ ((module) => { | |
| 1892 | + | |
| 1893 | +function _nonIterableRest() { | |
| 1894 | + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | |
| 1895 | +} | |
| 1896 | +module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1897 | + | |
| 1898 | +/***/ }), | |
| 1899 | + | |
| 1900 | +/***/ "../node_modules/@babel/runtime/helpers/slicedToArray.js": | |
| 1901 | +/*!***************************************************************!*\ | |
| 1902 | + !*** ../node_modules/@babel/runtime/helpers/slicedToArray.js ***! | |
| 1903 | + \***************************************************************/ | |
| 1904 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1905 | + | |
| 1906 | +var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js"); | |
| 1907 | +var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js"); | |
| 1908 | +var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js"); | |
| 1909 | +var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ "../node_modules/@babel/runtime/helpers/nonIterableRest.js"); | |
| 1910 | +function _slicedToArray(arr, i) { | |
| 1911 | + return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest(); | |
| 1912 | +} | |
| 1913 | +module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1914 | + | |
| 1915 | +/***/ }), | |
| 1916 | + | |
| 1917 | +/***/ "../node_modules/@babel/runtime/helpers/typeof.js": | |
| 1918 | +/*!********************************************************!*\ | |
| 1919 | + !*** ../node_modules/@babel/runtime/helpers/typeof.js ***! | |
| 1920 | + \********************************************************/ | |
| 1921 | +/***/ ((module) => { | |
| 1922 | + | |
| 1923 | +function _typeof(o) { | |
| 1924 | + "@babel/helpers - typeof"; | |
| 1925 | + | |
| 1926 | + return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { | |
| 1927 | + return typeof o; | |
| 1928 | + } : function (o) { | |
| 1929 | + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; | |
| 1930 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o); | |
| 1931 | +} | |
| 1932 | +module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1933 | + | |
| 1934 | +/***/ }), | |
| 1935 | + | |
| 1936 | +/***/ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js": | |
| 1937 | +/*!****************************************************************************!*\ | |
| 1938 | + !*** ../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***! | |
| 1939 | + \****************************************************************************/ | |
| 1940 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1941 | + | |
| 1942 | +var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js"); | |
| 1943 | +function _unsupportedIterableToArray(o, minLen) { | |
| 1944 | + if (!o) return; | |
| 1945 | + if (typeof o === "string") return arrayLikeToArray(o, minLen); | |
| 1946 | + var n = Object.prototype.toString.call(o).slice(8, -1); | |
| 1947 | + if (n === "Object" && o.constructor) n = o.constructor.name; | |
| 1948 | + if (n === "Map" || n === "Set") return Array.from(o); | |
| 1949 | + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen); | |
| 1950 | +} | |
| 1951 | +module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1952 | + | |
| 1953 | +/***/ }), | |
| 1954 | + | |
| 1955 | +/***/ "../node_modules/@tanstack/query-core/build/modern/focusManager.cjs": | |
| 1956 | +/*!**************************************************************************!*\ | |
| 1957 | + !*** ../node_modules/@tanstack/query-core/build/modern/focusManager.cjs ***! | |
| 1958 | + \**************************************************************************/ | |
| 1959 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1960 | + | |
| 1961 | +"use strict"; | |
| 1962 | + | |
| 1963 | +var __defProp = Object.defineProperty; | |
| 1964 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 1965 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 1966 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 1967 | +var __export = (target, all) => { | |
| 1968 | + for (var name in all) | |
| 1969 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 1970 | +}; | |
| 1971 | +var __copyProps = (to, from, except, desc) => { | |
| 1972 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 1973 | + for (let key of __getOwnPropNames(from)) | |
| 1974 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 1975 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 1976 | + } | |
| 1977 | + return to; | |
| 1978 | +}; | |
| 1979 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 1980 | + | |
| 1981 | +// src/focusManager.ts | |
| 1982 | +var focusManager_exports = {}; | |
| 1983 | +__export(focusManager_exports, { | |
| 1984 | + FocusManager: () => FocusManager, | |
| 1985 | + focusManager: () => focusManager | |
| 1986 | +}); | |
| 1987 | +module.exports = __toCommonJS(focusManager_exports); | |
| 1988 | +var import_subscribable = __webpack_require__(/*! ./subscribable.cjs */ "../node_modules/@tanstack/query-core/build/modern/subscribable.cjs"); | |
| 1989 | +var import_utils = __webpack_require__(/*! ./utils.cjs */ "../node_modules/@tanstack/query-core/build/modern/utils.cjs"); | |
| 1990 | +var FocusManager = class extends import_subscribable.Subscribable { | |
| 1991 | + #focused; | |
| 1992 | + #cleanup; | |
| 1993 | + #setup; | |
| 1994 | + constructor() { | |
| 1995 | + super(); | |
| 1996 | + this.#setup = (onFocus) => { | |
| 1997 | + if (!import_utils.isServer && window.addEventListener) { | |
| 1998 | + const listener = () => onFocus(); | |
| 1999 | + window.addEventListener("visibilitychange", listener, false); | |
| 2000 | + return () => { | |
| 2001 | + window.removeEventListener("visibilitychange", listener); | |
| 2002 | + }; | |
| 2003 | + } | |
| 2004 | + return; | |
| 2005 | + }; | |
| 2006 | + } | |
| 2007 | + onSubscribe() { | |
| 2008 | + if (!this.#cleanup) { | |
| 2009 | + this.setEventListener(this.#setup); | |
| 2010 | + } | |
| 2011 | + } | |
| 2012 | + onUnsubscribe() { | |
| 2013 | + if (!this.hasListeners()) { | |
| 2014 | + this.#cleanup?.(); | |
| 2015 | + this.#cleanup = void 0; | |
| 2016 | + } | |
| 2017 | + } | |
| 2018 | + setEventListener(setup) { | |
| 2019 | + this.#setup = setup; | |
| 2020 | + this.#cleanup?.(); | |
| 2021 | + this.#cleanup = setup((focused) => { | |
| 2022 | + if (typeof focused === "boolean") { | |
| 2023 | + this.setFocused(focused); | |
| 2024 | + } else { | |
| 2025 | + this.onFocus(); | |
| 2026 | + } | |
| 2027 | + }); | |
| 2028 | + } | |
| 2029 | + setFocused(focused) { | |
| 2030 | + const changed = this.#focused !== focused; | |
| 2031 | + if (changed) { | |
| 2032 | + this.#focused = focused; | |
| 2033 | + this.onFocus(); | |
| 2034 | + } | |
| 2035 | + } | |
| 2036 | + onFocus() { | |
| 2037 | + this.listeners.forEach((listener) => { | |
| 2038 | + listener(); | |
| 2039 | + }); | |
| 2040 | + } | |
| 2041 | + isFocused() { | |
| 2042 | + if (typeof this.#focused === "boolean") { | |
| 2043 | + return this.#focused; | |
| 2044 | + } | |
| 2045 | + return globalThis.document?.visibilityState !== "hidden"; | |
| 2046 | + } | |
| 2047 | +}; | |
| 2048 | +var focusManager = new FocusManager(); | |
| 2049 | +// Annotate the CommonJS export names for ESM import in node: | |
| 2050 | +0 && (0); | |
| 2051 | +//# sourceMappingURL=focusManager.cjs.map | |
| 2052 | + | |
| 2053 | +/***/ }), | |
| 2054 | + | |
| 2055 | +/***/ "../node_modules/@tanstack/query-core/build/modern/hydration.cjs": | |
| 2056 | +/*!***********************************************************************!*\ | |
| 2057 | + !*** ../node_modules/@tanstack/query-core/build/modern/hydration.cjs ***! | |
| 2058 | + \***********************************************************************/ | |
| 2059 | +/***/ ((module) => { | |
| 2060 | + | |
| 2061 | +"use strict"; | |
| 2062 | + | |
| 2063 | +var __defProp = Object.defineProperty; | |
| 2064 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 2065 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 2066 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 2067 | +var __export = (target, all) => { | |
| 2068 | + for (var name in all) | |
| 2069 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 2070 | +}; | |
| 2071 | +var __copyProps = (to, from, except, desc) => { | |
| 2072 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 2073 | + for (let key of __getOwnPropNames(from)) | |
| 2074 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 2075 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 2076 | + } | |
| 2077 | + return to; | |
| 2078 | +}; | |
| 2079 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 2080 | + | |
| 2081 | +// src/hydration.ts | |
| 2082 | +var hydration_exports = {}; | |
| 2083 | +__export(hydration_exports, { | |
| 2084 | + defaultShouldDehydrateMutation: () => defaultShouldDehydrateMutation, | |
| 2085 | + defaultShouldDehydrateQuery: () => defaultShouldDehydrateQuery, | |
| 2086 | + dehydrate: () => dehydrate, | |
| 2087 | + hydrate: () => hydrate | |
| 2088 | +}); | |
| 2089 | +module.exports = __toCommonJS(hydration_exports); | |
| 2090 | +function dehydrateMutation(mutation) { | |
| 2091 | + return { | |
| 2092 | + mutationKey: mutation.options.mutationKey, | |
| 2093 | + state: mutation.state, | |
| 2094 | + ...mutation.meta && { meta: mutation.meta } | |
| 2095 | + }; | |
| 2096 | +} | |
| 2097 | +function dehydrateQuery(query) { | |
| 2098 | + return { | |
| 2099 | + state: query.state, | |
| 2100 | + queryKey: query.queryKey, | |
| 2101 | + queryHash: query.queryHash, | |
| 2102 | + ...query.meta && { meta: query.meta } | |
| 2103 | + }; | |
| 2104 | +} | |
| 2105 | +function defaultShouldDehydrateMutation(mutation) { | |
| 2106 | + return mutation.state.isPaused; | |
| 2107 | +} | |
| 2108 | +function defaultShouldDehydrateQuery(query) { | |
| 2109 | + return query.state.status === "success"; | |
| 2110 | +} | |
| 2111 | +function dehydrate(client, options = {}) { | |
| 2112 | + const filterMutation = options.shouldDehydrateMutation ?? defaultShouldDehydrateMutation; | |
| 2113 | + const mutations = client.getMutationCache().getAll().flatMap( | |
| 2114 | + (mutation) => filterMutation(mutation) ? [dehydrateMutation(mutation)] : [] | |
| 2115 | + ); | |
| 2116 | + const filterQuery = options.shouldDehydrateQuery ?? defaultShouldDehydrateQuery; | |
| 2117 | + const queries = client.getQueryCache().getAll().flatMap((query) => filterQuery(query) ? [dehydrateQuery(query)] : []); | |
| 2118 | + return { mutations, queries }; | |
| 2119 | +} | |
| 2120 | +function hydrate(client, dehydratedState, options) { | |
| 2121 | + if (typeof dehydratedState !== "object" || dehydratedState === null) { | |
| 2122 | + return; | |
| 2123 | + } | |
| 2124 | + const mutationCache = client.getMutationCache(); | |
| 2125 | + const queryCache = client.getQueryCache(); | |
| 2126 | + const mutations = dehydratedState.mutations || []; | |
| 2127 | + const queries = dehydratedState.queries || []; | |
| 2128 | + mutations.forEach((dehydratedMutation) => { | |
| 2129 | + mutationCache.build( | |
| 2130 | + client, | |
| 2131 | + { | |
| 2132 | + ...options?.defaultOptions?.mutations, | |
| 2133 | + mutationKey: dehydratedMutation.mutationKey, | |
| 2134 | + meta: dehydratedMutation.meta | |
| 2135 | + }, | |
| 2136 | + dehydratedMutation.state | |
| 2137 | + ); | |
| 2138 | + }); | |
| 2139 | + queries.forEach(({ queryKey, state, queryHash, meta }) => { | |
| 2140 | + const query = queryCache.get(queryHash); | |
| 2141 | + if (query) { | |
| 2142 | + if (query.state.dataUpdatedAt < state.dataUpdatedAt) { | |
| 2143 | + const { fetchStatus: _ignored, ...dehydratedQueryState } = state; | |
| 2144 | + query.setState(dehydratedQueryState); | |
| 2145 | + } | |
| 2146 | + return; | |
| 2147 | + } | |
| 2148 | + queryCache.build( | |
| 2149 | + client, | |
| 2150 | + { | |
| 2151 | + ...options?.defaultOptions?.queries, | |
| 2152 | + queryKey, | |
| 2153 | + queryHash, | |
| 2154 | + meta | |
| 2155 | + }, | |
| 2156 | + // Reset fetch status to idle to avoid | |
| 2157 | + // query being stuck in fetching state upon hydration | |
| 2158 | + { | |
| 2159 | + ...state, | |
| 2160 | + fetchStatus: "idle" | |
| 2161 | + } | |
| 2162 | + ); | |
| 2163 | + }); | |
| 2164 | +} | |
| 2165 | +// Annotate the CommonJS export names for ESM import in node: | |
| 2166 | +0 && (0); | |
| 2167 | +//# sourceMappingURL=hydration.cjs.map | |
| 2168 | + | |
| 2169 | +/***/ }), | |
| 2170 | + | |
| 2171 | +/***/ "../node_modules/@tanstack/query-core/build/modern/index.cjs": | |
| 2172 | +/*!*******************************************************************!*\ | |
| 2173 | + !*** ../node_modules/@tanstack/query-core/build/modern/index.cjs ***! | |
| 2174 | + \*******************************************************************/ | |
| 2175 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 2176 | + | |
| 2177 | +"use strict"; | |
| 2178 | + | |
| 2179 | +var __defProp = Object.defineProperty; | |
| 2180 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 2181 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 2182 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 2183 | +var __export = (target, all) => { | |
| 2184 | + for (var name in all) | |
| 2185 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 2186 | +}; | |
| 2187 | +var __copyProps = (to, from, except, desc) => { | |
| 2188 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 2189 | + for (let key of __getOwnPropNames(from)) | |
| 2190 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 2191 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 2192 | + } | |
| 2193 | + return to; | |
| 2194 | +}; | |
| 2195 | +var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); | |
| 2196 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 2197 | + | |
| 2198 | +// src/index.ts | |
| 2199 | +var src_exports = {}; | |
| 2200 | +__export(src_exports, { | |
| 2201 | + CancelledError: () => import_retryer.CancelledError, | |
| 2202 | + InfiniteQueryObserver: () => import_infiniteQueryObserver.InfiniteQueryObserver, | |
| 2203 | + MutationCache: () => import_mutationCache.MutationCache, | |
| 2204 | + MutationObserver: () => import_mutationObserver.MutationObserver, | |
| 2205 | + QueriesObserver: () => import_queriesObserver.QueriesObserver, | |
| 2206 | + Query: () => import_query.Query, | |
| 2207 | + QueryCache: () => import_queryCache.QueryCache, | |
| 2208 | + QueryClient: () => import_queryClient.QueryClient, | |
| 2209 | + QueryObserver: () => import_queryObserver.QueryObserver, | |
| 2210 | + defaultShouldDehydrateMutation: () => import_hydration.defaultShouldDehydrateMutation, | |
| 2211 | + defaultShouldDehydrateQuery: () => import_hydration.defaultShouldDehydrateQuery, | |
| 2212 | + dehydrate: () => import_hydration.dehydrate, | |
| 2213 | + focusManager: () => import_focusManager.focusManager, | |
| 2214 | + hashKey: () => import_utils.hashKey, | |
| 2215 | + hydrate: () => import_hydration.hydrate, | |
| 2216 | + isCancelledError: () => import_retryer2.isCancelledError, | |
| 2217 | + isServer: () => import_utils.isServer, | |
| 2218 | + keepPreviousData: () => import_utils.keepPreviousData, | |
| 2219 | + matchQuery: () => import_utils.matchQuery, | |
| 2220 | + notifyManager: () => import_notifyManager.notifyManager, | |
| 2221 | + onlineManager: () => import_onlineManager.onlineManager, | |
| 2222 | + replaceEqualDeep: () => import_utils.replaceEqualDeep | |
| 2223 | +}); | |
| 2224 | +module.exports = __toCommonJS(src_exports); | |
| 2225 | +var import_retryer = __webpack_require__(/*! ./retryer.cjs */ "../node_modules/@tanstack/query-core/build/modern/retryer.cjs"); | |
| 2226 | +var import_queryCache = __webpack_require__(/*! ./queryCache.cjs */ "../node_modules/@tanstack/query-core/build/modern/queryCache.cjs"); | |
| 2227 | +var import_queryClient = __webpack_require__(/*! ./queryClient.cjs */ "../node_modules/@tanstack/query-core/build/modern/queryClient.cjs"); | |
| 2228 | +var import_queryObserver = __webpack_require__(/*! ./queryObserver.cjs */ "../node_modules/@tanstack/query-core/build/modern/queryObserver.cjs"); | |
| 2229 | +var import_queriesObserver = __webpack_require__(/*! ./queriesObserver.cjs */ "../node_modules/@tanstack/query-core/build/modern/queriesObserver.cjs"); | |
| 2230 | +var import_infiniteQueryObserver = __webpack_require__(/*! ./infiniteQueryObserver.cjs */ "../node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs"); | |
| 2231 | +var import_mutationCache = __webpack_require__(/*! ./mutationCache.cjs */ "../node_modules/@tanstack/query-core/build/modern/mutationCache.cjs"); | |
| 2232 | +var import_mutationObserver = __webpack_require__(/*! ./mutationObserver.cjs */ "../node_modules/@tanstack/query-core/build/modern/mutationObserver.cjs"); | |
| 2233 | +var import_notifyManager = __webpack_require__(/*! ./notifyManager.cjs */ "../node_modules/@tanstack/query-core/build/modern/notifyManager.cjs"); | |
| 2234 | +var import_focusManager = __webpack_require__(/*! ./focusManager.cjs */ "../node_modules/@tanstack/query-core/build/modern/focusManager.cjs"); | |
| 2235 | +var import_onlineManager = __webpack_require__(/*! ./onlineManager.cjs */ "../node_modules/@tanstack/query-core/build/modern/onlineManager.cjs"); | |
| 2236 | +var import_utils = __webpack_require__(/*! ./utils.cjs */ "../node_modules/@tanstack/query-core/build/modern/utils.cjs"); | |
| 2237 | +var import_retryer2 = __webpack_require__(/*! ./retryer.cjs */ "../node_modules/@tanstack/query-core/build/modern/retryer.cjs"); | |
| 2238 | +var import_hydration = __webpack_require__(/*! ./hydration.cjs */ "../node_modules/@tanstack/query-core/build/modern/hydration.cjs"); | |
| 2239 | +__reExport(src_exports, __webpack_require__(/*! ./types.cjs */ "../node_modules/@tanstack/query-core/build/modern/types.cjs"), module.exports); | |
| 2240 | +var import_query = __webpack_require__(/*! ./query.cjs */ "../node_modules/@tanstack/query-core/build/modern/query.cjs"); | |
| 2241 | +// Annotate the CommonJS export names for ESM import in node: | |
| 2242 | +0 && (0); | |
| 2243 | +//# sourceMappingURL=index.cjs.map | |
| 2244 | + | |
| 2245 | +/***/ }), | |
| 2246 | + | |
| 2247 | +/***/ "../node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs": | |
| 2248 | +/*!***********************************************************************************!*\ | |
| 2249 | + !*** ../node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs ***! | |
| 2250 | + \***********************************************************************************/ | |
| 2251 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 2252 | + | |
| 2253 | +"use strict"; | |
| 2254 | + | |
| 2255 | +var __defProp = Object.defineProperty; | |
| 2256 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 2257 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 2258 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 2259 | +var __export = (target, all) => { | |
| 2260 | + for (var name in all) | |
| 2261 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 2262 | +}; | |
| 2263 | +var __copyProps = (to, from, except, desc) => { | |
| 2264 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 2265 | + for (let key of __getOwnPropNames(from)) | |
| 2266 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 2267 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 2268 | + } | |
| 2269 | + return to; | |
| 2270 | +}; | |
| 2271 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 2272 | + | |
| 2273 | +// src/infiniteQueryBehavior.ts | |
| 2274 | +var infiniteQueryBehavior_exports = {}; | |
| 2275 | +__export(infiniteQueryBehavior_exports, { | |
| 2276 | + hasNextPage: () => hasNextPage, | |
| 2277 | + hasPreviousPage: () => hasPreviousPage, | |
| 2278 | + infiniteQueryBehavior: () => infiniteQueryBehavior | |
| 2279 | +}); | |
| 2280 | +module.exports = __toCommonJS(infiniteQueryBehavior_exports); | |
| 2281 | +var import_utils = __webpack_require__(/*! ./utils.cjs */ "../node_modules/@tanstack/query-core/build/modern/utils.cjs"); | |
| 2282 | +function infiniteQueryBehavior(pages) { | |
| 2283 | + return { | |
| 2284 | + onFetch: (context, query) => { | |
| 2285 | + const fetchFn = async () => { | |
| 2286 | + const options = context.options; | |
| 2287 | + const direction = context.fetchOptions?.meta?.fetchMore?.direction; | |
| 2288 | + const oldPages = context.state.data?.pages || []; | |
| 2289 | + const oldPageParams = context.state.data?.pageParams || []; | |
| 2290 | + const empty = { pages: [], pageParams: [] }; | |
| 2291 | + let cancelled = false; | |
| 2292 | + const addSignalProperty = (object) => { | |
| 2293 | + Object.defineProperty(object, "signal", { | |
| 2294 | + enumerable: true, | |
| 2295 | + get: () => { | |
| 2296 | + if (context.signal.aborted) { | |
| 2297 | + cancelled = true; | |
| 2298 | + } else { | |
| 2299 | + context.signal.addEventListener("abort", () => { | |
| 2300 | + cancelled = true; | |
| 2301 | + }); | |
| 2302 | + } | |
| 2303 | + return context.signal; | |
| 2304 | + } | |
| 2305 | + }); | |
| 2306 | + }; | |
| 2307 | + const queryFn = context.options.queryFn || (() => Promise.reject( | |
| 2308 | + new Error(`Missing queryFn: '${context.options.queryHash}'`) | |
| 2309 | + )); | |
| 2310 | + const fetchPage = async (data, param, previous) => { | |
| 2311 | + if (cancelled) { | |
| 2312 | + return Promise.reject(); | |
| 2313 | + } | |
| 2314 | + if (param == null && data.pages.length) { | |
| 2315 | + return Promise.resolve(data); | |
| 2316 | + } | |
| 2317 | + const queryFnContext = { | |
| 2318 | + queryKey: context.queryKey, | |
| 2319 | + pageParam: param, | |
| 2320 | + direction: previous ? "backward" : "forward", | |
| 2321 | + meta: context.options.meta | |
| 2322 | + }; | |
| 2323 | + addSignalProperty(queryFnContext); | |
| 2324 | + const page = await queryFn( | |
| 2325 | + queryFnContext | |
| 2326 | + ); | |
| 2327 | + const { maxPages } = context.options; | |
| 2328 | + const addTo = previous ? import_utils.addToStart : import_utils.addToEnd; | |
| 2329 | + return { | |
| 2330 | + pages: addTo(data.pages, page, maxPages), | |
| 2331 | + pageParams: addTo(data.pageParams, param, maxPages) | |
| 2332 | + }; | |
| 2333 | + }; | |
| 2334 | + let result; | |
| 2335 | + if (direction && oldPages.length) { | |
| 2336 | + const previous = direction === "backward"; | |
| 2337 | + const pageParamFn = previous ? getPreviousPageParam : getNextPageParam; | |
| 2338 | + const oldData = { | |
| 2339 | + pages: oldPages, | |
| 2340 | + pageParams: oldPageParams | |
| 2341 | + }; | |
| 2342 | + const param = pageParamFn(options, oldData); | |
| 2343 | + result = await fetchPage(oldData, param, previous); | |
| 2344 | + } else { | |
| 2345 | + result = await fetchPage( | |
| 2346 | + empty, | |
| 2347 | + oldPageParams[0] ?? options.initialPageParam | |
| 2348 | + ); | |
| 2349 | + const remainingPages = pages ?? oldPages.length; | |
| 2350 | + for (let i = 1; i < remainingPages; i++) { | |
| 2351 | + const param = getNextPageParam(options, result); | |
| 2352 | + result = await fetchPage(result, param); | |
| 2353 | + } | |
| 2354 | + } | |
| 2355 | + return result; | |
| 2356 | + }; | |
| 2357 | + if (context.options.persister) { | |
| 2358 | + context.fetchFn = () => { | |
| 2359 | + return context.options.persister?.( | |
| 2360 | + fetchFn, | |
| 2361 | + { | |
| 2362 | + queryKey: context.queryKey, | |
| 2363 | + meta: context.options.meta, | |
| 2364 | + signal: context.signal | |
| 2365 | + }, | |
| 2366 | + query | |
| 2367 | + ); | |
| 2368 | + }; | |
| 2369 | + } else { | |
| 2370 | + context.fetchFn = fetchFn; | |
| 2371 | + } | |
| 2372 | + } | |
| 2373 | + }; | |
| 2374 | +} | |
| 2375 | +function getNextPageParam(options, { pages, pageParams }) { | |
| 2376 | + const lastIndex = pages.length - 1; | |
| 2377 | + return options.getNextPageParam( | |
| 2378 | + pages[lastIndex], | |
| 2379 | + pages, | |
| 2380 | + pageParams[lastIndex], | |
| 2381 | + pageParams | |
| 2382 | + ); | |
| 2383 | +} | |
| 2384 | +function getPreviousPageParam(options, { pages, pageParams }) { | |
| 2385 | + return options.getPreviousPageParam?.( | |
| 2386 | + pages[0], | |
| 2387 | + pages, | |
| 2388 | + pageParams[0], | |
| 2389 | + pageParams | |
| 2390 | + ); | |
| 2391 | +} | |
| 2392 | +function hasNextPage(options, data) { | |
| 2393 | + if (!data) | |
| 2394 | + return false; | |
| 2395 | + return getNextPageParam(options, data) != null; | |
| 2396 | +} | |
| 2397 | +function hasPreviousPage(options, data) { | |
| 2398 | + if (!data || !options.getPreviousPageParam) | |
| 2399 | + return false; | |
| 2400 | + return getPreviousPageParam(options, data) != null; | |
| 2401 | +} | |
| 2402 | +// Annotate the CommonJS export names for ESM import in node: | |
| 2403 | +0 && (0); | |
| 2404 | +//# sourceMappingURL=infiniteQueryBehavior.cjs.map | |
| 2405 | + | |
| 2406 | +/***/ }), | |
| 2407 | + | |
| 2408 | +/***/ "../node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs": | |
| 2409 | +/*!***********************************************************************************!*\ | |
| 2410 | + !*** ../node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs ***! | |
| 2411 | + \***********************************************************************************/ | |
| 2412 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 2413 | + | |
| 2414 | +"use strict"; | |
| 2415 | + | |
| 2416 | +var __defProp = Object.defineProperty; | |
| 2417 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 2418 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 2419 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 2420 | +var __export = (target, all) => { | |
| 2421 | + for (var name in all) | |
| 2422 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 2423 | +}; | |
| 2424 | +var __copyProps = (to, from, except, desc) => { | |
| 2425 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 2426 | + for (let key of __getOwnPropNames(from)) | |
| 2427 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 2428 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 2429 | + } | |
| 2430 | + return to; | |
| 2431 | +}; | |
| 2432 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 2433 | + | |
| 2434 | +// src/infiniteQueryObserver.ts | |
| 2435 | +var infiniteQueryObserver_exports = {}; | |
| 2436 | +__export(infiniteQueryObserver_exports, { | |
| 2437 | + InfiniteQueryObserver: () => InfiniteQueryObserver | |
| 2438 | +}); | |
| 2439 | +module.exports = __toCommonJS(infiniteQueryObserver_exports); | |
| 2440 | +var import_queryObserver = __webpack_require__(/*! ./queryObserver.cjs */ "../node_modules/@tanstack/query-core/build/modern/queryObserver.cjs"); | |
| 2441 | +var import_infiniteQueryBehavior = __webpack_require__(/*! ./infiniteQueryBehavior.cjs */ "../node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs"); | |
| 2442 | +var InfiniteQueryObserver = class extends import_queryObserver.QueryObserver { | |
| 2443 | + // eslint-disable-next-line @typescript-eslint/no-useless-constructor | |
| 2444 | + constructor(client, options) { | |
| 2445 | + super(client, options); | |
| 2446 | + } | |
| 2447 | + bindMethods() { | |
| 2448 | + super.bindMethods(); | |
| 2449 | + this.fetchNextPage = this.fetchNextPage.bind(this); | |
| 2450 | + this.fetchPreviousPage = this.fetchPreviousPage.bind(this); | |
| 2451 | + } | |
| 2452 | + setOptions(options, notifyOptions) { | |
| 2453 | + super.setOptions( | |
| 2454 | + { | |
| 2455 | + ...options, | |
| 2456 | + behavior: (0, import_infiniteQueryBehavior.infiniteQueryBehavior)() | |
| 2457 | + }, | |
| 2458 | + notifyOptions | |
| 2459 | + ); | |
| 2460 | + } | |
| 2461 | + getOptimisticResult(options) { | |
| 2462 | + options.behavior = (0, import_infiniteQueryBehavior.infiniteQueryBehavior)(); | |
| 2463 | + return super.getOptimisticResult(options); | |
| 2464 | + } | |
| 2465 | + fetchNextPage(options) { | |
| 2466 | + return this.fetch({ | |
| 2467 | + ...options, | |
| 2468 | + meta: { | |
| 2469 | + fetchMore: { direction: "forward" } | |
| 2470 | + } | |
| 2471 | + }); | |
| 2472 | + } | |
| 2473 | + fetchPreviousPage(options) { | |
| 2474 | + return this.fetch({ | |
| 2475 | + ...options, | |
| 2476 | + meta: { | |
| 2477 | + fetchMore: { direction: "backward" } | |
| 2478 | + } | |
| 2479 | + }); | |
| 2480 | + } | |
| 2481 | + createResult(query, options) { | |
| 2482 | + const { state } = query; | |
| 2483 | + const result = super.createResult(query, options); | |
| 2484 | + const { isFetching, isRefetching } = result; | |
| 2485 | + const isFetchingNextPage = isFetching && state.fetchMeta?.fetchMore?.direction === "forward"; | |
| 2486 | + const isFetchingPreviousPage = isFetching && state.fetchMeta?.fetchMore?.direction === "backward"; | |
| 2487 | + return { | |
| 2488 | + ...result, | |
| 2489 | + fetchNextPage: this.fetchNextPage, | |
| 2490 | + fetchPreviousPage: this.fetchPreviousPage, | |
| 2491 | + hasNextPage: (0, import_infiniteQueryBehavior.hasNextPage)(options, state.data), | |
| 2492 | + hasPreviousPage: (0, import_infiniteQueryBehavior.hasPreviousPage)(options, state.data), | |
| 2493 | + isFetchingNextPage, | |
| 2494 | + isFetchingPreviousPage, | |
| 2495 | + isRefetching: isRefetching && !isFetchingNextPage && !isFetchingPreviousPage | |
| 2496 | + }; | |
| 2497 | + } | |
| 2498 | +}; | |
| 2499 | +// Annotate the CommonJS export names for ESM import in node: | |
| 2500 | +0 && (0); | |
| 2501 | +//# sourceMappingURL=infiniteQueryObserver.cjs.map | |
| 2502 | + | |
| 2503 | +/***/ }), | |
| 2504 | + | |
| 2505 | +/***/ "../node_modules/@tanstack/query-core/build/modern/mutation.cjs": | |
| 2506 | +/*!**********************************************************************!*\ | |
| 2507 | + !*** ../node_modules/@tanstack/query-core/build/modern/mutation.cjs ***! | |
| 2508 | + \**********************************************************************/ | |
| 2509 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 2510 | + | |
| 2511 | +"use strict"; | |
| 2512 | + | |
| 2513 | +var __defProp = Object.defineProperty; | |
| 2514 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 2515 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 2516 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 2517 | +var __export = (target, all) => { | |
| 2518 | + for (var name in all) | |
| 2519 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 2520 | +}; | |
| 2521 | +var __copyProps = (to, from, except, desc) => { | |
| 2522 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 2523 | + for (let key of __getOwnPropNames(from)) | |
| 2524 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 2525 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 2526 | + } | |
| 2527 | + return to; | |
| 2528 | +}; | |
| 2529 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 2530 | + | |
| 2531 | +// src/mutation.ts | |
| 2532 | +var mutation_exports = {}; | |
| 2533 | +__export(mutation_exports, { | |
| 2534 | + Mutation: () => Mutation, | |
| 2535 | + getDefaultState: () => getDefaultState | |
| 2536 | +}); | |
| 2537 | +module.exports = __toCommonJS(mutation_exports); | |
| 2538 | +var import_notifyManager = __webpack_require__(/*! ./notifyManager.cjs */ "../node_modules/@tanstack/query-core/build/modern/notifyManager.cjs"); | |
| 2539 | +var import_removable = __webpack_require__(/*! ./removable.cjs */ "../node_modules/@tanstack/query-core/build/modern/removable.cjs"); | |
| 2540 | +var import_retryer = __webpack_require__(/*! ./retryer.cjs */ "../node_modules/@tanstack/query-core/build/modern/retryer.cjs"); | |
| 2541 | +var Mutation = class extends import_removable.Removable { | |
| 2542 | + constructor(config) { | |
| 2543 | + super(); | |
| 2544 | + this.mutationId = config.mutationId; | |
| 2545 | + this.#defaultOptions = config.defaultOptions; | |
| 2546 | + this.#mutationCache = config.mutationCache; | |
| 2547 | + this.#observers = []; | |
| 2548 | + this.state = config.state || getDefaultState(); | |
| 2549 | + this.setOptions(config.options); | |
| 2550 | + this.scheduleGc(); | |
| 2551 | + } | |
| 2552 | + #observers; | |
| 2553 | + #defaultOptions; | |
| 2554 | + #mutationCache; | |
| 2555 | + #retryer; | |
| 2556 | + setOptions(options) { | |
| 2557 | + this.options = { ...this.#defaultOptions, ...options }; | |
| 2558 | + this.updateGcTime(this.options.gcTime); | |
| 2559 | + } | |
| 2560 | + get meta() { | |
| 2561 | + return this.options.meta; | |
| 2562 | + } | |
| 2563 | + addObserver(observer) { | |
| 2564 | + if (!this.#observers.includes(observer)) { | |
| 2565 | + this.#observers.push(observer); | |
| 2566 | + this.clearGcTimeout(); | |
| 2567 | + this.#mutationCache.notify({ | |
| 2568 | + type: "observerAdded", | |
| 2569 | + mutation: this, | |
| 2570 | + observer | |
| 2571 | + }); | |
| 2572 | + } | |
| 2573 | + } | |
| 2574 | + removeObserver(observer) { | |
| 2575 | + this.#observers = this.#observers.filter((x) => x !== observer); | |
| 2576 | + this.scheduleGc(); | |
| 2577 | + this.#mutationCache.notify({ | |
| 2578 | + type: "observerRemoved", | |
| 2579 | + mutation: this, | |
| 2580 | + observer | |
| 2581 | + }); | |
| 2582 | + } | |
| 2583 | + optionalRemove() { | |
| 2584 | + if (!this.#observers.length) { | |
| 2585 | + if (this.state.status === "pending") { | |
| 2586 | + this.scheduleGc(); | |
| 2587 | + } else { | |
| 2588 | + this.#mutationCache.remove(this); | |
| 2589 | + } | |
| 2590 | + } | |
| 2591 | + } | |
| 2592 | + continue() { | |
| 2593 | + return this.#retryer?.continue() ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before | |
| 2594 | + this.execute(this.state.variables); | |
| 2595 | + } | |
| 2596 | + async execute(variables) { | |
| 2597 | + const executeMutation = () => { | |
| 2598 | + this.#retryer = (0, import_retryer.createRetryer)({ | |
| 2599 | + fn: () => { | |
| 2600 | + if (!this.options.mutationFn) { | |
| 2601 | + return Promise.reject(new Error("No mutationFn found")); | |
| 2602 | + } | |
| 2603 | + return this.options.mutationFn(variables); | |
| 2604 | + }, | |
| 2605 | + onFail: (failureCount, error) => { | |
| 2606 | + this.#dispatch({ type: "failed", failureCount, error }); | |
| 2607 | + }, | |
| 2608 | + onPause: () => { | |
| 2609 | + this.#dispatch({ type: "pause" }); | |
| 2610 | + }, | |
| 2611 | + onContinue: () => { | |
| 2612 | + this.#dispatch({ type: "continue" }); | |
| 2613 | + }, | |
| 2614 | + retry: this.options.retry ?? 0, | |
| 2615 | + retryDelay: this.options.retryDelay, | |
| 2616 | + networkMode: this.options.networkMode | |
| 2617 | + }); | |
| 2618 | + return this.#retryer.promise; | |
| 2619 | + }; | |
| 2620 | + const restored = this.state.status === "pending"; | |
| 2621 | + try { | |
| 2622 | + if (!restored) { | |
| 2623 | + this.#dispatch({ type: "pending", variables }); | |
| 2624 | + await this.#mutationCache.config.onMutate?.( | |
| 2625 | + variables, | |
| 2626 | + this | |
| 2627 | + ); | |
| 2628 | + const context = await this.options.onMutate?.(variables); | |
| 2629 | + if (context !== this.state.context) { | |
| 2630 | + this.#dispatch({ | |
| 2631 | + type: "pending", | |
| 2632 | + context, | |
| 2633 | + variables | |
| 2634 | + }); | |
| 2635 | + } | |
| 2636 | + } | |
| 2637 | + const data = await executeMutation(); | |
| 2638 | + await this.#mutationCache.config.onSuccess?.( | |
| 2639 | + data, | |
| 2640 | + variables, | |
| 2641 | + this.state.context, | |
| 2642 | + this | |
| 2643 | + ); | |
| 2644 | + await this.options.onSuccess?.(data, variables, this.state.context); | |
| 2645 | + await this.#mutationCache.config.onSettled?.( | |
| 2646 | + data, | |
| 2647 | + null, | |
| 2648 | + this.state.variables, | |
| 2649 | + this.state.context, | |
| 2650 | + this | |
| 2651 | + ); | |
| 2652 | + await this.options.onSettled?.(data, null, variables, this.state.context); | |
| 2653 | + this.#dispatch({ type: "success", data }); | |
| 2654 | + return data; | |
| 2655 | + } catch (error) { | |
| 2656 | + try { | |
| 2657 | + await this.#mutationCache.config.onError?.( | |
| 2658 | + error, | |
| 2659 | + variables, | |
| 2660 | + this.state.context, | |
| 2661 | + this | |
| 2662 | + ); | |
| 2663 | + await this.options.onError?.( | |
| 2664 | + error, | |
| 2665 | + variables, | |
| 2666 | + this.state.context | |
| 2667 | + ); | |
| 2668 | + await this.#mutationCache.config.onSettled?.( | |
| 2669 | + void 0, | |
| 2670 | + error, | |
| 2671 | + this.state.variables, | |
| 2672 | + this.state.context, | |
| 2673 | + this | |
| 2674 | + ); | |
| 2675 | + await this.options.onSettled?.( | |
| 2676 | + void 0, | |
| 2677 | + error, | |
| 2678 | + variables, | |
| 2679 | + this.state.context | |
| 2680 | + ); | |
| 2681 | + throw error; | |
| 2682 | + } finally { | |
| 2683 | + this.#dispatch({ type: "error", error }); | |
| 2684 | + } | |
| 2685 | + } | |
| 2686 | + } | |
| 2687 | + #dispatch(action) { | |
| 2688 | + const reducer = (state) => { | |
| 2689 | + switch (action.type) { | |
| 2690 | + case "failed": | |
| 2691 | + return { | |
| 2692 | + ...state, | |
| 2693 | + failureCount: action.failureCount, | |
| 2694 | + failureReason: action.error | |
| 2695 | + }; | |
| 2696 | + case "pause": | |
| 2697 | + return { | |
| 2698 | + ...state, | |
| 2699 | + isPaused: true | |
| 2700 | + }; | |
| 2701 | + case "continue": | |
| 2702 | + return { | |
| 2703 | + ...state, | |
| 2704 | + isPaused: false | |
| 2705 | + }; | |
| 2706 | + case "pending": | |
| 2707 | + return { | |
| 2708 | + ...state, | |
| 2709 | + context: action.context, | |
| 2710 | + data: void 0, | |
| 2711 | + failureCount: 0, | |
| 2712 | + failureReason: null, | |
| 2713 | + error: null, | |
| 2714 | + isPaused: !(0, import_retryer.canFetch)(this.options.networkMode), | |
| 2715 | + status: "pending", | |
| 2716 | + variables: action.variables, | |
| 2717 | + submittedAt: Date.now() | |
| 2718 | + }; | |
| 2719 | + case "success": | |
| 2720 | + return { | |
| 2721 | + ...state, | |
| 2722 | + data: action.data, | |
| 2723 | + failureCount: 0, | |
| 2724 | + failureReason: null, | |
| 2725 | + error: null, | |
| 2726 | + status: "success", | |
| 2727 | + isPaused: false | |
| 2728 | + }; | |
| 2729 | + case "error": | |
| 2730 | + return { | |
| 2731 | + ...state, | |
| 2732 | + data: void 0, | |
| 2733 | + error: action.error, | |
| 2734 | + failureCount: state.failureCount + 1, | |
| 2735 | + failureReason: action.error, | |
| 2736 | + isPaused: false, | |
| 2737 | + status: "error" | |
| 2738 | + }; | |
| 2739 | + } | |
| 2740 | + }; | |
| 2741 | + this.state = reducer(this.state); | |
| 2742 | + import_notifyManager.notifyManager.batch(() => { | |
| 2743 | + this.#observers.forEach((observer) => { | |
| 2744 | + observer.onMutationUpdate(action); | |
| 2745 | + }); | |
| 2746 | + this.#mutationCache.notify({ | |
| 2747 | + mutation: this, | |
| 2748 | + type: "updated", | |
| 2749 | + action | |
| 2750 | + }); | |
| 2751 | + }); | |
| 2752 | + } | |
| 2753 | +}; | |
| 2754 | +function getDefaultState() { | |
| 2755 | + return { | |
| 2756 | + context: void 0, | |
| 2757 | + data: void 0, | |
| 2758 | + error: null, | |
| 2759 | + failureCount: 0, | |
| 2760 | + failureReason: null, | |
| 2761 | + isPaused: false, | |
| 2762 | + status: "idle", | |
| 2763 | + variables: void 0, | |
| 2764 | + submittedAt: 0 | |
| 2765 | + }; | |
| 2766 | +} | |
| 2767 | +// Annotate the CommonJS export names for ESM import in node: | |
| 2768 | +0 && (0); | |
| 2769 | +//# sourceMappingURL=mutation.cjs.map | |
| 2770 | + | |
| 2771 | +/***/ }), | |
| 2772 | + | |
| 2773 | +/***/ "../node_modules/@tanstack/query-core/build/modern/mutationCache.cjs": | |
| 2774 | +/*!***************************************************************************!*\ | |
| 2775 | + !*** ../node_modules/@tanstack/query-core/build/modern/mutationCache.cjs ***! | |
| 2776 | + \***************************************************************************/ | |
| 2777 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 2778 | + | |
| 2779 | +"use strict"; | |
| 2780 | + | |
| 2781 | +var __defProp = Object.defineProperty; | |
| 2782 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 2783 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 2784 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 2785 | +var __export = (target, all) => { | |
| 2786 | + for (var name in all) | |
| 2787 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 2788 | +}; | |
| 2789 | +var __copyProps = (to, from, except, desc) => { | |
| 2790 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 2791 | + for (let key of __getOwnPropNames(from)) | |
| 2792 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 2793 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 2794 | + } | |
| 2795 | + return to; | |
| 2796 | +}; | |
| 2797 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 2798 | + | |
| 2799 | +// src/mutationCache.ts | |
| 2800 | +var mutationCache_exports = {}; | |
| 2801 | +__export(mutationCache_exports, { | |
| 2802 | + MutationCache: () => MutationCache | |
| 2803 | +}); | |
| 2804 | +module.exports = __toCommonJS(mutationCache_exports); | |
| 2805 | +var import_notifyManager = __webpack_require__(/*! ./notifyManager.cjs */ "../node_modules/@tanstack/query-core/build/modern/notifyManager.cjs"); | |
| 2806 | +var import_mutation = __webpack_require__(/*! ./mutation.cjs */ "../node_modules/@tanstack/query-core/build/modern/mutation.cjs"); | |
| 2807 | +var import_utils = __webpack_require__(/*! ./utils.cjs */ "../node_modules/@tanstack/query-core/build/modern/utils.cjs"); | |
| 2808 | +var import_subscribable = __webpack_require__(/*! ./subscribable.cjs */ "../node_modules/@tanstack/query-core/build/modern/subscribable.cjs"); | |
| 2809 | +var MutationCache = class extends import_subscribable.Subscribable { | |
| 2810 | + constructor(config = {}) { | |
| 2811 | + super(); | |
| 2812 | + this.config = config; | |
| 2813 | + this.#mutations = []; | |
| 2814 | + this.#mutationId = 0; | |
| 2815 | + } | |
| 2816 | + #mutations; | |
| 2817 | + #mutationId; | |
| 2818 | + #resuming; | |
| 2819 | + build(client, options, state) { | |
| 2820 | + const mutation = new import_mutation.Mutation({ | |
| 2821 | + mutationCache: this, | |
| 2822 | + mutationId: ++this.#mutationId, | |
| 2823 | + options: client.defaultMutationOptions(options), | |
| 2824 | + state | |
| 2825 | + }); | |
| 2826 | + this.add(mutation); | |
| 2827 | + return mutation; | |
| 2828 | + } | |
| 2829 | + add(mutation) { | |
| 2830 | + this.#mutations.push(mutation); | |
| 2831 | + this.notify({ type: "added", mutation }); | |
| 2832 | + } | |
| 2833 | + remove(mutation) { | |
| 2834 | + this.#mutations = this.#mutations.filter((x) => x !== mutation); | |
| 2835 | + this.notify({ type: "removed", mutation }); | |
| 2836 | + } | |
| 2837 | + clear() { | |
| 2838 | + import_notifyManager.notifyManager.batch(() => { | |
| 2839 | + this.#mutations.forEach((mutation) => { | |
| 2840 | + this.remove(mutation); | |
| 2841 | + }); | |
| 2842 | + }); | |
| 2843 | + } | |
| 2844 | + getAll() { | |
| 2845 | + return this.#mutations; | |
| 2846 | + } | |
| 2847 | + find(filters) { | |
| 2848 | + const defaultedFilters = { exact: true, ...filters }; | |
| 2849 | + return this.#mutations.find( | |
| 2850 | + (mutation) => (0, import_utils.matchMutation)(defaultedFilters, mutation) | |
| 2851 | + ); | |
| 2852 | + } | |
| 2853 | + findAll(filters = {}) { | |
| 2854 | + return this.#mutations.filter( | |
| 2855 | + (mutation) => (0, import_utils.matchMutation)(filters, mutation) | |
| 2856 | + ); | |
| 2857 | + } | |
| 2858 | + notify(event) { | |
| 2859 | + import_notifyManager.notifyManager.batch(() => { | |
| 2860 | + this.listeners.forEach((listener) => { | |
| 2861 | + listener(event); | |
| 2862 | + }); | |
| 2863 | + }); | |
| 2864 | + } | |
| 2865 | + resumePausedMutations() { | |
| 2866 | + this.#resuming = (this.#resuming ?? Promise.resolve()).then(() => { | |
| 2867 | + const pausedMutations = this.#mutations.filter((x) => x.state.isPaused); | |
| 2868 | + return import_notifyManager.notifyManager.batch( | |
| 2869 | + () => pausedMutations.reduce( | |
| 2870 | + (promise, mutation) => promise.then(() => mutation.continue().catch(import_utils.noop)), | |
| 2871 | + Promise.resolve() | |
| 2872 | + ) | |
| 2873 | + ); | |
| 2874 | + }).then(() => { | |
| 2875 | + this.#resuming = void 0; | |
| 2876 | + }); | |
| 2877 | + return this.#resuming; | |
| 2878 | + } | |
| 2879 | +}; | |
| 2880 | +// Annotate the CommonJS export names for ESM import in node: | |
| 2881 | +0 && (0); | |
| 2882 | +//# sourceMappingURL=mutationCache.cjs.map | |
| 2883 | + | |
| 2884 | +/***/ }), | |
| 2885 | + | |
| 2886 | +/***/ "../node_modules/@tanstack/query-core/build/modern/mutationObserver.cjs": | |
| 2887 | +/*!******************************************************************************!*\ | |
| 2888 | + !*** ../node_modules/@tanstack/query-core/build/modern/mutationObserver.cjs ***! | |
| 2889 | + \******************************************************************************/ | |
| 2890 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 2891 | + | |
| 2892 | +"use strict"; | |
| 2893 | + | |
| 2894 | +var __defProp = Object.defineProperty; | |
| 2895 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 2896 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 2897 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 2898 | +var __export = (target, all) => { | |
| 2899 | + for (var name in all) | |
| 2900 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 2901 | +}; | |
| 2902 | +var __copyProps = (to, from, except, desc) => { | |
| 2903 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 2904 | + for (let key of __getOwnPropNames(from)) | |
| 2905 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 2906 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 2907 | + } | |
| 2908 | + return to; | |
| 2909 | +}; | |
| 2910 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 2911 | + | |
| 2912 | +// src/mutationObserver.ts | |
| 2913 | +var mutationObserver_exports = {}; | |
| 2914 | +__export(mutationObserver_exports, { | |
| 2915 | + MutationObserver: () => MutationObserver | |
| 2916 | +}); | |
| 2917 | +module.exports = __toCommonJS(mutationObserver_exports); | |
| 2918 | +var import_mutation = __webpack_require__(/*! ./mutation.cjs */ "../node_modules/@tanstack/query-core/build/modern/mutation.cjs"); | |
| 2919 | +var import_notifyManager = __webpack_require__(/*! ./notifyManager.cjs */ "../node_modules/@tanstack/query-core/build/modern/notifyManager.cjs"); | |
| 2920 | +var import_subscribable = __webpack_require__(/*! ./subscribable.cjs */ "../node_modules/@tanstack/query-core/build/modern/subscribable.cjs"); | |
| 2921 | +var import_utils = __webpack_require__(/*! ./utils.cjs */ "../node_modules/@tanstack/query-core/build/modern/utils.cjs"); | |
| 2922 | +var MutationObserver = class extends import_subscribable.Subscribable { | |
| 2923 | + constructor(client, options) { | |
| 2924 | + super(); | |
| 2925 | + this.#currentResult = void 0; | |
| 2926 | + this.#client = client; | |
| 2927 | + this.setOptions(options); | |
| 2928 | + this.bindMethods(); | |
| 2929 | + this.#updateResult(); | |
| 2930 | + } | |
| 2931 | + #client; | |
| 2932 | + #currentResult; | |
| 2933 | + #currentMutation; | |
| 2934 | + #mutateOptions; | |
| 2935 | + bindMethods() { | |
| 2936 | + this.mutate = this.mutate.bind(this); | |
| 2937 | + this.reset = this.reset.bind(this); | |
| 2938 | + } | |
| 2939 | + setOptions(options) { | |
| 2940 | + const prevOptions = this.options; | |
| 2941 | + this.options = this.#client.defaultMutationOptions(options); | |
| 2942 | + if (!(0, import_utils.shallowEqualObjects)(prevOptions, this.options)) { | |
| 2943 | + this.#client.getMutationCache().notify({ | |
| 2944 | + type: "observerOptionsUpdated", | |
| 2945 | + mutation: this.#currentMutation, | |
| 2946 | + observer: this | |
| 2947 | + }); | |
| 2948 | + } | |
| 2949 | + this.#currentMutation?.setOptions(this.options); | |
| 2950 | + } | |
| 2951 | + onUnsubscribe() { | |
| 2952 | + if (!this.hasListeners()) { | |
| 2953 | + this.#currentMutation?.removeObserver(this); | |
| 2954 | + } | |
| 2955 | + } | |
| 2956 | + onMutationUpdate(action) { | |
| 2957 | + this.#updateResult(); | |
| 2958 | + this.#notify(action); | |
| 2959 | + } | |
| 2960 | + getCurrentResult() { | |
| 2961 | + return this.#currentResult; | |
| 2962 | + } | |
| 2963 | + reset() { | |
| 2964 | + this.#currentMutation = void 0; | |
| 2965 | + this.#updateResult(); | |
| 2966 | + this.#notify(); | |
| 2967 | + } | |
| 2968 | + mutate(variables, options) { | |
| 2969 | + this.#mutateOptions = options; | |
| 2970 | + this.#currentMutation?.removeObserver(this); | |
| 2971 | + this.#currentMutation = this.#client.getMutationCache().build(this.#client, this.options); | |
| 2972 | + this.#currentMutation.addObserver(this); | |
| 2973 | + return this.#currentMutation.execute(variables); | |
| 2974 | + } | |
| 2975 | + #updateResult() { | |
| 2976 | + const state = this.#currentMutation?.state ?? (0, import_mutation.getDefaultState)(); | |
| 2977 | + this.#currentResult = { | |
| 2978 | + ...state, | |
| 2979 | + isPending: state.status === "pending", | |
| 2980 | + isSuccess: state.status === "success", | |
| 2981 | + isError: state.status === "error", | |
| 2982 | + isIdle: state.status === "idle", | |
| 2983 | + mutate: this.mutate, | |
| 2984 | + reset: this.reset | |
| 2985 | + }; | |
| 2986 | + } | |
| 2987 | + #notify(action) { | |
| 2988 | + import_notifyManager.notifyManager.batch(() => { | |
| 2989 | + if (this.#mutateOptions && this.hasListeners()) { | |
| 2990 | + if (action?.type === "success") { | |
| 2991 | + this.#mutateOptions.onSuccess?.( | |
| 2992 | + action.data, | |
| 2993 | + this.#currentResult.variables, | |
| 2994 | + this.#currentResult.context | |
| 2995 | + ); | |
| 2996 | + this.#mutateOptions.onSettled?.( | |
| 2997 | + action.data, | |
| 2998 | + null, | |
| 2999 | + this.#currentResult.variables, | |
| 3000 | + this.#currentResult.context | |
| 3001 | + ); | |
| 3002 | + } else if (action?.type === "error") { | |
| 3003 | + this.#mutateOptions.onError?.( | |
| 3004 | + action.error, | |
| 3005 | + this.#currentResult.variables, | |
| 3006 | + this.#currentResult.context | |
| 3007 | + ); | |
| 3008 | + this.#mutateOptions.onSettled?.( | |
| 3009 | + void 0, | |
| 3010 | + action.error, | |
| 3011 | + this.#currentResult.variables, | |
| 3012 | + this.#currentResult.context | |
| 3013 | + ); | |
| 3014 | + } | |
| 3015 | + } | |
| 3016 | + this.listeners.forEach((listener) => { | |
| 3017 | + listener(this.#currentResult); | |
| 3018 | + }); | |
| 3019 | + }); | |
| 3020 | + } | |
| 3021 | +}; | |
| 3022 | +// Annotate the CommonJS export names for ESM import in node: | |
| 3023 | +0 && (0); | |
| 3024 | +//# sourceMappingURL=mutationObserver.cjs.map | |
| 3025 | + | |
| 3026 | +/***/ }), | |
| 3027 | + | |
| 3028 | +/***/ "../node_modules/@tanstack/query-core/build/modern/notifyManager.cjs": | |
| 3029 | +/*!***************************************************************************!*\ | |
| 3030 | + !*** ../node_modules/@tanstack/query-core/build/modern/notifyManager.cjs ***! | |
| 3031 | + \***************************************************************************/ | |
| 3032 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 3033 | + | |
| 3034 | +"use strict"; | |
| 3035 | + | |
| 3036 | +var __defProp = Object.defineProperty; | |
| 3037 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 3038 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 3039 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 3040 | +var __export = (target, all) => { | |
| 3041 | + for (var name in all) | |
| 3042 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 3043 | +}; | |
| 3044 | +var __copyProps = (to, from, except, desc) => { | |
| 3045 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 3046 | + for (let key of __getOwnPropNames(from)) | |
| 3047 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 3048 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 3049 | + } | |
| 3050 | + return to; | |
| 3051 | +}; | |
| 3052 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 3053 | + | |
| 3054 | +// src/notifyManager.ts | |
| 3055 | +var notifyManager_exports = {}; | |
| 3056 | +__export(notifyManager_exports, { | |
| 3057 | + createNotifyManager: () => createNotifyManager, | |
| 3058 | + notifyManager: () => notifyManager | |
| 3059 | +}); | |
| 3060 | +module.exports = __toCommonJS(notifyManager_exports); | |
| 3061 | +var import_utils = __webpack_require__(/*! ./utils.cjs */ "../node_modules/@tanstack/query-core/build/modern/utils.cjs"); | |
| 3062 | +function createNotifyManager() { | |
| 3063 | + let queue = []; | |
| 3064 | + let transactions = 0; | |
| 3065 | + let notifyFn = (callback) => { | |
| 3066 | + callback(); | |
| 3067 | + }; | |
| 3068 | + let batchNotifyFn = (callback) => { | |
| 3069 | + callback(); | |
| 3070 | + }; | |
| 3071 | + const batch = (callback) => { | |
| 3072 | + let result; | |
| 3073 | + transactions++; | |
| 3074 | + try { | |
| 3075 | + result = callback(); | |
| 3076 | + } finally { | |
| 3077 | + transactions--; | |
| 3078 | + if (!transactions) { | |
| 3079 | + flush(); | |
| 3080 | + } | |
| 3081 | + } | |
| 3082 | + return result; | |
| 3083 | + }; | |
| 3084 | + const schedule = (callback) => { | |
| 3085 | + if (transactions) { | |
| 3086 | + queue.push(callback); | |
| 3087 | + } else { | |
| 3088 | + (0, import_utils.scheduleMicrotask)(() => { | |
| 3089 | + notifyFn(callback); | |
| 3090 | + }); | |
| 3091 | + } | |
| 3092 | + }; | |
| 3093 | + const batchCalls = (callback) => { | |
| 3094 | + return (...args) => { | |
| 3095 | + schedule(() => { | |
| 3096 | + callback(...args); | |
| 3097 | + }); | |
| 3098 | + }; | |
| 3099 | + }; | |
| 3100 | + const flush = () => { | |
| 3101 | + const originalQueue = queue; | |
| 3102 | + queue = []; | |
| 3103 | + if (originalQueue.length) { | |
| 3104 | + (0, import_utils.scheduleMicrotask)(() => { | |
| 3105 | + batchNotifyFn(() => { | |
| 3106 | + originalQueue.forEach((callback) => { | |
| 3107 | + notifyFn(callback); | |
| 3108 | + }); | |
| 3109 | + }); | |
| 3110 | + }); | |
| 3111 | + } | |
| 3112 | + }; | |
| 3113 | + const setNotifyFunction = (fn) => { | |
| 3114 | + notifyFn = fn; | |
| 3115 | + }; | |
| 3116 | + const setBatchNotifyFunction = (fn) => { | |
| 3117 | + batchNotifyFn = fn; | |
| 3118 | + }; | |
| 3119 | + return { | |
| 3120 | + batch, | |
| 3121 | + batchCalls, | |
| 3122 | + schedule, | |
| 3123 | + setNotifyFunction, | |
| 3124 | + setBatchNotifyFunction | |
| 3125 | + }; | |
| 3126 | +} | |
| 3127 | +var notifyManager = createNotifyManager(); | |
| 3128 | +// Annotate the CommonJS export names for ESM import in node: | |
| 3129 | +0 && (0); | |
| 3130 | +//# sourceMappingURL=notifyManager.cjs.map | |
| 3131 | + | |
| 3132 | +/***/ }), | |
| 3133 | + | |
| 3134 | +/***/ "../node_modules/@tanstack/query-core/build/modern/onlineManager.cjs": | |
| 3135 | +/*!***************************************************************************!*\ | |
| 3136 | + !*** ../node_modules/@tanstack/query-core/build/modern/onlineManager.cjs ***! | |
| 3137 | + \***************************************************************************/ | |
| 3138 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 3139 | + | |
| 3140 | +"use strict"; | |
| 3141 | + | |
| 3142 | +var __defProp = Object.defineProperty; | |
| 3143 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 3144 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 3145 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 3146 | +var __export = (target, all) => { | |
| 3147 | + for (var name in all) | |
| 3148 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 3149 | +}; | |
| 3150 | +var __copyProps = (to, from, except, desc) => { | |
| 3151 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 3152 | + for (let key of __getOwnPropNames(from)) | |
| 3153 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 3154 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 3155 | + } | |
| 3156 | + return to; | |
| 3157 | +}; | |
| 3158 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 3159 | + | |
| 3160 | +// src/onlineManager.ts | |
| 3161 | +var onlineManager_exports = {}; | |
| 3162 | +__export(onlineManager_exports, { | |
| 3163 | + OnlineManager: () => OnlineManager, | |
| 3164 | + onlineManager: () => onlineManager | |
| 3165 | +}); | |
| 3166 | +module.exports = __toCommonJS(onlineManager_exports); | |
| 3167 | +var import_subscribable = __webpack_require__(/*! ./subscribable.cjs */ "../node_modules/@tanstack/query-core/build/modern/subscribable.cjs"); | |
| 3168 | +var import_utils = __webpack_require__(/*! ./utils.cjs */ "../node_modules/@tanstack/query-core/build/modern/utils.cjs"); | |
| 3169 | +var OnlineManager = class extends import_subscribable.Subscribable { | |
| 3170 | + #online = true; | |
| 3171 | + #cleanup; | |
| 3172 | + #setup; | |
| 3173 | + constructor() { | |
| 3174 | + super(); | |
| 3175 | + this.#setup = (onOnline) => { | |
| 3176 | + if (!import_utils.isServer && window.addEventListener) { | |
| 3177 | + const onlineListener = () => onOnline(true); | |
| 3178 | + const offlineListener = () => onOnline(false); | |
| 3179 | + window.addEventListener("online", onlineListener, false); | |
| 3180 | + window.addEventListener("offline", offlineListener, false); | |
| 3181 | + return () => { | |
| 3182 | + window.removeEventListener("online", onlineListener); | |
| 3183 | + window.removeEventListener("offline", offlineListener); | |
| 3184 | + }; | |
| 3185 | + } | |
| 3186 | + return; | |
| 3187 | + }; | |
| 3188 | + } | |
| 3189 | + onSubscribe() { | |
| 3190 | + if (!this.#cleanup) { | |
| 3191 | + this.setEventListener(this.#setup); | |
| 3192 | + } | |
| 3193 | + } | |
| 3194 | + onUnsubscribe() { | |
| 3195 | + if (!this.hasListeners()) { | |
| 3196 | + this.#cleanup?.(); | |
| 3197 | + this.#cleanup = void 0; | |
| 3198 | + } | |
| 3199 | + } | |
| 3200 | + setEventListener(setup) { | |
| 3201 | + this.#setup = setup; | |
| 3202 | + this.#cleanup?.(); | |
| 3203 | + this.#cleanup = setup(this.setOnline.bind(this)); | |
| 3204 | + } | |
| 3205 | + setOnline(online) { | |
| 3206 | + const changed = this.#online !== online; | |
| 3207 | + if (changed) { | |
| 3208 | + this.#online = online; | |
| 3209 | + this.listeners.forEach((listener) => { | |
| 3210 | + listener(online); | |
| 3211 | + }); | |
| 3212 | + } | |
| 3213 | + } | |
| 3214 | + isOnline() { | |
| 3215 | + return this.#online; | |
| 3216 | + } | |
| 3217 | +}; | |
| 3218 | +var onlineManager = new OnlineManager(); | |
| 3219 | +// Annotate the CommonJS export names for ESM import in node: | |
| 3220 | +0 && (0); | |
| 3221 | +//# sourceMappingURL=onlineManager.cjs.map | |
| 3222 | + | |
| 3223 | +/***/ }), | |
| 3224 | + | |
| 3225 | +/***/ "../node_modules/@tanstack/query-core/build/modern/queriesObserver.cjs": | |
| 3226 | +/*!*****************************************************************************!*\ | |
| 3227 | + !*** ../node_modules/@tanstack/query-core/build/modern/queriesObserver.cjs ***! | |
| 3228 | + \*****************************************************************************/ | |
| 3229 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 3230 | + | |
| 3231 | +"use strict"; | |
| 3232 | + | |
| 3233 | +var __defProp = Object.defineProperty; | |
| 3234 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 3235 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 3236 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 3237 | +var __export = (target, all) => { | |
| 3238 | + for (var name in all) | |
| 3239 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 3240 | +}; | |
| 3241 | +var __copyProps = (to, from, except, desc) => { | |
| 3242 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 3243 | + for (let key of __getOwnPropNames(from)) | |
| 3244 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 3245 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 3246 | + } | |
| 3247 | + return to; | |
| 3248 | +}; | |
| 3249 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 3250 | + | |
| 3251 | +// src/queriesObserver.ts | |
| 3252 | +var queriesObserver_exports = {}; | |
| 3253 | +__export(queriesObserver_exports, { | |
| 3254 | + QueriesObserver: () => QueriesObserver | |
| 3255 | +}); | |
| 3256 | +module.exports = __toCommonJS(queriesObserver_exports); | |
| 3257 | +var import_notifyManager = __webpack_require__(/*! ./notifyManager.cjs */ "../node_modules/@tanstack/query-core/build/modern/notifyManager.cjs"); | |
| 3258 | +var import_queryObserver = __webpack_require__(/*! ./queryObserver.cjs */ "../node_modules/@tanstack/query-core/build/modern/queryObserver.cjs"); | |
| 3259 | +var import_subscribable = __webpack_require__(/*! ./subscribable.cjs */ "../node_modules/@tanstack/query-core/build/modern/subscribable.cjs"); | |
| 3260 | +var import_utils = __webpack_require__(/*! ./utils.cjs */ "../node_modules/@tanstack/query-core/build/modern/utils.cjs"); | |
| 3261 | +function difference(array1, array2) { | |
| 3262 | + return array1.filter((x) => !array2.includes(x)); | |
| 3263 | +} | |
| 3264 | +function replaceAt(array, index, value) { | |
| 3265 | + const copy = array.slice(0); | |
| 3266 | + copy[index] = value; | |
| 3267 | + return copy; | |
| 3268 | +} | |
| 3269 | +var QueriesObserver = class extends import_subscribable.Subscribable { | |
| 3270 | + #client; | |
| 3271 | + #result; | |
| 3272 | + #queries; | |
| 3273 | + #observers; | |
| 3274 | + #options; | |
| 3275 | + #combinedResult; | |
| 3276 | + constructor(client, queries, options) { | |
| 3277 | + super(); | |
| 3278 | + this.#client = client; | |
| 3279 | + this.#queries = []; | |
| 3280 | + this.#observers = []; | |
| 3281 | + this.#setResult([]); | |
| 3282 | + this.setQueries(queries, options); | |
| 3283 | + } | |
| 3284 | + #setResult(value) { | |
| 3285 | + this.#result = value; | |
| 3286 | + this.#combinedResult = this.#combineResult(value); | |
| 3287 | + } | |
| 3288 | + onSubscribe() { | |
| 3289 | + if (this.listeners.size === 1) { | |
| 3290 | + this.#observers.forEach((observer) => { | |
| 3291 | + observer.subscribe((result) => { | |
| 3292 | + this.#onUpdate(observer, result); | |
| 3293 | + }); | |
| 3294 | + }); | |
| 3295 | + } | |
| 3296 | + } | |
| 3297 | + onUnsubscribe() { | |
| 3298 | + if (!this.listeners.size) { | |
| 3299 | + this.destroy(); | |
| 3300 | + } | |
| 3301 | + } | |
| 3302 | + destroy() { | |
| 3303 | + this.listeners = /* @__PURE__ */ new Set(); | |
| 3304 | + this.#observers.forEach((observer) => { | |
| 3305 | + observer.destroy(); | |
| 3306 | + }); | |
| 3307 | + } | |
| 3308 | + setQueries(queries, options, notifyOptions) { | |
| 3309 | + this.#queries = queries; | |
| 3310 | + this.#options = options; | |
| 3311 | + import_notifyManager.notifyManager.batch(() => { | |
| 3312 | + const prevObservers = this.#observers; | |
| 3313 | + const newObserverMatches = this.#findMatchingObservers(this.#queries); | |
| 3314 | + newObserverMatches.forEach( | |
| 3315 | + (match) => match.observer.setOptions(match.defaultedQueryOptions, notifyOptions) | |
| 3316 | + ); | |
| 3317 | + const newObservers = newObserverMatches.map((match) => match.observer); | |
| 3318 | + const newResult = newObservers.map( | |
| 3319 | + (observer) => observer.getCurrentResult() | |
| 3320 | + ); | |
| 3321 | + const hasIndexChange = newObservers.some( | |
| 3322 | + (observer, index) => observer !== prevObservers[index] | |
| 3323 | + ); | |
| 3324 | + if (prevObservers.length === newObservers.length && !hasIndexChange) { | |
| 3325 | + return; | |
| 3326 | + } | |
| 3327 | + this.#observers = newObservers; | |
| 3328 | + this.#setResult(newResult); | |
| 3329 | + if (!this.hasListeners()) { | |
| 3330 | + return; | |
| 3331 | + } | |
| 3332 | + difference(prevObservers, newObservers).forEach((observer) => { | |
| 3333 | + observer.destroy(); | |
| 3334 | + }); | |
| 3335 | + difference(newObservers, prevObservers).forEach((observer) => { | |
| 3336 | + observer.subscribe((result) => { | |
| 3337 | + this.#onUpdate(observer, result); | |
| 3338 | + }); | |
| 3339 | + }); | |
| 3340 | + this.#notify(); | |
| 3341 | + }); | |
| 3342 | + } | |
| 3343 | + getCurrentResult() { | |
| 3344 | + return this.#combinedResult; | |
| 3345 | + } | |
| 3346 | + getQueries() { | |
| 3347 | + return this.#observers.map((observer) => observer.getCurrentQuery()); | |
| 3348 | + } | |
| 3349 | + getObservers() { | |
| 3350 | + return this.#observers; | |
| 3351 | + } | |
| 3352 | + getOptimisticResult(queries) { | |
| 3353 | + const matches = this.#findMatchingObservers(queries); | |
| 3354 | + const result = matches.map( | |
| 3355 | + (match) => match.observer.getOptimisticResult(match.defaultedQueryOptions) | |
| 3356 | + ); | |
| 3357 | + return [ | |
| 3358 | + result, | |
| 3359 | + (r) => { | |
| 3360 | + return this.#combineResult(r ?? result); | |
| 3361 | + }, | |
| 3362 | + () => { | |
| 3363 | + return matches.map((match, index) => { | |
| 3364 | + const observerResult = result[index]; | |
| 3365 | + return !match.defaultedQueryOptions.notifyOnChangeProps ? match.observer.trackResult(observerResult) : observerResult; | |
| 3366 | + }); | |
| 3367 | + } | |
| 3368 | + ]; | |
| 3369 | + } | |
| 3370 | + #combineResult(input) { | |
| 3371 | + const combine = this.#options?.combine; | |
| 3372 | + if (combine) { | |
| 3373 | + return (0, import_utils.replaceEqualDeep)(this.#combinedResult, combine(input)); | |
| 3374 | + } | |
| 3375 | + return input; | |
| 3376 | + } | |
| 3377 | + #findMatchingObservers(queries) { | |
| 3378 | + const prevObservers = this.#observers; | |
| 3379 | + const prevObserversMap = new Map( | |
| 3380 | + prevObservers.map((observer) => [observer.options.queryHash, observer]) | |
| 3381 | + ); | |
| 3382 | + const defaultedQueryOptions = queries.map( | |
| 3383 | + (options) => this.#client.defaultQueryOptions(options) | |
| 3384 | + ); | |
| 3385 | + const matchingObservers = defaultedQueryOptions.flatMap((defaultedOptions) => { | |
| 3386 | + const match = prevObserversMap.get(defaultedOptions.queryHash); | |
| 3387 | + if (match != null) { | |
| 3388 | + return [{ defaultedQueryOptions: defaultedOptions, observer: match }]; | |
| 3389 | + } | |
| 3390 | + return []; | |
| 3391 | + }); | |
| 3392 | + const matchedQueryHashes = new Set( | |
| 3393 | + matchingObservers.map((match) => match.defaultedQueryOptions.queryHash) | |
| 3394 | + ); | |
| 3395 | + const unmatchedQueries = defaultedQueryOptions.filter( | |
| 3396 | + (defaultedOptions) => !matchedQueryHashes.has(defaultedOptions.queryHash) | |
| 3397 | + ); | |
| 3398 | + const getObserver = (options) => { | |
| 3399 | + const defaultedOptions = this.#client.defaultQueryOptions(options); | |
| 3400 | + const currentObserver = this.#observers.find( | |
| 3401 | + (o) => o.options.queryHash === defaultedOptions.queryHash | |
| 3402 | + ); | |
| 3403 | + return currentObserver ?? new import_queryObserver.QueryObserver(this.#client, defaultedOptions); | |
| 3404 | + }; | |
| 3405 | + const newOrReusedObservers = unmatchedQueries.map((options) => { | |
| 3406 | + return { | |
| 3407 | + defaultedQueryOptions: options, | |
| 3408 | + observer: getObserver(options) | |
| 3409 | + }; | |
| 3410 | + }); | |
| 3411 | + const sortMatchesByOrderOfQueries = (a, b) => defaultedQueryOptions.indexOf(a.defaultedQueryOptions) - defaultedQueryOptions.indexOf(b.defaultedQueryOptions); | |
| 3412 | + return matchingObservers.concat(newOrReusedObservers).sort(sortMatchesByOrderOfQueries); | |
| 3413 | + } | |
| 3414 | + #onUpdate(observer, result) { | |
| 3415 | + const index = this.#observers.indexOf(observer); | |
| 3416 | + if (index !== -1) { | |
| 3417 | + this.#setResult(replaceAt(this.#result, index, result)); | |
| 3418 | + this.#notify(); | |
| 3419 | + } | |
| 3420 | + } | |
| 3421 | + #notify() { | |
| 3422 | + import_notifyManager.notifyManager.batch(() => { | |
| 3423 | + this.listeners.forEach((listener) => { | |
| 3424 | + listener(this.#result); | |
| 3425 | + }); | |
| 3426 | + }); | |
| 3427 | + } | |
| 3428 | +}; | |
| 3429 | +// Annotate the CommonJS export names for ESM import in node: | |
| 3430 | +0 && (0); | |
| 3431 | +//# sourceMappingURL=queriesObserver.cjs.map | |
| 3432 | + | |
| 3433 | +/***/ }), | |
| 3434 | + | |
| 3435 | +/***/ "../node_modules/@tanstack/query-core/build/modern/query.cjs": | |
| 3436 | +/*!*******************************************************************!*\ | |
| 3437 | + !*** ../node_modules/@tanstack/query-core/build/modern/query.cjs ***! | |
| 3438 | + \*******************************************************************/ | |
| 3439 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 3440 | + | |
| 3441 | +"use strict"; | |
| 3442 | + | |
| 3443 | +var __defProp = Object.defineProperty; | |
| 3444 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 3445 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 3446 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 3447 | +var __export = (target, all) => { | |
| 3448 | + for (var name in all) | |
| 3449 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 3450 | +}; | |
| 3451 | +var __copyProps = (to, from, except, desc) => { | |
| 3452 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 3453 | + for (let key of __getOwnPropNames(from)) | |
| 3454 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 3455 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 3456 | + } | |
| 3457 | + return to; | |
| 3458 | +}; | |
| 3459 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 3460 | + | |
| 3461 | +// src/query.ts | |
| 3462 | +var query_exports = {}; | |
| 3463 | +__export(query_exports, { | |
| 3464 | + Query: () => Query | |
| 3465 | +}); | |
| 3466 | +module.exports = __toCommonJS(query_exports); | |
| 3467 | +var import_utils = __webpack_require__(/*! ./utils.cjs */ "../node_modules/@tanstack/query-core/build/modern/utils.cjs"); | |
| 3468 | +var import_notifyManager = __webpack_require__(/*! ./notifyManager.cjs */ "../node_modules/@tanstack/query-core/build/modern/notifyManager.cjs"); | |
| 3469 | +var import_retryer = __webpack_require__(/*! ./retryer.cjs */ "../node_modules/@tanstack/query-core/build/modern/retryer.cjs"); | |
| 3470 | +var import_removable = __webpack_require__(/*! ./removable.cjs */ "../node_modules/@tanstack/query-core/build/modern/removable.cjs"); | |
| 3471 | +var Query = class extends import_removable.Removable { | |
| 3472 | + constructor(config) { | |
| 3473 | + super(); | |
| 3474 | + this.#abortSignalConsumed = false; | |
| 3475 | + this.#defaultOptions = config.defaultOptions; | |
| 3476 | + this.#setOptions(config.options); | |
| 3477 | + this.#observers = []; | |
| 3478 | + this.#cache = config.cache; | |
| 3479 | + this.queryKey = config.queryKey; | |
| 3480 | + this.queryHash = config.queryHash; | |
| 3481 | + this.#initialState = config.state || getDefaultState(this.options); | |
| 3482 | + this.state = this.#initialState; | |
| 3483 | + this.scheduleGc(); | |
| 3484 | + } | |
| 3485 | + #initialState; | |
| 3486 | + #revertState; | |
| 3487 | + #cache; | |
| 3488 | + #promise; | |
| 3489 | + #retryer; | |
| 3490 | + #observers; | |
| 3491 | + #defaultOptions; | |
| 3492 | + #abortSignalConsumed; | |
| 3493 | + get meta() { | |
| 3494 | + return this.options.meta; | |
| 3495 | + } | |
| 3496 | + #setOptions(options) { | |
| 3497 | + this.options = { ...this.#defaultOptions, ...options }; | |
| 3498 | + this.updateGcTime(this.options.gcTime); | |
| 3499 | + } | |
| 3500 | + optionalRemove() { | |
| 3501 | + if (!this.#observers.length && this.state.fetchStatus === "idle") { | |
| 3502 | + this.#cache.remove(this); | |
| 3503 | + } | |
| 3504 | + } | |
| 3505 | + setData(newData, options) { | |
| 3506 | + const data = (0, import_utils.replaceData)(this.state.data, newData, this.options); | |
| 3507 | + this.#dispatch({ | |
| 3508 | + data, | |
| 3509 | + type: "success", | |
| 3510 | + dataUpdatedAt: options?.updatedAt, | |
| 3511 | + manual: options?.manual | |
| 3512 | + }); | |
| 3513 | + return data; | |
| 3514 | + } | |
| 3515 | + setState(state, setStateOptions) { | |
| 3516 | + this.#dispatch({ type: "setState", state, setStateOptions }); | |
| 3517 | + } | |
| 3518 | + cancel(options) { | |
| 3519 | + const promise = this.#promise; | |
| 3520 | + this.#retryer?.cancel(options); | |
| 3521 | + return promise ? promise.then(import_utils.noop).catch(import_utils.noop) : Promise.resolve(); | |
| 3522 | + } | |
| 3523 | + destroy() { | |
| 3524 | + super.destroy(); | |
| 3525 | + this.cancel({ silent: true }); | |
| 3526 | + } | |
| 3527 | + reset() { | |
| 3528 | + this.destroy(); | |
| 3529 | + this.setState(this.#initialState); | |
| 3530 | + } | |
| 3531 | + isActive() { | |
| 3532 | + return this.#observers.some( | |
| 3533 | + (observer) => observer.options.enabled !== false | |
| 3534 | + ); | |
| 3535 | + } | |
| 3536 | + isDisabled() { | |
| 3537 | + return this.getObserversCount() > 0 && !this.isActive(); | |
| 3538 | + } | |
| 3539 | + isStale() { | |
| 3540 | + return this.state.isInvalidated || !this.state.dataUpdatedAt || this.#observers.some((observer) => observer.getCurrentResult().isStale); | |
| 3541 | + } | |
| 3542 | + isStaleByTime(staleTime = 0) { | |
| 3543 | + return this.state.isInvalidated || !this.state.dataUpdatedAt || !(0, import_utils.timeUntilStale)(this.state.dataUpdatedAt, staleTime); | |
| 3544 | + } | |
| 3545 | + onFocus() { | |
| 3546 | + const observer = this.#observers.find((x) => x.shouldFetchOnWindowFocus()); | |
| 3547 | + observer?.refetch({ cancelRefetch: false }); | |
| 3548 | + this.#retryer?.continue(); | |
| 3549 | + } | |
| 3550 | + onOnline() { | |
| 3551 | + const observer = this.#observers.find((x) => x.shouldFetchOnReconnect()); | |
| 3552 | + observer?.refetch({ cancelRefetch: false }); | |
| 3553 | + this.#retryer?.continue(); | |
| 3554 | + } | |
| 3555 | + addObserver(observer) { | |
| 3556 | + if (!this.#observers.includes(observer)) { | |
| 3557 | + this.#observers.push(observer); | |
| 3558 | + this.clearGcTimeout(); | |
| 3559 | + this.#cache.notify({ type: "observerAdded", query: this, observer }); | |
| 3560 | + } | |
| 3561 | + } | |
| 3562 | + removeObserver(observer) { | |
| 3563 | + if (this.#observers.includes(observer)) { | |
| 3564 | + this.#observers = this.#observers.filter((x) => x !== observer); | |
| 3565 | + if (!this.#observers.length) { | |
| 3566 | + if (this.#retryer) { | |
| 3567 | + if (this.#abortSignalConsumed) { | |
| 3568 | + this.#retryer.cancel({ revert: true }); | |
| 3569 | + } else { | |
| 3570 | + this.#retryer.cancelRetry(); | |
| 3571 | + } | |
| 3572 | + } | |
| 3573 | + this.scheduleGc(); | |
| 3574 | + } | |
| 3575 | + this.#cache.notify({ type: "observerRemoved", query: this, observer }); | |
| 3576 | + } | |
| 3577 | + } | |
| 3578 | + getObserversCount() { | |
| 3579 | + return this.#observers.length; | |
| 3580 | + } | |
| 3581 | + invalidate() { | |
| 3582 | + if (!this.state.isInvalidated) { | |
| 3583 | + this.#dispatch({ type: "invalidate" }); | |
| 3584 | + } | |
| 3585 | + } | |
| 3586 | + fetch(options, fetchOptions) { | |
| 3587 | + if (this.state.fetchStatus !== "idle") { | |
| 3588 | + if (this.state.dataUpdatedAt && fetchOptions?.cancelRefetch) { | |
| 3589 | + this.cancel({ silent: true }); | |
| 3590 | + } else if (this.#promise) { | |
| 3591 | + this.#retryer?.continueRetry(); | |
| 3592 | + return this.#promise; | |
| 3593 | + } | |
| 3594 | + } | |
| 3595 | + if (options) { | |
| 3596 | + this.#setOptions(options); | |
| 3597 | + } | |
| 3598 | + if (!this.options.queryFn) { | |
| 3599 | + const observer = this.#observers.find((x) => x.options.queryFn); | |
| 3600 | + if (observer) { | |
| 3601 | + this.#setOptions(observer.options); | |
| 3602 | + } | |
| 3603 | + } | |
| 3604 | + if (true) { | |
| 3605 | + if (!Array.isArray(this.options.queryKey)) { | |
| 3606 | + console.error( | |
| 3607 | + `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']` | |
| 3608 | + ); | |
| 3609 | + } | |
| 3610 | + } | |
| 3611 | + const abortController = new AbortController(); | |
| 3612 | + const queryFnContext = { | |
| 3613 | + queryKey: this.queryKey, | |
| 3614 | + meta: this.meta | |
| 3615 | + }; | |
| 3616 | + const addSignalProperty = (object) => { | |
| 3617 | + Object.defineProperty(object, "signal", { | |
| 3618 | + enumerable: true, | |
| 3619 | + get: () => { | |
| 3620 | + this.#abortSignalConsumed = true; | |
| 3621 | + return abortController.signal; | |
| 3622 | + } | |
| 3623 | + }); | |
| 3624 | + }; | |
| 3625 | + addSignalProperty(queryFnContext); | |
| 3626 | + const fetchFn = () => { | |
| 3627 | + if (!this.options.queryFn) { | |
| 3628 | + return Promise.reject( | |
| 3629 | + new Error(`Missing queryFn: '${this.options.queryHash}'`) | |
| 3630 | + ); | |
| 3631 | + } | |
| 3632 | + this.#abortSignalConsumed = false; | |
| 3633 | + if (this.options.persister) { | |
| 3634 | + return this.options.persister( | |
| 3635 | + this.options.queryFn, | |
| 3636 | + queryFnContext, | |
| 3637 | + this | |
| 3638 | + ); | |
| 3639 | + } | |
| 3640 | + return this.options.queryFn( | |
| 3641 | + queryFnContext | |
| 3642 | + ); | |
| 3643 | + }; | |
| 3644 | + const context = { | |
| 3645 | + fetchOptions, | |
| 3646 | + options: this.options, | |
| 3647 | + queryKey: this.queryKey, | |
| 3648 | + state: this.state, | |
| 3649 | + fetchFn | |
| 3650 | + }; | |
| 3651 | + addSignalProperty(context); | |
| 3652 | + this.options.behavior?.onFetch( | |
| 3653 | + context, | |
| 3654 | + this | |
| 3655 | + ); | |
| 3656 | + this.#revertState = this.state; | |
| 3657 | + if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== context.fetchOptions?.meta) { | |
| 3658 | + this.#dispatch({ type: "fetch", meta: context.fetchOptions?.meta }); | |
| 3659 | + } | |
| 3660 | + const onError = (error) => { | |
| 3661 | + if (!((0, import_retryer.isCancelledError)(error) && error.silent)) { | |
| 3662 | + this.#dispatch({ | |
| 3663 | + type: "error", | |
| 3664 | + error | |
| 3665 | + }); | |
| 3666 | + } | |
| 3667 | + if (!(0, import_retryer.isCancelledError)(error)) { | |
| 3668 | + this.#cache.config.onError?.( | |
| 3669 | + error, | |
| 3670 | + this | |
| 3671 | + ); | |
| 3672 | + this.#cache.config.onSettled?.( | |
| 3673 | + this.state.data, | |
| 3674 | + error, | |
| 3675 | + this | |
| 3676 | + ); | |
| 3677 | + } | |
| 3678 | + if (!this.isFetchingOptimistic) { | |
| 3679 | + this.scheduleGc(); | |
| 3680 | + } | |
| 3681 | + this.isFetchingOptimistic = false; | |
| 3682 | + }; | |
| 3683 | + this.#retryer = (0, import_retryer.createRetryer)({ | |
| 3684 | + fn: context.fetchFn, | |
| 3685 | + abort: abortController.abort.bind(abortController), | |
| 3686 | + onSuccess: (data) => { | |
| 3687 | + if (typeof data === "undefined") { | |
| 3688 | + if (true) { | |
| 3689 | + console.error( | |
| 3690 | + `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}` | |
| 3691 | + ); | |
| 3692 | + } | |
| 3693 | + onError(new Error(`${this.queryHash} data is undefined`)); | |
| 3694 | + return; | |
| 3695 | + } | |
| 3696 | + this.setData(data); | |
| 3697 | + this.#cache.config.onSuccess?.(data, this); | |
| 3698 | + this.#cache.config.onSettled?.( | |
| 3699 | + data, | |
| 3700 | + this.state.error, | |
| 3701 | + this | |
| 3702 | + ); | |
| 3703 | + if (!this.isFetchingOptimistic) { | |
| 3704 | + this.scheduleGc(); | |
| 3705 | + } | |
| 3706 | + this.isFetchingOptimistic = false; | |
| 3707 | + }, | |
| 3708 | + onError, | |
| 3709 | + onFail: (failureCount, error) => { | |
| 3710 | + this.#dispatch({ type: "failed", failureCount, error }); | |
| 3711 | + }, | |
| 3712 | + onPause: () => { | |
| 3713 | + this.#dispatch({ type: "pause" }); | |
| 3714 | + }, | |
| 3715 | + onContinue: () => { | |
| 3716 | + this.#dispatch({ type: "continue" }); | |
| 3717 | + }, | |
| 3718 | + retry: context.options.retry, | |
| 3719 | + retryDelay: context.options.retryDelay, | |
| 3720 | + networkMode: context.options.networkMode | |
| 3721 | + }); | |
| 3722 | + this.#promise = this.#retryer.promise; | |
| 3723 | + return this.#promise; | |
| 3724 | + } | |
| 3725 | + #dispatch(action) { | |
| 3726 | + const reducer = (state) => { | |
| 3727 | + switch (action.type) { | |
| 3728 | + case "failed": | |
| 3729 | + return { | |
| 3730 | + ...state, | |
| 3731 | + fetchFailureCount: action.failureCount, | |
| 3732 | + fetchFailureReason: action.error | |
| 3733 | + }; | |
| 3734 | + case "pause": | |
| 3735 | + return { | |
| 3736 | + ...state, | |
| 3737 | + fetchStatus: "paused" | |
| 3738 | + }; | |
| 3739 | + case "continue": | |
| 3740 | + return { | |
| 3741 | + ...state, | |
| 3742 | + fetchStatus: "fetching" | |
| 3743 | + }; | |
| 3744 | + case "fetch": | |
| 3745 | + return { | |
| 3746 | + ...state, | |
| 3747 | + fetchFailureCount: 0, | |
| 3748 | + fetchFailureReason: null, | |
| 3749 | + fetchMeta: action.meta ?? null, | |
| 3750 | + fetchStatus: (0, import_retryer.canFetch)(this.options.networkMode) ? "fetching" : "paused", | |
| 3751 | + ...!state.dataUpdatedAt && { | |
| 3752 | + error: null, | |
| 3753 | + status: "pending" | |
| 3754 | + } | |
| 3755 | + }; | |
| 3756 | + case "success": | |
| 3757 | + return { | |
| 3758 | + ...state, | |
| 3759 | + data: action.data, | |
| 3760 | + dataUpdateCount: state.dataUpdateCount + 1, | |
| 3761 | + dataUpdatedAt: action.dataUpdatedAt ?? Date.now(), | |
| 3762 | + error: null, | |
| 3763 | + isInvalidated: false, | |
| 3764 | + status: "success", | |
| 3765 | + ...!action.manual && { | |
| 3766 | + fetchStatus: "idle", | |
| 3767 | + fetchFailureCount: 0, | |
| 3768 | + fetchFailureReason: null | |
| 3769 | + } | |
| 3770 | + }; | |
| 3771 | + case "error": | |
| 3772 | + const error = action.error; | |
| 3773 | + if ((0, import_retryer.isCancelledError)(error) && error.revert && this.#revertState) { | |
| 3774 | + return { ...this.#revertState, fetchStatus: "idle" }; | |
| 3775 | + } | |
| 3776 | + return { | |
| 3777 | + ...state, | |
| 3778 | + error, | |
| 3779 | + errorUpdateCount: state.errorUpdateCount + 1, | |
| 3780 | + errorUpdatedAt: Date.now(), | |
| 3781 | + fetchFailureCount: state.fetchFailureCount + 1, | |
| 3782 | + fetchFailureReason: error, | |
| 3783 | + fetchStatus: "idle", | |
| 3784 | + status: "error" | |
| 3785 | + }; | |
| 3786 | + case "invalidate": | |
| 3787 | + return { | |
| 3788 | + ...state, | |
| 3789 | + isInvalidated: true | |
| 3790 | + }; | |
| 3791 | + case "setState": | |
| 3792 | + return { | |
| 3793 | + ...state, | |
| 3794 | + ...action.state | |
| 3795 | + }; | |
| 3796 | + } | |
| 3797 | + }; | |
| 3798 | + this.state = reducer(this.state); | |
| 3799 | + import_notifyManager.notifyManager.batch(() => { | |
| 3800 | + this.#observers.forEach((observer) => { | |
| 3801 | + observer.onQueryUpdate(); | |
| 3802 | + }); | |
| 3803 | + this.#cache.notify({ query: this, type: "updated", action }); | |
| 3804 | + }); | |
| 3805 | + } | |
| 3806 | +}; | |
| 3807 | +function getDefaultState(options) { | |
| 3808 | + const data = typeof options.initialData === "function" ? options.initialData() : options.initialData; | |
| 3809 | + const hasData = typeof data !== "undefined"; | |
| 3810 | + const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0; | |
| 3811 | + return { | |
| 3812 | + data, | |
| 3813 | + dataUpdateCount: 0, | |
| 3814 | + dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0, | |
| 3815 | + error: null, | |
| 3816 | + errorUpdateCount: 0, | |
| 3817 | + errorUpdatedAt: 0, | |
| 3818 | + fetchFailureCount: 0, | |
| 3819 | + fetchFailureReason: null, | |
| 3820 | + fetchMeta: null, | |
| 3821 | + isInvalidated: false, | |
| 3822 | + status: hasData ? "success" : "pending", | |
| 3823 | + fetchStatus: "idle" | |
| 3824 | + }; | |
| 3825 | +} | |
| 3826 | +// Annotate the CommonJS export names for ESM import in node: | |
| 3827 | +0 && (0); | |
| 3828 | +//# sourceMappingURL=query.cjs.map | |
| 3829 | + | |
| 3830 | +/***/ }), | |
| 3831 | + | |
| 3832 | +/***/ "../node_modules/@tanstack/query-core/build/modern/queryCache.cjs": | |
| 3833 | +/*!************************************************************************!*\ | |
| 3834 | + !*** ../node_modules/@tanstack/query-core/build/modern/queryCache.cjs ***! | |
| 3835 | + \************************************************************************/ | |
| 3836 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 3837 | + | |
| 3838 | +"use strict"; | |
| 3839 | + | |
| 3840 | +var __defProp = Object.defineProperty; | |
| 3841 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 3842 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 3843 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 3844 | +var __export = (target, all) => { | |
| 3845 | + for (var name in all) | |
| 3846 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 3847 | +}; | |
| 3848 | +var __copyProps = (to, from, except, desc) => { | |
| 3849 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 3850 | + for (let key of __getOwnPropNames(from)) | |
| 3851 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 3852 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 3853 | + } | |
| 3854 | + return to; | |
| 3855 | +}; | |
| 3856 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 3857 | + | |
| 3858 | +// src/queryCache.ts | |
| 3859 | +var queryCache_exports = {}; | |
| 3860 | +__export(queryCache_exports, { | |
| 3861 | + QueryCache: () => QueryCache | |
| 3862 | +}); | |
| 3863 | +module.exports = __toCommonJS(queryCache_exports); | |
| 3864 | +var import_utils = __webpack_require__(/*! ./utils.cjs */ "../node_modules/@tanstack/query-core/build/modern/utils.cjs"); | |
| 3865 | +var import_query = __webpack_require__(/*! ./query.cjs */ "../node_modules/@tanstack/query-core/build/modern/query.cjs"); | |
| 3866 | +var import_notifyManager = __webpack_require__(/*! ./notifyManager.cjs */ "../node_modules/@tanstack/query-core/build/modern/notifyManager.cjs"); | |
| 3867 | +var import_subscribable = __webpack_require__(/*! ./subscribable.cjs */ "../node_modules/@tanstack/query-core/build/modern/subscribable.cjs"); | |
| 3868 | +var QueryCache = class extends import_subscribable.Subscribable { | |
| 3869 | + constructor(config = {}) { | |
| 3870 | + super(); | |
| 3871 | + this.config = config; | |
| 3872 | + this.#queries = /* @__PURE__ */ new Map(); | |
| 3873 | + } | |
| 3874 | + #queries; | |
| 3875 | + build(client, options, state) { | |
| 3876 | + const queryKey = options.queryKey; | |
| 3877 | + const queryHash = options.queryHash ?? (0, import_utils.hashQueryKeyByOptions)(queryKey, options); | |
| 3878 | + let query = this.get(queryHash); | |
| 3879 | + if (!query) { | |
| 3880 | + query = new import_query.Query({ | |
| 3881 | + cache: this, | |
| 3882 | + queryKey, | |
| 3883 | + queryHash, | |
| 3884 | + options: client.defaultQueryOptions(options), | |
| 3885 | + state, | |
| 3886 | + defaultOptions: client.getQueryDefaults(queryKey) | |
| 3887 | + }); | |
| 3888 | + this.add(query); | |
| 3889 | + } | |
| 3890 | + return query; | |
| 3891 | + } | |
| 3892 | + add(query) { | |
| 3893 | + if (!this.#queries.has(query.queryHash)) { | |
| 3894 | + this.#queries.set(query.queryHash, query); | |
| 3895 | + this.notify({ | |
| 3896 | + type: "added", | |
| 3897 | + query | |
| 3898 | + }); | |
| 3899 | + } | |
| 3900 | + } | |
| 3901 | + remove(query) { | |
| 3902 | + const queryInMap = this.#queries.get(query.queryHash); | |
| 3903 | + if (queryInMap) { | |
| 3904 | + query.destroy(); | |
| 3905 | + if (queryInMap === query) { | |
| 3906 | + this.#queries.delete(query.queryHash); | |
| 3907 | + } | |
| 3908 | + this.notify({ type: "removed", query }); | |
| 3909 | + } | |
| 3910 | + } | |
| 3911 | + clear() { | |
| 3912 | + import_notifyManager.notifyManager.batch(() => { | |
| 3913 | + this.getAll().forEach((query) => { | |
| 3914 | + this.remove(query); | |
| 3915 | + }); | |
| 3916 | + }); | |
| 3917 | + } | |
| 3918 | + get(queryHash) { | |
| 3919 | + return this.#queries.get(queryHash); | |
| 3920 | + } | |
| 3921 | + getAll() { | |
| 3922 | + return [...this.#queries.values()]; | |
| 3923 | + } | |
| 3924 | + find(filters) { | |
| 3925 | + const defaultedFilters = { exact: true, ...filters }; | |
| 3926 | + return this.getAll().find( | |
| 3927 | + (query) => (0, import_utils.matchQuery)(defaultedFilters, query) | |
| 3928 | + ); | |
| 3929 | + } | |
| 3930 | + findAll(filters = {}) { | |
| 3931 | + const queries = this.getAll(); | |
| 3932 | + return Object.keys(filters).length > 0 ? queries.filter((query) => (0, import_utils.matchQuery)(filters, query)) : queries; | |
| 3933 | + } | |
| 3934 | + notify(event) { | |
| 3935 | + import_notifyManager.notifyManager.batch(() => { | |
| 3936 | + this.listeners.forEach((listener) => { | |
| 3937 | + listener(event); | |
| 3938 | + }); | |
| 3939 | + }); | |
| 3940 | + } | |
| 3941 | + onFocus() { | |
| 3942 | + import_notifyManager.notifyManager.batch(() => { | |
| 3943 | + this.getAll().forEach((query) => { | |
| 3944 | + query.onFocus(); | |
| 3945 | + }); | |
| 3946 | + }); | |
| 3947 | + } | |
| 3948 | + onOnline() { | |
| 3949 | + import_notifyManager.notifyManager.batch(() => { | |
| 3950 | + this.getAll().forEach((query) => { | |
| 3951 | + query.onOnline(); | |
| 3952 | + }); | |
| 3953 | + }); | |
| 3954 | + } | |
| 3955 | +}; | |
| 3956 | +// Annotate the CommonJS export names for ESM import in node: | |
| 3957 | +0 && (0); | |
| 3958 | +//# sourceMappingURL=queryCache.cjs.map | |
| 3959 | + | |
| 3960 | +/***/ }), | |
| 3961 | + | |
| 3962 | +/***/ "../node_modules/@tanstack/query-core/build/modern/queryClient.cjs": | |
| 3963 | +/*!*************************************************************************!*\ | |
| 3964 | + !*** ../node_modules/@tanstack/query-core/build/modern/queryClient.cjs ***! | |
| 3965 | + \*************************************************************************/ | |
| 3966 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 3967 | + | |
| 3968 | +"use strict"; | |
| 3969 | + | |
| 3970 | +var __defProp = Object.defineProperty; | |
| 3971 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 3972 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 3973 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 3974 | +var __export = (target, all) => { | |
| 3975 | + for (var name in all) | |
| 3976 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 3977 | +}; | |
| 3978 | +var __copyProps = (to, from, except, desc) => { | |
| 3979 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 3980 | + for (let key of __getOwnPropNames(from)) | |
| 3981 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 3982 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 3983 | + } | |
| 3984 | + return to; | |
| 3985 | +}; | |
| 3986 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 3987 | + | |
| 3988 | +// src/queryClient.ts | |
| 3989 | +var queryClient_exports = {}; | |
| 3990 | +__export(queryClient_exports, { | |
| 3991 | + QueryClient: () => QueryClient | |
| 3992 | +}); | |
| 3993 | +module.exports = __toCommonJS(queryClient_exports); | |
| 3994 | +var import_utils = __webpack_require__(/*! ./utils.cjs */ "../node_modules/@tanstack/query-core/build/modern/utils.cjs"); | |
| 3995 | +var import_queryCache = __webpack_require__(/*! ./queryCache.cjs */ "../node_modules/@tanstack/query-core/build/modern/queryCache.cjs"); | |
| 3996 | +var import_mutationCache = __webpack_require__(/*! ./mutationCache.cjs */ "../node_modules/@tanstack/query-core/build/modern/mutationCache.cjs"); | |
| 3997 | +var import_focusManager = __webpack_require__(/*! ./focusManager.cjs */ "../node_modules/@tanstack/query-core/build/modern/focusManager.cjs"); | |
| 3998 | +var import_onlineManager = __webpack_require__(/*! ./onlineManager.cjs */ "../node_modules/@tanstack/query-core/build/modern/onlineManager.cjs"); | |
| 3999 | +var import_notifyManager = __webpack_require__(/*! ./notifyManager.cjs */ "../node_modules/@tanstack/query-core/build/modern/notifyManager.cjs"); | |
| 4000 | +var import_infiniteQueryBehavior = __webpack_require__(/*! ./infiniteQueryBehavior.cjs */ "../node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs"); | |
| 4001 | +var QueryClient = class { | |
| 4002 | + #queryCache; | |
| 4003 | + #mutationCache; | |
| 4004 | + #defaultOptions; | |
| 4005 | + #queryDefaults; | |
| 4006 | + #mutationDefaults; | |
| 4007 | + #mountCount; | |
| 4008 | + #unsubscribeFocus; | |
| 4009 | + #unsubscribeOnline; | |
| 4010 | + constructor(config = {}) { | |
| 4011 | + this.#queryCache = config.queryCache || new import_queryCache.QueryCache(); | |
| 4012 | + this.#mutationCache = config.mutationCache || new import_mutationCache.MutationCache(); | |
| 4013 | + this.#defaultOptions = config.defaultOptions || {}; | |
| 4014 | + this.#queryDefaults = /* @__PURE__ */ new Map(); | |
| 4015 | + this.#mutationDefaults = /* @__PURE__ */ new Map(); | |
| 4016 | + this.#mountCount = 0; | |
| 4017 | + } | |
| 4018 | + mount() { | |
| 4019 | + this.#mountCount++; | |
| 4020 | + if (this.#mountCount !== 1) | |
| 4021 | + return; | |
| 4022 | + this.#unsubscribeFocus = import_focusManager.focusManager.subscribe(() => { | |
| 4023 | + if (import_focusManager.focusManager.isFocused()) { | |
| 4024 | + this.resumePausedMutations(); | |
| 4025 | + this.#queryCache.onFocus(); | |
| 4026 | + } | |
| 4027 | + }); | |
| 4028 | + this.#unsubscribeOnline = import_onlineManager.onlineManager.subscribe(() => { | |
| 4029 | + if (import_onlineManager.onlineManager.isOnline()) { | |
| 4030 | + this.resumePausedMutations(); | |
| 4031 | + this.#queryCache.onOnline(); | |
| 4032 | + } | |
| 4033 | + }); | |
| 4034 | + } | |
| 4035 | + unmount() { | |
| 4036 | + this.#mountCount--; | |
| 4037 | + if (this.#mountCount !== 0) | |
| 4038 | + return; | |
| 4039 | + this.#unsubscribeFocus?.(); | |
| 4040 | + this.#unsubscribeFocus = void 0; | |
| 4041 | + this.#unsubscribeOnline?.(); | |
| 4042 | + this.#unsubscribeOnline = void 0; | |
| 4043 | + } | |
| 4044 | + isFetching(filters) { | |
| 4045 | + return this.#queryCache.findAll({ ...filters, fetchStatus: "fetching" }).length; | |
| 4046 | + } | |
| 4047 | + isMutating(filters) { | |
| 4048 | + return this.#mutationCache.findAll({ ...filters, status: "pending" }).length; | |
| 4049 | + } | |
| 4050 | + getQueryData(queryKey) { | |
| 4051 | + return this.#queryCache.find({ queryKey })?.state.data; | |
| 4052 | + } | |
| 4053 | + ensureQueryData(options) { | |
| 4054 | + const cachedData = this.getQueryData(options.queryKey); | |
| 4055 | + return cachedData !== void 0 ? Promise.resolve(cachedData) : this.fetchQuery(options); | |
| 4056 | + } | |
| 4057 | + getQueriesData(filters) { | |
| 4058 | + return this.getQueryCache().findAll(filters).map(({ queryKey, state }) => { | |
| 4059 | + const data = state.data; | |
| 4060 | + return [queryKey, data]; | |
| 4061 | + }); | |
| 4062 | + } | |
| 4063 | + setQueryData(queryKey, updater, options) { | |
| 4064 | + const query = this.#queryCache.find({ queryKey }); | |
| 4065 | + const prevData = query?.state.data; | |
| 4066 | + const data = (0, import_utils.functionalUpdate)(updater, prevData); | |
| 4067 | + if (typeof data === "undefined") { | |
| 4068 | + return void 0; | |
| 4069 | + } | |
| 4070 | + const defaultedOptions = this.defaultQueryOptions({ queryKey }); | |
| 4071 | + return this.#queryCache.build(this, defaultedOptions).setData(data, { ...options, manual: true }); | |
| 4072 | + } | |
| 4073 | + setQueriesData(filters, updater, options) { | |
| 4074 | + return import_notifyManager.notifyManager.batch( | |
| 4075 | + () => this.getQueryCache().findAll(filters).map(({ queryKey }) => [ | |
| 4076 | + queryKey, | |
| 4077 | + this.setQueryData(queryKey, updater, options) | |
| 4078 | + ]) | |
| 4079 | + ); | |
| 4080 | + } | |
| 4081 | + getQueryState(queryKey) { | |
| 4082 | + return this.#queryCache.find({ queryKey })?.state; | |
| 4083 | + } | |
| 4084 | + removeQueries(filters) { | |
| 4085 | + const queryCache = this.#queryCache; | |
| 4086 | + import_notifyManager.notifyManager.batch(() => { | |
| 4087 | + queryCache.findAll(filters).forEach((query) => { | |
| 4088 | + queryCache.remove(query); | |
| 4089 | + }); | |
| 4090 | + }); | |
| 4091 | + } | |
| 4092 | + resetQueries(filters, options) { | |
| 4093 | + const queryCache = this.#queryCache; | |
| 4094 | + const refetchFilters = { | |
| 4095 | + type: "active", | |
| 4096 | + ...filters | |
| 4097 | + }; | |
| 4098 | + return import_notifyManager.notifyManager.batch(() => { | |
| 4099 | + queryCache.findAll(filters).forEach((query) => { | |
| 4100 | + query.reset(); | |
| 4101 | + }); | |
| 4102 | + return this.refetchQueries(refetchFilters, options); | |
| 4103 | + }); | |
| 4104 | + } | |
| 4105 | + cancelQueries(filters = {}, cancelOptions = {}) { | |
| 4106 | + const defaultedCancelOptions = { revert: true, ...cancelOptions }; | |
| 4107 | + const promises = import_notifyManager.notifyManager.batch( | |
| 4108 | + () => this.#queryCache.findAll(filters).map((query) => query.cancel(defaultedCancelOptions)) | |
| 4109 | + ); | |
| 4110 | + return Promise.all(promises).then(import_utils.noop).catch(import_utils.noop); | |
| 4111 | + } | |
| 4112 | + invalidateQueries(filters = {}, options = {}) { | |
| 4113 | + return import_notifyManager.notifyManager.batch(() => { | |
| 4114 | + this.#queryCache.findAll(filters).forEach((query) => { | |
| 4115 | + query.invalidate(); | |
| 4116 | + }); | |
| 4117 | + if (filters.refetchType === "none") { | |
| 4118 | + return Promise.resolve(); | |
| 4119 | + } | |
| 4120 | + const refetchFilters = { | |
| 4121 | + ...filters, | |
| 4122 | + type: filters.refetchType ?? filters.type ?? "active" | |
| 4123 | + }; | |
| 4124 | + return this.refetchQueries(refetchFilters, options); | |
| 4125 | + }); | |
| 4126 | + } | |
| 4127 | + refetchQueries(filters = {}, options) { | |
| 4128 | + const fetchOptions = { | |
| 4129 | + ...options, | |
| 4130 | + cancelRefetch: options?.cancelRefetch ?? true | |
| 4131 | + }; | |
| 4132 | + const promises = import_notifyManager.notifyManager.batch( | |
| 4133 | + () => this.#queryCache.findAll(filters).filter((query) => !query.isDisabled()).map((query) => { | |
| 4134 | + let promise = query.fetch(void 0, fetchOptions); | |
| 4135 | + if (!fetchOptions.throwOnError) { | |
| 4136 | + promise = promise.catch(import_utils.noop); | |
| 4137 | + } | |
| 4138 | + return query.state.fetchStatus === "paused" ? Promise.resolve() : promise; | |
| 4139 | + }) | |
| 4140 | + ); | |
| 4141 | + return Promise.all(promises).then(import_utils.noop); | |
| 4142 | + } | |
| 4143 | + fetchQuery(options) { | |
| 4144 | + const defaultedOptions = this.defaultQueryOptions(options); | |
| 4145 | + if (typeof defaultedOptions.retry === "undefined") { | |
| 4146 | + defaultedOptions.retry = false; | |
| 4147 | + } | |
| 4148 | + const query = this.#queryCache.build(this, defaultedOptions); | |
| 4149 | + return query.isStaleByTime(defaultedOptions.staleTime) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data); | |
| 4150 | + } | |
| 4151 | + prefetchQuery(options) { | |
| 4152 | + return this.fetchQuery(options).then(import_utils.noop).catch(import_utils.noop); | |
| 4153 | + } | |
| 4154 | + fetchInfiniteQuery(options) { | |
| 4155 | + options.behavior = (0, import_infiniteQueryBehavior.infiniteQueryBehavior)(options.pages); | |
| 4156 | + return this.fetchQuery(options); | |
| 4157 | + } | |
| 4158 | + prefetchInfiniteQuery(options) { | |
| 4159 | + return this.fetchInfiniteQuery(options).then(import_utils.noop).catch(import_utils.noop); | |
| 4160 | + } | |
| 4161 | + resumePausedMutations() { | |
| 4162 | + return this.#mutationCache.resumePausedMutations(); | |
| 4163 | + } | |
| 4164 | + getQueryCache() { | |
| 4165 | + return this.#queryCache; | |
| 4166 | + } | |
| 4167 | + getMutationCache() { | |
| 4168 | + return this.#mutationCache; | |
| 4169 | + } | |
| 4170 | + getDefaultOptions() { | |
| 4171 | + return this.#defaultOptions; | |
| 4172 | + } | |
| 4173 | + setDefaultOptions(options) { | |
| 4174 | + this.#defaultOptions = options; | |
| 4175 | + } | |
| 4176 | + setQueryDefaults(queryKey, options) { | |
| 4177 | + this.#queryDefaults.set((0, import_utils.hashKey)(queryKey), { | |
| 4178 | + queryKey, | |
| 4179 | + defaultOptions: options | |
| 4180 | + }); | |
| 4181 | + } | |
| 4182 | + getQueryDefaults(queryKey) { | |
| 4183 | + const defaults = [...this.#queryDefaults.values()]; | |
| 4184 | + let result = {}; | |
| 4185 | + defaults.forEach((queryDefault) => { | |
| 4186 | + if ((0, import_utils.partialMatchKey)(queryKey, queryDefault.queryKey)) { | |
| 4187 | + result = { ...result, ...queryDefault.defaultOptions }; | |
| 4188 | + } | |
| 4189 | + }); | |
| 4190 | + return result; | |
| 4191 | + } | |
| 4192 | + setMutationDefaults(mutationKey, options) { | |
| 4193 | + this.#mutationDefaults.set((0, import_utils.hashKey)(mutationKey), { | |
| 4194 | + mutationKey, | |
| 4195 | + defaultOptions: options | |
| 4196 | + }); | |
| 4197 | + } | |
| 4198 | + getMutationDefaults(mutationKey) { | |
| 4199 | + const defaults = [...this.#mutationDefaults.values()]; | |
| 4200 | + let result = {}; | |
| 4201 | + defaults.forEach((queryDefault) => { | |
| 4202 | + if ((0, import_utils.partialMatchKey)(mutationKey, queryDefault.mutationKey)) { | |
| 4203 | + result = { ...result, ...queryDefault.defaultOptions }; | |
| 4204 | + } | |
| 4205 | + }); | |
| 4206 | + return result; | |
| 4207 | + } | |
| 4208 | + defaultQueryOptions(options) { | |
| 4209 | + if (options?._defaulted) { | |
| 4210 | + return options; | |
| 4211 | + } | |
| 4212 | + const defaultedOptions = { | |
| 4213 | + ...this.#defaultOptions.queries, | |
| 4214 | + ...options?.queryKey && this.getQueryDefaults(options.queryKey), | |
| 4215 | + ...options, | |
| 4216 | + _defaulted: true | |
| 4217 | + }; | |
| 4218 | + if (!defaultedOptions.queryHash) { | |
| 4219 | + defaultedOptions.queryHash = (0, import_utils.hashQueryKeyByOptions)( | |
| 4220 | + defaultedOptions.queryKey, | |
| 4221 | + defaultedOptions | |
| 4222 | + ); | |
| 4223 | + } | |
| 4224 | + if (typeof defaultedOptions.refetchOnReconnect === "undefined") { | |
| 4225 | + defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always"; | |
| 4226 | + } | |
| 4227 | + if (typeof defaultedOptions.throwOnError === "undefined") { | |
| 4228 | + defaultedOptions.throwOnError = !!defaultedOptions.suspense; | |
| 4229 | + } | |
| 4230 | + if (typeof defaultedOptions.networkMode === "undefined" && defaultedOptions.persister) { | |
| 4231 | + defaultedOptions.networkMode = "offlineFirst"; | |
| 4232 | + } | |
| 4233 | + return defaultedOptions; | |
| 4234 | + } | |
| 4235 | + defaultMutationOptions(options) { | |
| 4236 | + if (options?._defaulted) { | |
| 4237 | + return options; | |
| 4238 | + } | |
| 4239 | + return { | |
| 4240 | + ...this.#defaultOptions.mutations, | |
| 4241 | + ...options?.mutationKey && this.getMutationDefaults(options.mutationKey), | |
| 4242 | + ...options, | |
| 4243 | + _defaulted: true | |
| 4244 | + }; | |
| 4245 | + } | |
| 4246 | + clear() { | |
| 4247 | + this.#queryCache.clear(); | |
| 4248 | + this.#mutationCache.clear(); | |
| 4249 | + } | |
| 4250 | +}; | |
| 4251 | +// Annotate the CommonJS export names for ESM import in node: | |
| 4252 | +0 && (0); | |
| 4253 | +//# sourceMappingURL=queryClient.cjs.map | |
| 4254 | + | |
| 4255 | +/***/ }), | |
| 4256 | + | |
| 4257 | +/***/ "../node_modules/@tanstack/query-core/build/modern/queryObserver.cjs": | |
| 4258 | +/*!***************************************************************************!*\ | |
| 4259 | + !*** ../node_modules/@tanstack/query-core/build/modern/queryObserver.cjs ***! | |
| 4260 | + \***************************************************************************/ | |
| 4261 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 4262 | + | |
| 4263 | +"use strict"; | |
| 4264 | + | |
| 4265 | +var __defProp = Object.defineProperty; | |
| 4266 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 4267 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 4268 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 4269 | +var __export = (target, all) => { | |
| 4270 | + for (var name in all) | |
| 4271 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 4272 | +}; | |
| 4273 | +var __copyProps = (to, from, except, desc) => { | |
| 4274 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 4275 | + for (let key of __getOwnPropNames(from)) | |
| 4276 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 4277 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 4278 | + } | |
| 4279 | + return to; | |
| 4280 | +}; | |
| 4281 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 4282 | + | |
| 4283 | +// src/queryObserver.ts | |
| 4284 | +var queryObserver_exports = {}; | |
| 4285 | +__export(queryObserver_exports, { | |
| 4286 | + QueryObserver: () => QueryObserver | |
| 4287 | +}); | |
| 4288 | +module.exports = __toCommonJS(queryObserver_exports); | |
| 4289 | +var import_utils = __webpack_require__(/*! ./utils.cjs */ "../node_modules/@tanstack/query-core/build/modern/utils.cjs"); | |
| 4290 | +var import_notifyManager = __webpack_require__(/*! ./notifyManager.cjs */ "../node_modules/@tanstack/query-core/build/modern/notifyManager.cjs"); | |
| 4291 | +var import_focusManager = __webpack_require__(/*! ./focusManager.cjs */ "../node_modules/@tanstack/query-core/build/modern/focusManager.cjs"); | |
| 4292 | +var import_subscribable = __webpack_require__(/*! ./subscribable.cjs */ "../node_modules/@tanstack/query-core/build/modern/subscribable.cjs"); | |
| 4293 | +var import_retryer = __webpack_require__(/*! ./retryer.cjs */ "../node_modules/@tanstack/query-core/build/modern/retryer.cjs"); | |
| 4294 | +var QueryObserver = class extends import_subscribable.Subscribable { | |
| 4295 | + constructor(client, options) { | |
| 4296 | + super(); | |
| 4297 | + this.#currentQuery = void 0; | |
| 4298 | + this.#currentQueryInitialState = void 0; | |
| 4299 | + this.#currentResult = void 0; | |
| 4300 | + this.#trackedProps = /* @__PURE__ */ new Set(); | |
| 4301 | + this.#client = client; | |
| 4302 | + this.options = options; | |
| 4303 | + this.#selectError = null; | |
| 4304 | + this.bindMethods(); | |
| 4305 | + this.setOptions(options); | |
| 4306 | + } | |
| 4307 | + #client; | |
| 4308 | + #currentQuery; | |
| 4309 | + #currentQueryInitialState; | |
| 4310 | + #currentResult; | |
| 4311 | + #currentResultState; | |
| 4312 | + #currentResultOptions; | |
| 4313 | + #selectError; | |
| 4314 | + #selectFn; | |
| 4315 | + #selectResult; | |
| 4316 | + // This property keeps track of the last query with defined data. | |
| 4317 | + // It will be used to pass the previous data and query to the placeholder function between renders. | |
| 4318 | + #lastQueryWithDefinedData; | |
| 4319 | + #staleTimeoutId; | |
| 4320 | + #refetchIntervalId; | |
| 4321 | + #currentRefetchInterval; | |
| 4322 | + #trackedProps; | |
| 4323 | + bindMethods() { | |
| 4324 | + this.refetch = this.refetch.bind(this); | |
| 4325 | + } | |
| 4326 | + onSubscribe() { | |
| 4327 | + if (this.listeners.size === 1) { | |
| 4328 | + this.#currentQuery.addObserver(this); | |
| 4329 | + if (shouldFetchOnMount(this.#currentQuery, this.options)) { | |
| 4330 | + this.#executeFetch(); | |
| 4331 | + } | |
| 4332 | + this.#updateTimers(); | |
| 4333 | + } | |
| 4334 | + } | |
| 4335 | + onUnsubscribe() { | |
| 4336 | + if (!this.hasListeners()) { | |
| 4337 | + this.destroy(); | |
| 4338 | + } | |
| 4339 | + } | |
| 4340 | + shouldFetchOnReconnect() { | |
| 4341 | + return shouldFetchOn( | |
| 4342 | + this.#currentQuery, | |
| 4343 | + this.options, | |
| 4344 | + this.options.refetchOnReconnect | |
| 4345 | + ); | |
| 4346 | + } | |
| 4347 | + shouldFetchOnWindowFocus() { | |
| 4348 | + return shouldFetchOn( | |
| 4349 | + this.#currentQuery, | |
| 4350 | + this.options, | |
| 4351 | + this.options.refetchOnWindowFocus | |
| 4352 | + ); | |
| 4353 | + } | |
| 4354 | + destroy() { | |
| 4355 | + this.listeners = /* @__PURE__ */ new Set(); | |
| 4356 | + this.#clearStaleTimeout(); | |
| 4357 | + this.#clearRefetchInterval(); | |
| 4358 | + this.#currentQuery.removeObserver(this); | |
| 4359 | + } | |
| 4360 | + setOptions(options, notifyOptions) { | |
| 4361 | + const prevOptions = this.options; | |
| 4362 | + const prevQuery = this.#currentQuery; | |
| 4363 | + this.options = this.#client.defaultQueryOptions(options); | |
| 4364 | + if (!(0, import_utils.shallowEqualObjects)(prevOptions, this.options)) { | |
| 4365 | + this.#client.getQueryCache().notify({ | |
| 4366 | + type: "observerOptionsUpdated", | |
| 4367 | + query: this.#currentQuery, | |
| 4368 | + observer: this | |
| 4369 | + }); | |
| 4370 | + } | |
| 4371 | + if (typeof this.options.enabled !== "undefined" && typeof this.options.enabled !== "boolean") { | |
| 4372 | + throw new Error("Expected enabled to be a boolean"); | |
| 4373 | + } | |
| 4374 | + if (!this.options.queryKey) { | |
| 4375 | + this.options.queryKey = prevOptions.queryKey; | |
| 4376 | + } | |
| 4377 | + this.#updateQuery(); | |
| 4378 | + const mounted = this.hasListeners(); | |
| 4379 | + if (mounted && shouldFetchOptionally( | |
| 4380 | + this.#currentQuery, | |
| 4381 | + prevQuery, | |
| 4382 | + this.options, | |
| 4383 | + prevOptions | |
| 4384 | + )) { | |
| 4385 | + this.#executeFetch(); | |
| 4386 | + } | |
| 4387 | + this.updateResult(notifyOptions); | |
| 4388 | + if (mounted && (this.#currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || this.options.staleTime !== prevOptions.staleTime)) { | |
| 4389 | + this.#updateStaleTimeout(); | |
| 4390 | + } | |
| 4391 | + const nextRefetchInterval = this.#computeRefetchInterval(); | |
| 4392 | + if (mounted && (this.#currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || nextRefetchInterval !== this.#currentRefetchInterval)) { | |
| 4393 | + this.#updateRefetchInterval(nextRefetchInterval); | |
| 4394 | + } | |
| 4395 | + } | |
| 4396 | + getOptimisticResult(options) { | |
| 4397 | + const query = this.#client.getQueryCache().build(this.#client, options); | |
| 4398 | + const result = this.createResult(query, options); | |
| 4399 | + if (shouldAssignObserverCurrentProperties(this, result)) { | |
| 4400 | + this.#currentResult = result; | |
| 4401 | + this.#currentResultOptions = this.options; | |
| 4402 | + this.#currentResultState = this.#currentQuery.state; | |
| 4403 | + } | |
| 4404 | + return result; | |
| 4405 | + } | |
| 4406 | + getCurrentResult() { | |
| 4407 | + return this.#currentResult; | |
| 4408 | + } | |
| 4409 | + trackResult(result) { | |
| 4410 | + const trackedResult = {}; | |
| 4411 | + Object.keys(result).forEach((key) => { | |
| 4412 | + Object.defineProperty(trackedResult, key, { | |
| 4413 | + configurable: false, | |
| 4414 | + enumerable: true, | |
| 4415 | + get: () => { | |
| 4416 | + this.#trackedProps.add(key); | |
| 4417 | + return result[key]; | |
| 4418 | + } | |
| 4419 | + }); | |
| 4420 | + }); | |
| 4421 | + return trackedResult; | |
| 4422 | + } | |
| 4423 | + getCurrentQuery() { | |
| 4424 | + return this.#currentQuery; | |
| 4425 | + } | |
| 4426 | + refetch({ ...options } = {}) { | |
| 4427 | + return this.fetch({ | |
| 4428 | + ...options | |
| 4429 | + }); | |
| 4430 | + } | |
| 4431 | + fetchOptimistic(options) { | |
| 4432 | + const defaultedOptions = this.#client.defaultQueryOptions(options); | |
| 4433 | + const query = this.#client.getQueryCache().build(this.#client, defaultedOptions); | |
| 4434 | + query.isFetchingOptimistic = true; | |
| 4435 | + return query.fetch().then(() => this.createResult(query, defaultedOptions)); | |
| 4436 | + } | |
| 4437 | + fetch(fetchOptions) { | |
| 4438 | + return this.#executeFetch({ | |
| 4439 | + ...fetchOptions, | |
| 4440 | + cancelRefetch: fetchOptions.cancelRefetch ?? true | |
| 4441 | + }).then(() => { | |
| 4442 | + this.updateResult(); | |
| 4443 | + return this.#currentResult; | |
| 4444 | + }); | |
| 4445 | + } | |
| 4446 | + #executeFetch(fetchOptions) { | |
| 4447 | + this.#updateQuery(); | |
| 4448 | + let promise = this.#currentQuery.fetch( | |
| 4449 | + this.options, | |
| 4450 | + fetchOptions | |
| 4451 | + ); | |
| 4452 | + if (!fetchOptions?.throwOnError) { | |
| 4453 | + promise = promise.catch(import_utils.noop); | |
| 4454 | + } | |
| 4455 | + return promise; | |
| 4456 | + } | |
| 4457 | + #updateStaleTimeout() { | |
| 4458 | + this.#clearStaleTimeout(); | |
| 4459 | + if (import_utils.isServer || this.#currentResult.isStale || !(0, import_utils.isValidTimeout)(this.options.staleTime)) { | |
| 4460 | + return; | |
| 4461 | + } | |
| 4462 | + const time = (0, import_utils.timeUntilStale)( | |
| 4463 | + this.#currentResult.dataUpdatedAt, | |
| 4464 | + this.options.staleTime | |
| 4465 | + ); | |
| 4466 | + const timeout = time + 1; | |
| 4467 | + this.#staleTimeoutId = setTimeout(() => { | |
| 4468 | + if (!this.#currentResult.isStale) { | |
| 4469 | + this.updateResult(); | |
| 4470 | + } | |
| 4471 | + }, timeout); | |
| 4472 | + } | |
| 4473 | + #computeRefetchInterval() { | |
| 4474 | + return (typeof this.options.refetchInterval === "function" ? this.options.refetchInterval(this.#currentQuery) : this.options.refetchInterval) ?? false; | |
| 4475 | + } | |
| 4476 | + #updateRefetchInterval(nextInterval) { | |
| 4477 | + this.#clearRefetchInterval(); | |
| 4478 | + this.#currentRefetchInterval = nextInterval; | |
| 4479 | + if (import_utils.isServer || this.options.enabled === false || !(0, import_utils.isValidTimeout)(this.#currentRefetchInterval) || this.#currentRefetchInterval === 0) { | |
| 4480 | + return; | |
| 4481 | + } | |
| 4482 | + this.#refetchIntervalId = setInterval(() => { | |
| 4483 | + if (this.options.refetchIntervalInBackground || import_focusManager.focusManager.isFocused()) { | |
| 4484 | + this.#executeFetch(); | |
| 4485 | + } | |
| 4486 | + }, this.#currentRefetchInterval); | |
| 4487 | + } | |
| 4488 | + #updateTimers() { | |
| 4489 | + this.#updateStaleTimeout(); | |
| 4490 | + this.#updateRefetchInterval(this.#computeRefetchInterval()); | |
| 4491 | + } | |
| 4492 | + #clearStaleTimeout() { | |
| 4493 | + if (this.#staleTimeoutId) { | |
| 4494 | + clearTimeout(this.#staleTimeoutId); | |
| 4495 | + this.#staleTimeoutId = void 0; | |
| 4496 | + } | |
| 4497 | + } | |
| 4498 | + #clearRefetchInterval() { | |
| 4499 | + if (this.#refetchIntervalId) { | |
| 4500 | + clearInterval(this.#refetchIntervalId); | |
| 4501 | + this.#refetchIntervalId = void 0; | |
| 4502 | + } | |
| 4503 | + } | |
| 4504 | + createResult(query, options) { | |
| 4505 | + const prevQuery = this.#currentQuery; | |
| 4506 | + const prevOptions = this.options; | |
| 4507 | + const prevResult = this.#currentResult; | |
| 4508 | + const prevResultState = this.#currentResultState; | |
| 4509 | + const prevResultOptions = this.#currentResultOptions; | |
| 4510 | + const queryChange = query !== prevQuery; | |
| 4511 | + const queryInitialState = queryChange ? query.state : this.#currentQueryInitialState; | |
| 4512 | + const { state } = query; | |
| 4513 | + let { error, errorUpdatedAt, fetchStatus, status } = state; | |
| 4514 | + let isPlaceholderData = false; | |
| 4515 | + let data; | |
| 4516 | + if (options._optimisticResults) { | |
| 4517 | + const mounted = this.hasListeners(); | |
| 4518 | + const fetchOnMount = !mounted && shouldFetchOnMount(query, options); | |
| 4519 | + const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions); | |
| 4520 | + if (fetchOnMount || fetchOptionally) { | |
| 4521 | + fetchStatus = (0, import_retryer.canFetch)(query.options.networkMode) ? "fetching" : "paused"; | |
| 4522 | + if (!state.dataUpdatedAt) { | |
| 4523 | + status = "pending"; | |
| 4524 | + } | |
| 4525 | + } | |
| 4526 | + if (options._optimisticResults === "isRestoring") { | |
| 4527 | + fetchStatus = "idle"; | |
| 4528 | + } | |
| 4529 | + } | |
| 4530 | + if (options.select && typeof state.data !== "undefined") { | |
| 4531 | + if (prevResult && state.data === prevResultState?.data && options.select === this.#selectFn) { | |
| 4532 | + data = this.#selectResult; | |
| 4533 | + } else { | |
| 4534 | + try { | |
| 4535 | + this.#selectFn = options.select; | |
| 4536 | + data = options.select(state.data); | |
| 4537 | + data = (0, import_utils.replaceData)(prevResult?.data, data, options); | |
| 4538 | + this.#selectResult = data; | |
| 4539 | + this.#selectError = null; | |
| 4540 | + } catch (selectError) { | |
| 4541 | + this.#selectError = selectError; | |
| 4542 | + } | |
| 4543 | + } | |
| 4544 | + } else { | |
| 4545 | + data = state.data; | |
| 4546 | + } | |
| 4547 | + if (typeof options.placeholderData !== "undefined" && typeof data === "undefined" && status === "pending") { | |
| 4548 | + let placeholderData; | |
| 4549 | + if (prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData) { | |
| 4550 | + placeholderData = prevResult.data; | |
| 4551 | + } else { | |
| 4552 | + placeholderData = typeof options.placeholderData === "function" ? options.placeholderData( | |
| 4553 | + this.#lastQueryWithDefinedData?.state.data, | |
| 4554 | + this.#lastQueryWithDefinedData | |
| 4555 | + ) : options.placeholderData; | |
| 4556 | + if (options.select && typeof placeholderData !== "undefined") { | |
| 4557 | + try { | |
| 4558 | + placeholderData = options.select(placeholderData); | |
| 4559 | + this.#selectError = null; | |
| 4560 | + } catch (selectError) { | |
| 4561 | + this.#selectError = selectError; | |
| 4562 | + } | |
| 4563 | + } | |
| 4564 | + } | |
| 4565 | + if (typeof placeholderData !== "undefined") { | |
| 4566 | + status = "success"; | |
| 4567 | + data = (0, import_utils.replaceData)( | |
| 4568 | + prevResult?.data, | |
| 4569 | + placeholderData, | |
| 4570 | + options | |
| 4571 | + ); | |
| 4572 | + isPlaceholderData = true; | |
| 4573 | + } | |
| 4574 | + } | |
| 4575 | + if (this.#selectError) { | |
| 4576 | + error = this.#selectError; | |
| 4577 | + data = this.#selectResult; | |
| 4578 | + errorUpdatedAt = Date.now(); | |
| 4579 | + status = "error"; | |
| 4580 | + } | |
| 4581 | + const isFetching = fetchStatus === "fetching"; | |
| 4582 | + const isPending = status === "pending"; | |
| 4583 | + const isError = status === "error"; | |
| 4584 | + const isLoading = isPending && isFetching; | |
| 4585 | + const result = { | |
| 4586 | + status, | |
| 4587 | + fetchStatus, | |
| 4588 | + isPending, | |
| 4589 | + isSuccess: status === "success", | |
| 4590 | + isError, | |
| 4591 | + isInitialLoading: isLoading, | |
| 4592 | + isLoading, | |
| 4593 | + data, | |
| 4594 | + dataUpdatedAt: state.dataUpdatedAt, | |
| 4595 | + error, | |
| 4596 | + errorUpdatedAt, | |
| 4597 | + failureCount: state.fetchFailureCount, | |
| 4598 | + failureReason: state.fetchFailureReason, | |
| 4599 | + errorUpdateCount: state.errorUpdateCount, | |
| 4600 | + isFetched: state.dataUpdateCount > 0 || state.errorUpdateCount > 0, | |
| 4601 | + isFetchedAfterMount: state.dataUpdateCount > queryInitialState.dataUpdateCount || state.errorUpdateCount > queryInitialState.errorUpdateCount, | |
| 4602 | + isFetching, | |
| 4603 | + isRefetching: isFetching && !isPending, | |
| 4604 | + isLoadingError: isError && state.dataUpdatedAt === 0, | |
| 4605 | + isPaused: fetchStatus === "paused", | |
| 4606 | + isPlaceholderData, | |
| 4607 | + isRefetchError: isError && state.dataUpdatedAt !== 0, | |
| 4608 | + isStale: isStale(query, options), | |
| 4609 | + refetch: this.refetch | |
| 4610 | + }; | |
| 4611 | + return result; | |
| 4612 | + } | |
| 4613 | + updateResult(notifyOptions) { | |
| 4614 | + const prevResult = this.#currentResult; | |
| 4615 | + const nextResult = this.createResult(this.#currentQuery, this.options); | |
| 4616 | + this.#currentResultState = this.#currentQuery.state; | |
| 4617 | + this.#currentResultOptions = this.options; | |
| 4618 | + if ((0, import_utils.shallowEqualObjects)(nextResult, prevResult)) { | |
| 4619 | + return; | |
| 4620 | + } | |
| 4621 | + if (this.#currentResultState.data !== void 0) { | |
| 4622 | + this.#lastQueryWithDefinedData = this.#currentQuery; | |
| 4623 | + } | |
| 4624 | + this.#currentResult = nextResult; | |
| 4625 | + const defaultNotifyOptions = {}; | |
| 4626 | + const shouldNotifyListeners = () => { | |
| 4627 | + if (!prevResult) { | |
| 4628 | + return true; | |
| 4629 | + } | |
| 4630 | + const { notifyOnChangeProps } = this.options; | |
| 4631 | + const notifyOnChangePropsValue = typeof notifyOnChangeProps === "function" ? notifyOnChangeProps() : notifyOnChangeProps; | |
| 4632 | + if (notifyOnChangePropsValue === "all" || !notifyOnChangePropsValue && !this.#trackedProps.size) { | |
| 4633 | + return true; | |
| 4634 | + } | |
| 4635 | + const includedProps = new Set( | |
| 4636 | + notifyOnChangePropsValue ?? this.#trackedProps | |
| 4637 | + ); | |
| 4638 | + if (this.options.throwOnError) { | |
| 4639 | + includedProps.add("error"); | |
| 4640 | + } | |
| 4641 | + return Object.keys(this.#currentResult).some((key) => { | |
| 4642 | + const typedKey = key; | |
| 4643 | + const changed = this.#currentResult[typedKey] !== prevResult[typedKey]; | |
| 4644 | + return changed && includedProps.has(typedKey); | |
| 4645 | + }); | |
| 4646 | + }; | |
| 4647 | + if (notifyOptions?.listeners !== false && shouldNotifyListeners()) { | |
| 4648 | + defaultNotifyOptions.listeners = true; | |
| 4649 | + } | |
| 4650 | + this.#notify({ ...defaultNotifyOptions, ...notifyOptions }); | |
| 4651 | + } | |
| 4652 | + #updateQuery() { | |
| 4653 | + const query = this.#client.getQueryCache().build(this.#client, this.options); | |
| 4654 | + if (query === this.#currentQuery) { | |
| 4655 | + return; | |
| 4656 | + } | |
| 4657 | + const prevQuery = this.#currentQuery; | |
| 4658 | + this.#currentQuery = query; | |
| 4659 | + this.#currentQueryInitialState = query.state; | |
| 4660 | + if (this.hasListeners()) { | |
| 4661 | + prevQuery?.removeObserver(this); | |
| 4662 | + query.addObserver(this); | |
| 4663 | + } | |
| 4664 | + } | |
| 4665 | + onQueryUpdate() { | |
| 4666 | + this.updateResult(); | |
| 4667 | + if (this.hasListeners()) { | |
| 4668 | + this.#updateTimers(); | |
| 4669 | + } | |
| 4670 | + } | |
| 4671 | + #notify(notifyOptions) { | |
| 4672 | + import_notifyManager.notifyManager.batch(() => { | |
| 4673 | + if (notifyOptions.listeners) { | |
| 4674 | + this.listeners.forEach((listener) => { | |
| 4675 | + listener(this.#currentResult); | |
| 4676 | + }); | |
| 4677 | + } | |
| 4678 | + this.#client.getQueryCache().notify({ | |
| 4679 | + query: this.#currentQuery, | |
| 4680 | + type: "observerResultsUpdated" | |
| 4681 | + }); | |
| 4682 | + }); | |
| 4683 | + } | |
| 4684 | +}; | |
| 4685 | +function shouldLoadOnMount(query, options) { | |
| 4686 | + return options.enabled !== false && !query.state.dataUpdatedAt && !(query.state.status === "error" && options.retryOnMount === false); | |
| 4687 | +} | |
| 4688 | +function shouldFetchOnMount(query, options) { | |
| 4689 | + return shouldLoadOnMount(query, options) || query.state.dataUpdatedAt > 0 && shouldFetchOn(query, options, options.refetchOnMount); | |
| 4690 | +} | |
| 4691 | +function shouldFetchOn(query, options, field) { | |
| 4692 | + if (options.enabled !== false) { | |
| 4693 | + const value = typeof field === "function" ? field(query) : field; | |
| 4694 | + return value === "always" || value !== false && isStale(query, options); | |
| 4695 | + } | |
| 4696 | + return false; | |
| 4697 | +} | |
| 4698 | +function shouldFetchOptionally(query, prevQuery, options, prevOptions) { | |
| 4699 | + return options.enabled !== false && (query !== prevQuery || prevOptions.enabled === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options); | |
| 4700 | +} | |
| 4701 | +function isStale(query, options) { | |
| 4702 | + return query.isStaleByTime(options.staleTime); | |
| 4703 | +} | |
| 4704 | +function shouldAssignObserverCurrentProperties(observer, optimisticResult) { | |
| 4705 | + if (!(0, import_utils.shallowEqualObjects)(observer.getCurrentResult(), optimisticResult)) { | |
| 4706 | + return true; | |
| 4707 | + } | |
| 4708 | + return false; | |
| 4709 | +} | |
| 4710 | +// Annotate the CommonJS export names for ESM import in node: | |
| 4711 | +0 && (0); | |
| 4712 | +//# sourceMappingURL=queryObserver.cjs.map | |
| 4713 | + | |
| 4714 | +/***/ }), | |
| 4715 | + | |
| 4716 | +/***/ "../node_modules/@tanstack/query-core/build/modern/removable.cjs": | |
| 4717 | +/*!***********************************************************************!*\ | |
| 4718 | + !*** ../node_modules/@tanstack/query-core/build/modern/removable.cjs ***! | |
| 4719 | + \***********************************************************************/ | |
| 4720 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 4721 | + | |
| 4722 | +"use strict"; | |
| 4723 | + | |
| 4724 | +var __defProp = Object.defineProperty; | |
| 4725 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 4726 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 4727 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 4728 | +var __export = (target, all) => { | |
| 4729 | + for (var name in all) | |
| 4730 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 4731 | +}; | |
| 4732 | +var __copyProps = (to, from, except, desc) => { | |
| 4733 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 4734 | + for (let key of __getOwnPropNames(from)) | |
| 4735 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 4736 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 4737 | + } | |
| 4738 | + return to; | |
| 4739 | +}; | |
| 4740 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 4741 | + | |
| 4742 | +// src/removable.ts | |
| 4743 | +var removable_exports = {}; | |
| 4744 | +__export(removable_exports, { | |
| 4745 | + Removable: () => Removable | |
| 4746 | +}); | |
| 4747 | +module.exports = __toCommonJS(removable_exports); | |
| 4748 | +var import_utils = __webpack_require__(/*! ./utils.cjs */ "../node_modules/@tanstack/query-core/build/modern/utils.cjs"); | |
| 4749 | +var Removable = class { | |
| 4750 | + #gcTimeout; | |
| 4751 | + destroy() { | |
| 4752 | + this.clearGcTimeout(); | |
| 4753 | + } | |
| 4754 | + scheduleGc() { | |
| 4755 | + this.clearGcTimeout(); | |
| 4756 | + if ((0, import_utils.isValidTimeout)(this.gcTime)) { | |
| 4757 | + this.#gcTimeout = setTimeout(() => { | |
| 4758 | + this.optionalRemove(); | |
| 4759 | + }, this.gcTime); | |
| 4760 | + } | |
| 4761 | + } | |
| 4762 | + updateGcTime(newGcTime) { | |
| 4763 | + this.gcTime = Math.max( | |
| 4764 | + this.gcTime || 0, | |
| 4765 | + newGcTime ?? (import_utils.isServer ? Infinity : 5 * 60 * 1e3) | |
| 4766 | + ); | |
| 4767 | + } | |
| 4768 | + clearGcTimeout() { | |
| 4769 | + if (this.#gcTimeout) { | |
| 4770 | + clearTimeout(this.#gcTimeout); | |
| 4771 | + this.#gcTimeout = void 0; | |
| 4772 | + } | |
| 4773 | + } | |
| 4774 | +}; | |
| 4775 | +// Annotate the CommonJS export names for ESM import in node: | |
| 4776 | +0 && (0); | |
| 4777 | +//# sourceMappingURL=removable.cjs.map | |
| 4778 | + | |
| 4779 | +/***/ }), | |
| 4780 | + | |
| 4781 | +/***/ "../node_modules/@tanstack/query-core/build/modern/retryer.cjs": | |
| 4782 | +/*!*********************************************************************!*\ | |
| 4783 | + !*** ../node_modules/@tanstack/query-core/build/modern/retryer.cjs ***! | |
| 4784 | + \*********************************************************************/ | |
| 4785 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 4786 | + | |
| 4787 | +"use strict"; | |
| 4788 | + | |
| 4789 | +var __defProp = Object.defineProperty; | |
| 4790 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 4791 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 4792 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 4793 | +var __export = (target, all) => { | |
| 4794 | + for (var name in all) | |
| 4795 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 4796 | +}; | |
| 4797 | +var __copyProps = (to, from, except, desc) => { | |
| 4798 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 4799 | + for (let key of __getOwnPropNames(from)) | |
| 4800 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 4801 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 4802 | + } | |
| 4803 | + return to; | |
| 4804 | +}; | |
| 4805 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 4806 | + | |
| 4807 | +// src/retryer.ts | |
| 4808 | +var retryer_exports = {}; | |
| 4809 | +__export(retryer_exports, { | |
| 4810 | + CancelledError: () => CancelledError, | |
| 4811 | + canFetch: () => canFetch, | |
| 4812 | + createRetryer: () => createRetryer, | |
| 4813 | + isCancelledError: () => isCancelledError | |
| 4814 | +}); | |
| 4815 | +module.exports = __toCommonJS(retryer_exports); | |
| 4816 | +var import_focusManager = __webpack_require__(/*! ./focusManager.cjs */ "../node_modules/@tanstack/query-core/build/modern/focusManager.cjs"); | |
| 4817 | +var import_onlineManager = __webpack_require__(/*! ./onlineManager.cjs */ "../node_modules/@tanstack/query-core/build/modern/onlineManager.cjs"); | |
| 4818 | +var import_utils = __webpack_require__(/*! ./utils.cjs */ "../node_modules/@tanstack/query-core/build/modern/utils.cjs"); | |
| 4819 | +function defaultRetryDelay(failureCount) { | |
| 4820 | + return Math.min(1e3 * 2 ** failureCount, 3e4); | |
| 4821 | +} | |
| 4822 | +function canFetch(networkMode) { | |
| 4823 | + return (networkMode ?? "online") === "online" ? import_onlineManager.onlineManager.isOnline() : true; | |
| 4824 | +} | |
| 4825 | +var CancelledError = class { | |
| 4826 | + constructor(options) { | |
| 4827 | + this.revert = options?.revert; | |
| 4828 | + this.silent = options?.silent; | |
| 4829 | + } | |
| 4830 | +}; | |
| 4831 | +function isCancelledError(value) { | |
| 4832 | + return value instanceof CancelledError; | |
| 4833 | +} | |
| 4834 | +function createRetryer(config) { | |
| 4835 | + let isRetryCancelled = false; | |
| 4836 | + let failureCount = 0; | |
| 4837 | + let isResolved = false; | |
| 4838 | + let continueFn; | |
| 4839 | + let promiseResolve; | |
| 4840 | + let promiseReject; | |
| 4841 | + const promise = new Promise((outerResolve, outerReject) => { | |
| 4842 | + promiseResolve = outerResolve; | |
| 4843 | + promiseReject = outerReject; | |
| 4844 | + }); | |
| 4845 | + const cancel = (cancelOptions) => { | |
| 4846 | + if (!isResolved) { | |
| 4847 | + reject(new CancelledError(cancelOptions)); | |
| 4848 | + config.abort?.(); | |
| 4849 | + } | |
| 4850 | + }; | |
| 4851 | + const cancelRetry = () => { | |
| 4852 | + isRetryCancelled = true; | |
| 4853 | + }; | |
| 4854 | + const continueRetry = () => { | |
| 4855 | + isRetryCancelled = false; | |
| 4856 | + }; | |
| 4857 | + const shouldPause = () => !import_focusManager.focusManager.isFocused() || config.networkMode !== "always" && !import_onlineManager.onlineManager.isOnline(); | |
| 4858 | + const resolve = (value) => { | |
| 4859 | + if (!isResolved) { | |
| 4860 | + isResolved = true; | |
| 4861 | + config.onSuccess?.(value); | |
| 4862 | + continueFn?.(); | |
| 4863 | + promiseResolve(value); | |
| 4864 | + } | |
| 4865 | + }; | |
| 4866 | + const reject = (value) => { | |
| 4867 | + if (!isResolved) { | |
| 4868 | + isResolved = true; | |
| 4869 | + config.onError?.(value); | |
| 4870 | + continueFn?.(); | |
| 4871 | + promiseReject(value); | |
| 4872 | + } | |
| 4873 | + }; | |
| 4874 | + const pause = () => { | |
| 4875 | + return new Promise((continueResolve) => { | |
| 4876 | + continueFn = (value) => { | |
| 4877 | + const canContinue = isResolved || !shouldPause(); | |
| 4878 | + if (canContinue) { | |
| 4879 | + continueResolve(value); | |
| 4880 | + } | |
| 4881 | + return canContinue; | |
| 4882 | + }; | |
| 4883 | + config.onPause?.(); | |
| 4884 | + }).then(() => { | |
| 4885 | + continueFn = void 0; | |
| 4886 | + if (!isResolved) { | |
| 4887 | + config.onContinue?.(); | |
| 4888 | + } | |
| 4889 | + }); | |
| 4890 | + }; | |
| 4891 | + const run = () => { | |
| 4892 | + if (isResolved) { | |
| 4893 | + return; | |
| 4894 | + } | |
| 4895 | + let promiseOrValue; | |
| 4896 | + try { | |
| 4897 | + promiseOrValue = config.fn(); | |
| 4898 | + } catch (error) { | |
| 4899 | + promiseOrValue = Promise.reject(error); | |
| 4900 | + } | |
| 4901 | + Promise.resolve(promiseOrValue).then(resolve).catch((error) => { | |
| 4902 | + if (isResolved) { | |
| 4903 | + return; | |
| 4904 | + } | |
| 4905 | + const retry = config.retry ?? (import_utils.isServer ? 0 : 3); | |
| 4906 | + const retryDelay = config.retryDelay ?? defaultRetryDelay; | |
| 4907 | + const delay = typeof retryDelay === "function" ? retryDelay(failureCount, error) : retryDelay; | |
| 4908 | + const shouldRetry = retry === true || typeof retry === "number" && failureCount < retry || typeof retry === "function" && retry(failureCount, error); | |
| 4909 | + if (isRetryCancelled || !shouldRetry) { | |
| 4910 | + reject(error); | |
| 4911 | + return; | |
| 4912 | + } | |
| 4913 | + failureCount++; | |
| 4914 | + config.onFail?.(failureCount, error); | |
| 4915 | + (0, import_utils.sleep)(delay).then(() => { | |
| 4916 | + if (shouldPause()) { | |
| 4917 | + return pause(); | |
| 4918 | + } | |
| 4919 | + return; | |
| 4920 | + }).then(() => { | |
| 4921 | + if (isRetryCancelled) { | |
| 4922 | + reject(error); | |
| 4923 | + } else { | |
| 4924 | + run(); | |
| 4925 | + } | |
| 4926 | + }); | |
| 4927 | + }); | |
| 4928 | + }; | |
| 4929 | + if (canFetch(config.networkMode)) { | |
| 4930 | + run(); | |
| 4931 | + } else { | |
| 4932 | + pause().then(run); | |
| 4933 | + } | |
| 4934 | + return { | |
| 4935 | + promise, | |
| 4936 | + cancel, | |
| 4937 | + continue: () => { | |
| 4938 | + const didContinue = continueFn?.(); | |
| 4939 | + return didContinue ? promise : Promise.resolve(); | |
| 4940 | + }, | |
| 4941 | + cancelRetry, | |
| 4942 | + continueRetry | |
| 4943 | + }; | |
| 4944 | +} | |
| 4945 | +// Annotate the CommonJS export names for ESM import in node: | |
| 4946 | +0 && (0); | |
| 4947 | +//# sourceMappingURL=retryer.cjs.map | |
| 4948 | + | |
| 4949 | +/***/ }), | |
| 4950 | + | |
| 4951 | +/***/ "../node_modules/@tanstack/query-core/build/modern/subscribable.cjs": | |
| 4952 | +/*!**************************************************************************!*\ | |
| 4953 | + !*** ../node_modules/@tanstack/query-core/build/modern/subscribable.cjs ***! | |
| 4954 | + \**************************************************************************/ | |
| 4955 | +/***/ ((module) => { | |
| 4956 | + | |
| 4957 | +"use strict"; | |
| 4958 | + | |
| 4959 | +var __defProp = Object.defineProperty; | |
| 4960 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 4961 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 4962 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 4963 | +var __export = (target, all) => { | |
| 4964 | + for (var name in all) | |
| 4965 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 4966 | +}; | |
| 4967 | +var __copyProps = (to, from, except, desc) => { | |
| 4968 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 4969 | + for (let key of __getOwnPropNames(from)) | |
| 4970 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 4971 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 4972 | + } | |
| 4973 | + return to; | |
| 4974 | +}; | |
| 4975 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 4976 | + | |
| 4977 | +// src/subscribable.ts | |
| 4978 | +var subscribable_exports = {}; | |
| 4979 | +__export(subscribable_exports, { | |
| 4980 | + Subscribable: () => Subscribable | |
| 4981 | +}); | |
| 4982 | +module.exports = __toCommonJS(subscribable_exports); | |
| 4983 | +var Subscribable = class { | |
| 4984 | + constructor() { | |
| 4985 | + this.listeners = /* @__PURE__ */ new Set(); | |
| 4986 | + this.subscribe = this.subscribe.bind(this); | |
| 4987 | + } | |
| 4988 | + subscribe(listener) { | |
| 4989 | + this.listeners.add(listener); | |
| 4990 | + this.onSubscribe(); | |
| 4991 | + return () => { | |
| 4992 | + this.listeners.delete(listener); | |
| 4993 | + this.onUnsubscribe(); | |
| 4994 | + }; | |
| 4995 | + } | |
| 4996 | + hasListeners() { | |
| 4997 | + return this.listeners.size > 0; | |
| 4998 | + } | |
| 4999 | + onSubscribe() { | |
| 5000 | + } | |
| 5001 | + onUnsubscribe() { | |
| 5002 | + } | |
| 5003 | +}; | |
| 5004 | +// Annotate the CommonJS export names for ESM import in node: | |
| 5005 | +0 && (0); | |
| 5006 | +//# sourceMappingURL=subscribable.cjs.map | |
| 5007 | + | |
| 5008 | +/***/ }), | |
| 5009 | + | |
| 5010 | +/***/ "../node_modules/@tanstack/query-core/build/modern/types.cjs": | |
| 5011 | +/*!*******************************************************************!*\ | |
| 5012 | + !*** ../node_modules/@tanstack/query-core/build/modern/types.cjs ***! | |
| 5013 | + \*******************************************************************/ | |
| 5014 | +/***/ ((module) => { | |
| 5015 | + | |
| 5016 | +"use strict"; | |
| 5017 | + | |
| 5018 | +var __defProp = Object.defineProperty; | |
| 5019 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 5020 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 5021 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 5022 | +var __copyProps = (to, from, except, desc) => { | |
| 5023 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 5024 | + for (let key of __getOwnPropNames(from)) | |
| 5025 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 5026 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 5027 | + } | |
| 5028 | + return to; | |
| 5029 | +}; | |
| 5030 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 5031 | + | |
| 5032 | +// src/types.ts | |
| 5033 | +var types_exports = {}; | |
| 5034 | +module.exports = __toCommonJS(types_exports); | |
| 5035 | +//# sourceMappingURL=types.cjs.map | |
| 5036 | + | |
| 5037 | +/***/ }), | |
| 5038 | + | |
| 5039 | +/***/ "../node_modules/@tanstack/query-core/build/modern/utils.cjs": | |
| 5040 | +/*!*******************************************************************!*\ | |
| 5041 | + !*** ../node_modules/@tanstack/query-core/build/modern/utils.cjs ***! | |
| 5042 | + \*******************************************************************/ | |
| 5043 | +/***/ ((module) => { | |
| 5044 | + | |
| 5045 | +"use strict"; | |
| 5046 | + | |
| 5047 | +var __defProp = Object.defineProperty; | |
| 5048 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 5049 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 5050 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 5051 | +var __export = (target, all) => { | |
| 5052 | + for (var name in all) | |
| 5053 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 5054 | +}; | |
| 5055 | +var __copyProps = (to, from, except, desc) => { | |
| 5056 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 5057 | + for (let key of __getOwnPropNames(from)) | |
| 5058 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 5059 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 5060 | + } | |
| 5061 | + return to; | |
| 5062 | +}; | |
| 5063 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 5064 | + | |
| 5065 | +// src/utils.ts | |
| 5066 | +var utils_exports = {}; | |
| 5067 | +__export(utils_exports, { | |
| 5068 | + addToEnd: () => addToEnd, | |
| 5069 | + addToStart: () => addToStart, | |
| 5070 | + functionalUpdate: () => functionalUpdate, | |
| 5071 | + hashKey: () => hashKey, | |
| 5072 | + hashQueryKeyByOptions: () => hashQueryKeyByOptions, | |
| 5073 | + isPlainArray: () => isPlainArray, | |
| 5074 | + isPlainObject: () => isPlainObject, | |
| 5075 | + isServer: () => isServer, | |
| 5076 | + isValidTimeout: () => isValidTimeout, | |
| 5077 | + keepPreviousData: () => keepPreviousData, | |
| 5078 | + matchMutation: () => matchMutation, | |
| 5079 | + matchQuery: () => matchQuery, | |
| 5080 | + noop: () => noop, | |
| 5081 | + partialMatchKey: () => partialMatchKey, | |
| 5082 | + replaceData: () => replaceData, | |
| 5083 | + replaceEqualDeep: () => replaceEqualDeep, | |
| 5084 | + scheduleMicrotask: () => scheduleMicrotask, | |
| 5085 | + shallowEqualObjects: () => shallowEqualObjects, | |
| 5086 | + sleep: () => sleep, | |
| 5087 | + timeUntilStale: () => timeUntilStale | |
| 5088 | +}); | |
| 5089 | +module.exports = __toCommonJS(utils_exports); | |
| 5090 | +var isServer = typeof window === "undefined" || "Deno" in window; | |
| 5091 | +function noop() { | |
| 5092 | + return void 0; | |
| 5093 | +} | |
| 5094 | +function functionalUpdate(updater, input) { | |
| 5095 | + return typeof updater === "function" ? updater(input) : updater; | |
| 5096 | +} | |
| 5097 | +function isValidTimeout(value) { | |
| 5098 | + return typeof value === "number" && value >= 0 && value !== Infinity; | |
| 5099 | +} | |
| 5100 | +function timeUntilStale(updatedAt, staleTime) { | |
| 5101 | + return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0); | |
| 5102 | +} | |
| 5103 | +function matchQuery(filters, query) { | |
| 5104 | + const { | |
| 5105 | + type = "all", | |
| 5106 | + exact, | |
| 5107 | + fetchStatus, | |
| 5108 | + predicate, | |
| 5109 | + queryKey, | |
| 5110 | + stale | |
| 5111 | + } = filters; | |
| 5112 | + if (queryKey) { | |
| 5113 | + if (exact) { | |
| 5114 | + if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) { | |
| 5115 | + return false; | |
| 5116 | + } | |
| 5117 | + } else if (!partialMatchKey(query.queryKey, queryKey)) { | |
| 5118 | + return false; | |
| 5119 | + } | |
| 5120 | + } | |
| 5121 | + if (type !== "all") { | |
| 5122 | + const isActive = query.isActive(); | |
| 5123 | + if (type === "active" && !isActive) { | |
| 5124 | + return false; | |
| 5125 | + } | |
| 5126 | + if (type === "inactive" && isActive) { | |
| 5127 | + return false; | |
| 5128 | + } | |
| 5129 | + } | |
| 5130 | + if (typeof stale === "boolean" && query.isStale() !== stale) { | |
| 5131 | + return false; | |
| 5132 | + } | |
| 5133 | + if (typeof fetchStatus !== "undefined" && fetchStatus !== query.state.fetchStatus) { | |
| 5134 | + return false; | |
| 5135 | + } | |
| 5136 | + if (predicate && !predicate(query)) { | |
| 5137 | + return false; | |
| 5138 | + } | |
| 5139 | + return true; | |
| 5140 | +} | |
| 5141 | +function matchMutation(filters, mutation) { | |
| 5142 | + const { exact, status, predicate, mutationKey } = filters; | |
| 5143 | + if (mutationKey) { | |
| 5144 | + if (!mutation.options.mutationKey) { | |
| 5145 | + return false; | |
| 5146 | + } | |
| 5147 | + if (exact) { | |
| 5148 | + if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) { | |
| 5149 | + return false; | |
| 5150 | + } | |
| 5151 | + } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) { | |
| 5152 | + return false; | |
| 5153 | + } | |
| 5154 | + } | |
| 5155 | + if (status && mutation.state.status !== status) { | |
| 5156 | + return false; | |
| 5157 | + } | |
| 5158 | + if (predicate && !predicate(mutation)) { | |
| 5159 | + return false; | |
| 5160 | + } | |
| 5161 | + return true; | |
| 5162 | +} | |
| 5163 | +function hashQueryKeyByOptions(queryKey, options) { | |
| 5164 | + const hashFn = options?.queryKeyHashFn || hashKey; | |
| 5165 | + return hashFn(queryKey); | |
| 5166 | +} | |
| 5167 | +function hashKey(queryKey) { | |
| 5168 | + return JSON.stringify( | |
| 5169 | + queryKey, | |
| 5170 | + (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => { | |
| 5171 | + result[key] = val[key]; | |
| 5172 | + return result; | |
| 5173 | + }, {}) : val | |
| 5174 | + ); | |
| 5175 | +} | |
| 5176 | +function partialMatchKey(a, b) { | |
| 5177 | + if (a === b) { | |
| 5178 | + return true; | |
| 5179 | + } | |
| 5180 | + if (typeof a !== typeof b) { | |
| 5181 | + return false; | |
| 5182 | + } | |
| 5183 | + if (a && b && typeof a === "object" && typeof b === "object") { | |
| 5184 | + return !Object.keys(b).some((key) => !partialMatchKey(a[key], b[key])); | |
| 5185 | + } | |
| 5186 | + return false; | |
| 5187 | +} | |
| 5188 | +function replaceEqualDeep(a, b) { | |
| 5189 | + if (a === b) { | |
| 5190 | + return a; | |
| 5191 | + } | |
| 5192 | + const array = isPlainArray(a) && isPlainArray(b); | |
| 5193 | + if (array || isPlainObject(a) && isPlainObject(b)) { | |
| 5194 | + const aSize = array ? a.length : Object.keys(a).length; | |
| 5195 | + const bItems = array ? b : Object.keys(b); | |
| 5196 | + const bSize = bItems.length; | |
| 5197 | + const copy = array ? [] : {}; | |
| 5198 | + let equalItems = 0; | |
| 5199 | + for (let i = 0; i < bSize; i++) { | |
| 5200 | + const key = array ? i : bItems[i]; | |
| 5201 | + copy[key] = replaceEqualDeep(a[key], b[key]); | |
| 5202 | + if (copy[key] === a[key]) { | |
| 5203 | + equalItems++; | |
| 5204 | + } | |
| 5205 | + } | |
| 5206 | + return aSize === bSize && equalItems === aSize ? a : copy; | |
| 5207 | + } | |
| 5208 | + return b; | |
| 5209 | +} | |
| 5210 | +function shallowEqualObjects(a, b) { | |
| 5211 | + if (a && !b || b && !a) { | |
| 5212 | + return false; | |
| 5213 | + } | |
| 5214 | + for (const key in a) { | |
| 5215 | + if (a[key] !== b[key]) { | |
| 5216 | + return false; | |
| 5217 | + } | |
| 5218 | + } | |
| 5219 | + return true; | |
| 5220 | +} | |
| 5221 | +function isPlainArray(value) { | |
| 5222 | + return Array.isArray(value) && value.length === Object.keys(value).length; | |
| 5223 | +} | |
| 5224 | +function isPlainObject(o) { | |
| 5225 | + if (!hasObjectPrototype(o)) { | |
| 5226 | + return false; | |
| 5227 | + } | |
| 5228 | + const ctor = o.constructor; | |
| 5229 | + if (typeof ctor === "undefined") { | |
| 5230 | + return true; | |
| 5231 | + } | |
| 5232 | + const prot = ctor.prototype; | |
| 5233 | + if (!hasObjectPrototype(prot)) { | |
| 5234 | + return false; | |
| 5235 | + } | |
| 5236 | + if (!prot.hasOwnProperty("isPrototypeOf")) { | |
| 5237 | + return false; | |
| 5238 | + } | |
| 5239 | + return true; | |
| 5240 | +} | |
| 5241 | +function hasObjectPrototype(o) { | |
| 5242 | + return Object.prototype.toString.call(o) === "[object Object]"; | |
| 5243 | +} | |
| 5244 | +function sleep(timeout) { | |
| 5245 | + return new Promise((resolve) => { | |
| 5246 | + setTimeout(resolve, timeout); | |
| 5247 | + }); | |
| 5248 | +} | |
| 5249 | +function scheduleMicrotask(callback) { | |
| 5250 | + sleep(0).then(callback); | |
| 5251 | +} | |
| 5252 | +function replaceData(prevData, data, options) { | |
| 5253 | + if (typeof options.structuralSharing === "function") { | |
| 5254 | + return options.structuralSharing(prevData, data); | |
| 5255 | + } else if (options.structuralSharing !== false) { | |
| 5256 | + return replaceEqualDeep(prevData, data); | |
| 5257 | + } | |
| 5258 | + return data; | |
| 5259 | +} | |
| 5260 | +function keepPreviousData(previousData) { | |
| 5261 | + return previousData; | |
| 5262 | +} | |
| 5263 | +function addToEnd(items, item, max = 0) { | |
| 5264 | + const newItems = [...items, item]; | |
| 5265 | + return max && newItems.length > max ? newItems.slice(1) : newItems; | |
| 5266 | +} | |
| 5267 | +function addToStart(items, item, max = 0) { | |
| 5268 | + const newItems = [item, ...items]; | |
| 5269 | + return max && newItems.length > max ? newItems.slice(0, -1) : newItems; | |
| 5270 | +} | |
| 5271 | +// Annotate the CommonJS export names for ESM import in node: | |
| 5272 | +0 && (0); | |
| 5273 | +//# sourceMappingURL=utils.cjs.map | |
| 5274 | + | |
| 5275 | +/***/ }), | |
| 5276 | + | |
| 5277 | +/***/ "../node_modules/@tanstack/react-query/build/modern/HydrationBoundary.cjs": | |
| 5278 | +/*!********************************************************************************!*\ | |
| 5279 | + !*** ../node_modules/@tanstack/react-query/build/modern/HydrationBoundary.cjs ***! | |
| 5280 | + \********************************************************************************/ | |
| 5281 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 5282 | + | |
| 5283 | +"use strict"; | |
| 5284 | + | |
| 5285 | +"use client"; | |
| 5286 | +var __create = Object.create; | |
| 5287 | +var __defProp = Object.defineProperty; | |
| 5288 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 5289 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 5290 | +var __getProtoOf = Object.getPrototypeOf; | |
| 5291 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 5292 | +var __export = (target, all) => { | |
| 5293 | + for (var name in all) | |
| 5294 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 5295 | +}; | |
| 5296 | +var __copyProps = (to, from, except, desc) => { | |
| 5297 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 5298 | + for (let key of __getOwnPropNames(from)) | |
| 5299 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 5300 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 5301 | + } | |
| 5302 | + return to; | |
| 5303 | +}; | |
| 5304 | +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | |
| 5305 | + // If the importer is in node compatibility mode or this is not an ESM | |
| 5306 | + // file that has been converted to a CommonJS file using a Babel- | |
| 5307 | + // compatible transform (i.e. "__esModule" has not been set), then set | |
| 5308 | + // "default" to the CommonJS "module.exports" for node compatibility. | |
| 5309 | + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | |
| 5310 | + mod | |
| 5311 | +)); | |
| 5312 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 5313 | + | |
| 5314 | +// src/HydrationBoundary.tsx | |
| 5315 | +var HydrationBoundary_exports = {}; | |
| 5316 | +__export(HydrationBoundary_exports, { | |
| 5317 | + HydrationBoundary: () => HydrationBoundary | |
| 5318 | +}); | |
| 5319 | +module.exports = __toCommonJS(HydrationBoundary_exports); | |
| 5320 | +var React = __toESM(__webpack_require__(/*! react */ "react"), 1); | |
| 5321 | +var import_query_core = __webpack_require__(/*! @tanstack/query-core */ "../node_modules/@tanstack/query-core/build/modern/index.cjs"); | |
| 5322 | +var import_QueryClientProvider = __webpack_require__(/*! ./QueryClientProvider.cjs */ "../node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs"); | |
| 5323 | +var HydrationBoundary = ({ | |
| 5324 | + children, | |
| 5325 | + options = {}, | |
| 5326 | + state, | |
| 5327 | + queryClient | |
| 5328 | +}) => { | |
| 5329 | + const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); | |
| 5330 | + const [hydrationQueue, setHydrationQueue] = React.useState(); | |
| 5331 | + const optionsRef = React.useRef(options); | |
| 5332 | + optionsRef.current = options; | |
| 5333 | + React.useMemo(() => { | |
| 5334 | + if (state) { | |
| 5335 | + if (typeof state !== "object") { | |
| 5336 | + return; | |
| 5337 | + } | |
| 5338 | + const queryCache = client.getQueryCache(); | |
| 5339 | + const queries = state.queries || []; | |
| 5340 | + const newQueries = []; | |
| 5341 | + const existingQueries = []; | |
| 5342 | + for (const dehydratedQuery of queries) { | |
| 5343 | + const existingQuery = queryCache.get(dehydratedQuery.queryHash); | |
| 5344 | + if (!existingQuery) { | |
| 5345 | + newQueries.push(dehydratedQuery); | |
| 5346 | + } else { | |
| 5347 | + const hydrationIsNewer = dehydratedQuery.state.dataUpdatedAt > existingQuery.state.dataUpdatedAt; | |
| 5348 | + const queryAlreadyQueued = hydrationQueue?.find( | |
| 5349 | + (query) => query.queryHash === dehydratedQuery.queryHash | |
| 5350 | + ); | |
| 5351 | + if (hydrationIsNewer && (!queryAlreadyQueued || dehydratedQuery.state.dataUpdatedAt > queryAlreadyQueued.state.dataUpdatedAt)) { | |
| 5352 | + existingQueries.push(dehydratedQuery); | |
| 5353 | + } | |
| 5354 | + } | |
| 5355 | + } | |
| 5356 | + if (newQueries.length > 0) { | |
| 5357 | + (0, import_query_core.hydrate)(client, { queries: newQueries }, optionsRef.current); | |
| 5358 | + } | |
| 5359 | + if (existingQueries.length > 0) { | |
| 5360 | + setHydrationQueue( | |
| 5361 | + (prev) => prev ? [...prev, ...existingQueries] : existingQueries | |
| 5362 | + ); | |
| 5363 | + } | |
| 5364 | + } | |
| 5365 | + }, [client, hydrationQueue, state]); | |
| 5366 | + React.useEffect(() => { | |
| 5367 | + if (hydrationQueue) { | |
| 5368 | + (0, import_query_core.hydrate)(client, { queries: hydrationQueue }, optionsRef.current); | |
| 5369 | + setHydrationQueue(void 0); | |
| 5370 | + } | |
| 5371 | + }, [client, hydrationQueue]); | |
| 5372 | + return children; | |
| 5373 | +}; | |
| 5374 | +// Annotate the CommonJS export names for ESM import in node: | |
| 5375 | +0 && (0); | |
| 5376 | +//# sourceMappingURL=HydrationBoundary.cjs.map | |
| 5377 | + | |
| 5378 | +/***/ }), | |
| 5379 | + | |
| 5380 | +/***/ "../node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs": | |
| 5381 | +/*!**********************************************************************************!*\ | |
| 5382 | + !*** ../node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs ***! | |
| 5383 | + \**********************************************************************************/ | |
| 5384 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 5385 | + | |
| 5386 | +"use strict"; | |
| 5387 | + | |
| 5388 | +"use client"; | |
| 5389 | +var __create = Object.create; | |
| 5390 | +var __defProp = Object.defineProperty; | |
| 5391 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 5392 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 5393 | +var __getProtoOf = Object.getPrototypeOf; | |
| 5394 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 5395 | +var __export = (target, all) => { | |
| 5396 | + for (var name in all) | |
| 5397 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 5398 | +}; | |
| 5399 | +var __copyProps = (to, from, except, desc) => { | |
| 5400 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 5401 | + for (let key of __getOwnPropNames(from)) | |
| 5402 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 5403 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 5404 | + } | |
| 5405 | + return to; | |
| 5406 | +}; | |
| 5407 | +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | |
| 5408 | + // If the importer is in node compatibility mode or this is not an ESM | |
| 5409 | + // file that has been converted to a CommonJS file using a Babel- | |
| 5410 | + // compatible transform (i.e. "__esModule" has not been set), then set | |
| 5411 | + // "default" to the CommonJS "module.exports" for node compatibility. | |
| 5412 | + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | |
| 5413 | + mod | |
| 5414 | +)); | |
| 5415 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 5416 | + | |
| 5417 | +// src/QueryClientProvider.tsx | |
| 5418 | +var QueryClientProvider_exports = {}; | |
| 5419 | +__export(QueryClientProvider_exports, { | |
| 5420 | + QueryClientContext: () => QueryClientContext, | |
| 5421 | + QueryClientProvider: () => QueryClientProvider, | |
| 5422 | + useQueryClient: () => useQueryClient | |
| 5423 | +}); | |
| 5424 | +module.exports = __toCommonJS(QueryClientProvider_exports); | |
| 5425 | +var React = __toESM(__webpack_require__(/*! react */ "react"), 1); | |
| 5426 | +var QueryClientContext = React.createContext( | |
| 5427 | + void 0 | |
| 5428 | +); | |
| 5429 | +var useQueryClient = (queryClient) => { | |
| 5430 | + const client = React.useContext(QueryClientContext); | |
| 5431 | + if (queryClient) { | |
| 5432 | + return queryClient; | |
| 5433 | + } | |
| 5434 | + if (!client) { | |
| 5435 | + throw new Error("No QueryClient set, use QueryClientProvider to set one"); | |
| 5436 | + } | |
| 5437 | + return client; | |
| 5438 | +}; | |
| 5439 | +var QueryClientProvider = ({ | |
| 5440 | + client, | |
| 5441 | + children | |
| 5442 | +}) => { | |
| 5443 | + React.useEffect(() => { | |
| 5444 | + client.mount(); | |
| 5445 | + return () => { | |
| 5446 | + client.unmount(); | |
| 5447 | + }; | |
| 5448 | + }, [client]); | |
| 5449 | + return /* @__PURE__ */ React.createElement(QueryClientContext.Provider, { value: client }, children); | |
| 5450 | +}; | |
| 5451 | +// Annotate the CommonJS export names for ESM import in node: | |
| 5452 | +0 && (0); | |
| 5453 | +//# sourceMappingURL=QueryClientProvider.cjs.map | |
| 5454 | + | |
| 5455 | +/***/ }), | |
| 5456 | + | |
| 5457 | +/***/ "../node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs": | |
| 5458 | +/*!**************************************************************************************!*\ | |
| 5459 | + !*** ../node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs ***! | |
| 5460 | + \**************************************************************************************/ | |
| 5461 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 5462 | + | |
| 5463 | +"use strict"; | |
| 5464 | + | |
| 5465 | +"use client"; | |
| 5466 | +var __create = Object.create; | |
| 5467 | +var __defProp = Object.defineProperty; | |
| 5468 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 5469 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 5470 | +var __getProtoOf = Object.getPrototypeOf; | |
| 5471 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 5472 | +var __export = (target, all) => { | |
| 5473 | + for (var name in all) | |
| 5474 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 5475 | +}; | |
| 5476 | +var __copyProps = (to, from, except, desc) => { | |
| 5477 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 5478 | + for (let key of __getOwnPropNames(from)) | |
| 5479 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 5480 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 5481 | + } | |
| 5482 | + return to; | |
| 5483 | +}; | |
| 5484 | +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | |
| 5485 | + // If the importer is in node compatibility mode or this is not an ESM | |
| 5486 | + // file that has been converted to a CommonJS file using a Babel- | |
| 5487 | + // compatible transform (i.e. "__esModule" has not been set), then set | |
| 5488 | + // "default" to the CommonJS "module.exports" for node compatibility. | |
| 5489 | + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | |
| 5490 | + mod | |
| 5491 | +)); | |
| 5492 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 5493 | + | |
| 5494 | +// src/QueryErrorResetBoundary.tsx | |
| 5495 | +var QueryErrorResetBoundary_exports = {}; | |
| 5496 | +__export(QueryErrorResetBoundary_exports, { | |
| 5497 | + QueryErrorResetBoundary: () => QueryErrorResetBoundary, | |
| 5498 | + useQueryErrorResetBoundary: () => useQueryErrorResetBoundary | |
| 5499 | +}); | |
| 5500 | +module.exports = __toCommonJS(QueryErrorResetBoundary_exports); | |
| 5501 | +var React = __toESM(__webpack_require__(/*! react */ "react"), 1); | |
| 5502 | +function createValue() { | |
| 5503 | + let isReset = false; | |
| 5504 | + return { | |
| 5505 | + clearReset: () => { | |
| 5506 | + isReset = false; | |
| 5507 | + }, | |
| 5508 | + reset: () => { | |
| 5509 | + isReset = true; | |
| 5510 | + }, | |
| 5511 | + isReset: () => { | |
| 5512 | + return isReset; | |
| 5513 | + } | |
| 5514 | + }; | |
| 5515 | +} | |
| 5516 | +var QueryErrorResetBoundaryContext = React.createContext(createValue()); | |
| 5517 | +var useQueryErrorResetBoundary = () => React.useContext(QueryErrorResetBoundaryContext); | |
| 5518 | +var QueryErrorResetBoundary = ({ | |
| 5519 | + children | |
| 5520 | +}) => { | |
| 5521 | + const [value] = React.useState(() => createValue()); | |
| 5522 | + return /* @__PURE__ */ React.createElement(QueryErrorResetBoundaryContext.Provider, { value }, typeof children === "function" ? children(value) : children); | |
| 5523 | +}; | |
| 5524 | +// Annotate the CommonJS export names for ESM import in node: | |
| 5525 | +0 && (0); | |
| 5526 | +//# sourceMappingURL=QueryErrorResetBoundary.cjs.map | |
| 5527 | + | |
| 5528 | +/***/ }), | |
| 5529 | + | |
| 5530 | +/***/ "../node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs": | |
| 5531 | +/*!*********************************************************************************!*\ | |
| 5532 | + !*** ../node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs ***! | |
| 5533 | + \*********************************************************************************/ | |
| 5534 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 5535 | + | |
| 5536 | +"use strict"; | |
| 5537 | + | |
| 5538 | +"use client"; | |
| 5539 | +var __create = Object.create; | |
| 5540 | +var __defProp = Object.defineProperty; | |
| 5541 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 5542 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 5543 | +var __getProtoOf = Object.getPrototypeOf; | |
| 5544 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 5545 | +var __export = (target, all) => { | |
| 5546 | + for (var name in all) | |
| 5547 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 5548 | +}; | |
| 5549 | +var __copyProps = (to, from, except, desc) => { | |
| 5550 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 5551 | + for (let key of __getOwnPropNames(from)) | |
| 5552 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 5553 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 5554 | + } | |
| 5555 | + return to; | |
| 5556 | +}; | |
| 5557 | +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | |
| 5558 | + // If the importer is in node compatibility mode or this is not an ESM | |
| 5559 | + // file that has been converted to a CommonJS file using a Babel- | |
| 5560 | + // compatible transform (i.e. "__esModule" has not been set), then set | |
| 5561 | + // "default" to the CommonJS "module.exports" for node compatibility. | |
| 5562 | + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | |
| 5563 | + mod | |
| 5564 | +)); | |
| 5565 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 5566 | + | |
| 5567 | +// src/errorBoundaryUtils.ts | |
| 5568 | +var errorBoundaryUtils_exports = {}; | |
| 5569 | +__export(errorBoundaryUtils_exports, { | |
| 5570 | + ensurePreventErrorBoundaryRetry: () => ensurePreventErrorBoundaryRetry, | |
| 5571 | + getHasError: () => getHasError, | |
| 5572 | + useClearResetErrorBoundary: () => useClearResetErrorBoundary | |
| 5573 | +}); | |
| 5574 | +module.exports = __toCommonJS(errorBoundaryUtils_exports); | |
| 5575 | +var React = __toESM(__webpack_require__(/*! react */ "react"), 1); | |
| 5576 | +var import_utils = __webpack_require__(/*! ./utils.cjs */ "../node_modules/@tanstack/react-query/build/modern/utils.cjs"); | |
| 5577 | +var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => { | |
| 5578 | + if (options.suspense || options.throwOnError) { | |
| 5579 | + if (!errorResetBoundary.isReset()) { | |
| 5580 | + options.retryOnMount = false; | |
| 5581 | + } | |
| 5582 | + } | |
| 5583 | +}; | |
| 5584 | +var useClearResetErrorBoundary = (errorResetBoundary) => { | |
| 5585 | + React.useEffect(() => { | |
| 5586 | + errorResetBoundary.clearReset(); | |
| 5587 | + }, [errorResetBoundary]); | |
| 5588 | +}; | |
| 5589 | +var getHasError = ({ | |
| 5590 | + result, | |
| 5591 | + errorResetBoundary, | |
| 5592 | + throwOnError, | |
| 5593 | + query | |
| 5594 | +}) => { | |
| 5595 | + return result.isError && !errorResetBoundary.isReset() && !result.isFetching && (0, import_utils.shouldThrowError)(throwOnError, [result.error, query]); | |
| 5596 | +}; | |
| 5597 | +// Annotate the CommonJS export names for ESM import in node: | |
| 5598 | +0 && (0); | |
| 5599 | +//# sourceMappingURL=errorBoundaryUtils.cjs.map | |
| 5600 | + | |
| 5601 | +/***/ }), | |
| 5602 | + | |
| 5603 | +/***/ "../node_modules/@tanstack/react-query/build/modern/index.cjs": | |
| 5604 | +/*!********************************************************************!*\ | |
| 5605 | + !*** ../node_modules/@tanstack/react-query/build/modern/index.cjs ***! | |
| 5606 | + \********************************************************************/ | |
| 5607 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 5608 | + | |
| 5609 | +"use strict"; | |
| 5610 | + | |
| 5611 | +var __defProp = Object.defineProperty; | |
| 5612 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 5613 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 5614 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 5615 | +var __export = (target, all) => { | |
| 5616 | + for (var name in all) | |
| 5617 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 5618 | +}; | |
| 5619 | +var __copyProps = (to, from, except, desc) => { | |
| 5620 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 5621 | + for (let key of __getOwnPropNames(from)) | |
| 5622 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 5623 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 5624 | + } | |
| 5625 | + return to; | |
| 5626 | +}; | |
| 5627 | +var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); | |
| 5628 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 5629 | + | |
| 5630 | +// src/index.ts | |
| 5631 | +var src_exports = {}; | |
| 5632 | +__export(src_exports, { | |
| 5633 | + HydrationBoundary: () => import_HydrationBoundary.HydrationBoundary, | |
| 5634 | + IsRestoringProvider: () => import_isRestoring.IsRestoringProvider, | |
| 5635 | + QueryClientContext: () => import_QueryClientProvider.QueryClientContext, | |
| 5636 | + QueryClientProvider: () => import_QueryClientProvider.QueryClientProvider, | |
| 5637 | + QueryErrorResetBoundary: () => import_QueryErrorResetBoundary.QueryErrorResetBoundary, | |
| 5638 | + infiniteQueryOptions: () => import_infiniteQueryOptions.infiniteQueryOptions, | |
| 5639 | + queryOptions: () => import_queryOptions.queryOptions, | |
| 5640 | + useInfiniteQuery: () => import_useInfiniteQuery.useInfiniteQuery, | |
| 5641 | + useIsFetching: () => import_useIsFetching.useIsFetching, | |
| 5642 | + useIsMutating: () => import_useMutationState.useIsMutating, | |
| 5643 | + useIsRestoring: () => import_isRestoring.useIsRestoring, | |
| 5644 | + useMutation: () => import_useMutation.useMutation, | |
| 5645 | + useMutationState: () => import_useMutationState.useMutationState, | |
| 5646 | + useQueries: () => import_useQueries.useQueries, | |
| 5647 | + useQuery: () => import_useQuery.useQuery, | |
| 5648 | + useQueryClient: () => import_QueryClientProvider.useQueryClient, | |
| 5649 | + useQueryErrorResetBoundary: () => import_QueryErrorResetBoundary.useQueryErrorResetBoundary, | |
| 5650 | + useSuspenseInfiniteQuery: () => import_useSuspenseInfiniteQuery.useSuspenseInfiniteQuery, | |
| 5651 | + useSuspenseQueries: () => import_useSuspenseQueries.useSuspenseQueries, | |
| 5652 | + useSuspenseQuery: () => import_useSuspenseQuery.useSuspenseQuery | |
| 5653 | +}); | |
| 5654 | +module.exports = __toCommonJS(src_exports); | |
| 5655 | +__reExport(src_exports, __webpack_require__(/*! @tanstack/query-core */ "../node_modules/@tanstack/query-core/build/modern/index.cjs"), module.exports); | |
| 5656 | +__reExport(src_exports, __webpack_require__(/*! ./types.cjs */ "../node_modules/@tanstack/react-query/build/modern/types.cjs"), module.exports); | |
| 5657 | +var import_useQueries = __webpack_require__(/*! ./useQueries.cjs */ "../node_modules/@tanstack/react-query/build/modern/useQueries.cjs"); | |
| 5658 | +var import_useQuery = __webpack_require__(/*! ./useQuery.cjs */ "../node_modules/@tanstack/react-query/build/modern/useQuery.cjs"); | |
| 5659 | +var import_useSuspenseQuery = __webpack_require__(/*! ./useSuspenseQuery.cjs */ "../node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.cjs"); | |
| 5660 | +var import_useSuspenseInfiniteQuery = __webpack_require__(/*! ./useSuspenseInfiniteQuery.cjs */ "../node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs"); | |
| 5661 | +var import_useSuspenseQueries = __webpack_require__(/*! ./useSuspenseQueries.cjs */ "../node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.cjs"); | |
| 5662 | +var import_queryOptions = __webpack_require__(/*! ./queryOptions.cjs */ "../node_modules/@tanstack/react-query/build/modern/queryOptions.cjs"); | |
| 5663 | +var import_infiniteQueryOptions = __webpack_require__(/*! ./infiniteQueryOptions.cjs */ "../node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.cjs"); | |
| 5664 | +var import_QueryClientProvider = __webpack_require__(/*! ./QueryClientProvider.cjs */ "../node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs"); | |
| 5665 | +var import_HydrationBoundary = __webpack_require__(/*! ./HydrationBoundary.cjs */ "../node_modules/@tanstack/react-query/build/modern/HydrationBoundary.cjs"); | |
| 5666 | +var import_QueryErrorResetBoundary = __webpack_require__(/*! ./QueryErrorResetBoundary.cjs */ "../node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs"); | |
| 5667 | +var import_useIsFetching = __webpack_require__(/*! ./useIsFetching.cjs */ "../node_modules/@tanstack/react-query/build/modern/useIsFetching.cjs"); | |
| 5668 | +var import_useMutationState = __webpack_require__(/*! ./useMutationState.cjs */ "../node_modules/@tanstack/react-query/build/modern/useMutationState.cjs"); | |
| 5669 | +var import_useMutation = __webpack_require__(/*! ./useMutation.cjs */ "../node_modules/@tanstack/react-query/build/modern/useMutation.cjs"); | |
| 5670 | +var import_useInfiniteQuery = __webpack_require__(/*! ./useInfiniteQuery.cjs */ "../node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs"); | |
| 5671 | +var import_isRestoring = __webpack_require__(/*! ./isRestoring.cjs */ "../node_modules/@tanstack/react-query/build/modern/isRestoring.cjs"); | |
| 5672 | +// Annotate the CommonJS export names for ESM import in node: | |
| 5673 | +0 && (0); | |
| 5674 | +//# sourceMappingURL=index.cjs.map | |
| 5675 | + | |
| 5676 | +/***/ }), | |
| 5677 | + | |
| 5678 | +/***/ "../node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.cjs": | |
| 5679 | +/*!***********************************************************************************!*\ | |
| 5680 | + !*** ../node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.cjs ***! | |
| 5681 | + \***********************************************************************************/ | |
| 5682 | +/***/ ((module) => { | |
| 5683 | + | |
| 5684 | +"use strict"; | |
| 5685 | + | |
| 5686 | +var __defProp = Object.defineProperty; | |
| 5687 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 5688 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 5689 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 5690 | +var __export = (target, all) => { | |
| 5691 | + for (var name in all) | |
| 5692 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 5693 | +}; | |
| 5694 | +var __copyProps = (to, from, except, desc) => { | |
| 5695 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 5696 | + for (let key of __getOwnPropNames(from)) | |
| 5697 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 5698 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 5699 | + } | |
| 5700 | + return to; | |
| 5701 | +}; | |
| 5702 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 5703 | + | |
| 5704 | +// src/infiniteQueryOptions.ts | |
| 5705 | +var infiniteQueryOptions_exports = {}; | |
| 5706 | +__export(infiniteQueryOptions_exports, { | |
| 5707 | + infiniteQueryOptions: () => infiniteQueryOptions | |
| 5708 | +}); | |
| 5709 | +module.exports = __toCommonJS(infiniteQueryOptions_exports); | |
| 5710 | +function infiniteQueryOptions(options) { | |
| 5711 | + return options; | |
| 5712 | +} | |
| 5713 | +// Annotate the CommonJS export names for ESM import in node: | |
| 5714 | +0 && (0); | |
| 5715 | +//# sourceMappingURL=infiniteQueryOptions.cjs.map | |
| 5716 | + | |
| 5717 | +/***/ }), | |
| 5718 | + | |
| 5719 | +/***/ "../node_modules/@tanstack/react-query/build/modern/isRestoring.cjs": | |
| 5720 | +/*!**************************************************************************!*\ | |
| 5721 | + !*** ../node_modules/@tanstack/react-query/build/modern/isRestoring.cjs ***! | |
| 5722 | + \**************************************************************************/ | |
| 5723 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 5724 | + | |
| 5725 | +"use strict"; | |
| 5726 | + | |
| 5727 | +"use client"; | |
| 5728 | +var __create = Object.create; | |
| 5729 | +var __defProp = Object.defineProperty; | |
| 5730 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 5731 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 5732 | +var __getProtoOf = Object.getPrototypeOf; | |
| 5733 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 5734 | +var __export = (target, all) => { | |
| 5735 | + for (var name in all) | |
| 5736 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 5737 | +}; | |
| 5738 | +var __copyProps = (to, from, except, desc) => { | |
| 5739 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 5740 | + for (let key of __getOwnPropNames(from)) | |
| 5741 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 5742 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 5743 | + } | |
| 5744 | + return to; | |
| 5745 | +}; | |
| 5746 | +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | |
| 5747 | + // If the importer is in node compatibility mode or this is not an ESM | |
| 5748 | + // file that has been converted to a CommonJS file using a Babel- | |
| 5749 | + // compatible transform (i.e. "__esModule" has not been set), then set | |
| 5750 | + // "default" to the CommonJS "module.exports" for node compatibility. | |
| 5751 | + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | |
| 5752 | + mod | |
| 5753 | +)); | |
| 5754 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 5755 | + | |
| 5756 | +// src/isRestoring.ts | |
| 5757 | +var isRestoring_exports = {}; | |
| 5758 | +__export(isRestoring_exports, { | |
| 5759 | + IsRestoringProvider: () => IsRestoringProvider, | |
| 5760 | + useIsRestoring: () => useIsRestoring | |
| 5761 | +}); | |
| 5762 | +module.exports = __toCommonJS(isRestoring_exports); | |
| 5763 | +var React = __toESM(__webpack_require__(/*! react */ "react"), 1); | |
| 5764 | +var IsRestoringContext = React.createContext(false); | |
| 5765 | +var useIsRestoring = () => React.useContext(IsRestoringContext); | |
| 5766 | +var IsRestoringProvider = IsRestoringContext.Provider; | |
| 5767 | +// Annotate the CommonJS export names for ESM import in node: | |
| 5768 | +0 && (0); | |
| 5769 | +//# sourceMappingURL=isRestoring.cjs.map | |
| 5770 | + | |
| 5771 | +/***/ }), | |
| 5772 | + | |
| 5773 | +/***/ "../node_modules/@tanstack/react-query/build/modern/queryOptions.cjs": | |
| 5774 | +/*!***************************************************************************!*\ | |
| 5775 | + !*** ../node_modules/@tanstack/react-query/build/modern/queryOptions.cjs ***! | |
| 5776 | + \***************************************************************************/ | |
| 5777 | +/***/ ((module) => { | |
| 5778 | + | |
| 5779 | +"use strict"; | |
| 5780 | + | |
| 5781 | +var __defProp = Object.defineProperty; | |
| 5782 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 5783 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 5784 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 5785 | +var __export = (target, all) => { | |
| 5786 | + for (var name in all) | |
| 5787 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 5788 | +}; | |
| 5789 | +var __copyProps = (to, from, except, desc) => { | |
| 5790 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 5791 | + for (let key of __getOwnPropNames(from)) | |
| 5792 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 5793 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 5794 | + } | |
| 5795 | + return to; | |
| 5796 | +}; | |
| 5797 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 5798 | + | |
| 5799 | +// src/queryOptions.ts | |
| 5800 | +var queryOptions_exports = {}; | |
| 5801 | +__export(queryOptions_exports, { | |
| 5802 | + queryOptions: () => queryOptions | |
| 5803 | +}); | |
| 5804 | +module.exports = __toCommonJS(queryOptions_exports); | |
| 5805 | +function queryOptions(options) { | |
| 5806 | + return options; | |
| 5807 | +} | |
| 5808 | +// Annotate the CommonJS export names for ESM import in node: | |
| 5809 | +0 && (0); | |
| 5810 | +//# sourceMappingURL=queryOptions.cjs.map | |
| 5811 | + | |
| 5812 | +/***/ }), | |
| 5813 | + | |
| 5814 | +/***/ "../node_modules/@tanstack/react-query/build/modern/suspense.cjs": | |
| 5815 | +/*!***********************************************************************!*\ | |
| 5816 | + !*** ../node_modules/@tanstack/react-query/build/modern/suspense.cjs ***! | |
| 5817 | + \***********************************************************************/ | |
| 5818 | +/***/ ((module) => { | |
| 5819 | + | |
| 5820 | +"use strict"; | |
| 5821 | + | |
| 5822 | +var __defProp = Object.defineProperty; | |
| 5823 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 5824 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 5825 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 5826 | +var __export = (target, all) => { | |
| 5827 | + for (var name in all) | |
| 5828 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 5829 | +}; | |
| 5830 | +var __copyProps = (to, from, except, desc) => { | |
| 5831 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 5832 | + for (let key of __getOwnPropNames(from)) | |
| 5833 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 5834 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 5835 | + } | |
| 5836 | + return to; | |
| 5837 | +}; | |
| 5838 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 5839 | + | |
| 5840 | +// src/suspense.ts | |
| 5841 | +var suspense_exports = {}; | |
| 5842 | +__export(suspense_exports, { | |
| 5843 | + defaultThrowOnError: () => defaultThrowOnError, | |
| 5844 | + ensureStaleTime: () => ensureStaleTime, | |
| 5845 | + fetchOptimistic: () => fetchOptimistic, | |
| 5846 | + shouldSuspend: () => shouldSuspend, | |
| 5847 | + willFetch: () => willFetch | |
| 5848 | +}); | |
| 5849 | +module.exports = __toCommonJS(suspense_exports); | |
| 5850 | +var defaultThrowOnError = (_error, query) => typeof query.state.data === "undefined"; | |
| 5851 | +var ensureStaleTime = (defaultedOptions) => { | |
| 5852 | + if (defaultedOptions.suspense) { | |
| 5853 | + if (typeof defaultedOptions.staleTime !== "number") { | |
| 5854 | + defaultedOptions.staleTime = 1e3; | |
| 5855 | + } | |
| 5856 | + } | |
| 5857 | +}; | |
| 5858 | +var willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring; | |
| 5859 | +var shouldSuspend = (defaultedOptions, result, isRestoring) => defaultedOptions?.suspense && willFetch(result, isRestoring); | |
| 5860 | +var fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => { | |
| 5861 | + errorResetBoundary.clearReset(); | |
| 5862 | +}); | |
| 5863 | +// Annotate the CommonJS export names for ESM import in node: | |
| 5864 | +0 && (0); | |
| 5865 | +//# sourceMappingURL=suspense.cjs.map | |
| 5866 | + | |
| 5867 | +/***/ }), | |
| 5868 | + | |
| 5869 | +/***/ "../node_modules/@tanstack/react-query/build/modern/types.cjs": | |
| 5870 | +/*!********************************************************************!*\ | |
| 5871 | + !*** ../node_modules/@tanstack/react-query/build/modern/types.cjs ***! | |
| 5872 | + \********************************************************************/ | |
| 5873 | +/***/ ((module) => { | |
| 5874 | + | |
| 5875 | +"use strict"; | |
| 5876 | + | |
| 5877 | +var __defProp = Object.defineProperty; | |
| 5878 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 5879 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 5880 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 5881 | +var __copyProps = (to, from, except, desc) => { | |
| 5882 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 5883 | + for (let key of __getOwnPropNames(from)) | |
| 5884 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 5885 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 5886 | + } | |
| 5887 | + return to; | |
| 5888 | +}; | |
| 5889 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 5890 | + | |
| 5891 | +// src/types.ts | |
| 5892 | +var types_exports = {}; | |
| 5893 | +module.exports = __toCommonJS(types_exports); | |
| 5894 | +//# sourceMappingURL=types.cjs.map | |
| 5895 | + | |
| 5896 | +/***/ }), | |
| 5897 | + | |
| 5898 | +/***/ "../node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs": | |
| 5899 | +/*!***************************************************************************!*\ | |
| 5900 | + !*** ../node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs ***! | |
| 5901 | + \***************************************************************************/ | |
| 5902 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 5903 | + | |
| 5904 | +"use strict"; | |
| 5905 | + | |
| 5906 | +"use client"; | |
| 5907 | +var __create = Object.create; | |
| 5908 | +var __defProp = Object.defineProperty; | |
| 5909 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 5910 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 5911 | +var __getProtoOf = Object.getPrototypeOf; | |
| 5912 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 5913 | +var __export = (target, all) => { | |
| 5914 | + for (var name in all) | |
| 5915 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 5916 | +}; | |
| 5917 | +var __copyProps = (to, from, except, desc) => { | |
| 5918 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 5919 | + for (let key of __getOwnPropNames(from)) | |
| 5920 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 5921 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 5922 | + } | |
| 5923 | + return to; | |
| 5924 | +}; | |
| 5925 | +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | |
| 5926 | + // If the importer is in node compatibility mode or this is not an ESM | |
| 5927 | + // file that has been converted to a CommonJS file using a Babel- | |
| 5928 | + // compatible transform (i.e. "__esModule" has not been set), then set | |
| 5929 | + // "default" to the CommonJS "module.exports" for node compatibility. | |
| 5930 | + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | |
| 5931 | + mod | |
| 5932 | +)); | |
| 5933 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 5934 | + | |
| 5935 | +// src/useBaseQuery.ts | |
| 5936 | +var useBaseQuery_exports = {}; | |
| 5937 | +__export(useBaseQuery_exports, { | |
| 5938 | + useBaseQuery: () => useBaseQuery | |
| 5939 | +}); | |
| 5940 | +module.exports = __toCommonJS(useBaseQuery_exports); | |
| 5941 | +var React = __toESM(__webpack_require__(/*! react */ "react"), 1); | |
| 5942 | +var import_query_core = __webpack_require__(/*! @tanstack/query-core */ "../node_modules/@tanstack/query-core/build/modern/index.cjs"); | |
| 5943 | +var import_QueryErrorResetBoundary = __webpack_require__(/*! ./QueryErrorResetBoundary.cjs */ "../node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs"); | |
| 5944 | +var import_QueryClientProvider = __webpack_require__(/*! ./QueryClientProvider.cjs */ "../node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs"); | |
| 5945 | +var import_isRestoring = __webpack_require__(/*! ./isRestoring.cjs */ "../node_modules/@tanstack/react-query/build/modern/isRestoring.cjs"); | |
| 5946 | +var import_errorBoundaryUtils = __webpack_require__(/*! ./errorBoundaryUtils.cjs */ "../node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs"); | |
| 5947 | +var import_suspense = __webpack_require__(/*! ./suspense.cjs */ "../node_modules/@tanstack/react-query/build/modern/suspense.cjs"); | |
| 5948 | +function useBaseQuery(options, Observer, queryClient) { | |
| 5949 | + if (true) { | |
| 5950 | + if (typeof options !== "object" || Array.isArray(options)) { | |
| 5951 | + throw new Error( | |
| 5952 | + 'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object' | |
| 5953 | + ); | |
| 5954 | + } | |
| 5955 | + } | |
| 5956 | + const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); | |
| 5957 | + const isRestoring = (0, import_isRestoring.useIsRestoring)(); | |
| 5958 | + const errorResetBoundary = (0, import_QueryErrorResetBoundary.useQueryErrorResetBoundary)(); | |
| 5959 | + const defaultedOptions = client.defaultQueryOptions(options); | |
| 5960 | + defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; | |
| 5961 | + (0, import_suspense.ensureStaleTime)(defaultedOptions); | |
| 5962 | + (0, import_errorBoundaryUtils.ensurePreventErrorBoundaryRetry)(defaultedOptions, errorResetBoundary); | |
| 5963 | + (0, import_errorBoundaryUtils.useClearResetErrorBoundary)(errorResetBoundary); | |
| 5964 | + const [observer] = React.useState( | |
| 5965 | + () => new Observer( | |
| 5966 | + client, | |
| 5967 | + defaultedOptions | |
| 5968 | + ) | |
| 5969 | + ); | |
| 5970 | + const result = observer.getOptimisticResult(defaultedOptions); | |
| 5971 | + React.useSyncExternalStore( | |
| 5972 | + React.useCallback( | |
| 5973 | + (onStoreChange) => { | |
| 5974 | + const unsubscribe = isRestoring ? () => void 0 : observer.subscribe(import_query_core.notifyManager.batchCalls(onStoreChange)); | |
| 5975 | + observer.updateResult(); | |
| 5976 | + return unsubscribe; | |
| 5977 | + }, | |
| 5978 | + [observer, isRestoring] | |
| 5979 | + ), | |
| 5980 | + () => observer.getCurrentResult(), | |
| 5981 | + () => observer.getCurrentResult() | |
| 5982 | + ); | |
| 5983 | + React.useEffect(() => { | |
| 5984 | + observer.setOptions(defaultedOptions, { listeners: false }); | |
| 5985 | + }, [defaultedOptions, observer]); | |
| 5986 | + if ((0, import_suspense.shouldSuspend)(defaultedOptions, result, isRestoring)) { | |
| 5987 | + throw (0, import_suspense.fetchOptimistic)(defaultedOptions, observer, errorResetBoundary); | |
| 5988 | + } | |
| 5989 | + if ((0, import_errorBoundaryUtils.getHasError)({ | |
| 5990 | + result, | |
| 5991 | + errorResetBoundary, | |
| 5992 | + throwOnError: defaultedOptions.throwOnError, | |
| 5993 | + query: observer.getCurrentQuery() | |
| 5994 | + })) { | |
| 5995 | + throw result.error; | |
| 5996 | + } | |
| 5997 | + return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result; | |
| 5998 | +} | |
| 5999 | +// Annotate the CommonJS export names for ESM import in node: | |
| 6000 | +0 && (0); | |
| 6001 | +//# sourceMappingURL=useBaseQuery.cjs.map | |
| 6002 | + | |
| 6003 | +/***/ }), | |
| 6004 | + | |
| 6005 | +/***/ "../node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs": | |
| 6006 | +/*!*******************************************************************************!*\ | |
| 6007 | + !*** ../node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs ***! | |
| 6008 | + \*******************************************************************************/ | |
| 6009 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 6010 | + | |
| 6011 | +"use strict"; | |
| 6012 | + | |
| 6013 | +"use client"; | |
| 6014 | +var __defProp = Object.defineProperty; | |
| 6015 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 6016 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 6017 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 6018 | +var __export = (target, all) => { | |
| 6019 | + for (var name in all) | |
| 6020 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 6021 | +}; | |
| 6022 | +var __copyProps = (to, from, except, desc) => { | |
| 6023 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 6024 | + for (let key of __getOwnPropNames(from)) | |
| 6025 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 6026 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 6027 | + } | |
| 6028 | + return to; | |
| 6029 | +}; | |
| 6030 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 6031 | + | |
| 6032 | +// src/useInfiniteQuery.ts | |
| 6033 | +var useInfiniteQuery_exports = {}; | |
| 6034 | +__export(useInfiniteQuery_exports, { | |
| 6035 | + useInfiniteQuery: () => useInfiniteQuery | |
| 6036 | +}); | |
| 6037 | +module.exports = __toCommonJS(useInfiniteQuery_exports); | |
| 6038 | +var import_query_core = __webpack_require__(/*! @tanstack/query-core */ "../node_modules/@tanstack/query-core/build/modern/index.cjs"); | |
| 6039 | +var import_useBaseQuery = __webpack_require__(/*! ./useBaseQuery.cjs */ "../node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs"); | |
| 6040 | +function useInfiniteQuery(options, queryClient) { | |
| 6041 | + return (0, import_useBaseQuery.useBaseQuery)( | |
| 6042 | + options, | |
| 6043 | + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion | |
| 6044 | + import_query_core.InfiniteQueryObserver, | |
| 6045 | + queryClient | |
| 6046 | + ); | |
| 6047 | +} | |
| 6048 | +// Annotate the CommonJS export names for ESM import in node: | |
| 6049 | +0 && (0); | |
| 6050 | +//# sourceMappingURL=useInfiniteQuery.cjs.map | |
| 6051 | + | |
| 6052 | +/***/ }), | |
| 6053 | + | |
| 6054 | +/***/ "../node_modules/@tanstack/react-query/build/modern/useIsFetching.cjs": | |
| 6055 | +/*!****************************************************************************!*\ | |
| 6056 | + !*** ../node_modules/@tanstack/react-query/build/modern/useIsFetching.cjs ***! | |
| 6057 | + \****************************************************************************/ | |
| 6058 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 6059 | + | |
| 6060 | +"use strict"; | |
| 6061 | + | |
| 6062 | +"use client"; | |
| 6063 | +var __create = Object.create; | |
| 6064 | +var __defProp = Object.defineProperty; | |
| 6065 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 6066 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 6067 | +var __getProtoOf = Object.getPrototypeOf; | |
| 6068 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 6069 | +var __export = (target, all) => { | |
| 6070 | + for (var name in all) | |
| 6071 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 6072 | +}; | |
| 6073 | +var __copyProps = (to, from, except, desc) => { | |
| 6074 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 6075 | + for (let key of __getOwnPropNames(from)) | |
| 6076 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 6077 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 6078 | + } | |
| 6079 | + return to; | |
| 6080 | +}; | |
| 6081 | +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | |
| 6082 | + // If the importer is in node compatibility mode or this is not an ESM | |
| 6083 | + // file that has been converted to a CommonJS file using a Babel- | |
| 6084 | + // compatible transform (i.e. "__esModule" has not been set), then set | |
| 6085 | + // "default" to the CommonJS "module.exports" for node compatibility. | |
| 6086 | + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | |
| 6087 | + mod | |
| 6088 | +)); | |
| 6089 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 6090 | + | |
| 6091 | +// src/useIsFetching.ts | |
| 6092 | +var useIsFetching_exports = {}; | |
| 6093 | +__export(useIsFetching_exports, { | |
| 6094 | + useIsFetching: () => useIsFetching | |
| 6095 | +}); | |
| 6096 | +module.exports = __toCommonJS(useIsFetching_exports); | |
| 6097 | +var React = __toESM(__webpack_require__(/*! react */ "react"), 1); | |
| 6098 | +var import_query_core = __webpack_require__(/*! @tanstack/query-core */ "../node_modules/@tanstack/query-core/build/modern/index.cjs"); | |
| 6099 | +var import_QueryClientProvider = __webpack_require__(/*! ./QueryClientProvider.cjs */ "../node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs"); | |
| 6100 | +function useIsFetching(filters, queryClient) { | |
| 6101 | + const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); | |
| 6102 | + const queryCache = client.getQueryCache(); | |
| 6103 | + return React.useSyncExternalStore( | |
| 6104 | + React.useCallback( | |
| 6105 | + (onStoreChange) => queryCache.subscribe(import_query_core.notifyManager.batchCalls(onStoreChange)), | |
| 6106 | + [queryCache] | |
| 6107 | + ), | |
| 6108 | + () => client.isFetching(filters), | |
| 6109 | + () => client.isFetching(filters) | |
| 6110 | + ); | |
| 6111 | +} | |
| 6112 | +// Annotate the CommonJS export names for ESM import in node: | |
| 6113 | +0 && (0); | |
| 6114 | +//# sourceMappingURL=useIsFetching.cjs.map | |
| 6115 | + | |
| 6116 | +/***/ }), | |
| 6117 | + | |
| 6118 | +/***/ "../node_modules/@tanstack/react-query/build/modern/useMutation.cjs": | |
| 6119 | +/*!**************************************************************************!*\ | |
| 6120 | + !*** ../node_modules/@tanstack/react-query/build/modern/useMutation.cjs ***! | |
| 6121 | + \**************************************************************************/ | |
| 6122 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 6123 | + | |
| 6124 | +"use strict"; | |
| 6125 | + | |
| 6126 | +"use client"; | |
| 6127 | +var __create = Object.create; | |
| 6128 | +var __defProp = Object.defineProperty; | |
| 6129 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 6130 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 6131 | +var __getProtoOf = Object.getPrototypeOf; | |
| 6132 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 6133 | +var __export = (target, all) => { | |
| 6134 | + for (var name in all) | |
| 6135 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 6136 | +}; | |
| 6137 | +var __copyProps = (to, from, except, desc) => { | |
| 6138 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 6139 | + for (let key of __getOwnPropNames(from)) | |
| 6140 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 6141 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 6142 | + } | |
| 6143 | + return to; | |
| 6144 | +}; | |
| 6145 | +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | |
| 6146 | + // If the importer is in node compatibility mode or this is not an ESM | |
| 6147 | + // file that has been converted to a CommonJS file using a Babel- | |
| 6148 | + // compatible transform (i.e. "__esModule" has not been set), then set | |
| 6149 | + // "default" to the CommonJS "module.exports" for node compatibility. | |
| 6150 | + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | |
| 6151 | + mod | |
| 6152 | +)); | |
| 6153 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 6154 | + | |
| 6155 | +// src/useMutation.ts | |
| 6156 | +var useMutation_exports = {}; | |
| 6157 | +__export(useMutation_exports, { | |
| 6158 | + useMutation: () => useMutation | |
| 6159 | +}); | |
| 6160 | +module.exports = __toCommonJS(useMutation_exports); | |
| 6161 | +var React = __toESM(__webpack_require__(/*! react */ "react"), 1); | |
| 6162 | +var import_query_core = __webpack_require__(/*! @tanstack/query-core */ "../node_modules/@tanstack/query-core/build/modern/index.cjs"); | |
| 6163 | +var import_QueryClientProvider = __webpack_require__(/*! ./QueryClientProvider.cjs */ "../node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs"); | |
| 6164 | +var import_utils = __webpack_require__(/*! ./utils.cjs */ "../node_modules/@tanstack/react-query/build/modern/utils.cjs"); | |
| 6165 | +function useMutation(options, queryClient) { | |
| 6166 | + const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); | |
| 6167 | + const [observer] = React.useState( | |
| 6168 | + () => new import_query_core.MutationObserver( | |
| 6169 | + client, | |
| 6170 | + options | |
| 6171 | + ) | |
| 6172 | + ); | |
| 6173 | + React.useEffect(() => { | |
| 6174 | + observer.setOptions(options); | |
| 6175 | + }, [observer, options]); | |
| 6176 | + const result = React.useSyncExternalStore( | |
| 6177 | + React.useCallback( | |
| 6178 | + (onStoreChange) => observer.subscribe(import_query_core.notifyManager.batchCalls(onStoreChange)), | |
| 6179 | + [observer] | |
| 6180 | + ), | |
| 6181 | + () => observer.getCurrentResult(), | |
| 6182 | + () => observer.getCurrentResult() | |
| 6183 | + ); | |
| 6184 | + const mutate = React.useCallback( | |
| 6185 | + (variables, mutateOptions) => { | |
| 6186 | + observer.mutate(variables, mutateOptions).catch(noop); | |
| 6187 | + }, | |
| 6188 | + [observer] | |
| 6189 | + ); | |
| 6190 | + if (result.error && (0, import_utils.shouldThrowError)(observer.options.throwOnError, [result.error])) { | |
| 6191 | + throw result.error; | |
| 6192 | + } | |
| 6193 | + return { ...result, mutate, mutateAsync: result.mutate }; | |
| 6194 | +} | |
| 6195 | +function noop() { | |
| 6196 | +} | |
| 6197 | +// Annotate the CommonJS export names for ESM import in node: | |
| 6198 | +0 && (0); | |
| 6199 | +//# sourceMappingURL=useMutation.cjs.map | |
| 6200 | + | |
| 6201 | +/***/ }), | |
| 6202 | + | |
| 6203 | +/***/ "../node_modules/@tanstack/react-query/build/modern/useMutationState.cjs": | |
| 6204 | +/*!*******************************************************************************!*\ | |
| 6205 | + !*** ../node_modules/@tanstack/react-query/build/modern/useMutationState.cjs ***! | |
| 6206 | + \*******************************************************************************/ | |
| 6207 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 6208 | + | |
| 6209 | +"use strict"; | |
| 6210 | + | |
| 6211 | +"use client"; | |
| 6212 | +var __create = Object.create; | |
| 6213 | +var __defProp = Object.defineProperty; | |
| 6214 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 6215 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 6216 | +var __getProtoOf = Object.getPrototypeOf; | |
| 6217 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 6218 | +var __export = (target, all) => { | |
| 6219 | + for (var name in all) | |
| 6220 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 6221 | +}; | |
| 6222 | +var __copyProps = (to, from, except, desc) => { | |
| 6223 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 6224 | + for (let key of __getOwnPropNames(from)) | |
| 6225 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 6226 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 6227 | + } | |
| 6228 | + return to; | |
| 6229 | +}; | |
| 6230 | +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | |
| 6231 | + // If the importer is in node compatibility mode or this is not an ESM | |
| 6232 | + // file that has been converted to a CommonJS file using a Babel- | |
| 6233 | + // compatible transform (i.e. "__esModule" has not been set), then set | |
| 6234 | + // "default" to the CommonJS "module.exports" for node compatibility. | |
| 6235 | + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | |
| 6236 | + mod | |
| 6237 | +)); | |
| 6238 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 6239 | + | |
| 6240 | +// src/useMutationState.ts | |
| 6241 | +var useMutationState_exports = {}; | |
| 6242 | +__export(useMutationState_exports, { | |
| 6243 | + useIsMutating: () => useIsMutating, | |
| 6244 | + useMutationState: () => useMutationState | |
| 6245 | +}); | |
| 6246 | +module.exports = __toCommonJS(useMutationState_exports); | |
| 6247 | +var React = __toESM(__webpack_require__(/*! react */ "react"), 1); | |
| 6248 | +var import_query_core = __webpack_require__(/*! @tanstack/query-core */ "../node_modules/@tanstack/query-core/build/modern/index.cjs"); | |
| 6249 | +var import_QueryClientProvider = __webpack_require__(/*! ./QueryClientProvider.cjs */ "../node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs"); | |
| 6250 | +function useIsMutating(filters, queryClient) { | |
| 6251 | + const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); | |
| 6252 | + return useMutationState( | |
| 6253 | + { filters: { ...filters, status: "pending" } }, | |
| 6254 | + client | |
| 6255 | + ).length; | |
| 6256 | +} | |
| 6257 | +function getResult(mutationCache, options) { | |
| 6258 | + return mutationCache.findAll(options.filters).map( | |
| 6259 | + (mutation) => options.select ? options.select( | |
| 6260 | + mutation | |
| 6261 | + ) : mutation.state | |
| 6262 | + ); | |
| 6263 | +} | |
| 6264 | +function useMutationState(options = {}, queryClient) { | |
| 6265 | + const mutationCache = (0, import_QueryClientProvider.useQueryClient)(queryClient).getMutationCache(); | |
| 6266 | + const optionsRef = React.useRef(options); | |
| 6267 | + const result = React.useRef(); | |
| 6268 | + if (!result.current) { | |
| 6269 | + result.current = getResult(mutationCache, options); | |
| 6270 | + } | |
| 6271 | + React.useEffect(() => { | |
| 6272 | + optionsRef.current = options; | |
| 6273 | + }); | |
| 6274 | + return React.useSyncExternalStore( | |
| 6275 | + React.useCallback( | |
| 6276 | + (onStoreChange) => mutationCache.subscribe(() => { | |
| 6277 | + const nextResult = (0, import_query_core.replaceEqualDeep)( | |
| 6278 | + result.current, | |
| 6279 | + getResult(mutationCache, optionsRef.current) | |
| 6280 | + ); | |
| 6281 | + if (result.current !== nextResult) { | |
| 6282 | + result.current = nextResult; | |
| 6283 | + import_query_core.notifyManager.schedule(onStoreChange); | |
| 6284 | + } | |
| 6285 | + }), | |
| 6286 | + [mutationCache] | |
| 6287 | + ), | |
| 6288 | + () => result.current, | |
| 6289 | + () => result.current | |
| 6290 | + ); | |
| 6291 | +} | |
| 6292 | +// Annotate the CommonJS export names for ESM import in node: | |
| 6293 | +0 && (0); | |
| 6294 | +//# sourceMappingURL=useMutationState.cjs.map | |
| 6295 | + | |
| 6296 | +/***/ }), | |
| 6297 | + | |
| 6298 | +/***/ "../node_modules/@tanstack/react-query/build/modern/useQueries.cjs": | |
| 6299 | +/*!*************************************************************************!*\ | |
| 6300 | + !*** ../node_modules/@tanstack/react-query/build/modern/useQueries.cjs ***! | |
| 6301 | + \*************************************************************************/ | |
| 6302 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 6303 | + | |
| 6304 | +"use strict"; | |
| 6305 | + | |
| 6306 | +"use client"; | |
| 6307 | +var __create = Object.create; | |
| 6308 | +var __defProp = Object.defineProperty; | |
| 6309 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 6310 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 6311 | +var __getProtoOf = Object.getPrototypeOf; | |
| 6312 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 6313 | +var __export = (target, all) => { | |
| 6314 | + for (var name in all) | |
| 6315 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 6316 | +}; | |
| 6317 | +var __copyProps = (to, from, except, desc) => { | |
| 6318 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 6319 | + for (let key of __getOwnPropNames(from)) | |
| 6320 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 6321 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 6322 | + } | |
| 6323 | + return to; | |
| 6324 | +}; | |
| 6325 | +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | |
| 6326 | + // If the importer is in node compatibility mode or this is not an ESM | |
| 6327 | + // file that has been converted to a CommonJS file using a Babel- | |
| 6328 | + // compatible transform (i.e. "__esModule" has not been set), then set | |
| 6329 | + // "default" to the CommonJS "module.exports" for node compatibility. | |
| 6330 | + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | |
| 6331 | + mod | |
| 6332 | +)); | |
| 6333 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 6334 | + | |
| 6335 | +// src/useQueries.ts | |
| 6336 | +var useQueries_exports = {}; | |
| 6337 | +__export(useQueries_exports, { | |
| 6338 | + useQueries: () => useQueries | |
| 6339 | +}); | |
| 6340 | +module.exports = __toCommonJS(useQueries_exports); | |
| 6341 | +var React = __toESM(__webpack_require__(/*! react */ "react"), 1); | |
| 6342 | +var import_query_core = __webpack_require__(/*! @tanstack/query-core */ "../node_modules/@tanstack/query-core/build/modern/index.cjs"); | |
| 6343 | +var import_QueryClientProvider = __webpack_require__(/*! ./QueryClientProvider.cjs */ "../node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs"); | |
| 6344 | +var import_isRestoring = __webpack_require__(/*! ./isRestoring.cjs */ "../node_modules/@tanstack/react-query/build/modern/isRestoring.cjs"); | |
| 6345 | +var import_QueryErrorResetBoundary = __webpack_require__(/*! ./QueryErrorResetBoundary.cjs */ "../node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs"); | |
| 6346 | +var import_errorBoundaryUtils = __webpack_require__(/*! ./errorBoundaryUtils.cjs */ "../node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs"); | |
| 6347 | +var import_suspense = __webpack_require__(/*! ./suspense.cjs */ "../node_modules/@tanstack/react-query/build/modern/suspense.cjs"); | |
| 6348 | +function useQueries({ | |
| 6349 | + queries, | |
| 6350 | + ...options | |
| 6351 | +}, queryClient) { | |
| 6352 | + const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); | |
| 6353 | + const isRestoring = (0, import_isRestoring.useIsRestoring)(); | |
| 6354 | + const errorResetBoundary = (0, import_QueryErrorResetBoundary.useQueryErrorResetBoundary)(); | |
| 6355 | + const defaultedQueries = React.useMemo( | |
| 6356 | + () => queries.map((opts) => { | |
| 6357 | + const defaultedOptions = client.defaultQueryOptions(opts); | |
| 6358 | + defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; | |
| 6359 | + return defaultedOptions; | |
| 6360 | + }), | |
| 6361 | + [queries, client, isRestoring] | |
| 6362 | + ); | |
| 6363 | + defaultedQueries.forEach((query) => { | |
| 6364 | + (0, import_suspense.ensureStaleTime)(query); | |
| 6365 | + (0, import_errorBoundaryUtils.ensurePreventErrorBoundaryRetry)(query, errorResetBoundary); | |
| 6366 | + }); | |
| 6367 | + (0, import_errorBoundaryUtils.useClearResetErrorBoundary)(errorResetBoundary); | |
| 6368 | + const [observer] = React.useState( | |
| 6369 | + () => new import_query_core.QueriesObserver( | |
| 6370 | + client, | |
| 6371 | + defaultedQueries, | |
| 6372 | + options | |
| 6373 | + ) | |
| 6374 | + ); | |
| 6375 | + const [optimisticResult, getCombinedResult, trackResult] = observer.getOptimisticResult(defaultedQueries); | |
| 6376 | + React.useSyncExternalStore( | |
| 6377 | + React.useCallback( | |
| 6378 | + (onStoreChange) => isRestoring ? () => void 0 : observer.subscribe(import_query_core.notifyManager.batchCalls(onStoreChange)), | |
| 6379 | + [observer, isRestoring] | |
| 6380 | + ), | |
| 6381 | + () => observer.getCurrentResult(), | |
| 6382 | + () => observer.getCurrentResult() | |
| 6383 | + ); | |
| 6384 | + React.useEffect(() => { | |
| 6385 | + observer.setQueries( | |
| 6386 | + defaultedQueries, | |
| 6387 | + options, | |
| 6388 | + { | |
| 6389 | + listeners: false | |
| 6390 | + } | |
| 6391 | + ); | |
| 6392 | + }, [defaultedQueries, options, observer]); | |
| 6393 | + const shouldAtLeastOneSuspend = optimisticResult.some( | |
| 6394 | + (result, index) => (0, import_suspense.shouldSuspend)(defaultedQueries[index], result, isRestoring) | |
| 6395 | + ); | |
| 6396 | + const suspensePromises = shouldAtLeastOneSuspend ? optimisticResult.flatMap((result, index) => { | |
| 6397 | + const opts = defaultedQueries[index]; | |
| 6398 | + if (opts) { | |
| 6399 | + const queryObserver = new import_query_core.QueryObserver(client, opts); | |
| 6400 | + if ((0, import_suspense.shouldSuspend)(opts, result, isRestoring)) { | |
| 6401 | + return (0, import_suspense.fetchOptimistic)(opts, queryObserver, errorResetBoundary); | |
| 6402 | + } else if ((0, import_suspense.willFetch)(result, isRestoring)) { | |
| 6403 | + void (0, import_suspense.fetchOptimistic)(opts, queryObserver, errorResetBoundary); | |
| 6404 | + } | |
| 6405 | + } | |
| 6406 | + return []; | |
| 6407 | + }) : []; | |
| 6408 | + if (suspensePromises.length > 0) { | |
| 6409 | + throw Promise.all(suspensePromises); | |
| 6410 | + } | |
| 6411 | + const observerQueries = observer.getQueries(); | |
| 6412 | + const firstSingleResultWhichShouldThrow = optimisticResult.find( | |
| 6413 | + (result, index) => (0, import_errorBoundaryUtils.getHasError)({ | |
| 6414 | + result, | |
| 6415 | + errorResetBoundary, | |
| 6416 | + throwOnError: defaultedQueries[index]?.throwOnError ?? false, | |
| 6417 | + query: observerQueries[index] | |
| 6418 | + }) | |
| 6419 | + ); | |
| 6420 | + if (firstSingleResultWhichShouldThrow?.error) { | |
| 6421 | + throw firstSingleResultWhichShouldThrow.error; | |
| 6422 | + } | |
| 6423 | + return getCombinedResult(trackResult()); | |
| 6424 | +} | |
| 6425 | +// Annotate the CommonJS export names for ESM import in node: | |
| 6426 | +0 && (0); | |
| 6427 | +//# sourceMappingURL=useQueries.cjs.map | |
| 6428 | + | |
| 6429 | +/***/ }), | |
| 6430 | + | |
| 6431 | +/***/ "../node_modules/@tanstack/react-query/build/modern/useQuery.cjs": | |
| 6432 | +/*!***********************************************************************!*\ | |
| 6433 | + !*** ../node_modules/@tanstack/react-query/build/modern/useQuery.cjs ***! | |
| 6434 | + \***********************************************************************/ | |
| 6435 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 6436 | + | |
| 6437 | +"use strict"; | |
| 6438 | + | |
| 6439 | +"use client"; | |
| 6440 | +var __defProp = Object.defineProperty; | |
| 6441 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 6442 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 6443 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 6444 | +var __export = (target, all) => { | |
| 6445 | + for (var name in all) | |
| 6446 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 6447 | +}; | |
| 6448 | +var __copyProps = (to, from, except, desc) => { | |
| 6449 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 6450 | + for (let key of __getOwnPropNames(from)) | |
| 6451 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 6452 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 6453 | + } | |
| 6454 | + return to; | |
| 6455 | +}; | |
| 6456 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 6457 | + | |
| 6458 | +// src/useQuery.ts | |
| 6459 | +var useQuery_exports = {}; | |
| 6460 | +__export(useQuery_exports, { | |
| 6461 | + useQuery: () => useQuery | |
| 6462 | +}); | |
| 6463 | +module.exports = __toCommonJS(useQuery_exports); | |
| 6464 | +var import_query_core = __webpack_require__(/*! @tanstack/query-core */ "../node_modules/@tanstack/query-core/build/modern/index.cjs"); | |
| 6465 | +var import_useBaseQuery = __webpack_require__(/*! ./useBaseQuery.cjs */ "../node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs"); | |
| 6466 | +function useQuery(options, queryClient) { | |
| 6467 | + return (0, import_useBaseQuery.useBaseQuery)(options, import_query_core.QueryObserver, queryClient); | |
| 6468 | +} | |
| 6469 | +// Annotate the CommonJS export names for ESM import in node: | |
| 6470 | +0 && (0); | |
| 6471 | +//# sourceMappingURL=useQuery.cjs.map | |
| 6472 | + | |
| 6473 | +/***/ }), | |
| 6474 | + | |
| 6475 | +/***/ "../node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs": | |
| 6476 | +/*!***************************************************************************************!*\ | |
| 6477 | + !*** ../node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs ***! | |
| 6478 | + \***************************************************************************************/ | |
| 6479 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 6480 | + | |
| 6481 | +"use strict"; | |
| 6482 | + | |
| 6483 | +"use client"; | |
| 6484 | +var __defProp = Object.defineProperty; | |
| 6485 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 6486 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 6487 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 6488 | +var __export = (target, all) => { | |
| 6489 | + for (var name in all) | |
| 6490 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 6491 | +}; | |
| 6492 | +var __copyProps = (to, from, except, desc) => { | |
| 6493 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 6494 | + for (let key of __getOwnPropNames(from)) | |
| 6495 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 6496 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 6497 | + } | |
| 6498 | + return to; | |
| 6499 | +}; | |
| 6500 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 6501 | + | |
| 6502 | +// src/useSuspenseInfiniteQuery.ts | |
| 6503 | +var useSuspenseInfiniteQuery_exports = {}; | |
| 6504 | +__export(useSuspenseInfiniteQuery_exports, { | |
| 6505 | + useSuspenseInfiniteQuery: () => useSuspenseInfiniteQuery | |
| 6506 | +}); | |
| 6507 | +module.exports = __toCommonJS(useSuspenseInfiniteQuery_exports); | |
| 6508 | +var import_query_core = __webpack_require__(/*! @tanstack/query-core */ "../node_modules/@tanstack/query-core/build/modern/index.cjs"); | |
| 6509 | +var import_useBaseQuery = __webpack_require__(/*! ./useBaseQuery.cjs */ "../node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs"); | |
| 6510 | +var import_suspense = __webpack_require__(/*! ./suspense.cjs */ "../node_modules/@tanstack/react-query/build/modern/suspense.cjs"); | |
| 6511 | +function useSuspenseInfiniteQuery(options, queryClient) { | |
| 6512 | + return (0, import_useBaseQuery.useBaseQuery)( | |
| 6513 | + { | |
| 6514 | + ...options, | |
| 6515 | + enabled: true, | |
| 6516 | + suspense: true, | |
| 6517 | + throwOnError: import_suspense.defaultThrowOnError | |
| 6518 | + }, | |
| 6519 | + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion | |
| 6520 | + import_query_core.InfiniteQueryObserver, | |
| 6521 | + queryClient | |
| 6522 | + ); | |
| 6523 | +} | |
| 6524 | +// Annotate the CommonJS export names for ESM import in node: | |
| 6525 | +0 && (0); | |
| 6526 | +//# sourceMappingURL=useSuspenseInfiniteQuery.cjs.map | |
| 6527 | + | |
| 6528 | +/***/ }), | |
| 6529 | + | |
| 6530 | +/***/ "../node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.cjs": | |
| 6531 | +/*!*********************************************************************************!*\ | |
| 6532 | + !*** ../node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.cjs ***! | |
| 6533 | + \*********************************************************************************/ | |
| 6534 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 6535 | + | |
| 6536 | +"use strict"; | |
| 6537 | + | |
| 6538 | +"use client"; | |
| 6539 | +var __defProp = Object.defineProperty; | |
| 6540 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 6541 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 6542 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 6543 | +var __export = (target, all) => { | |
| 6544 | + for (var name in all) | |
| 6545 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 6546 | +}; | |
| 6547 | +var __copyProps = (to, from, except, desc) => { | |
| 6548 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 6549 | + for (let key of __getOwnPropNames(from)) | |
| 6550 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 6551 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 6552 | + } | |
| 6553 | + return to; | |
| 6554 | +}; | |
| 6555 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 6556 | + | |
| 6557 | +// src/useSuspenseQueries.ts | |
| 6558 | +var useSuspenseQueries_exports = {}; | |
| 6559 | +__export(useSuspenseQueries_exports, { | |
| 6560 | + useSuspenseQueries: () => useSuspenseQueries | |
| 6561 | +}); | |
| 6562 | +module.exports = __toCommonJS(useSuspenseQueries_exports); | |
| 6563 | +var import_useQueries = __webpack_require__(/*! ./useQueries.cjs */ "../node_modules/@tanstack/react-query/build/modern/useQueries.cjs"); | |
| 6564 | +var import_suspense = __webpack_require__(/*! ./suspense.cjs */ "../node_modules/@tanstack/react-query/build/modern/suspense.cjs"); | |
| 6565 | +function useSuspenseQueries(options, queryClient) { | |
| 6566 | + return (0, import_useQueries.useQueries)( | |
| 6567 | + { | |
| 6568 | + ...options, | |
| 6569 | + queries: options.queries.map((query) => ({ | |
| 6570 | + ...query, | |
| 6571 | + suspense: true, | |
| 6572 | + throwOnError: import_suspense.defaultThrowOnError, | |
| 6573 | + enabled: true | |
| 6574 | + })) | |
| 6575 | + }, | |
| 6576 | + queryClient | |
| 6577 | + ); | |
| 6578 | +} | |
| 6579 | +// Annotate the CommonJS export names for ESM import in node: | |
| 6580 | +0 && (0); | |
| 6581 | +//# sourceMappingURL=useSuspenseQueries.cjs.map | |
| 6582 | + | |
| 6583 | +/***/ }), | |
| 6584 | + | |
| 6585 | +/***/ "../node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.cjs": | |
| 6586 | +/*!*******************************************************************************!*\ | |
| 6587 | + !*** ../node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.cjs ***! | |
| 6588 | + \*******************************************************************************/ | |
| 6589 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 6590 | + | |
| 6591 | +"use strict"; | |
| 6592 | + | |
| 6593 | +"use client"; | |
| 6594 | +var __defProp = Object.defineProperty; | |
| 6595 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 6596 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 6597 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 6598 | +var __export = (target, all) => { | |
| 6599 | + for (var name in all) | |
| 6600 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 6601 | +}; | |
| 6602 | +var __copyProps = (to, from, except, desc) => { | |
| 6603 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 6604 | + for (let key of __getOwnPropNames(from)) | |
| 6605 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 6606 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 6607 | + } | |
| 6608 | + return to; | |
| 6609 | +}; | |
| 6610 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 6611 | + | |
| 6612 | +// src/useSuspenseQuery.ts | |
| 6613 | +var useSuspenseQuery_exports = {}; | |
| 6614 | +__export(useSuspenseQuery_exports, { | |
| 6615 | + useSuspenseQuery: () => useSuspenseQuery | |
| 6616 | +}); | |
| 6617 | +module.exports = __toCommonJS(useSuspenseQuery_exports); | |
| 6618 | +var import_query_core = __webpack_require__(/*! @tanstack/query-core */ "../node_modules/@tanstack/query-core/build/modern/index.cjs"); | |
| 6619 | +var import_useBaseQuery = __webpack_require__(/*! ./useBaseQuery.cjs */ "../node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs"); | |
| 6620 | +var import_suspense = __webpack_require__(/*! ./suspense.cjs */ "../node_modules/@tanstack/react-query/build/modern/suspense.cjs"); | |
| 6621 | +function useSuspenseQuery(options, queryClient) { | |
| 6622 | + return (0, import_useBaseQuery.useBaseQuery)( | |
| 6623 | + { | |
| 6624 | + ...options, | |
| 6625 | + enabled: true, | |
| 6626 | + suspense: true, | |
| 6627 | + throwOnError: import_suspense.defaultThrowOnError | |
| 6628 | + }, | |
| 6629 | + import_query_core.QueryObserver, | |
| 6630 | + queryClient | |
| 6631 | + ); | |
| 6632 | +} | |
| 6633 | +// Annotate the CommonJS export names for ESM import in node: | |
| 6634 | +0 && (0); | |
| 6635 | +//# sourceMappingURL=useSuspenseQuery.cjs.map | |
| 6636 | + | |
| 6637 | +/***/ }), | |
| 6638 | + | |
| 6639 | +/***/ "../node_modules/@tanstack/react-query/build/modern/utils.cjs": | |
| 6640 | +/*!********************************************************************!*\ | |
| 6641 | + !*** ../node_modules/@tanstack/react-query/build/modern/utils.cjs ***! | |
| 6642 | + \********************************************************************/ | |
| 6643 | +/***/ ((module) => { | |
| 6644 | + | |
| 6645 | +"use strict"; | |
| 6646 | + | |
| 6647 | +var __defProp = Object.defineProperty; | |
| 6648 | +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 6649 | +var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 6650 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 6651 | +var __export = (target, all) => { | |
| 6652 | + for (var name in all) | |
| 6653 | + __defProp(target, name, { get: all[name], enumerable: true }); | |
| 6654 | +}; | |
| 6655 | +var __copyProps = (to, from, except, desc) => { | |
| 6656 | + if (from && typeof from === "object" || typeof from === "function") { | |
| 6657 | + for (let key of __getOwnPropNames(from)) | |
| 6658 | + if (!__hasOwnProp.call(to, key) && key !== except) | |
| 6659 | + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| 6660 | + } | |
| 6661 | + return to; | |
| 6662 | +}; | |
| 6663 | +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 6664 | + | |
| 6665 | +// src/utils.ts | |
| 6666 | +var utils_exports = {}; | |
| 6667 | +__export(utils_exports, { | |
| 6668 | + shouldThrowError: () => shouldThrowError | |
| 6669 | +}); | |
| 6670 | +module.exports = __toCommonJS(utils_exports); | |
| 6671 | +function shouldThrowError(throwError, params) { | |
| 6672 | + if (typeof throwError === "function") { | |
| 6673 | + return throwError(...params); | |
| 6674 | + } | |
| 6675 | + return !!throwError; | |
| 6676 | +} | |
| 6677 | +// Annotate the CommonJS export names for ESM import in node: | |
| 6678 | +0 && (0); | |
| 6679 | +//# sourceMappingURL=utils.cjs.map | |
| 6680 | + | |
| 6681 | +/***/ }) | |
| 6682 | + | |
| 6683 | +/******/ }); | |
| 6684 | +/************************************************************************/ | |
| 6685 | +/******/ // The module cache | |
| 6686 | +/******/ var __webpack_module_cache__ = {}; | |
| 6687 | +/******/ | |
| 6688 | +/******/ // The require function | |
| 6689 | +/******/ function __webpack_require__(moduleId) { | |
| 6690 | +/******/ // Check if module is in cache | |
| 6691 | +/******/ var cachedModule = __webpack_module_cache__[moduleId]; | |
| 6692 | +/******/ if (cachedModule !== undefined) { | |
| 6693 | +/******/ return cachedModule.exports; | |
| 6694 | +/******/ } | |
| 6695 | +/******/ // Create a new module (and put it into the cache) | |
| 6696 | +/******/ var module = __webpack_module_cache__[moduleId] = { | |
| 6697 | +/******/ // no module.id needed | |
| 6698 | +/******/ // no module.loaded needed | |
| 6699 | +/******/ exports: {} | |
| 6700 | +/******/ }; | |
| 6701 | +/******/ | |
| 6702 | +/******/ // Execute the module function | |
| 6703 | +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); | |
| 6704 | +/******/ | |
| 6705 | +/******/ // Return the exports of the module | |
| 6706 | +/******/ return module.exports; | |
| 6707 | +/******/ } | |
| 6708 | +/******/ | |
| 6709 | +/************************************************************************/ | |
| 6710 | +var __webpack_exports__ = {}; | |
| 6711 | +// This entry need to be wrapped in an IIFE because it need to be in strict mode. | |
| 6712 | +(() => { | |
| 6713 | +"use strict"; | |
| 6714 | +/*!****************************************************!*\ | |
| 6715 | + !*** ../modules/notifications/assets/js/editor.js ***! | |
| 6716 | + \****************************************************/ | |
| 6717 | +/* provided dependency */ var ReactDOM = __webpack_require__(/*! react-dom */ "react-dom"); | |
| 6718 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 6719 | + | |
| 6720 | + | |
| 6721 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 6722 | +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 6723 | +var _editorV = __webpack_require__(/*! ./components/editor-v1 */ "../modules/notifications/assets/js/components/editor-v1.js"); | |
| 6724 | +var isRendered = false; | |
| 6725 | +var onButtonClicked = function onButtonClicked() { | |
| 6726 | + if (!isRendered) { | |
| 6727 | + isRendered = true; | |
| 6728 | + var container = document.createElement('div'); | |
| 6729 | + document.body.append(container); | |
| 6730 | + ReactDOM.render( /*#__PURE__*/_react.default.createElement(_editorV.EditorV1, null), container); | |
| 6731 | + return; | |
| 6732 | + } | |
| 6733 | + elementor.trigger('elementor/editor/panel/whats-new/clicked'); | |
| 6734 | +}; | |
| 6735 | +elementor.on('panel:init', function () { | |
| 6736 | + if (elementorNotifications.is_unread) { | |
| 6737 | + document.body.classList.add('e-has-notification'); | |
| 6738 | + } | |
| 6739 | + elementor.getPanelView().getPages('menu').view.addItem({ | |
| 6740 | + name: 'notification-center', | |
| 6741 | + icon: 'eicon-notification', | |
| 6742 | + title: __('What\'s New', 'elementor'), | |
| 6743 | + callback: onButtonClicked | |
| 6744 | + }, 'navigate_from_page', 'view-page'); | |
| 6745 | +}); | |
| 6746 | +})(); | |
| 6747 | + | |
| 6748 | +/******/ })() | |
| 6749 | +; | |
| 1578 | 6750 | //# sourceMappingURL=editor-notifications.js.map |