/*
 * ATTENTION: An "eval-source-map" devtool has been used.
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([["app/admin/documents/page"],{

/***/ "(app-pages-browser)/./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22C%3A%5C%5CUsers%5C%5CRaymondVerhoef%5C%5CGitea%5C%5Clearning-platform%5C%5Capp%5C%5Cfrontend%5C%5Csrc%5C%5Capp%5C%5Cadmin%5C%5Cdocuments%5C%5Cpage.tsx%22%2C%22ids%22%3A%5B%5D%7D&server=false!":
/*!***********************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22C%3A%5C%5CUsers%5C%5CRaymondVerhoef%5C%5CGitea%5C%5Clearning-platform%5C%5Capp%5C%5Cfrontend%5C%5Csrc%5C%5Capp%5C%5Cadmin%5C%5Cdocuments%5C%5Cpage.tsx%22%2C%22ids%22%3A%5B%5D%7D&server=false! ***!
  \***********************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval(__webpack_require__.ts("Promise.resolve(/*! import() eager */).then(__webpack_require__.bind(__webpack_require__, /*! ./src/app/admin/documents/page.tsx */ \"(app-pages-browser)/./src/app/admin/documents/page.tsx\"));\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL25vZGVfbW9kdWxlcy9uZXh0L2Rpc3QvYnVpbGQvd2VicGFjay9sb2FkZXJzL25leHQtZmxpZ2h0LWNsaWVudC1lbnRyeS1sb2FkZXIuanM/bW9kdWxlcz0lN0IlMjJyZXF1ZXN0JTIyJTNBJTIyQyUzQSU1QyU1Q1VzZXJzJTVDJTVDUmF5bW9uZFZlcmhvZWYlNUMlNUNHaXRlYSU1QyU1Q2xlYXJuaW5nLXBsYXRmb3JtJTVDJTVDYXBwJTVDJTVDZnJvbnRlbmQlNUMlNUNzcmMlNUMlNUNhcHAlNUMlNUNhZG1pbiU1QyU1Q2RvY3VtZW50cyU1QyU1Q3BhZ2UudHN4JTIyJTJDJTIyaWRzJTIyJTNBJTVCJTVEJTdEJnNlcnZlcj1mYWxzZSEiLCJtYXBwaW5ncyI6IkFBQUEsOExBQTZJIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vX05fRS8/MjQ5ZiJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQoLyogd2VicGFja01vZGU6IFwiZWFnZXJcIiAqLyBcIkM6XFxcXFVzZXJzXFxcXFJheW1vbmRWZXJob2VmXFxcXEdpdGVhXFxcXGxlYXJuaW5nLXBsYXRmb3JtXFxcXGFwcFxcXFxmcm9udGVuZFxcXFxzcmNcXFxcYXBwXFxcXGFkbWluXFxcXGRvY3VtZW50c1xcXFxwYWdlLnRzeFwiKTtcbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///(app-pages-browser)/./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22C%3A%5C%5CUsers%5C%5CRaymondVerhoef%5C%5CGitea%5C%5Clearning-platform%5C%5Capp%5C%5Cfrontend%5C%5Csrc%5C%5Capp%5C%5Cadmin%5C%5Cdocuments%5C%5Cpage.tsx%22%2C%22ids%22%3A%5B%5D%7D&server=false!\n"));

/***/ }),

/***/ "(app-pages-browser)/./src/app/admin/documents/page.tsx":
/*!******************************************!*\
  !*** ./src/app/admin/documents/page.tsx ***!
  \******************************************/
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": function() { return /* binding */ DocumentsPage; }\n/* harmony export */ });\n/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-dev-runtime */ \"(app-pages-browser)/./node_modules/next/dist/compiled/react/jsx-dev-runtime.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"(app-pages-browser)/./node_modules/next/dist/compiled/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _components_admin_DocumentUpload__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/admin/DocumentUpload */ \"(app-pages-browser)/./src/components/admin/DocumentUpload.tsx\");\n/* harmony import */ var _components_admin_JobStatusList__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/admin/JobStatusList */ \"(app-pages-browser)/./src/components/admin/JobStatusList.tsx\");\n/* harmony import */ var _lib_hooks_usePBCollection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/lib/hooks/usePBCollection */ \"(app-pages-browser)/./src/lib/hooks/usePBCollection.ts\");\n/* __next_internal_client_entry_do_not_use__ default auto */ \nvar _s = $RefreshSig$();\n\n\n\n\nfunction DocumentsPage() {\n    _s();\n    const { items: documents, loading, refresh } = (0,_lib_hooks_usePBCollection__WEBPACK_IMPORTED_MODULE_4__.usePBCollection)(\"source_documents\", {\n        sort: \"-created\"\n    });\n    return /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n        style: {\n            display: \"flex\",\n            flexDirection: \"column\",\n            gap: \"var(--s-6)\"\n        },\n        children: [\n            /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n                children: [\n                    /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"h1\", {\n                        style: {\n                            margin: \"0 0 var(--s-2)\",\n                            fontSize: \"var(--t-h3)\",\n                            fontWeight: 700,\n                            color: \"var(--fg)\"\n                        },\n                        children: \"Documents\"\n                    }, void 0, false, {\n                        fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\app\\\\admin\\\\documents\\\\page.tsx\",\n                        lineNumber: 17,\n                        columnNumber: 9\n                    }, this),\n                    /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n                        style: {\n                            margin: 0,\n                            fontSize: \"var(--t-body)\",\n                            color: \"var(--fg-muted)\"\n                        },\n                        children: \"Upload source documents to populate the knowledge base.\"\n                    }, void 0, false, {\n                        fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\app\\\\admin\\\\documents\\\\page.tsx\",\n                        lineNumber: 27,\n                        columnNumber: 9\n                    }, this)\n                ]\n            }, void 0, true, {\n                fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\app\\\\admin\\\\documents\\\\page.tsx\",\n                lineNumber: 16,\n                columnNumber: 7\n            }, this),\n            /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_components_admin_DocumentUpload__WEBPACK_IMPORTED_MODULE_2__.DocumentUpload, {\n                onSuccess: refresh\n            }, void 0, false, {\n                fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\app\\\\admin\\\\documents\\\\page.tsx\",\n                lineNumber: 32,\n                columnNumber: 7\n            }, this),\n            /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n                children: [\n                    /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"h2\", {\n                        style: {\n                            margin: \"0 0 var(--s-4)\",\n                            fontSize: \"var(--t-body)\",\n                            fontWeight: 700,\n                            color: \"var(--fg)\"\n                        },\n                        children: \"Document history\"\n                    }, void 0, false, {\n                        fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\app\\\\admin\\\\documents\\\\page.tsx\",\n                        lineNumber: 35,\n                        columnNumber: 9\n                    }, this),\n                    loading ? /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n                        style: {\n                            color: \"var(--fg-muted)\",\n                            fontSize: \"var(--t-body)\"\n                        },\n                        children: \"Loading…\"\n                    }, void 0, false, {\n                        fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\app\\\\admin\\\\documents\\\\page.tsx\",\n                        lineNumber: 46,\n                        columnNumber: 11\n                    }, this) : /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_components_admin_JobStatusList__WEBPACK_IMPORTED_MODULE_3__.JobStatusList, {\n                        documents: documents\n                    }, void 0, false, {\n                        fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\app\\\\admin\\\\documents\\\\page.tsx\",\n                        lineNumber: 48,\n                        columnNumber: 11\n                    }, this)\n                ]\n            }, void 0, true, {\n                fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\app\\\\admin\\\\documents\\\\page.tsx\",\n                lineNumber: 34,\n                columnNumber: 7\n            }, this)\n        ]\n    }, void 0, true, {\n        fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\app\\\\admin\\\\documents\\\\page.tsx\",\n        lineNumber: 15,\n        columnNumber: 5\n    }, this);\n}\n_s(DocumentsPage, \"2RvTkuJBbKN+A7l0OYdnZCa3s20=\", false, function() {\n    return [\n        _lib_hooks_usePBCollection__WEBPACK_IMPORTED_MODULE_4__.usePBCollection\n    ];\n});\n_c = DocumentsPage;\nvar _c;\n$RefreshReg$(_c, \"DocumentsPage\");\n\n\n;\n    // Wrapped in an IIFE to avoid polluting the global scope\n    ;\n    (function () {\n        var _a, _b;\n        // Legacy CSS implementations will `eval` browser code in a Node.js context\n        // to extract CSS. For backwards compatibility, we need to check we're in a\n        // browser context before continuing.\n        if (typeof self !== 'undefined' &&\n            // AMP / No-JS mode does not inject these helpers:\n            '$RefreshHelpers$' in self) {\n            // @ts-ignore __webpack_module__ is global\n            var currentExports = module.exports;\n            // @ts-ignore __webpack_module__ is global\n            var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n            // This cannot happen in MainTemplate because the exports mismatch between\n            // templating and execution.\n            self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n            // A module can be accepted automatically based on its exports, e.g. when\n            // it is a Refresh Boundary.\n            if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n                // Save the previous exports signature on update so we can compare the boundary\n                // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n                module.hot.dispose(function (data) {\n                    data.prevSignature =\n                        self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n                });\n                // Unconditionally accept an update to this module, we'll check if it's\n                // still a Refresh Boundary later.\n                // @ts-ignore importMeta is replaced in the loader\n                module.hot.accept();\n                // This field is set when the previous version of this module was a\n                // Refresh Boundary, letting us know we need to check for invalidation or\n                // enqueue an update.\n                if (prevSignature !== null) {\n                    // A boundary can become ineligible if its exports are incompatible\n                    // with the previous exports.\n                    //\n                    // For example, if you add/remove/change exports, we'll want to\n                    // re-execute the importing modules, and force those components to\n                    // re-render. Similarly, if you convert a class component to a\n                    // function, we want to invalidate the boundary.\n                    if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n                        module.hot.invalidate();\n                    }\n                    else {\n                        self.$RefreshHelpers$.scheduleUpdate();\n                    }\n                }\n            }\n            else {\n                // Since we just executed the code for the module, it's possible that the\n                // new exports made it ineligible for being a boundary.\n                // We only care about the case when we were _previously_ a boundary,\n                // because we already accepted this update (accidental side effect).\n                var isNoLongerABoundary = prevSignature !== null;\n                if (isNoLongerABoundary) {\n                    module.hot.invalidate();\n                }\n            }\n        }\n    })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL3NyYy9hcHAvYWRtaW4vZG9jdW1lbnRzL3BhZ2UudHN4IiwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztBQUN5QjtBQUN5QztBQUNGO0FBQ0g7QUFHOUMsU0FBU0k7O0lBQ3RCLE1BQU0sRUFBRUMsT0FBT0MsU0FBUyxFQUFFQyxPQUFPLEVBQUVDLE9BQU8sRUFBRSxHQUFHTCwyRUFBZUEsQ0FDNUQsb0JBQ0E7UUFBRU0sTUFBTTtJQUFXO0lBR3JCLHFCQUNFLDhEQUFDQztRQUFJQyxPQUFPO1lBQUVDLFNBQVM7WUFBUUMsZUFBZTtZQUFVQyxLQUFLO1FBQWE7OzBCQUN4RSw4REFBQ0o7O2tDQUNDLDhEQUFDSzt3QkFDQ0osT0FBTzs0QkFDTEssUUFBUTs0QkFDUkMsVUFBVTs0QkFDVkMsWUFBWTs0QkFDWkMsT0FBTzt3QkFDVDtrQ0FDRDs7Ozs7O2tDQUdELDhEQUFDQzt3QkFBRVQsT0FBTzs0QkFBRUssUUFBUTs0QkFBR0MsVUFBVTs0QkFBaUJFLE9BQU87d0JBQWtCO2tDQUFHOzs7Ozs7Ozs7Ozs7MEJBS2hGLDhEQUFDbEIsNEVBQWNBO2dCQUFDb0IsV0FBV2I7Ozs7OzswQkFFM0IsOERBQUNFOztrQ0FDQyw4REFBQ1k7d0JBQ0NYLE9BQU87NEJBQ0xLLFFBQVE7NEJBQ1JDLFVBQVU7NEJBQ1ZDLFlBQVk7NEJBQ1pDLE9BQU87d0JBQ1Q7a0NBQ0Q7Ozs7OztvQkFHQVosd0JBQ0MsOERBQUNHO3dCQUFJQyxPQUFPOzRCQUFFUSxPQUFPOzRCQUFtQkYsVUFBVTt3QkFBZ0I7a0NBQUc7Ozs7OzZDQUVyRSw4REFBQ2YsMEVBQWFBO3dCQUFDSSxXQUFXQTs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBS3BDO0dBN0N3QkY7O1FBQ3lCRCx1RUFBZUE7OztLQUR4Q0MiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9fTl9FLy4vc3JjL2FwcC9hZG1pbi9kb2N1bWVudHMvcGFnZS50c3g/ODMxMSJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIGNsaWVudCdcbmltcG9ydCBSZWFjdCBmcm9tICdyZWFjdCdcbmltcG9ydCB7IERvY3VtZW50VXBsb2FkIH0gZnJvbSAnQC9jb21wb25lbnRzL2FkbWluL0RvY3VtZW50VXBsb2FkJ1xuaW1wb3J0IHsgSm9iU3RhdHVzTGlzdCB9IGZyb20gJ0AvY29tcG9uZW50cy9hZG1pbi9Kb2JTdGF0dXNMaXN0J1xuaW1wb3J0IHsgdXNlUEJDb2xsZWN0aW9uIH0gZnJvbSAnQC9saWIvaG9va3MvdXNlUEJDb2xsZWN0aW9uJ1xuaW1wb3J0IHR5cGUgeyBTb3VyY2VEb2N1bWVudCB9IGZyb20gJ0AvdHlwZXMnXG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIERvY3VtZW50c1BhZ2UoKSB7XG4gIGNvbnN0IHsgaXRlbXM6IGRvY3VtZW50cywgbG9hZGluZywgcmVmcmVzaCB9ID0gdXNlUEJDb2xsZWN0aW9uPFNvdXJjZURvY3VtZW50PihcbiAgICAnc291cmNlX2RvY3VtZW50cycsXG4gICAgeyBzb3J0OiAnLWNyZWF0ZWQnIH0sXG4gIClcblxuICByZXR1cm4gKFxuICAgIDxkaXYgc3R5bGU9e3sgZGlzcGxheTogJ2ZsZXgnLCBmbGV4RGlyZWN0aW9uOiAnY29sdW1uJywgZ2FwOiAndmFyKC0tcy02KScgfX0+XG4gICAgICA8ZGl2PlxuICAgICAgICA8aDFcbiAgICAgICAgICBzdHlsZT17e1xuICAgICAgICAgICAgbWFyZ2luOiAnMCAwIHZhcigtLXMtMiknLFxuICAgICAgICAgICAgZm9udFNpemU6ICd2YXIoLS10LWgzKScsXG4gICAgICAgICAgICBmb250V2VpZ2h0OiA3MDAsXG4gICAgICAgICAgICBjb2xvcjogJ3ZhcigtLWZnKScsXG4gICAgICAgICAgfX1cbiAgICAgICAgPlxuICAgICAgICAgIERvY3VtZW50c1xuICAgICAgICA8L2gxPlxuICAgICAgICA8cCBzdHlsZT17eyBtYXJnaW46IDAsIGZvbnRTaXplOiAndmFyKC0tdC1ib2R5KScsIGNvbG9yOiAndmFyKC0tZmctbXV0ZWQpJyB9fT5cbiAgICAgICAgICBVcGxvYWQgc291cmNlIGRvY3VtZW50cyB0byBwb3B1bGF0ZSB0aGUga25vd2xlZGdlIGJhc2UuXG4gICAgICAgIDwvcD5cbiAgICAgIDwvZGl2PlxuXG4gICAgICA8RG9jdW1lbnRVcGxvYWQgb25TdWNjZXNzPXtyZWZyZXNofSAvPlxuXG4gICAgICA8ZGl2PlxuICAgICAgICA8aDJcbiAgICAgICAgICBzdHlsZT17e1xuICAgICAgICAgICAgbWFyZ2luOiAnMCAwIHZhcigtLXMtNCknLFxuICAgICAgICAgICAgZm9udFNpemU6ICd2YXIoLS10LWJvZHkpJyxcbiAgICAgICAgICAgIGZvbnRXZWlnaHQ6IDcwMCxcbiAgICAgICAgICAgIGNvbG9yOiAndmFyKC0tZmcpJyxcbiAgICAgICAgICB9fVxuICAgICAgICA+XG4gICAgICAgICAgRG9jdW1lbnQgaGlzdG9yeVxuICAgICAgICA8L2gyPlxuICAgICAgICB7bG9hZGluZyA/IChcbiAgICAgICAgICA8ZGl2IHN0eWxlPXt7IGNvbG9yOiAndmFyKC0tZmctbXV0ZWQpJywgZm9udFNpemU6ICd2YXIoLS10LWJvZHkpJyB9fT5Mb2FkaW5n4oCmPC9kaXY+XG4gICAgICAgICkgOiAoXG4gICAgICAgICAgPEpvYlN0YXR1c0xpc3QgZG9jdW1lbnRzPXtkb2N1bWVudHN9IC8+XG4gICAgICAgICl9XG4gICAgICA8L2Rpdj5cbiAgICA8L2Rpdj5cbiAgKVxufVxuIl0sIm5hbWVzIjpbIlJlYWN0IiwiRG9jdW1lbnRVcGxvYWQiLCJKb2JTdGF0dXNMaXN0IiwidXNlUEJDb2xsZWN0aW9uIiwiRG9jdW1lbnRzUGFnZSIsIml0ZW1zIiwiZG9jdW1lbnRzIiwibG9hZGluZyIsInJlZnJlc2giLCJzb3J0IiwiZGl2Iiwic3R5bGUiLCJkaXNwbGF5IiwiZmxleERpcmVjdGlvbiIsImdhcCIsImgxIiwibWFyZ2luIiwiZm9udFNpemUiLCJmb250V2VpZ2h0IiwiY29sb3IiLCJwIiwib25TdWNjZXNzIiwiaDIiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///(app-pages-browser)/./src/app/admin/documents/page.tsx\n"));

/***/ }),

/***/ "(app-pages-browser)/./src/components/admin/DocumentUpload.tsx":
/*!*************************************************!*\
  !*** ./src/components/admin/DocumentUpload.tsx ***!
  \*************************************************/
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   DocumentUpload: function() { return /* binding */ DocumentUpload; }\n/* harmony export */ });\n/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-dev-runtime */ \"(app-pages-browser)/./node_modules/next/dist/compiled/react/jsx-dev-runtime.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"(app-pages-browser)/./node_modules/next/dist/compiled/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _components_ui_Button__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/ui/Button */ \"(app-pages-browser)/./src/components/ui/Button.tsx\");\n/* harmony import */ var _components_ui_ProgressBar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/ui/ProgressBar */ \"(app-pages-browser)/./src/components/ui/ProgressBar.tsx\");\n/* harmony import */ var _lib_hooks_useIngestionStatus__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/lib/hooks/useIngestionStatus */ \"(app-pages-browser)/./src/lib/hooks/useIngestionStatus.ts\");\n/* harmony import */ var _lib_pocketbase__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/lib/pocketbase */ \"(app-pages-browser)/./src/lib/pocketbase.ts\");\n/* harmony import */ var _lib_services__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/lib/services */ \"(app-pages-browser)/./src/lib/services.ts\");\n/* __next_internal_client_entry_do_not_use__ DocumentUpload auto */ \nvar _s = $RefreshSig$();\n\n\n\n\n\n\nfunction DocumentUpload(param) {\n    let { onSuccess } = param;\n    _s();\n    const fileInputRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);\n    const [uploading, setUploading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);\n    const [jobId, setJobId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null);\n    const [uploadError, setUploadError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null);\n    const [dragOver, setDragOver] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);\n    const { status, progress } = (0,_lib_hooks_useIngestionStatus__WEBPACK_IMPORTED_MODULE_4__.useIngestionStatus)(jobId);\n    const handleFiles = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async (files)=>{\n        if (!files || files.length === 0) return;\n        const file = files[0];\n        if (!file) return;\n        const allowed = [\n            \".pdf\",\n            \".md\",\n            \".txt\"\n        ];\n        const ext = file.name.slice(file.name.lastIndexOf(\".\")).toLowerCase();\n        if (!allowed.includes(ext)) {\n            setUploadError(\"Unsupported file type: \".concat(ext, \". Use PDF, MD, or TXT.\"));\n            return;\n        }\n        setUploadError(null);\n        setUploading(true);\n        setJobId(null);\n        try {\n            // Create record in PocketBase\n            const format = ext.slice(1);\n            // Force explicit MIME type — Windows doesn't register .md and sends\n            // application/octet-stream which PocketBase rejects.\n            const mimeMap = {\n                pdf: \"application/pdf\",\n                md: \"text/markdown\",\n                txt: \"text/plain\"\n            };\n            var _mimeMap_format;\n            const blob = new Blob([\n                file\n            ], {\n                type: (_mimeMap_format = mimeMap[format]) !== null && _mimeMap_format !== void 0 ? _mimeMap_format : file.type\n            });\n            const fd = new FormData();\n            fd.append(\"file\", blob, file.name);\n            fd.append(\"filename\", file.name);\n            fd.append(\"format\", format);\n            fd.append(\"status\", \"processing\");\n            const doc = await _lib_pocketbase__WEBPACK_IMPORTED_MODULE_5__.pb.collection(\"source_documents\").create(fd);\n            var _process_env_NEXT_PUBLIC_POCKETBASE_URL;\n            // Build PocketBase file download URL\n            const pbUrl = (_process_env_NEXT_PUBLIC_POCKETBASE_URL = \"http://localhost:8090\") !== null && _process_env_NEXT_PUBLIC_POCKETBASE_URL !== void 0 ? _process_env_NEXT_PUBLIC_POCKETBASE_URL : \"http://localhost:8090\";\n            const fileUrl = \"\".concat(pbUrl, \"/api/files/source_documents/\").concat(doc.id, \"/\").concat(doc.file);\n            // Kick off ingestion\n            const { jobId: jId } = await (0,_lib_services__WEBPACK_IMPORTED_MODULE_6__.postIngest)({\n                documentId: doc.id,\n                filename: file.name,\n                format,\n                fileUrl\n            });\n            setJobId(jId);\n        } catch (err) {\n            var _pbErr_response;\n            // PocketBase ClientResponseError has a `response` with field details\n            const pbErr = err;\n            const detail = ((_pbErr_response = pbErr.response) === null || _pbErr_response === void 0 ? void 0 : _pbErr_response.data) ? Object.entries(pbErr.response.data).map((param)=>{\n                let [f, v] = param;\n                var _v_message;\n                return \"\".concat(f, \": \").concat((_v_message = v === null || v === void 0 ? void 0 : v.message) !== null && _v_message !== void 0 ? _v_message : \"\");\n            }).join(\", \") : null;\n            setUploadError(detail !== null && detail !== void 0 ? detail : err instanceof Error ? err.message : \"Upload failed\");\n        } finally{\n            setUploading(false);\n        }\n    }, []);\n    function handleChange(e) {\n        void handleFiles(e.target.files);\n        e.target.value = \"\";\n    }\n    function handleDrop(e) {\n        e.preventDefault();\n        setDragOver(false);\n        void handleFiles(e.dataTransfer.files);\n    }\n    function handleDragOver(e) {\n        e.preventDefault();\n        setDragOver(true);\n    }\n    function handleDragLeave() {\n        setDragOver(false);\n    }\n    const isDone = (status === null || status === void 0 ? void 0 : status.status) === \"done\";\n    const isFailed = (status === null || status === void 0 ? void 0 : status.status) === \"failed\";\n    if (isDone && jobId) {\n        return /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n            style: {\n                background: \"var(--success)\",\n                borderRadius: \"var(--r-md)\",\n                padding: \"var(--s-5)\",\n                textAlign: \"center\",\n                display: \"flex\",\n                flexDirection: \"column\",\n                gap: \"var(--s-3)\"\n            },\n            children: [\n                /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n                    style: {\n                        margin: 0,\n                        fontWeight: 600,\n                        color: \"var(--teal-900)\"\n                    },\n                    children: [\n                        \"Ingestion complete! \",\n                        status.themesFound,\n                        \" themes, \",\n                        status.topicsFound,\n                        \" topics found.\"\n                    ]\n                }, void 0, true, {\n                    fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\admin\\\\DocumentUpload.tsx\",\n                    lineNumber: 124,\n                    columnNumber: 9\n                }, this),\n                /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_components_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Button, {\n                    variant: \"secondary\",\n                    size: \"sm\",\n                    onClick: ()=>{\n                        setJobId(null);\n                        onSuccess();\n                    },\n                    children: \"Upload another\"\n                }, void 0, false, {\n                    fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\admin\\\\DocumentUpload.tsx\",\n                    lineNumber: 127,\n                    columnNumber: 9\n                }, this)\n            ]\n        }, void 0, true, {\n            fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\admin\\\\DocumentUpload.tsx\",\n            lineNumber: 113,\n            columnNumber: 7\n        }, this);\n    }\n    var _status_reason;\n    return /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n        style: {\n            display: \"flex\",\n            flexDirection: \"column\",\n            gap: \"var(--s-4)\"\n        },\n        children: [\n            /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n                onDrop: handleDrop,\n                onDragOver: handleDragOver,\n                onDragLeave: handleDragLeave,\n                onClick: ()=>{\n                    var _fileInputRef_current;\n                    return (_fileInputRef_current = fileInputRef.current) === null || _fileInputRef_current === void 0 ? void 0 : _fileInputRef_current.click();\n                },\n                style: {\n                    border: \"2px dashed \".concat(dragOver ? \"var(--accent)\" : \"var(--cream)\"),\n                    borderRadius: \"var(--r-lg)\",\n                    padding: \"var(--s-8, 64px) var(--s-5)\",\n                    textAlign: \"center\",\n                    cursor: \"pointer\",\n                    background: dragOver ? \"var(--accent-soft)\" : \"var(--bg-warm)\",\n                    transition: \"background 150ms, border-color 150ms\"\n                },\n                children: [\n                    /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"input\", {\n                        ref: fileInputRef,\n                        type: \"file\",\n                        accept: \".pdf,.md,.txt\",\n                        style: {\n                            display: \"none\"\n                        },\n                        onChange: handleChange\n                    }, void 0, false, {\n                        fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\admin\\\\DocumentUpload.tsx\",\n                        lineNumber: 158,\n                        columnNumber: 9\n                    }, this),\n                    /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n                        style: {\n                            margin: \"0 0 var(--s-2)\",\n                            fontSize: \"var(--t-lead)\",\n                            fontWeight: 600,\n                            color: \"var(--fg)\"\n                        },\n                        children: \"Drop a document here\"\n                    }, void 0, false, {\n                        fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\admin\\\\DocumentUpload.tsx\",\n                        lineNumber: 165,\n                        columnNumber: 9\n                    }, this),\n                    /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n                        style: {\n                            margin: 0,\n                            fontSize: \"var(--t-small)\",\n                            color: \"var(--fg-muted)\"\n                        },\n                        children: \"or tap to browse — PDF, Markdown, TXT\"\n                    }, void 0, false, {\n                        fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\admin\\\\DocumentUpload.tsx\",\n                        lineNumber: 175,\n                        columnNumber: 9\n                    }, this)\n                ]\n            }, void 0, true, {\n                fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\admin\\\\DocumentUpload.tsx\",\n                lineNumber: 143,\n                columnNumber: 7\n            }, this),\n            uploadError && /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n                style: {\n                    background: \"#f8d7da\",\n                    color: \"#c0392b\",\n                    borderRadius: \"var(--r-sm)\",\n                    padding: \"var(--s-3) var(--s-4)\",\n                    fontSize: \"var(--t-small)\"\n                },\n                children: uploadError\n            }, void 0, false, {\n                fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\admin\\\\DocumentUpload.tsx\",\n                lineNumber: 181,\n                columnNumber: 9\n            }, this),\n            (uploading || jobId) && /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n                style: {\n                    display: \"flex\",\n                    flexDirection: \"column\",\n                    gap: \"var(--s-2)\"\n                },\n                children: [\n                    /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_components_ui_ProgressBar__WEBPACK_IMPORTED_MODULE_3__.ProgressBar, {\n                        value: uploading ? 5 : progress,\n                        label: uploading ? \"Uploading…\" : isFailed ? \"Failed: \".concat((_status_reason = status === null || status === void 0 ? void 0 : status.reason) !== null && _status_reason !== void 0 ? _status_reason : \"unknown error\") : (status === null || status === void 0 ? void 0 : status.status) ? \"\".concat(status.status.charAt(0).toUpperCase()).concat(status.status.slice(1), \"…\") : \"Processing…\",\n                        color: isFailed ? \"#c0392b\" : \"var(--accent)\"\n                    }, void 0, false, {\n                        fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\admin\\\\DocumentUpload.tsx\",\n                        lineNumber: 196,\n                        columnNumber: 11\n                    }, this),\n                    status && /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n                        style: {\n                            fontSize: \"var(--t-small)\",\n                            color: \"var(--fg-muted)\",\n                            display: \"flex\",\n                            gap: \"var(--s-4)\",\n                            flexWrap: \"wrap\"\n                        },\n                        children: [\n                            /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n                                children: [\n                                    \"Chunks: \",\n                                    status.chunksEmbedded,\n                                    \"/\",\n                                    status.chunksTotal\n                                ]\n                            }, void 0, true, {\n                                fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\admin\\\\DocumentUpload.tsx\",\n                                lineNumber: 219,\n                                columnNumber: 15\n                            }, this),\n                            /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n                                children: [\n                                    \"Themes: \",\n                                    status.themesFound\n                                ]\n                            }, void 0, true, {\n                                fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\admin\\\\DocumentUpload.tsx\",\n                                lineNumber: 220,\n                                columnNumber: 15\n                            }, this),\n                            /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n                                children: [\n                                    \"Topics: \",\n                                    status.topicsFound\n                                ]\n                            }, void 0, true, {\n                                fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\admin\\\\DocumentUpload.tsx\",\n                                lineNumber: 221,\n                                columnNumber: 15\n                            }, this)\n                        ]\n                    }, void 0, true, {\n                        fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\admin\\\\DocumentUpload.tsx\",\n                        lineNumber: 210,\n                        columnNumber: 13\n                    }, this)\n                ]\n            }, void 0, true, {\n                fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\admin\\\\DocumentUpload.tsx\",\n                lineNumber: 195,\n                columnNumber: 9\n            }, this)\n        ]\n    }, void 0, true, {\n        fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\admin\\\\DocumentUpload.tsx\",\n        lineNumber: 142,\n        columnNumber: 5\n    }, this);\n}\n_s(DocumentUpload, \"YWcKUF7Ga0zlCuEtKN+CCdia0aE=\", false, function() {\n    return [\n        _lib_hooks_useIngestionStatus__WEBPACK_IMPORTED_MODULE_4__.useIngestionStatus\n    ];\n});\n_c = DocumentUpload;\nvar _c;\n$RefreshReg$(_c, \"DocumentUpload\");\n\n\n;\n    // Wrapped in an IIFE to avoid polluting the global scope\n    ;\n    (function () {\n        var _a, _b;\n        // Legacy CSS implementations will `eval` browser code in a Node.js context\n        // to extract CSS. For backwards compatibility, we need to check we're in a\n        // browser context before continuing.\n        if (typeof self !== 'undefined' &&\n            // AMP / No-JS mode does not inject these helpers:\n            '$RefreshHelpers$' in self) {\n            // @ts-ignore __webpack_module__ is global\n            var currentExports = module.exports;\n            // @ts-ignore __webpack_module__ is global\n            var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n            // This cannot happen in MainTemplate because the exports mismatch between\n            // templating and execution.\n            self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n            // A module can be accepted automatically based on its exports, e.g. when\n            // it is a Refresh Boundary.\n            if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n                // Save the previous exports signature on update so we can compare the boundary\n                // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n                module.hot.dispose(function (data) {\n                    data.prevSignature =\n                        self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n                });\n                // Unconditionally accept an update to this module, we'll check if it's\n                // still a Refresh Boundary later.\n                // @ts-ignore importMeta is replaced in the loader\n                module.hot.accept();\n                // This field is set when the previous version of this module was a\n                // Refresh Boundary, letting us know we need to check for invalidation or\n                // enqueue an update.\n                if (prevSignature !== null) {\n                    // A boundary can become ineligible if its exports are incompatible\n                    // with the previous exports.\n                    //\n                    // For example, if you add/remove/change exports, we'll want to\n                    // re-execute the importing modules, and force those components to\n                    // re-render. Similarly, if you convert a class component to a\n                    // function, we want to invalidate the boundary.\n                    if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n                        module.hot.invalidate();\n                    }\n                    else {\n                        self.$RefreshHelpers$.scheduleUpdate();\n                    }\n                }\n            }\n            else {\n                // Since we just executed the code for the module, it's possible that the\n                // new exports made it ineligible for being a boundary.\n                // We only care about the case when we were _previously_ a boundary,\n                // because we already accepted this update (accidental side effect).\n                var isNoLongerABoundary = prevSignature !== null;\n                if (isNoLongerABoundary) {\n                    module.hot.invalidate();\n                }\n            }\n        }\n    })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64, \n//# sourceURL=webpack-internal:///(app-pages-browser)/./src/components/admin/DocumentUpload.tsx\n"));

/***/ }),

/***/ "(app-pages-browser)/./src/components/admin/JobStatusList.tsx":
/*!************************************************!*\
  !*** ./src/components/admin/JobStatusList.tsx ***!
  \************************************************/
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   JobStatusList: function() { return /* binding */ JobStatusList; }\n/* harmony export */ });\n/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-dev-runtime */ \"(app-pages-browser)/./node_modules/next/dist/compiled/react/jsx-dev-runtime.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"(app-pages-browser)/./node_modules/next/dist/compiled/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _components_ui_StatusBadge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/ui/StatusBadge */ \"(app-pages-browser)/./src/components/ui/StatusBadge.tsx\");\n/* __next_internal_client_entry_do_not_use__ JobStatusList auto */ \n\n\nfunction formatDate(iso) {\n    if (!iso) return \"—\";\n    try {\n        return new Intl.DateTimeFormat(\"en\", {\n            month: \"short\",\n            day: \"numeric\",\n            hour: \"2-digit\",\n            minute: \"2-digit\"\n        }).format(new Date(iso));\n    } catch (e) {\n        return iso;\n    }\n}\nfunction JobStatusList(param) {\n    let { documents } = param;\n    if (documents.length === 0) {\n        return /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n            style: {\n                color: \"var(--fg-muted)\",\n                fontSize: \"var(--t-body)\",\n                padding: \"var(--s-4)\"\n            },\n            children: \"No documents yet.\"\n        }, void 0, false, {\n            fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\admin\\\\JobStatusList.tsx\",\n            lineNumber: 27,\n            columnNumber: 7\n        }, this);\n    }\n    return /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n        style: {\n            display: \"flex\",\n            flexDirection: \"column\",\n            gap: \"var(--s-2)\"\n        },\n        children: documents.map((doc)=>/*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n                style: {\n                    background: \"var(--bg-warm)\",\n                    borderRadius: \"var(--r-sm)\",\n                    padding: \"var(--s-3) var(--s-4)\",\n                    display: \"flex\",\n                    alignItems: \"center\",\n                    gap: \"var(--s-3)\",\n                    flexWrap: \"wrap\"\n                },\n                children: [\n                    /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n                        style: {\n                            flex: 1,\n                            minWidth: 0\n                        },\n                        children: [\n                            /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n                                style: {\n                                    margin: 0,\n                                    fontWeight: 600,\n                                    fontSize: \"var(--t-body)\",\n                                    color: \"var(--fg)\",\n                                    overflow: \"hidden\",\n                                    textOverflow: \"ellipsis\",\n                                    whiteSpace: \"nowrap\"\n                                },\n                                children: doc.filename\n                            }, void 0, false, {\n                                fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\admin\\\\JobStatusList.tsx\",\n                                lineNumber: 49,\n                                columnNumber: 13\n                            }, this),\n                            /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n                                style: {\n                                    margin: 0,\n                                    fontSize: \"var(--t-small)\",\n                                    color: \"var(--fg-muted)\"\n                                },\n                                children: [\n                                    doc.chunk_count,\n                                    \" chunks \\xb7 \",\n                                    formatDate(doc.ingested_at)\n                                ]\n                            }, void 0, true, {\n                                fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\admin\\\\JobStatusList.tsx\",\n                                lineNumber: 62,\n                                columnNumber: 13\n                            }, this)\n                        ]\n                    }, void 0, true, {\n                        fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\admin\\\\JobStatusList.tsx\",\n                        lineNumber: 48,\n                        columnNumber: 11\n                    }, this),\n                    /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n                        style: {\n                            display: \"flex\",\n                            alignItems: \"center\",\n                            gap: \"var(--s-2)\"\n                        },\n                        children: [\n                            /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n                                style: {\n                                    fontSize: \"var(--t-label)\",\n                                    fontFamily: \"var(--font-mono)\",\n                                    textTransform: \"uppercase\",\n                                    color: \"var(--fg-subtle)\"\n                                },\n                                children: doc.format\n                            }, void 0, false, {\n                                fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\admin\\\\JobStatusList.tsx\",\n                                lineNumber: 67,\n                                columnNumber: 13\n                            }, this),\n                            /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_components_ui_StatusBadge__WEBPACK_IMPORTED_MODULE_2__.StatusBadge, {\n                                status: doc.status\n                            }, void 0, false, {\n                                fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\admin\\\\JobStatusList.tsx\",\n                                lineNumber: 77,\n                                columnNumber: 13\n                            }, this)\n                        ]\n                    }, void 0, true, {\n                        fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\admin\\\\JobStatusList.tsx\",\n                        lineNumber: 66,\n                        columnNumber: 11\n                    }, this)\n                ]\n            }, doc.id, true, {\n                fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\admin\\\\JobStatusList.tsx\",\n                lineNumber: 36,\n                columnNumber: 9\n            }, this))\n    }, void 0, false, {\n        fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\admin\\\\JobStatusList.tsx\",\n        lineNumber: 34,\n        columnNumber: 5\n    }, this);\n}\n_c = JobStatusList;\nvar _c;\n$RefreshReg$(_c, \"JobStatusList\");\n\n\n;\n    // Wrapped in an IIFE to avoid polluting the global scope\n    ;\n    (function () {\n        var _a, _b;\n        // Legacy CSS implementations will `eval` browser code in a Node.js context\n        // to extract CSS. For backwards compatibility, we need to check we're in a\n        // browser context before continuing.\n        if (typeof self !== 'undefined' &&\n            // AMP / No-JS mode does not inject these helpers:\n            '$RefreshHelpers$' in self) {\n            // @ts-ignore __webpack_module__ is global\n            var currentExports = module.exports;\n            // @ts-ignore __webpack_module__ is global\n            var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n            // This cannot happen in MainTemplate because the exports mismatch between\n            // templating and execution.\n            self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n            // A module can be accepted automatically based on its exports, e.g. when\n            // it is a Refresh Boundary.\n            if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n                // Save the previous exports signature on update so we can compare the boundary\n                // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n                module.hot.dispose(function (data) {\n                    data.prevSignature =\n                        self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n                });\n                // Unconditionally accept an update to this module, we'll check if it's\n                // still a Refresh Boundary later.\n                // @ts-ignore importMeta is replaced in the loader\n                module.hot.accept();\n                // This field is set when the previous version of this module was a\n                // Refresh Boundary, letting us know we need to check for invalidation or\n                // enqueue an update.\n                if (prevSignature !== null) {\n                    // A boundary can become ineligible if its exports are incompatible\n                    // with the previous exports.\n                    //\n                    // For example, if you add/remove/change exports, we'll want to\n                    // re-execute the importing modules, and force those components to\n                    // re-render. Similarly, if you convert a class component to a\n                    // function, we want to invalidate the boundary.\n                    if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n                        module.hot.invalidate();\n                    }\n                    else {\n                        self.$RefreshHelpers$.scheduleUpdate();\n                    }\n                }\n            }\n            else {\n                // Since we just executed the code for the module, it's possible that the\n                // new exports made it ineligible for being a boundary.\n                // We only care about the case when we were _previously_ a boundary,\n                // because we already accepted this update (accidental side effect).\n                var isNoLongerABoundary = prevSignature !== null;\n                if (isNoLongerABoundary) {\n                    module.hot.invalidate();\n                }\n            }\n        }\n    })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64, \n//# sourceURL=webpack-internal:///(app-pages-browser)/./src/components/admin/JobStatusList.tsx\n"));

/***/ }),

/***/ "(app-pages-browser)/./src/components/ui/Button.tsx":
/*!**************************************!*\
  !*** ./src/components/ui/Button.tsx ***!
  \**************************************/
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   Button: function() { return /* binding */ Button; }\n/* harmony export */ });\n/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-dev-runtime */ \"(app-pages-browser)/./node_modules/next/dist/compiled/react/jsx-dev-runtime.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"(app-pages-browser)/./node_modules/next/dist/compiled/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* __next_internal_client_entry_do_not_use__ Button auto */ \n\nconst variantStyles = {\n    primary: {\n        background: \"var(--accent)\",\n        color: \"var(--paper)\",\n        border: \"none\"\n    },\n    secondary: {\n        background: \"var(--bg-warm)\",\n        color: \"var(--fg)\",\n        border: \"1.5px solid var(--cream)\"\n    },\n    danger: {\n        background: \"#c0392b\",\n        color: \"var(--paper)\",\n        border: \"none\"\n    },\n    ghost: {\n        background: \"transparent\",\n        color: \"var(--fg)\",\n        border: \"1.5px solid var(--cream)\"\n    }\n};\nconst sizeStyles = {\n    sm: {\n        fontSize: \"var(--t-small)\",\n        padding: \"var(--s-2) var(--s-3)\",\n        minHeight: \"36px\",\n        borderRadius: \"var(--r-sm)\"\n    },\n    md: {\n        fontSize: \"var(--t-body)\",\n        padding: \"var(--s-2) var(--s-5)\",\n        minHeight: \"44px\",\n        borderRadius: \"var(--r-md)\"\n    },\n    lg: {\n        fontSize: \"var(--t-lead)\",\n        padding: \"var(--s-3) var(--s-6)\",\n        minHeight: \"52px\",\n        borderRadius: \"var(--r-lg)\"\n    }\n};\nfunction Button(param) {\n    let { variant = \"primary\", size = \"md\", loading = false, disabled, children, style, ...rest } = param;\n    return /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"button\", {\n        disabled: disabled !== null && disabled !== void 0 ? disabled : loading,\n        style: {\n            display: \"inline-flex\",\n            alignItems: \"center\",\n            justifyContent: \"center\",\n            gap: \"var(--s-2)\",\n            fontFamily: \"var(--font-sans)\",\n            fontWeight: 500,\n            cursor: (disabled !== null && disabled !== void 0 ? disabled : loading) ? \"not-allowed\" : \"pointer\",\n            opacity: (disabled !== null && disabled !== void 0 ? disabled : loading) ? 0.6 : 1,\n            transition: \"opacity 150ms, transform 100ms\",\n            ...variantStyles[variant],\n            ...sizeStyles[size],\n            ...style\n        },\n        ...rest,\n        children: loading ? /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {\n            children: [\n                /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(Spinner, {}, void 0, false, {\n                    fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\ui\\\\Button.tsx\",\n                    lineNumber: 88,\n                    columnNumber: 11\n                }, this),\n                children\n            ]\n        }, void 0, true) : children\n    }, void 0, false, {\n        fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\ui\\\\Button.tsx\",\n        lineNumber: 68,\n        columnNumber: 5\n    }, this);\n}\n_c = Button;\nfunction Spinner() {\n    return /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n        style: {\n            width: \"16px\",\n            height: \"16px\",\n            border: \"2px solid currentColor\",\n            borderTopColor: \"transparent\",\n            borderRadius: \"50%\",\n            display: \"inline-block\",\n            animation: \"spin 0.7s linear infinite\"\n        }\n    }, void 0, false, {\n        fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\ui\\\\Button.tsx\",\n        lineNumber: 100,\n        columnNumber: 5\n    }, this);\n}\n_c1 = Spinner;\nvar _c, _c1;\n$RefreshReg$(_c, \"Button\");\n$RefreshReg$(_c1, \"Spinner\");\n\n\n;\n    // Wrapped in an IIFE to avoid polluting the global scope\n    ;\n    (function () {\n        var _a, _b;\n        // Legacy CSS implementations will `eval` browser code in a Node.js context\n        // to extract CSS. For backwards compatibility, we need to check we're in a\n        // browser context before continuing.\n        if (typeof self !== 'undefined' &&\n            // AMP / No-JS mode does not inject these helpers:\n            '$RefreshHelpers$' in self) {\n            // @ts-ignore __webpack_module__ is global\n            var currentExports = module.exports;\n            // @ts-ignore __webpack_module__ is global\n            var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n            // This cannot happen in MainTemplate because the exports mismatch between\n            // templating and execution.\n            self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n            // A module can be accepted automatically based on its exports, e.g. when\n            // it is a Refresh Boundary.\n            if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n                // Save the previous exports signature on update so we can compare the boundary\n                // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n                module.hot.dispose(function (data) {\n                    data.prevSignature =\n                        self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n                });\n                // Unconditionally accept an update to this module, we'll check if it's\n                // still a Refresh Boundary later.\n                // @ts-ignore importMeta is replaced in the loader\n                module.hot.accept();\n                // This field is set when the previous version of this module was a\n                // Refresh Boundary, letting us know we need to check for invalidation or\n                // enqueue an update.\n                if (prevSignature !== null) {\n                    // A boundary can become ineligible if its exports are incompatible\n                    // with the previous exports.\n                    //\n                    // For example, if you add/remove/change exports, we'll want to\n                    // re-execute the importing modules, and force those components to\n                    // re-render. Similarly, if you convert a class component to a\n                    // function, we want to invalidate the boundary.\n                    if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n                        module.hot.invalidate();\n                    }\n                    else {\n                        self.$RefreshHelpers$.scheduleUpdate();\n                    }\n                }\n            }\n            else {\n                // Since we just executed the code for the module, it's possible that the\n                // new exports made it ineligible for being a boundary.\n                // We only care about the case when we were _previously_ a boundary,\n                // because we already accepted this update (accidental side effect).\n                var isNoLongerABoundary = prevSignature !== null;\n                if (isNoLongerABoundary) {\n                    module.hot.invalidate();\n                }\n            }\n        }\n    })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64, \n//# sourceURL=webpack-internal:///(app-pages-browser)/./src/components/ui/Button.tsx\n"));

/***/ }),

/***/ "(app-pages-browser)/./src/components/ui/ProgressBar.tsx":
/*!*******************************************!*\
  !*** ./src/components/ui/ProgressBar.tsx ***!
  \*******************************************/
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   ProgressBar: function() { return /* binding */ ProgressBar; }\n/* harmony export */ });\n/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-dev-runtime */ \"(app-pages-browser)/./node_modules/next/dist/compiled/react/jsx-dev-runtime.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"(app-pages-browser)/./node_modules/next/dist/compiled/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* __next_internal_client_entry_do_not_use__ ProgressBar auto */ \n\nfunction ProgressBar(param) {\n    let { value, label, color = \"var(--accent)\" } = param;\n    const clamped = Math.min(100, Math.max(0, value));\n    return /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n        style: {\n            width: \"100%\"\n        },\n        children: [\n            label && /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n                style: {\n                    display: \"flex\",\n                    justifyContent: \"space-between\",\n                    marginBottom: \"var(--s-1)\",\n                    fontSize: \"var(--t-small)\",\n                    color: \"var(--fg-muted)\"\n                },\n                children: [\n                    /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n                        children: label\n                    }, void 0, false, {\n                        fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\ui\\\\ProgressBar.tsx\",\n                        lineNumber: 25,\n                        columnNumber: 11\n                    }, this),\n                    /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n                        children: [\n                            clamped,\n                            \"%\"\n                        ]\n                    }, void 0, true, {\n                        fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\ui\\\\ProgressBar.tsx\",\n                        lineNumber: 26,\n                        columnNumber: 11\n                    }, this)\n                ]\n            }, void 0, true, {\n                fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\ui\\\\ProgressBar.tsx\",\n                lineNumber: 16,\n                columnNumber: 9\n            }, this),\n            /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n                style: {\n                    width: \"100%\",\n                    height: \"8px\",\n                    background: \"var(--bg-warm)\",\n                    borderRadius: \"var(--r-pill)\",\n                    overflow: \"hidden\"\n                },\n                role: \"progressbar\",\n                \"aria-valuenow\": clamped,\n                \"aria-valuemin\": 0,\n                \"aria-valuemax\": 100,\n                children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n                    style: {\n                        width: \"\".concat(clamped, \"%\"),\n                        height: \"100%\",\n                        background: color,\n                        borderRadius: \"var(--r-pill)\",\n                        transition: \"width 400ms ease\"\n                    }\n                }, void 0, false, {\n                    fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\ui\\\\ProgressBar.tsx\",\n                    lineNumber: 42,\n                    columnNumber: 9\n                }, this)\n            }, void 0, false, {\n                fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\ui\\\\ProgressBar.tsx\",\n                lineNumber: 29,\n                columnNumber: 7\n            }, this)\n        ]\n    }, void 0, true, {\n        fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\ui\\\\ProgressBar.tsx\",\n        lineNumber: 14,\n        columnNumber: 5\n    }, this);\n}\n_c = ProgressBar;\nvar _c;\n$RefreshReg$(_c, \"ProgressBar\");\n\n\n;\n    // Wrapped in an IIFE to avoid polluting the global scope\n    ;\n    (function () {\n        var _a, _b;\n        // Legacy CSS implementations will `eval` browser code in a Node.js context\n        // to extract CSS. For backwards compatibility, we need to check we're in a\n        // browser context before continuing.\n        if (typeof self !== 'undefined' &&\n            // AMP / No-JS mode does not inject these helpers:\n            '$RefreshHelpers$' in self) {\n            // @ts-ignore __webpack_module__ is global\n            var currentExports = module.exports;\n            // @ts-ignore __webpack_module__ is global\n            var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n            // This cannot happen in MainTemplate because the exports mismatch between\n            // templating and execution.\n            self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n            // A module can be accepted automatically based on its exports, e.g. when\n            // it is a Refresh Boundary.\n            if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n                // Save the previous exports signature on update so we can compare the boundary\n                // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n                module.hot.dispose(function (data) {\n                    data.prevSignature =\n                        self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n                });\n                // Unconditionally accept an update to this module, we'll check if it's\n                // still a Refresh Boundary later.\n                // @ts-ignore importMeta is replaced in the loader\n                module.hot.accept();\n                // This field is set when the previous version of this module was a\n                // Refresh Boundary, letting us know we need to check for invalidation or\n                // enqueue an update.\n                if (prevSignature !== null) {\n                    // A boundary can become ineligible if its exports are incompatible\n                    // with the previous exports.\n                    //\n                    // For example, if you add/remove/change exports, we'll want to\n                    // re-execute the importing modules, and force those components to\n                    // re-render. Similarly, if you convert a class component to a\n                    // function, we want to invalidate the boundary.\n                    if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n                        module.hot.invalidate();\n                    }\n                    else {\n                        self.$RefreshHelpers$.scheduleUpdate();\n                    }\n                }\n            }\n            else {\n                // Since we just executed the code for the module, it's possible that the\n                // new exports made it ineligible for being a boundary.\n                // We only care about the case when we were _previously_ a boundary,\n                // because we already accepted this update (accidental side effect).\n                var isNoLongerABoundary = prevSignature !== null;\n                if (isNoLongerABoundary) {\n                    module.hot.invalidate();\n                }\n            }\n        }\n    })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL3NyYy9jb21wb25lbnRzL3VpL1Byb2dyZXNzQmFyLnRzeCIsIm1hcHBpbmdzIjoiOzs7Ozs7OztBQUN5QjtBQVFsQixTQUFTQyxZQUFZLEtBQTJEO1FBQTNELEVBQUVDLEtBQUssRUFBRUMsS0FBSyxFQUFFQyxRQUFRLGVBQWUsRUFBb0IsR0FBM0Q7SUFDMUIsTUFBTUMsVUFBVUMsS0FBS0MsR0FBRyxDQUFDLEtBQUtELEtBQUtFLEdBQUcsQ0FBQyxHQUFHTjtJQUUxQyxxQkFDRSw4REFBQ087UUFBSUMsT0FBTztZQUFFQyxPQUFPO1FBQU87O1lBQ3pCUix1QkFDQyw4REFBQ007Z0JBQ0NDLE9BQU87b0JBQ0xFLFNBQVM7b0JBQ1RDLGdCQUFnQjtvQkFDaEJDLGNBQWM7b0JBQ2RDLFVBQVU7b0JBQ1ZYLE9BQU87Z0JBQ1Q7O2tDQUVBLDhEQUFDWTtrQ0FBTWI7Ozs7OztrQ0FDUCw4REFBQ2E7OzRCQUFNWDs0QkFBUTs7Ozs7Ozs7Ozs7OzswQkFHbkIsOERBQUNJO2dCQUNDQyxPQUFPO29CQUNMQyxPQUFPO29CQUNQTSxRQUFRO29CQUNSQyxZQUFZO29CQUNaQyxjQUFjO29CQUNkQyxVQUFVO2dCQUNaO2dCQUNBQyxNQUFLO2dCQUNMQyxpQkFBZWpCO2dCQUNma0IsaUJBQWU7Z0JBQ2ZDLGlCQUFlOzBCQUVmLDRFQUFDZjtvQkFDQ0MsT0FBTzt3QkFDTEMsT0FBTyxHQUFXLE9BQVJOLFNBQVE7d0JBQ2xCWSxRQUFRO3dCQUNSQyxZQUFZZDt3QkFDWmUsY0FBYzt3QkFDZE0sWUFBWTtvQkFDZDs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFLVjtLQTVDZ0J4QiIsInNvdXJjZXMiOlsid2VicGFjazovL19OX0UvLi9zcmMvY29tcG9uZW50cy91aS9Qcm9ncmVzc0Jhci50c3g/MDJkZSJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIGNsaWVudCdcbmltcG9ydCBSZWFjdCBmcm9tICdyZWFjdCdcblxuaW50ZXJmYWNlIFByb2dyZXNzQmFyUHJvcHMge1xuICB2YWx1ZTogbnVtYmVyIC8vIDDigJMxMDBcbiAgbGFiZWw/OiBzdHJpbmdcbiAgY29sb3I/OiBzdHJpbmdcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIFByb2dyZXNzQmFyKHsgdmFsdWUsIGxhYmVsLCBjb2xvciA9ICd2YXIoLS1hY2NlbnQpJyB9OiBQcm9ncmVzc0JhclByb3BzKSB7XG4gIGNvbnN0IGNsYW1wZWQgPSBNYXRoLm1pbigxMDAsIE1hdGgubWF4KDAsIHZhbHVlKSlcblxuICByZXR1cm4gKFxuICAgIDxkaXYgc3R5bGU9e3sgd2lkdGg6ICcxMDAlJyB9fT5cbiAgICAgIHtsYWJlbCAmJiAoXG4gICAgICAgIDxkaXZcbiAgICAgICAgICBzdHlsZT17e1xuICAgICAgICAgICAgZGlzcGxheTogJ2ZsZXgnLFxuICAgICAgICAgICAganVzdGlmeUNvbnRlbnQ6ICdzcGFjZS1iZXR3ZWVuJyxcbiAgICAgICAgICAgIG1hcmdpbkJvdHRvbTogJ3ZhcigtLXMtMSknLFxuICAgICAgICAgICAgZm9udFNpemU6ICd2YXIoLS10LXNtYWxsKScsXG4gICAgICAgICAgICBjb2xvcjogJ3ZhcigtLWZnLW11dGVkKScsXG4gICAgICAgICAgfX1cbiAgICAgICAgPlxuICAgICAgICAgIDxzcGFuPntsYWJlbH08L3NwYW4+XG4gICAgICAgICAgPHNwYW4+e2NsYW1wZWR9JTwvc3Bhbj5cbiAgICAgICAgPC9kaXY+XG4gICAgICApfVxuICAgICAgPGRpdlxuICAgICAgICBzdHlsZT17e1xuICAgICAgICAgIHdpZHRoOiAnMTAwJScsXG4gICAgICAgICAgaGVpZ2h0OiAnOHB4JyxcbiAgICAgICAgICBiYWNrZ3JvdW5kOiAndmFyKC0tYmctd2FybSknLFxuICAgICAgICAgIGJvcmRlclJhZGl1czogJ3ZhcigtLXItcGlsbCknLFxuICAgICAgICAgIG92ZXJmbG93OiAnaGlkZGVuJyxcbiAgICAgICAgfX1cbiAgICAgICAgcm9sZT1cInByb2dyZXNzYmFyXCJcbiAgICAgICAgYXJpYS12YWx1ZW5vdz17Y2xhbXBlZH1cbiAgICAgICAgYXJpYS12YWx1ZW1pbj17MH1cbiAgICAgICAgYXJpYS12YWx1ZW1heD17MTAwfVxuICAgICAgPlxuICAgICAgICA8ZGl2XG4gICAgICAgICAgc3R5bGU9e3tcbiAgICAgICAgICAgIHdpZHRoOiBgJHtjbGFtcGVkfSVgLFxuICAgICAgICAgICAgaGVpZ2h0OiAnMTAwJScsXG4gICAgICAgICAgICBiYWNrZ3JvdW5kOiBjb2xvcixcbiAgICAgICAgICAgIGJvcmRlclJhZGl1czogJ3ZhcigtLXItcGlsbCknLFxuICAgICAgICAgICAgdHJhbnNpdGlvbjogJ3dpZHRoIDQwMG1zIGVhc2UnLFxuICAgICAgICAgIH19XG4gICAgICAgIC8+XG4gICAgICA8L2Rpdj5cbiAgICA8L2Rpdj5cbiAgKVxufVxuIl0sIm5hbWVzIjpbIlJlYWN0IiwiUHJvZ3Jlc3NCYXIiLCJ2YWx1ZSIsImxhYmVsIiwiY29sb3IiLCJjbGFtcGVkIiwiTWF0aCIsIm1pbiIsIm1heCIsImRpdiIsInN0eWxlIiwid2lkdGgiLCJkaXNwbGF5IiwianVzdGlmeUNvbnRlbnQiLCJtYXJnaW5Cb3R0b20iLCJmb250U2l6ZSIsInNwYW4iLCJoZWlnaHQiLCJiYWNrZ3JvdW5kIiwiYm9yZGVyUmFkaXVzIiwib3ZlcmZsb3ciLCJyb2xlIiwiYXJpYS12YWx1ZW5vdyIsImFyaWEtdmFsdWVtaW4iLCJhcmlhLXZhbHVlbWF4IiwidHJhbnNpdGlvbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///(app-pages-browser)/./src/components/ui/ProgressBar.tsx\n"));

/***/ }),

/***/ "(app-pages-browser)/./src/components/ui/StatusBadge.tsx":
/*!*******************************************!*\
  !*** ./src/components/ui/StatusBadge.tsx ***!
  \*******************************************/
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   StatusBadge: function() { return /* binding */ StatusBadge; }\n/* harmony export */ });\n/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-dev-runtime */ \"(app-pages-browser)/./node_modules/next/dist/compiled/react/jsx-dev-runtime.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"(app-pages-browser)/./node_modules/next/dist/compiled/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* __next_internal_client_entry_do_not_use__ StatusBadge auto */ \n\nconst STATUS_CONFIG = {\n    queued: {\n        label: \"Queued\",\n        background: \"var(--cream)\",\n        color: \"var(--fg-muted)\"\n    },\n    extracting: {\n        label: \"Extracting\",\n        background: \"#fff3cd\",\n        color: \"#856404\"\n    },\n    chunking: {\n        label: \"Chunking\",\n        background: \"#fff3cd\",\n        color: \"#856404\"\n    },\n    structuring: {\n        label: \"Structuring\",\n        background: \"#cce5ff\",\n        color: \"#004085\"\n    },\n    writing: {\n        label: \"Writing\",\n        background: \"#cce5ff\",\n        color: \"#004085\"\n    },\n    embedding: {\n        label: \"Embedding\",\n        background: \"#d4edda\",\n        color: \"#155724\"\n    },\n    done: {\n        label: \"Done\",\n        background: \"var(--success)\",\n        color: \"var(--teal-900)\"\n    },\n    failed: {\n        label: \"Failed\",\n        background: \"#f8d7da\",\n        color: \"#c0392b\"\n    },\n    processing: {\n        label: \"Processing\",\n        background: \"#fff3cd\",\n        color: \"#856404\"\n    },\n    processed: {\n        label: \"Processed\",\n        background: \"var(--success)\",\n        color: \"var(--teal-900)\"\n    },\n    draft: {\n        label: \"Draft\",\n        background: \"var(--cream)\",\n        color: \"var(--fg-muted)\"\n    },\n    published: {\n        label: \"Published\",\n        background: \"var(--success)\",\n        color: \"var(--teal-900)\"\n    },\n    rejected: {\n        label: \"Rejected\",\n        background: \"#f8d7da\",\n        color: \"#c0392b\"\n    },\n    generated: {\n        label: \"Generated\",\n        background: \"#cce5ff\",\n        color: \"#004085\"\n    },\n    active: {\n        label: \"Active\",\n        background: \"var(--success)\",\n        color: \"var(--teal-900)\"\n    },\n    superseded: {\n        label: \"Superseded\",\n        background: \"var(--cream)\",\n        color: \"var(--fg-muted)\"\n    },\n    introductory: {\n        label: \"Introductory\",\n        background: \"var(--accent-soft)\",\n        color: \"var(--teal-900)\"\n    },\n    intermediate: {\n        label: \"Intermediate\",\n        background: \"#fff3cd\",\n        color: \"#856404\"\n    },\n    advanced: {\n        label: \"Advanced\",\n        background: \"var(--peri)\",\n        color: \"var(--teal-900)\"\n    }\n};\nfunction StatusBadge(param) {\n    let { status } = param;\n    var _STATUS_CONFIG_status;\n    const config = (_STATUS_CONFIG_status = STATUS_CONFIG[status]) !== null && _STATUS_CONFIG_status !== void 0 ? _STATUS_CONFIG_status : {\n        label: status,\n        background: \"var(--cream)\",\n        color: \"var(--fg-muted)\"\n    };\n    return /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n        style: {\n            display: \"inline-block\",\n            padding: \"2px var(--s-2)\",\n            borderRadius: \"var(--r-pill)\",\n            fontSize: \"var(--t-label)\",\n            fontFamily: \"var(--font-mono)\",\n            fontWeight: 500,\n            textTransform: \"uppercase\",\n            letterSpacing: \"var(--label-ls)\",\n            background: config.background,\n            color: config.color\n        },\n        children: config.label\n    }, void 0, false, {\n        fileName: \"C:\\\\Users\\\\RaymondVerhoef\\\\Gitea\\\\learning-platform\\\\app\\\\frontend\\\\src\\\\components\\\\ui\\\\StatusBadge.tsx\",\n        lineNumber: 58,\n        columnNumber: 5\n    }, this);\n}\n_c = StatusBadge;\nvar _c;\n$RefreshReg$(_c, \"StatusBadge\");\n\n\n;\n    // Wrapped in an IIFE to avoid polluting the global scope\n    ;\n    (function () {\n        var _a, _b;\n        // Legacy CSS implementations will `eval` browser code in a Node.js context\n        // to extract CSS. For backwards compatibility, we need to check we're in a\n        // browser context before continuing.\n        if (typeof self !== 'undefined' &&\n            // AMP / No-JS mode does not inject these helpers:\n            '$RefreshHelpers$' in self) {\n            // @ts-ignore __webpack_module__ is global\n            var currentExports = module.exports;\n            // @ts-ignore __webpack_module__ is global\n            var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n            // This cannot happen in MainTemplate because the exports mismatch between\n            // templating and execution.\n            self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n            // A module can be accepted automatically based on its exports, e.g. when\n            // it is a Refresh Boundary.\n            if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n                // Save the previous exports signature on update so we can compare the boundary\n                // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n                module.hot.dispose(function (data) {\n                    data.prevSignature =\n                        self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n                });\n                // Unconditionally accept an update to this module, we'll check if it's\n                // still a Refresh Boundary later.\n                // @ts-ignore importMeta is replaced in the loader\n                module.hot.accept();\n                // This field is set when the previous version of this module was a\n                // Refresh Boundary, letting us know we need to check for invalidation or\n                // enqueue an update.\n                if (prevSignature !== null) {\n                    // A boundary can become ineligible if its exports are incompatible\n                    // with the previous exports.\n                    //\n                    // For example, if you add/remove/change exports, we'll want to\n                    // re-execute the importing modules, and force those components to\n                    // re-render. Similarly, if you convert a class component to a\n                    // function, we want to invalidate the boundary.\n                    if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n                        module.hot.invalidate();\n                    }\n                    else {\n                        self.$RefreshHelpers$.scheduleUpdate();\n                    }\n                }\n            }\n            else {\n                // Since we just executed the code for the module, it's possible that the\n                // new exports made it ineligible for being a boundary.\n                // We only care about the case when we were _previously_ a boundary,\n                // because we already accepted this update (accidental side effect).\n                var isNoLongerABoundary = prevSignature !== null;\n                if (isNoLongerABoundary) {\n                    module.hot.invalidate();\n                }\n            }\n        }\n    })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64, \n//# sourceURL=webpack-internal:///(app-pages-browser)/./src/components/ui/StatusBadge.tsx\n"));

/***/ }),

/***/ "(app-pages-browser)/./src/lib/hooks/useIngestionStatus.ts":
/*!*********************************************!*\
  !*** ./src/lib/hooks/useIngestionStatus.ts ***!
  \*********************************************/
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   useIngestionStatus: function() { return /* binding */ useIngestionStatus; }\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"(app-pages-browser)/./node_modules/next/dist/compiled/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _lib_services__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/lib/services */ \"(app-pages-browser)/./src/lib/services.ts\");\n/* __next_internal_client_entry_do_not_use__ useIngestionStatus auto */ \n\nconst TERMINAL_STATES = new Set([\n    \"done\",\n    \"failed\"\n]);\nconst POLL_INTERVAL_MS = 3000;\nfunction calcProgress(s) {\n    const stageMap = {\n        queued: 5,\n        extracting: 15,\n        chunking: 30,\n        structuring: 50,\n        writing: 65,\n        embedding: s.chunksTotal > 0 ? 65 + Math.round(s.chunksEmbedded / s.chunksTotal * 30) : 70,\n        done: 100,\n        failed: 0\n    };\n    var _stageMap_s_status;\n    return (_stageMap_s_status = stageMap[s.status]) !== null && _stageMap_s_status !== void 0 ? _stageMap_s_status : 0;\n}\nfunction useIngestionStatus(jobId) {\n    const [status, setStatus] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);\n    const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);\n    const timerRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);\n    (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(()=>{\n        if (!jobId) return;\n        let cancelled = false;\n        async function poll() {\n            if (cancelled) return;\n            try {\n                const result = await (0,_lib_services__WEBPACK_IMPORTED_MODULE_1__.getIngestionStatus)(jobId);\n                if (cancelled) return;\n                setStatus(result);\n                setError(null);\n                if (!TERMINAL_STATES.has(result.status)) {\n                    timerRef.current = setTimeout(poll, POLL_INTERVAL_MS);\n                }\n            } catch (err) {\n                if (cancelled) return;\n                setError(err instanceof Error ? err.message : \"Unknown error\");\n            }\n        }\n        void poll();\n        return ()=>{\n            cancelled = true;\n            if (timerRef.current) clearTimeout(timerRef.current);\n        };\n    }, [\n        jobId\n    ]);\n    return {\n        status,\n        progress: status ? calcProgress(status) : 0,\n        error\n    };\n}\n\n\n;\n    // Wrapped in an IIFE to avoid polluting the global scope\n    ;\n    (function () {\n        var _a, _b;\n        // Legacy CSS implementations will `eval` browser code in a Node.js context\n        // to extract CSS. For backwards compatibility, we need to check we're in a\n        // browser context before continuing.\n        if (typeof self !== 'undefined' &&\n            // AMP / No-JS mode does not inject these helpers:\n            '$RefreshHelpers$' in self) {\n            // @ts-ignore __webpack_module__ is global\n            var currentExports = module.exports;\n            // @ts-ignore __webpack_module__ is global\n            var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n            // This cannot happen in MainTemplate because the exports mismatch between\n            // templating and execution.\n            self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n            // A module can be accepted automatically based on its exports, e.g. when\n            // it is a Refresh Boundary.\n            if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n                // Save the previous exports signature on update so we can compare the boundary\n                // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n                module.hot.dispose(function (data) {\n                    data.prevSignature =\n                        self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n                });\n                // Unconditionally accept an update to this module, we'll check if it's\n                // still a Refresh Boundary later.\n                // @ts-ignore importMeta is replaced in the loader\n                module.hot.accept();\n                // This field is set when the previous version of this module was a\n                // Refresh Boundary, letting us know we need to check for invalidation or\n                // enqueue an update.\n                if (prevSignature !== null) {\n                    // A boundary can become ineligible if its exports are incompatible\n                    // with the previous exports.\n                    //\n                    // For example, if you add/remove/change exports, we'll want to\n                    // re-execute the importing modules, and force those components to\n                    // re-render. Similarly, if you convert a class component to a\n                    // function, we want to invalidate the boundary.\n                    if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n                        module.hot.invalidate();\n                    }\n                    else {\n                        self.$RefreshHelpers$.scheduleUpdate();\n                    }\n                }\n            }\n            else {\n                // Since we just executed the code for the module, it's possible that the\n                // new exports made it ineligible for being a boundary.\n                // We only care about the case when we were _previously_ a boundary,\n                // because we already accepted this update (accidental side effect).\n                var isNoLongerABoundary = prevSignature !== null;\n                if (isNoLongerABoundary) {\n                    module.hot.invalidate();\n                }\n            }\n        }\n    })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64, \n//# sourceURL=webpack-internal:///(app-pages-browser)/./src/lib/hooks/useIngestionStatus.ts\n"));

/***/ }),

/***/ "(app-pages-browser)/./src/lib/hooks/usePBCollection.ts":
/*!******************************************!*\
  !*** ./src/lib/hooks/usePBCollection.ts ***!
  \******************************************/
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   usePBCollection: function() { return /* binding */ usePBCollection; }\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"(app-pages-browser)/./node_modules/next/dist/compiled/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _lib_pocketbase__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/lib/pocketbase */ \"(app-pages-browser)/./src/lib/pocketbase.ts\");\n/* __next_internal_client_entry_do_not_use__ usePBCollection auto */ \n\nfunction usePBCollection(collection, options) {\n    const [items, setItems] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);\n    const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true);\n    const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);\n    const [tick, setTick] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0);\n    const refresh = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(()=>{\n        setTick((t)=>t + 1);\n    }, []);\n    (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(()=>{\n        let cancelled = false;\n        async function load() {\n            setLoading(true);\n            setError(null);\n            try {\n                const result = await _lib_pocketbase__WEBPACK_IMPORTED_MODULE_1__.pb.collection(collection).getFullList({\n                    ...options !== null && options !== void 0 ? options : {}\n                });\n                if (!cancelled) {\n                    setItems(result);\n                }\n            } catch (err) {\n                if (!cancelled) {\n                    setError(err instanceof Error ? err.message : \"Failed to load\");\n                }\n            } finally{\n                if (!cancelled) {\n                    setLoading(false);\n                }\n            }\n        }\n        void load();\n        return ()=>{\n            cancelled = true;\n        };\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [\n        collection,\n        tick\n    ]);\n    return {\n        items,\n        loading,\n        error,\n        refresh\n    };\n}\n\n\n;\n    // Wrapped in an IIFE to avoid polluting the global scope\n    ;\n    (function () {\n        var _a, _b;\n        // Legacy CSS implementations will `eval` browser code in a Node.js context\n        // to extract CSS. For backwards compatibility, we need to check we're in a\n        // browser context before continuing.\n        if (typeof self !== 'undefined' &&\n            // AMP / No-JS mode does not inject these helpers:\n            '$RefreshHelpers$' in self) {\n            // @ts-ignore __webpack_module__ is global\n            var currentExports = module.exports;\n            // @ts-ignore __webpack_module__ is global\n            var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n            // This cannot happen in MainTemplate because the exports mismatch between\n            // templating and execution.\n            self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n            // A module can be accepted automatically based on its exports, e.g. when\n            // it is a Refresh Boundary.\n            if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n                // Save the previous exports signature on update so we can compare the boundary\n                // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n                module.hot.dispose(function (data) {\n                    data.prevSignature =\n                        self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n                });\n                // Unconditionally accept an update to this module, we'll check if it's\n                // still a Refresh Boundary later.\n                // @ts-ignore importMeta is replaced in the loader\n                module.hot.accept();\n                // This field is set when the previous version of this module was a\n                // Refresh Boundary, letting us know we need to check for invalidation or\n                // enqueue an update.\n                if (prevSignature !== null) {\n                    // A boundary can become ineligible if its exports are incompatible\n                    // with the previous exports.\n                    //\n                    // For example, if you add/remove/change exports, we'll want to\n                    // re-execute the importing modules, and force those components to\n                    // re-render. Similarly, if you convert a class component to a\n                    // function, we want to invalidate the boundary.\n                    if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n                        module.hot.invalidate();\n                    }\n                    else {\n                        self.$RefreshHelpers$.scheduleUpdate();\n                    }\n                }\n            }\n            else {\n                // Since we just executed the code for the module, it's possible that the\n                // new exports made it ineligible for being a boundary.\n                // We only care about the case when we were _previously_ a boundary,\n                // because we already accepted this update (accidental side effect).\n                var isNoLongerABoundary = prevSignature !== null;\n                if (isNoLongerABoundary) {\n                    module.hot.invalidate();\n                }\n            }\n        }\n    })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL3NyYy9saWIvaG9va3MvdXNlUEJDb2xsZWN0aW9uLnRzIiwibWFwcGluZ3MiOiI7Ozs7Ozs7cUVBQ3dEO0FBQ25CO0FBUzlCLFNBQVNJLGdCQUNkQyxVQUFrQixFQUNsQkMsT0FBaUM7SUFFakMsTUFBTSxDQUFDQyxPQUFPQyxTQUFTLEdBQUdSLCtDQUFRQSxDQUFNLEVBQUU7SUFDMUMsTUFBTSxDQUFDUyxTQUFTQyxXQUFXLEdBQUdWLCtDQUFRQSxDQUFVO0lBQ2hELE1BQU0sQ0FBQ1csT0FBT0MsU0FBUyxHQUFHWiwrQ0FBUUEsQ0FBZ0I7SUFDbEQsTUFBTSxDQUFDYSxNQUFNQyxRQUFRLEdBQUdkLCtDQUFRQSxDQUFTO0lBRXpDLE1BQU1lLFVBQVViLGtEQUFXQSxDQUFDO1FBQzFCWSxRQUFRLENBQUNFLElBQU1BLElBQUk7SUFDckIsR0FBRyxFQUFFO0lBRUxmLGdEQUFTQSxDQUFDO1FBQ1IsSUFBSWdCLFlBQVk7UUFFaEIsZUFBZUM7WUFDYlIsV0FBVztZQUNYRSxTQUFTO1lBQ1QsSUFBSTtnQkFDRixNQUFNTyxTQUFTLE1BQU1oQiwrQ0FBRUEsQ0FBQ0UsVUFBVSxDQUFDQSxZQUFZZSxXQUFXLENBQUk7b0JBQzVELEdBQUlkLG9CQUFBQSxxQkFBQUEsVUFBVyxDQUFDLENBQUM7Z0JBQ25CO2dCQUNBLElBQUksQ0FBQ1csV0FBVztvQkFDZFQsU0FBU1c7Z0JBQ1g7WUFDRixFQUFFLE9BQU9FLEtBQUs7Z0JBQ1osSUFBSSxDQUFDSixXQUFXO29CQUNkTCxTQUFTUyxlQUFlQyxRQUFRRCxJQUFJRSxPQUFPLEdBQUc7Z0JBQ2hEO1lBQ0YsU0FBVTtnQkFDUixJQUFJLENBQUNOLFdBQVc7b0JBQ2RQLFdBQVc7Z0JBQ2I7WUFDRjtRQUNGO1FBRUEsS0FBS1E7UUFDTCxPQUFPO1lBQ0xELFlBQVk7UUFDZDtJQUNBLHVEQUF1RDtJQUN6RCxHQUFHO1FBQUNaO1FBQVlRO0tBQUs7SUFFckIsT0FBTztRQUFFTjtRQUFPRTtRQUFTRTtRQUFPSTtJQUFRO0FBQzFDIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vX05fRS8uL3NyYy9saWIvaG9va3MvdXNlUEJDb2xsZWN0aW9uLnRzPzA2N2YiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBjbGllbnQnXG5pbXBvcnQgeyB1c2VTdGF0ZSwgdXNlRWZmZWN0LCB1c2VDYWxsYmFjayB9IGZyb20gJ3JlYWN0J1xuaW1wb3J0IHsgcGIgfSBmcm9tICdAL2xpYi9wb2NrZXRiYXNlJ1xuXG5pbnRlcmZhY2UgVXNlUEJDb2xsZWN0aW9uUmVzdWx0PFQ+IHtcbiAgaXRlbXM6IFRbXVxuICBsb2FkaW5nOiBib29sZWFuXG4gIGVycm9yOiBzdHJpbmcgfCBudWxsXG4gIHJlZnJlc2g6ICgpID0+IHZvaWRcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIHVzZVBCQ29sbGVjdGlvbjxUPihcbiAgY29sbGVjdGlvbjogc3RyaW5nLFxuICBvcHRpb25zPzogUmVjb3JkPHN0cmluZywgdW5rbm93bj4sXG4pOiBVc2VQQkNvbGxlY3Rpb25SZXN1bHQ8VD4ge1xuICBjb25zdCBbaXRlbXMsIHNldEl0ZW1zXSA9IHVzZVN0YXRlPFRbXT4oW10pXG4gIGNvbnN0IFtsb2FkaW5nLCBzZXRMb2FkaW5nXSA9IHVzZVN0YXRlPGJvb2xlYW4+KHRydWUpXG4gIGNvbnN0IFtlcnJvciwgc2V0RXJyb3JdID0gdXNlU3RhdGU8c3RyaW5nIHwgbnVsbD4obnVsbClcbiAgY29uc3QgW3RpY2ssIHNldFRpY2tdID0gdXNlU3RhdGU8bnVtYmVyPigwKVxuXG4gIGNvbnN0IHJlZnJlc2ggPSB1c2VDYWxsYmFjaygoKSA9PiB7XG4gICAgc2V0VGljaygodCkgPT4gdCArIDEpXG4gIH0sIFtdKVxuXG4gIHVzZUVmZmVjdCgoKSA9PiB7XG4gICAgbGV0IGNhbmNlbGxlZCA9IGZhbHNlXG5cbiAgICBhc3luYyBmdW5jdGlvbiBsb2FkKCkge1xuICAgICAgc2V0TG9hZGluZyh0cnVlKVxuICAgICAgc2V0RXJyb3IobnVsbClcbiAgICAgIHRyeSB7XG4gICAgICAgIGNvbnN0IHJlc3VsdCA9IGF3YWl0IHBiLmNvbGxlY3Rpb24oY29sbGVjdGlvbikuZ2V0RnVsbExpc3Q8VD4oe1xuICAgICAgICAgIC4uLihvcHRpb25zID8/IHt9KSxcbiAgICAgICAgfSlcbiAgICAgICAgaWYgKCFjYW5jZWxsZWQpIHtcbiAgICAgICAgICBzZXRJdGVtcyhyZXN1bHQpXG4gICAgICAgIH1cbiAgICAgIH0gY2F0Y2ggKGVycikge1xuICAgICAgICBpZiAoIWNhbmNlbGxlZCkge1xuICAgICAgICAgIHNldEVycm9yKGVyciBpbnN0YW5jZW9mIEVycm9yID8gZXJyLm1lc3NhZ2UgOiAnRmFpbGVkIHRvIGxvYWQnKVxuICAgICAgICB9XG4gICAgICB9IGZpbmFsbHkge1xuICAgICAgICBpZiAoIWNhbmNlbGxlZCkge1xuICAgICAgICAgIHNldExvYWRpbmcoZmFsc2UpXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG5cbiAgICB2b2lkIGxvYWQoKVxuICAgIHJldHVybiAoKSA9PiB7XG4gICAgICBjYW5jZWxsZWQgPSB0cnVlXG4gICAgfVxuICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSByZWFjdC1ob29rcy9leGhhdXN0aXZlLWRlcHNcbiAgfSwgW2NvbGxlY3Rpb24sIHRpY2tdKVxuXG4gIHJldHVybiB7IGl0ZW1zLCBsb2FkaW5nLCBlcnJvciwgcmVmcmVzaCB9XG59XG4iXSwibmFtZXMiOlsidXNlU3RhdGUiLCJ1c2VFZmZlY3QiLCJ1c2VDYWxsYmFjayIsInBiIiwidXNlUEJDb2xsZWN0aW9uIiwiY29sbGVjdGlvbiIsIm9wdGlvbnMiLCJpdGVtcyIsInNldEl0ZW1zIiwibG9hZGluZyIsInNldExvYWRpbmciLCJlcnJvciIsInNldEVycm9yIiwidGljayIsInNldFRpY2siLCJyZWZyZXNoIiwidCIsImNhbmNlbGxlZCIsImxvYWQiLCJyZXN1bHQiLCJnZXRGdWxsTGlzdCIsImVyciIsIkVycm9yIiwibWVzc2FnZSJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///(app-pages-browser)/./src/lib/hooks/usePBCollection.ts\n"));

/***/ }),

/***/ "(app-pages-browser)/./src/lib/pocketbase.ts":
/*!*******************************!*\
  !*** ./src/lib/pocketbase.ts ***!
  \*******************************/
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   pb: function() { return /* binding */ pb; }\n/* harmony export */ });\n/* harmony import */ var pocketbase__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! pocketbase */ \"(app-pages-browser)/./node_modules/pocketbase/dist/pocketbase.es.mjs\");\n/* __next_internal_client_entry_do_not_use__ pb auto */ \nvar _process_env_NEXT_PUBLIC_POCKETBASE_URL;\nconst pb = new pocketbase__WEBPACK_IMPORTED_MODULE_0__[\"default\"]((_process_env_NEXT_PUBLIC_POCKETBASE_URL = \"http://localhost:8090\") !== null && _process_env_NEXT_PUBLIC_POCKETBASE_URL !== void 0 ? _process_env_NEXT_PUBLIC_POCKETBASE_URL : \"http://localhost:8090\");\n\n\n;\n    // Wrapped in an IIFE to avoid polluting the global scope\n    ;\n    (function () {\n        var _a, _b;\n        // Legacy CSS implementations will `eval` browser code in a Node.js context\n        // to extract CSS. For backwards compatibility, we need to check we're in a\n        // browser context before continuing.\n        if (typeof self !== 'undefined' &&\n            // AMP / No-JS mode does not inject these helpers:\n            '$RefreshHelpers$' in self) {\n            // @ts-ignore __webpack_module__ is global\n            var currentExports = module.exports;\n            // @ts-ignore __webpack_module__ is global\n            var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n            // This cannot happen in MainTemplate because the exports mismatch between\n            // templating and execution.\n            self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n            // A module can be accepted automatically based on its exports, e.g. when\n            // it is a Refresh Boundary.\n            if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n                // Save the previous exports signature on update so we can compare the boundary\n                // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n                module.hot.dispose(function (data) {\n                    data.prevSignature =\n                        self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n                });\n                // Unconditionally accept an update to this module, we'll check if it's\n                // still a Refresh Boundary later.\n                // @ts-ignore importMeta is replaced in the loader\n                module.hot.accept();\n                // This field is set when the previous version of this module was a\n                // Refresh Boundary, letting us know we need to check for invalidation or\n                // enqueue an update.\n                if (prevSignature !== null) {\n                    // A boundary can become ineligible if its exports are incompatible\n                    // with the previous exports.\n                    //\n                    // For example, if you add/remove/change exports, we'll want to\n                    // re-execute the importing modules, and force those components to\n                    // re-render. Similarly, if you convert a class component to a\n                    // function, we want to invalidate the boundary.\n                    if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n                        module.hot.invalidate();\n                    }\n                    else {\n                        self.$RefreshHelpers$.scheduleUpdate();\n                    }\n                }\n            }\n            else {\n                // Since we just executed the code for the module, it's possible that the\n                // new exports made it ineligible for being a boundary.\n                // We only care about the case when we were _previously_ a boundary,\n                // because we already accepted this update (accidental side effect).\n                var isNoLongerABoundary = prevSignature !== null;\n                if (isNoLongerABoundary) {\n                    module.hot.invalidate();\n                }\n            }\n        }\n    })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL3NyYy9saWIvcG9ja2V0YmFzZS50cyIsIm1hcHBpbmdzIjoiOzs7Ozt3REFDbUM7SUFFRkM7QUFBMUIsTUFBTUMsS0FBSyxJQUFJRixrREFBVUEsQ0FBQ0MsQ0FBQUEsMENBQUFBLHVCQUFzQyxjQUF0Q0EscURBQUFBLDBDQUEwQyx5QkFBd0IiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9fTl9FLy4vc3JjL2xpYi9wb2NrZXRiYXNlLnRzP2U2NTciXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBjbGllbnQnXG5pbXBvcnQgUG9ja2V0QmFzZSBmcm9tICdwb2NrZXRiYXNlJ1xuXG5leHBvcnQgY29uc3QgcGIgPSBuZXcgUG9ja2V0QmFzZShwcm9jZXNzLmVudi5ORVhUX1BVQkxJQ19QT0NLRVRCQVNFX1VSTCA/PyAnaHR0cDovL2xvY2FsaG9zdDo4MDkwJylcbiJdLCJuYW1lcyI6WyJQb2NrZXRCYXNlIiwicHJvY2VzcyIsInBiIiwiZW52IiwiTkVYVF9QVUJMSUNfUE9DS0VUQkFTRV9VUkwiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///(app-pages-browser)/./src/lib/pocketbase.ts\n"));

/***/ }),

/***/ "(app-pages-browser)/./src/lib/services.ts":
/*!*****************************!*\
  !*** ./src/lib/services.ts ***!
  \*****************************/
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   getFeed: function() { return /* binding */ getFeed; },\n/* harmony export */   getIngestionStatus: function() { return /* binding */ getIngestionStatus; },\n/* harmony export */   getLeaderboard: function() { return /* binding */ getLeaderboard; },\n/* harmony export */   patchCurriculumWeekOrder: function() { return /* binding */ patchCurriculumWeekOrder; },\n/* harmony export */   postComplete: function() { return /* binding */ postComplete; },\n/* harmony export */   postCurriculumConfirm: function() { return /* binding */ postCurriculumConfirm; },\n/* harmony export */   postGenerateAll: function() { return /* binding */ postGenerateAll; },\n/* harmony export */   postIngest: function() { return /* binding */ postIngest; }\n/* harmony export */ });\nvar _process_env_NEXT_PUBLIC_INGESTION_URL;\nconst INGESTION_URL = (_process_env_NEXT_PUBLIC_INGESTION_URL = \"http://localhost:3001\") !== null && _process_env_NEXT_PUBLIC_INGESTION_URL !== void 0 ? _process_env_NEXT_PUBLIC_INGESTION_URL : \"http://localhost:3001\";\nvar _process_env_NEXT_PUBLIC_GENERATION_URL;\nconst GENERATION_URL = (_process_env_NEXT_PUBLIC_GENERATION_URL = \"http://localhost:3002\") !== null && _process_env_NEXT_PUBLIC_GENERATION_URL !== void 0 ? _process_env_NEXT_PUBLIC_GENERATION_URL : \"http://localhost:3002\";\nvar _process_env_NEXT_PUBLIC_CURRICULUM_URL;\nconst CURRICULUM_URL = (_process_env_NEXT_PUBLIC_CURRICULUM_URL = \"http://localhost:3003\") !== null && _process_env_NEXT_PUBLIC_CURRICULUM_URL !== void 0 ? _process_env_NEXT_PUBLIC_CURRICULUM_URL : \"http://localhost:3003\";\nvar _process_env_NEXT_PUBLIC_PROGRESS_URL;\nconst PROGRESS_URL = (_process_env_NEXT_PUBLIC_PROGRESS_URL = \"http://localhost:3005\") !== null && _process_env_NEXT_PUBLIC_PROGRESS_URL !== void 0 ? _process_env_NEXT_PUBLIC_PROGRESS_URL : \"http://localhost:3005\";\nasync function handleResponse(res) {\n    if (!res.ok) {\n        const text = await res.text().catch(()=>res.statusText);\n        throw new Error(\"HTTP \".concat(res.status, \": \").concat(text));\n    }\n    return res.json();\n}\nasync function postIngest(payload) {\n    const res = await fetch(\"\".concat(INGESTION_URL, \"/ingest\"), {\n        method: \"POST\",\n        headers: {\n            \"Content-Type\": \"application/json\"\n        },\n        body: JSON.stringify(payload)\n    });\n    return handleResponse(res);\n}\nasync function getIngestionStatus(jobId) {\n    const res = await fetch(\"\".concat(INGESTION_URL, \"/ingest/status/\").concat(encodeURIComponent(jobId)));\n    return handleResponse(res);\n}\nasync function postGenerateAll(themeId) {\n    const res = await fetch(\"\".concat(GENERATION_URL, \"/generate\"), {\n        method: \"POST\",\n        headers: {\n            \"Content-Type\": \"application/json\"\n        },\n        body: JSON.stringify({\n            themeId\n        })\n    });\n    const data = await handleResponse(res);\n    return {\n        queued: data.totalItems\n    };\n}\nasync function postComplete(payload) {\n    const res = await fetch(\"\".concat(PROGRESS_URL, \"/complete\"), {\n        method: \"POST\",\n        headers: {\n            \"Content-Type\": \"application/json\"\n        },\n        body: JSON.stringify(payload)\n    });\n    return handleResponse(res);\n}\nasync function getLeaderboard() {\n    const res = await fetch(\"\".concat(PROGRESS_URL, \"/leaderboard\"));\n    return handleResponse(res);\n}\nasync function getFeed() {\n    const res = await fetch(\"\".concat(PROGRESS_URL, \"/feed\"));\n    return handleResponse(res);\n}\nasync function postCurriculumConfirm(versionId) {\n    const res = await fetch(\"\".concat(CURRICULUM_URL, \"/curriculum/versions/\").concat(encodeURIComponent(versionId), \"/confirm\"), {\n        method: \"POST\",\n        headers: {\n            \"Content-Type\": \"application/json\"\n        }\n    });\n    if (!res.ok) {\n        const text = await res.text().catch(()=>res.statusText);\n        throw new Error(\"HTTP \".concat(res.status, \": \").concat(text));\n    }\n}\nasync function patchCurriculumWeekOrder(weekId, position) {\n    const res = await fetch(\"\".concat(CURRICULUM_URL, \"/curriculum/weeks/\").concat(encodeURIComponent(weekId), \"/order\"), {\n        method: \"PATCH\",\n        headers: {\n            \"Content-Type\": \"application/json\"\n        },\n        body: JSON.stringify({\n            position\n        })\n    });\n    if (!res.ok) {\n        const text = await res.text().catch(()=>res.statusText);\n        throw new Error(\"HTTP \".concat(res.status, \": \").concat(text));\n    }\n}\n\n\n;\n    // Wrapped in an IIFE to avoid polluting the global scope\n    ;\n    (function () {\n        var _a, _b;\n        // Legacy CSS implementations will `eval` browser code in a Node.js context\n        // to extract CSS. For backwards compatibility, we need to check we're in a\n        // browser context before continuing.\n        if (typeof self !== 'undefined' &&\n            // AMP / No-JS mode does not inject these helpers:\n            '$RefreshHelpers$' in self) {\n            // @ts-ignore __webpack_module__ is global\n            var currentExports = module.exports;\n            // @ts-ignore __webpack_module__ is global\n            var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n            // This cannot happen in MainTemplate because the exports mismatch between\n            // templating and execution.\n            self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n            // A module can be accepted automatically based on its exports, e.g. when\n            // it is a Refresh Boundary.\n            if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n                // Save the previous exports signature on update so we can compare the boundary\n                // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n                module.hot.dispose(function (data) {\n                    data.prevSignature =\n                        self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n                });\n                // Unconditionally accept an update to this module, we'll check if it's\n                // still a Refresh Boundary later.\n                // @ts-ignore importMeta is replaced in the loader\n                module.hot.accept();\n                // This field is set when the previous version of this module was a\n                // Refresh Boundary, letting us know we need to check for invalidation or\n                // enqueue an update.\n                if (prevSignature !== null) {\n                    // A boundary can become ineligible if its exports are incompatible\n                    // with the previous exports.\n                    //\n                    // For example, if you add/remove/change exports, we'll want to\n                    // re-execute the importing modules, and force those components to\n                    // re-render. Similarly, if you convert a class component to a\n                    // function, we want to invalidate the boundary.\n                    if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n                        module.hot.invalidate();\n                    }\n                    else {\n                        self.$RefreshHelpers$.scheduleUpdate();\n                    }\n                }\n            }\n            else {\n                // Since we just executed the code for the module, it's possible that the\n                // new exports made it ineligible for being a boundary.\n                // We only care about the case when we were _previously_ a boundary,\n                // because we already accepted this update (accidental side effect).\n                var isNoLongerABoundary = prevSignature !== null;\n                if (isNoLongerABoundary) {\n                    module.hot.invalidate();\n                }\n            }\n        }\n    })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64, \n//# sourceURL=webpack-internal:///(app-pages-browser)/./src/lib/services.ts\n"));

/***/ }),

/***/ "(app-pages-browser)/./node_modules/next/dist/compiled/react/cjs/react-jsx-dev-runtime.development.js":
/*!****************************************************************************************!*\
  !*** ./node_modules/next/dist/compiled/react/cjs/react-jsx-dev-runtime.development.js ***!
  \****************************************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
eval(__webpack_require__.ts("/**\n * @license React\n * react-jsx-dev-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nif (true) {\n  (function() {\n'use strict';\n\nvar React = __webpack_require__(/*! next/dist/compiled/react */ \"(app-pages-browser)/./node_modules/next/dist/compiled/react/index.js\");\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider'); // TODO: Delete with enableRenderableContext\n\nvar REACT_CONSUMER_TYPE = Symbol.for('react.consumer');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar REACT_CACHE_TYPE = Symbol.for('react.cache');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n  if (maybeIterable === null || typeof maybeIterable !== 'object') {\n    return null;\n  }\n\n  var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n  if (typeof maybeIterator === 'function') {\n    return maybeIterator;\n  }\n\n  return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n  {\n    {\n      for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n        args[_key2 - 1] = arguments[_key2];\n      }\n\n      printWarning('error', format, args);\n    }\n  }\n}\n\nfunction printWarning(level, format, args) {\n  // When changing this logic, you might want to also\n  // update consoleWithStackDev.www.js as well.\n  {\n    var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n    var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n    if (stack !== '') {\n      format += '%s';\n      args = args.concat([stack]);\n    } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n    var argsWithFormat = args.map(function (item) {\n      return String(item);\n    }); // Careful: RN currently depends on this prefix\n\n    argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n    // breaks IE9: https://github.com/facebook/react/issues/13610\n    // eslint-disable-next-line react-internal/no-production-logging\n\n    Function.prototype.apply.call(console[level], console, argsWithFormat);\n  }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\nvar enableRenderableContext = false;\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false;\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n  var displayName = outerType.displayName;\n\n  if (displayName) {\n    return displayName;\n  }\n\n  var functionName = innerType.displayName || innerType.name || '';\n  return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n  return type.displayName || 'Context';\n}\n\nvar REACT_CLIENT_REFERENCE$2 = Symbol.for('react.client.reference'); // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\nfunction getComponentNameFromType(type) {\n  if (type == null) {\n    // Host root, text node or just invalid type.\n    return null;\n  }\n\n  if (typeof type === 'function') {\n    if (type.$$typeof === REACT_CLIENT_REFERENCE$2) {\n      // TODO: Create a convention for naming client references with debug info.\n      return null;\n    }\n\n    return type.displayName || type.name || null;\n  }\n\n  if (typeof type === 'string') {\n    return type;\n  }\n\n  switch (type) {\n    case REACT_FRAGMENT_TYPE:\n      return 'Fragment';\n\n    case REACT_PORTAL_TYPE:\n      return 'Portal';\n\n    case REACT_PROFILER_TYPE:\n      return 'Profiler';\n\n    case REACT_STRICT_MODE_TYPE:\n      return 'StrictMode';\n\n    case REACT_SUSPENSE_TYPE:\n      return 'Suspense';\n\n    case REACT_SUSPENSE_LIST_TYPE:\n      return 'SuspenseList';\n\n    case REACT_CACHE_TYPE:\n      {\n        return 'Cache';\n      }\n\n  }\n\n  if (typeof type === 'object') {\n    {\n      if (typeof type.tag === 'number') {\n        error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n      }\n    }\n\n    switch (type.$$typeof) {\n      case REACT_PROVIDER_TYPE:\n        {\n          var provider = type;\n          return getContextName(provider._context) + '.Provider';\n        }\n\n      case REACT_CONTEXT_TYPE:\n        var context = type;\n\n        {\n          return getContextName(context) + '.Consumer';\n        }\n\n      case REACT_CONSUMER_TYPE:\n        {\n          return null;\n        }\n\n      case REACT_FORWARD_REF_TYPE:\n        return getWrappedName(type, type.render, 'ForwardRef');\n\n      case REACT_MEMO_TYPE:\n        var outerName = type.displayName || null;\n\n        if (outerName !== null) {\n          return outerName;\n        }\n\n        return getComponentNameFromType(type.type) || 'Memo';\n\n      case REACT_LAZY_TYPE:\n        {\n          var lazyComponent = type;\n          var payload = lazyComponent._payload;\n          var init = lazyComponent._init;\n\n          try {\n            return getComponentNameFromType(init(payload));\n          } catch (x) {\n            return null;\n          }\n        }\n    }\n  }\n\n  return null;\n}\n\n// $FlowFixMe[method-unbinding]\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar assign = Object.assign;\n\n/*\n * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible.\nfunction typeName(value) {\n  {\n    // toStringTag is needed for namespaced types like Temporal.Instant\n    var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n    var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object'; // $FlowFixMe[incompatible-return]\n\n    return type;\n  }\n} // $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n  {\n    try {\n      testStringCoercion(value);\n      return false;\n    } catch (e) {\n      return true;\n    }\n  }\n}\n\nfunction testStringCoercion(value) {\n  // If you ended up here by following an exception call stack, here's what's\n  // happened: you supplied an object or symbol value to React (as a prop, key,\n  // DOM attribute, CSS property, string ref, etc.) and when React tried to\n  // coerce it to a string using `'' + value`, an exception was thrown.\n  //\n  // The most common types that will cause this exception are `Symbol` instances\n  // and Temporal objects like `Temporal.Instant`. But any object that has a\n  // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n  // exception. (Library authors do this to prevent users from using built-in\n  // numeric operators like `+` or comparison operators like `>=` because custom\n  // methods are needed to perform accurate arithmetic or comparison.)\n  //\n  // To fix the problem, coerce this object or symbol value to a string before\n  // passing it to React. The most reliable way is usually `String(value)`.\n  //\n  // To find which value is throwing, check the browser or debugger console.\n  // Before this exception was thrown, there should be `console.error` output\n  // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n  // problem and how that type was used: key, atrribute, input value prop, etc.\n  // In most cases, this console output also shows the component and its\n  // ancestor components where the exception happened.\n  //\n  // eslint-disable-next-line react-internal/safe-string-coercion\n  return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n  {\n    if (willCoercionThrow(value)) {\n      error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before using it here.', typeName(value));\n\n      return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n    }\n  }\n}\n\nvar REACT_CLIENT_REFERENCE$1 = Symbol.for('react.client.reference');\nfunction isValidElementType(type) {\n  if (typeof type === 'string' || typeof type === 'function') {\n    return true;\n  } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n  if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing  || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden  || type === REACT_OFFSCREEN_TYPE || enableScopeAPI  || enableCacheElement  || enableTransitionTracing ) {\n    return true;\n  }\n\n  if (typeof type === 'object' && type !== null) {\n    if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || enableRenderableContext  || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n    // types supported by any Flight configuration anywhere since\n    // we don't know which Flight build this will end up being used\n    // with.\n    type.$$typeof === REACT_CLIENT_REFERENCE$1 || type.getModuleId !== undefined) {\n      return true;\n    }\n  }\n\n  return false;\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n  return isArrayImpl(a);\n}\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n  {\n    if (disabledDepth === 0) {\n      /* eslint-disable react-internal/no-production-logging */\n      prevLog = console.log;\n      prevInfo = console.info;\n      prevWarn = console.warn;\n      prevError = console.error;\n      prevGroup = console.group;\n      prevGroupCollapsed = console.groupCollapsed;\n      prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n      var props = {\n        configurable: true,\n        enumerable: true,\n        value: disabledLog,\n        writable: true\n      }; // $FlowFixMe[cannot-write] Flow thinks console is immutable.\n\n      Object.defineProperties(console, {\n        info: props,\n        log: props,\n        warn: props,\n        error: props,\n        group: props,\n        groupCollapsed: props,\n        groupEnd: props\n      });\n      /* eslint-enable react-internal/no-production-logging */\n    }\n\n    disabledDepth++;\n  }\n}\nfunction reenableLogs() {\n  {\n    disabledDepth--;\n\n    if (disabledDepth === 0) {\n      /* eslint-disable react-internal/no-production-logging */\n      var props = {\n        configurable: true,\n        enumerable: true,\n        writable: true\n      }; // $FlowFixMe[cannot-write] Flow thinks console is immutable.\n\n      Object.defineProperties(console, {\n        log: assign({}, props, {\n          value: prevLog\n        }),\n        info: assign({}, props, {\n          value: prevInfo\n        }),\n        warn: assign({}, props, {\n          value: prevWarn\n        }),\n        error: assign({}, props, {\n          value: prevError\n        }),\n        group: assign({}, props, {\n          value: prevGroup\n        }),\n        groupCollapsed: assign({}, props, {\n          value: prevGroupCollapsed\n        }),\n        groupEnd: assign({}, props, {\n          value: prevGroupEnd\n        })\n      });\n      /* eslint-enable react-internal/no-production-logging */\n    }\n\n    if (disabledDepth < 0) {\n      error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n    }\n  }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, ownerFn) {\n  {\n    if (prefix === undefined) {\n      // Extract the VM specific prefix used by each line.\n      try {\n        throw Error();\n      } catch (x) {\n        var match = x.stack.trim().match(/\\n( *(at )?)/);\n        prefix = match && match[1] || '';\n      }\n    } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n    return '\\n' + prefix + name;\n  }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n  var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n  componentFrameCache = new PossiblyWeakMap();\n}\n/**\n * Leverages native browser/VM stack frames to get proper details (e.g.\n * filename, line + col number) for a single component in a component stack. We\n * do this by:\n *   (1) throwing and catching an error in the function - this will be our\n *       control error.\n *   (2) calling the component which will eventually throw an error that we'll\n *       catch - this will be our sample error.\n *   (3) diffing the control and sample error stacks to find the stack frame\n *       which represents our component.\n */\n\n\nfunction describeNativeComponentFrame(fn, construct) {\n  // If something asked for a stack inside a fake render, it should get ignored.\n  if (!fn || reentry) {\n    return '';\n  }\n\n  {\n    var frame = componentFrameCache.get(fn);\n\n    if (frame !== undefined) {\n      return frame;\n    }\n  }\n\n  reentry = true;\n  var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe[incompatible-type] It does accept undefined.\n\n  Error.prepareStackTrace = undefined;\n  var previousDispatcher;\n\n  {\n    previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n    // for warnings.\n\n    ReactCurrentDispatcher.current = null;\n    disableLogs();\n  }\n  /**\n   * Finding a common stack frame between sample and control errors can be\n   * tricky given the different types and levels of stack trace truncation from\n   * different JS VMs. So instead we'll attempt to control what that common\n   * frame should be through this object method:\n   * Having both the sample and control errors be in the function under the\n   * `DescribeNativeComponentFrameRoot` property, + setting the `name` and\n   * `displayName` properties of the function ensures that a stack\n   * frame exists that has the method name `DescribeNativeComponentFrameRoot` in\n   * it for both control and sample stacks.\n   */\n\n\n  var RunInRootFrame = {\n    DetermineComponentFrameRoot: function () {\n      var control;\n\n      try {\n        // This should throw.\n        if (construct) {\n          // Something should be setting the props in the constructor.\n          var Fake = function () {\n            throw Error();\n          }; // $FlowFixMe[prop-missing]\n\n\n          Object.defineProperty(Fake.prototype, 'props', {\n            set: function () {\n              // We use a throwing setter instead of frozen or non-writable props\n              // because that won't throw in a non-strict mode function.\n              throw Error();\n            }\n          });\n\n          if (typeof Reflect === 'object' && Reflect.construct) {\n            // We construct a different control for this case to include any extra\n            // frames added by the construct call.\n            try {\n              Reflect.construct(Fake, []);\n            } catch (x) {\n              control = x;\n            }\n\n            Reflect.construct(fn, [], Fake);\n          } else {\n            try {\n              Fake.call();\n            } catch (x) {\n              control = x;\n            } // $FlowFixMe[prop-missing] found when upgrading Flow\n\n\n            fn.call(Fake.prototype);\n          }\n        } else {\n          try {\n            throw Error();\n          } catch (x) {\n            control = x;\n          } // TODO(luna): This will currently only throw if the function component\n          // tries to access React/ReactDOM/props. We should probably make this throw\n          // in simple components too\n\n\n          var maybePromise = fn(); // If the function component returns a promise, it's likely an async\n          // component, which we don't yet support. Attach a noop catch handler to\n          // silence the error.\n          // TODO: Implement component stacks for async client components?\n\n          if (maybePromise && typeof maybePromise.catch === 'function') {\n            maybePromise.catch(function () {});\n          }\n        }\n      } catch (sample) {\n        // This is inlined manually because closure doesn't do it for us.\n        if (sample && control && typeof sample.stack === 'string') {\n          return [sample.stack, control.stack];\n        }\n      }\n\n      return [null, null];\n    }\n  }; // $FlowFixMe[prop-missing]\n\n  RunInRootFrame.DetermineComponentFrameRoot.displayName = 'DetermineComponentFrameRoot';\n  var namePropDescriptor = Object.getOwnPropertyDescriptor(RunInRootFrame.DetermineComponentFrameRoot, 'name'); // Before ES6, the `name` property was not configurable.\n\n  if (namePropDescriptor && namePropDescriptor.configurable) {\n    // V8 utilizes a function's `name` property when generating a stack trace.\n    Object.defineProperty(RunInRootFrame.DetermineComponentFrameRoot, // Configurable properties can be updated even if its writable descriptor\n    // is set to `false`.\n    // $FlowFixMe[cannot-write]\n    'name', {\n      value: 'DetermineComponentFrameRoot'\n    });\n  }\n\n  try {\n    var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(),\n        sampleStack = _RunInRootFrame$Deter[0],\n        controlStack = _RunInRootFrame$Deter[1];\n\n    if (sampleStack && controlStack) {\n      // This extracts the first frame from the sample that isn't also in the control.\n      // Skipping one frame that we assume is the frame that calls the two.\n      var sampleLines = sampleStack.split('\\n');\n      var controlLines = controlStack.split('\\n');\n      var s = 0;\n      var c = 0;\n\n      while (s < sampleLines.length && !sampleLines[s].includes('DetermineComponentFrameRoot')) {\n        s++;\n      }\n\n      while (c < controlLines.length && !controlLines[c].includes('DetermineComponentFrameRoot')) {\n        c++;\n      } // We couldn't find our intentionally injected common root frame, attempt\n      // to find another common root frame by search from the bottom of the\n      // control stack...\n\n\n      if (s === sampleLines.length || c === controlLines.length) {\n        s = sampleLines.length - 1;\n        c = controlLines.length - 1;\n\n        while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n          // We expect at least one stack frame to be shared.\n          // Typically this will be the root most one. However, stack frames may be\n          // cut off due to maximum stack limits. In this case, one maybe cut off\n          // earlier than the other. We assume that the sample is longer or the same\n          // and there for cut off earlier. So we should find the root most frame in\n          // the sample somewhere in the control.\n          c--;\n        }\n      }\n\n      for (; s >= 1 && c >= 0; s--, c--) {\n        // Next we find the first one that isn't the same which should be the\n        // frame that called our sample function and the control.\n        if (sampleLines[s] !== controlLines[c]) {\n          // In V8, the first line is describing the message but other VMs don't.\n          // If we're about to return the first line, and the control is also on the same\n          // line, that's a pretty good indicator that our sample threw at same line as\n          // the control. I.e. before we entered the sample frame. So we ignore this result.\n          // This can happen if you passed a class to function component, or non-function.\n          if (s !== 1 || c !== 1) {\n            do {\n              s--;\n              c--; // We may still have similar intermediate frames from the construct call.\n              // The next one that isn't the same should be our match though.\n\n              if (c < 0 || sampleLines[s] !== controlLines[c]) {\n                // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n                var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"<anonymous>\"\n                // but we have a user-provided \"displayName\"\n                // splice it in to make the stack more readable.\n\n\n                if (fn.displayName && _frame.includes('<anonymous>')) {\n                  _frame = _frame.replace('<anonymous>', fn.displayName);\n                }\n\n                if (true) {\n                  if (typeof fn === 'function') {\n                    componentFrameCache.set(fn, _frame);\n                  }\n                } // Return the line we found.\n\n\n                return _frame;\n              }\n            } while (s >= 1 && c >= 0);\n          }\n\n          break;\n        }\n      }\n    }\n  } finally {\n    reentry = false;\n\n    {\n      ReactCurrentDispatcher.current = previousDispatcher;\n      reenableLogs();\n    }\n\n    Error.prepareStackTrace = previousPrepareStackTrace;\n  } // Fallback to just using the name if we couldn't make it throw.\n\n\n  var name = fn ? fn.displayName || fn.name : '';\n  var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n  {\n    if (typeof fn === 'function') {\n      componentFrameCache.set(fn, syntheticFrame);\n    }\n  }\n\n  return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, ownerFn) {\n  {\n    return describeNativeComponentFrame(fn, false);\n  }\n}\n\nfunction shouldConstruct(Component) {\n  var prototype = Component.prototype;\n  return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, ownerFn) {\n\n  if (type == null) {\n    return '';\n  }\n\n  if (typeof type === 'function') {\n    {\n      return describeNativeComponentFrame(type, shouldConstruct(type));\n    }\n  }\n\n  if (typeof type === 'string') {\n    return describeBuiltInComponentFrame(type);\n  }\n\n  switch (type) {\n    case REACT_SUSPENSE_TYPE:\n      return describeBuiltInComponentFrame('Suspense');\n\n    case REACT_SUSPENSE_LIST_TYPE:\n      return describeBuiltInComponentFrame('SuspenseList');\n  }\n\n  if (typeof type === 'object') {\n    switch (type.$$typeof) {\n      case REACT_FORWARD_REF_TYPE:\n        return describeFunctionComponentFrame(type.render);\n\n      case REACT_MEMO_TYPE:\n        // Memo may contain any component type so we recursively resolve it.\n        return describeUnknownElementTypeFrameInDEV(type.type, ownerFn);\n\n      case REACT_LAZY_TYPE:\n        {\n          var lazyComponent = type;\n          var payload = lazyComponent._payload;\n          var init = lazyComponent._init;\n\n          try {\n            // Lazy may contain any component type so we recursively resolve it.\n            return describeUnknownElementTypeFrameInDEV(init(payload), ownerFn);\n          } catch (x) {}\n        }\n    }\n  }\n\n  return '';\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\nvar REACT_CLIENT_REFERENCE = Symbol.for('react.client.reference');\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n  didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n  {\n    if (hasOwnProperty.call(config, 'ref')) {\n      var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n      if (getter && getter.isReactWarning) {\n        return false;\n      }\n    }\n  }\n\n  return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n  {\n    if (hasOwnProperty.call(config, 'key')) {\n      var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n      if (getter && getter.isReactWarning) {\n        return false;\n      }\n    }\n  }\n\n  return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n  {\n    if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n      var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n      if (!didWarnAboutStringRefs[componentName]) {\n        error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n        didWarnAboutStringRefs[componentName] = true;\n      }\n    }\n  }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n  {\n    var warnAboutAccessingKey = function () {\n      if (!specialPropKeyWarningShown) {\n        specialPropKeyWarningShown = true;\n\n        error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n      }\n    };\n\n    warnAboutAccessingKey.isReactWarning = true;\n    Object.defineProperty(props, 'key', {\n      get: warnAboutAccessingKey,\n      configurable: true\n    });\n  }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n  {\n    {\n      var warnAboutAccessingRef = function () {\n        if (!specialPropRefWarningShown) {\n          specialPropRefWarningShown = true;\n\n          error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n        }\n      };\n\n      warnAboutAccessingRef.isReactWarning = true;\n      Object.defineProperty(props, 'ref', {\n        get: warnAboutAccessingRef,\n        configurable: true\n      });\n    }\n  }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nfunction ReactElement(type, key, _ref, self, source, owner, props) {\n  var ref;\n\n  {\n    ref = _ref;\n  }\n\n  var element;\n\n  {\n    // In prod, `ref` is a regular property. It will be removed in a\n    // future release.\n    element = {\n      // This tag allows us to uniquely identify this as a React Element\n      $$typeof: REACT_ELEMENT_TYPE,\n      // Built-in properties that belong on the element\n      type: type,\n      key: key,\n      ref: ref,\n      props: props,\n      // Record the component responsible for creating this element.\n      _owner: owner\n    };\n  }\n\n  {\n    // The validation flag is currently mutative. We put it on\n    // an external backing store so that we can freeze the whole object.\n    // This can be replaced with a WeakMap once they are implemented in\n    // commonly used development environments.\n    element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n    // the validation flag non-enumerable (where possible, which should\n    // include every environment we run tests in), so the test framework\n    // ignores it.\n\n    Object.defineProperty(element._store, 'validated', {\n      configurable: false,\n      enumerable: false,\n      writable: true,\n      value: false\n    }); // debugInfo contains Server Component debug information.\n\n    Object.defineProperty(element, '_debugInfo', {\n      configurable: false,\n      enumerable: false,\n      writable: true,\n      value: null\n    });\n\n    if (Object.freeze) {\n      Object.freeze(element.props);\n      Object.freeze(element);\n    }\n  }\n\n  return element;\n}\nvar didWarnAboutKeySpread = {};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV$1(type, config, maybeKey, isStaticChildren, source, self) {\n  {\n    if (!isValidElementType(type)) {\n      // This is an invalid element type.\n      //\n      // We warn in this case but don't throw. We expect the element creation to\n      // succeed and there will likely be errors in render.\n      var info = '';\n\n      if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n        info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n      }\n\n      var typeString;\n\n      if (type === null) {\n        typeString = 'null';\n      } else if (isArray(type)) {\n        typeString = 'array';\n      } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n        typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n        info = ' Did you accidentally export a JSX literal instead of a component?';\n      } else {\n        typeString = typeof type;\n      }\n\n      error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n    } else {\n      // This is a valid element type.\n      // Skip key warning if the type isn't valid since our key validation logic\n      // doesn't expect a non-string/function type and can throw confusing\n      // errors. We don't want exception behavior to differ between dev and\n      // prod. (Rendering will throw with a helpful message and as soon as the\n      // type is fixed, the key warnings will appear.)\n      var children = config.children;\n\n      if (children !== undefined) {\n        if (isStaticChildren) {\n          if (isArray(children)) {\n            for (var i = 0; i < children.length; i++) {\n              validateChildKeys(children[i], type);\n            }\n\n            if (Object.freeze) {\n              Object.freeze(children);\n            }\n          } else {\n            error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n          }\n        } else {\n          validateChildKeys(children, type);\n        }\n      }\n    } // Warn about key spread regardless of whether the type is valid.\n\n\n    if (hasOwnProperty.call(config, 'key')) {\n      var componentName = getComponentNameFromType(type);\n      var keys = Object.keys(config).filter(function (k) {\n        return k !== 'key';\n      });\n      var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';\n\n      if (!didWarnAboutKeySpread[componentName + beforeExample]) {\n        var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';\n\n        error('A props object containing a \"key\" prop is being spread into JSX:\\n' + '  let props = %s;\\n' + '  <%s {...props} />\\n' + 'React keys must be passed directly to JSX without using spread:\\n' + '  let props = %s;\\n' + '  <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);\n\n        didWarnAboutKeySpread[componentName + beforeExample] = true;\n      }\n    }\n\n    var propName; // Reserved names are extracted\n\n    var props = {};\n    var key = null;\n    var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n    // issue if key is also explicitly declared (ie. <div {...props} key=\"Hi\" />\n    // or <div key=\"Hi\" {...props} /> ). We want to deprecate key spread,\n    // but as an intermediary step, we will use jsxDEV for everything except\n    // <div {...props} key=\"Hi\" />, because we aren't currently able to tell if\n    // key is explicitly declared to be undefined or not.\n\n    if (maybeKey !== undefined) {\n      {\n        checkKeyStringCoercion(maybeKey);\n      }\n\n      key = '' + maybeKey;\n    }\n\n    if (hasValidKey(config)) {\n      {\n        checkKeyStringCoercion(config.key);\n      }\n\n      key = '' + config.key;\n    }\n\n    if (hasValidRef(config)) {\n      {\n        ref = config.ref;\n      }\n\n      warnIfStringRefCannotBeAutoConverted(config, self);\n    } // Remaining properties are added to a new props object\n\n\n    for (propName in config) {\n      if (hasOwnProperty.call(config, propName) && // Skip over reserved prop names\n      propName !== 'key' && (propName !== 'ref')) {\n        props[propName] = config[propName];\n      }\n    } // Resolve default props\n\n\n    if (type && type.defaultProps) {\n      var defaultProps = type.defaultProps;\n\n      for (propName in defaultProps) {\n        if (props[propName] === undefined) {\n          props[propName] = defaultProps[propName];\n        }\n      }\n    }\n\n    if (key || ref) {\n      var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n      if (key) {\n        defineKeyPropWarningGetter(props, displayName);\n      }\n\n      if (ref) {\n        defineRefPropWarningGetter(props, displayName);\n      }\n    }\n\n    var element = ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n\n    if (type === REACT_FRAGMENT_TYPE) {\n      validateFragmentProps(element);\n    }\n\n    return element;\n  }\n}\n\nfunction getDeclarationErrorAddendum() {\n  {\n    if (ReactCurrentOwner.current) {\n      var name = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n      if (name) {\n        return '\\n\\nCheck the render method of `' + name + '`.';\n      }\n    }\n\n    return '';\n  }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n  {\n    if (typeof node !== 'object' || !node) {\n      return;\n    }\n\n    if (node.$$typeof === REACT_CLIENT_REFERENCE) ; else if (isArray(node)) {\n      for (var i = 0; i < node.length; i++) {\n        var child = node[i];\n\n        if (isValidElement(child)) {\n          validateExplicitKey(child, parentType);\n        }\n      }\n    } else if (isValidElement(node)) {\n      // This element was passed in a valid location.\n      if (node._store) {\n        node._store.validated = true;\n      }\n    } else {\n      var iteratorFn = getIteratorFn(node);\n\n      if (typeof iteratorFn === 'function') {\n        // Entry iterators used to provide implicit keys,\n        // but now we print a separate warning for them later.\n        if (iteratorFn !== node.entries) {\n          var iterator = iteratorFn.call(node);\n          var step;\n\n          while (!(step = iterator.next()).done) {\n            if (isValidElement(step.value)) {\n              validateExplicitKey(step.value, parentType);\n            }\n          }\n        }\n      }\n    }\n  }\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n  return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\nvar ownerHasKeyUseWarning = {};\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\nfunction validateExplicitKey(element, parentType) {\n  {\n    if (!element._store || element._store.validated || element.key != null) {\n      return;\n    }\n\n    element._store.validated = true;\n    var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n    if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n      return;\n    }\n\n    ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n    // property, it may be the creator of the child that's responsible for\n    // assigning it a key.\n\n    var childOwner = '';\n\n    if (element && element._owner && element._owner !== ReactCurrentOwner.current) {\n      // Give the component that originally created this child.\n      childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n    }\n\n    setCurrentlyValidatingElement(element);\n\n    error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n    setCurrentlyValidatingElement(null);\n  }\n}\n\nfunction setCurrentlyValidatingElement(element) {\n  {\n    if (element) {\n      var owner = element._owner;\n      var stack = describeUnknownElementTypeFrameInDEV(element.type, owner ? owner.type : null);\n      ReactDebugCurrentFrame.setExtraStackFrame(stack);\n    } else {\n      ReactDebugCurrentFrame.setExtraStackFrame(null);\n    }\n  }\n}\n\nfunction getCurrentComponentErrorInfo(parentType) {\n  {\n    var info = getDeclarationErrorAddendum();\n\n    if (!info) {\n      var parentName = getComponentNameFromType(parentType);\n\n      if (parentName) {\n        info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n      }\n    }\n\n    return info;\n  }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n  // TODO: Move this to render phase instead of at element creation.\n  {\n    var keys = Object.keys(fragment.props);\n\n    for (var i = 0; i < keys.length; i++) {\n      var key = keys[i];\n\n      if (key !== 'children' && key !== 'key') {\n        setCurrentlyValidatingElement(fragment);\n\n        error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n        setCurrentlyValidatingElement(null);\n        break;\n      }\n    }\n\n    if (fragment.ref !== null) {\n      setCurrentlyValidatingElement(fragment);\n\n      error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n      setCurrentlyValidatingElement(null);\n    }\n  }\n}\n\nvar jsxDEV = jsxDEV$1 ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsxDEV = jsxDEV;\n  })();\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64, \n//# sourceURL=webpack-internal:///(app-pages-browser)/./node_modules/next/dist/compiled/react/cjs/react-jsx-dev-runtime.development.js\n"));

/***/ }),

/***/ "(app-pages-browser)/./node_modules/next/dist/compiled/react/jsx-dev-runtime.js":
/*!******************************************************************!*\
  !*** ./node_modules/next/dist/compiled/react/jsx-dev-runtime.js ***!
  \******************************************************************/
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
eval(__webpack_require__.ts("\n\nif (false) {} else {\n  module.exports = __webpack_require__(/*! ./cjs/react-jsx-dev-runtime.development.js */ \"(app-pages-browser)/./node_modules/next/dist/compiled/react/cjs/react-jsx-dev-runtime.development.js\");\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL25vZGVfbW9kdWxlcy9uZXh0L2Rpc3QvY29tcGlsZWQvcmVhY3QvanN4LWRldi1ydW50aW1lLmpzIiwibWFwcGluZ3MiOiJBQUFhOztBQUViLElBQUksS0FBcUMsRUFBRSxFQUUxQyxDQUFDO0FBQ0YsRUFBRSw4TEFBc0U7QUFDeEUiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9fTl9FLy4vbm9kZV9tb2R1bGVzL25leHQvZGlzdC9jb21waWxlZC9yZWFjdC9qc3gtZGV2LXJ1bnRpbWUuanM/OTU0ZSJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG5cbmlmIChwcm9jZXNzLmVudi5OT0RFX0VOViA9PT0gJ3Byb2R1Y3Rpb24nKSB7XG4gIG1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9janMvcmVhY3QtanN4LWRldi1ydW50aW1lLnByb2R1Y3Rpb24ubWluLmpzJyk7XG59IGVsc2Uge1xuICBtb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4vY2pzL3JlYWN0LWpzeC1kZXYtcnVudGltZS5kZXZlbG9wbWVudC5qcycpO1xufVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///(app-pages-browser)/./node_modules/next/dist/compiled/react/jsx-dev-runtime.js\n"));

/***/ }),

/***/ "(app-pages-browser)/./node_modules/pocketbase/dist/pocketbase.es.mjs":
/*!********************************************************!*\
  !*** ./node_modules/pocketbase/dist/pocketbase.es.mjs ***!
  \********************************************************/
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {

"use strict";
eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   AdminService: function() { return /* binding */ AdminService; },\n/* harmony export */   AsyncAuthStore: function() { return /* binding */ AsyncAuthStore; },\n/* harmony export */   BaseAuthStore: function() { return /* binding */ BaseAuthStore; },\n/* harmony export */   ClientResponseError: function() { return /* binding */ ClientResponseError; },\n/* harmony export */   CollectionService: function() { return /* binding */ CollectionService; },\n/* harmony export */   CrudService: function() { return /* binding */ CrudService; },\n/* harmony export */   HealthService: function() { return /* binding */ HealthService; },\n/* harmony export */   LocalAuthStore: function() { return /* binding */ LocalAuthStore; },\n/* harmony export */   LogService: function() { return /* binding */ LogService; },\n/* harmony export */   RealtimeService: function() { return /* binding */ RealtimeService; },\n/* harmony export */   RecordService: function() { return /* binding */ RecordService; },\n/* harmony export */   cookieParse: function() { return /* binding */ cookieParse; },\n/* harmony export */   cookieSerialize: function() { return /* binding */ cookieSerialize; },\n/* harmony export */   \"default\": function() { return /* binding */ Client; },\n/* harmony export */   getTokenPayload: function() { return /* binding */ getTokenPayload; },\n/* harmony export */   isTokenExpired: function() { return /* binding */ isTokenExpired; },\n/* harmony export */   normalizeUnknownQueryParams: function() { return /* binding */ normalizeUnknownQueryParams; }\n/* harmony export */ });\nclass ClientResponseError extends Error{constructor(e){super(\"ClientResponseError\"),this.url=\"\",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,ClientResponseError.prototype),null!==e&&\"object\"==typeof e&&(this.url=\"string\"==typeof e.url?e.url:\"\",this.status=\"number\"==typeof e.status?e.status:0,this.isAbort=!!e.isAbort,this.originalError=e.originalError,null!==e.response&&\"object\"==typeof e.response?this.response=e.response:null!==e.data&&\"object\"==typeof e.data?this.response=e.data:this.response={}),this.originalError||e instanceof ClientResponseError||(this.originalError=e),\"undefined\"!=typeof DOMException&&e instanceof DOMException&&(this.isAbort=!0),this.name=\"ClientResponseError \"+this.status,this.message=this.response?.message,this.message||(this.isAbort?this.message=\"The request was autocancelled. You can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation.\":this.originalError?.cause?.message?.includes(\"ECONNREFUSED ::1\")?this.message=\"Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).\":this.message=\"Something went wrong while processing your request.\")}get data(){return this.response}toJSON(){return{...this}}}const e=/^[\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+$/;function cookieParse(e,t){const s={};if(\"string\"!=typeof e)return s;const i=Object.assign({},t||{}).decode||defaultDecode;let n=0;for(;n<e.length;){const t=e.indexOf(\"=\",n);if(-1===t)break;let r=e.indexOf(\";\",n);if(-1===r)r=e.length;else if(r<t){n=e.lastIndexOf(\";\",t-1)+1;continue}const o=e.slice(n,t).trim();if(void 0===s[o]){let n=e.slice(t+1,r).trim();34===n.charCodeAt(0)&&(n=n.slice(1,-1));try{s[o]=i(n)}catch(e){s[o]=n}}n=r+1}return s}function cookieSerialize(t,s,i){const n=Object.assign({},i||{}),r=n.encode||defaultEncode;if(!e.test(t))throw new TypeError(\"argument name is invalid\");const o=r(s);if(o&&!e.test(o))throw new TypeError(\"argument val is invalid\");let a=t+\"=\"+o;if(null!=n.maxAge){const e=n.maxAge-0;if(isNaN(e)||!isFinite(e))throw new TypeError(\"option maxAge is invalid\");a+=\"; Max-Age=\"+Math.floor(e)}if(n.domain){if(!e.test(n.domain))throw new TypeError(\"option domain is invalid\");a+=\"; Domain=\"+n.domain}if(n.path){if(!e.test(n.path))throw new TypeError(\"option path is invalid\");a+=\"; Path=\"+n.path}if(n.expires){if(!function isDate(e){return\"[object Date]\"===Object.prototype.toString.call(e)||e instanceof Date}(n.expires)||isNaN(n.expires.valueOf()))throw new TypeError(\"option expires is invalid\");a+=\"; Expires=\"+n.expires.toUTCString()}if(n.httpOnly&&(a+=\"; HttpOnly\"),n.secure&&(a+=\"; Secure\"),n.priority){switch(\"string\"==typeof n.priority?n.priority.toLowerCase():n.priority){case\"low\":a+=\"; Priority=Low\";break;case\"medium\":a+=\"; Priority=Medium\";break;case\"high\":a+=\"; Priority=High\";break;default:throw new TypeError(\"option priority is invalid\")}}if(n.sameSite){switch(\"string\"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:a+=\"; SameSite=Strict\";break;case\"lax\":a+=\"; SameSite=Lax\";break;case\"strict\":a+=\"; SameSite=Strict\";break;case\"none\":a+=\"; SameSite=None\";break;default:throw new TypeError(\"option sameSite is invalid\")}}return a}function defaultDecode(e){return-1!==e.indexOf(\"%\")?decodeURIComponent(e):e}function defaultEncode(e){return encodeURIComponent(e)}const t=\"undefined\"!=typeof navigator&&\"ReactNative\"===navigator.product||\"undefined\"!=typeof global&&global.HermesInternal;let s;function getTokenPayload(e){if(e)try{const t=decodeURIComponent(s(e.split(\".\")[1]).split(\"\").map((function(e){return\"%\"+(\"00\"+e.charCodeAt(0).toString(16)).slice(-2)})).join(\"\"));return JSON.parse(t)||{}}catch(e){}return{}}function isTokenExpired(e,t=0){let s=getTokenPayload(e);return!(Object.keys(s).length>0&&(!s.exp||s.exp-t>Date.now()/1e3))}s=\"function\"!=typeof atob||t?e=>{let t=String(e).replace(/=+$/,\"\");if(t.length%4==1)throw new Error(\"'atob' failed: The string to be decoded is not correctly encoded.\");for(var s,i,n=0,r=0,o=\"\";i=t.charAt(r++);~i&&(s=n%4?64*s+i:i,n++%4)?o+=String.fromCharCode(255&s>>(-2*n&6)):0)i=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\".indexOf(i);return o}:atob;const i=\"pb_auth\";class BaseAuthStore{constructor(){this.baseToken=\"\",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!isTokenExpired(this.token)}get isAdmin(){return\"admin\"===getTokenPayload(this.token).type}get isAuthRecord(){return\"authRecord\"===getTokenPayload(this.token).type}save(e,t){this.baseToken=e||\"\",this.baseModel=t||null,this.triggerChange()}clear(){this.baseToken=\"\",this.baseModel=null,this.triggerChange()}loadFromCookie(e,t=i){const s=cookieParse(e||\"\")[t]||\"\";let n={};try{n=JSON.parse(s),(null===typeof n||\"object\"!=typeof n||Array.isArray(n))&&(n={})}catch(e){}this.save(n.token||\"\",n.model||null)}exportToCookie(e,t=i){const s={secure:!0,sameSite:!0,httpOnly:!0,path:\"/\"},n=getTokenPayload(this.token);s.expires=n?.exp?new Date(1e3*n.exp):new Date(\"1970-01-01\"),e=Object.assign({},s,e);const r={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let o=cookieSerialize(t,JSON.stringify(r),e);const a=\"undefined\"!=typeof Blob?new Blob([o]).size:o.length;if(r.model&&a>4096){r.model={id:r?.model?.id,email:r?.model?.email};const s=[\"collectionId\",\"username\",\"verified\"];for(const e in this.model)s.includes(e)&&(r.model[e]=this.model[e]);o=cookieSerialize(t,JSON.stringify(r),e)}return o}onChange(e,t=!1){return this._onChangeCallbacks.push(e),t&&e(this.token,this.model),()=>{for(let t=this._onChangeCallbacks.length-1;t>=0;t--)if(this._onChangeCallbacks[t]==e)return delete this._onChangeCallbacks[t],void this._onChangeCallbacks.splice(t,1)}}triggerChange(){for(const e of this._onChangeCallbacks)e&&e(this.token,this.model)}}class LocalAuthStore extends BaseAuthStore{constructor(e=\"pocketbase_auth\"){super(),this.storageFallback={},this.storageKey=e,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||\"\"}get model(){return(this._storageGet(this.storageKey)||{}).model||null}save(e,t){this._storageSet(this.storageKey,{token:e,model:t}),super.save(e,t)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(e){if(\"undefined\"!=typeof window&&window?.localStorage){const t=window.localStorage.getItem(e)||\"\";try{return JSON.parse(t)}catch(e){return t}}return this.storageFallback[e]}_storageSet(e,t){if(\"undefined\"!=typeof window&&window?.localStorage){let s=t;\"string\"!=typeof t&&(s=JSON.stringify(t)),window.localStorage.setItem(e,s)}else this.storageFallback[e]=t}_storageRemove(e){\"undefined\"!=typeof window&&window?.localStorage&&window.localStorage?.removeItem(e),delete this.storageFallback[e]}_bindStorageEvent(){\"undefined\"!=typeof window&&window?.localStorage&&window.addEventListener&&window.addEventListener(\"storage\",(e=>{if(e.key!=this.storageKey)return;const t=this._storageGet(this.storageKey)||{};super.save(t.token||\"\",t.model||null)}))}}class BaseService{constructor(e){this.client=e}}class SettingsService extends BaseService{async getAll(e){return e=Object.assign({method:\"GET\"},e),this.client.send(\"/api/settings\",e)}async update(e,t){return t=Object.assign({method:\"PATCH\",body:e},t),this.client.send(\"/api/settings\",t)}async testS3(e=\"storage\",t){return t=Object.assign({method:\"POST\",body:{filesystem:e}},t),this.client.send(\"/api/settings/test/s3\",t).then((()=>!0))}async testEmail(e,t,s){return s=Object.assign({method:\"POST\",body:{email:e,template:t}},s),this.client.send(\"/api/settings/test/email\",s).then((()=>!0))}async generateAppleClientSecret(e,t,s,i,n,r){return r=Object.assign({method:\"POST\",body:{clientId:e,teamId:t,keyId:s,privateKey:i,duration:n}},r),this.client.send(\"/api/settings/apple/generate-client-secret\",r)}}class CrudService extends BaseService{decode(e){return e}async getFullList(e,t){if(\"number\"==typeof e)return this._getFullList(e,t);let s=500;return(t=Object.assign({},e,t)).batch&&(s=t.batch,delete t.batch),this._getFullList(s,t)}async getList(e=1,t=30,s){return(s=Object.assign({method:\"GET\"},s)).query=Object.assign({page:e,perPage:t},s.query),this.client.send(this.baseCrudPath,s).then((e=>(e.items=e.items?.map((e=>this.decode(e)))||[],e)))}async getFirstListItem(e,t){return(t=Object.assign({requestKey:\"one_by_filter_\"+this.baseCrudPath+\"_\"+e},t)).query=Object.assign({filter:e,skipTotal:1},t.query),this.getList(1,1,t).then((e=>{if(!e?.items?.length)throw new ClientResponseError({status:404,response:{code:404,message:\"The requested resource wasn't found.\",data:{}}});return e.items[0]}))}async getOne(e,t){if(!e)throw new ClientResponseError({url:this.client.buildUrl(this.baseCrudPath+\"/\"),status:404,response:{code:404,message:\"Missing required record id.\",data:{}}});return t=Object.assign({method:\"GET\"},t),this.client.send(this.baseCrudPath+\"/\"+encodeURIComponent(e),t).then((e=>this.decode(e)))}async create(e,t){return t=Object.assign({method:\"POST\",body:e},t),this.client.send(this.baseCrudPath,t).then((e=>this.decode(e)))}async update(e,t,s){return s=Object.assign({method:\"PATCH\",body:t},s),this.client.send(this.baseCrudPath+\"/\"+encodeURIComponent(e),s).then((e=>this.decode(e)))}async delete(e,t){return t=Object.assign({method:\"DELETE\"},t),this.client.send(this.baseCrudPath+\"/\"+encodeURIComponent(e),t).then((()=>!0))}_getFullList(e=500,t){(t=t||{}).query=Object.assign({skipTotal:1},t.query);let s=[],request=async i=>this.getList(i,e||500,t).then((e=>{const t=e.items;return s=s.concat(t),t.length==e.perPage?request(i+1):s}));return request(1)}}function normalizeLegacyOptionsArgs(e,t,s,i){const n=void 0!==i;return n||void 0!==s?n?(console.warn(e),t.body=Object.assign({},t.body,s),t.query=Object.assign({},t.query,i),t):Object.assign(t,s):t}function resetAutoRefresh(e){e._resetAutoRefresh?.()}class AdminService extends CrudService{get baseCrudPath(){return\"/api/admins\"}async update(e,t,s){return super.update(e,t,s).then((e=>(this.client.authStore.model?.id===e.id&&void 0===this.client.authStore.model?.collectionId&&this.client.authStore.save(this.client.authStore.token,e),e)))}async delete(e,t){return super.delete(e,t).then((t=>(t&&this.client.authStore.model?.id===e&&void 0===this.client.authStore.model?.collectionId&&this.client.authStore.clear(),t)))}authResponse(e){const t=this.decode(e?.admin||{});return e?.token&&e?.admin&&this.client.authStore.save(e.token,t),Object.assign({},e,{token:e?.token||\"\",admin:t})}async authWithPassword(e,t,s,i){let n={method:\"POST\",body:{identity:e,password:t}};n=normalizeLegacyOptionsArgs(\"This form of authWithPassword(email, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(email, pass, options?).\",n,s,i);const r=n.autoRefreshThreshold;delete n.autoRefreshThreshold,n.autoRefresh||resetAutoRefresh(this.client);let o=await this.client.send(this.baseCrudPath+\"/auth-with-password\",n);return o=this.authResponse(o),r&&function registerAutoRefresh(e,t,s,i){resetAutoRefresh(e);const n=e.beforeSend,r=e.authStore.model,o=e.authStore.onChange(((t,s)=>{(!t||s?.id!=r?.id||(s?.collectionId||r?.collectionId)&&s?.collectionId!=r?.collectionId)&&resetAutoRefresh(e)}));e._resetAutoRefresh=function(){o(),e.beforeSend=n,delete e._resetAutoRefresh},e.beforeSend=async(r,o)=>{const a=e.authStore.token;if(o.query?.autoRefresh)return n?n(r,o):{url:r,sendOptions:o};let c=e.authStore.isValid;if(c&&isTokenExpired(e.authStore.token,t))try{await s()}catch(e){c=!1}c||await i();const l=o.headers||{};for(let t in l)if(\"authorization\"==t.toLowerCase()&&a==l[t]&&e.authStore.token){l[t]=e.authStore.token;break}return o.headers=l,n?n(r,o):{url:r,sendOptions:o}}}(this.client,r,(()=>this.authRefresh({autoRefresh:!0})),(()=>this.authWithPassword(e,t,Object.assign({autoRefresh:!0},n)))),o}async authRefresh(e,t){let s={method:\"POST\"};return s=normalizeLegacyOptionsArgs(\"This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).\",s,e,t),this.client.send(this.baseCrudPath+\"/auth-refresh\",s).then(this.authResponse.bind(this))}async requestPasswordReset(e,t,s){let i={method:\"POST\",body:{email:e}};return i=normalizeLegacyOptionsArgs(\"This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).\",i,t,s),this.client.send(this.baseCrudPath+\"/request-password-reset\",i).then((()=>!0))}async confirmPasswordReset(e,t,s,i,n){let r={method:\"POST\",body:{token:e,password:t,passwordConfirm:s}};return r=normalizeLegacyOptionsArgs(\"This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).\",r,i,n),this.client.send(this.baseCrudPath+\"/confirm-password-reset\",r).then((()=>!0))}}const n=[\"requestKey\",\"$cancelKey\",\"$autoCancel\",\"fetch\",\"headers\",\"body\",\"query\",\"params\",\"cache\",\"credentials\",\"headers\",\"integrity\",\"keepalive\",\"method\",\"mode\",\"redirect\",\"referrer\",\"referrerPolicy\",\"signal\",\"window\"];function normalizeUnknownQueryParams(e){if(e){e.query=e.query||{};for(let t in e)n.includes(t)||(e.query[t]=e[t],delete e[t])}}class RealtimeService extends BaseService{constructor(){super(...arguments),this.clientId=\"\",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(e,t,s){if(!e)throw new Error(\"topic must be set.\");let i=e;if(s){normalizeUnknownQueryParams(s=Object.assign({},s));const e=\"options=\"+encodeURIComponent(JSON.stringify({query:s.query,headers:s.headers}));i+=(i.includes(\"?\")?\"&\":\"?\")+e}const listener=function(e){const s=e;let i;try{i=JSON.parse(s?.data)}catch{}t(i||{})};return this.subscriptions[i]||(this.subscriptions[i]=[]),this.subscriptions[i].push(listener),this.isConnected?1===this.subscriptions[i].length?await this.submitSubscriptions():this.eventSource?.addEventListener(i,listener):await this.connect(),async()=>this.unsubscribeByTopicAndListener(e,listener)}async unsubscribe(e){let t=!1;if(e){const s=this.getSubscriptionsByTopic(e);for(let e in s)if(this.hasSubscriptionListeners(e)){for(let t of this.subscriptions[e])this.eventSource?.removeEventListener(e,t);delete this.subscriptions[e],t||(t=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?t&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(e){let t=!1;for(let s in this.subscriptions)if((s+\"?\").startsWith(e)){t=!0;for(let e of this.subscriptions[s])this.eventSource?.removeEventListener(s,e);delete this.subscriptions[s]}t&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(e,t){let s=!1;const i=this.getSubscriptionsByTopic(e);for(let e in i){if(!Array.isArray(this.subscriptions[e])||!this.subscriptions[e].length)continue;let i=!1;for(let s=this.subscriptions[e].length-1;s>=0;s--)this.subscriptions[e][s]===t&&(i=!0,delete this.subscriptions[e][s],this.subscriptions[e].splice(s,1),this.eventSource?.removeEventListener(e,t));i&&(this.subscriptions[e].length||delete this.subscriptions[e],s||this.hasSubscriptionListeners(e)||(s=!0))}this.hasSubscriptionListeners()?s&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(e){if(this.subscriptions=this.subscriptions||{},e)return!!this.subscriptions[e]?.length;for(let e in this.subscriptions)if(this.subscriptions[e]?.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send(\"/api/realtime\",{method:\"POST\",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch((e=>{if(!e?.isAbort)throw e}))}getSubscriptionsCancelKey(){return\"realtime_\"+this.clientId}getSubscriptionsByTopic(e){const t={};e=e.includes(\"?\")?e:e+\"?\";for(let s in this.subscriptions)(s+\"?\").startsWith(e)&&(t[s]=this.subscriptions[s]);return t}getNonEmptySubscriptionKeys(){const e=[];for(let t in this.subscriptions)this.subscriptions[t].length&&e.push(t);return e}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.addEventListener(e,t)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.removeEventListener(e,t)}async connect(){if(!(this.reconnectAttempts>0))return new Promise(((e,t)=>{this.pendingConnects.push({resolve:e,reject:t}),this.pendingConnects.length>1||this.initConnect()}))}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout((()=>{this.connectErrorHandler(new Error(\"EventSource connect took too long.\"))}),this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildUrl(\"/api/realtime\")),this.eventSource.onerror=e=>{this.connectErrorHandler(new Error(\"Failed to establish realtime connection.\"))},this.eventSource.addEventListener(\"PB_CONNECT\",(e=>{const t=e;this.clientId=t?.lastEventId,this.submitSubscriptions().then((async()=>{let e=3;for(;this.hasUnsentSubscriptions()&&e>0;)e--,await this.submitSubscriptions()})).then((()=>{for(let e of this.pendingConnects)e.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const t=this.getSubscriptionsByTopic(\"PB_CONNECT\");for(let s in t)for(let i of t[s])i(e)})).catch((e=>{this.clientId=\"\",this.connectErrorHandler(e)}))}))}hasUnsentSubscriptions(){const e=this.getNonEmptySubscriptionKeys();if(e.length!=this.lastSentSubscriptions.length)return!0;for(const t of e)if(!this.lastSentSubscriptions.includes(t))return!0;return!1}connectErrorHandler(e){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let t of this.pendingConnects)t.reject(new ClientResponseError(e));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const t=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout((()=>{this.initConnect()}),t)}disconnect(e=!1){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),this.eventSource?.close(),this.eventSource=null,this.clientId=\"\",!e){this.reconnectAttempts=0;for(let e of this.pendingConnects)e.resolve();this.pendingConnects=[]}}}class RecordService extends CrudService{constructor(e,t){super(e),this.collectionIdOrName=t}get baseCrudPath(){return this.baseCollectionPath+\"/records\"}get baseCollectionPath(){return\"/api/collections/\"+encodeURIComponent(this.collectionIdOrName)}async subscribe(e,t,s){if(!e)throw new Error(\"Missing topic.\");if(!t)throw new Error(\"Missing subscription callback.\");return this.client.realtime.subscribe(this.collectionIdOrName+\"/\"+e,t,s)}async unsubscribe(e){return e?this.client.realtime.unsubscribe(this.collectionIdOrName+\"/\"+e):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(e,t){if(\"number\"==typeof e)return super.getFullList(e,t);const s=Object.assign({},e,t);return super.getFullList(s)}async getList(e=1,t=30,s){return super.getList(e,t,s)}async getFirstListItem(e,t){return super.getFirstListItem(e,t)}async getOne(e,t){return super.getOne(e,t)}async create(e,t){return super.create(e,t)}async update(e,t,s){return super.update(e,t,s).then((e=>(this.client.authStore.model?.id!==e?.id||this.client.authStore.model?.collectionId!==this.collectionIdOrName&&this.client.authStore.model?.collectionName!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,e),e)))}async delete(e,t){return super.delete(e,t).then((t=>(!t||this.client.authStore.model?.id!==e||this.client.authStore.model?.collectionId!==this.collectionIdOrName&&this.client.authStore.model?.collectionName!==this.collectionIdOrName||this.client.authStore.clear(),t)))}authResponse(e){const t=this.decode(e?.record||{});return this.client.authStore.save(e?.token,t),Object.assign({},e,{token:e?.token||\"\",record:t})}async listAuthMethods(e){return e=Object.assign({method:\"GET\"},e),this.client.send(this.baseCollectionPath+\"/auth-methods\",e).then((e=>Object.assign({},e,{usernamePassword:!!e?.usernamePassword,emailPassword:!!e?.emailPassword,authProviders:Array.isArray(e?.authProviders)?e?.authProviders:[]})))}async authWithPassword(e,t,s,i){let n={method:\"POST\",body:{identity:e,password:t}};return n=normalizeLegacyOptionsArgs(\"This form of authWithPassword(usernameOrEmail, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).\",n,s,i),this.client.send(this.baseCollectionPath+\"/auth-with-password\",n).then((e=>this.authResponse(e)))}async authWithOAuth2Code(e,t,s,i,n,r,o){let a={method:\"POST\",body:{provider:e,code:t,codeVerifier:s,redirectUrl:i,createData:n}};return a=normalizeLegacyOptionsArgs(\"This form of authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, options?).\",a,r,o),this.client.send(this.baseCollectionPath+\"/auth-with-oauth2\",a).then((e=>this.authResponse(e)))}authWithOAuth2(...e){if(e.length>1||\"string\"==typeof e?.[0])return console.warn(\"PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration.\"),this.authWithOAuth2Code(e?.[0]||\"\",e?.[1]||\"\",e?.[2]||\"\",e?.[3]||\"\",e?.[4]||{},e?.[5]||{},e?.[6]||{});const t=e?.[0]||{};let s=null;t.urlCallback||(s=openBrowserPopup(void 0));const i=new RealtimeService(this.client);function cleanup(){s?.close(),i.unsubscribe()}const n={},r=t.requestKey;return r&&(n.requestKey=r),this.listAuthMethods(n).then((e=>{const n=e.authProviders.find((e=>e.name===t.provider));if(!n)throw new ClientResponseError(new Error(`Missing or invalid provider \"${t.provider}\".`));const o=this.client.buildUrl(\"/api/oauth2-redirect\"),a=r?this.client.cancelControllers?.[r]:void 0;return a&&(a.signal.onabort=()=>{cleanup()}),new Promise((async(e,r)=>{try{await i.subscribe(\"@oauth2\",(async s=>{const c=i.clientId;try{if(!s.state||c!==s.state)throw new Error(\"State parameters don't match.\");if(s.error||!s.code)throw new Error(\"OAuth2 redirect error or missing code: \"+s.error);const i=Object.assign({},t);delete i.provider,delete i.scopes,delete i.createData,delete i.urlCallback,a?.signal?.onabort&&(a.signal.onabort=null);const r=await this.authWithOAuth2Code(n.name,s.code,n.codeVerifier,o,t.createData,i);e(r)}catch(e){r(new ClientResponseError(e))}cleanup()}));const c={state:i.clientId};t.scopes?.length&&(c.scope=t.scopes.join(\" \"));const l=this._replaceQueryParams(n.authUrl+o,c);let h=t.urlCallback||function(e){s?s.location.href=e:s=openBrowserPopup(e)};await h(l)}catch(e){cleanup(),r(new ClientResponseError(e))}}))})).catch((e=>{throw cleanup(),e}))}async authRefresh(e,t){let s={method:\"POST\"};return s=normalizeLegacyOptionsArgs(\"This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).\",s,e,t),this.client.send(this.baseCollectionPath+\"/auth-refresh\",s).then((e=>this.authResponse(e)))}async requestPasswordReset(e,t,s){let i={method:\"POST\",body:{email:e}};return i=normalizeLegacyOptionsArgs(\"This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).\",i,t,s),this.client.send(this.baseCollectionPath+\"/request-password-reset\",i).then((()=>!0))}async confirmPasswordReset(e,t,s,i,n){let r={method:\"POST\",body:{token:e,password:t,passwordConfirm:s}};return r=normalizeLegacyOptionsArgs(\"This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).\",r,i,n),this.client.send(this.baseCollectionPath+\"/confirm-password-reset\",r).then((()=>!0))}async requestVerification(e,t,s){let i={method:\"POST\",body:{email:e}};return i=normalizeLegacyOptionsArgs(\"This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).\",i,t,s),this.client.send(this.baseCollectionPath+\"/request-verification\",i).then((()=>!0))}async confirmVerification(e,t,s){let i={method:\"POST\",body:{token:e}};return i=normalizeLegacyOptionsArgs(\"This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).\",i,t,s),this.client.send(this.baseCollectionPath+\"/confirm-verification\",i).then((()=>{const t=getTokenPayload(e),s=this.client.authStore.model;return s&&!s.verified&&s.id===t.id&&s.collectionId===t.collectionId&&(s.verified=!0,this.client.authStore.save(this.client.authStore.token,s)),!0}))}async requestEmailChange(e,t,s){let i={method:\"POST\",body:{newEmail:e}};return i=normalizeLegacyOptionsArgs(\"This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).\",i,t,s),this.client.send(this.baseCollectionPath+\"/request-email-change\",i).then((()=>!0))}async confirmEmailChange(e,t,s,i){let n={method:\"POST\",body:{token:e,password:t}};return n=normalizeLegacyOptionsArgs(\"This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).\",n,s,i),this.client.send(this.baseCollectionPath+\"/confirm-email-change\",n).then((()=>{const t=getTokenPayload(e),s=this.client.authStore.model;return s&&s.id===t.id&&s.collectionId===t.collectionId&&this.client.authStore.clear(),!0}))}async listExternalAuths(e,t){return t=Object.assign({method:\"GET\"},t),this.client.send(this.baseCrudPath+\"/\"+encodeURIComponent(e)+\"/external-auths\",t)}async unlinkExternalAuth(e,t,s){return s=Object.assign({method:\"DELETE\"},s),this.client.send(this.baseCrudPath+\"/\"+encodeURIComponent(e)+\"/external-auths/\"+encodeURIComponent(t),s).then((()=>!0))}_replaceQueryParams(e,t={}){let s=e,i=\"\";e.indexOf(\"?\")>=0&&(s=e.substring(0,e.indexOf(\"?\")),i=e.substring(e.indexOf(\"?\")+1));const n={},r=i.split(\"&\");for(const e of r){if(\"\"==e)continue;const t=e.split(\"=\");n[decodeURIComponent(t[0].replace(/\\+/g,\" \"))]=decodeURIComponent((t[1]||\"\").replace(/\\+/g,\" \"))}for(let e in t)t.hasOwnProperty(e)&&(null==t[e]?delete n[e]:n[e]=t[e]);i=\"\";for(let e in n)n.hasOwnProperty(e)&&(\"\"!=i&&(i+=\"&\"),i+=encodeURIComponent(e.replace(/%20/g,\"+\"))+\"=\"+encodeURIComponent(n[e].replace(/%20/g,\"+\")));return\"\"!=i?s+\"?\"+i:s}}function openBrowserPopup(e){if(\"undefined\"==typeof window||!window?.open)throw new ClientResponseError(new Error(\"Not in a browser context - please pass a custom urlCallback function.\"));let t=1024,s=768,i=window.innerWidth,n=window.innerHeight;t=t>i?i:t,s=s>n?n:s;let r=i/2-t/2,o=n/2-s/2;return window.open(e,\"popup_window\",\"width=\"+t+\",height=\"+s+\",top=\"+o+\",left=\"+r+\",resizable,menubar=no\")}class CollectionService extends CrudService{get baseCrudPath(){return\"/api/collections\"}async import(e,t=!1,s){return s=Object.assign({method:\"PUT\",body:{collections:e,deleteMissing:t}},s),this.client.send(this.baseCrudPath+\"/import\",s).then((()=>!0))}}class LogService extends BaseService{async getList(e=1,t=30,s){return(s=Object.assign({method:\"GET\"},s)).query=Object.assign({page:e,perPage:t},s.query),this.client.send(\"/api/logs\",s)}async getOne(e,t){if(!e)throw new ClientResponseError({url:this.client.buildUrl(\"/api/logs/\"),status:404,response:{code:404,message:\"Missing required log id.\",data:{}}});return t=Object.assign({method:\"GET\"},t),this.client.send(\"/api/logs/\"+encodeURIComponent(e),t)}async getStats(e){return e=Object.assign({method:\"GET\"},e),this.client.send(\"/api/logs/stats\",e)}}class HealthService extends BaseService{async check(e){return e=Object.assign({method:\"GET\"},e),this.client.send(\"/api/health\",e)}}class FileService extends BaseService{getUrl(e,t,s={}){if(!t||!e?.id||!e?.collectionId&&!e?.collectionName)return\"\";const i=[];i.push(\"api\"),i.push(\"files\"),i.push(encodeURIComponent(e.collectionId||e.collectionName)),i.push(encodeURIComponent(e.id)),i.push(encodeURIComponent(t));let n=this.client.buildUrl(i.join(\"/\"));if(Object.keys(s).length){!1===s.download&&delete s.download;const e=new URLSearchParams(s);n+=(n.includes(\"?\")?\"&\":\"?\")+e}return n}async getToken(e){return e=Object.assign({method:\"POST\"},e),this.client.send(\"/api/files/token\",e).then((e=>e?.token||\"\"))}}class BackupService extends BaseService{async getFullList(e){return e=Object.assign({method:\"GET\"},e),this.client.send(\"/api/backups\",e)}async create(e,t){return t=Object.assign({method:\"POST\",body:{name:e}},t),this.client.send(\"/api/backups\",t).then((()=>!0))}async upload(e,t){return t=Object.assign({method:\"POST\",body:e},t),this.client.send(\"/api/backups/upload\",t).then((()=>!0))}async delete(e,t){return t=Object.assign({method:\"DELETE\"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}`,t).then((()=>!0))}async restore(e,t){return t=Object.assign({method:\"POST\"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}/restore`,t).then((()=>!0))}getDownloadUrl(e,t){return this.client.buildUrl(`/api/backups/${encodeURIComponent(t)}?token=${encodeURIComponent(e)}`)}}class Client{constructor(e=\"/\",t,s=\"en-US\"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=e,this.lang=s,this.authStore=t||new LocalAuthStore,this.admins=new AdminService(this),this.collections=new CollectionService(this),this.files=new FileService(this),this.logs=new LogService(this),this.settings=new SettingsService(this),this.realtime=new RealtimeService(this),this.health=new HealthService(this),this.backups=new BackupService(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new RecordService(this,e)),this.recordServices[e]}autoCancellation(e){return this.enableAutoCancellation=!!e,this}cancelRequest(e){return this.cancelControllers[e]&&(this.cancelControllers[e].abort(),delete this.cancelControllers[e]),this}cancelAllRequests(){for(let e in this.cancelControllers)this.cancelControllers[e].abort();return this.cancelControllers={},this}filter(e,t){if(!t)return e;for(let s in t){let i=t[s];switch(typeof i){case\"boolean\":case\"number\":i=\"\"+i;break;case\"string\":i=\"'\"+i.replace(/'/g,\"\\\\'\")+\"'\";break;default:i=null===i?\"null\":i instanceof Date?\"'\"+i.toISOString().replace(\"T\",\" \")+\"'\":\"'\"+JSON.stringify(i).replace(/'/g,\"\\\\'\")+\"'\"}e=e.replaceAll(\"{:\"+s+\"}\",i)}return e}getFileUrl(e,t,s={}){return this.files.getUrl(e,t,s)}buildUrl(e){let t=this.baseUrl;return\"undefined\"==typeof window||!window.location||t.startsWith(\"https://\")||t.startsWith(\"http://\")||(t=window.location.origin?.endsWith(\"/\")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||\"\",this.baseUrl.startsWith(\"/\")||(t+=window.location.pathname||\"/\",t+=t.endsWith(\"/\")?\"\":\"/\"),t+=this.baseUrl),e&&(t+=t.endsWith(\"/\")?\"\":\"/\",t+=e.startsWith(\"/\")?e.substring(1):e),t}async send(e,t){t=this.initSendOptions(e,t);let s=this.buildUrl(e);if(this.beforeSend){const e=Object.assign({},await this.beforeSend(s,t));void 0!==e.url||void 0!==e.options?(s=e.url||s,t=e.options||t):Object.keys(e).length&&(t=e,console?.warn&&console.warn(\"Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`.\"))}if(void 0!==t.query){const e=this.serializeQueryParams(t.query);e&&(s+=(s.includes(\"?\")?\"&\":\"?\")+e),delete t.query}\"application/json\"==this.getHeader(t.headers,\"Content-Type\")&&t.body&&\"string\"!=typeof t.body&&(t.body=JSON.stringify(t.body));return(t.fetch||fetch)(s,t).then((async e=>{let t={};try{t=await e.json()}catch(e){}if(this.afterSend&&(t=await this.afterSend(e,t)),e.status>=400)throw new ClientResponseError({url:e.url,status:e.status,data:t});return t})).catch((e=>{throw new ClientResponseError(e)}))}initSendOptions(e,t){if((t=Object.assign({method:\"GET\"},t)).body=this.convertToFormDataIfNeeded(t.body),normalizeUnknownQueryParams(t),t.query=Object.assign({},t.params,t.query),void 0===t.requestKey&&(!1===t.$autoCancel||!1===t.query.$autoCancel?t.requestKey=null:(t.$cancelKey||t.query.$cancelKey)&&(t.requestKey=t.$cancelKey||t.query.$cancelKey)),delete t.$autoCancel,delete t.query.$autoCancel,delete t.$cancelKey,delete t.query.$cancelKey,null!==this.getHeader(t.headers,\"Content-Type\")||this.isFormData(t.body)||(t.headers=Object.assign({},t.headers,{\"Content-Type\":\"application/json\"})),null===this.getHeader(t.headers,\"Accept-Language\")&&(t.headers=Object.assign({},t.headers,{\"Accept-Language\":this.lang})),this.authStore.token&&null===this.getHeader(t.headers,\"Authorization\")&&(t.headers=Object.assign({},t.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&null!==t.requestKey){const s=t.requestKey||(t.method||\"GET\")+e;delete t.requestKey,this.cancelRequest(s);const i=new AbortController;this.cancelControllers[s]=i,t.signal=i.signal}return t}convertToFormDataIfNeeded(e){if(\"undefined\"==typeof FormData||void 0===e||\"object\"!=typeof e||null===e||this.isFormData(e)||!this.hasBlobField(e))return e;const t=new FormData;for(const s in e){const i=e[s];if(\"object\"!=typeof i||this.hasBlobField({data:i})){const e=Array.isArray(i)?i:[i];for(let i of e)t.append(s,i)}else{let e={};e[s]=i,t.append(\"@jsonPayload\",JSON.stringify(e))}}return t}hasBlobField(e){for(const t in e){const s=Array.isArray(e[t])?e[t]:[e[t]];for(const e of s)if(\"undefined\"!=typeof Blob&&e instanceof Blob||\"undefined\"!=typeof File&&e instanceof File)return!0}return!1}getHeader(e,t){e=e||{},t=t.toLowerCase();for(let s in e)if(s.toLowerCase()==t)return e[s];return null}isFormData(e){return e&&(\"FormData\"===e.constructor.name||\"undefined\"!=typeof FormData&&e instanceof FormData)}serializeQueryParams(e){const t=[];for(const s in e){if(null===e[s])continue;const i=e[s],n=encodeURIComponent(s);if(Array.isArray(i))for(const e of i)t.push(n+\"=\"+encodeURIComponent(e));else i instanceof Date?t.push(n+\"=\"+encodeURIComponent(i.toISOString())):null!==typeof i&&\"object\"==typeof i?t.push(n+\"=\"+encodeURIComponent(JSON.stringify(i))):t.push(n+\"=\"+encodeURIComponent(i))}return t.join(\"&\")}}class AsyncAuthStore extends BaseAuthStore{constructor(e){super(),this.queue=[],this.saveFunc=e.save,this.clearFunc=e.clear,this._enqueue((()=>this._loadInitial(e.initial)))}save(e,t){super.save(e,t);let s=\"\";try{s=JSON.stringify({token:e,model:t})}catch(e){console.warn(\"AsyncAuthStore: failed to stringify the new state\")}this._enqueue((()=>this.saveFunc(s)))}clear(){super.clear(),this.clearFunc?this._enqueue((()=>this.clearFunc())):this._enqueue((()=>this.saveFunc(\"\")))}async _loadInitial(e){try{if(e=await e){let t;\"string\"==typeof e?t=JSON.parse(e)||{}:\"object\"==typeof e&&(t=e),this.save(t.token||\"\",t.model||null)}}catch(e){}}_enqueue(e){this.queue.push(e),1==this.queue.length&&this._dequeue()}_dequeue(){this.queue.length&&this.queue[0]().finally((()=>{this.queue.shift(),this.queue.length&&this._dequeue()}))}}\n//# sourceMappingURL=pocketbase.es.mjs.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64, \n//# sourceURL=webpack-internal:///(app-pages-browser)/./node_modules/pocketbase/dist/pocketbase.es.mjs\n"));

/***/ })

},
/******/ function(__webpack_require__) { // webpackRuntimeModules
/******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
/******/ __webpack_require__.O(0, ["main-app"], function() { return __webpack_exec__("(app-pages-browser)/./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22C%3A%5C%5CUsers%5C%5CRaymondVerhoef%5C%5CGitea%5C%5Clearning-platform%5C%5Capp%5C%5Cfrontend%5C%5Csrc%5C%5Capp%5C%5Cadmin%5C%5Cdocuments%5C%5Cpage.tsx%22%2C%22ids%22%3A%5B%5D%7D&server=false!"); });
/******/ var __webpack_exports__ = __webpack_require__.O();
/******/ _N_E = __webpack_exports__;
/******/ }
]);