/opt/canhelp/apps/web/.next/cache/webpack/server-production
NameSizeModeActions
0.pack925145390644editdlrm
1.pack12673790644editdlrm
2.pack43735990644editdlrm
3.pack7451990644editdlrm
4.pack65204660644editdlrm
5.pack259717610644editdlrm
6.pack7518430644editdlrm
7.pack46388840644editdlrm
8.pack48452960644editdlrm
9.pack97020644editdlrm
10.pack27038500644editdlrm
11.pack1361530644editdlrm
12.pack24060644editdlrm
13.pack4277340644editdlrm
14.pack6358240644editdlrm
15.pack19769150644editdlrm
16.pack85740644editdlrm
17.pack24591570644editdlrm
18.pack119171890644editdlrm
19.pack768050644editdlrm
20.pack31443360644editdlrm
21.pack60115380644editdlrm
22.pack10241010644editdlrm
index.pack77214480644editdlrm
index.pack.old84399530644editdlrm
Edit: /opt/canhelp/apps/web/.next/cache/webpack/server-production/4.pack (6520466B)
wpc~cwebpack/lib/cache/PackFileCacheStrategyPackContentItems `FlagDependencyExportsPlugin|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[4].use[0]!/opt/canhelp/apps/web/src/lib/api.ts|rsc%FlagDependencyExportsPlugin|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[7].use[1]!/opt/canhelp/apps/web/src/lib/api.ts|ssr9Compilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[4].use[0]!/opt/canhelp/apps/web/src/app/tasks/[id]/page.tsx|rsc|webpack-runtime4Compilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[4].use[0]!/opt/canhelp/apps/web/src/app/tasks/page.tsx|rsc|webpack-runtime,Compilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[4].use[0]!/opt/canhelp/apps/web/src/lib/api.ts|rsc|webpack-runtimeHCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[7].use[1]!/opt/canhelp/apps/web/src/app/become-specialist/page.tsx|ssr|webpack-runtimeECompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[7].use[1]!/opt/canhelp/apps/web/src/app/delete-account/page.tsx|ssr|webpack-runtime@Compilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[7].use[1]!/opt/canhelp/apps/web/src/app/favorites/page.tsx|ssr|webpack-runtime>Compilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[7].use[1]!/opt/canhelp/apps/web/src/app/payment/page.tsx|ssr|webpack-runtime?Compilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[7].use[1]!/opt/canhelp/apps/web/src/app/schedule/page.tsx|ssr|webpack-runtimeGCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[7].use[1]!/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx|ssr|webpack-runtimeICompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[7].use[1]!/opt/canhelp/apps/web/src/components/AdminRolePreview.tsx|ssr|webpack-runtime>Compilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[7].use[1]!/opt/canhelp/apps/web/src/app/support/page.tsx|ssr|webpack-runtime@Compilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[7].use[1]!/opt/canhelp/apps/web/src/app/tasks/new/page.tsx|ssr|webpack-runtime>Compilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[7].use[1]!/opt/canhelp/apps/web/src/context/location.tsx|ssr|webpack-runtime4Compilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[7].use[1]!/opt/canhelp/apps/web/src/lib/api.ts|ssr|webpack-runtimeQCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[7].use[1]!/opt/canhelp/apps/web/src/components/FavoriteSpecialistButton.tsx|ssr|webpack-runtimeKCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[4].use[0]!/opt/canhelp/apps/web/src/app/specialists/page.tsx|rsc|0997d6643e94138f|webpack-runtimePCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[7].use[1]!/opt/canhelp/apps/web/src/components/Header.tsx|ssr|cd30fd2908d95ee8|webpack-runtimeCompilation/assets|chunk240Compilation/assets|chunk466Compilation/assets|chunk40Compilation/assets|chunk407Compilation/assets|chunk826Compilation/assets|chunk442Compilation/assets|chunk755Compilation/assets|chunk174Compilation/assets|chunk147Compilation/assets|chunk478Compilation/assets|chunk902MinifierWebpackPlugin|902.jswebpack/lib/ModuleGraphRestoreProvidedData@nameprovidedcanMangleProvideterminalBindingexportsInfoacceptOfferactivateUseraddFavoriteaddPortfolioItemaddSpecialistFavoriteadminBroadcastPushadminSendPushToUseradminTopUpUserBalanceadminUpdateSpecialistCardadminWithdrawUserBalanceapplyMyReferralautoTranslateautoTranslateEmailTemplatesautoTranslateTaskscancelTaskcancelTaskAdminߎchangeUserRole݌completeTaskێcreateCategoryَcreateLocation׋createOfferՊcreatePlanӔcreatePriceListGroupѓcreatePriceListItemόcreateReview͋createSkill˔createSpecialistCardɓcreateSupportTicketNJcreateTaskŎdeactivateUserÌdeclineOfferdeleteCategorydeleteLocationdeletePlandeletePortfolioItemdeletePriceListGroupdeletePriceListItemdeleteSkilldeleteSpecialistCarddeleteTaskAdmindisconnectGoogleCalendardismissNotificationgetAdminActivityLogsgetAdminAiLogsgetAdminBalanceHistorygetAdminCategoriesgetAdminEmailTemplatesgetAdminLocationsgetAdminMailLogsgetAdminMailStatsgetAdminNotifLogsgetAdminNotifStatsgetAdminPlansgetAdminReferralsgetAdminReportsgetAdminSettingsgetAdminSkillsgetAdminSpecialistCardsgetAdminStatsgetAdminSupportTicketsgetAdminTasksgetAdminUsergetAdminUserSpecialistCardsgetAdminUsersgetAutoMatchResults}getAutoResponseSettings{getBalanceHistoryygetCanMessagewgetCategoriesugetChatRoomssgetCustomerFomoDashboardqgetDailyUsageogetFavoritesmgetFomoRecommendationskgetGoogleCalendarConnectUrligetGoogleCalendarStatusggetLocationsegetMessagescgetMyAvailabilityagetMyDashboard_getMyOffers]getMyPortfolio[getMyReferralInfoYgetMyReviewsWgetMySpecialistCardsUgetMyStatusesSgetMySupportTicketsQgetMyTasksOgetNotificationsMgetOffersKgetOrCreateDirectRoomIgetPaymentHistoryGgetPlanHistoryEgetPlansCgetPriceListAgetPublicSiteProfile?getSiteStats=getSkillDedup;getSkillSuggestions9getSpecialistAvailability7getSpecialistCards5getSpecialistFavorites3getSpecialistFomoDashboard1getSpecialistPortfolio/getSpecialists-getTask+getTaskBudgetRange)getTaskCountsByCategory'getTaskInvite%getTaskReviews#getTaskStats!getTasksgetTasksForSpecialistgetTasksTranslationPreviewgetTranslationsMissinggetTranslationsStatsgetUnreadCountgetUserProfilegetUserRatinggetUserReviewsimportFromGoogleCalendar initiateTopUp markAllRead markReadmergeSkillDuplicatespreviewPlanChangepurchasePlanremoveFavoriteremoveSpecialistFavoritereplyToSupportTicketrequestrunAutoMatchsaveSiteSeosaveTranslationssearchTaskssendMessagesendPublicSupportMessagesendTestEmailsetAvailabilitysetAvailabilityRangesetSupportTicketStatustestTelegramConnectiontoggleStatustrackSiteMessagetranslateAdminEmailTemplateupdateAdminEmailTemplateupdateAdminSettingsupdateAdminUserupdateAutoResponseSettingsupdateCategoryupdateLocationupdateNotifSettingsupdatePlanupdatePortfolioItemupdatePriceListGroupupdatePriceListItemupdateReportStatusupdateSkillupdateSpecialistCardupdateTaskverifyAdminUserEmailverifyTelegramToken @~}|{zyxwvutsrqponmlkj i h g f edcba`_^]\[ZYXWVUTS R!Q"P#O$N%M&L'K(J)I*H+G,F-E.D/C0B1A2@3?4>5=6<7;8:99:8;7<6=5>4?3@2A1B0C/D.E-F,G+H*I)J(K'L&M%N$O#P"Q!R STUVWXYZ[ sourcesruntimeRequirementsdatajavascriptwebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ TaskDetailPage), /* harmony export */ generateMetadata: () => (/* binding */ generateMetadata) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5939); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(59902); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(22134); /* harmony import */ var next_headers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(56057); /* harmony import */ var _TaskDetailClient__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(21180); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceimport { jsx as _jsx } from "react/jsx-runtime"; import { getTask, getCategories, getLocations } from '@/lib/api'; import { notFound } from 'next/navigation'; import { cookies } from 'next/headers'; import TaskDetailClient from './TaskDetailClient'; export async function generateMetadata({ params }) { const { id } = await params; try { const { task } = await getTask(id); return { title: `${task.title} — CanHelp`, description: task.description.slice(0, 160) }; } catch { return { title: 'Εργασία — CanHelp' }; } } export default async function TaskDetailPage({ params }) { const { id } = await params; let taskData; try { taskData = await getTask(id); } catch { notFound(); } const cookieStore = await cookies(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const [cats, locs] = await Promise.all([ getCategories().catch(()=>[]), getLocations().catch(()=>[]) ]); const catMap = {}; for (const cat of cats){ catMap[cat.slug] = cat.names[locale] ?? cat.names.el; for (const sub of cat.children ?? []){ catMap[sub.slug] = sub.names[locale] ?? sub.names.el; } } const locMap = {}; for (const city of locs){ locMap[city.slug] = city.names[locale] ?? city.names.el; for (const d of city.children ?? []){ locMap[d.slug] = d.names[locale] ?? d.names.el; } } return /*#__PURE__*/ _jsx(TaskDetailClient, { taskId: id, initialTask: taskData.task, initialCustomer: taskData.customer, catMap: catMap, locMap: locMap }); } e/1qsXybpGM((0,_lib_api__WEBPACK_IMPORTED_MODULE_1__/* .getTask */ .gg)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.notFound)(0,next_headers__WEBPACK_IMPORTED_MODULE_3__/* .cookies */ .UL)(0,_lib_api__WEBPACK_IMPORTED_MODULE_1__/* .getCategories */ .bW)(0,_lib_api__WEBPACK_IMPORTED_MODULE_1__/* .getLocations */ .Vs)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)_TaskDetailClient__WEBPACK_IMPORTED_MODULE_4__["default"]buffersourcesizemapshash __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ TaskDetailPage), /* harmony export */ generateMetadata: () => (/* binding */ generateMetadata) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5939); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(59902); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(22134); /* harmony import */ var next_headers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(56057); /* harmony import */ var _TaskDetailClient__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(21180); async function generateMetadata({ params }) { const { id } = await params; try { const { task } = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_1__/* .getTask */ .gg)(id); return { title: `${task.title} — CanHelp`, description: task.description.slice(0, 160) }; } catch { return { title: 'Εργασία — CanHelp' }; } } async function TaskDetailPage({ params }) { const { id } = await params; let taskData; try { taskData = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_1__/* .getTask */ .gg)(id); } catch { (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.notFound)(); } const cookieStore = await (0,next_headers__WEBPACK_IMPORTED_MODULE_3__/* .cookies */ .UL)(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const [cats, locs] = await Promise.all([ (0,_lib_api__WEBPACK_IMPORTED_MODULE_1__/* .getCategories */ .bW)().catch(()=>[]), (0,_lib_api__WEBPACK_IMPORTED_MODULE_1__/* .getLocations */ .Vs)().catch(()=>[]) ]); const catMap = {}; for (const cat of cats){ catMap[cat.slug] = cat.names[locale] ?? cat.names.el; for (const sub of cat.children ?? []){ catMap[sub.slug] = sub.names[locale] ?? sub.names.el; } } const locMap = {}; for (const city of locs){ locMap[city.slug] = city.names[locale] ?? city.names.el; for (const d of city.children ?? []){ locMap[d.slug] = d.names[locale] ?? d.names.el; } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_TaskDetailClient__WEBPACK_IMPORTED_MODULE_4__["default"], { taskId: id, initialTask: taskData.task, initialCustomer: taskData.customer, catMap: catMap, locMap: locMap }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ TaskDetailPage), /* harmony export */ generateMetadata: () => (/* binding */ generateMetadata) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5939); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(59902); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(22134); /* harmony import */ var next_headers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(56057); /* harmony import */ var _TaskDetailClient__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(21180); ReplaceSourceRawSourceimport { jsx as _jsx } from "react/jsx-runtime"; import { getTask, getCategories, getLocations } from '@/lib/api'; import { notFound } from 'next/navigation'; import { cookies } from 'next/headers'; import TaskDetailClient from './TaskDetailClient'; export async function generateMetadata({ params }) { const { id } = await params; try { const { task } = await getTask(id); return { title: `${task.title} — CanHelp`, description: task.description.slice(0, 160) }; } catch { return { title: 'Εργασία — CanHelp' }; } } export default async function TaskDetailPage({ params }) { const { id } = await params; let taskData; try { taskData = await getTask(id); } catch { notFound(); } const cookieStore = await cookies(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const [cats, locs] = await Promise.all([ getCategories().catch(()=>[]), getLocations().catch(()=>[]) ]); const catMap = {}; for (const cat of cats){ catMap[cat.slug] = cat.names[locale] ?? cat.names.el; for (const sub of cat.children ?? []){ catMap[sub.slug] = sub.names[locale] ?? sub.names.el; } } const locMap = {}; for (const city of locs){ locMap[city.slug] = city.names[locale] ?? city.names.el; for (const d of city.children ?? []){ locMap[d.slug] = d.names[locale] ?? d.names.el; } } return /*#__PURE__*/ _jsx(TaskDetailClient, { taskId: id, initialTask: taskData.task, initialCustomer: taskData.customer, catMap: catMap, locMap: locMap }); } 047undefined49113undefined115157undefined159197undefined199248undefined250256undefined377383(0,_lib_api__WEBPACK_IMPORTED_MODULE_1__/* .getTask */ .gg)undefined610624undefined755761(0,_lib_api__WEBPACK_IMPORTED_MODULE_1__/* .getTask */ .gg)undefined791798(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.notFound)undefined839845(0,next_headers__WEBPACK_IMPORTED_MODULE_3__/* .cookies */ .UL)undefined972984(0,_lib_api__WEBPACK_IMPORTED_MODULE_1__/* .getCategories */ .bW)undefined10111022(0,_lib_api__WEBPACK_IMPORTED_MODULE_1__/* .getLocations */ .Vs)undefined15561559(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined15611576_TaskDetailClient__WEBPACK_IMPORTED_MODULE_4__["default"]undefined__webpack_require____webpack_require__.n__webpack_require__.r__webpack_exports____webpack_require__.d  Iwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ TasksPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5939); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3498); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_headers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56057); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(59902); /* harmony import */ var _lib_translations__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(75112); /* harmony import */ var _TaskListClient__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(70535); /* harmony import */ var _TaskFiltersClient__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(34052); /* harmony import */ var _TasksAuthGuard__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(52386); /* harmony import */ var _TaskMapDynamic__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(97107); /* harmony import */ var _TaskViewToggle__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(77241); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource<import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import Link from 'next/link'; import { cookies } from 'next/headers'; import { getCategories, getLocations, getTaskBudgetRange } from '@/lib/api'; import { getTranslations } from '@/lib/translations'; import { TaskListClient } from './TaskListClient'; import { TaskFiltersClient } from './TaskFiltersClient'; import { TasksAuthGuard } from './TasksAuthGuard'; import { TaskMapDynamic } from './TaskMapDynamic'; import { TaskViewToggle } from './TaskViewToggle'; // SSR uses INTERNAL_API_URL (or localhost:4000 directly) to avoid external DNS/CORS round-trip const API_BASE = "undefined" === 'undefined' ? process.env.INTERNAL_API_URL || 'http://localhost:4000' : process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export default async function TasksPage({ searchParams }) { const params = await searchParams; const page = Number(params.page || 1); const cookieStore = await cookies(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const cookieLocation = decodeURIComponent(cookieStore.get('canhelp_location')?.value ?? ''); const t = getTranslations(locale); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const cookieHeader = cookieStore.getAll().map((c)=>`${c.name}=${c.value}`).join('; '); // Detect if user is a logged-in specialist (has session cookie) let isSpecialistSession = false; if (cookieHeader) { try { const INTERNAL = process.env.INTERNAL_API_URL || 'http://localhost:4000'; const sessRes = await fetch(`${INTERNAL}/api/auth/get-session`, { headers: { Cookie: cookieHeader } }); if (sessRes.ok) { const sess = await sessRes.json(); const role = sess?.user?.role; isSpecialistSession = role === 'specialist' || role === 'admin'; } } catch {} } // Guests and customers default to 'all'; specialists default to 'for_me' const mode = params.mode === 'all' ? 'all' : params.mode === 'for_me' ? 'for_me' : isSpecialistSession ? 'for_me' : 'all'; let tasks = []; let total = 0; let noCards = false; let categories = []; let locationTree = []; let budgetRange = { min: 0, max: 0 }; // In 'all' mode only respect explicit URL param; cookie location only applies to 'for_me' // (for_me filtering is handled server-side by specialist cards, so cookie is unused there too) const effectiveLocation = params.location ?? (mode === 'for_me' ? cookieLocation : ''); const { q, category } = params; const rangeParams = {}; if (q) rangeParams.q = q; if (category) rangeParams.category = category; if (effectiveLocation) rangeParams.location = effectiveLocation; const effectiveParams = { page: String(page), limit: '10', ...params, ...effectiveLocation ? { location: effectiveLocation } : {} }; delete effectiveParams.mode; try { ; [categories, locationTree, budgetRange] = await Promise.all([ getCategories(), getLocations(), getTaskBudgetRange(Object.keys(rangeParams).length ? rangeParams : undefined) ]); } catch {} try { if (mode === 'for_me') { const forMeParams = new URLSearchParams(effectiveParams); const res = await fetch(`${API_BASE}/api/tasks/for-me?${forMeParams}`, { headers: { Cookie: cookieHeader }, cache: 'no-store' }); if (res.ok) { const json = await res.json(); if (json.noCards) { noCards = true; } else { tasks = json.data ?? []; total = json.total ?? 0; } } } else { const allParams = new URLSearchParams(effectiveParams); const res = await fetch(`${API_BASE}/api/tasks?${allParams}`, { headers: { Cookie: cookieHeader }, cache: 'no-store' }); if (res.ok) { const json = await res.json(); tasks = json.data ?? []; total = json.total ?? 0; } } } catch {} const catMap = {}; for (const cat of categories){ catMap[cat.slug] = cat.names[catLocale] ?? cat.names.el; for (const sub of cat.children ?? []){ catMap[sub.slug] = sub.names[catLocale] ?? sub.names.el; } } const locMap = {}; for (const city of locationTree){ locMap[city.slug] = city.names[catLocale] ?? city.names.el; for (const d of city.children ?? []){ locMap[d.slug] = d.names[catLocale] ?? d.names.el; } } const view = params.view === 'map' ? 'map' : 'list'; const hasFilter = !!(params.q || params.category || params.location || params.budgetMin || params.budgetMax); const filterParams = {}; if (params.q) filterParams.q = params.q; if (params.category) filterParams.category = params.category; if (params.location) filterParams.location = params.location; if (params.budgetMin) filterParams.budgetMin = params.budgetMin; if (params.budgetMax) filterParams.budgetMax = params.budgetMax; return /*#__PURE__*/ _jsxs("div", { className: "max-w-7xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsx(TasksAuthGuard, {}), view === 'map' ? /* ── Full-screen map layout ────────────────────────────── */ /*#__PURE__*/ _jsxs("div", { className: "relative -mx-4 -mt-8", style: { height: 'calc(100vh - 64px)' }, children: [ /*#__PURE__*/ _jsx("div", { className: "absolute left-4 top-4 z-[2000] w-72 bg-white rounded-xl shadow-lg border border-gray-200 overflow-hidden", children: /*#__PURE__*/ _jsxs("details", { open: true, className: "group", children: [ /*#__PURE__*/ _jsxs("summary", { className: "flex items-center justify-between px-4 py-3 cursor-pointer select-none font-semibold text-gray-800 text-sm hover:bg-gray-50", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M3 4a1 1 0 011-1h16a1 1 0 011 1v2a1 1 0 01-.293.707L13 13.414V19a1 1 0 01-.553.894l-4 2A1 1 0 017 21v-7.586L3.293 6.707A1 1 0 013 6V4z" }) }), t('tasks.filters') ] }), /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 group-open:rotate-180 transition-transform", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "px-4 pb-4 pt-1 max-h-[calc(100vh-160px)] overflow-y-auto", children: /*#__PURE__*/ _jsx(TaskFiltersClient, { categories: categories, locationTree: locationTree, budgetRange: budgetRange, initialMode: mode, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialBudgetMin: params.budgetMin, initialBudgetMax: params.budgetMax }) }) ] }) }), /*#__PURE__*/ _jsx("div", { className: "absolute top-4 right-4 z-[2000]", children: /*#__PURE__*/ _jsx(TaskViewToggle, { view: view }) }), /*#__PURE__*/ _jsx(TaskMapDynamic, { filterParams: filterParams, catMap: catMap, locMap: locMap, mode: mode, fullscreen: true }) ] }) : /* ── List layout ───────────────────────────────────────── */ /*#__PURE__*/ _jsxs("div", { className: "flex flex-col md:flex-row gap-8", children: [ /*#__PURE__*/ _jsx("aside", { className: "md:w-64 shrink-0", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 mb-4", children: t('tasks.filters') }), /*#__PURE__*/ _jsx(TaskFiltersClient, { categories: categories, locationTree: locationTree, budgetRange: budgetRange, initialMode: mode, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialBudgetMin: params.budgetMin, initialBudgetMax: params.budgetMax }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ /*#__PURE__*/ _jsxs("div", { className: "mb-4 flex items-center justify-between", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-xl font-bold text-white", children: hasFilter ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ total, " ", t('tasks.title') ] }) : t('nav.tasks') }), /*#__PURE__*/ _jsx(TaskViewToggle, { view: view }) ] }), noCards ? /*#__PURE__*/ _jsxs("div", { className: "bg-white/15 border border-white/30 rounded-xl p-8 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "text-4xl mb-3", children: "\uD83D\uDDC2️" }), /*#__PURE__*/ _jsx("p", { className: "text-white font-medium mb-2", children: t('find_tasks.no_cards') }), /*#__PURE__*/ _jsx(Link, { href: "/profile", className: "inline-block mt-2 px-5 py-2 bg-white text-green-600 rounded-lg text-sm font-medium hover:bg-green-50 transition", children: t('find_tasks.add_card') }) ] }) : /*#__PURE__*/ _jsx(TaskListClient, { initialTasks: tasks, initialTotal: total, filterParams: filterParams, locale: locale, catMap: catMap, locMap: locMap, mode: mode }, [ mode, params.q, params.category, params.location, params.budgetMin, params.budgetMax, page ].join('|')) ] }) ] }) ] }); } e:UWsu_ QS#'*8 _JMO\x|9=`d8;J!M!@#C#### $4'7''_'''K(N(P(]())E*H***++{,~,,,o/s///00g1k1m1u1#3&3(3N53 44445566668888 true0(0,next_headers__WEBPACK_IMPORTED_MODULE_2__/* .cookies */ .UL)(0,_lib_translations__WEBPACK_IMPORTED_MODULE_4__/* .getTranslations */ .$)(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .getCategories */ .bW)(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .getLocations */ .Vs)(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .getTaskBudgetRange */ .CC)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)_TasksAuthGuard__WEBPACK_IMPORTED_MODULE_7__.TasksAuthGuard_TaskFiltersClient__WEBPACK_IMPORTED_MODULE_6__.TaskFiltersClient_TaskViewToggle__WEBPACK_IMPORTED_MODULE_9__.TaskViewToggle_TaskMapDynamic__WEBPACK_IMPORTED_MODULE_8__.TaskMapDynamicreact_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment(next_link__WEBPACK_IMPORTED_MODULE_1___default())_TaskListClient__WEBPACK_IMPORTED_MODULE_5__.TaskListClient__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ TasksPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5939); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3498); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_headers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56057); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(59902); /* harmony import */ var _lib_translations__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(75112); /* harmony import */ var _TaskListClient__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(70535); /* harmony import */ var _TaskFiltersClient__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(34052); /* harmony import */ var _TasksAuthGuard__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(52386); /* harmony import */ var _TaskMapDynamic__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(97107); /* harmony import */ var _TaskViewToggle__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(77241); <import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import Link from 'next/link'; import { cookies } from 'next/headers'; import { getCategories, getLocations, getTaskBudgetRange } from '@/lib/api'; import { getTranslations } from '@/lib/translations'; import { TaskListClient } from './TaskListClient'; import { TaskFiltersClient } from './TaskFiltersClient'; import { TasksAuthGuard } from './TasksAuthGuard'; import { TaskMapDynamic } from './TaskMapDynamic'; import { TaskViewToggle } from './TaskViewToggle'; // SSR uses INTERNAL_API_URL (or localhost:4000 directly) to avoid external DNS/CORS round-trip const API_BASE = "undefined" === 'undefined' ? process.env.INTERNAL_API_URL || 'http://localhost:4000' : process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export default async function TasksPage({ searchParams }) { const params = await searchParams; const page = Number(params.page || 1); const cookieStore = await cookies(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const cookieLocation = decodeURIComponent(cookieStore.get('canhelp_location')?.value ?? ''); const t = getTranslations(locale); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const cookieHeader = cookieStore.getAll().map((c)=>`${c.name}=${c.value}`).join('; '); // Detect if user is a logged-in specialist (has session cookie) let isSpecialistSession = false; if (cookieHeader) { try { const INTERNAL = process.env.INTERNAL_API_URL || 'http://localhost:4000'; const sessRes = await fetch(`${INTERNAL}/api/auth/get-session`, { headers: { Cookie: cookieHeader } }); if (sessRes.ok) { const sess = await sessRes.json(); const role = sess?.user?.role; isSpecialistSession = role === 'specialist' || role === 'admin'; } } catch {} } // Guests and customers default to 'all'; specialists default to 'for_me' const mode = params.mode === 'all' ? 'all' : params.mode === 'for_me' ? 'for_me' : isSpecialistSession ? 'for_me' : 'all'; let tasks = []; let total = 0; let noCards = false; let categories = []; let locationTree = []; let budgetRange = { min: 0, max: 0 }; // In 'all' mode only respect explicit URL param; cookie location only applies to 'for_me' // (for_me filtering is handled server-side by specialist cards, so cookie is unused there too) const effectiveLocation = params.location ?? (mode === 'for_me' ? cookieLocation : ''); const { q, category } = params; const rangeParams = {}; if (q) rangeParams.q = q; if (category) rangeParams.category = category; if (effectiveLocation) rangeParams.location = effectiveLocation; const effectiveParams = { page: String(page), limit: '10', ...params, ...effectiveLocation ? { location: effectiveLocation } : {} }; delete effectiveParams.mode; try { ; [categories, locationTree, budgetRange] = await Promise.all([ getCategories(), getLocations(), getTaskBudgetRange(Object.keys(rangeParams).length ? rangeParams : undefined) ]); } catch {} try { if (mode === 'for_me') { const forMeParams = new URLSearchParams(effectiveParams); const res = await fetch(`${API_BASE}/api/tasks/for-me?${forMeParams}`, { headers: { Cookie: cookieHeader }, cache: 'no-store' }); if (res.ok) { const json = await res.json(); if (json.noCards) { noCards = true; } else { tasks = json.data ?? []; total = json.total ?? 0; } } } else { const allParams = new URLSearchParams(effectiveParams); const res = await fetch(`${API_BASE}/api/tasks?${allParams}`, { headers: { Cookie: cookieHeader }, cache: 'no-store' }); if (res.ok) { const json = await res.json(); tasks = json.data ?? []; total = json.total ?? 0; } } } catch {} const catMap = {}; for (const cat of categories){ catMap[cat.slug] = cat.names[catLocale] ?? cat.names.el; for (const sub of cat.children ?? []){ catMap[sub.slug] = sub.names[catLocale] ?? sub.names.el; } } const locMap = {}; for (const city of locationTree){ locMap[city.slug] = city.names[catLocale] ?? city.names.el; for (const d of city.children ?? []){ locMap[d.slug] = d.names[catLocale] ?? d.names.el; } } const view = params.view === 'map' ? 'map' : 'list'; const hasFilter = !!(params.q || params.category || params.location || params.budgetMin || params.budgetMax); const filterParams = {}; if (params.q) filterParams.q = params.q; if (params.category) filterParams.category = params.category; if (params.location) filterParams.location = params.location; if (params.budgetMin) filterParams.budgetMin = params.budgetMin; if (params.budgetMax) filterParams.budgetMax = params.budgetMax; return /*#__PURE__*/ _jsxs("div", { className: "max-w-7xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsx(TasksAuthGuard, {}), view === 'map' ? /* ── Full-screen map layout ────────────────────────────── */ /*#__PURE__*/ _jsxs("div", { className: "relative -mx-4 -mt-8", style: { height: 'calc(100vh - 64px)' }, children: [ /*#__PURE__*/ _jsx("div", { className: "absolute left-4 top-4 z-[2000] w-72 bg-white rounded-xl shadow-lg border border-gray-200 overflow-hidden", children: /*#__PURE__*/ _jsxs("details", { open: true, className: "group", children: [ /*#__PURE__*/ _jsxs("summary", { className: "flex items-center justify-between px-4 py-3 cursor-pointer select-none font-semibold text-gray-800 text-sm hover:bg-gray-50", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M3 4a1 1 0 011-1h16a1 1 0 011 1v2a1 1 0 01-.293.707L13 13.414V19a1 1 0 01-.553.894l-4 2A1 1 0 017 21v-7.586L3.293 6.707A1 1 0 013 6V4z" }) }), t('tasks.filters') ] }), /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 group-open:rotate-180 transition-transform", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "px-4 pb-4 pt-1 max-h-[calc(100vh-160px)] overflow-y-auto", children: /*#__PURE__*/ _jsx(TaskFiltersClient, { categories: categories, locationTree: locationTree, budgetRange: budgetRange, initialMode: mode, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialBudgetMin: params.budgetMin, initialBudgetMax: params.budgetMax }) }) ] }) }), /*#__PURE__*/ _jsx("div", { className: "absolute top-4 right-4 z-[2000]", children: /*#__PURE__*/ _jsx(TaskViewToggle, { view: view }) }), /*#__PURE__*/ _jsx(TaskMapDynamic, { filterParams: filterParams, catMap: catMap, locMap: locMap, mode: mode, fullscreen: true }) ] }) : /* ── List layout ───────────────────────────────────────── */ /*#__PURE__*/ _jsxs("div", { className: "flex flex-col md:flex-row gap-8", children: [ /*#__PURE__*/ _jsx("aside", { className: "md:w-64 shrink-0", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 mb-4", children: t('tasks.filters') }), /*#__PURE__*/ _jsx(TaskFiltersClient, { categories: categories, locationTree: locationTree, budgetRange: budgetRange, initialMode: mode, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialBudgetMin: params.budgetMin, initialBudgetMax: params.budgetMax }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ /*#__PURE__*/ _jsxs("div", { className: "mb-4 flex items-center justify-between", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-xl font-bold text-white", children: hasFilter ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ total, " ", t('tasks.title') ] }) : t('nav.tasks') }), /*#__PURE__*/ _jsx(TaskViewToggle, { view: view }) ] }), noCards ? /*#__PURE__*/ _jsxs("div", { className: "bg-white/15 border border-white/30 rounded-xl p-8 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "text-4xl mb-3", children: "\uD83D\uDDC2️" }), /*#__PURE__*/ _jsx("p", { className: "text-white font-medium mb-2", children: t('find_tasks.no_cards') }), /*#__PURE__*/ _jsx(Link, { href: "/profile", className: "inline-block mt-2 px-5 py-2 bg-white text-green-600 rounded-lg text-sm font-medium hover:bg-green-50 transition", children: t('find_tasks.add_card') }) ] }) : /*#__PURE__*/ _jsx(TaskListClient, { initialTasks: tasks, initialTotal: total, filterParams: filterParams, locale: locale, catMap: catMap, locMap: locMap, mode: mode }, [ mode, params.q, params.category, params.location, params.budgetMin, params.budgetMax, page ].join('|')) ] }) ] }) ] }); }  085undefined87115undefined117155undefined157232undefined234286undefined288337undefined339394undefined396445undefined447496undefined498547undefined662688 trueundefined7508070undefined810824undefined982988(0,next_headers__WEBPACK_IMPORTED_MODULE_2__/* .cookies */ .UL)undefined11731187(0,_lib_translations__WEBPACK_IMPORTED_MODULE_4__/* .getTranslations */ .$)undefined32633275(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .getCategories */ .bW)undefined32923303(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .getLocations */ .Vs)undefined33203337(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .getTaskBudgetRange */ .CC)undefined55955599(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined57065709(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined57115724_TasksAuthGuard__WEBPACK_IMPORTED_MODULE_7__.TasksAuthGuardundefined58385842(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined60596062(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined62646268(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined64576461(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined67526756(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined69686971(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined73637366(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined81258128(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined85228525(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined90249027(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined92059208(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined92109226_TaskFiltersClient__WEBPACK_IMPORTED_MODULE_6__.TaskFiltersClientundefined1003610039(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1016810171(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1017310186_TaskViewToggle__WEBPACK_IMPORTED_MODULE_9__.TaskViewToggleundefined1031510318(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1032010333_TaskMapDynamic__WEBPACK_IMPORTED_MODULE_8__.TaskMapDynamicundefined1068210686(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1082110824(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1094010944(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1114411147(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1138711390(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1139211408_TaskFiltersClient__WEBPACK_IMPORTED_MODULE_6__.TaskFiltersClientundefined1214312147(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1228112285(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1247512478(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1264712651(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1265312661react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined1309113094(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1309613109_TaskViewToggle__WEBPACK_IMPORTED_MODULE_9__.TaskViewToggleundefined1332213326(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1353913542(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1377713780(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1403614039(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1404114044(next_link__WEBPACK_IMPORTED_MODULE_1___default())undefined1446814471(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1447314486_TaskListClient__WEBPACK_IMPORTED_MODULE_5__.TaskListClientundefined ~webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CC: () => (/* binding */ getTaskBudgetRange), /* harmony export */ F7: () => (/* binding */ getSpecialists), /* harmony export */ Vs: () => (/* binding */ getLocations), /* harmony export */ bW: () => (/* binding */ getCategories), /* harmony export */ gg: () => (/* binding */ getTask) /* harmony export */ }); /* unused harmony exports request, getTasks, searchTasks, getMyTasks, getTasksForSpecialist, getTaskCountsByCategory, createTask, updateTask, completeTask, cancelTask, getOffers, getMyOffers, createOffer, acceptOffer, declineOffer, getUserProfile, createReview, getTaskReviews, getMyReviews, getChatRooms, getOrCreateDirectRoom, getCanMessage, getMessages, sendMessage, updateNotifSettings, getNotifications, getUnreadCount, markRead, markAllRead, getTaskInvite, dismissNotification, getMyReferralInfo, applyMyReferral, getUserReviews, getUserRating, getFavorites, addFavorite, removeFavorite, getSpecialistFavorites, addSpecialistFavorite, removeSpecialistFavorite, getAdminCategories, createCategory, updateCategory, deleteCategory, getAdminSkills, createSkill, updateSkill, deleteSkill, getSkillDedup, mergeSkillDuplicates, getAdminStats, getAdminUsers, deactivateUser, activateUser, changeUserRole, getAdminUser, getAdminUserSpecialistCards, adminUpdateSpecialistCard, getAdminSpecialistCards, updateAdminUser, verifyAdminUserEmail, getAdminTasks, cancelTaskAdmin, deleteTaskAdmin, getAdminReports, updateReportStatus, getAdminAiLogs, getAdminActivityLogs, getAdminMailLogs, getAdminNotifLogs, getAdminNotifStats, getAdminMailStats, getAdminReferrals, adminSendPushToUser, adminBroadcastPush, getAdminLocations, createLocation, updateLocation, deleteLocation, getAdminPlans, createPlan, updatePlan, deletePlan, getAdminSettings, updateAdminSettings, getAdminEmailTemplates, updateAdminEmailTemplate, translateAdminEmailTemplate, sendTestEmail, testTelegramConnection, verifyTelegramToken, getTranslationsStats, getTranslationsMissing, saveTranslations, autoTranslate, autoTranslateTasks, getTasksTranslationPreview, autoTranslateEmailTemplates, getMyAvailability, setAvailability, setAvailabilityRange, getSpecialistAvailability, getMyPortfolio, addPortfolioItem, updatePortfolioItem, deletePortfolioItem, getSpecialistPortfolio, getMySpecialistCards, createSpecialistCard, updateSpecialistCard, saveSiteSeo, deleteSpecialistCard, getSpecialistCards, getPriceList, createPriceListGroup, updatePriceListGroup, deletePriceListGroup, createPriceListItem, updatePriceListItem, deletePriceListItem, getSkillSuggestions, initiateTopUp, getPaymentHistory, getBalanceHistory, getPlanHistory, getAdminBalanceHistory, adminTopUpUserBalance, adminWithdrawUserBalance, previewPlanChange, getPlans, getMyDashboard, getDailyUsage, purchasePlan, getMyStatuses, toggleStatus, getAutoResponseSettings, updateAutoResponseSettings, getSpecialistFomoDashboard, getCustomerFomoDashboard, getFomoRecommendations, getAutoMatchResults, runAutoMatch, getGoogleCalendarStatus, disconnectGoogleCalendar, importFromGoogleCalendar, getGoogleCalendarConnectUrl, getPublicSiteProfile, getSiteStats, trackSiteMessage, getTaskStats, sendPublicSupportMessage, createSupportTicket, getMySupportTickets, getAdminSupportTickets, replyToSupportTicket, setSupportTicketStatus */ webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource[j// SSR: use INTERNAL_API_URL (http://localhost:4000) to avoid external DNS/SSL round-trip // Browser: use NEXT_PUBLIC_API_URL (https://api.canhelp.gr) const BASE = "undefined" === 'undefined' ? process.env.INTERNAL_API_URL || 'http://localhost:4000' : process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export async function request(path, init) { const url = `${BASE}/api${path}`; if ("undefined" === 'undefined') console.log('[api] SSR fetch', url); const res = await fetch(url, { ...init, credentials: 'include', headers: { 'Content-Type': 'application/json', ...init?.headers } }); if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); const msg = typeof err.error === 'string' ? err.error : typeof err.message === 'string' ? err.message : res.statusText || 'Request failed'; throw new Error(msg); } return res.json(); } // ─── Tasks ──────────────────────────────────────────────────────────────── export const getTasks = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks${qs}`); }; export const getTaskBudgetRange = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks/budget-range${qs}`); }; export const searchTasks = (params)=>request(`/tasks/search?${new URLSearchParams(params)}`); export const getMyTasks = ()=>request('/tasks/my'); export const getTasksForSpecialist = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks/for-me${qs}`); }; export const getTaskCountsByCategory = ()=>request('/tasks/counts-by-category'); export const getTask = (id)=>request(`/tasks/${id}`); export const createTask = (data)=>request('/tasks', { method: 'POST', body: JSON.stringify(data) }); export const updateTask = (id, data)=>request(`/tasks/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const completeTask = (id)=>request(`/tasks/${id}/complete`, { method: 'PATCH' }); export const cancelTask = (id)=>request(`/tasks/${id}/cancel`, { method: 'PATCH' }); // ─── Offers ──────────────────────────────────────────────────────────────── export const getOffers = (taskId)=>request(`/offers?taskId=${taskId}`); export const getMyOffers = ()=>request('/offers/my'); export const createOffer = (data)=>request('/offers', { method: 'POST', body: JSON.stringify(data) }); export const acceptOffer = (id)=>request(`/offers/${id}/accept`, { method: 'PATCH' }); export const declineOffer = (id)=>request(`/offers/${id}/decline`, { method: 'PATCH' }); export const getUserProfile = (id, locale)=>request(`/users/${id}/profile${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); export const getSpecialists = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/users/specialists${qs}`); }; export const createReview = (data)=>request('/reviews', { method: 'POST', body: JSON.stringify(data) }); export const getTaskReviews = (taskId)=>request(`/reviews/task/${taskId}`); export const getMyReviews = ()=>request('/reviews/my'); // ─── Chat ────────────────────────────────────────────────────────────────── export const getChatRooms = ()=>request('/chat/rooms'); export const getOrCreateDirectRoom = (userId)=>request(`/chat/direct/${userId}`); export const getCanMessage = (userId)=>request(`/chat/can-message/${userId}`); export const getMessages = (roomId)=>request(`/chat/rooms/${roomId}/messages`); export const sendMessage = (roomId, body)=>request('/chat/messages', { method: 'POST', body: JSON.stringify({ roomId, body }) }); // ─── Notifications ──────────────────────────────────────────────────────── export const updateNotifSettings = (data)=>request('/users/me', { method: 'PATCH', body: JSON.stringify(data) }); export const getNotifications = ()=>request('/notifications'); export const getUnreadCount = ()=>request('/notifications/count'); export const markRead = (id)=>request(`/notifications/${id}/read`, { method: 'PATCH' }); export const markAllRead = ()=>request('/notifications/read-all', { method: 'PATCH' }); export const getTaskInvite = (taskId)=>request(`/notifications?type=task_invite&referenceId=${taskId}`); export const dismissNotification = (id)=>request(`/notifications/${id}`, { method: 'DELETE' }); // ─── Referral ───────────────────────────────────────────────────────────── export const getMyReferralInfo = ()=>request('/users/me/referral'); export const applyMyReferral = (refCode)=>request('/users/me/referral/apply', { method: 'POST', body: JSON.stringify({ refCode }) }); // ─── Reviews ────────────────────────────────────────────────────────────── export const getUserReviews = (userId)=>request(`/reviews/user/${userId}`); export const getUserRating = (userId)=>request(`/reviews/user/${userId}/rating`); // ─── Categories ─────────────────────────────────────────────────────────── export const getCategories = ()=>request('/categories'); // ─── Locations ──────────────────────────────────────────────────────────── export const getLocations = ()=>request('/locations'); // ─── Favorites ──────────────────────────────────────────────────────────── export const getFavorites = ()=>request('/favorites'); export const addFavorite = (taskId)=>request(`/favorites/${taskId}`, { method: 'POST' }); export const removeFavorite = (taskId)=>request(`/favorites/${taskId}`, { method: 'DELETE' }); export const getSpecialistFavorites = ()=>request('/favorites/specialists'); export const addSpecialistFavorite = (specialistId)=>request(`/favorites/specialists/${specialistId}`, { method: 'POST' }); export const removeSpecialistFavorite = (specialistId)=>request(`/favorites/specialists/${specialistId}`, { method: 'DELETE' }); // ─── Admin ───────────────────────────────────────────────────────────────── // ─── Admin Categories ────────────────────────────────────────────────────── export const getAdminCategories = ()=>request('/admin/categories'); export const createCategory = (data)=>request('/admin/categories', { method: 'POST', body: JSON.stringify(data) }); export const updateCategory = (id, data)=>request(`/admin/categories/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deleteCategory = (id)=>request(`/admin/categories/${id}`, { method: 'DELETE' }); // ─── Admin Skills ────────────────────────────────────────────────────────── export const getAdminSkills = (categorySlug)=>request(`/admin/skills?categorySlug=${encodeURIComponent(categorySlug)}`); export const createSkill = (data)=>request('/admin/skills', { method: 'POST', body: JSON.stringify(data) }); export const updateSkill = (id, data)=>request(`/admin/skills/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deleteSkill = (id)=>request(`/admin/skills/${id}`, { method: 'DELETE' }); export const getSkillDedup = (categorySlug)=>request(`/admin/skills/dedup${categorySlug ? `?categorySlug=${encodeURIComponent(categorySlug)}` : ''}`); export const mergeSkillDuplicates = (keepId, deleteIds)=>request('/admin/skills/dedup/merge', { method: 'POST', body: JSON.stringify({ keepId, deleteIds }) }); // ─── Admin ───────────────────────────────────────────────────────────────── export const getAdminStats = ()=>request('/admin/stats'); export const getAdminUsers = (page = 1, q, role)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (role) p.set('role', role); return request(`/admin/users?${p}`); }; export const deactivateUser = (id)=>request(`/admin/users/${id}/deactivate`, { method: 'PATCH' }); export const activateUser = (id)=>request(`/admin/users/${id}/activate`, { method: 'PATCH' }); export const changeUserRole = (id, role)=>request(`/admin/users/${id}/role`, { method: 'PATCH', body: JSON.stringify({ role }) }); export const getAdminUser = (id)=>request(`/admin/users/${id}`); export const getAdminUserSpecialistCards = (userId)=>request(`/admin/users/${userId}/specialist-cards`); export const adminUpdateSpecialistCard = (id, data)=>request(`/admin/specialist-cards/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const getAdminSpecialistCards = (page = 1, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request(`/admin/specialist-cards?${p}`); }; export const updateAdminUser = (id, data)=>request(`/admin/users/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const verifyAdminUserEmail = (id)=>request(`/admin/users/${id}/verify-email`, { method: 'PATCH' }); export const getAdminTasks = (page = 1, q, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (status) p.set('status', status); return request(`/admin/tasks?${p}`); }; export const cancelTaskAdmin = (id)=>request(`/admin/tasks/${id}/cancel`, { method: 'PATCH' }); export const deleteTaskAdmin = (id)=>request(`/admin/tasks/${id}`, { method: 'DELETE' }); export const getAdminReports = (page = 1, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request(`/admin/reports?${p}`); }; export const updateReportStatus = (id, status)=>request(`/admin/reports/${id}/status`, { method: 'PATCH', body: JSON.stringify({ status }) }); export const getAdminAiLogs = (page = 1)=>request(`/admin/ai-logs?page=${page}&limit=50`); export const getAdminActivityLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.userId) p.set('userId', params.userId); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/activity-logs?${p}`); }; export const getAdminMailLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/mail-logs?${p}`); }; export const getAdminNotifLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.type) p.set('type', params.type); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/notification-logs?${p}`); }; export const getAdminNotifStats = ()=>request('/admin/notification-stats'); export const getAdminMailStats = ()=>request('/admin/mail-stats'); export const getAdminReferrals = ()=>request('/admin/referrals'); export const adminSendPushToUser = (userId, data)=>request(`/admin/push/user/${userId}`, { method: 'POST', body: JSON.stringify(data) }); export const adminBroadcastPush = (data)=>request('/admin/push/broadcast', { method: 'POST', body: JSON.stringify(data) }); // ─── Admin Locations ─────────────────────────────────────────────────────── export const getAdminLocations = ()=>request('/admin/locations'); export const createLocation = (data)=>request('/admin/locations', { method: 'POST', body: JSON.stringify(data) }); export const updateLocation = (id, data)=>request(`/admin/locations/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deleteLocation = (id)=>request(`/admin/locations/${id}`, { method: 'DELETE' }); // ─── Admin Plans ─────────────────────────────────────────────────────────── export const getAdminPlans = ()=>request('/admin/plans'); export const createPlan = (data)=>request('/admin/plans', { method: 'POST', body: JSON.stringify(data) }); export const updatePlan = (id, data)=>request(`/admin/plans/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deletePlan = (id)=>request(`/admin/plans/${id}`, { method: 'DELETE' }); // ─── Admin Settings ──────────────────────────────────────────────────────── export const getAdminSettings = ()=>request('/admin/settings'); export const updateAdminSettings = (data)=>request('/admin/settings', { method: 'PUT', body: JSON.stringify(data) }); export const getAdminEmailTemplates = ()=>request('/admin/settings/templates'); export const updateAdminEmailTemplate = (key, data)=>request(`/admin/settings/templates/${key}`, { method: 'PUT', body: JSON.stringify(data) }); export const translateAdminEmailTemplate = (data)=>request('/admin/settings/templates/translate', { method: 'POST', body: JSON.stringify(data) }); export const sendTestEmail = ()=>request('/admin/settings/test-email', { method: 'POST' }); export const testTelegramConnection = (botToken, chatId)=>fetch(`${BASE}/api/admin/settings/test-telegram`, { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken, chatId }) }).then((r)=>r.json()); export const verifyTelegramToken = (botToken)=>fetch(`${BASE}/api/admin/settings/verify-telegram-token`, { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken }) }).then((r)=>r.json()); export const getTranslationsStats = ()=>request('/admin/translations/stats'); export const getTranslationsMissing = (table, missingLang, page = 1, limit = 50)=>request(`/admin/translations/${table}?missingLang=${missingLang}&page=${page}&limit=${limit}`); export const saveTranslations = (table, items)=>request(`/admin/translations/${table}/save`, { method: 'POST', body: JSON.stringify({ items }) }); export const autoTranslate = (table, missingLang, fromLang, batchSize = 500)=>request('/admin/translations/auto-translate', { method: 'POST', body: JSON.stringify({ table, missingLang, fromLang, batchSize }) }); export const autoTranslateTasks = (batchSize = 500)=>request('/admin/translations/auto-translate-tasks', { method: 'POST', body: JSON.stringify({ batchSize }) }); export const getTasksTranslationPreview = (lang, limit = 50)=>request(`/admin/translations/tasks-preview?lang=${lang}&limit=${limit}`); export const autoTranslateEmailTemplates = (missingLang, fromLang = 'el')=>request('/admin/translations/auto-translate-templates', { method: 'POST', body: JSON.stringify({ missingLang, fromLang }) }); // ─── Availability ────────────────────────────────────────────────────────── export const getMyAvailability = (month)=>request(`/availability/my${month ? `?month=${month}` : ''}`); export const setAvailability = (date, status, note)=>request('/availability/set', { method: 'POST', body: JSON.stringify({ date, status, note }) }); export const setAvailabilityRange = (from, to, status)=>request('/availability/set-range', { method: 'POST', body: JSON.stringify({ from, to, status }) }); export const getSpecialistAvailability = (userId, month)=>request(`/availability/user/${userId}${month ? `?month=${month}` : ''}`); export const getMyPortfolio = ()=>request('/portfolio/my'); export const addPortfolioItem = (formData)=>fetch(`${BASE}/api/portfolio`, { method: 'POST', credentials: 'include', body: formData }).then(async (res)=>{ if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); throw new Error(err.error || 'Upload failed'); } return res.json(); }); export const updatePortfolioItem = (id, data)=>request(`/portfolio/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deletePortfolioItem = (id)=>request(`/portfolio/${id}`, { method: 'DELETE' }); export const getSpecialistPortfolio = (userId)=>request(`/portfolio/user/${userId}`); export const getMySpecialistCards = ()=>request('/specialist-cards/my'); export const createSpecialistCard = (data)=>request('/specialist-cards', { method: 'POST', body: JSON.stringify(data) }); export const updateSpecialistCard = (id, data)=>request(`/specialist-cards/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const saveSiteSeo = (data)=>request('/users/me/site-seo', { method: 'POST', body: JSON.stringify(data) }); export const deleteSpecialistCard = (id)=>request(`/specialist-cards/${id}`, { method: 'DELETE' }); export const getSpecialistCards = (userId, locale)=>request(`/specialist-cards/user/${userId}${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); export const getPriceList = (cardId, locale)=>request(`/price-list/${cardId}${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); export const createPriceListGroup = (cardId, data)=>request(`/price-list/${cardId}/groups`, { method: 'POST', body: JSON.stringify(data) }); export const updatePriceListGroup = (groupId, data)=>request(`/price-list/groups/${groupId}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deletePriceListGroup = (groupId)=>request(`/price-list/groups/${groupId}`, { method: 'DELETE' }); export const createPriceListItem = (groupId, data)=>request(`/price-list/groups/${groupId}/items`, { method: 'POST', body: JSON.stringify(data) }); export const updatePriceListItem = (itemId, data)=>request(`/price-list/items/${itemId}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deletePriceListItem = (itemId)=>request(`/price-list/items/${itemId}`, { method: 'DELETE' }); export const getSkillSuggestions = (categorySlugs)=>{ const params = categorySlugs?.length ? '?' + categorySlugs.map((s)=>`category=${encodeURIComponent(s)}`).join('&') : ''; return request(`/skill-suggestions${params}`); }; export const initiateTopUp = (amount)=>request('/payments/topup/init', { method: 'POST', body: JSON.stringify({ amount }) }); export const getPaymentHistory = ()=>request('/payments/history'); export const getBalanceHistory = (limit = 50)=>request(`/payments/balance-history?limit=${limit}`); export const getPlanHistory = (limit = 50)=>request(`/users/me/plan-history?limit=${limit}`); export const getAdminBalanceHistory = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.userId) p.set('userId', params.userId); if (params.kind) p.set('kind', params.kind); p.set('limit', '50'); return request(`/admin/balance-history?${p}`); }; export const adminTopUpUserBalance = (id, data)=>request(`/admin/users/${id}/balance/topup`, { method: 'POST', body: JSON.stringify(data) }); export const adminWithdrawUserBalance = (id, data)=>request(`/admin/users/${id}/balance/withdraw`, { method: 'POST', body: JSON.stringify(data) }); export const previewPlanChange = (planId)=>request('/payments/plan/preview', { method: 'POST', body: JSON.stringify({ planId }) }); export const getPlans = (role)=>{ const qs = role ? `?role=${role}` : ''; return request(`/plans${qs}`); }; export const getMyDashboard = ()=>request('/dashboard/me'); export const getDailyUsage = ()=>request('/plans/daily-usage'); export const purchasePlan = (planId, payFromBalance = true)=>request('/payments/plan/purchase', { method: 'POST', body: JSON.stringify({ planId, payFromBalance }) }); // ─── Statuses ────────────────────────────────────────────────────────────── export const getMyStatuses = ()=>request('/statuses/me'); export const toggleStatus = (statusType, active)=>request('/statuses/toggle', { method: 'POST', body: JSON.stringify({ statusType, active }) }); export const getAutoResponseSettings = ()=>request('/auto-response'); export const updateAutoResponseSettings = (data)=>request('/auto-response', { method: 'PUT', body: JSON.stringify(data) }); // ─── FOMO ────────────────────────────────────────────────────────────────── export const getSpecialistFomoDashboard = ()=>request('/fomo/specialist'); export const getCustomerFomoDashboard = ()=>request('/fomo/customer'); export const getFomoRecommendations = ()=>request('/fomo/recommendations'); // ─── Auto-match ──────────────────────────────────────────────────────────── export const getAutoMatchResults = (taskId)=>request(`/auto-match/${taskId}`); export const runAutoMatch = (taskId)=>request(`/auto-match/${taskId}`, { method: 'POST' }); // ─── Google Calendar ─────────────────────────────────────────────────────── export const getGoogleCalendarStatus = ()=>request('/google/calendar/status'); export const disconnectGoogleCalendar = ()=>request('/google/calendar/disconnect', { method: 'DELETE' }); export const importFromGoogleCalendar = ()=>request('/google/calendar/import', { method: 'POST' }); export const getGoogleCalendarConnectUrl = ()=>`${BASE}/api/google/calendar/connect`; // ─── Personal site ───────────────────────────────────────────────────────── export const getPublicSiteProfile = (slug)=>request(`/users/site/${slug}`); export const getSiteStats = ()=>request('/users/me/site-stats'); export const trackSiteMessage = (slug)=>request(`/users/site/${slug}/track-message`, { method: 'POST' }).catch(()=>{}); // ─── Task stats (FOMO) ───────────────────────────────────────────────────── export const getTaskStats = (taskId)=>request(`/tasks/${taskId}/stats`); // ─── Support tickets ─────────────────────────────────────────────────────── export const sendPublicSupportMessage = (data)=>request('/support/public', { method: 'POST', body: JSON.stringify(data) }); export const createSupportTicket = (data)=>request('/support', { method: 'POST', body: JSON.stringify(data) }); export const getMySupportTickets = (page = 1)=>request(`/support/my?page=${page}`); export const getAdminSupportTickets = (params)=>request(`/support${params ? '?' + new URLSearchParams(params) : ''}`); export const replyToSupportTicket = (id, data)=>request(`/support/${id}/reply`, { method: 'PATCH', body: JSON.stringify(data) }); export const setSupportTicketStatus = (id, status)=>request(`/support/${id}/status`, { method: 'PATCH', body: JSON.stringify({ status }) }); _58>5;`fy) _/ q w " ( o u  [ a 4:_MSY_|/5QW _!MSZ`TZw}  _ /!5!p!v!!!}""##$$$$%%%&c&i&_'e'((q(w(1*7*++9-_?----- ....////P0V0001111S2Y2223333W4]44_4L5R555[6a67799V9\9::::;;<<6=<=>>>>??@@A_%A[AaAC CCCCDUD[DDD,E2EEEKFQFFFTGZGGG}HH!I'IIIDJ_JJJJ[KaKDLJLLL-M3MMMMM (/* binding */ getTaskBudgetRange), /* harmony export */ F7: () => (/* binding */ getSpecialists), /* harmony export */ Vs: () => (/* binding */ getLocations), /* harmony export */ bW: () => (/* binding */ getCategories), /* harmony export */ gg: () => (/* binding */ getTask) /* harmony export */ }); /* unused harmony exports request, getTasks, searchTasks, getMyTasks, getTasksForSpecialist, getTaskCountsByCategory, createTask, updateTask, completeTask, cancelTask, getOffers, getMyOffers, createOffer, acceptOffer, declineOffer, getUserProfile, createReview, getTaskReviews, getMyReviews, getChatRooms, getOrCreateDirectRoom, getCanMessage, getMessages, sendMessage, updateNotifSettings, getNotifications, getUnreadCount, markRead, markAllRead, getTaskInvite, dismissNotification, getMyReferralInfo, applyMyReferral, getUserReviews, getUserRating, getFavorites, addFavorite, removeFavorite, getSpecialistFavorites, addSpecialistFavorite, removeSpecialistFavorite, getAdminCategories, createCategory, updateCategory, deleteCategory, getAdminSkills, createSkill, updateSkill, deleteSkill, getSkillDedup, mergeSkillDuplicates, getAdminStats, getAdminUsers, deactivateUser, activateUser, changeUserRole, getAdminUser, getAdminUserSpecialistCards, adminUpdateSpecialistCard, getAdminSpecialistCards, updateAdminUser, verifyAdminUserEmail, getAdminTasks, cancelTaskAdmin, deleteTaskAdmin, getAdminReports, updateReportStatus, getAdminAiLogs, getAdminActivityLogs, getAdminMailLogs, getAdminNotifLogs, getAdminNotifStats, getAdminMailStats, getAdminReferrals, adminSendPushToUser, adminBroadcastPush, getAdminLocations, createLocation, updateLocation, deleteLocation, getAdminPlans, createPlan, updatePlan, deletePlan, getAdminSettings, updateAdminSettings, getAdminEmailTemplates, updateAdminEmailTemplate, translateAdminEmailTemplate, sendTestEmail, testTelegramConnection, verifyTelegramToken, getTranslationsStats, getTranslationsMissing, saveTranslations, autoTranslate, autoTranslateTasks, getTasksTranslationPreview, autoTranslateEmailTemplates, getMyAvailability, setAvailability, setAvailabilityRange, getSpecialistAvailability, getMyPortfolio, addPortfolioItem, updatePortfolioItem, deletePortfolioItem, getSpecialistPortfolio, getMySpecialistCards, createSpecialistCard, updateSpecialistCard, saveSiteSeo, deleteSpecialistCard, getSpecialistCards, getPriceList, createPriceListGroup, updatePriceListGroup, deletePriceListGroup, createPriceListItem, updatePriceListItem, deletePriceListItem, getSkillSuggestions, initiateTopUp, getPaymentHistory, getBalanceHistory, getPlanHistory, getAdminBalanceHistory, adminTopUpUserBalance, adminWithdrawUserBalance, previewPlanChange, getPlans, getMyDashboard, getDailyUsage, purchasePlan, getMyStatuses, toggleStatus, getAutoResponseSettings, updateAutoResponseSettings, getSpecialistFomoDashboard, getCustomerFomoDashboard, getFomoRecommendations, getAutoMatchResults, runAutoMatch, getGoogleCalendarStatus, disconnectGoogleCalendar, importFromGoogleCalendar, getGoogleCalendarConnectUrl, getPublicSiteProfile, getSiteStats, trackSiteMessage, getTaskStats, sendPublicSupportMessage, createSupportTicket, getMySupportTickets, getAdminSupportTickets, replyToSupportTicket, setSupportTicketStatus */ // SSR: use INTERNAL_API_URL (http://localhost:4000) to avoid external DNS/SSL round-trip // Browser: use NEXT_PUBLIC_API_URL (https://api.canhelp.gr) const BASE = true ? process.env.INTERNAL_API_URL || 'http://localhost:4000' : 0; async function request(path, init) { const url = `${BASE}/api${path}`; if (true) console.log('[api] SSR fetch', url); const res = await fetch(url, { ...init, credentials: 'include', headers: { 'Content-Type': 'application/json', ...init?.headers } }); if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); const msg = typeof err.error === 'string' ? err.error : typeof err.message === 'string' ? err.message : res.statusText || 'Request failed'; throw new Error(msg); } return res.json(); } // ─── Tasks ──────────────────────────────────────────────────────────────── const getTasks = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks${qs}`); }; const getTaskBudgetRange = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks/budget-range${qs}`); }; const searchTasks = (params)=>request(`/tasks/search?${new URLSearchParams(params)}`); const getMyTasks = ()=>request('/tasks/my'); const getTasksForSpecialist = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks/for-me${qs}`); }; const getTaskCountsByCategory = ()=>request('/tasks/counts-by-category'); const getTask = (id)=>request(`/tasks/${id}`); const createTask = (data)=>request('/tasks', { method: 'POST', body: JSON.stringify(data) }); const updateTask = (id, data)=>request(`/tasks/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const completeTask = (id)=>request(`/tasks/${id}/complete`, { method: 'PATCH' }); const cancelTask = (id)=>request(`/tasks/${id}/cancel`, { method: 'PATCH' }); // ─── Offers ──────────────────────────────────────────────────────────────── const getOffers = (taskId)=>request(`/offers?taskId=${taskId}`); const getMyOffers = ()=>request('/offers/my'); const createOffer = (data)=>request('/offers', { method: 'POST', body: JSON.stringify(data) }); const acceptOffer = (id)=>request(`/offers/${id}/accept`, { method: 'PATCH' }); const declineOffer = (id)=>request(`/offers/${id}/decline`, { method: 'PATCH' }); const getUserProfile = (id, locale)=>request(`/users/${id}/profile${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); const getSpecialists = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/users/specialists${qs}`); }; const createReview = (data)=>request('/reviews', { method: 'POST', body: JSON.stringify(data) }); const getTaskReviews = (taskId)=>request(`/reviews/task/${taskId}`); const getMyReviews = ()=>request('/reviews/my'); // ─── Chat ────────────────────────────────────────────────────────────────── const getChatRooms = ()=>request('/chat/rooms'); const getOrCreateDirectRoom = (userId)=>request(`/chat/direct/${userId}`); const getCanMessage = (userId)=>request(`/chat/can-message/${userId}`); const getMessages = (roomId)=>request(`/chat/rooms/${roomId}/messages`); const sendMessage = (roomId, body)=>request('/chat/messages', { method: 'POST', body: JSON.stringify({ roomId, body }) }); // ─── Notifications ──────────────────────────────────────────────────────── const updateNotifSettings = (data)=>request('/users/me', { method: 'PATCH', body: JSON.stringify(data) }); const getNotifications = ()=>request('/notifications'); const getUnreadCount = ()=>request('/notifications/count'); const markRead = (id)=>request(`/notifications/${id}/read`, { method: 'PATCH' }); const markAllRead = ()=>request('/notifications/read-all', { method: 'PATCH' }); const getTaskInvite = (taskId)=>request(`/notifications?type=task_invite&referenceId=${taskId}`); const dismissNotification = (id)=>request(`/notifications/${id}`, { method: 'DELETE' }); // ─── Referral ───────────────────────────────────────────────────────────── const getMyReferralInfo = ()=>request('/users/me/referral'); const applyMyReferral = (refCode)=>request('/users/me/referral/apply', { method: 'POST', body: JSON.stringify({ refCode }) }); // ─── Reviews ────────────────────────────────────────────────────────────── const getUserReviews = (userId)=>request(`/reviews/user/${userId}`); const getUserRating = (userId)=>request(`/reviews/user/${userId}/rating`); // ─── Categories ─────────────────────────────────────────────────────────── const getCategories = ()=>request('/categories'); // ─── Locations ──────────────────────────────────────────────────────────── const getLocations = ()=>request('/locations'); // ─── Favorites ──────────────────────────────────────────────────────────── const getFavorites = ()=>request('/favorites'); const addFavorite = (taskId)=>request(`/favorites/${taskId}`, { method: 'POST' }); const removeFavorite = (taskId)=>request(`/favorites/${taskId}`, { method: 'DELETE' }); const getSpecialistFavorites = ()=>request('/favorites/specialists'); const addSpecialistFavorite = (specialistId)=>request(`/favorites/specialists/${specialistId}`, { method: 'POST' }); const removeSpecialistFavorite = (specialistId)=>request(`/favorites/specialists/${specialistId}`, { method: 'DELETE' }); // ─── Admin ───────────────────────────────────────────────────────────────── // ─── Admin Categories ────────────────────────────────────────────────────── const getAdminCategories = ()=>request('/admin/categories'); const createCategory = (data)=>request('/admin/categories', { method: 'POST', body: JSON.stringify(data) }); const updateCategory = (id, data)=>request(`/admin/categories/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const deleteCategory = (id)=>request(`/admin/categories/${id}`, { method: 'DELETE' }); // ─── Admin Skills ────────────────────────────────────────────────────────── const getAdminSkills = (categorySlug)=>request(`/admin/skills?categorySlug=${encodeURIComponent(categorySlug)}`); const createSkill = (data)=>request('/admin/skills', { method: 'POST', body: JSON.stringify(data) }); const updateSkill = (id, data)=>request(`/admin/skills/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const deleteSkill = (id)=>request(`/admin/skills/${id}`, { method: 'DELETE' }); const getSkillDedup = (categorySlug)=>request(`/admin/skills/dedup${categorySlug ? `?categorySlug=${encodeURIComponent(categorySlug)}` : ''}`); const mergeSkillDuplicates = (keepId, deleteIds)=>request('/admin/skills/dedup/merge', { method: 'POST', body: JSON.stringify({ keepId, deleteIds }) }); // ─── Admin ───────────────────────────────────────────────────────────────── const getAdminStats = ()=>request('/admin/stats'); const getAdminUsers = (page = 1, q, role)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (role) p.set('role', role); return request(`/admin/users?${p}`); }; const deactivateUser = (id)=>request(`/admin/users/${id}/deactivate`, { method: 'PATCH' }); const activateUser = (id)=>request(`/admin/users/${id}/activate`, { method: 'PATCH' }); const changeUserRole = (id, role)=>request(`/admin/users/${id}/role`, { method: 'PATCH', body: JSON.stringify({ role }) }); const getAdminUser = (id)=>request(`/admin/users/${id}`); const getAdminUserSpecialistCards = (userId)=>request(`/admin/users/${userId}/specialist-cards`); const adminUpdateSpecialistCard = (id, data)=>request(`/admin/specialist-cards/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const getAdminSpecialistCards = (page = 1, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request(`/admin/specialist-cards?${p}`); }; const updateAdminUser = (id, data)=>request(`/admin/users/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const verifyAdminUserEmail = (id)=>request(`/admin/users/${id}/verify-email`, { method: 'PATCH' }); const getAdminTasks = (page = 1, q, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (status) p.set('status', status); return request(`/admin/tasks?${p}`); }; const cancelTaskAdmin = (id)=>request(`/admin/tasks/${id}/cancel`, { method: 'PATCH' }); const deleteTaskAdmin = (id)=>request(`/admin/tasks/${id}`, { method: 'DELETE' }); const getAdminReports = (page = 1, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request(`/admin/reports?${p}`); }; const updateReportStatus = (id, status)=>request(`/admin/reports/${id}/status`, { method: 'PATCH', body: JSON.stringify({ status }) }); const getAdminAiLogs = (page = 1)=>request(`/admin/ai-logs?page=${page}&limit=50`); const getAdminActivityLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.userId) p.set('userId', params.userId); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/activity-logs?${p}`); }; const getAdminMailLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/mail-logs?${p}`); }; const getAdminNotifLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.type) p.set('type', params.type); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/notification-logs?${p}`); }; const getAdminNotifStats = ()=>request('/admin/notification-stats'); const getAdminMailStats = ()=>request('/admin/mail-stats'); const getAdminReferrals = ()=>request('/admin/referrals'); const adminSendPushToUser = (userId, data)=>request(`/admin/push/user/${userId}`, { method: 'POST', body: JSON.stringify(data) }); const adminBroadcastPush = (data)=>request('/admin/push/broadcast', { method: 'POST', body: JSON.stringify(data) }); // ─── Admin Locations ─────────────────────────────────────────────────────── const getAdminLocations = ()=>request('/admin/locations'); const createLocation = (data)=>request('/admin/locations', { method: 'POST', body: JSON.stringify(data) }); const updateLocation = (id, data)=>request(`/admin/locations/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const deleteLocation = (id)=>request(`/admin/locations/${id}`, { method: 'DELETE' }); // ─── Admin Plans ─────────────────────────────────────────────────────────── const getAdminPlans = ()=>request('/admin/plans'); const createPlan = (data)=>request('/admin/plans', { method: 'POST', body: JSON.stringify(data) }); const updatePlan = (id, data)=>request(`/admin/plans/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const deletePlan = (id)=>request(`/admin/plans/${id}`, { method: 'DELETE' }); // ─── Admin Settings ──────────────────────────────────────────────────────── const getAdminSettings = ()=>request('/admin/settings'); const updateAdminSettings = (data)=>request('/admin/settings', { method: 'PUT', body: JSON.stringify(data) }); const getAdminEmailTemplates = ()=>request('/admin/settings/templates'); const updateAdminEmailTemplate = (key, data)=>request(`/admin/settings/templates/${key}`, { method: 'PUT', body: JSON.stringify(data) }); const translateAdminEmailTemplate = (data)=>request('/admin/settings/templates/translate', { method: 'POST', body: JSON.stringify(data) }); const sendTestEmail = ()=>request('/admin/settings/test-email', { method: 'POST' }); const testTelegramConnection = (botToken, chatId)=>fetch(`${BASE}/api/admin/settings/test-telegram`, { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken, chatId }) }).then((r)=>r.json()); const verifyTelegramToken = (botToken)=>fetch(`${BASE}/api/admin/settings/verify-telegram-token`, { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken }) }).then((r)=>r.json()); const getTranslationsStats = ()=>request('/admin/translations/stats'); const getTranslationsMissing = (table, missingLang, page = 1, limit = 50)=>request(`/admin/translations/${table}?missingLang=${missingLang}&page=${page}&limit=${limit}`); const saveTranslations = (table, items)=>request(`/admin/translations/${table}/save`, { method: 'POST', body: JSON.stringify({ items }) }); const autoTranslate = (table, missingLang, fromLang, batchSize = 500)=>request('/admin/translations/auto-translate', { method: 'POST', body: JSON.stringify({ table, missingLang, fromLang, batchSize }) }); const autoTranslateTasks = (batchSize = 500)=>request('/admin/translations/auto-translate-tasks', { method: 'POST', body: JSON.stringify({ batchSize }) }); const getTasksTranslationPreview = (lang, limit = 50)=>request(`/admin/translations/tasks-preview?lang=${lang}&limit=${limit}`); const autoTranslateEmailTemplates = (missingLang, fromLang = 'el')=>request('/admin/translations/auto-translate-templates', { method: 'POST', body: JSON.stringify({ missingLang, fromLang }) }); // ─── Availability ────────────────────────────────────────────────────────── const getMyAvailability = (month)=>request(`/availability/my${month ? `?month=${month}` : ''}`); const setAvailability = (date, status, note)=>request('/availability/set', { method: 'POST', body: JSON.stringify({ date, status, note }) }); const setAvailabilityRange = (from, to, status)=>request('/availability/set-range', { method: 'POST', body: JSON.stringify({ from, to, status }) }); const getSpecialistAvailability = (userId, month)=>request(`/availability/user/${userId}${month ? `?month=${month}` : ''}`); const getMyPortfolio = ()=>request('/portfolio/my'); const addPortfolioItem = (formData)=>fetch(`${BASE}/api/portfolio`, { method: 'POST', credentials: 'include', body: formData }).then(async (res)=>{ if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); throw new Error(err.error || 'Upload failed'); } return res.json(); }); const updatePortfolioItem = (id, data)=>request(`/portfolio/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const deletePortfolioItem = (id)=>request(`/portfolio/${id}`, { method: 'DELETE' }); const getSpecialistPortfolio = (userId)=>request(`/portfolio/user/${userId}`); const getMySpecialistCards = ()=>request('/specialist-cards/my'); const createSpecialistCard = (data)=>request('/specialist-cards', { method: 'POST', body: JSON.stringify(data) }); const updateSpecialistCard = (id, data)=>request(`/specialist-cards/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const saveSiteSeo = (data)=>request('/users/me/site-seo', { method: 'POST', body: JSON.stringify(data) }); const deleteSpecialistCard = (id)=>request(`/specialist-cards/${id}`, { method: 'DELETE' }); const getSpecialistCards = (userId, locale)=>request(`/specialist-cards/user/${userId}${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); const getPriceList = (cardId, locale)=>request(`/price-list/${cardId}${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); const createPriceListGroup = (cardId, data)=>request(`/price-list/${cardId}/groups`, { method: 'POST', body: JSON.stringify(data) }); const updatePriceListGroup = (groupId, data)=>request(`/price-list/groups/${groupId}`, { method: 'PATCH', body: JSON.stringify(data) }); const deletePriceListGroup = (groupId)=>request(`/price-list/groups/${groupId}`, { method: 'DELETE' }); const createPriceListItem = (groupId, data)=>request(`/price-list/groups/${groupId}/items`, { method: 'POST', body: JSON.stringify(data) }); const updatePriceListItem = (itemId, data)=>request(`/price-list/items/${itemId}`, { method: 'PATCH', body: JSON.stringify(data) }); const deletePriceListItem = (itemId)=>request(`/price-list/items/${itemId}`, { method: 'DELETE' }); const getSkillSuggestions = (categorySlugs)=>{ const params = categorySlugs?.length ? '?' + categorySlugs.map((s)=>`category=${encodeURIComponent(s)}`).join('&') : ''; return request(`/skill-suggestions${params}`); }; const initiateTopUp = (amount)=>request('/payments/topup/init', { method: 'POST', body: JSON.stringify({ amount }) }); const getPaymentHistory = ()=>request('/payments/history'); const getBalanceHistory = (limit = 50)=>request(`/payments/balance-history?limit=${limit}`); const getPlanHistory = (limit = 50)=>request(`/users/me/plan-history?limit=${limit}`); const getAdminBalanceHistory = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.userId) p.set('userId', params.userId); if (params.kind) p.set('kind', params.kind); p.set('limit', '50'); return request(`/admin/balance-history?${p}`); }; const adminTopUpUserBalance = (id, data)=>request(`/admin/users/${id}/balance/topup`, { method: 'POST', body: JSON.stringify(data) }); const adminWithdrawUserBalance = (id, data)=>request(`/admin/users/${id}/balance/withdraw`, { method: 'POST', body: JSON.stringify(data) }); const previewPlanChange = (planId)=>request('/payments/plan/preview', { method: 'POST', body: JSON.stringify({ planId }) }); const getPlans = (role)=>{ const qs = role ? `?role=${role}` : ''; return request(`/plans${qs}`); }; const getMyDashboard = ()=>request('/dashboard/me'); const getDailyUsage = ()=>request('/plans/daily-usage'); const purchasePlan = (planId, payFromBalance = true)=>request('/payments/plan/purchase', { method: 'POST', body: JSON.stringify({ planId, payFromBalance }) }); // ─── Statuses ────────────────────────────────────────────────────────────── const getMyStatuses = ()=>request('/statuses/me'); const toggleStatus = (statusType, active)=>request('/statuses/toggle', { method: 'POST', body: JSON.stringify({ statusType, active }) }); const getAutoResponseSettings = ()=>request('/auto-response'); const updateAutoResponseSettings = (data)=>request('/auto-response', { method: 'PUT', body: JSON.stringify(data) }); // ─── FOMO ────────────────────────────────────────────────────────────────── const getSpecialistFomoDashboard = ()=>request('/fomo/specialist'); const getCustomerFomoDashboard = ()=>request('/fomo/customer'); const getFomoRecommendations = ()=>request('/fomo/recommendations'); // ─── Auto-match ──────────────────────────────────────────────────────────── const getAutoMatchResults = (taskId)=>request(`/auto-match/${taskId}`); const runAutoMatch = (taskId)=>request(`/auto-match/${taskId}`, { method: 'POST' }); // ─── Google Calendar ─────────────────────────────────────────────────────── const getGoogleCalendarStatus = ()=>request('/google/calendar/status'); const disconnectGoogleCalendar = ()=>request('/google/calendar/disconnect', { method: 'DELETE' }); const importFromGoogleCalendar = ()=>request('/google/calendar/import', { method: 'POST' }); const getGoogleCalendarConnectUrl = ()=>`${BASE}/api/google/calendar/connect`; // ─── Personal site ───────────────────────────────────────────────────────── const getPublicSiteProfile = (slug)=>request(`/users/site/${slug}`); const getSiteStats = ()=>request('/users/me/site-stats'); const trackSiteMessage = (slug)=>request(`/users/site/${slug}/track-message`, { method: 'POST' }).catch(()=>{}); // ─── Task stats (FOMO) ───────────────────────────────────────────────────── const getTaskStats = (taskId)=>request(`/tasks/${taskId}/stats`); // ─── Support tickets ─────────────────────────────────────────────────────── const sendPublicSupportMessage = (data)=>request('/support/public', { method: 'POST', body: JSON.stringify(data) }); const createSupportTicket = (data)=>request('/support', { method: 'POST', body: JSON.stringify(data) }); const getMySupportTickets = (page = 1)=>request(`/support/my?page=${page}`); const getAdminSupportTickets = (params)=>request(`/support${params ? '?' + new URLSearchParams(params) : ''}`); const replyToSupportTicket = (id, data)=>request(`/support/${id}/reply`, { method: 'PATCH', body: JSON.stringify(data) }); const setSupportTicketStatus = (id, status)=>request(`/support/${id}/status`, { method: 'PATCH', body: JSON.stringify({ status }) });   /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CC: () => (/* binding */ getTaskBudgetRange), /* harmony export */ F7: () => (/* binding */ getSpecialists), /* harmony export */ Vs: () => (/* binding */ getLocations), /* harmony export */ bW: () => (/* binding */ getCategories), /* harmony export */ gg: () => (/* binding */ getTask) /* harmony export */ }); /* unused harmony exports request, getTasks, searchTasks, getMyTasks, getTasksForSpecialist, getTaskCountsByCategory, createTask, updateTask, completeTask, cancelTask, getOffers, getMyOffers, createOffer, acceptOffer, declineOffer, getUserProfile, createReview, getTaskReviews, getMyReviews, getChatRooms, getOrCreateDirectRoom, getCanMessage, getMessages, sendMessage, updateNotifSettings, getNotifications, getUnreadCount, markRead, markAllRead, getTaskInvite, dismissNotification, getMyReferralInfo, applyMyReferral, getUserReviews, getUserRating, getFavorites, addFavorite, removeFavorite, getSpecialistFavorites, addSpecialistFavorite, removeSpecialistFavorite, getAdminCategories, createCategory, updateCategory, deleteCategory, getAdminSkills, createSkill, updateSkill, deleteSkill, getSkillDedup, mergeSkillDuplicates, getAdminStats, getAdminUsers, deactivateUser, activateUser, changeUserRole, getAdminUser, getAdminUserSpecialistCards, adminUpdateSpecialistCard, getAdminSpecialistCards, updateAdminUser, verifyAdminUserEmail, getAdminTasks, cancelTaskAdmin, deleteTaskAdmin, getAdminReports, updateReportStatus, getAdminAiLogs, getAdminActivityLogs, getAdminMailLogs, getAdminNotifLogs, getAdminNotifStats, getAdminMailStats, getAdminReferrals, adminSendPushToUser, adminBroadcastPush, getAdminLocations, createLocation, updateLocation, deleteLocation, getAdminPlans, createPlan, updatePlan, deletePlan, getAdminSettings, updateAdminSettings, getAdminEmailTemplates, updateAdminEmailTemplate, translateAdminEmailTemplate, sendTestEmail, testTelegramConnection, verifyTelegramToken, getTranslationsStats, getTranslationsMissing, saveTranslations, autoTranslate, autoTranslateTasks, getTasksTranslationPreview, autoTranslateEmailTemplates, getMyAvailability, setAvailability, setAvailabilityRange, getSpecialistAvailability, getMyPortfolio, addPortfolioItem, updatePortfolioItem, deletePortfolioItem, getSpecialistPortfolio, getMySpecialistCards, createSpecialistCard, updateSpecialistCard, saveSiteSeo, deleteSpecialistCard, getSpecialistCards, getPriceList, createPriceListGroup, updatePriceListGroup, deletePriceListGroup, createPriceListItem, updatePriceListItem, deletePriceListItem, getSkillSuggestions, initiateTopUp, getPaymentHistory, getBalanceHistory, getPlanHistory, getAdminBalanceHistory, adminTopUpUserBalance, adminWithdrawUserBalance, previewPlanChange, getPlans, getMyDashboard, getDailyUsage, purchasePlan, getMyStatuses, toggleStatus, getAutoResponseSettings, updateAutoResponseSettings, getSpecialistFomoDashboard, getCustomerFomoDashboard, getFomoRecommendations, getAutoMatchResults, runAutoMatch, getGoogleCalendarStatus, disconnectGoogleCalendar, importFromGoogleCalendar, getGoogleCalendarConnectUrl, getPublicSiteProfile, getSiteStats, trackSiteMessage, getTaskStats, sendPublicSupportMessage, createSupportTicket, getMySupportTickets, getAdminSupportTickets, replyToSupportTicket, setSupportTicketStatus */ [j// SSR: use INTERNAL_API_URL (http://localhost:4000) to avoid external DNS/SSL round-trip // Browser: use NEXT_PUBLIC_API_URL (https://api.canhelp.gr) const BASE = "undefined" === 'undefined' ? process.env.INTERNAL_API_URL || 'http://localhost:4000' : process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export async function request(path, init) { const url = `${BASE}/api${path}`; if ("undefined" === 'undefined') console.log('[api] SSR fetch', url); const res = await fetch(url, { ...init, credentials: 'include', headers: { 'Content-Type': 'application/json', ...init?.headers } }); if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); const msg = typeof err.error === 'string' ? err.error : typeof err.message === 'string' ? err.message : res.statusText || 'Request failed'; throw new Error(msg); } return res.json(); } // ─── Tasks ──────────────────────────────────────────────────────────────── export const getTasks = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks${qs}`); }; export const getTaskBudgetRange = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks/budget-range${qs}`); }; export const searchTasks = (params)=>request(`/tasks/search?${new URLSearchParams(params)}`); export const getMyTasks = ()=>request('/tasks/my'); export const getTasksForSpecialist = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks/for-me${qs}`); }; export const getTaskCountsByCategory = ()=>request('/tasks/counts-by-category'); export const getTask = (id)=>request(`/tasks/${id}`); export const createTask = (data)=>request('/tasks', { method: 'POST', body: JSON.stringify(data) }); export const updateTask = (id, data)=>request(`/tasks/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const completeTask = (id)=>request(`/tasks/${id}/complete`, { method: 'PATCH' }); export const cancelTask = (id)=>request(`/tasks/${id}/cancel`, { method: 'PATCH' }); // ─── Offers ──────────────────────────────────────────────────────────────── export const getOffers = (taskId)=>request(`/offers?taskId=${taskId}`); export const getMyOffers = ()=>request('/offers/my'); export const createOffer = (data)=>request('/offers', { method: 'POST', body: JSON.stringify(data) }); export const acceptOffer = (id)=>request(`/offers/${id}/accept`, { method: 'PATCH' }); export const declineOffer = (id)=>request(`/offers/${id}/decline`, { method: 'PATCH' }); export const getUserProfile = (id, locale)=>request(`/users/${id}/profile${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); export const getSpecialists = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/users/specialists${qs}`); }; export const createReview = (data)=>request('/reviews', { method: 'POST', body: JSON.stringify(data) }); export const getTaskReviews = (taskId)=>request(`/reviews/task/${taskId}`); export const getMyReviews = ()=>request('/reviews/my'); // ─── Chat ────────────────────────────────────────────────────────────────── export const getChatRooms = ()=>request('/chat/rooms'); export const getOrCreateDirectRoom = (userId)=>request(`/chat/direct/${userId}`); export const getCanMessage = (userId)=>request(`/chat/can-message/${userId}`); export const getMessages = (roomId)=>request(`/chat/rooms/${roomId}/messages`); export const sendMessage = (roomId, body)=>request('/chat/messages', { method: 'POST', body: JSON.stringify({ roomId, body }) }); // ─── Notifications ──────────────────────────────────────────────────────── export const updateNotifSettings = (data)=>request('/users/me', { method: 'PATCH', body: JSON.stringify(data) }); export const getNotifications = ()=>request('/notifications'); export const getUnreadCount = ()=>request('/notifications/count'); export const markRead = (id)=>request(`/notifications/${id}/read`, { method: 'PATCH' }); export const markAllRead = ()=>request('/notifications/read-all', { method: 'PATCH' }); export const getTaskInvite = (taskId)=>request(`/notifications?type=task_invite&referenceId=${taskId}`); export const dismissNotification = (id)=>request(`/notifications/${id}`, { method: 'DELETE' }); // ─── Referral ───────────────────────────────────────────────────────────── export const getMyReferralInfo = ()=>request('/users/me/referral'); export const applyMyReferral = (refCode)=>request('/users/me/referral/apply', { method: 'POST', body: JSON.stringify({ refCode }) }); // ─── Reviews ────────────────────────────────────────────────────────────── export const getUserReviews = (userId)=>request(`/reviews/user/${userId}`); export const getUserRating = (userId)=>request(`/reviews/user/${userId}/rating`); // ─── Categories ─────────────────────────────────────────────────────────── export const getCategories = ()=>request('/categories'); // ─── Locations ──────────────────────────────────────────────────────────── export const getLocations = ()=>request('/locations'); // ─── Favorites ──────────────────────────────────────────────────────────── export const getFavorites = ()=>request('/favorites'); export const addFavorite = (taskId)=>request(`/favorites/${taskId}`, { method: 'POST' }); export const removeFavorite = (taskId)=>request(`/favorites/${taskId}`, { method: 'DELETE' }); export const getSpecialistFavorites = ()=>request('/favorites/specialists'); export const addSpecialistFavorite = (specialistId)=>request(`/favorites/specialists/${specialistId}`, { method: 'POST' }); export const removeSpecialistFavorite = (specialistId)=>request(`/favorites/specialists/${specialistId}`, { method: 'DELETE' }); // ─── Admin ───────────────────────────────────────────────────────────────── // ─── Admin Categories ────────────────────────────────────────────────────── export const getAdminCategories = ()=>request('/admin/categories'); export const createCategory = (data)=>request('/admin/categories', { method: 'POST', body: JSON.stringify(data) }); export const updateCategory = (id, data)=>request(`/admin/categories/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deleteCategory = (id)=>request(`/admin/categories/${id}`, { method: 'DELETE' }); // ─── Admin Skills ────────────────────────────────────────────────────────── export const getAdminSkills = (categorySlug)=>request(`/admin/skills?categorySlug=${encodeURIComponent(categorySlug)}`); export const createSkill = (data)=>request('/admin/skills', { method: 'POST', body: JSON.stringify(data) }); export const updateSkill = (id, data)=>request(`/admin/skills/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deleteSkill = (id)=>request(`/admin/skills/${id}`, { method: 'DELETE' }); export const getSkillDedup = (categorySlug)=>request(`/admin/skills/dedup${categorySlug ? `?categorySlug=${encodeURIComponent(categorySlug)}` : ''}`); export const mergeSkillDuplicates = (keepId, deleteIds)=>request('/admin/skills/dedup/merge', { method: 'POST', body: JSON.stringify({ keepId, deleteIds }) }); // ─── Admin ───────────────────────────────────────────────────────────────── export const getAdminStats = ()=>request('/admin/stats'); export const getAdminUsers = (page = 1, q, role)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (role) p.set('role', role); return request(`/admin/users?${p}`); }; export const deactivateUser = (id)=>request(`/admin/users/${id}/deactivate`, { method: 'PATCH' }); export const activateUser = (id)=>request(`/admin/users/${id}/activate`, { method: 'PATCH' }); export const changeUserRole = (id, role)=>request(`/admin/users/${id}/role`, { method: 'PATCH', body: JSON.stringify({ role }) }); export const getAdminUser = (id)=>request(`/admin/users/${id}`); export const getAdminUserSpecialistCards = (userId)=>request(`/admin/users/${userId}/specialist-cards`); export const adminUpdateSpecialistCard = (id, data)=>request(`/admin/specialist-cards/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const getAdminSpecialistCards = (page = 1, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request(`/admin/specialist-cards?${p}`); }; export const updateAdminUser = (id, data)=>request(`/admin/users/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const verifyAdminUserEmail = (id)=>request(`/admin/users/${id}/verify-email`, { method: 'PATCH' }); export const getAdminTasks = (page = 1, q, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (status) p.set('status', status); return request(`/admin/tasks?${p}`); }; export const cancelTaskAdmin = (id)=>request(`/admin/tasks/${id}/cancel`, { method: 'PATCH' }); export const deleteTaskAdmin = (id)=>request(`/admin/tasks/${id}`, { method: 'DELETE' }); export const getAdminReports = (page = 1, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request(`/admin/reports?${p}`); }; export const updateReportStatus = (id, status)=>request(`/admin/reports/${id}/status`, { method: 'PATCH', body: JSON.stringify({ status }) }); export const getAdminAiLogs = (page = 1)=>request(`/admin/ai-logs?page=${page}&limit=50`); export const getAdminActivityLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.userId) p.set('userId', params.userId); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/activity-logs?${p}`); }; export const getAdminMailLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/mail-logs?${p}`); }; export const getAdminNotifLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.type) p.set('type', params.type); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/notification-logs?${p}`); }; export const getAdminNotifStats = ()=>request('/admin/notification-stats'); export const getAdminMailStats = ()=>request('/admin/mail-stats'); export const getAdminReferrals = ()=>request('/admin/referrals'); export const adminSendPushToUser = (userId, data)=>request(`/admin/push/user/${userId}`, { method: 'POST', body: JSON.stringify(data) }); export const adminBroadcastPush = (data)=>request('/admin/push/broadcast', { method: 'POST', body: JSON.stringify(data) }); // ─── Admin Locations ─────────────────────────────────────────────────────── export const getAdminLocations = ()=>request('/admin/locations'); export const createLocation = (data)=>request('/admin/locations', { method: 'POST', body: JSON.stringify(data) }); export const updateLocation = (id, data)=>request(`/admin/locations/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deleteLocation = (id)=>request(`/admin/locations/${id}`, { method: 'DELETE' }); // ─── Admin Plans ─────────────────────────────────────────────────────────── export const getAdminPlans = ()=>request('/admin/plans'); export const createPlan = (data)=>request('/admin/plans', { method: 'POST', body: JSON.stringify(data) }); export const updatePlan = (id, data)=>request(`/admin/plans/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deletePlan = (id)=>request(`/admin/plans/${id}`, { method: 'DELETE' }); // ─── Admin Settings ──────────────────────────────────────────────────────── export const getAdminSettings = ()=>request('/admin/settings'); export const updateAdminSettings = (data)=>request('/admin/settings', { method: 'PUT', body: JSON.stringify(data) }); export const getAdminEmailTemplates = ()=>request('/admin/settings/templates'); export const updateAdminEmailTemplate = (key, data)=>request(`/admin/settings/templates/${key}`, { method: 'PUT', body: JSON.stringify(data) }); export const translateAdminEmailTemplate = (data)=>request('/admin/settings/templates/translate', { method: 'POST', body: JSON.stringify(data) }); export const sendTestEmail = ()=>request('/admin/settings/test-email', { method: 'POST' }); export const testTelegramConnection = (botToken, chatId)=>fetch(`${BASE}/api/admin/settings/test-telegram`, { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken, chatId }) }).then((r)=>r.json()); export const verifyTelegramToken = (botToken)=>fetch(`${BASE}/api/admin/settings/verify-telegram-token`, { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken }) }).then((r)=>r.json()); export const getTranslationsStats = ()=>request('/admin/translations/stats'); export const getTranslationsMissing = (table, missingLang, page = 1, limit = 50)=>request(`/admin/translations/${table}?missingLang=${missingLang}&page=${page}&limit=${limit}`); export const saveTranslations = (table, items)=>request(`/admin/translations/${table}/save`, { method: 'POST', body: JSON.stringify({ items }) }); export const autoTranslate = (table, missingLang, fromLang, batchSize = 500)=>request('/admin/translations/auto-translate', { method: 'POST', body: JSON.stringify({ table, missingLang, fromLang, batchSize }) }); export const autoTranslateTasks = (batchSize = 500)=>request('/admin/translations/auto-translate-tasks', { method: 'POST', body: JSON.stringify({ batchSize }) }); export const getTasksTranslationPreview = (lang, limit = 50)=>request(`/admin/translations/tasks-preview?lang=${lang}&limit=${limit}`); export const autoTranslateEmailTemplates = (missingLang, fromLang = 'el')=>request('/admin/translations/auto-translate-templates', { method: 'POST', body: JSON.stringify({ missingLang, fromLang }) }); // ─── Availability ────────────────────────────────────────────────────────── export const getMyAvailability = (month)=>request(`/availability/my${month ? `?month=${month}` : ''}`); export const setAvailability = (date, status, note)=>request('/availability/set', { method: 'POST', body: JSON.stringify({ date, status, note }) }); export const setAvailabilityRange = (from, to, status)=>request('/availability/set-range', { method: 'POST', body: JSON.stringify({ from, to, status }) }); export const getSpecialistAvailability = (userId, month)=>request(`/availability/user/${userId}${month ? `?month=${month}` : ''}`); export const getMyPortfolio = ()=>request('/portfolio/my'); export const addPortfolioItem = (formData)=>fetch(`${BASE}/api/portfolio`, { method: 'POST', credentials: 'include', body: formData }).then(async (res)=>{ if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); throw new Error(err.error || 'Upload failed'); } return res.json(); }); export const updatePortfolioItem = (id, data)=>request(`/portfolio/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deletePortfolioItem = (id)=>request(`/portfolio/${id}`, { method: 'DELETE' }); export const getSpecialistPortfolio = (userId)=>request(`/portfolio/user/${userId}`); export const getMySpecialistCards = ()=>request('/specialist-cards/my'); export const createSpecialistCard = (data)=>request('/specialist-cards', { method: 'POST', body: JSON.stringify(data) }); export const updateSpecialistCard = (id, data)=>request(`/specialist-cards/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const saveSiteSeo = (data)=>request('/users/me/site-seo', { method: 'POST', body: JSON.stringify(data) }); export const deleteSpecialistCard = (id)=>request(`/specialist-cards/${id}`, { method: 'DELETE' }); export const getSpecialistCards = (userId, locale)=>request(`/specialist-cards/user/${userId}${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); export const getPriceList = (cardId, locale)=>request(`/price-list/${cardId}${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); export const createPriceListGroup = (cardId, data)=>request(`/price-list/${cardId}/groups`, { method: 'POST', body: JSON.stringify(data) }); export const updatePriceListGroup = (groupId, data)=>request(`/price-list/groups/${groupId}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deletePriceListGroup = (groupId)=>request(`/price-list/groups/${groupId}`, { method: 'DELETE' }); export const createPriceListItem = (groupId, data)=>request(`/price-list/groups/${groupId}/items`, { method: 'POST', body: JSON.stringify(data) }); export const updatePriceListItem = (itemId, data)=>request(`/price-list/items/${itemId}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deletePriceListItem = (itemId)=>request(`/price-list/items/${itemId}`, { method: 'DELETE' }); export const getSkillSuggestions = (categorySlugs)=>{ const params = categorySlugs?.length ? '?' + categorySlugs.map((s)=>`category=${encodeURIComponent(s)}`).join('&') : ''; return request(`/skill-suggestions${params}`); }; export const initiateTopUp = (amount)=>request('/payments/topup/init', { method: 'POST', body: JSON.stringify({ amount }) }); export const getPaymentHistory = ()=>request('/payments/history'); export const getBalanceHistory = (limit = 50)=>request(`/payments/balance-history?limit=${limit}`); export const getPlanHistory = (limit = 50)=>request(`/users/me/plan-history?limit=${limit}`); export const getAdminBalanceHistory = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.userId) p.set('userId', params.userId); if (params.kind) p.set('kind', params.kind); p.set('limit', '50'); return request(`/admin/balance-history?${p}`); }; export const adminTopUpUserBalance = (id, data)=>request(`/admin/users/${id}/balance/topup`, { method: 'POST', body: JSON.stringify(data) }); export const adminWithdrawUserBalance = (id, data)=>request(`/admin/users/${id}/balance/withdraw`, { method: 'POST', body: JSON.stringify(data) }); export const previewPlanChange = (planId)=>request('/payments/plan/preview', { method: 'POST', body: JSON.stringify({ planId }) }); export const getPlans = (role)=>{ const qs = role ? `?role=${role}` : ''; return request(`/plans${qs}`); }; export const getMyDashboard = ()=>request('/dashboard/me'); export const getDailyUsage = ()=>request('/plans/daily-usage'); export const purchasePlan = (planId, payFromBalance = true)=>request('/payments/plan/purchase', { method: 'POST', body: JSON.stringify({ planId, payFromBalance }) }); // ─── Statuses ────────────────────────────────────────────────────────────── export const getMyStatuses = ()=>request('/statuses/me'); export const toggleStatus = (statusType, active)=>request('/statuses/toggle', { method: 'POST', body: JSON.stringify({ statusType, active }) }); export const getAutoResponseSettings = ()=>request('/auto-response'); export const updateAutoResponseSettings = (data)=>request('/auto-response', { method: 'PUT', body: JSON.stringify(data) }); // ─── FOMO ────────────────────────────────────────────────────────────────── export const getSpecialistFomoDashboard = ()=>request('/fomo/specialist'); export const getCustomerFomoDashboard = ()=>request('/fomo/customer'); export const getFomoRecommendations = ()=>request('/fomo/recommendations'); // ─── Auto-match ──────────────────────────────────────────────────────────── export const getAutoMatchResults = (taskId)=>request(`/auto-match/${taskId}`); export const runAutoMatch = (taskId)=>request(`/auto-match/${taskId}`, { method: 'POST' }); // ─── Google Calendar ─────────────────────────────────────────────────────── export const getGoogleCalendarStatus = ()=>request('/google/calendar/status'); export const disconnectGoogleCalendar = ()=>request('/google/calendar/disconnect', { method: 'DELETE' }); export const importFromGoogleCalendar = ()=>request('/google/calendar/import', { method: 'POST' }); export const getGoogleCalendarConnectUrl = ()=>`${BASE}/api/google/calendar/connect`; // ─── Personal site ───────────────────────────────────────────────────────── export const getPublicSiteProfile = (slug)=>request(`/users/site/${slug}`); export const getSiteStats = ()=>request('/users/me/site-stats'); export const trackSiteMessage = (slug)=>request(`/users/site/${slug}/track-message`, { method: 'POST' }).catch(()=>{}); // ─── Task stats (FOMO) ───────────────────────────────────────────────────── export const getTaskStats = (taskId)=>request(`/tasks/${taskId}/stats`); // ─── Support tickets ─────────────────────────────────────────────────────── export const sendPublicSupportMessage = (data)=>request('/support/public', { method: 'POST', body: JSON.stringify(data) }); export const createSupportTicket = (data)=>request('/support', { method: 'POST', body: JSON.stringify(data) }); export const getMySupportTickets = (page = 1)=>request(`/support/my?page=${page}`); export const getAdminSupportTickets = (params)=>request(`/support${params ? '?' + new URLSearchParams(params) : ''}`); export const replyToSupportTicket = (id, data)=>request(`/support/${id}/reply`, { method: 'PATCH', body: JSON.stringify(data) }); export const setSupportTicketStatus = (id, status)=>request(`/support/${id}/status`, { method: 'PATCH', body: JSON.stringify({ status }) });  164190 trueundefined2523090undefined312318undefined402428trueundefined10771083undefined12151221undefined13761382undefined14701476undefined15221528undefined16801686undefined17611767undefined18151821undefined19361942undefined20682074undefined21692175undefined23452351undefined24172423undefined24712477undefined25942600undefined26932699undefined27942800undefined29272933undefined30833089undefined32083214undefined32843290undefined34193425undefined34753481undefined35573563undefined36363642undefined37163722undefined39763982undefined41104116undefined41734179undefined42404246undefined43414347undefined44414447undefined45464552undefined47324738undefined48004806undefined50525058undefined51285134undefined52885294undefined54235429undefined55565562undefined56115617undefined57135719undefined58205826undefined58975903undefined60336039undefined63326338undefined64006406undefined65366542undefined66836689undefined68686874undefined69896995undefined71187124undefined72587264undefined73577363undefined75087514undefined77997805undefined78577863undefined81068112undefined82178223undefined83248330undefined84958501undefined85608566undefined86658671undefined88298835undefined90989104undefined92419247undefined93609366undefined96179623undefined97259731undefined98279833undefined1007910085undefined1026210268undefined1035310359undefined1080110807undefined1118611192undefined1157711583undefined1165311659undefined1172011726undefined1178611792undefined1194411950undefined1216712173undefined1223312239undefined1236812374undefined1251412520undefined1269812704undefined1275612762undefined1288312889undefined1302113027undefined1319713203undefined1326113267undefined1339913405undefined1347913485undefined1364413650undefined1381113817undefined1391513921undefined1426914275undefined1460014606undefined1467814684undefined1485614862undefined1504315049undefined1533115337undefined1553415540undefined1567015676undefined1600216008undefined1610616112undefined1631916325undefined1653916545undefined1667116677undefined1673116737undefined1715817164undefined1730317309undefined1740717413undefined1749317499undefined1756617572undefined1770817714undefined1786117867undefined1799518001undefined1810718113undefined1826018266undefined1839618402undefined1855718563undefined1872118727undefined1884418850undefined1901219018undefined1917219178undefined1929119297undefined1952419530undefined1969019696undefined1975719763undefined1985719863undefined1995119957undefined2028420290undefined2044620452undefined2061420620undefined2078620792undefined2090220908undefined2096220968undefined2102621032undefined2132421330undefined2138221388undefined2157921585undefined2164921655undefined2187221878undefined2194721953undefined2201822024undefined2217322179undefined2225222258undefined2243522441undefined2251422520undefined2263222638undefined2274422750undefined2290922915undefined2298522991undefined2305023056undefined2326123267undefined2341323419undefined2355723563undefined2368923695undefined2377323779undefined2389223898undefined2404224048undefined &webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceK__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ BecomeSpecialistPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13260); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(96484); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource0/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { request } from '@/lib/api'; export default function BecomeSpecialistPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t } = useLocale(); const [loading, setLoading] = useState(false); const [error, setError] = useState(''); async function handleBecome() { setLoading(true); setError(''); try { await request('/users/me/offer-help', { method: 'POST' }); router.push('/specialist-setup'); } catch { setError(t('common.error')); setLoading(false); } } if (isPending) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const steps = [ { n: 1, title: t('become_specialist.step1.title'), desc: t('become_specialist.step1.desc'), icon: '🗂️' }, { n: 2, title: t('become_specialist.step2.title'), desc: t('become_specialist.step2.desc'), icon: '🔍' }, { n: 3, title: t('become_specialist.step3.title'), desc: t('become_specialist.step3.desc'), icon: '💰' } ]; const benefits = [ { icon: '🎯', text: t('become_specialist.benefit1') }, { icon: '⭐', text: t('become_specialist.benefit2') }, { icon: '📅', text: t('become_specialist.benefit3') }, { icon: '❤️', text: t('become_specialist.benefit4') } ]; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("section", { className: "bg-gradient-to-br from-green-700 to-green-600 text-white py-20 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto text-center", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-4xl md:text-5xl font-bold mb-4", children: t('become_specialist.hero.title') }), /*#__PURE__*/ _jsx("p", { className: "text-xl text-green-100 mb-8", children: t('become_specialist.hero.subtitle') }) ] }) }), /*#__PURE__*/ _jsxs("section", { className: "max-w-4xl mx-auto px-4 py-16", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-white mb-10 text-center", children: t('become_specialist.how.title') }), /*#__PURE__*/ _jsx("div", { className: "grid md:grid-cols-3 gap-8", children: steps.map((step)=>/*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-14 h-14 bg-green-50 border-2 border-green-200 rounded-2xl flex items-center justify-center text-2xl mx-auto mb-4", children: step.icon }), /*#__PURE__*/ _jsx("div", { className: "w-7 h-7 bg-green-600 text-white rounded-full flex items-center justify-center text-sm font-bold mx-auto -mt-1 mb-3", children: step.n }), /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-white text-lg mb-2", children: step.title }), /*#__PURE__*/ _jsx("p", { className: "text-green-100 text-sm leading-relaxed", children: step.desc }) ] }, step.n)) }) ] }), /*#__PURE__*/ _jsx("section", { className: "bg-gray-50 py-14 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-8 text-center", children: t('become_specialist.benefits.title') }), /*#__PURE__*/ _jsx("div", { className: "grid sm:grid-cols-2 gap-4", children: benefits.map((b, i)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-4 bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl shrink-0", children: b.icon }), /*#__PURE__*/ _jsx("p", { className: "text-gray-700 font-medium leading-snug", children: b.text }) ] }, i)) }) ] }) }), /*#__PURE__*/ _jsx("section", { className: "py-16 px-4 text-center", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-md mx-auto", children: [ error && /*#__PURE__*/ _jsx("p", { className: "text-red-500 text-sm mb-4", children: error }), session ? /*#__PURE__*/ _jsx("button", { onClick: handleBecome, disabled: loading, className: "w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 disabled:opacity-60 transition", children: loading ? t('common.loading') : t('profile.become_specialist') }) : /*#__PURE__*/ _jsx("a", { href: "/register", className: "block w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 transition text-center", children: t('profile.become_specialist') }) ] }) }) ] }); } c'={}_!#FHV@G)-fi  _ |    *-wz*-!$J*-*-(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)K__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ BecomeSpecialistPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13260); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(96484); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); 0/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { request } from '@/lib/api'; export default function BecomeSpecialistPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t } = useLocale(); const [loading, setLoading] = useState(false); const [error, setError] = useState(''); async function handleBecome() { setLoading(true); setError(''); try { await request('/users/me/offer-help', { method: 'POST' }); router.push('/specialist-setup'); } catch { setError(t('common.error')); setLoading(false); } } if (isPending) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const steps = [ { n: 1, title: t('become_specialist.step1.title'), desc: t('become_specialist.step1.desc'), icon: '🗂️' }, { n: 2, title: t('become_specialist.step2.title'), desc: t('become_specialist.step2.desc'), icon: '🔍' }, { n: 3, title: t('become_specialist.step3.title'), desc: t('become_specialist.step3.desc'), icon: '💰' } ]; const benefits = [ { icon: '🎯', text: t('become_specialist.benefit1') }, { icon: '⭐', text: t('become_specialist.benefit2') }, { icon: '📅', text: t('become_specialist.benefit3') }, { icon: '❤️', text: t('become_specialist.benefit4') } ]; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("section", { className: "bg-gradient-to-br from-green-700 to-green-600 text-white py-20 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto text-center", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-4xl md:text-5xl font-bold mb-4", children: t('become_specialist.hero.title') }), /*#__PURE__*/ _jsx("p", { className: "text-xl text-green-100 mb-8", children: t('become_specialist.hero.subtitle') }) ] }) }), /*#__PURE__*/ _jsxs("section", { className: "max-w-4xl mx-auto px-4 py-16", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-white mb-10 text-center", children: t('become_specialist.how.title') }), /*#__PURE__*/ _jsx("div", { className: "grid md:grid-cols-3 gap-8", children: steps.map((step)=>/*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-14 h-14 bg-green-50 border-2 border-green-200 rounded-2xl flex items-center justify-center text-2xl mx-auto mb-4", children: step.icon }), /*#__PURE__*/ _jsx("div", { className: "w-7 h-7 bg-green-600 text-white rounded-full flex items-center justify-center text-sm font-bold mx-auto -mt-1 mb-3", children: step.n }), /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-white text-lg mb-2", children: step.title }), /*#__PURE__*/ _jsx("p", { className: "text-green-100 text-sm leading-relaxed", children: step.desc }) ] }, step.n)) }) ] }), /*#__PURE__*/ _jsx("section", { className: "bg-gray-50 py-14 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-8 text-center", children: t('become_specialist.benefits.title') }), /*#__PURE__*/ _jsx("div", { className: "grid sm:grid-cols-2 gap-4", children: benefits.map((b, i)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-4 bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl shrink-0", children: b.icon }), /*#__PURE__*/ _jsx("p", { className: "text-gray-700 font-medium leading-snug", children: b.text }) ] }, i)) }) ] }) }), /*#__PURE__*/ _jsx("section", { className: "py-16 px-4 text-center", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-md mx-auto", children: [ error && /*#__PURE__*/ _jsx("p", { className: "text-red-500 text-sm mb-4", children: error }), session ? /*#__PURE__*/ _jsx("button", { onClick: handleBecome, disabled: loading, className: "w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 disabled:opacity-60 transition", children: loading ? t('common.loading') : t('profile.become_specialist') }) : /*#__PURE__*/ _jsx("a", { href: "/register", className: "block w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 transition text-center", children: t('profile.become_specialist') }) ] }) }) ] }); } R 61123undefined125157undefined159202undefined204243undefined245289undefined291326undefined328342undefined418427(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)undefined451459(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined482490(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined529536(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined576583(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined706712(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)undefined990993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined20892093(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined21502153(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23062310(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined24552458(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined26842687(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined29512955(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined30913094(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined33153318(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34593463(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined36263629(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined39593962(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42894292(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined45454548(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49064909(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined50165020(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined51535156(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54005403(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined55555559(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined57925795(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined60426045(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined64426445(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined65536557(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined66986701(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined68986901(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined73197322(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined Y-webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ DeleteAccountPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13260); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource$/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import { useSession } from '@/lib/auth'; import { createSupportTicket } from '@/lib/api'; export default function DeleteAccountPage() { const { t } = useLocale(); const { data: session } = useSession(); const [reason, setReason] = useState(''); const [confirmed, setConfirmed] = useState(false); const [submitting, setSubmitting] = useState(false); const [done, setDone] = useState(false); const [error, setError] = useState(null); const handleSubmit = async (e)=>{ e.preventDefault(); if (!confirmed || submitting) return; setSubmitting(true); setError(null); try { await createSupportTicket({ type: 'delete_account', subject: 'Account deletion request', body: reason.trim() || 'No reason provided.' }); setDone(true); } catch (err) { setError(err?.message ?? 'Error'); } finally{ setSubmitting(false); } }; return /*#__PURE__*/ _jsx("main", { className: "py-12 px-4 sm:px-6", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-lg mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10", children: [ /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs(Link, { href: "/", className: "text-sm text-green-600 hover:underline", children: [ "← ", t('nav.home') ] }) }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-extrabold text-gray-900 mb-2", children: t('delete_account.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-8", children: t('delete_account.subtitle') }), done ? /*#__PURE__*/ _jsxs("div", { className: "rounded-xl bg-green-50 border border-green-200 p-6 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex items-center justify-center mx-auto mb-4", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-green-800 mb-1", children: t('delete_account.success_title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-green-700", children: t('delete_account.success_body') }) ] }) : !session?.user ? /*#__PURE__*/ _jsxs("div", { className: "rounded-xl bg-amber-50 border border-amber-200 p-6 text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-amber-800 mb-4", children: t('delete_account.login_required') }), /*#__PURE__*/ _jsx(Link, { href: "/login", className: "inline-flex items-center gap-2 px-5 py-2.5 bg-green-600 hover:bg-green-700 text-white text-sm font-semibold rounded-xl transition", children: t('delete_account.login_btn') }) ] }) : /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 rounded-xl bg-red-50 border border-red-200 p-4", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-red-500 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-700", children: t('delete_account.warning') }) ] }), /*#__PURE__*/ _jsx("div", { className: "rounded-xl bg-gray-50 border border-gray-200 px-4 py-3 text-sm text-gray-700", children: /*#__PURE__*/ _jsx("span", { className: "font-medium", children: session.user.email }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: t('delete_account.reason_label') }), /*#__PURE__*/ _jsx("textarea", { value: reason, onChange: (e)=>setReason(e.target.value), placeholder: t('delete_account.reason_placeholder'), rows: 4, maxLength: 2000, className: "w-full rounded-xl border border-gray-200 px-4 py-3 text-sm text-gray-800 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-green-500 resize-none" }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-start gap-3 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: confirmed, onChange: (e)=>setConfirmed(e.target.checked), className: "mt-0.5 w-4 h-4 rounded border-gray-300 text-red-600 focus:ring-red-500 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('delete_account.confirm_label') }) ] }), error && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600", children: error }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: !confirmed || submitting, className: "w-full py-3 rounded-xl bg-red-600 hover:bg-red-700 disabled:opacity-40 disabled:cursor-not-allowed text-white font-semibold text-sm transition", children: submitting ? t('delete_account.submitting') : t('delete_account.submit') }) ] }) ] }) }); } c/={}_CESKRx|UY_ptvyB F  Q T >A7;GKZ;> dg ;!>!!!(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSupportTicket */ .mq)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(next_link__WEBPACK_IMPORTED_MODULE_2___default())__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ DeleteAccountPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13260); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); $/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import { useSession } from '@/lib/auth'; import { createSupportTicket } from '@/lib/api'; export default function DeleteAccountPage() { const { t } = useLocale(); const { data: session } = useSession(); const [reason, setReason] = useState(''); const [confirmed, setConfirmed] = useState(false); const [submitting, setSubmitting] = useState(false); const [done, setDone] = useState(false); const [error, setError] = useState(null); const handleSubmit = async (e)=>{ e.preventDefault(); if (!confirmed || submitting) return; setSubmitting(true); setError(null); try { await createSupportTicket({ type: 'delete_account', subject: 'Account deletion request', body: reason.trim() || 'No reason provided.' }); setDone(true); } catch (err) { setError(err?.message ?? 'Error'); } finally{ setSubmitting(false); } }; return /*#__PURE__*/ _jsx("main", { className: "py-12 px-4 sm:px-6", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-lg mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10", children: [ /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs(Link, { href: "/", className: "text-sm text-green-600 hover:underline", children: [ "← ", t('nav.home') ] }) }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-extrabold text-gray-900 mb-2", children: t('delete_account.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-8", children: t('delete_account.subtitle') }), done ? /*#__PURE__*/ _jsxs("div", { className: "rounded-xl bg-green-50 border border-green-200 p-6 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex items-center justify-center mx-auto mb-4", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-green-800 mb-1", children: t('delete_account.success_title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-green-700", children: t('delete_account.success_body') }) ] }) : !session?.user ? /*#__PURE__*/ _jsxs("div", { className: "rounded-xl bg-amber-50 border border-amber-200 p-6 text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-amber-800 mb-4", children: t('delete_account.login_required') }), /*#__PURE__*/ _jsx(Link, { href: "/login", className: "inline-flex items-center gap-2 px-5 py-2.5 bg-green-600 hover:bg-green-700 text-white text-sm font-semibold rounded-xl transition", children: t('delete_account.login_btn') }) ] }) : /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 rounded-xl bg-red-50 border border-red-200 p-4", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-red-500 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-700", children: t('delete_account.warning') }) ] }), /*#__PURE__*/ _jsx("div", { className: "rounded-xl bg-gray-50 border border-gray-200 px-4 py-3 text-sm text-gray-700", children: /*#__PURE__*/ _jsx("span", { className: "font-medium", children: session.user.email }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: t('delete_account.reason_label') }), /*#__PURE__*/ _jsx("textarea", { value: reason, onChange: (e)=>setReason(e.target.value), placeholder: t('delete_account.reason_placeholder'), rows: 4, maxLength: 2000, className: "w-full rounded-xl border border-gray-200 px-4 py-3 text-sm text-gray-800 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-green-500 resize-none" }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-start gap-3 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: confirmed, onChange: (e)=>setConfirmed(e.target.checked), className: "mt-0.5 w-4 h-4 rounded border-gray-300 text-red-600 focus:ring-red-500 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('delete_account.confirm_label') }) ] }), error && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600", children: error }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: !confirmed || submitting, className: "w-full py-3 rounded-xl bg-red-600 hover:bg-red-700 disabled:opacity-40 disabled:cursor-not-allowed text-white font-semibold text-sm transition", children: submitting ? t('delete_account.submitting') : t('delete_account.submit') }) ] }) ] }) }); } t 61123undefined125157undefined159187undefined189233undefined235274undefined276323undefined325339undefined389397(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined432441(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined478485(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined530537(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined587594(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined632639(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined679686(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined892910(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSupportTicket */ .mq)undefined12771280(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined13651369(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined15511554(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined16481652(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined16541657(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined19851988(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined21812184(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23702374(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined25522555(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined27422745(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined30853088(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34093412(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined36463649(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined38953899(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined40774080(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42984301(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43034306(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined46794683(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined48534857(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined50545057(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54355438(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined58445847(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined61326135(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined63176320(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined65486552(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined66496652(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined69236926(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined75977601(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined77807783(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined82008203(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined85078510(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined86928695(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ FavoritesPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(71159); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13260); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(96484); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(91864); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(48178); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource'/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getSpecialistFavorites, removeSpecialistFavorite } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; export default function FavoritesPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t } = useLocale(); const [favorites, setFavorites] = useState([]); const [loading, setLoading] = useState(true); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isPending && !session) { router.push('/login'); return; } if (!session) return; getSpecialistFavorites().then(setFavorites).catch(()=>{}).finally(()=>setLoading(false)); }, [ session, isPending ]); async function handleRemove(specialistId) { await removeSpecialistFavorite(specialistId).catch(()=>{}); setFavorites((prev)=>prev.filter((r)=>r.specialist?.id !== specialistId)); } if (isPending || loading) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } return /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white mb-6", children: t('favorites.specialists.title') }), favorites.length === 0 ? /*#__PURE__*/ _jsxs("div", { className: "text-center py-20 text-white/70", children: [ /*#__PURE__*/ _jsx("p", { className: "text-4xl mb-4", children: "\uD83E\uDD0D" }), /*#__PURE__*/ _jsx("p", { className: "text-lg", children: t('favorites.specialists.empty') }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: "mt-4 inline-block text-white hover:text-white/80 text-sm", children: [ t('specialists.view'), " →" ] }) ] }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: favorites.map((row)=>{ const u = row.specialist; if (!u) return null; const name = formatShortName(u.firstName, u.lastName, u.name); const initials = `${u.firstName?.[0] ?? ''}${u.lastName?.[0] ?? ''}`.toUpperCase() || u.name?.[0]?.toUpperCase() || '?'; return /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4 bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm transition", children: [ /*#__PURE__*/ _jsxs(Link, { href: `/users/${u.id}`, className: "flex items-center gap-3 flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: u.image ? /*#__PURE__*/ _jsx("img", { src: u.image, alt: name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 truncate", children: name }), u.bio && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 line-clamp-1", children: u.bio }) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>handleRemove(u.id), title: t('specialist.unfavorite'), className: "flex-shrink-0 w-8 h-8 flex items-center justify-center text-pink-400 hover:text-pink-600 hover:bg-pink-50 rounded-full transition", children: "❤️" }) ] }, row.id); }) }) ] }); } c$={}_JL!*BJai t@_CJMLO  x { W e ? C $ ( * -  FIdDg!(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getSpecialistFavorites */ .pD)(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .removeSpecialistFavorite */ .sD)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(next_link__WEBPACK_IMPORTED_MODULE_2___default())(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_7__/* .formatShortName */ .H)__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ FavoritesPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(71159); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13260); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(96484); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(91864); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(48178); '/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getSpecialistFavorites, removeSpecialistFavorite } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; export default function FavoritesPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t } = useLocale(); const [favorites, setFavorites] = useState([]); const [loading, setLoading] = useState(true); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isPending && !session) { router.push('/login'); return; } if (!session) return; getSpecialistFavorites().then(setFavorites).catch(()=>{}).finally(()=>setLoading(false)); }, [ session, isPending ]); async function handleRemove(specialistId) { await removeSpecialistFavorite(specialistId).catch(()=>{}); setFavorites((prev)=>prev.filter((r)=>r.specialist?.id !== specialistId)); } if (isPending || loading) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } return /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white mb-6", children: t('favorites.specialists.title') }), favorites.length === 0 ? /*#__PURE__*/ _jsxs("div", { className: "text-center py-20 text-white/70", children: [ /*#__PURE__*/ _jsx("p", { className: "text-4xl mb-4", children: "\uD83E\uDD0D" }), /*#__PURE__*/ _jsx("p", { className: "text-lg", children: t('favorites.specialists.empty') }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: "mt-4 inline-block text-white hover:text-white/80 text-sm", children: [ t('specialists.view'), " →" ] }) ] }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: favorites.map((row)=>{ const u = row.specialist; if (!u) return null; const name = formatShortName(u.firstName, u.lastName, u.name); const initials = `${u.firstName?.[0] ?? ''}${u.lastName?.[0] ?? ''}`.toUpperCase() || u.name?.[0]?.toUpperCase() || '?'; return /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4 bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm transition", children: [ /*#__PURE__*/ _jsxs(Link, { href: `/users/${u.id}`, className: "flex items-center gap-3 flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: u.image ? /*#__PURE__*/ _jsx("img", { src: u.image, alt: name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 truncate", children: name }), u.bio && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 line-clamp-1", children: u.bio }) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>handleRemove(u.id), title: t('specialist.unfavorite'), className: "flex-shrink-0 w-8 h-8 flex items-center justify-center text-pink-400 hover:text-pink-600 hover:bg-pink-50 rounded-full transition", children: "❤️" }) ] }, row.id); }) }) ] }); } 661123undefined125168undefined170198undefined200243undefined245284undefined286330undefined332408undefined410460undefined462476undefined545554(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined578586(0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)undefined609617(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)undefined660667(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined708715(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined779787(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined936957(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getSpecialistFavorites */ .pD)undefined11401163(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .removeSpecialistFavorite */ .sD)undefined13441347(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined14981502(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined16101613(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined18141818(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined19531956(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined21242127(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23072311(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined23132316(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined26802683(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined29032917(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_7__/* .formatShortName */ .H)undefined31353139(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined33643368(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined33703373(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined36133616(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined39103913(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42654269(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined44524455(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined47414744(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined51505153(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined z'webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PaymentPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(96484); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; import { useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; // Status is determined either by: // 1. ?status=cancelled (from our cancel redirect) // 2. ?ref=ORDER_REF → we poll /payments/history to check the order status export default function PaymentPage() { const searchParams = useSearchParams(); const { t } = useLocale(); const statusParam = searchParams.get('status'); const ref = searchParams.get('ref'); const [status, setStatus] = useState(statusParam === 'cancelled' ? 'cancelled' : ref ? 'loading' : 'pending'); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (statusParam === 'cancelled') { setStatus('cancelled'); return; } if (!ref) return; // Poll payment history to find the order status let attempts = 0; const MAX = 12 // ~24 seconds total ; const INTERVAL = 2000; const check = async ()=>{ attempts++; try { const history = await api.getPaymentHistory(); const payment = history.find((p)=>p.orderRef === ref); if (payment && payment.status !== 'pending') { setStatus(payment.status); return; } } catch {} if (attempts < MAX) { setTimeout(check, INTERVAL); } else { setStatus('pending'); // timeout - show pending message } }; setTimeout(check, INTERVAL); }, [ ref, statusParam ]); const config = { success: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-green-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), title: t('payment.success.title'), desc: t('payment.success.desc'), color: 'text-green-700', bg: 'bg-green-50', border: 'border-green-200' }, cancelled: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-yellow-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z" }) }), title: t('payment.cancelled.title'), desc: t('payment.cancelled.desc'), color: 'text-yellow-700', bg: 'bg-yellow-50', border: 'border-yellow-200' }, failed: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-red-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" }) }), title: t('payment.cancelled.title'), desc: t('payment.cancelled.desc'), color: 'text-red-700', bg: 'bg-red-50', border: 'border-red-200' }, pending: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z" }) }), title: t('payment.pending.title'), desc: t('payment.pending.desc'), color: 'text-green-700', bg: 'bg-green-50', border: 'border-green-200' }, loading: { icon: /*#__PURE__*/ _jsxs("svg", { className: "w-16 h-16 text-gray-400 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), title: t('payment.pending.title'), desc: t('payment.pending.desc'), color: 'text-gray-700', bg: 'bg-gray-50', border: 'border-gray-200' } }; const current = config[status] ?? config.pending; return /*#__PURE__*/ _jsx("div", { className: "min-h-screen bg-gray-50 flex items-center justify-center p-4", children: /*#__PURE__*/ _jsxs("div", { className: `bg-white rounded-2xl border ${current.border} shadow-sm p-10 max-w-sm w-full text-center`, children: [ /*#__PURE__*/ _jsx("div", { className: "flex justify-center mb-5", children: current.icon }), /*#__PURE__*/ _jsx("h1", { className: `text-2xl font-bold mb-2 ${current.color}`, children: current.title }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-8", children: current.desc }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: "inline-flex items-center gap-2 px-6 py-3 bg-green-600 hover:bg-green-700 text-white font-semibold rounded-xl transition-colors text-sm", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 19l-7-7m0 0l7-7m-7 7h18" }) }), t('payment.back_to_profile') ] }) ] }) }); } c ={}_')I-;RZfn+q t m p e h ^\a[^qt'* #(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPaymentHistory */ .pK(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(next_link__WEBPACK_IMPORTED_MODULE_3___default())__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PaymentPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(96484); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); /* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; import { useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; // Status is determined either by: // 1. ?status=cancelled (from our cancel redirect) // 2. ?ref=ORDER_REF → we poll /payments/history to check the order status export default function PaymentPage() { const searchParams = useSearchParams(); const { t } = useLocale(); const statusParam = searchParams.get('status'); const ref = searchParams.get('ref'); const [status, setStatus] = useState(statusParam === 'cancelled' ? 'cancelled' : ref ? 'loading' : 'pending'); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (statusParam === 'cancelled') { setStatus('cancelled'); return; } if (!ref) return; // Poll payment history to find the order status let attempts = 0; const MAX = 12 // ~24 seconds total ; const INTERVAL = 2000; const check = async ()=>{ attempts++; try { const history = await api.getPaymentHistory(); const payment = history.find((p)=>p.orderRef === ref); if (payment && payment.status !== 'pending') { setStatus(payment.status); return; } } catch {} if (attempts < MAX) { setTimeout(check, INTERVAL); } else { setStatus('pending'); // timeout - show pending message } }; setTimeout(check, INTERVAL); }, [ ref, statusParam ]); const config = { success: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-green-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), title: t('payment.success.title'), desc: t('payment.success.desc'), color: 'text-green-700', bg: 'bg-green-50', border: 'border-green-200' }, cancelled: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-yellow-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z" }) }), title: t('payment.cancelled.title'), desc: t('payment.cancelled.desc'), color: 'text-yellow-700', bg: 'bg-yellow-50', border: 'border-yellow-200' }, failed: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-red-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" }) }), title: t('payment.cancelled.title'), desc: t('payment.cancelled.desc'), color: 'text-red-700', bg: 'bg-red-50', border: 'border-red-200' }, pending: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z" }) }), title: t('payment.pending.title'), desc: t('payment.pending.desc'), color: 'text-green-700', bg: 'bg-green-50', border: 'border-green-200' }, loading: { icon: /*#__PURE__*/ _jsxs("svg", { className: "w-16 h-16 text-gray-400 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), title: t('payment.pending.title'), desc: t('payment.pending.desc'), color: 'text-gray-700', bg: 'bg-gray-50', border: 'border-gray-200' } }; const current = config[status] ?? config.pending; return /*#__PURE__*/ _jsx("div", { className: "min-h-screen bg-gray-50 flex items-center justify-center p-4", children: /*#__PURE__*/ _jsxs("div", { className: `bg-white rounded-2xl border ${current.border} shadow-sm p-10 max-w-sm w-full text-center`, children: [ /*#__PURE__*/ _jsx("div", { className: "flex justify-center mb-5", children: current.icon }), /*#__PURE__*/ _jsx("h1", { className: `text-2xl font-bold mb-2 ${current.color}`, children: current.title }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-8", children: current.desc }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: "inline-flex items-center gap-2 px-6 py-3 bg-green-600 hover:bg-green-700 text-white font-semibold rounded-xl transition-colors text-sm", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 19l-7-7m0 0l7-7m-7 7h18" }) }), t('payment.back_to_profile') ] }) ] }) }); } c61123undefined125168undefined170219undefined221249undefined251295undefined297329undefined492506undefined557571(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)undefined594602(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined732739(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined870878(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined13031323_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPaymentHistory */ .pKundefined19351938(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined21862189(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined26732676(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined29252928(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34293432(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined36783681(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42784281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined45284531(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49995003(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined52115214(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined55255528(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined60346037(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined61636167(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined63476350(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined65136516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined66956698(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined68616865(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined68676870(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined71527155(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined74567459(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined ΋webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceC__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SchedulePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13260); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(96484); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource~/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect, useCallback } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getMyAvailability, setAvailability, setAvailabilityRange, request } from '@/lib/api'; const STATUS_CYCLE = { available: 'busy', busy: null }; const WEEK_DAYS_BY_LOCALE = { ru: [ 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс' ], en: [ 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su' ], el: [ 'Δε', 'Τρ', 'Τε', 'Πε', 'Πα', 'Σά', 'Κυ' ] }; const MONTHS_BY_LOCALE = { ru: [ 'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь' ], en: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], el: [ 'Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος' ] }; function toMonthKey(year, month) { return `${year}-${String(month + 1).padStart(2, '0')}`; } function toDateKey(year, month, day) { return `${year}-${String(month + 1).padStart(2, '0')}-${String(day).padStart(2, '0')}`; } export default function SchedulePage() { const { data: session, isPending } = useSession(); const router = useRouter(); const searchParams = useSearchParams(); const { locale, t } = useLocale(); const now = new Date(); const [viewYear, setViewYear] = useState(now.getFullYear()); const [viewMonth, setViewMonth] = useState(now.getMonth()); // availability map: 'YYYY-MM-DD' → 'available'|'busy' const [avail, setAvail] = useState({}); const [saving, setSaving] = useState(null) // date being saved ; // Range selection state const [rangeStart, setRangeStart] = useState(null); const [rangeMode, setRangeMode] = useState(false); const [rangeStatus, setRangeStatus] = useState('available'); // Google Calendar state const [gcalStatus, setGcalStatus] = useState(null); const [gcalLoading, setGcalLoading] = useState(false); const [gcalToast, setGcalToast] = useState(null); const today = new Date().toISOString().slice(0, 10); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isPending && !session) router.push('/login'); if (!isPending && session && session.user?.role !== 'specialist' && session.user?.role !== 'admin') router.push('/profile'); }, [ session, isPending ]); // Load Google Calendar status const loadGcalStatus = useCallback(()=>{ request('/google/calendar/status').then(setGcalStatus).catch(()=>setGcalStatus({ connected: false })); }, []); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!session) return; loadGcalStatus(); // Handle callback redirect params const gcalParam = searchParams.get('gcal'); if (gcalParam === 'connected') { setGcalToast(t('schedule.gcalConnected')); setTimeout(()=>setGcalToast(null), 5000); router.replace('/schedule'); } else if (gcalParam === 'error') { setGcalToast(t('schedule.gcalError')); setTimeout(()=>setGcalToast(null), 5000); router.replace('/schedule'); } }, [ session ]); const loadMonth = useCallback((year, month)=>{ const key = toMonthKey(year, month); getMyAvailability(key).then((rows)=>{ setAvail((prev)=>{ const next = { ...prev }; rows.forEach((r)=>{ next[r.date] = r.status; }); return next; }); }).catch(()=>{}); }, []); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!session) return; loadMonth(viewYear, viewMonth); // preload next month too const next = new Date(viewYear, viewMonth + 1, 1); loadMonth(next.getFullYear(), next.getMonth()); }, [ session, viewYear, viewMonth, loadMonth ]); function prevMonth() { if (viewMonth === 0) { setViewYear((y)=>y - 1); setViewMonth(11); } else setViewMonth((m)=>m - 1); } function nextMonth() { if (viewMonth === 11) { setViewYear((y)=>y + 1); setViewMonth(0); } else setViewMonth((m)=>m + 1); } async function toggleDay(dateKey) { if (dateKey < today) return; // past — ignore if (rangeMode) { if (!rangeStart) { setRangeStart(dateKey); return; } // Second click — apply range const from = rangeStart < dateKey ? rangeStart : dateKey; const to = rangeStart < dateKey ? dateKey : rangeStart; setRangeStart(null); setSaving('range'); try { await setAvailabilityRange(from, to, rangeStatus); // Update local state setAvail((prev)=>{ const next = { ...prev }; const cur = new Date(from); const end = new Date(to); while(cur <= end){ const d = cur.toISOString().slice(0, 10); if (d >= today) next[d] = rangeStatus; cur.setDate(cur.getDate() + 1); } return next; }); } catch {} setSaving(null); return; } const current = avail[dateKey] ?? null; const next = current === null ? 'available' : STATUS_CYCLE[current]; setSaving(dateKey); // Optimistic setAvail((prev)=>({ ...prev, [dateKey]: next })); try { await setAvailability(dateKey, next); } catch { // Revert on error setAvail((prev)=>({ ...prev, [dateKey]: current })); } setSaving(null); } if (isPending) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-gray-500", children: t('common.loading') }); const role = session?.user?.role; if (!session || role !== 'specialist' && role !== 'admin') return null; const apiBase = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; async function connectGcal() { window.location.href = `${apiBase}/api/google/calendar/connect`; } async function disconnectGcal() { if (!confirm(t('schedule.gcalDisconnectConfirm'))) return; setGcalLoading(true); try { await request('/google/calendar/disconnect', { method: 'DELETE' }); setGcalStatus({ connected: false }); } catch {} setGcalLoading(false); } async function importFromGcal() { setGcalLoading(true); try { const res = await request('/google/calendar/import', { method: 'POST' }); setGcalToast(t('schedule.gcalImportDone').replace('{n}', String(res.imported ?? 0))); setTimeout(()=>setGcalToast(null), 5000); // Refresh calendar display loadMonth(viewYear, viewMonth); } catch {} setGcalLoading(false); } return /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ gcalToast && /*#__PURE__*/ _jsx("div", { className: "fixed top-4 right-4 z-50 bg-white border border-gray-200 shadow-lg rounded-xl px-4 py-3 text-sm text-gray-800 max-w-xs", children: gcalToast }), /*#__PURE__*/ _jsxs("div", { className: "mb-8", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white", children: t('schedule.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-white/70 mt-1", children: t('schedule.subtitle') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-4 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-emerald-100 border-2 border-emerald-400 flex items-center justify-center text-xs", children: "✓" }), t('schedule.available') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-red-100 border-2 border-red-400 flex items-center justify-center text-xs", children: "✗" }), t('schedule.busy') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-white/20 border border-white/30" }), t('schedule.unset') ] }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-white/50 self-center", children: t('schedule.click_hint') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6 p-3 bg-white rounded-xl border border-gray-200", children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ _jsx("div", { onClick: ()=>{ setRangeMode((v)=>!v); setRangeStart(null); }, className: `w-10 h-6 rounded-full transition-colors relative cursor-pointer ${rangeMode ? 'bg-green-500' : 'bg-gray-200'}`, children: /*#__PURE__*/ _jsx("span", { className: `absolute top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ${rangeMode ? 'translate-x-5' : 'translate-x-1'}` }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-700", children: t('schedule.range_mode') }) ] }), rangeMode && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 ml-4", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>setRangeStatus('available'), className: `px-3 py-1 rounded-lg text-sm font-medium border transition ${rangeStatus === 'available' ? 'bg-emerald-100 border-emerald-400 text-emerald-700' : 'bg-white border-gray-200 text-gray-500'}`, children: t('schedule.available') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setRangeStatus('busy'), className: `px-3 py-1 rounded-lg text-sm font-medium border transition ${rangeStatus === 'busy' ? 'bg-red-100 border-red-400 text-red-700' : 'bg-white border-gray-200 text-gray-500'}`, children: t('schedule.busy') }), rangeStart && /*#__PURE__*/ _jsx("span", { className: "text-xs text-green-600", children: t('schedule.range_from').replace('{date}', rangeStart) }) ] }) ] }), /*#__PURE__*/ _jsx(AvailCalendar, { year: viewYear, month: viewMonth, avail: avail, saving: saving, rangeStart: rangeStart, today: today, onToggle: toggleDay, onPrev: prevMonth, onNext: nextMonth }), /*#__PURE__*/ _jsxs("div", { className: "mt-6 bg-white rounded-2xl border border-gray-200 p-5 shadow-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-4", children: [ /*#__PURE__*/ _jsxs("svg", { width: "22", height: "22", viewBox: "0 0 48 48", fill: "none", children: [ /*#__PURE__*/ _jsx("rect", { width: "48", height: "48", rx: "8", fill: "#fff" }), /*#__PURE__*/ _jsx("path", { d: "M34 14H14a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V16a2 2 0 0 0-2-2z", fill: "#4285F4" }), /*#__PURE__*/ _jsx("path", { d: "M28 20h-8v2h8v-2zm0 4h-8v2h8v-2zm-2 4h-6v2h6v-2z", fill: "#fff" }), /*#__PURE__*/ _jsx("circle", { cx: "18", cy: "18", r: "2", fill: "#DB4437" }), /*#__PURE__*/ _jsx("circle", { cx: "30", cy: "18", r: "2", fill: "#DB4437" }), /*#__PURE__*/ _jsx("rect", { x: "17", y: "12", width: "2", height: "6", rx: "1", fill: "#DB4437" }), /*#__PURE__*/ _jsx("rect", { x: "29", y: "12", width: "2", height: "6", rx: "1", fill: "#DB4437" }) ] }), /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 text-sm", children: t('schedule.googleCalendar') }) ] }), gcalStatus === null ? /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('common.loading') }) : gcalStatus.connected ? /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [ /*#__PURE__*/ _jsx("circle", { cx: "8", cy: "8", r: "8", fill: "#22c55e" }), /*#__PURE__*/ _jsx("path", { d: "M5 8l2 2 4-4", stroke: "#fff", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }), /*#__PURE__*/ _jsxs("span", { className: "text-sm text-gray-700", children: [ t('schedule.connectedAs'), " ", /*#__PURE__*/ _jsx("span", { className: "font-medium", children: gcalStatus.email }) ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('schedule.gcalAutoSyncNote') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: importFromGcal, disabled: gcalLoading, className: "px-3 py-1.5 rounded-lg border border-green-200 bg-green-50 text-green-700 text-xs font-medium hover:bg-green-100 disabled:opacity-50 transition", children: gcalLoading ? t('common.loading') : t('schedule.importFromGoogle') }), /*#__PURE__*/ _jsx("button", { onClick: disconnectGcal, disabled: gcalLoading, className: "px-3 py-1.5 rounded-lg border border-gray-200 bg-white text-gray-500 text-xs font-medium hover:bg-gray-50 disabled:opacity-50 transition", children: t('schedule.disconnectGoogle') }) ] }) ] }) : /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('schedule.gcalConnectDesc') }), /*#__PURE__*/ _jsxs("button", { onClick: connectGcal, className: "flex items-center gap-2 px-4 py-2 rounded-xl border border-gray-200 bg-white hover:bg-gray-50 transition text-sm font-medium text-gray-700", children: [ /*#__PURE__*/ _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 48 48", fill: "none", children: [ /*#__PURE__*/ _jsx("path", { d: "M44.5 20H24v8.5h11.8C34.7 33.9 30.1 37 24 37c-7.2 0-13-5.8-13-13s5.8-13 13-13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 11.8 2 2 11.8 2 24s9.8 22 22 22c11 0 21-8 21-22 0-1.3-.2-2.7-.5-4z", fill: "#FFC107" }), /*#__PURE__*/ _jsx("path", { d: "M6.3 14.7l7 5.1C15 16.1 19.1 13 24 13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 16.3 2 9.7 7.4 6.3 14.7z", fill: "#FF3D00" }), /*#__PURE__*/ _jsx("path", { d: "M24 46c5.5 0 10.5-1.9 14.4-5.1l-6.7-5.5C29.5 37 26.9 38 24 38c-6.1 0-11.2-4-13-9.5l-7 5.4C7.6 41.9 15.2 46 24 46z", fill: "#4CAF50" }), /*#__PURE__*/ _jsx("path", { d: "M44.5 20H24v8.5h11.8c-.9 2.8-2.8 5.1-5.3 6.6l6.7 5.5C41.5 37.3 45 31.1 45 24c0-1.3-.2-2.7-.5-4z", fill: "#1976D2" }) ] }), t('schedule.connectGoogle') ] }) ] }) ] }) ] }); } function AvailCalendar({ year, month, avail, saving, rangeStart, today, onToggle, onPrev, onNext }) { const { locale, t } = useLocale(); const weekDays = WEEK_DAYS_BY_LOCALE[locale] ?? WEEK_DAYS_BY_LOCALE.ru; const months = MONTHS_BY_LOCALE[locale] ?? MONTHS_BY_LOCALE.ru; const firstDay = new Date(year, month, 1); // Monday-based: 0=Mon, 6=Sun const startDow = (firstDay.getDay() + 6) % 7; const daysInMonth = new Date(year, month + 1, 0).getDate(); const prevMonthDays = new Date(year, month, 0).getDate(); const cells = []; // Leading days from prev month for(let i = startDow - 1; i >= 0; i--){ cells.push({ day: prevMonthDays - i, cur: false, dateKey: '' }); } // Current month days for(let d = 1; d <= daysInMonth; d++){ cells.push({ day: d, cur: true, dateKey: toDateKey(year, month, d) }); } // Trailing days const remainder = cells.length % 7; if (remainder !== 0) { for(let d = 1; d <= 7 - remainder; d++){ cells.push({ day: d, cur: false, dateKey: '' }); } } // Count summary — only future dates (>= today) const monthPrefix = toDateKey(year, month, 1).slice(0, 7); const availCount = Object.entries(avail).filter(([k, v])=>k.startsWith(monthPrefix) && k >= today && v === 'available').length; const busyCount = Object.entries(avail).filter(([k, v])=>k.startsWith(monthPrefix) && k >= today && v === 'busy').length; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden shadow-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("button", { onClick: onPrev, className: "w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition", children: "‹" }), /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsxs("h2", { className: "font-semibold text-gray-900", children: [ months[month], " ", year ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mt-0.5", children: [ /*#__PURE__*/ _jsxs("span", { className: "text-emerald-600 font-medium", children: [ availCount, " ", t('schedule.free') ] }), ' · ', /*#__PURE__*/ _jsxs("span", { className: "text-red-500 font-medium", children: [ busyCount, " ", t('schedule.busy_count') ] }) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: onNext, className: "w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition", children: "›" }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7 border-b border-gray-100", children: weekDays.map((d)=>/*#__PURE__*/ _jsx("div", { className: "py-2 text-center text-xs font-medium text-gray-400", children: d }, d)) }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7", children: cells.map((cell, idx)=>{ if (!cell.cur) { return /*#__PURE__*/ _jsx("div", { className: "p-1 h-12 flex items-center justify-center text-sm text-gray-200", children: cell.day }, `empty-${idx}`); } const status = avail[cell.dateKey] ?? null; const isPast = cell.dateKey < today; const isToday = cell.dateKey === today; const isSaving = saving === cell.dateKey; const isRangeStart = rangeStart === cell.dateKey; let cellCls = 'h-12 flex flex-col items-center justify-center rounded-xl m-0.5 text-sm font-medium transition-all select-none '; if (isPast) { cellCls += 'text-gray-200 cursor-default '; } else if (status === 'available') { cellCls += 'bg-emerald-100 border-2 border-emerald-400 text-emerald-700 cursor-pointer hover:bg-emerald-200 '; } else if (status === 'busy') { cellCls += 'bg-red-100 border-2 border-red-400 text-red-700 cursor-pointer hover:bg-red-200 '; } else { cellCls += 'bg-gray-50 border border-gray-200 text-gray-700 cursor-pointer hover:bg-green-50 hover:border-green-300 '; } if (isToday) cellCls += 'ring-2 ring-blue-400 ring-offset-1 '; if (isRangeStart) cellCls += '!ring-2 !ring-green-500 !ring-offset-1 scale-105 '; if (isSaving) cellCls += 'opacity-60 pointer-events-none '; return /*#__PURE__*/ _jsxs("button", { className: cellCls, onClick: ()=>onToggle(cell.dateKey), disabled: isPast || isSaving, title: status === 'available' ? t('schedule.available') : status === 'busy' ? t('schedule.busy') : t('schedule.click_to_set'), children: [ /*#__PURE__*/ _jsx("span", { children: cell.day }), !isPast && status === 'available' && /*#__PURE__*/ _jsx("span", { className: "text-[9px] leading-none text-emerald-600", children: t('schedule.available').toLowerCase() }), !isPast && status === 'busy' && /*#__PURE__*/ _jsx("span", { className: "text-[9px] leading-none text-red-500", children: t('schedule.busy').toLowerCase() }), isSaving && /*#__PURE__*/ _jsx("span", { className: "text-[8px] text-gray-400", children: "..." }) ] }, cell.dateKey); }) }) ] }); } cl={}_JL9GLS 0 7  _ k r \ d ~ 5ETg5CQTIgl_ !!!^"a"#"###}$$.%1%&&Y'\'((w)z)**q+u+(,_,,,,|..//00e1h1639344;6>677U8Y888!:$:[;^;v<y<s=v=>_>??~AATCWCDDAEEEEEFFGGBIEI[K_KLL-N0NOOOOQQ0T_4TTTUUVWZX]X ZZn[q[\\__eeffffggxh|hiijjlTlnnooppOqRqrrxx#z&zzz{{||(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyAvailability */ .iN)(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .setAvailabilityRange */ .D1)(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .setAvailability */ .OM)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)"https://api.canhelp.gr"0(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)C__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SchedulePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13260); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(96484); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); ~/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect, useCallback } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getMyAvailability, setAvailability, setAvailabilityRange, request } from '@/lib/api'; const STATUS_CYCLE = { available: 'busy', busy: null }; const WEEK_DAYS_BY_LOCALE = { ru: [ 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс' ], en: [ 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su' ], el: [ 'Δε', 'Τρ', 'Τε', 'Πε', 'Πα', 'Σά', 'Κυ' ] }; const MONTHS_BY_LOCALE = { ru: [ 'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь' ], en: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], el: [ 'Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος' ] }; function toMonthKey(year, month) { return `${year}-${String(month + 1).padStart(2, '0')}`; } function toDateKey(year, month, day) { return `${year}-${String(month + 1).padStart(2, '0')}-${String(day).padStart(2, '0')}`; } export default function SchedulePage() { const { data: session, isPending } = useSession(); const router = useRouter(); const searchParams = useSearchParams(); const { locale, t } = useLocale(); const now = new Date(); const [viewYear, setViewYear] = useState(now.getFullYear()); const [viewMonth, setViewMonth] = useState(now.getMonth()); // availability map: 'YYYY-MM-DD' → 'available'|'busy' const [avail, setAvail] = useState({}); const [saving, setSaving] = useState(null) // date being saved ; // Range selection state const [rangeStart, setRangeStart] = useState(null); const [rangeMode, setRangeMode] = useState(false); const [rangeStatus, setRangeStatus] = useState('available'); // Google Calendar state const [gcalStatus, setGcalStatus] = useState(null); const [gcalLoading, setGcalLoading] = useState(false); const [gcalToast, setGcalToast] = useState(null); const today = new Date().toISOString().slice(0, 10); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isPending && !session) router.push('/login'); if (!isPending && session && session.user?.role !== 'specialist' && session.user?.role !== 'admin') router.push('/profile'); }, [ session, isPending ]); // Load Google Calendar status const loadGcalStatus = useCallback(()=>{ request('/google/calendar/status').then(setGcalStatus).catch(()=>setGcalStatus({ connected: false })); }, []); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!session) return; loadGcalStatus(); // Handle callback redirect params const gcalParam = searchParams.get('gcal'); if (gcalParam === 'connected') { setGcalToast(t('schedule.gcalConnected')); setTimeout(()=>setGcalToast(null), 5000); router.replace('/schedule'); } else if (gcalParam === 'error') { setGcalToast(t('schedule.gcalError')); setTimeout(()=>setGcalToast(null), 5000); router.replace('/schedule'); } }, [ session ]); const loadMonth = useCallback((year, month)=>{ const key = toMonthKey(year, month); getMyAvailability(key).then((rows)=>{ setAvail((prev)=>{ const next = { ...prev }; rows.forEach((r)=>{ next[r.date] = r.status; }); return next; }); }).catch(()=>{}); }, []); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!session) return; loadMonth(viewYear, viewMonth); // preload next month too const next = new Date(viewYear, viewMonth + 1, 1); loadMonth(next.getFullYear(), next.getMonth()); }, [ session, viewYear, viewMonth, loadMonth ]); function prevMonth() { if (viewMonth === 0) { setViewYear((y)=>y - 1); setViewMonth(11); } else setViewMonth((m)=>m - 1); } function nextMonth() { if (viewMonth === 11) { setViewYear((y)=>y + 1); setViewMonth(0); } else setViewMonth((m)=>m + 1); } async function toggleDay(dateKey) { if (dateKey < today) return; // past — ignore if (rangeMode) { if (!rangeStart) { setRangeStart(dateKey); return; } // Second click — apply range const from = rangeStart < dateKey ? rangeStart : dateKey; const to = rangeStart < dateKey ? dateKey : rangeStart; setRangeStart(null); setSaving('range'); try { await setAvailabilityRange(from, to, rangeStatus); // Update local state setAvail((prev)=>{ const next = { ...prev }; const cur = new Date(from); const end = new Date(to); while(cur <= end){ const d = cur.toISOString().slice(0, 10); if (d >= today) next[d] = rangeStatus; cur.setDate(cur.getDate() + 1); } return next; }); } catch {} setSaving(null); return; } const current = avail[dateKey] ?? null; const next = current === null ? 'available' : STATUS_CYCLE[current]; setSaving(dateKey); // Optimistic setAvail((prev)=>({ ...prev, [dateKey]: next })); try { await setAvailability(dateKey, next); } catch { // Revert on error setAvail((prev)=>({ ...prev, [dateKey]: current })); } setSaving(null); } if (isPending) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-gray-500", children: t('common.loading') }); const role = session?.user?.role; if (!session || role !== 'specialist' && role !== 'admin') return null; const apiBase = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; async function connectGcal() { window.location.href = `${apiBase}/api/google/calendar/connect`; } async function disconnectGcal() { if (!confirm(t('schedule.gcalDisconnectConfirm'))) return; setGcalLoading(true); try { await request('/google/calendar/disconnect', { method: 'DELETE' }); setGcalStatus({ connected: false }); } catch {} setGcalLoading(false); } async function importFromGcal() { setGcalLoading(true); try { const res = await request('/google/calendar/import', { method: 'POST' }); setGcalToast(t('schedule.gcalImportDone').replace('{n}', String(res.imported ?? 0))); setTimeout(()=>setGcalToast(null), 5000); // Refresh calendar display loadMonth(viewYear, viewMonth); } catch {} setGcalLoading(false); } return /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ gcalToast && /*#__PURE__*/ _jsx("div", { className: "fixed top-4 right-4 z-50 bg-white border border-gray-200 shadow-lg rounded-xl px-4 py-3 text-sm text-gray-800 max-w-xs", children: gcalToast }), /*#__PURE__*/ _jsxs("div", { className: "mb-8", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white", children: t('schedule.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-white/70 mt-1", children: t('schedule.subtitle') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-4 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-emerald-100 border-2 border-emerald-400 flex items-center justify-center text-xs", children: "✓" }), t('schedule.available') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-red-100 border-2 border-red-400 flex items-center justify-center text-xs", children: "✗" }), t('schedule.busy') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-white/20 border border-white/30" }), t('schedule.unset') ] }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-white/50 self-center", children: t('schedule.click_hint') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6 p-3 bg-white rounded-xl border border-gray-200", children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ _jsx("div", { onClick: ()=>{ setRangeMode((v)=>!v); setRangeStart(null); }, className: `w-10 h-6 rounded-full transition-colors relative cursor-pointer ${rangeMode ? 'bg-green-500' : 'bg-gray-200'}`, children: /*#__PURE__*/ _jsx("span", { className: `absolute top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ${rangeMode ? 'translate-x-5' : 'translate-x-1'}` }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-700", children: t('schedule.range_mode') }) ] }), rangeMode && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 ml-4", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>setRangeStatus('available'), className: `px-3 py-1 rounded-lg text-sm font-medium border transition ${rangeStatus === 'available' ? 'bg-emerald-100 border-emerald-400 text-emerald-700' : 'bg-white border-gray-200 text-gray-500'}`, children: t('schedule.available') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setRangeStatus('busy'), className: `px-3 py-1 rounded-lg text-sm font-medium border transition ${rangeStatus === 'busy' ? 'bg-red-100 border-red-400 text-red-700' : 'bg-white border-gray-200 text-gray-500'}`, children: t('schedule.busy') }), rangeStart && /*#__PURE__*/ _jsx("span", { className: "text-xs text-green-600", children: t('schedule.range_from').replace('{date}', rangeStart) }) ] }) ] }), /*#__PURE__*/ _jsx(AvailCalendar, { year: viewYear, month: viewMonth, avail: avail, saving: saving, rangeStart: rangeStart, today: today, onToggle: toggleDay, onPrev: prevMonth, onNext: nextMonth }), /*#__PURE__*/ _jsxs("div", { className: "mt-6 bg-white rounded-2xl border border-gray-200 p-5 shadow-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-4", children: [ /*#__PURE__*/ _jsxs("svg", { width: "22", height: "22", viewBox: "0 0 48 48", fill: "none", children: [ /*#__PURE__*/ _jsx("rect", { width: "48", height: "48", rx: "8", fill: "#fff" }), /*#__PURE__*/ _jsx("path", { d: "M34 14H14a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V16a2 2 0 0 0-2-2z", fill: "#4285F4" }), /*#__PURE__*/ _jsx("path", { d: "M28 20h-8v2h8v-2zm0 4h-8v2h8v-2zm-2 4h-6v2h6v-2z", fill: "#fff" }), /*#__PURE__*/ _jsx("circle", { cx: "18", cy: "18", r: "2", fill: "#DB4437" }), /*#__PURE__*/ _jsx("circle", { cx: "30", cy: "18", r: "2", fill: "#DB4437" }), /*#__PURE__*/ _jsx("rect", { x: "17", y: "12", width: "2", height: "6", rx: "1", fill: "#DB4437" }), /*#__PURE__*/ _jsx("rect", { x: "29", y: "12", width: "2", height: "6", rx: "1", fill: "#DB4437" }) ] }), /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 text-sm", children: t('schedule.googleCalendar') }) ] }), gcalStatus === null ? /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('common.loading') }) : gcalStatus.connected ? /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [ /*#__PURE__*/ _jsx("circle", { cx: "8", cy: "8", r: "8", fill: "#22c55e" }), /*#__PURE__*/ _jsx("path", { d: "M5 8l2 2 4-4", stroke: "#fff", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }), /*#__PURE__*/ _jsxs("span", { className: "text-sm text-gray-700", children: [ t('schedule.connectedAs'), " ", /*#__PURE__*/ _jsx("span", { className: "font-medium", children: gcalStatus.email }) ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('schedule.gcalAutoSyncNote') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: importFromGcal, disabled: gcalLoading, className: "px-3 py-1.5 rounded-lg border border-green-200 bg-green-50 text-green-700 text-xs font-medium hover:bg-green-100 disabled:opacity-50 transition", children: gcalLoading ? t('common.loading') : t('schedule.importFromGoogle') }), /*#__PURE__*/ _jsx("button", { onClick: disconnectGcal, disabled: gcalLoading, className: "px-3 py-1.5 rounded-lg border border-gray-200 bg-white text-gray-500 text-xs font-medium hover:bg-gray-50 disabled:opacity-50 transition", children: t('schedule.disconnectGoogle') }) ] }) ] }) : /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('schedule.gcalConnectDesc') }), /*#__PURE__*/ _jsxs("button", { onClick: connectGcal, className: "flex items-center gap-2 px-4 py-2 rounded-xl border border-gray-200 bg-white hover:bg-gray-50 transition text-sm font-medium text-gray-700", children: [ /*#__PURE__*/ _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 48 48", fill: "none", children: [ /*#__PURE__*/ _jsx("path", { d: "M44.5 20H24v8.5h11.8C34.7 33.9 30.1 37 24 37c-7.2 0-13-5.8-13-13s5.8-13 13-13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 11.8 2 2 11.8 2 24s9.8 22 22 22c11 0 21-8 21-22 0-1.3-.2-2.7-.5-4z", fill: "#FFC107" }), /*#__PURE__*/ _jsx("path", { d: "M6.3 14.7l7 5.1C15 16.1 19.1 13 24 13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 16.3 2 9.7 7.4 6.3 14.7z", fill: "#FF3D00" }), /*#__PURE__*/ _jsx("path", { d: "M24 46c5.5 0 10.5-1.9 14.4-5.1l-6.7-5.5C29.5 37 26.9 38 24 38c-6.1 0-11.2-4-13-9.5l-7 5.4C7.6 41.9 15.2 46 24 46z", fill: "#4CAF50" }), /*#__PURE__*/ _jsx("path", { d: "M44.5 20H24v8.5h11.8c-.9 2.8-2.8 5.1-5.3 6.6l6.7 5.5C41.5 37.3 45 31.1 45 24c0-1.3-.2-2.7-.5-4z", fill: "#1976D2" }) ] }), t('schedule.connectGoogle') ] }) ] }) ] }) ] }); } function AvailCalendar({ year, month, avail, saving, rangeStart, today, onToggle, onPrev, onNext }) { const { locale, t } = useLocale(); const weekDays = WEEK_DAYS_BY_LOCALE[locale] ?? WEEK_DAYS_BY_LOCALE.ru; const months = MONTHS_BY_LOCALE[locale] ?? MONTHS_BY_LOCALE.ru; const firstDay = new Date(year, month, 1); // Monday-based: 0=Mon, 6=Sun const startDow = (firstDay.getDay() + 6) % 7; const daysInMonth = new Date(year, month + 1, 0).getDate(); const prevMonthDays = new Date(year, month, 0).getDate(); const cells = []; // Leading days from prev month for(let i = startDow - 1; i >= 0; i--){ cells.push({ day: prevMonthDays - i, cur: false, dateKey: '' }); } // Current month days for(let d = 1; d <= daysInMonth; d++){ cells.push({ day: d, cur: true, dateKey: toDateKey(year, month, d) }); } // Trailing days const remainder = cells.length % 7; if (remainder !== 0) { for(let d = 1; d <= 7 - remainder; d++){ cells.push({ day: d, cur: false, dateKey: '' }); } } // Count summary — only future dates (>= today) const monthPrefix = toDateKey(year, month, 1).slice(0, 7); const availCount = Object.entries(avail).filter(([k, v])=>k.startsWith(monthPrefix) && k >= today && v === 'available').length; const busyCount = Object.entries(avail).filter(([k, v])=>k.startsWith(monthPrefix) && k >= today && v === 'busy').length; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden shadow-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("button", { onClick: onPrev, className: "w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition", children: "‹" }), /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsxs("h2", { className: "font-semibold text-gray-900", children: [ months[month], " ", year ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mt-0.5", children: [ /*#__PURE__*/ _jsxs("span", { className: "text-emerald-600 font-medium", children: [ availCount, " ", t('schedule.free') ] }), ' · ', /*#__PURE__*/ _jsxs("span", { className: "text-red-500 font-medium", children: [ busyCount, " ", t('schedule.busy_count') ] }) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: onNext, className: "w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition", children: "›" }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7 border-b border-gray-100", children: weekDays.map((d)=>/*#__PURE__*/ _jsx("div", { className: "py-2 text-center text-xs font-medium text-gray-400", children: d }, d)) }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7", children: cells.map((cell, idx)=>{ if (!cell.cur) { return /*#__PURE__*/ _jsx("div", { className: "p-1 h-12 flex items-center justify-center text-sm text-gray-200", children: cell.day }, `empty-${idx}`); } const status = avail[cell.dateKey] ?? null; const isPast = cell.dateKey < today; const isToday = cell.dateKey === today; const isSaving = saving === cell.dateKey; const isRangeStart = rangeStart === cell.dateKey; let cellCls = 'h-12 flex flex-col items-center justify-center rounded-xl m-0.5 text-sm font-medium transition-all select-none '; if (isPast) { cellCls += 'text-gray-200 cursor-default '; } else if (status === 'available') { cellCls += 'bg-emerald-100 border-2 border-emerald-400 text-emerald-700 cursor-pointer hover:bg-emerald-200 '; } else if (status === 'busy') { cellCls += 'bg-red-100 border-2 border-red-400 text-red-700 cursor-pointer hover:bg-red-200 '; } else { cellCls += 'bg-gray-50 border border-gray-200 text-gray-700 cursor-pointer hover:bg-green-50 hover:border-green-300 '; } if (isToday) cellCls += 'ring-2 ring-blue-400 ring-offset-1 '; if (isRangeStart) cellCls += '!ring-2 !ring-green-500 !ring-offset-1 scale-105 '; if (isSaving) cellCls += 'opacity-60 pointer-events-none '; return /*#__PURE__*/ _jsxs("button", { className: cellCls, onClick: ()=>onToggle(cell.dateKey), disabled: isPast || isSaving, title: status === 'available' ? t('schedule.available') : status === 'busy' ? t('schedule.busy') : t('schedule.click_to_set'), children: [ /*#__PURE__*/ _jsx("span", { children: cell.day }), !isPast && status === 'available' && /*#__PURE__*/ _jsx("span", { className: "text-[9px] leading-none text-emerald-600", children: t('schedule.available').toLowerCase() }), !isPast && status === 'busy' && /*#__PURE__*/ _jsx("span", { className: "text-[9px] leading-none text-red-500", children: t('schedule.busy').toLowerCase() }), isSaving && /*#__PURE__*/ _jsx("span", { className: "text-[8px] text-gray-400", children: "..." }) ] }, cell.dateKey); }) }) ] }); } 61123undefined125181undefined183243undefined245284undefined286330undefined332425undefined18491863undefined19311940(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)undefined19641972(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined20022016(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)undefined20472055(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined21242131(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined21912198(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined23062313(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined23522359(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24622469(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25162523(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25752582(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26672674(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined27252732(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined27802787(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined29082916(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined32303240(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined32563262(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)undefined34543462(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined40674077(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined41494165(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyAvailability */ .iN)undefined45354543(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined57165735(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .setAvailabilityRange */ .D1)undefined67096723(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .setAvailability */ .OM)undefined69936996(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined72417271"https://api.canhelp.gr"undefined727672980undefined75827588(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)undefined79187924(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)undefined83208324(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined84458448(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined86868690(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined87988801(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined89918994(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined92089212(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined93419345(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined95189521(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined98969900(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1007310076(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1043810442(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1061510618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1089310896(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1112111125(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1130411308(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1147611479(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1190011903(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1219512198(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1248512489(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1264512648(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1311013113(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1356213565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1388313886(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1425114255(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1442114425(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1458114585(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1488114884(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1519515198(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1547815481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1573115734(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1604216045(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1635316356(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1676616769(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1723617239(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1753917542(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1772917733(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1787017874(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1804918053(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1839718400(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1875418757(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1929119295(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1961319616(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2001320016(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2024020244(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2041620419(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2096620969(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2155221556(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2169321696(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2191921923(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2227022274(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2261822621(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2305323056(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2340623409(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2375923762(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2447624484(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined2598525989(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2613826142(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2631426317(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2660126605(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2674426748(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2711727121(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2729927303(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2779327797(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2834328346(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2865528658(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2879928802(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2900729010(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2920129204(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3086130865(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3126731270(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3144431447(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3173231735(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3199131994(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SpecialistSetupPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13260); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(96484); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(44972); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect, useRef } from 'react'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; import { CategoryIcon, isCategoryIconUrl } from '@/components/CategoryIcon'; const TOTAL_STEPS = 5; // ─── Step indicator ──────────────────────────────────────────────────────── function StepIndicator({ current, total }) { return /*#__PURE__*/ _jsx("div", { className: "flex items-center justify-center gap-2 mb-8", children: Array.from({ length: total }, (_, i)=>i + 1).map((n)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("div", { className: `w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold transition-colors ${n < current ? 'bg-green-500 text-white' : n === current ? 'bg-green-600 text-white ring-4 ring-blue-200' : 'bg-gray-200 text-gray-400'}`, children: n < current ? /*#__PURE__*/ _jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /*#__PURE__*/ _jsx("path", { d: "M2 7l4 4 6-6", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) : n }), n < total && /*#__PURE__*/ _jsx("div", { className: `w-8 h-0.5 ${n < current ? 'bg-green-500' : 'bg-gray-200'}` }) ] }, n)) }); } // ─── Step 1: Welcome ─────────────────────────────────────────────────────── function Step1Welcome({ t, onNext }) { return /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6", children: /*#__PURE__*/ _jsxs("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "#2563eb", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "7", r: "4" }) ] }) }), /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: t('specialist_setup.step1.title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-600 font-medium mb-4", children: t('specialist_setup.step1.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm leading-relaxed mb-8 max-w-sm mx-auto", children: t('specialist_setup.step1.desc') }), /*#__PURE__*/ _jsxs("div", { className: "bg-gray-50 rounded-xl p-5 text-left mb-8 max-w-sm mx-auto", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-gray-700 mb-3", children: t('specialist_setup.step1.what_next') }), /*#__PURE__*/ _jsx("ul", { className: "space-y-2", children: [ t('specialist_setup.step1.item1'), t('specialist_setup.step1.item2'), t('specialist_setup.step1.item3'), t('specialist_setup.step1.item4'), t('specialist_setup.step1.item5') ].map((item, i)=>/*#__PURE__*/ _jsxs("li", { className: "flex items-center gap-2 text-sm text-gray-600", children: [ /*#__PURE__*/ _jsx("span", { className: "w-5 h-5 bg-green-100 text-green-600 rounded-full flex items-center justify-center text-xs font-bold shrink-0", children: i + 1 }), item ] }, i)) }) ] }), /*#__PURE__*/ _jsxs("button", { onClick: onNext, className: "w-full max-w-xs bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 transition", children: [ t('specialist_setup.next'), " →" ] }) ] }); } // ─── Step 2: Basic profile ───────────────────────────────────────────────── function Step2Profile({ t, onNext, onBack }) { const [bio, setBio] = useState(''); const [phone, setPhone] = useState(''); const [saving, setSaving] = useState(false); const [avatarUrl, setAvatarUrl] = useState(null); const [uploading, setUploading] = useState(false); const fileRef = useRef(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ api.request('/users/me', {}).then((u)=>{ setBio(u.bio ?? ''); setPhone(u.phone ?? ''); setAvatarUrl(u.image ?? null); }).catch(()=>{}); }, []); async function handleAvatarChange(e) { const file = e.target.files?.[0]; if (!file) return; setUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch(`${process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'}/api/uploads`, { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = `${process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'}${url}`; await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ image: fullUrl }) }); setAvatarUrl(fullUrl); } catch {} finally{ setUploading(false); if (fileRef.current) fileRef.current.value = ''; } } async function handleSave() { setSaving(true); try { await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ bio: bio || undefined, phone: phone || undefined }) }); onNext(); } catch {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step2.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step2.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-5", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step2.photo_label') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ _jsx("div", { className: "w-16 h-16 rounded-full bg-gray-100 border-2 border-gray-200 overflow-hidden shrink-0 flex items-center justify-center", children: avatarUrl ? /*#__PURE__*/ _jsx("img", { src: avatarUrl, alt: "", className: "w-full h-full object-cover" }) : /*#__PURE__*/ _jsxs("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", stroke: "#9ca3af", strokeWidth: "2", children: [ /*#__PURE__*/ _jsx("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "7", r: "4" }) ] }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>fileRef.current?.click(), disabled: uploading, className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium text-gray-700 disabled:opacity-50 transition", children: uploading ? t('specialist_setup.step2.photo_uploading') : t('specialist_setup.step2.photo_btn') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('specialist_setup.step2.photo_hint') }) ] }), /*#__PURE__*/ _jsx("input", { ref: fileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleAvatarChange }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-4", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step2.bio_label') }), /*#__PURE__*/ _jsx("textarea", { value: bio, onChange: (e)=>setBio(e.target.value), rows: 4, maxLength: 1000, placeholder: t('specialist_setup.step2.bio_placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step2.phone_label') }), /*#__PURE__*/ _jsx("input", { type: "tel", value: phone, onChange: (e)=>setPhone(e.target.value), placeholder: t('specialist_setup.step2.phone_placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 3: Service card ────────────────────────────────────────────────── function Step3Card({ t, onNext, onBack, onCardCreated }) { const [title, setTitle] = useState(''); const [desc, setDesc] = useState(''); const [saving, setSaving] = useState(false); const [error, setError] = useState(''); async function handleSave() { if (!title.trim()) { setError(t('specialist_setup.step3.title_required')); return; } setError(''); setSaving(true); try { const card = await api.createSpecialistCard({ title: title.trim(), description: desc || undefined }); onCardCreated(card); onNext(); } catch {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step3.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step3.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-4", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step3.title_label') }), /*#__PURE__*/ _jsx("input", { value: title, onChange: (e)=>{ setTitle(e.target.value); if (error) setError(''); }, maxLength: 200, placeholder: t('specialist_setup.step3.title_placeholder'), className: `w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ${error ? 'border-red-400' : 'border-gray-300'}` }), error && /*#__PURE__*/ _jsx("p", { className: "text-red-500 text-xs mt-1", children: error }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step3.desc_label') }), /*#__PURE__*/ _jsx("textarea", { value: desc, onChange: (e)=>setDesc(e.target.value), rows: 5, maxLength: 1000, placeholder: t('specialist_setup.step3.desc_placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 4: Skills & Categories ────────────────────────────────────────── function Step4Skills({ t, onNext, onBack, card, catLocale }) { const [skills, setSkills] = useState(card?.skills ?? []); const [skillInput, setSkillInput] = useState(''); const [categories, setCategories] = useState(card?.categories ?? []); const [allCategories, setAllCategories] = useState([]); const [suggestions, setSuggestions] = useState([]); const [saving, setSaving] = useState(false); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ api.getCategories().then(setAllCategories).catch(()=>{}); }, []); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ api.getSkillSuggestions(categories.length > 0 ? categories : undefined).then(setSuggestions).catch(()=>{}); }, [ categories ]); function addSkill(s) { const trimmed = s.trim(); if (trimmed && !skills.includes(trimmed)) setSkills([ ...skills, trimmed ]); setSkillInput(''); } function toggleCategory(slug, childSlugs = []) { if (categories.includes(slug)) { setCategories(categories.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setCategories([ ...new Set([ ...categories, slug, ...childSlugs ]) ]); } } async function handleSave() { if (!card) { onNext(); return; } setSaving(true); try { await api.updateSpecialistCard(card.id, { skills, categories }); onNext(); } catch {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step4.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step4.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step4.skills_label') }), skills.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2 mb-2", children: skills.map((s)=>/*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: [ s, /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSkills(skills.filter((x)=>x !== s)), className: "text-gray-400 hover:text-green-700 leading-none text-base", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') { e.preventDefault(); addSkill(skillInput); } }, placeholder: t('specialist_setup.step4.skills_placeholder'), className: "flex-1 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>addSkill(skillInput), className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium", children: t('specialist_setup.step4.skills_add') }) ] }), suggestions.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mt-2", children: suggestions.map((s)=>s.names[catLocale] ?? s.names.el).filter((name, i, arr)=>arr.indexOf(name) === i && !skills.includes(name)).slice(0, 12).map((name)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>addSkill(name), className: "text-xs px-2.5 py-1 border border-gray-200 rounded-full text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: [ "+ ", name ] }, name)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step4.categories_label') }), /*#__PURE__*/ _jsx("div", { className: "space-y-2 max-h-64 overflow-y-auto border border-gray-200 rounded-xl p-3", children: allCategories.map((cat)=>{ const catName = cat.names?.[catLocale] ?? cat.names?.el ?? cat.slug; const children = cat.children ?? []; const childSlugs = children.map((c)=>c.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: categories.includes(cat.slug), onChange: ()=>toggleCategory(cat.slug, childSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("span", { className: "text-sm font-medium text-gray-800 inline-flex items-center gap-1", children: [ cat.icon && /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: catName, className: isCategoryIconUrl(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }), catName ] }) ] }), children.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-1.5 space-y-1.5", children: children.map((sub)=>{ const subName = sub.names?.[catLocale] ?? sub.names?.el ?? sub.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: categories.includes(sub.slug), onChange: ()=>toggleCategory(sub.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: subName }) ] }, sub.id); }) }) ] }, cat.id); }) }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 5: Geography ───────────────────────────────────────────────────── function Step5Geography({ t, onNext, onBack, card, catLocale }) { const [locations, setLocations] = useState(card?.locations ?? []); const [locationTree, setLocationTree] = useState([]); const [saving, setSaving] = useState(false); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ api.getLocations().then(setLocationTree).catch(()=>{}); }, []); function toggleLocation(slug, childSlugs = []) { if (locations.includes(slug)) { setLocations(locations.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocations([ ...new Set([ ...locations, slug, ...childSlugs ]) ]); } } async function handleSave() { if (!card) { onNext(); return; } setSaving(true); try { await api.updateSpecialistCard(card.id, { locations }); onNext(); } catch {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step5.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-2", children: t('specialist_setup.step5.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mb-5", children: t('specialist_setup.step5.hint') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3 max-h-72 overflow-y-auto border border-gray-200 rounded-xl p-3 mb-6", children: locationTree.map((city)=>{ const cityName = city.names?.[catLocale] ?? city.names?.el ?? city.slug; const districts = city.children ?? []; const districtSlugs = districts.map((d)=>d.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: locations.includes(city.slug), onChange: ()=>toggleLocation(city.slug, districtSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: cityName }) ] }), districts.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-1.5 space-y-1.5", children: districts.map((d)=>{ const dName = d.names?.[catLocale] ?? d.names?.el ?? d.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: locations.includes(d.slug), onChange: ()=>toggleLocation(d.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: dName }) ] }, d.id); }) }) ] }, city.id); }) }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving, isLast: true }) ] }); } // ─── Done screen ─────────────────────────────────────────────────────────── function StepDone({ t }) { return /*#__PURE__*/ _jsxs("div", { className: "text-center py-4", children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6", children: /*#__PURE__*/ _jsx("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "#16a34a", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _jsx("path", { d: "M20 6L9 17l-5-5" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: t('specialist_setup.done.title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-600 font-medium mb-4", children: t('specialist_setup.done.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm leading-relaxed mb-8 max-w-sm mx-auto", children: t('specialist_setup.done.desc') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col sm:flex-row gap-3 justify-center", children: [ /*#__PURE__*/ _jsx("a", { href: "/profile", className: "px-6 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 transition text-center", children: t('specialist_setup.go_to_profile') }), /*#__PURE__*/ _jsx("a", { href: "/tasks", className: "px-6 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition text-center", children: t('specialist_setup.browse_tasks') }) ] }) ] }); } // ─── Navigation buttons ──────────────────────────────────────────────────── function NavButtons({ t, onBack, onNext, loading, isLast }) { return /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: onBack, className: "flex-1 px-4 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition", children: [ "← ", t('specialist_setup.back') ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: onNext, disabled: loading, className: "flex-[2] px-4 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 transition", children: loading ? '...' : isLast ? t('specialist_setup.finish') : `${t('specialist_setup.next')} →` }) ] }); } // ─── Main page ───────────────────────────────────────────────────────────── export default function SpecialistSetupPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t, locale } = useLocale(); const [step, setStep] = useState(1); const [card, setCard] = useState(null); const catLocale = locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : locale === 'en' ? 'en' : 'el'; process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); if (isPending || !session) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const isDone = step > TOTAL_STEPS; return /*#__PURE__*/ _jsx("div", { className: "min-h-screen py-10 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-lg mx-auto", children: [ /*#__PURE__*/ _jsxs("div", { className: "text-center mb-6", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-lg font-semibold text-white/90", children: t('specialist_setup.page_title') }), !isDone && /*#__PURE__*/ _jsx("p", { className: "text-sm text-white/50 mt-0.5", children: t('specialist_setup.step_of').replace('{current}', String(step)).replace('{total}', String(TOTAL_STEPS)) }) ] }), !isDone && /*#__PURE__*/ _jsx(StepIndicator, { current: step, total: TOTAL_STEPS }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 p-6 shadow-sm", children: [ isDone && /*#__PURE__*/ _jsx(StepDone, { t: t }), step === 1 && /*#__PURE__*/ _jsx(Step1Welcome, { t: t, onNext: ()=>setStep(2) }), step === 2 && /*#__PURE__*/ _jsx(Step2Profile, { t: t, onNext: ()=>setStep(3), onBack: ()=>setStep(1) }), step === 3 && /*#__PURE__*/ _jsx(Step3Card, { t: t, onNext: ()=>setStep(4), onBack: ()=>setStep(2), onCardCreated: setCard }), step === 4 && /*#__PURE__*/ _jsx(Step4Skills, { t: t, onNext: ()=>setStep(5), onBack: ()=>setStep(3), card: card, catLocale: catLocale }), step === 5 && /*#__PURE__*/ _jsx(Step5Geography, { t: t, onNext: ()=>setStep(6), onBack: ()=>setStep(4), card: card, catLocale: catLocale }) ] }), step >= 2 && step <= TOTAL_STEPS && /*#__PURE__*/ _jsx("div", { className: "text-center mt-4", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setStep(step + 1), className: "text-sm text-white/50 hover:text-white/80 transition", children: t('specialist_setup.skip') }) }) ] }) }); } @b={}_46VXQT or  @ C _ 36RV.5el_ ' '5SXn=G7 ; !!"""##$_$%%&&''Z(](**,,--3.6.//1!111t2w2K4N455555_6*61637J7M8Q888@9C999^:a:E;H;==d>h>>>??AAC&CeClCC_CCC#D*DQDXDDDDD.E6EFE\EHHIIIJJJcKgKKKLL^MbMuN_xNjPnPPPSTUUVV3Y7YYYZZf\j\\\]]__````aac_ceef f"h%hjjkk6l=ldlklllll;oRopp@pCpppqqNrQrt_tatet'u*uvv@xCxmyqyKzNz2|5|~~gkqtru(+ڃ݃_>Avzو݈LO=Kތ07ލ\_(X,<?x{fi̘ϘMP(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em"https://api.canhelp.gr"00_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSpecialistCard */ .eR_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bW_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSkillSuggestions */ .rl_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zc_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .CategoryIcon */ .Ez(0,_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .isCategoryIconUrl */ .V)_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vs(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SpecialistSetupPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13260); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(96484); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(44972); /* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect, useRef } from 'react'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; import { CategoryIcon, isCategoryIconUrl } from '@/components/CategoryIcon'; const TOTAL_STEPS = 5; // ─── Step indicator ──────────────────────────────────────────────────────── function StepIndicator({ current, total }) { return /*#__PURE__*/ _jsx("div", { className: "flex items-center justify-center gap-2 mb-8", children: Array.from({ length: total }, (_, i)=>i + 1).map((n)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("div", { className: `w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold transition-colors ${n < current ? 'bg-green-500 text-white' : n === current ? 'bg-green-600 text-white ring-4 ring-blue-200' : 'bg-gray-200 text-gray-400'}`, children: n < current ? /*#__PURE__*/ _jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /*#__PURE__*/ _jsx("path", { d: "M2 7l4 4 6-6", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) : n }), n < total && /*#__PURE__*/ _jsx("div", { className: `w-8 h-0.5 ${n < current ? 'bg-green-500' : 'bg-gray-200'}` }) ] }, n)) }); } // ─── Step 1: Welcome ─────────────────────────────────────────────────────── function Step1Welcome({ t, onNext }) { return /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6", children: /*#__PURE__*/ _jsxs("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "#2563eb", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "7", r: "4" }) ] }) }), /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: t('specialist_setup.step1.title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-600 font-medium mb-4", children: t('specialist_setup.step1.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm leading-relaxed mb-8 max-w-sm mx-auto", children: t('specialist_setup.step1.desc') }), /*#__PURE__*/ _jsxs("div", { className: "bg-gray-50 rounded-xl p-5 text-left mb-8 max-w-sm mx-auto", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-gray-700 mb-3", children: t('specialist_setup.step1.what_next') }), /*#__PURE__*/ _jsx("ul", { className: "space-y-2", children: [ t('specialist_setup.step1.item1'), t('specialist_setup.step1.item2'), t('specialist_setup.step1.item3'), t('specialist_setup.step1.item4'), t('specialist_setup.step1.item5') ].map((item, i)=>/*#__PURE__*/ _jsxs("li", { className: "flex items-center gap-2 text-sm text-gray-600", children: [ /*#__PURE__*/ _jsx("span", { className: "w-5 h-5 bg-green-100 text-green-600 rounded-full flex items-center justify-center text-xs font-bold shrink-0", children: i + 1 }), item ] }, i)) }) ] }), /*#__PURE__*/ _jsxs("button", { onClick: onNext, className: "w-full max-w-xs bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 transition", children: [ t('specialist_setup.next'), " →" ] }) ] }); } // ─── Step 2: Basic profile ───────────────────────────────────────────────── function Step2Profile({ t, onNext, onBack }) { const [bio, setBio] = useState(''); const [phone, setPhone] = useState(''); const [saving, setSaving] = useState(false); const [avatarUrl, setAvatarUrl] = useState(null); const [uploading, setUploading] = useState(false); const fileRef = useRef(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ api.request('/users/me', {}).then((u)=>{ setBio(u.bio ?? ''); setPhone(u.phone ?? ''); setAvatarUrl(u.image ?? null); }).catch(()=>{}); }, []); async function handleAvatarChange(e) { const file = e.target.files?.[0]; if (!file) return; setUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch(`${process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'}/api/uploads`, { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = `${process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'}${url}`; await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ image: fullUrl }) }); setAvatarUrl(fullUrl); } catch {} finally{ setUploading(false); if (fileRef.current) fileRef.current.value = ''; } } async function handleSave() { setSaving(true); try { await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ bio: bio || undefined, phone: phone || undefined }) }); onNext(); } catch {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step2.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step2.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-5", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step2.photo_label') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ _jsx("div", { className: "w-16 h-16 rounded-full bg-gray-100 border-2 border-gray-200 overflow-hidden shrink-0 flex items-center justify-center", children: avatarUrl ? /*#__PURE__*/ _jsx("img", { src: avatarUrl, alt: "", className: "w-full h-full object-cover" }) : /*#__PURE__*/ _jsxs("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", stroke: "#9ca3af", strokeWidth: "2", children: [ /*#__PURE__*/ _jsx("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "7", r: "4" }) ] }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>fileRef.current?.click(), disabled: uploading, className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium text-gray-700 disabled:opacity-50 transition", children: uploading ? t('specialist_setup.step2.photo_uploading') : t('specialist_setup.step2.photo_btn') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('specialist_setup.step2.photo_hint') }) ] }), /*#__PURE__*/ _jsx("input", { ref: fileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleAvatarChange }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-4", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step2.bio_label') }), /*#__PURE__*/ _jsx("textarea", { value: bio, onChange: (e)=>setBio(e.target.value), rows: 4, maxLength: 1000, placeholder: t('specialist_setup.step2.bio_placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step2.phone_label') }), /*#__PURE__*/ _jsx("input", { type: "tel", value: phone, onChange: (e)=>setPhone(e.target.value), placeholder: t('specialist_setup.step2.phone_placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 3: Service card ────────────────────────────────────────────────── function Step3Card({ t, onNext, onBack, onCardCreated }) { const [title, setTitle] = useState(''); const [desc, setDesc] = useState(''); const [saving, setSaving] = useState(false); const [error, setError] = useState(''); async function handleSave() { if (!title.trim()) { setError(t('specialist_setup.step3.title_required')); return; } setError(''); setSaving(true); try { const card = await api.createSpecialistCard({ title: title.trim(), description: desc || undefined }); onCardCreated(card); onNext(); } catch {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step3.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step3.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-4", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step3.title_label') }), /*#__PURE__*/ _jsx("input", { value: title, onChange: (e)=>{ setTitle(e.target.value); if (error) setError(''); }, maxLength: 200, placeholder: t('specialist_setup.step3.title_placeholder'), className: `w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ${error ? 'border-red-400' : 'border-gray-300'}` }), error && /*#__PURE__*/ _jsx("p", { className: "text-red-500 text-xs mt-1", children: error }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step3.desc_label') }), /*#__PURE__*/ _jsx("textarea", { value: desc, onChange: (e)=>setDesc(e.target.value), rows: 5, maxLength: 1000, placeholder: t('specialist_setup.step3.desc_placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 4: Skills & Categories ────────────────────────────────────────── function Step4Skills({ t, onNext, onBack, card, catLocale }) { const [skills, setSkills] = useState(card?.skills ?? []); const [skillInput, setSkillInput] = useState(''); const [categories, setCategories] = useState(card?.categories ?? []); const [allCategories, setAllCategories] = useState([]); const [suggestions, setSuggestions] = useState([]); const [saving, setSaving] = useState(false); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ api.getCategories().then(setAllCategories).catch(()=>{}); }, []); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ api.getSkillSuggestions(categories.length > 0 ? categories : undefined).then(setSuggestions).catch(()=>{}); }, [ categories ]); function addSkill(s) { const trimmed = s.trim(); if (trimmed && !skills.includes(trimmed)) setSkills([ ...skills, trimmed ]); setSkillInput(''); } function toggleCategory(slug, childSlugs = []) { if (categories.includes(slug)) { setCategories(categories.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setCategories([ ...new Set([ ...categories, slug, ...childSlugs ]) ]); } } async function handleSave() { if (!card) { onNext(); return; } setSaving(true); try { await api.updateSpecialistCard(card.id, { skills, categories }); onNext(); } catch {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step4.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step4.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step4.skills_label') }), skills.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2 mb-2", children: skills.map((s)=>/*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: [ s, /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSkills(skills.filter((x)=>x !== s)), className: "text-gray-400 hover:text-green-700 leading-none text-base", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') { e.preventDefault(); addSkill(skillInput); } }, placeholder: t('specialist_setup.step4.skills_placeholder'), className: "flex-1 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>addSkill(skillInput), className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium", children: t('specialist_setup.step4.skills_add') }) ] }), suggestions.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mt-2", children: suggestions.map((s)=>s.names[catLocale] ?? s.names.el).filter((name, i, arr)=>arr.indexOf(name) === i && !skills.includes(name)).slice(0, 12).map((name)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>addSkill(name), className: "text-xs px-2.5 py-1 border border-gray-200 rounded-full text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: [ "+ ", name ] }, name)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step4.categories_label') }), /*#__PURE__*/ _jsx("div", { className: "space-y-2 max-h-64 overflow-y-auto border border-gray-200 rounded-xl p-3", children: allCategories.map((cat)=>{ const catName = cat.names?.[catLocale] ?? cat.names?.el ?? cat.slug; const children = cat.children ?? []; const childSlugs = children.map((c)=>c.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: categories.includes(cat.slug), onChange: ()=>toggleCategory(cat.slug, childSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("span", { className: "text-sm font-medium text-gray-800 inline-flex items-center gap-1", children: [ cat.icon && /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: catName, className: isCategoryIconUrl(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }), catName ] }) ] }), children.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-1.5 space-y-1.5", children: children.map((sub)=>{ const subName = sub.names?.[catLocale] ?? sub.names?.el ?? sub.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: categories.includes(sub.slug), onChange: ()=>toggleCategory(sub.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: subName }) ] }, sub.id); }) }) ] }, cat.id); }) }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 5: Geography ───────────────────────────────────────────────────── function Step5Geography({ t, onNext, onBack, card, catLocale }) { const [locations, setLocations] = useState(card?.locations ?? []); const [locationTree, setLocationTree] = useState([]); const [saving, setSaving] = useState(false); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ api.getLocations().then(setLocationTree).catch(()=>{}); }, []); function toggleLocation(slug, childSlugs = []) { if (locations.includes(slug)) { setLocations(locations.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocations([ ...new Set([ ...locations, slug, ...childSlugs ]) ]); } } async function handleSave() { if (!card) { onNext(); return; } setSaving(true); try { await api.updateSpecialistCard(card.id, { locations }); onNext(); } catch {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step5.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-2", children: t('specialist_setup.step5.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mb-5", children: t('specialist_setup.step5.hint') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3 max-h-72 overflow-y-auto border border-gray-200 rounded-xl p-3 mb-6", children: locationTree.map((city)=>{ const cityName = city.names?.[catLocale] ?? city.names?.el ?? city.slug; const districts = city.children ?? []; const districtSlugs = districts.map((d)=>d.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: locations.includes(city.slug), onChange: ()=>toggleLocation(city.slug, districtSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: cityName }) ] }), districts.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-1.5 space-y-1.5", children: districts.map((d)=>{ const dName = d.names?.[catLocale] ?? d.names?.el ?? d.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: locations.includes(d.slug), onChange: ()=>toggleLocation(d.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: dName }) ] }, d.id); }) }) ] }, city.id); }) }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving, isLast: true }) ] }); } // ─── Done screen ─────────────────────────────────────────────────────────── function StepDone({ t }) { return /*#__PURE__*/ _jsxs("div", { className: "text-center py-4", children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6", children: /*#__PURE__*/ _jsx("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "#16a34a", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _jsx("path", { d: "M20 6L9 17l-5-5" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: t('specialist_setup.done.title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-600 font-medium mb-4", children: t('specialist_setup.done.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm leading-relaxed mb-8 max-w-sm mx-auto", children: t('specialist_setup.done.desc') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col sm:flex-row gap-3 justify-center", children: [ /*#__PURE__*/ _jsx("a", { href: "/profile", className: "px-6 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 transition text-center", children: t('specialist_setup.go_to_profile') }), /*#__PURE__*/ _jsx("a", { href: "/tasks", className: "px-6 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition text-center", children: t('specialist_setup.browse_tasks') }) ] }) ] }); } // ─── Navigation buttons ──────────────────────────────────────────────────── function NavButtons({ t, onBack, onNext, loading, isLast }) { return /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: onBack, className: "flex-1 px-4 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition", children: [ "← ", t('specialist_setup.back') ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: onNext, disabled: loading, className: "flex-[2] px-4 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 transition", children: loading ? '...' : isLast ? t('specialist_setup.finish') : `${t('specialist_setup.next')} →` }) ] }); } // ─── Main page ───────────────────────────────────────────────────────────── export default function SpecialistSetupPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t, locale } = useLocale(); const [step, setStep] = useState(1); const [card, setCard] = useState(null); const catLocale = locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : locale === 'en' ? 'en' : 'el'; process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); if (isPending || !session) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const isDone = step > TOTAL_STEPS; return /*#__PURE__*/ _jsx("div", { className: "min-h-screen py-10 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-lg mx-auto", children: [ /*#__PURE__*/ _jsxs("div", { className: "text-center mb-6", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-lg font-semibold text-white/90", children: t('specialist_setup.page_title') }), !isDone && /*#__PURE__*/ _jsx("p", { className: "text-sm text-white/50 mt-0.5", children: t('specialist_setup.step_of').replace('{current}', String(step)).replace('{total}', String(TOTAL_STEPS)) }) ] }), !isDone && /*#__PURE__*/ _jsx(StepIndicator, { current: step, total: TOTAL_STEPS }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 p-6 shadow-sm", children: [ isDone && /*#__PURE__*/ _jsx(StepDone, { t: t }), step === 1 && /*#__PURE__*/ _jsx(Step1Welcome, { t: t, onNext: ()=>setStep(2) }), step === 2 && /*#__PURE__*/ _jsx(Step2Profile, { t: t, onNext: ()=>setStep(3), onBack: ()=>setStep(1) }), step === 3 && /*#__PURE__*/ _jsx(Step3Card, { t: t, onNext: ()=>setStep(4), onBack: ()=>setStep(2), onCardCreated: setCard }), step === 4 && /*#__PURE__*/ _jsx(Step4Skills, { t: t, onNext: ()=>setStep(5), onBack: ()=>setStep(3), card: card, catLocale: catLocale }), step === 5 && /*#__PURE__*/ _jsx(Step5Geography, { t: t, onNext: ()=>setStep(6), onBack: ()=>setStep(4), card: card, catLocale: catLocale }) ] }), step >= 2 && step <= TOTAL_STEPS && /*#__PURE__*/ _jsx("div", { className: "text-center mt-4", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setStep(step + 1), className: "text-sm text-white/50 hover:text-white/80 transition", children: t('specialist_setup.skip') }) }) ] }) }); } .61123undefined125176undefined178221undefined223262undefined264308undefined310342undefined344419undefined593596(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined779783(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined910913(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined12521255(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined14931496(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined19031906(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined22252229(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined23202323(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined24862490(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined28802883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined30363039(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined32733276(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34563459(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined36353638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined38383842(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined40034006(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42244227(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined46904694(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined48904893(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined53575361(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined58445851(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined58885895(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined59345941(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined59895996(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined60436050(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined60806085(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined61496157(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined61736183_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined66386668"https://api.canhelp.gr"undefined667366950undefined69656995"https://api.canhelp.gr"undefined700070220undefined70517061_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined74857495_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined78307834(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined78917894(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined80738076(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined82478251(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined83598362(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined85808584(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined87358738(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined89818984(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined92199223(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined96529655(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined98569859(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1022110225(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1033010333(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1094910952(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1127811281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1171511719(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1182711830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1205612059(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1257312577(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1268512688(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1291612919(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1338713390(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1373113738(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1377313780(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1381913826(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1386613873(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1413114154_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSpecialistCard */ .eRundefined1441314417(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1447414477(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1465614659(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1483014834(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1494214945(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1517315176(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1577315776(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1597215976(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1608416087(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1631416317(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1683416837(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1718317190(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1725317260(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1730717314(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1738717394(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1744317450(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1748917496(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1756117569(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined1758517601_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bWundefined1771017718(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined1773417756_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSkillSuggestions */ .rlundefined1865718680_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zcundefined1888218886(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1894318946(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1912519128(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1929919303(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1941119414(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1966419667(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1980619810(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2008520088(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2058620590(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2072820731(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2150221505(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2197321976(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2225522259(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2283522839(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2294722950(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2318323186(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2365423658(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2376323767(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2398523988(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2448924493(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2477024773(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2477524786_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .CategoryIcon */ .Ezundefined2500025016(0,_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .isCategoryIconUrl */ .V)undefined2553025533(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2587225876(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2611826121(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2665826661(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2726627269(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2762527632(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2770227709(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2774827755(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2782027828(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined2784427859_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vsundefined2847528498_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zcundefined2867528679(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2873628739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2891828921(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2909229095(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2926229265(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2970029704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2979329797(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2999129994(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3045130454(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3078430787(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3108531089(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3130731310(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3179431797(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3227832281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3261532619(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3271532718(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3288132884(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3325033253(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3339433397(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3357633579(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3375433757(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3395633960(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3411034113(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3443134434(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3493434938(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3503335037(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3540435407(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3590135915undefined3599035999(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)undefined3602336031(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined3606236070(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined3610336110(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3614436151(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3631836326(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined3650736510(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3670036703(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3679236796(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3690436908(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3704037043(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3727937282(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3761537618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3776137765(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3794837951(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3807838081(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3826438267(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3850238505(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3878938792(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3911639119(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3950139504(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3961039613(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ AdminRolePreview: () => (/* binding */ AdminRolePreview) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13260); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(91864); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource`/* __next_internal_client_entry_do_not_use__ AdminRolePreview auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useSession } from '@/lib/auth'; import { useRouter } from 'next/navigation'; import { useEffect, useState, useRef } from 'react'; import { getPlans, updateAdminUser } from '@/lib/api'; const ORIG_PLAN_KEY = 'canhelp_admin_orig_plan'; function getPreviewRole() { return null; } const TIER_COLORS = { free: 'bg-slate-100 text-slate-600', pro: 'bg-green-100 text-green-700', ultimate: 'bg-amber-100 text-amber-700' }; export function AdminRolePreview() { const { data: session } = useSession(); const router = useRouter(); const isAdmin = session?.user?.role === 'admin'; const userId = session?.user?.id; const [mounted, setMounted] = useState(false); const [plans, setPlans] = useState([]); const [activePlanId, setActivePlanId] = useState(null); const [loading, setLoading] = useState(false); const [expanded, setExpanded] = useState(false); const origPlanRef = useRef(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>setMounted(true), []); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if ("undefined" !== 'undefined') { origPlanRef.current = localStorage.getItem(ORIG_PLAN_KEY); } }, []); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isAdmin) return; getPlans().then(setPlans).catch(()=>{}); }, [ isAdmin ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ // Sync active plan from session const currentPlanId = session?.user?.planId ?? null; setActivePlanId(currentPlanId); }, [ session ]); if (!mounted || !isAdmin) return null; const setPlan = async (planId)=>{ if (!userId) return; setLoading(true); try { // Save original plan on first change if (!origPlanRef.current && activePlanId) { localStorage.setItem(ORIG_PLAN_KEY, activePlanId); origPlanRef.current = activePlanId; } await updateAdminUser(userId, { planId }); setActivePlanId(planId); window.dispatchEvent(new CustomEvent('canhelp:plan-changed', { detail: { planId } })); router.refresh(); } catch {} setLoading(false); }; const restorePlan = async ()=>{ const orig = origPlanRef.current; localStorage.removeItem(ORIG_PLAN_KEY); origPlanRef.current = null; await setPlan(orig ?? null); }; const visiblePlans = plans; const hasOrigPlan = !!origPlanRef.current; return /*#__PURE__*/ _jsxs("div", { className: "fixed bottom-20 right-4 z-50 bg-white border border-slate-200 rounded-2xl shadow-lg text-xs font-medium select-none", style: { minWidth: 130 }, children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setExpanded((v)=>!v), className: "flex items-center justify-between gap-2 w-full px-3 py-2 text-slate-500 hover:text-slate-700 transition rounded-2xl", children: [ /*#__PURE__*/ _jsx("span", { children: "\uD83D\uDC41 Preview" }), /*#__PURE__*/ _jsx("span", { className: "text-slate-300", children: expanded ? '▲' : '▼' }) ] }), expanded && /*#__PURE__*/ _jsx("div", { className: "flex flex-col gap-1 px-2 pb-2 border-t border-slate-100 pt-2", children: visiblePlans.length > 0 && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "text-slate-400 px-1 mt-2 mb-0.5", children: "Plan" }), visiblePlans.map((plan)=>/*#__PURE__*/ _jsxs("button", { disabled: loading, onClick: ()=>setPlan(plan.id === activePlanId ? null : plan.id), className: `flex items-center justify-between gap-2 px-3 py-1.5 rounded-xl transition text-left ${activePlanId === plan.id ? 'bg-indigo-600 text-white' : 'text-slate-600 hover:bg-slate-100'} ${loading ? 'opacity-50' : ''}`, children: [ /*#__PURE__*/ _jsx("span", { className: "truncate max-w-[90px]", children: plan.name }), /*#__PURE__*/ _jsx("span", { className: `px-1.5 py-0.5 rounded-full text-[10px] font-semibold ${activePlanId === plan.id ? 'bg-white/20 text-white' : TIER_COLORS[plan.tier] ?? TIER_COLORS.free}`, children: plan.tier }) ] }, plan.id)), activePlanId && /*#__PURE__*/ _jsx("button", { disabled: loading, onClick: ()=>setPlan(null), className: "px-3 py-1 rounded-xl text-slate-400 hover:text-red-500 hover:bg-red-50 transition text-left", children: "✕ No plan" }), hasOrigPlan && /*#__PURE__*/ _jsx("button", { disabled: loading, onClick: restorePlan, className: "px-3 py-1 rounded-xl text-green-600 hover:bg-green-50 transition text-left", children: "↩ Restore" }) ] }) }) ] }); } a#F_&(]U[CJry<A_gckL P I M ^ a fjltDWZ(0,_lib_auth__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .wV)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(0,react__WEBPACK_IMPORTED_MODULE_3__.useRef)(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)false{}(0,_lib_api__WEBPACK_IMPORTED_MODULE_4__/* .getPlans */ .T9)(0,_lib_api__WEBPACK_IMPORTED_MODULE_4__/* .updateAdminUser */ .wl)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentw/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ AdminRolePreview: () => (/* binding */ AdminRolePreview) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13260); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(91864); /* __next_internal_client_entry_do_not_use__ AdminRolePreview auto */ const ORIG_PLAN_KEY = 'canhelp_admin_orig_plan'; function getPreviewRole() { return null; } const TIER_COLORS = { free: 'bg-slate-100 text-slate-600', pro: 'bg-green-100 text-green-700', ultimate: 'bg-amber-100 text-amber-700' }; function AdminRolePreview() { const { data: session } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const isAdmin = session?.user?.role === 'admin'; const userId = session?.user?.id; const [mounted, setMounted] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false); const [plans, setPlans] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)([]); const [activePlanId, setActivePlanId] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(null); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false); const [expanded, setExpanded] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false); const origPlanRef = (0,react__WEBPACK_IMPORTED_MODULE_3__.useRef)(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>setMounted(true), []); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{ if (false) {} }, []); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{ if (!isAdmin) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_4__/* .getPlans */ .T9)().then(setPlans).catch(()=>{}); }, [ isAdmin ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{ // Sync active plan from session const currentPlanId = session?.user?.planId ?? null; setActivePlanId(currentPlanId); }, [ session ]); if (!mounted || !isAdmin) return null; const setPlan = async (planId)=>{ if (!userId) return; setLoading(true); try { // Save original plan on first change if (!origPlanRef.current && activePlanId) { localStorage.setItem(ORIG_PLAN_KEY, activePlanId); origPlanRef.current = activePlanId; } await (0,_lib_api__WEBPACK_IMPORTED_MODULE_4__/* .updateAdminUser */ .wl)(userId, { planId }); setActivePlanId(planId); window.dispatchEvent(new CustomEvent('canhelp:plan-changed', { detail: { planId } })); router.refresh(); } catch {} setLoading(false); }; const restorePlan = async ()=>{ const orig = origPlanRef.current; localStorage.removeItem(ORIG_PLAN_KEY); origPlanRef.current = null; await setPlan(orig ?? null); }; const visiblePlans = plans; const hasOrigPlan = !!origPlanRef.current; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "fixed bottom-20 right-4 z-50 bg-white border border-slate-200 rounded-2xl shadow-lg text-xs font-medium select-none", style: { minWidth: 130 }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>setExpanded((v)=>!v), className: "flex items-center justify-between gap-2 w-full px-3 py-2 text-slate-500 hover:text-slate-700 transition rounded-2xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: "\uD83D\uDC41 Preview" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-slate-300", children: expanded ? '▲' : '▼' }) ] }), expanded && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-col gap-1 px-2 pb-2 border-t border-slate-100 pt-2", children: visiblePlans.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-slate-400 px-1 mt-2 mb-0.5", children: "Plan" }), visiblePlans.map((plan)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { disabled: loading, onClick: ()=>setPlan(plan.id === activePlanId ? null : plan.id), className: `flex items-center justify-between gap-2 px-3 py-1.5 rounded-xl transition text-left ${activePlanId === plan.id ? 'bg-indigo-600 text-white' : 'text-slate-600 hover:bg-slate-100'} ${loading ? 'opacity-50' : ''}`, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "truncate max-w-[90px]", children: plan.name }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: `px-1.5 py-0.5 rounded-full text-[10px] font-semibold ${activePlanId === plan.id ? 'bg-white/20 text-white' : TIER_COLORS[plan.tier] ?? TIER_COLORS.free}`, children: plan.tier }) ] }, plan.id)), activePlanId && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { disabled: loading, onClick: ()=>setPlan(null), className: "px-3 py-1 rounded-xl text-slate-400 hover:text-red-500 hover:bg-red-50 transition text-left", children: "✕ No plan" }), hasOrigPlan && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { disabled: loading, onClick: restorePlan, className: "px-3 py-1 rounded-xl text-green-600 hover:bg-green-50 transition text-left", children: "↩ Restore" }) ] }) }) ] }); }  /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ AdminRolePreview: () => (/* binding */ AdminRolePreview) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13260); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(91864); `/* __next_internal_client_entry_do_not_use__ AdminRolePreview auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useSession } from '@/lib/auth'; import { useRouter } from 'next/navigation'; import { useEffect, useState, useRef } from 'react'; import { getPlans, updateAdminUser } from '@/lib/api'; const ORIG_PLAN_KEY = 'canhelp_admin_orig_plan'; function getPreviewRole() { return null; } const TIER_COLORS = { free: 'bg-slate-100 text-slate-600', pro: 'bg-green-100 text-green-700', ultimate: 'bg-amber-100 text-amber-700' }; export function AdminRolePreview() { const { data: session } = useSession(); const router = useRouter(); const isAdmin = session?.user?.role === 'admin'; const userId = session?.user?.id; const [mounted, setMounted] = useState(false); const [plans, setPlans] = useState([]); const [activePlanId, setActivePlanId] = useState(null); const [loading, setLoading] = useState(false); const [expanded, setExpanded] = useState(false); const origPlanRef = useRef(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>setMounted(true), []); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if ("undefined" !== 'undefined') { origPlanRef.current = localStorage.getItem(ORIG_PLAN_KEY); } }, []); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isAdmin) return; getPlans().then(setPlans).catch(()=>{}); }, [ isAdmin ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ // Sync active plan from session const currentPlanId = session?.user?.planId ?? null; setActivePlanId(currentPlanId); }, [ session ]); if (!mounted || !isAdmin) return null; const setPlan = async (planId)=>{ if (!userId) return; setLoading(true); try { // Save original plan on first change if (!origPlanRef.current && activePlanId) { localStorage.setItem(ORIG_PLAN_KEY, activePlanId); origPlanRef.current = activePlanId; } await updateAdminUser(userId, { planId }); setActivePlanId(planId); window.dispatchEvent(new CustomEvent('canhelp:plan-changed', { detail: { planId } })); router.refresh(); } catch {} setLoading(false); }; const restorePlan = async ()=>{ const orig = origPlanRef.current; localStorage.removeItem(ORIG_PLAN_KEY); origPlanRef.current = null; await setPlan(orig ?? null); }; const visiblePlans = plans; const hasOrigPlan = !!origPlanRef.current; return /*#__PURE__*/ _jsxs("div", { className: "fixed bottom-20 right-4 z-50 bg-white border border-slate-200 rounded-2xl shadow-lg text-xs font-medium select-none", style: { minWidth: 130 }, children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setExpanded((v)=>!v), className: "flex items-center justify-between gap-2 w-full px-3 py-2 text-slate-500 hover:text-slate-700 transition rounded-2xl", children: [ /*#__PURE__*/ _jsx("span", { children: "\uD83D\uDC41 Preview" }), /*#__PURE__*/ _jsx("span", { className: "text-slate-300", children: expanded ? '▲' : '▼' }) ] }), expanded && /*#__PURE__*/ _jsx("div", { className: "flex flex-col gap-1 px-2 pb-2 border-t border-slate-100 pt-2", children: visiblePlans.length > 0 && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "text-slate-400 px-1 mt-2 mb-0.5", children: "Plan" }), visiblePlans.map((plan)=>/*#__PURE__*/ _jsxs("button", { disabled: loading, onClick: ()=>setPlan(plan.id === activePlanId ? null : plan.id), className: `flex items-center justify-between gap-2 px-3 py-1.5 rounded-xl transition text-left ${activePlanId === plan.id ? 'bg-indigo-600 text-white' : 'text-slate-600 hover:bg-slate-100'} ${loading ? 'opacity-50' : ''}`, children: [ /*#__PURE__*/ _jsx("span", { className: "truncate max-w-[90px]", children: plan.name }), /*#__PURE__*/ _jsx("span", { className: `px-1.5 py-0.5 rounded-full text-[10px] font-semibold ${activePlanId === plan.id ? 'bg-white/20 text-white' : TIER_COLORS[plan.tier] ?? TIER_COLORS.free}`, children: plan.tier }) ] }, plan.id)), activePlanId && /*#__PURE__*/ _jsx("button", { disabled: loading, onClick: ()=>setPlan(null), className: "px-3 py-1 rounded-xl text-slate-400 hover:text-red-500 hover:bg-red-50 transition text-left", children: "✕ No plan" }), hasOrigPlan && /*#__PURE__*/ _jsx("button", { disabled: loading, onClick: restorePlan, className: "px-3 py-1 rounded-xl text-green-600 hover:bg-green-50 transition text-left", children: "↩ Restore" }) ] }) }) ] }); } 70155undefined157196undefined198241undefined243294undefined296349undefined597603undefined664673(0,_lib_auth__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .wV)undefined697705(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined835842(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)undefined882889(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)undefined940947(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)undefined990997(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)undefined10431050(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)undefined10841089(0,react__WEBPACK_IMPORTED_MODULE_3__.useRef)undefined11531161(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)undefined12451253(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)undefined12731299falseundefined13021383{}undefined14521460(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)undefined15061513(0,_lib_api__WEBPACK_IMPORTED_MODULE_4__/* .getPlans */ .T9)undefined16351643(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)undefined22332247(0,_lib_api__WEBPACK_IMPORTED_MODULE_4__/* .updateAdminUser */ .wl)undefined28922896(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined31453149(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined34223425(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined35523555(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined37703773(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined39423946(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined39483956react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined40314034(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42554259(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined47714774(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined50125015(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54635466(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined58485851(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefinedyz ?webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SupportPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _components_Turnstile__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(32589); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceo5/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import { CAPTCHA_ENABLED, TurnstileWidget } from '@/components/Turnstile'; import { sendPublicSupportMessage } from '@/lib/api'; const SUPPORT_EMAIL = 'info@canhelp.gr'; const CONTENT = { el: { title: 'Υποστήριξη CanHelp', intro: 'Αν χρειάζεστε βοήθεια με την εφαρμογή, στείλτε μας email ή χρησιμοποιήστε τη φόρμα επικοινωνίας μέσα στην εφαρμογή.', points: [ 'Περιγράψτε σύντομα το πρόβλημα και, αν γίνεται, επισυνάψτε στιγμιότυπο οθόνης.', 'Αν το ζήτημα αφορά σύνδεση, αναφέρετε τη συσκευή και την έκδοση της εφαρμογής.', 'Απαντάμε συνήθως μέσα σε 1-2 εργάσιμες ημέρες.' ] }, en: { title: 'CanHelp Support', intro: 'If you need help with the app, email us or use the in-app contact form.', points: [ 'Briefly describe the issue and attach a screenshot if possible.', 'If it is a login problem, include your device and app version.', 'We usually reply within 1-2 business days.' ] }, ru: { title: 'Поддержка CanHelp', intro: 'Если вам нужна помощь с приложением, напишите нам на email или используйте форму связи в приложении.', points: [ 'Кратко опишите проблему и, если возможно, приложите скриншот.', 'Если проблема со входом, укажите устройство и версию приложения.', 'Обычно мы отвечаем в течение 1-2 рабочих дней.' ] }, uk: { title: 'Підтримка CanHelp', intro: 'Якщо вам потрібна допомога з додатком, напишіть нам на email або скористайтеся формою зв’язку в додатку.', points: [ 'Коротко опишіть проблему та, якщо можливо, додайте скріншот.', 'Якщо проблема зі входом, вкажіть пристрій і версію додатка.', 'Зазвичай ми відповідаємо протягом 1-2 робочих днів.' ] } }; export default function SupportPage() { const { locale, t } = useLocale(); const content = CONTENT[locale] ?? CONTENT.en; const [name, setName] = useState(''); const [email, setEmail] = useState(''); const [subject, setSubject] = useState(''); const [body, setBody] = useState(''); const [captchaToken, setCaptchaToken] = useState(CAPTCHA_ENABLED ? '' : 'dev'); const [loading, setLoading] = useState(false); const [sent, setSent] = useState(false); const [error, setError] = useState(''); async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); try { await sendPublicSupportMessage({ name: name.trim(), email: email.trim(), subject: subject.trim(), body: body.trim(), captchaToken }); setSent(true); } catch (err) { if ((err?.message || '').toLowerCase().includes('captcha')) { setError('Security check failed. Please try again.'); setCaptchaToken(''); } else { setError('Failed to send message. Please try again.'); } } finally{ setLoading(false); } } return /*#__PURE__*/ _jsx("main", { className: "py-12 px-4 sm:px-6", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10", children: [ /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs(Link, { href: "/", className: "text-sm text-green-600 hover:underline", children: [ "← ", t('nav.home') ] }) }), /*#__PURE__*/ _jsx("h1", { className: "text-3xl font-extrabold text-gray-900 mb-3", children: content.title }), /*#__PURE__*/ _jsx("p", { className: "text-gray-600 leading-relaxed", children: content.intro }), /*#__PURE__*/ _jsx("div", { className: "mt-8 space-y-3", children: content.points.map((point)=>/*#__PURE__*/ _jsxs("div", { className: "flex gap-3 items-start rounded-xl border border-gray-100 bg-gray-50 px-4 py-3 text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("span", { className: "mt-0.5 h-2 w-2 rounded-full bg-green-500 shrink-0" }), /*#__PURE__*/ _jsx("span", { children: point }) ] }, point)) }), /*#__PURE__*/ _jsxs("div", { className: "mt-8 flex flex-col sm:flex-row gap-3 sm:items-center", children: [ /*#__PURE__*/ _jsx("a", { href: `mailto:${SUPPORT_EMAIL}`, className: "inline-flex items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 transition", children: SUPPORT_EMAIL }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-500", children: t('nav.privacy') }) ] }), /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "mt-10 space-y-4 rounded-2xl border border-gray-100 bg-gray-50 p-5 sm:p-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-semibold text-gray-900 mb-1", children: "Send a message to support" }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: "We will forward it directly to the admin team." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Name" }), /*#__PURE__*/ _jsx("input", { value: name, onChange: (e)=>setName(e.target.value), required: true, minLength: 2, maxLength: 100, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "Your name" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Email" }), /*#__PURE__*/ _jsx("input", { type: "email", value: email, onChange: (e)=>setEmail(e.target.value), required: true, maxLength: 200, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "name@example.com" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Subject" }), /*#__PURE__*/ _jsx("input", { value: subject, onChange: (e)=>setSubject(e.target.value), required: true, minLength: 3, maxLength: 200, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "What do you need help with?" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Message" }), /*#__PURE__*/ _jsx("textarea", { value: body, onChange: (e)=>setBody(e.target.value), required: true, minLength: 10, maxLength: 5000, rows: 6, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500 resize-none", placeholder: "Describe the problem in detail" }) ] }), /*#__PURE__*/ _jsx("div", { children: /*#__PURE__*/ _jsx(TurnstileWidget, { onSuccess: setCaptchaToken, onError: ()=>setCaptchaToken(''), onExpire: ()=>setCaptchaToken('') }) }), error && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600", children: error }), sent ? /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-green-200 bg-green-50 px-4 py-3 text-sm text-green-800", children: "Your message has been sent." }) : /*#__PURE__*/ _jsx("button", { type: "submit", disabled: loading || CAPTCHA_ENABLED && !captchaToken, className: "inline-flex w-full items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 disabled:opacity-50", children: loading ? 'Sending...' : 'Send message' }) ] }) ] }) }); } c8={}_46j@N  : A d k   D K _ l o 14 VY_;?Y\orY ] !! %%o%r%h&k&))w)z)p*s*U-LX-----..//000 1(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .CAPTCHA_ENABLED */ .l(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .sendPublicSupportMessage */ .O8)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(next_link__WEBPACK_IMPORTED_MODULE_2___default())_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .TurnstileWidget */ .$__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SupportPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _components_Turnstile__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(32589); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); o5/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import { CAPTCHA_ENABLED, TurnstileWidget } from '@/components/Turnstile'; import { sendPublicSupportMessage } from '@/lib/api'; const SUPPORT_EMAIL = 'info@canhelp.gr'; const CONTENT = { el: { title: 'Υποστήριξη CanHelp', intro: 'Αν χρειάζεστε βοήθεια με την εφαρμογή, στείλτε μας email ή χρησιμοποιήστε τη φόρμα επικοινωνίας μέσα στην εφαρμογή.', points: [ 'Περιγράψτε σύντομα το πρόβλημα και, αν γίνεται, επισυνάψτε στιγμιότυπο οθόνης.', 'Αν το ζήτημα αφορά σύνδεση, αναφέρετε τη συσκευή και την έκδοση της εφαρμογής.', 'Απαντάμε συνήθως μέσα σε 1-2 εργάσιμες ημέρες.' ] }, en: { title: 'CanHelp Support', intro: 'If you need help with the app, email us or use the in-app contact form.', points: [ 'Briefly describe the issue and attach a screenshot if possible.', 'If it is a login problem, include your device and app version.', 'We usually reply within 1-2 business days.' ] }, ru: { title: 'Поддержка CanHelp', intro: 'Если вам нужна помощь с приложением, напишите нам на email или используйте форму связи в приложении.', points: [ 'Кратко опишите проблему и, если возможно, приложите скриншот.', 'Если проблема со входом, укажите устройство и версию приложения.', 'Обычно мы отвечаем в течение 1-2 рабочих дней.' ] }, uk: { title: 'Підтримка CanHelp', intro: 'Якщо вам потрібна допомога з додатком, напишіть нам на email або скористайтеся формою зв’язку в додатку.', points: [ 'Коротко опишіть проблему та, якщо можливо, додайте скріншот.', 'Якщо проблема зі входом, вкажіть пристрій і версію додатка.', 'Зазвичай ми відповідаємо протягом 1-2 робочих днів.' ] } }; export default function SupportPage() { const { locale, t } = useLocale(); const content = CONTENT[locale] ?? CONTENT.en; const [name, setName] = useState(''); const [email, setEmail] = useState(''); const [subject, setSubject] = useState(''); const [body, setBody] = useState(''); const [captchaToken, setCaptchaToken] = useState(CAPTCHA_ENABLED ? '' : 'dev'); const [loading, setLoading] = useState(false); const [sent, setSent] = useState(false); const [error, setError] = useState(''); async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); try { await sendPublicSupportMessage({ name: name.trim(), email: email.trim(), subject: subject.trim(), body: body.trim(), captchaToken }); setSent(true); } catch (err) { if ((err?.message || '').toLowerCase().includes('captcha')) { setError('Security check failed. Please try again.'); setCaptchaToken(''); } else { setError('Failed to send message. Please try again.'); } } finally{ setLoading(false); } } return /*#__PURE__*/ _jsx("main", { className: "py-12 px-4 sm:px-6", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10", children: [ /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs(Link, { href: "/", className: "text-sm text-green-600 hover:underline", children: [ "← ", t('nav.home') ] }) }), /*#__PURE__*/ _jsx("h1", { className: "text-3xl font-extrabold text-gray-900 mb-3", children: content.title }), /*#__PURE__*/ _jsx("p", { className: "text-gray-600 leading-relaxed", children: content.intro }), /*#__PURE__*/ _jsx("div", { className: "mt-8 space-y-3", children: content.points.map((point)=>/*#__PURE__*/ _jsxs("div", { className: "flex gap-3 items-start rounded-xl border border-gray-100 bg-gray-50 px-4 py-3 text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("span", { className: "mt-0.5 h-2 w-2 rounded-full bg-green-500 shrink-0" }), /*#__PURE__*/ _jsx("span", { children: point }) ] }, point)) }), /*#__PURE__*/ _jsxs("div", { className: "mt-8 flex flex-col sm:flex-row gap-3 sm:items-center", children: [ /*#__PURE__*/ _jsx("a", { href: `mailto:${SUPPORT_EMAIL}`, className: "inline-flex items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 transition", children: SUPPORT_EMAIL }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-500", children: t('nav.privacy') }) ] }), /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "mt-10 space-y-4 rounded-2xl border border-gray-100 bg-gray-50 p-5 sm:p-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-semibold text-gray-900 mb-1", children: "Send a message to support" }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: "We will forward it directly to the admin team." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Name" }), /*#__PURE__*/ _jsx("input", { value: name, onChange: (e)=>setName(e.target.value), required: true, minLength: 2, maxLength: 100, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "Your name" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Email" }), /*#__PURE__*/ _jsx("input", { type: "email", value: email, onChange: (e)=>setEmail(e.target.value), required: true, maxLength: 200, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "name@example.com" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Subject" }), /*#__PURE__*/ _jsx("input", { value: subject, onChange: (e)=>setSubject(e.target.value), required: true, minLength: 3, maxLength: 200, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "What do you need help with?" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Message" }), /*#__PURE__*/ _jsx("textarea", { value: body, onChange: (e)=>setBody(e.target.value), required: true, minLength: 10, maxLength: 5000, rows: 6, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500 resize-none", placeholder: "Describe the problem in detail" }) ] }), /*#__PURE__*/ _jsx("div", { children: /*#__PURE__*/ _jsx(TurnstileWidget, { onSuccess: setCaptchaToken, onError: ()=>setCaptchaToken(''), onExpire: ()=>setCaptchaToken('') }) }), error && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600", children: error }), sent ? /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-green-200 bg-green-50 px-4 py-3 text-sm text-green-800", children: "Your message has been sent." }) : /*#__PURE__*/ _jsx("button", { type: "submit", disabled: loading || CAPTCHA_ENABLED && !captchaToken, className: "inline-flex w-full items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 disabled:opacity-50", children: loading ? 'Sending...' : 'Send message' }) ] }) ] }) }); } F61123undefined125157undefined159187undefined189233undefined235308undefined310362undefined21122126undefined21782186(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined22702277(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined23142321(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined23622369(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24042411(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24622469(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24712485_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .CAPTCHA_ENABLED */ .lundefined25362543(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25812588(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26282635(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined27872810(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .sendPublicSupportMessage */ .O8)undefined34363439(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined35243528(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined37113714(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined38083812(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined38143817(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined41454148(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43294332(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined44994502(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined46344638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined48774880(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined50735076(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined52905294(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined54625465(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined58305833(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined60636067(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined63006304(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined64016404(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined66616664(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined69716975(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined71407144(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined72577260(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined75357538(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined82818285(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined83988401(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined86778680(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined94829486(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined95839586(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined98329835(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1051410518(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1061510618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1086410867(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1160511608(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1167111674(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1167611690_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .TurnstileWidget */ .$undefined1199311996(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1218512188(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1243212435(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1254212556_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .CAPTCHA_ENABLED */ .lundefinedno webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ CreateTaskPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13260); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(96484); /* harmony import */ var _context_location__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(56003); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(91864); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(48178); /* harmony import */ var _lib_formatLastSeen__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(49598); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(53863); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(88142); /* harmony import */ var _components_Turnstile__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(32589); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect, useRef } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { useLocation } from '@/context/location'; import { createTask, getCategories, getLocations, getSpecialists } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { TaskLocationPicker } from '@/components/TaskLocationPicker'; import { TaskCategoryPicker } from '@/components/TaskCategoryPicker'; import { TurnstileWidget } from '@/components/Turnstile'; import { CAPTCHA_ENABLED } from '@/components/Turnstile'; const API = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const localISO = (d)=>{ const y = d.getFullYear(); const m = String(d.getMonth() + 1).padStart(2, '0'); const day = String(d.getDate()).padStart(2, '0'); return `${y}-${m}-${day}`; }; export default function CreateTaskPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const searchParams = useSearchParams(); const preselectedCategory = searchParams.get('category') ?? ''; const { t, locale } = useLocale(); const [categories, setCategories] = useState([]); const [locations, setLocations] = useState([]); const [loading, setLoading] = useState(false); const [error, setError] = useState(''); const [topSpecialists, setTopSpecialists] = useState([]); const [deadline, setDeadline] = useState(()=>{ const d = new Date(); d.setDate(d.getDate() + 1); return localISO(d); }); const [expiresAtDays, setExpiresAtDays] = useState(30); const [calendarMonth, setCalendarMonth] = useState(()=>{ const d = new Date(); d.setDate(d.getDate() + 1); return localISO(d).slice(0, 7); }); const calendarInputRef = useRef(null); const [specialistAvailMap, setSpecialistAvailMap] = useState({}); const [invitedIds, setInvitedIds] = useState(new Set()); const [captchaToken, setCaptchaToken] = useState(CAPTCHA_ENABLED ? '' : 'dev'); const { locationSlug: ctxLocation } = useLocation(); const [selectedLocation, setSelectedLocation] = useState(''); const [selectedCategory, setSelectedCategory] = useState(preselectedCategory); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (ctxLocation) setSelectedLocation(ctxLocation); }, [ ctxLocation ]); const [images, setImages] = useState([]); const [photoUploading, setPhotoUploading] = useState(false); const fileInputRef = useRef(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isPending && !session) router.push('/login'); getCategories().then(setCategories).catch(()=>{}); getLocations().then(setLocations).catch(()=>{}); }, [ session, isPending ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!selectedCategory) { setTopSpecialists([]); return; } getSpecialists({ limit: '5', category: selectedCategory, locale }).then((r)=>setTopSpecialists(r.data)).catch(()=>{}); }, [ selectedCategory, locale ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!deadline || topSpecialists.length === 0) return; const month = deadline.slice(0, 7); const ids = topSpecialists.map((u)=>u.id); Promise.all(ids.map((id)=>fetch(`${API}/api/availability/user/${id}?month=${month}`, { credentials: 'include' }).then((r)=>r.ok ? r.json() : []).then((rows)=>{ const row = rows.find((r)=>r.date === deadline); return { id, status: row?.status ?? null }; }).catch(()=>({ id, status: null })))).then((results)=>{ const map = {}; results.forEach(({ id, status })=>{ map[id] = status; }); setSpecialistAvailMap(map); }); }, [ deadline, topSpecialists ]); async function handlePhotoChange(e) { const file = e.target.files?.[0]; if (!file) return; setPhotoUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch(`${API}/api/uploads`, { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); setImages((prev)=>[ ...prev, `${API}${url}` ]); } catch { setError(t('profile.upload.error')); } finally{ setPhotoUploading(false); if (fileInputRef.current) fileInputRef.current.value = ''; } } async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); const form = new FormData(e.currentTarget); const data = { title: form.get('title'), description: form.get('description'), category: form.get('category') || undefined, location: form.get('location') || undefined, budget: form.get('budget') ? Number(form.get('budget')) : undefined, budgetNegotiable: form.get('budgetNegotiable') === 'on', deadline: form.get('deadline') ? new Date(form.get('deadline')).toISOString() : undefined, expiresAt: (()=>{ const d = new Date(); d.setDate(d.getDate() + Number(form.get('expiresAtDays') || 30)); return d.toISOString(); })(), timeSlot: form.get('timeSlot') || undefined, district: form.get('district') || undefined, street: form.get('street') || undefined, houseNumber: form.get('houseNumber') || undefined, confidentialNote: form.get('confidentialNote') || undefined, images: images.length > 0 ? images : undefined, status: 'open', locale: locale, inviteSpecialistIds: invitedIds.size > 0 ? [ ...invitedIds ] : undefined }; try { const task = await createTask({ ...data, captchaToken }); router.push(`/tasks/${task.id}`); } catch (err) { setError(err.message || t('create.error')); } finally{ setLoading(false); } } if (isPending) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const todayMidnight = new Date(); todayMidnight.setHours(0, 0, 0, 0); const [cmYear, cmMonth] = calendarMonth.split('-').map(Number); const daysInMonth = new Date(cmYear, cmMonth, 0).getDate(); const calendarDates = []; for(let day = 1; day <= daysInMonth; day++){ const d = new Date(cmYear, cmMonth - 1, day); if (d >= todayMidnight) calendarDates.push(d); } const monthOptions = Array.from({ length: 12 }, (_, i)=>{ const d = new Date(); d.setDate(1); d.setMonth(d.getMonth() + i); return { value: localISO(d).slice(0, 7), label: d.toLocaleDateString(dateLocale, { month: 'long', year: 'numeric' }) }; }); const sidebarTitle = t('tasks.new.top_specialists'); return /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-3 sm:px-4 py-6 sm:py-8", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-xl sm:text-2xl font-bold text-white mb-4 sm:mb-6", children: t('create.title') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col lg:flex-row gap-6 lg:gap-8 items-start", children: [ /*#__PURE__*/ _jsx("div", { className: "flex-1 min-w-0 w-full", children: /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "bg-white rounded-xl border border-gray-200 p-4 sm:p-6 space-y-4 sm:space-y-5", children: [ error && /*#__PURE__*/ _jsx("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 sm:gap-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.category') }), /*#__PURE__*/ _jsx(TaskCategoryPicker, { categories: categories, locale: catLocale, value: selectedCategory, onChange: setSelectedCategory, placeholder: t('create.field.category.select') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.location') }), /*#__PURE__*/ _jsx(TaskLocationPicker, { locations: locations, value: selectedLocation, onChange: setSelectedLocation, anyLabel: t('create.field.location.any'), allLabel: t('create.field.location.all') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.title'), " ", /*#__PURE__*/ _jsx("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ _jsx("input", { name: "title", required: true, minLength: 5, maxLength: 200, placeholder: t('create.field.title.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.description'), " ", /*#__PURE__*/ _jsx("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ _jsx("textarea", { name: "description", required: true, minLength: 20, rows: 4, placeholder: t('create.field.description.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.budget') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3", children: [ /*#__PURE__*/ _jsx("input", { name: "budget", type: "number", min: 1, step: 1, placeholder: t('create.field.budget.placeholder'), className: "w-full sm:flex-1 border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-1.5 cursor-pointer select-none", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", name: "budgetNegotiable", className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('create.field.budget_negotiable') }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-2", children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm font-medium text-gray-700 shrink-0", children: t('create.field.deadline') }), /*#__PURE__*/ _jsx("select", { value: calendarMonth, onChange: (e)=>setCalendarMonth(e.target.value), className: "flex-1 border border-gray-300 rounded-lg px-2 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: monthOptions.map((mo)=>/*#__PURE__*/ _jsx("option", { value: mo.value, children: mo.label }, mo.value)) }), /*#__PURE__*/ _jsx("button", { type: "button", title: "Открыть календарь", onClick: ()=>{ try { calendarInputRef.current?.showPicker(); } catch { calendarInputRef.current?.click(); } }, className: "shrink-0 w-8 h-8 flex items-center justify-center rounded-lg border border-gray-300 text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: /*#__PURE__*/ _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }), /*#__PURE__*/ _jsx("line", { x1: "16", y1: "2", x2: "16", y2: "6" }), /*#__PURE__*/ _jsx("line", { x1: "8", y1: "2", x2: "8", y2: "6" }), /*#__PURE__*/ _jsx("line", { x1: "3", y1: "10", x2: "21", y2: "10" }) ] }) }), /*#__PURE__*/ _jsx("input", { ref: calendarInputRef, type: "date", min: localISO(todayMidnight), value: deadline, onChange: (e)=>{ if (!e.target.value) return; setDeadline(e.target.value); setCalendarMonth(e.target.value.slice(0, 7)); }, className: "absolute w-0 h-0 opacity-0 pointer-events-none" }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex gap-2 overflow-x-auto pb-1 snap-x snap-mandatory", children: calendarDates.map((d)=>{ const iso = localISO(d); const isSelected = deadline === iso; const dayName = d.toLocaleDateString(dateLocale, { weekday: 'short' }); const dayNum = d.getDate(); return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setDeadline(iso), className: `flex-shrink-0 snap-start flex flex-col items-center justify-center w-14 h-16 rounded-xl border-2 transition select-none ${isSelected ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-700 hover:border-green-300 hover:bg-gray-50'}`, children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium uppercase leading-none mb-0.5", children: dayName }), /*#__PURE__*/ _jsx("span", { className: "text-xl font-bold leading-none", children: dayNum }) ] }, iso); }) }), /*#__PURE__*/ _jsx("input", { type: "hidden", name: "deadline", value: deadline }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.expires_at') }), /*#__PURE__*/ _jsx("div", { className: "flex gap-2", children: [ 7, 14, 30, 60 ].map((days)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setExpiresAtDays(days), className: `flex-1 py-2 rounded-lg border-2 text-sm font-medium transition select-none ${expiresAtDays === days ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-700 hover:border-green-300'}`, children: [ days, " ", t('create.field.expires_at.days').replace('{n}', '') ] }, days)) }), /*#__PURE__*/ _jsx("input", { type: "hidden", name: "expiresAtDays", value: expiresAtDays }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.time_slot') }), /*#__PURE__*/ _jsxs("select", { name: "timeSlot", className: "w-full border border-gray-300 rounded-lg px-3 py-2", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('create.field.time_slot.any') }), /*#__PURE__*/ _jsx("option", { value: "morning", children: t('create.field.time_slot.morning') }), /*#__PURE__*/ _jsx("option", { value: "afternoon", children: t('create.field.time_slot.afternoon') }), /*#__PURE__*/ _jsx("option", { value: "evening", children: t('create.field.time_slot.evening') }), /*#__PURE__*/ _jsx("option", { value: "weekend", children: t('create.field.time_slot.weekend') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.photos') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-2 mb-2", children: [ images.map((url, i)=>/*#__PURE__*/ _jsxs("div", { className: "relative w-20 h-20 rounded-lg overflow-hidden border border-gray-200", children: [ /*#__PURE__*/ _jsx("img", { src: url, alt: "", className: "w-full h-full object-cover" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setImages((prev)=>prev.filter((_, j)=>j !== i)), className: "absolute top-0.5 right-0.5 bg-black/50 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs hover:bg-black/70", children: "\xd7" }) ] }, i)), images.length < 5 && /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>fileInputRef.current?.click(), disabled: photoUploading, className: "w-20 h-20 border-2 border-dashed border-gray-300 rounded-lg flex flex-col items-center justify-center text-gray-400 hover:border-green-400 hover:text-gray-400 text-xs disabled:opacity-50", children: photoUploading ? '...' : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl leading-none", children: "+" }), /*#__PURE__*/ _jsx("span", { children: t('create.field.photos.add') }) ] }) }) ] }), /*#__PURE__*/ _jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", className: "hidden", onChange: handlePhotoChange }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-3 p-3 bg-yellow-50 border border-yellow-200 rounded-xl", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-xs font-medium text-yellow-700 flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" }) }), "\uD83D\uDD12 ", t('create.field.confidential.hint') ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.address') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-2 sm:gap-3", children: [ /*#__PURE__*/ _jsx("input", { name: "district", placeholder: t('create.field.address.district'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }), /*#__PURE__*/ _jsx("input", { name: "street", placeholder: t('create.field.address.street'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }), /*#__PURE__*/ _jsx("input", { name: "houseNumber", placeholder: t('create.field.address.house'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.confidential') }), /*#__PURE__*/ _jsx("textarea", { name: "confidentialNote", rows: 2, placeholder: t('create.field.confidential.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none bg-white" }) ] }) ] }), /*#__PURE__*/ _jsx(TurnstileWidget, { onSuccess: setCaptchaToken, onError: ()=>setCaptchaToken(''), onExpire: ()=>setCaptchaToken('') }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: loading || !captchaToken, className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed", children: loading ? t('create.submitting') : t('create.submit') }) ] }) }), /*#__PURE__*/ _jsx("aside", { className: "hidden lg:block lg:w-64 shrink-0", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 mb-4 text-sm", children: sidebarTitle }), !selectedCategory ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 text-center py-4", children: t('tasks.new.select_category') }) : topSpecialists.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 text-center py-4", children: t('specialists.empty') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: topSpecialists.map((u)=>{ const name = formatShortName(u.firstName, u.lastName, u.name); const initials = `${u.firstName?.[0] ?? ''}${u.lastName?.[0] ?? ''}`.toUpperCase() || u.name?.[0]?.toUpperCase() || '?'; const seen = formatLastSeen(u.lastSeenAt, t); const avail = specialistAvailMap[u.id]; const isInvited = invitedIds.has(u.id); return /*#__PURE__*/ _jsxs("div", { className: "rounded-lg border border-gray-100 hover:bg-gray-50 transition", children: [ /*#__PURE__*/ _jsxs(Link, { href: `/users/${u.id}`, target: "_blank", rel: "noopener noreferrer", className: "flex items-center gap-3 p-2", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: u.image ? /*#__PURE__*/ _jsx("img", { src: u.image, alt: name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-900 truncate", children: name }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 flex-wrap", children: [ u.rating ? /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-500", children: [ "★ ", Number(u.rating).toFixed(1) ] }) : seen ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: seen }) : null, typeof u.reviewCount === 'number' && u.reviewCount > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400", children: [ u.reviewCount, " ", t('reviews.count') ] }), typeof u.positivePercent === 'number' && u.reviewCount > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-green-600", children: [ u.positivePercent, "% \uD83D\uDC4D" ] }), avail === 'available' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-0.5 text-xs font-medium text-green-700 bg-green-100 px-1.5 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), avail === 'busy' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-0.5 text-xs font-medium text-red-700 bg-red-100 px-1.5 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "px-2 pb-2", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setInvitedIds((prev)=>{ const next = new Set(prev); if (next.has(u.id)) next.delete(u.id); else next.add(u.id); return next; }), className: `w-full text-xs font-medium py-1 rounded-lg transition ${isInvited ? 'bg-green-600 text-white hover:bg-green-700' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'}`, children: isInvited ? t('tasks.new.invited') : t('tasks.new.invite') }) }) ] }, u.id); }) }) ] }) }) ] }) ] }); } @`=_#%LNz|57ln24lz~_'#*RYel?D_   N X ) 1 ! & f n  &_} !!S"V"""##$$%%6&9&''''))y*|*++++._../h0k011i4m444P6S677f:j:::<<<<??@@SBVBDDE_EEE:G=GIIuJxJ9N=NPPSSTT|VVXX\\__bbscvcsevef_fQgTg}hhj"jmmSoWooopp&r)rFsIsqtttuuvvxxxy%z)z{_{;|>|}}րـ;?AI܃߃'*Y]__bfiil"&ɝ̝Νܝ8;átw;IC_PAE>BDGcf>B<?'**-DVY"https://api.canhelp.gr"0(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)_components_Turnstile__WEBPACK_IMPORTED_MODULE_10__/* .CAPTCHA_ENABLED */ .l(0,_context_location__WEBPACK_IMPORTED_MODULE_6__/* .useLocation */ .z)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getCategories */ .bW)(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getLocations */ .Vs)(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getSpecialists */ .F7)(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .createTask */ .UT)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_9__/* .TaskCategoryPicker */ .W_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_8__/* .TaskLocationPicker */ .Vreact_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment_components_Turnstile__WEBPACK_IMPORTED_MODULE_10__/* .TurnstileWidget */ .$(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_11__/* .formatShortName */ .H)(0,_lib_formatLastSeen__WEBPACK_IMPORTED_MODULE_12__/* .formatLastSeen */ .V)(next_link__WEBPACK_IMPORTED_MODULE_3___default())u|__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ CreateTaskPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13260); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(96484); /* harmony import */ var _context_location__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(56003); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(91864); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(48178); /* harmony import */ var _lib_formatLastSeen__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(49598); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(53863); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(88142); /* harmony import */ var _components_Turnstile__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(32589); }/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect, useRef } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { useLocation } from '@/context/location'; import { createTask, getCategories, getLocations, getSpecialists } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { TaskLocationPicker } from '@/components/TaskLocationPicker'; import { TaskCategoryPicker } from '@/components/TaskCategoryPicker'; import { TurnstileWidget } from '@/components/Turnstile'; import { CAPTCHA_ENABLED } from '@/components/Turnstile'; const API = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const localISO = (d)=>{ const y = d.getFullYear(); const m = String(d.getMonth() + 1).padStart(2, '0'); const day = String(d.getDate()).padStart(2, '0'); return `${y}-${m}-${day}`; }; export default function CreateTaskPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const searchParams = useSearchParams(); const preselectedCategory = searchParams.get('category') ?? ''; const { t, locale } = useLocale(); const [categories, setCategories] = useState([]); const [locations, setLocations] = useState([]); const [loading, setLoading] = useState(false); const [error, setError] = useState(''); const [topSpecialists, setTopSpecialists] = useState([]); const [deadline, setDeadline] = useState(()=>{ const d = new Date(); d.setDate(d.getDate() + 1); return localISO(d); }); const [expiresAtDays, setExpiresAtDays] = useState(30); const [calendarMonth, setCalendarMonth] = useState(()=>{ const d = new Date(); d.setDate(d.getDate() + 1); return localISO(d).slice(0, 7); }); const calendarInputRef = useRef(null); const [specialistAvailMap, setSpecialistAvailMap] = useState({}); const [invitedIds, setInvitedIds] = useState(new Set()); const [captchaToken, setCaptchaToken] = useState(CAPTCHA_ENABLED ? '' : 'dev'); const { locationSlug: ctxLocation } = useLocation(); const [selectedLocation, setSelectedLocation] = useState(''); const [selectedCategory, setSelectedCategory] = useState(preselectedCategory); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (ctxLocation) setSelectedLocation(ctxLocation); }, [ ctxLocation ]); const [images, setImages] = useState([]); const [photoUploading, setPhotoUploading] = useState(false); const fileInputRef = useRef(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isPending && !session) router.push('/login'); getCategories().then(setCategories).catch(()=>{}); getLocations().then(setLocations).catch(()=>{}); }, [ session, isPending ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!selectedCategory) { setTopSpecialists([]); return; } getSpecialists({ limit: '5', category: selectedCategory, locale }).then((r)=>setTopSpecialists(r.data)).catch(()=>{}); }, [ selectedCategory, locale ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!deadline || topSpecialists.length === 0) return; const month = deadline.slice(0, 7); const ids = topSpecialists.map((u)=>u.id); Promise.all(ids.map((id)=>fetch(`${API}/api/availability/user/${id}?month=${month}`, { credentials: 'include' }).then((r)=>r.ok ? r.json() : []).then((rows)=>{ const row = rows.find((r)=>r.date === deadline); return { id, status: row?.status ?? null }; }).catch(()=>({ id, status: null })))).then((results)=>{ const map = {}; results.forEach(({ id, status })=>{ map[id] = status; }); setSpecialistAvailMap(map); }); }, [ deadline, topSpecialists ]); async function handlePhotoChange(e) { const file = e.target.files?.[0]; if (!file) return; setPhotoUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch(`${API}/api/uploads`, { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); setImages((prev)=>[ ...prev, `${API}${url}` ]); } catch { setError(t('profile.upload.error')); } finally{ setPhotoUploading(false); if (fileInputRef.current) fileInputRef.current.value = ''; } } async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); const form = new FormData(e.currentTarget); const data = { title: form.get('title'), description: form.get('description'), category: form.get('category') || undefined, location: form.get('location') || undefined, budget: form.get('budget') ? Number(form.get('budget')) : undefined, budgetNegotiable: form.get('budgetNegotiable') === 'on', deadline: form.get('deadline') ? new Date(form.get('deadline')).toISOString() : undefined, expiresAt: (()=>{ const d = new Date(); d.setDate(d.getDate() + Number(form.get('expiresAtDays') || 30)); return d.toISOString(); })(), timeSlot: form.get('timeSlot') || undefined, district: form.get('district') || undefined, street: form.get('street') || undefined, houseNumber: form.get('houseNumber') || undefined, confidentialNote: form.get('confidentialNote') || undefined, images: images.length > 0 ? images : undefined, status: 'open', locale: locale, inviteSpecialistIds: invitedIds.size > 0 ? [ ...invitedIds ] : undefined }; try { const task = await createTask({ ...data, captchaToken }); router.push(`/tasks/${task.id}`); } catch (err) { setError(err.message || t('create.error')); } finally{ setLoading(false); } } if (isPending) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const todayMidnight = new Date(); todayMidnight.setHours(0, 0, 0, 0); const [cmYear, cmMonth] = calendarMonth.split('-').map(Number); const daysInMonth = new Date(cmYear, cmMonth, 0).getDate(); const calendarDates = []; for(let day = 1; day <= daysInMonth; day++){ const d = new Date(cmYear, cmMonth - 1, day); if (d >= todayMidnight) calendarDates.push(d); } const monthOptions = Array.from({ length: 12 }, (_, i)=>{ const d = new Date(); d.setDate(1); d.setMonth(d.getMonth() + i); return { value: localISO(d).slice(0, 7), label: d.toLocaleDateString(dateLocale, { month: 'long', year: 'numeric' }) }; }); const sidebarTitle = t('tasks.new.top_specialists'); return /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-3 sm:px-4 py-6 sm:py-8", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-xl sm:text-2xl font-bold text-white mb-4 sm:mb-6", children: t('create.title') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col lg:flex-row gap-6 lg:gap-8 items-start", children: [ /*#__PURE__*/ _jsx("div", { className: "flex-1 min-w-0 w-full", children: /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "bg-white rounded-xl border border-gray-200 p-4 sm:p-6 space-y-4 sm:space-y-5", children: [ error && /*#__PURE__*/ _jsx("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 sm:gap-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.category') }), /*#__PURE__*/ _jsx(TaskCategoryPicker, { categories: categories, locale: catLocale, value: selectedCategory, onChange: setSelectedCategory, placeholder: t('create.field.category.select') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.location') }), /*#__PURE__*/ _jsx(TaskLocationPicker, { locations: locations, value: selectedLocation, onChange: setSelectedLocation, anyLabel: t('create.field.location.any'), allLabel: t('create.field.location.all') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.title'), " ", /*#__PURE__*/ _jsx("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ _jsx("input", { name: "title", required: true, minLength: 5, maxLength: 200, placeholder: t('create.field.title.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.description'), " ", /*#__PURE__*/ _jsx("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ _jsx("textarea", { name: "description", required: true, minLength: 20, rows: 4, placeholder: t('create.field.description.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.budget') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3", children: [ /*#__PURE__*/ _jsx("input", { name: "budget", type: "number", min: 1, step: 1, placeholder: t('create.field.budget.placeholder'), className: "w-full sm:flex-1 border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-1.5 cursor-pointer select-none", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", name: "budgetNegotiable", className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('create.field.budget_negotiable') }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-2", children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm font-medium text-gray-700 shrink-0", children: t('create.field.deadline') }), /*#__PURE__*/ _jsx("select", { value: calendarMonth, onChange: (e)=>setCalendarMonth(e.target.value), className: "flex-1 border border-gray-300 rounded-lg px-2 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: monthOptions.map((mo)=>/*#__PURE__*/ _jsx("option", { value: mo.value, children: mo.label }, mo.value)) }), /*#__PURE__*/ _jsx("button", { type: "button", title: "Открыть календарь", onClick: ()=>{ try { calendarInputRef.current?.showPicker(); } catch { calendarInputRef.current?.click(); } }, className: "shrink-0 w-8 h-8 flex items-center justify-center rounded-lg border border-gray-300 text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: /*#__PURE__*/ _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }), /*#__PURE__*/ _jsx("line", { x1: "16", y1: "2", x2: "16", y2: "6" }), /*#__PURE__*/ _jsx("line", { x1: "8", y1: "2", x2: "8", y2: "6" }), /*#__PURE__*/ _jsx("line", { x1: "3", y1: "10", x2: "21", y2: "10" }) ] }) }), /*#__PURE__*/ _jsx("input", { ref: calendarInputRef, type: "date", min: localISO(todayMidnight), value: deadline, onChange: (e)=>{ if (!e.target.value) return; setDeadline(e.target.value); setCalendarMonth(e.target.value.slice(0, 7)); }, className: "absolute w-0 h-0 opacity-0 pointer-events-none" }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex gap-2 overflow-x-auto pb-1 snap-x snap-mandatory", children: calendarDates.map((d)=>{ const iso = localISO(d); const isSelected = deadline === iso; const dayName = d.toLocaleDateString(dateLocale, { weekday: 'short' }); const dayNum = d.getDate(); return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setDeadline(iso), className: `flex-shrink-0 snap-start flex flex-col items-center justify-center w-14 h-16 rounded-xl border-2 transition select-none ${isSelected ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-700 hover:border-green-300 hover:bg-gray-50'}`, children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium uppercase leading-none mb-0.5", children: dayName }), /*#__PURE__*/ _jsx("span", { className: "text-xl font-bold leading-none", children: dayNum }) ] }, iso); }) }), /*#__PURE__*/ _jsx("input", { type: "hidden", name: "deadline", value: deadline }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.expires_at') }), /*#__PURE__*/ _jsx("div", { className: "flex gap-2", children: [ 7, 14, 30, 60 ].map((days)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setExpiresAtDays(days), className: `flex-1 py-2 rounded-lg border-2 text-sm font-medium transition select-none ${expiresAtDays === days ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-700 hover:border-green-300'}`, children: [ days, " ", t('create.field.expires_at.days').replace('{n}', '') ] }, days)) }), /*#__PURE__*/ _jsx("input", { type: "hidden", name: "expiresAtDays", value: expiresAtDays }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.time_slot') }), /*#__PURE__*/ _jsxs("select", { name: "timeSlot", className: "w-full border border-gray-300 rounded-lg px-3 py-2", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('create.field.time_slot.any') }), /*#__PURE__*/ _jsx("option", { value: "morning", children: t('create.field.time_slot.morning') }), /*#__PURE__*/ _jsx("option", { value: "afternoon", children: t('create.field.time_slot.afternoon') }), /*#__PURE__*/ _jsx("option", { value: "evening", children: t('create.field.time_slot.evening') }), /*#__PURE__*/ _jsx("option", { value: "weekend", children: t('create.field.time_slot.weekend') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.photos') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-2 mb-2", children: [ images.map((url, i)=>/*#__PURE__*/ _jsxs("div", { className: "relative w-20 h-20 rounded-lg overflow-hidden border border-gray-200", children: [ /*#__PURE__*/ _jsx("img", { src: url, alt: "", className: "w-full h-full object-cover" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setImages((prev)=>prev.filter((_, j)=>j !== i)), className: "absolute top-0.5 right-0.5 bg-black/50 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs hover:bg-black/70", children: "\xd7" }) ] }, i)), images.length < 5 && /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>fileInputRef.current?.click(), disabled: photoUploading, className: "w-20 h-20 border-2 border-dashed border-gray-300 rounded-lg flex flex-col items-center justify-center text-gray-400 hover:border-green-400 hover:text-gray-400 text-xs disabled:opacity-50", children: photoUploading ? '...' : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl leading-none", children: "+" }), /*#__PURE__*/ _jsx("span", { children: t('create.field.photos.add') }) ] }) }) ] }), /*#__PURE__*/ _jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", className: "hidden", onChange: handlePhotoChange }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-3 p-3 bg-yellow-50 border border-yellow-200 rounded-xl", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-xs font-medium text-yellow-700 flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" }) }), "\uD83D\uDD12 ", t('create.field.confidential.hint') ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.address') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-2 sm:gap-3", children: [ /*#__PURE__*/ _jsx("input", { name: "district", placeholder: t('create.field.address.district'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }), /*#__PURE__*/ _jsx("input", { name: "street", placeholder: t('create.field.address.street'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }), /*#__PURE__*/ _jsx("input", { name: "houseNumber", placeholder: t('create.field.address.house'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.confidential') }), /*#__PURE__*/ _jsx("textarea", { name: "confidentialNote", rows: 2, placeholder: t('create.field.confidential.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none bg-white" }) ] }) ] }), /*#__PURE__*/ _jsx(TurnstileWidget, { onSuccess: setCaptchaToken, onError: ()=>setCaptchaToken(''), onExpire: ()=>setCaptchaToken('') }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: loading || !captchaToken, className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed", children: loading ? t('create.submitting') : t('create.submit') }) ] }) }), /*#__PURE__*/ _jsx("aside", { className: "hidden lg:block lg:w-64 shrink-0", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 mb-4 text-sm", children: sidebarTitle }), !selectedCategory ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 text-center py-4", children: t('tasks.new.select_category') }) : topSpecialists.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 text-center py-4", children: t('specialists.empty') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: topSpecialists.map((u)=>{ const name = formatShortName(u.firstName, u.lastName, u.name); const initials = `${u.firstName?.[0] ?? ''}${u.lastName?.[0] ?? ''}`.toUpperCase() || u.name?.[0]?.toUpperCase() || '?'; const seen = formatLastSeen(u.lastSeenAt, t); const avail = specialistAvailMap[u.id]; const isInvited = invitedIds.has(u.id); return /*#__PURE__*/ _jsxs("div", { className: "rounded-lg border border-gray-100 hover:bg-gray-50 transition", children: [ /*#__PURE__*/ _jsxs(Link, { href: `/users/${u.id}`, target: "_blank", rel: "noopener noreferrer", className: "flex items-center gap-3 p-2", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: u.image ? /*#__PURE__*/ _jsx("img", { src: u.image, alt: name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-900 truncate", children: name }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 flex-wrap", children: [ u.rating ? /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-500", children: [ "★ ", Number(u.rating).toFixed(1) ] }) : seen ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: seen }) : null, typeof u.reviewCount === 'number' && u.reviewCount > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400", children: [ u.reviewCount, " ", t('reviews.count') ] }), typeof u.positivePercent === 'number' && u.reviewCount > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-green-600", children: [ u.positivePercent, "% \uD83D\uDC4D" ] }), avail === 'available' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-0.5 text-xs font-medium text-green-700 bg-green-100 px-1.5 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), avail === 'busy' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-0.5 text-xs font-medium text-red-700 bg-red-100 px-1.5 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "px-2 pb-2", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setInvitedIds((prev)=>{ const next = new Set(prev); if (next.has(u.id)) next.delete(u.id); else next.add(u.id); return next; }), className: `w-full text-xs font-medium py-1 rounded-lg transition ${isInvited ? 'bg-green-600 text-white hover:bg-green-700' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'}`, children: isInvited ? t('tasks.new.invited') : t('tasks.new.invite') }) }) ] }, u.id); }) }) ] }) }) ] }) ] }); } *61146undefined148199undefined201261undefined263291undefined293332undefined334378undefined380428undefined430513undefined515565undefined567620undefined622690undefined692760undefined762818undefined820876undefined890920"https://api.canhelp.gr"undefined9259470undefined11501164undefined12341243(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined12671275(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined13051319(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)undefined14181426(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)undefined14711478(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15231530(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15711578(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined16181625(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined16801687(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined17301737(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined18931900(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined19531960(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined21112116(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined21812188(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined22352242(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined23002307(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined23092323_components_Turnstile__WEBPACK_IMPORTED_MODULE_10__/* .CAPTCHA_ENABLED */ .lundefined23822392(0,_context_location__WEBPACK_IMPORTED_MODULE_6__/* .useLocation */ .z)undefined24492456(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25152522(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26012609(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined27452752(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined28072814(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined28492854(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined29182926(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined30013013(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getCategories */ .bW)undefined30603071(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getLocations */ .Vs)undefined32163224(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined33383351(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getSpecialists */ .F7)undefined36143622(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined68106819(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .createTask */ .UT)undefined71257128(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined83178321(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined84448447(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined86278631(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined87878790(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined89098913(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined91919194(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined94359439(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined96499653(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined97829785(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1011210115(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1011710134_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_9__/* .TaskCategoryPicker */ .Wundefined1074010744(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1087310876(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1120311206(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1120811225_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_8__/* .TaskLocationPicker */ .Vundefined1191111915(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1202812032(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1239212395(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1274712750(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1341713421(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1353413538(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1390413907(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1425914262(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1495014954(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1506715070(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1536315367(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1561115614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1627916283(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1654916552(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1697916982(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1756917573(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1768617690(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1790617909(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1823418237(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1870418707(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1906119064(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2002520029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2065320656(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2125021253(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2169621699(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2214022143(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2273922742(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2375023753(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2447824482(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2511225115(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2545925462(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2597125974(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2633226336(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2644926452(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2674926752(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2716627170(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2812828131(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2849928503(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2861628619(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2891528919(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2922229225(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2951029513(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2980929812(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3011230115(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3041130414(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3085630860(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3097330976(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3126931273(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3150731511(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3180331806(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3220632209(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3298232985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3359533599(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3360133609react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined3375633759(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3408734090(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3457634579(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3507635080(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3530635310(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3555535558(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3600936012(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3674736751(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3688036883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3720937213(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3747137474(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3799037993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3850538508(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3920239206(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3933539338(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3966939672(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4039340396(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4039840412_components_Turnstile__WEBPACK_IMPORTED_MODULE_10__/* .TurnstileWidget */ .$undefined4070340706(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4127241275(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4140741411(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4161141614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4187641879(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4213542138(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4235642359(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4255542569(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_11__/* .formatShortName */ .H)undefined4281942832(0,_lib_formatLastSeen__WEBPACK_IMPORTED_MODULE_12__/* .formatLastSeen */ .V)undefined4307343077(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4332643330(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4333243335(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined4379443797(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4413144134(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4460644610(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4486044863(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4522645230(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4553645540(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4611946122(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4656146565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4735547359(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4803048034(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4842648429(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4903749041(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4942949432(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5035250355(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5051850521(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined~cd webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource9/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ LocationProvider: () => (/* binding */ LocationProvider), /* harmony export */ z: () => (/* binding */ useLocation) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(91864); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceB /* __next_internal_client_entry_do_not_use__ LocationProvider,useLocation auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { createContext, useContext, useState, useEffect, useCallback } from 'react'; import { getLocations } from '@/lib/api'; const LocationContext = /*#__PURE__*/ createContext({ locationSlug: '', locationTree: [], locationLoading: true, setLocation: ()=>{}, getLabel: ()=>'' }); function readCookieLocation() { if (typeof document === 'undefined') return ''; const match = document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/); return match?.[1] ? decodeURIComponent(match[1]) : ''; } export function LocationProvider({ children, initialSlug = '' }) { const [locationSlug, setLocationSlug] = useState(initialSlug); const [locationTree, setLocationTree] = useState([]); const [locationLoading, setLocationLoading] = useState(true); // Sync from cookie on client mount process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ const cookieSlug = readCookieLocation(); setLocationSlug(cookieSlug); }, []); // Load location tree once process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ getLocations().then((tree)=>setLocationTree(tree)).catch(()=>{}).finally(()=>setLocationLoading(false)); }, []); const setLocation = useCallback((slug)=>{ setLocationSlug(slug); const encoded = encodeURIComponent(slug); document.cookie = `canhelp_location=${encoded}; path=/; max-age=31536000; SameSite=Lax`; }, []); const getLabel = useCallback((locale)=>{ if (!locationSlug) return ''; for (const city of locationTree){ if (city.slug === locationSlug) return city.names[locale] ?? city.names.el; for (const d of city.children ?? []){ if (d.slug === locationSlug) return d.names[locale] ?? d.names.el; } } return locationSlug; }, [ locationSlug, locationTree ]); return /*#__PURE__*/ _jsx(LocationContext.Provider, { value: { locationSlug, locationTree, locationLoading, setLocation, getLabel }, children: children }); } export function useLocation() { return useContext(LocationContext); } aR^(4CJ_iHR# , (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(0,_lib_api__WEBPACK_IMPORTED_MODULE_2__/* .getLocations */ .Vs)(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)j /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ LocationProvider: () => (/* binding */ LocationProvider), /* harmony export */ z: () => (/* binding */ useLocation) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(91864); /* __next_internal_client_entry_do_not_use__ LocationProvider,useLocation auto */ const LocationContext = /*#__PURE__*/ (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({ locationSlug: '', locationTree: [], locationLoading: true, setLocation: ()=>{}, getLabel: ()=>'' }); function readCookieLocation() { if (typeof document === 'undefined') return ''; const match = document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/); return match?.[1] ? decodeURIComponent(match[1]) : ''; } function LocationProvider({ children, initialSlug = '' }) { const [locationSlug, setLocationSlug] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialSlug); const [locationTree, setLocationTree] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [locationLoading, setLocationLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); // Sync from cookie on client mount process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const cookieSlug = readCookieLocation(); setLocationSlug(cookieSlug); }, []); // Load location tree once process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ (0,_lib_api__WEBPACK_IMPORTED_MODULE_2__/* .getLocations */ .Vs)().then((tree)=>setLocationTree(tree)).catch(()=>{}).finally(()=>setLocationLoading(false)); }, []); const setLocation = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((slug)=>{ setLocationSlug(slug); const encoded = encodeURIComponent(slug); document.cookie = `canhelp_location=${encoded}; path=/; max-age=31536000; SameSite=Lax`; }, []); const getLabel = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((locale)=>{ if (!locationSlug) return ''; for (const city of locationTree){ if (city.slug === locationSlug) return city.names[locale] ?? city.names.el; for (const d of city.children ?? []){ if (d.slug === locationSlug) return d.names[locale] ?? d.names.el; } } return locationSlug; }, [ locationSlug, locationTree ]); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(LocationContext.Provider, { value: { locationSlug, locationTree, locationLoading, setLocation, getLabel }, children: children }); } function useLocation() { return (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(LocationContext); } kn o9/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ LocationProvider: () => (/* binding */ LocationProvider), /* harmony export */ z: () => (/* binding */ useLocation) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(91864); pB /* __next_internal_client_entry_do_not_use__ LocationProvider,useLocation auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { createContext, useContext, useState, useEffect, useCallback } from 'react'; import { getLocations } from '@/lib/api'; const LocationContext = /*#__PURE__*/ createContext({ locationSlug: '', locationTree: [], locationLoading: true, setLocation: ()=>{}, getLabel: ()=>'' }); function readCookieLocation() { if (typeof document === 'undefined') return ''; const match = document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/); return match?.[1] ? decodeURIComponent(match[1]) : ''; } export function LocationProvider({ children, initialSlug = '' }) { const [locationSlug, setLocationSlug] = useState(initialSlug); const [locationTree, setLocationTree] = useState([]); const [locationLoading, setLocationLoading] = useState(true); // Sync from cookie on client mount process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ const cookieSlug = readCookieLocation(); setLocationSlug(cookieSlug); }, []); // Load location tree once process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ getLocations().then((tree)=>setLocationTree(tree)).catch(()=>{}).finally(()=>setLocationLoading(false)); }, []); const setLocation = useCallback((slug)=>{ setLocationSlug(slug); const encoded = encodeURIComponent(slug); document.cookie = `canhelp_location=${encoded}; path=/; max-age=31536000; SameSite=Lax`; }, []); const getLabel = useCallback((locale)=>{ if (!locationSlug) return ''; for (const city of locationTree){ if (city.slug === locationSlug) return city.names[locale] ?? city.names.el; for (const d of city.children ?? []){ if (d.slug === locationSlug) return d.names[locale] ?? d.names.el; } } return locationSlug; }, [ locationSlug, locationTree ]); return /*#__PURE__*/ _jsx(LocationContext.Provider, { value: { locationSlug, locationTree, locationLoading, setLocation, getLabel }, children: children }); } export function useLocation() { return useContext(LocationContext); } +82129undefined131214undefined216256undefined296308(0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)undefined657663undefined768775(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined835842(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined899906(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10101018(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined12101218(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined12341245(0,_lib_api__WEBPACK_IMPORTED_MODULE_2__/* .getLocations */ .Vs)undefined13751385(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined16081618(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined20712074(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined22962302undefined23392348(0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)undefinedqrtuVW fwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource&/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $7: () => (/* binding */ updateCategory), /* harmony export */ $H: () => (/* binding */ acceptOffer), /* harmony export */ $M: () => (/* binding */ getUnreadCount), /* harmony export */ Bb: () => (/* binding */ getMySpecialistCards), /* harmony export */ Bm: () => (/* binding */ getUserRating), /* harmony export */ Bq: () => (/* binding */ getSpecialistCards), /* harmony export */ Br: () => (/* binding */ getAdminNotifLogs), /* harmony export */ C0: () => (/* binding */ applyMyReferral), /* harmony export */ CX: () => (/* binding */ updateAdminSettings), /* harmony export */ Ck: () => (/* binding */ getPriceList), /* harmony export */ Cs: () => (/* binding */ previewPlanChange), /* harmony export */ D1: () => (/* binding */ setAvailabilityRange), /* harmony export */ Em: () => (/* binding */ request), /* harmony export */ F7: () => (/* binding */ getSpecialists), /* harmony export */ F9: () => (/* binding */ getTaskInvite), /* harmony export */ FI: () => (/* binding */ sendTestEmail), /* harmony export */ Fu: () => (/* binding */ getMyTasks), /* harmony export */ GB: () => (/* binding */ deleteTaskAdmin), /* harmony export */ GE: () => (/* binding */ getSkillDedup), /* harmony export */ Gp: () => (/* binding */ getAutoResponseSettings), /* harmony export */ H: () => (/* binding */ getMyDashboard), /* harmony export */ H6: () => (/* binding */ getTaskReviews), /* harmony export */ He: () => (/* binding */ activateUser), /* harmony export */ I: () => (/* binding */ autoTranslateTasks), /* harmony export */ Ic: () => (/* binding */ deletePriceListGroup), /* harmony export */ Ip: () => (/* binding */ markRead), /* harmony export */ Je: () => (/* binding */ purchasePlan), /* harmony export */ K7: () => (/* binding */ deleteCategory), /* harmony export */ KD: () => (/* binding */ getAdminCategories), /* harmony export */ KZ: () => (/* binding */ getAdminSupportTickets), /* harmony export */ Lb: () => (/* binding */ declineOffer), /* harmony export */ Lp: () => (/* binding */ getAdminEmailTemplates), /* harmony export */ ML: () => (/* binding */ getCustomerFomoDashboard), /* harmony export */ Mm: () => (/* binding */ changeUserRole), /* harmony export */ NL: () => (/* binding */ markAllRead), /* harmony export */ Nt: () => (/* binding */ updateLocation), /* harmony export */ O8: () => (/* binding */ sendPublicSupportMessage), /* harmony export */ OM: () => (/* binding */ setAvailability), /* harmony export */ OV: () => (/* binding */ runAutoMatch), /* harmony export */ OX: () => (/* binding */ getAdminPlans), /* harmony export */ On: () => (/* binding */ getCanMessage), /* harmony export */ P0: () => (/* binding */ adminTopUpUserBalance), /* harmony export */ QN: () => (/* binding */ getOrCreateDirectRoom), /* harmony export */ QY: () => (/* binding */ getTasksTranslationPreview), /* harmony export */ RN: () => (/* binding */ getSiteStats), /* harmony export */ RQ: () => (/* binding */ updateAutoResponseSettings), /* harmony export */ Rt: () => (/* binding */ completeTask), /* harmony export */ S$: () => (/* binding */ getPublicSiteProfile), /* harmony export */ S9: () => (/* binding */ createSkill), /* harmony export */ Sw: () => (/* binding */ getOffers), /* harmony export */ T9: () => (/* binding */ getPlans), /* harmony export */ Tr: () => (/* binding */ getNotifications), /* harmony export */ U9: () => (/* binding */ deletePriceListItem), /* harmony export */ UE: () => (/* binding */ trackSiteMessage), /* harmony export */ UT: () => (/* binding */ createTask), /* harmony export */ Uq: () => (/* binding */ mergeSkillDuplicates), /* harmony export */ V: () => (/* binding */ addSpecialistFavorite), /* harmony export */ V7: () => (/* binding */ adminBroadcastPush), /* harmony export */ VL: () => (/* binding */ getMessages), /* harmony export */ VM: () => (/* binding */ getUserProfile), /* harmony export */ Vs: () => (/* binding */ getLocations), /* harmony export */ Wi: () => (/* binding */ deactivateUser), /* harmony export */ Xz: () => (/* binding */ getSpecialistAvailability), /* harmony export */ YQ: () => (/* binding */ getTranslationsStats), /* harmony export */ Yj: () => (/* binding */ getAdminTasks), /* harmony export */ Z2: () => (/* binding */ createPriceListItem), /* harmony export */ Zp: () => (/* binding */ getChatRooms), /* harmony export */ _z: () => (/* binding */ sendMessage), /* harmony export */ aT: () => (/* binding */ getMyOffers), /* harmony export */ bR: () => (/* binding */ deletePlan), /* harmony export */ bW: () => (/* binding */ getCategories), /* harmony export */ bc: () => (/* binding */ toggleStatus), /* harmony export */ bi: () => (/* binding */ getAdminNotifStats), /* harmony export */ bx: () => (/* binding */ createReview), /* harmony export */ cJ: () => (/* binding */ getAdminReferrals), /* harmony export */ cS: () => (/* binding */ getAdminUsers), /* harmony export */ cl: () => (/* binding */ verifyTelegramToken), /* harmony export */ cp: () => (/* binding */ autoTranslate), /* harmony export */ dE: () => (/* binding */ getAdminStats), /* harmony export */ eR: () => (/* binding */ createSpecialistCard), /* harmony export */ eU: () => (/* binding */ updateReportStatus), /* harmony export */ ew: () => (/* binding */ getPlanHistory), /* harmony export */ f5: () => (/* binding */ deleteSpecialistCard), /* harmony export */ fP: () => (/* binding */ updateSkill), /* harmony export */ fm: () => (/* binding */ getBalanceHistory), /* harmony export */ fu: () => (/* binding */ autoTranslateEmailTemplates), /* harmony export */ g0: () => (/* binding */ getAdminBalanceHistory), /* harmony export */ g1: () => (/* binding */ adminSendPushToUser), /* harmony export */ gg: () => (/* binding */ getTask), /* harmony export */ hD: () => (/* binding */ adminWithdrawUserBalance), /* harmony export */ hl: () => (/* binding */ updatePortfolioItem), /* harmony export */ hp: () => (/* binding */ deleteSkill), /* harmony export */ iN: () => (/* binding */ getMyAvailability), /* harmony export */ i_: () => (/* binding */ getAdminSkills), /* harmony export */ j_: () => (/* binding */ getAdminAiLogs), /* harmony export */ jd: () => (/* binding */ getAdminUser), /* harmony export */ jg: () => (/* binding */ updateAdminEmailTemplate), /* harmony export */ k_: () => (/* binding */ getAdminLocations), /* harmony export */ lC: () => (/* binding */ updateTask), /* harmony export */ mq: () => (/* binding */ createSupportTicket), /* harmony export */ nT: () => (/* binding */ replyToSupportTicket), /* harmony export */ nf: () => (/* binding */ cancelTaskAdmin), /* harmony export */ oD: () => (/* binding */ updatePriceListGroup), /* harmony export */ oh: () => (/* binding */ initiateTopUp), /* harmony export */ oq: () => (/* binding */ adminUpdateSpecialistCard), /* harmony export */ pD: () => (/* binding */ getSpecialistFavorites), /* harmony export */ pK: () => (/* binding */ getPaymentHistory), /* harmony export */ q7: () => (/* binding */ getMyReviews), /* harmony export */ qT: () => (/* binding */ createPlan), /* harmony export */ qX: () => (/* binding */ testTelegramConnection), /* harmony export */ qt: () => (/* binding */ getAdminMailLogs), /* harmony export */ rC: () => (/* binding */ getAdminSettings), /* harmony export */ rl: () => (/* binding */ getSkillSuggestions), /* harmony export */ sD: () => (/* binding */ removeSpecialistFavorite), /* harmony export */ s_: () => (/* binding */ getAdminSpecialistCards), /* harmony export */ st: () => (/* binding */ getMyReferralInfo), /* harmony export */ td: () => (/* binding */ updatePlan), /* harmony export */ ts: () => (/* binding */ createOffer), /* harmony export */ u0: () => (/* binding */ setSupportTicketStatus), /* harmony export */ u4: () => (/* binding */ getAdminMailStats), /* harmony export */ uQ: () => (/* binding */ verifyAdminUserEmail), /* harmony export */ v9: () => (/* binding */ getUserReviews), /* harmony export */ vD: () => (/* binding */ createPriceListGroup), /* harmony export */ vh: () => (/* binding */ getTaskStats), /* harmony export */ vy: () => (/* binding */ getAdminUserSpecialistCards), /* harmony export */ wc: () => (/* binding */ translateAdminEmailTemplate), /* harmony export */ wl: () => (/* binding */ updateAdminUser), /* harmony export */ yJ: () => (/* binding */ createLocation), /* harmony export */ yO: () => (/* binding */ getAdminActivityLogs), /* harmony export */ yk: () => (/* binding */ dismissNotification), /* harmony export */ z4: () => (/* binding */ getDailyUsage), /* harmony export */ z5: () => (/* binding */ getAdminReports), /* harmony export */ z6: () => (/* binding */ getMyStatuses), /* harmony export */ zB: () => (/* binding */ deletePortfolioItem), /* harmony export */ zR: () => (/* binding */ deleteLocation), /* harmony export */ zZ: () => (/* binding */ createCategory), /* harmony export */ zc: () => (/* binding */ updateSpecialistCard), /* harmony export */ zk: () => (/* binding */ getSpecialistFomoDashboard) /* harmony export */ }); /* unused harmony exports getTasks, getTaskBudgetRange, searchTasks, getTasksForSpecialist, getTaskCountsByCategory, cancelTask, updateNotifSettings, getFavorites, addFavorite, removeFavorite, getTranslationsMissing, saveTranslations, getMyPortfolio, addPortfolioItem, getSpecialistPortfolio, saveSiteSeo, updatePriceListItem, getFomoRecommendations, getAutoMatchResults, getGoogleCalendarStatus, disconnectGoogleCalendar, importFromGoogleCalendar, getGoogleCalendarConnectUrl, getMySupportTickets */ webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource[j// SSR: use INTERNAL_API_URL (http://localhost:4000) to avoid external DNS/SSL round-trip // Browser: use NEXT_PUBLIC_API_URL (https://api.canhelp.gr) const BASE = "undefined" === 'undefined' ? process.env.INTERNAL_API_URL || 'http://localhost:4000' : process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export async function request(path, init) { const url = `${BASE}/api${path}`; if ("undefined" === 'undefined') console.log('[api] SSR fetch', url); const res = await fetch(url, { ...init, credentials: 'include', headers: { 'Content-Type': 'application/json', ...init?.headers } }); if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); const msg = typeof err.error === 'string' ? err.error : typeof err.message === 'string' ? err.message : res.statusText || 'Request failed'; throw new Error(msg); } return res.json(); } // ─── Tasks ──────────────────────────────────────────────────────────────── export const getTasks = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks${qs}`); }; export const getTaskBudgetRange = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks/budget-range${qs}`); }; export const searchTasks = (params)=>request(`/tasks/search?${new URLSearchParams(params)}`); export const getMyTasks = ()=>request('/tasks/my'); export const getTasksForSpecialist = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks/for-me${qs}`); }; export const getTaskCountsByCategory = ()=>request('/tasks/counts-by-category'); export const getTask = (id)=>request(`/tasks/${id}`); export const createTask = (data)=>request('/tasks', { method: 'POST', body: JSON.stringify(data) }); export const updateTask = (id, data)=>request(`/tasks/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const completeTask = (id)=>request(`/tasks/${id}/complete`, { method: 'PATCH' }); export const cancelTask = (id)=>request(`/tasks/${id}/cancel`, { method: 'PATCH' }); // ─── Offers ──────────────────────────────────────────────────────────────── export const getOffers = (taskId)=>request(`/offers?taskId=${taskId}`); export const getMyOffers = ()=>request('/offers/my'); export const createOffer = (data)=>request('/offers', { method: 'POST', body: JSON.stringify(data) }); export const acceptOffer = (id)=>request(`/offers/${id}/accept`, { method: 'PATCH' }); export const declineOffer = (id)=>request(`/offers/${id}/decline`, { method: 'PATCH' }); export const getUserProfile = (id, locale)=>request(`/users/${id}/profile${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); export const getSpecialists = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/users/specialists${qs}`); }; export const createReview = (data)=>request('/reviews', { method: 'POST', body: JSON.stringify(data) }); export const getTaskReviews = (taskId)=>request(`/reviews/task/${taskId}`); export const getMyReviews = ()=>request('/reviews/my'); // ─── Chat ────────────────────────────────────────────────────────────────── export const getChatRooms = ()=>request('/chat/rooms'); export const getOrCreateDirectRoom = (userId)=>request(`/chat/direct/${userId}`); export const getCanMessage = (userId)=>request(`/chat/can-message/${userId}`); export const getMessages = (roomId)=>request(`/chat/rooms/${roomId}/messages`); export const sendMessage = (roomId, body)=>request('/chat/messages', { method: 'POST', body: JSON.stringify({ roomId, body }) }); // ─── Notifications ──────────────────────────────────────────────────────── export const updateNotifSettings = (data)=>request('/users/me', { method: 'PATCH', body: JSON.stringify(data) }); export const getNotifications = ()=>request('/notifications'); export const getUnreadCount = ()=>request('/notifications/count'); export const markRead = (id)=>request(`/notifications/${id}/read`, { method: 'PATCH' }); export const markAllRead = ()=>request('/notifications/read-all', { method: 'PATCH' }); export const getTaskInvite = (taskId)=>request(`/notifications?type=task_invite&referenceId=${taskId}`); export const dismissNotification = (id)=>request(`/notifications/${id}`, { method: 'DELETE' }); // ─── Referral ───────────────────────────────────────────────────────────── export const getMyReferralInfo = ()=>request('/users/me/referral'); export const applyMyReferral = (refCode)=>request('/users/me/referral/apply', { method: 'POST', body: JSON.stringify({ refCode }) }); // ─── Reviews ────────────────────────────────────────────────────────────── export const getUserReviews = (userId)=>request(`/reviews/user/${userId}`); export const getUserRating = (userId)=>request(`/reviews/user/${userId}/rating`); // ─── Categories ─────────────────────────────────────────────────────────── export const getCategories = ()=>request('/categories'); // ─── Locations ──────────────────────────────────────────────────────────── export const getLocations = ()=>request('/locations'); // ─── Favorites ──────────────────────────────────────────────────────────── export const getFavorites = ()=>request('/favorites'); export const addFavorite = (taskId)=>request(`/favorites/${taskId}`, { method: 'POST' }); export const removeFavorite = (taskId)=>request(`/favorites/${taskId}`, { method: 'DELETE' }); export const getSpecialistFavorites = ()=>request('/favorites/specialists'); export const addSpecialistFavorite = (specialistId)=>request(`/favorites/specialists/${specialistId}`, { method: 'POST' }); export const removeSpecialistFavorite = (specialistId)=>request(`/favorites/specialists/${specialistId}`, { method: 'DELETE' }); // ─── Admin ───────────────────────────────────────────────────────────────── // ─── Admin Categories ────────────────────────────────────────────────────── export const getAdminCategories = ()=>request('/admin/categories'); export const createCategory = (data)=>request('/admin/categories', { method: 'POST', body: JSON.stringify(data) }); export const updateCategory = (id, data)=>request(`/admin/categories/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deleteCategory = (id)=>request(`/admin/categories/${id}`, { method: 'DELETE' }); // ─── Admin Skills ────────────────────────────────────────────────────────── export const getAdminSkills = (categorySlug)=>request(`/admin/skills?categorySlug=${encodeURIComponent(categorySlug)}`); export const createSkill = (data)=>request('/admin/skills', { method: 'POST', body: JSON.stringify(data) }); export const updateSkill = (id, data)=>request(`/admin/skills/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deleteSkill = (id)=>request(`/admin/skills/${id}`, { method: 'DELETE' }); export const getSkillDedup = (categorySlug)=>request(`/admin/skills/dedup${categorySlug ? `?categorySlug=${encodeURIComponent(categorySlug)}` : ''}`); export const mergeSkillDuplicates = (keepId, deleteIds)=>request('/admin/skills/dedup/merge', { method: 'POST', body: JSON.stringify({ keepId, deleteIds }) }); // ─── Admin ───────────────────────────────────────────────────────────────── export const getAdminStats = ()=>request('/admin/stats'); export const getAdminUsers = (page = 1, q, role)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (role) p.set('role', role); return request(`/admin/users?${p}`); }; export const deactivateUser = (id)=>request(`/admin/users/${id}/deactivate`, { method: 'PATCH' }); export const activateUser = (id)=>request(`/admin/users/${id}/activate`, { method: 'PATCH' }); export const changeUserRole = (id, role)=>request(`/admin/users/${id}/role`, { method: 'PATCH', body: JSON.stringify({ role }) }); export const getAdminUser = (id)=>request(`/admin/users/${id}`); export const getAdminUserSpecialistCards = (userId)=>request(`/admin/users/${userId}/specialist-cards`); export const adminUpdateSpecialistCard = (id, data)=>request(`/admin/specialist-cards/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const getAdminSpecialistCards = (page = 1, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request(`/admin/specialist-cards?${p}`); }; export const updateAdminUser = (id, data)=>request(`/admin/users/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const verifyAdminUserEmail = (id)=>request(`/admin/users/${id}/verify-email`, { method: 'PATCH' }); export const getAdminTasks = (page = 1, q, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (status) p.set('status', status); return request(`/admin/tasks?${p}`); }; export const cancelTaskAdmin = (id)=>request(`/admin/tasks/${id}/cancel`, { method: 'PATCH' }); export const deleteTaskAdmin = (id)=>request(`/admin/tasks/${id}`, { method: 'DELETE' }); export const getAdminReports = (page = 1, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request(`/admin/reports?${p}`); }; export const updateReportStatus = (id, status)=>request(`/admin/reports/${id}/status`, { method: 'PATCH', body: JSON.stringify({ status }) }); export const getAdminAiLogs = (page = 1)=>request(`/admin/ai-logs?page=${page}&limit=50`); export const getAdminActivityLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.userId) p.set('userId', params.userId); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/activity-logs?${p}`); }; export const getAdminMailLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/mail-logs?${p}`); }; export const getAdminNotifLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.type) p.set('type', params.type); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/notification-logs?${p}`); }; export const getAdminNotifStats = ()=>request('/admin/notification-stats'); export const getAdminMailStats = ()=>request('/admin/mail-stats'); export const getAdminReferrals = ()=>request('/admin/referrals'); export const adminSendPushToUser = (userId, data)=>request(`/admin/push/user/${userId}`, { method: 'POST', body: JSON.stringify(data) }); export const adminBroadcastPush = (data)=>request('/admin/push/broadcast', { method: 'POST', body: JSON.stringify(data) }); // ─── Admin Locations ─────────────────────────────────────────────────────── export const getAdminLocations = ()=>request('/admin/locations'); export const createLocation = (data)=>request('/admin/locations', { method: 'POST', body: JSON.stringify(data) }); export const updateLocation = (id, data)=>request(`/admin/locations/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deleteLocation = (id)=>request(`/admin/locations/${id}`, { method: 'DELETE' }); // ─── Admin Plans ─────────────────────────────────────────────────────────── export const getAdminPlans = ()=>request('/admin/plans'); export const createPlan = (data)=>request('/admin/plans', { method: 'POST', body: JSON.stringify(data) }); export const updatePlan = (id, data)=>request(`/admin/plans/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deletePlan = (id)=>request(`/admin/plans/${id}`, { method: 'DELETE' }); // ─── Admin Settings ──────────────────────────────────────────────────────── export const getAdminSettings = ()=>request('/admin/settings'); export const updateAdminSettings = (data)=>request('/admin/settings', { method: 'PUT', body: JSON.stringify(data) }); export const getAdminEmailTemplates = ()=>request('/admin/settings/templates'); export const updateAdminEmailTemplate = (key, data)=>request(`/admin/settings/templates/${key}`, { method: 'PUT', body: JSON.stringify(data) }); export const translateAdminEmailTemplate = (data)=>request('/admin/settings/templates/translate', { method: 'POST', body: JSON.stringify(data) }); export const sendTestEmail = ()=>request('/admin/settings/test-email', { method: 'POST' }); export const testTelegramConnection = (botToken, chatId)=>fetch(`${BASE}/api/admin/settings/test-telegram`, { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken, chatId }) }).then((r)=>r.json()); export const verifyTelegramToken = (botToken)=>fetch(`${BASE}/api/admin/settings/verify-telegram-token`, { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken }) }).then((r)=>r.json()); export const getTranslationsStats = ()=>request('/admin/translations/stats'); export const getTranslationsMissing = (table, missingLang, page = 1, limit = 50)=>request(`/admin/translations/${table}?missingLang=${missingLang}&page=${page}&limit=${limit}`); export const saveTranslations = (table, items)=>request(`/admin/translations/${table}/save`, { method: 'POST', body: JSON.stringify({ items }) }); export const autoTranslate = (table, missingLang, fromLang, batchSize = 500)=>request('/admin/translations/auto-translate', { method: 'POST', body: JSON.stringify({ table, missingLang, fromLang, batchSize }) }); export const autoTranslateTasks = (batchSize = 500)=>request('/admin/translations/auto-translate-tasks', { method: 'POST', body: JSON.stringify({ batchSize }) }); export const getTasksTranslationPreview = (lang, limit = 50)=>request(`/admin/translations/tasks-preview?lang=${lang}&limit=${limit}`); export const autoTranslateEmailTemplates = (missingLang, fromLang = 'el')=>request('/admin/translations/auto-translate-templates', { method: 'POST', body: JSON.stringify({ missingLang, fromLang }) }); // ─── Availability ────────────────────────────────────────────────────────── export const getMyAvailability = (month)=>request(`/availability/my${month ? `?month=${month}` : ''}`); export const setAvailability = (date, status, note)=>request('/availability/set', { method: 'POST', body: JSON.stringify({ date, status, note }) }); export const setAvailabilityRange = (from, to, status)=>request('/availability/set-range', { method: 'POST', body: JSON.stringify({ from, to, status }) }); export const getSpecialistAvailability = (userId, month)=>request(`/availability/user/${userId}${month ? `?month=${month}` : ''}`); export const getMyPortfolio = ()=>request('/portfolio/my'); export const addPortfolioItem = (formData)=>fetch(`${BASE}/api/portfolio`, { method: 'POST', credentials: 'include', body: formData }).then(async (res)=>{ if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); throw new Error(err.error || 'Upload failed'); } return res.json(); }); export const updatePortfolioItem = (id, data)=>request(`/portfolio/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deletePortfolioItem = (id)=>request(`/portfolio/${id}`, { method: 'DELETE' }); export const getSpecialistPortfolio = (userId)=>request(`/portfolio/user/${userId}`); export const getMySpecialistCards = ()=>request('/specialist-cards/my'); export const createSpecialistCard = (data)=>request('/specialist-cards', { method: 'POST', body: JSON.stringify(data) }); export const updateSpecialistCard = (id, data)=>request(`/specialist-cards/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const saveSiteSeo = (data)=>request('/users/me/site-seo', { method: 'POST', body: JSON.stringify(data) }); export const deleteSpecialistCard = (id)=>request(`/specialist-cards/${id}`, { method: 'DELETE' }); export const getSpecialistCards = (userId, locale)=>request(`/specialist-cards/user/${userId}${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); export const getPriceList = (cardId, locale)=>request(`/price-list/${cardId}${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); export const createPriceListGroup = (cardId, data)=>request(`/price-list/${cardId}/groups`, { method: 'POST', body: JSON.stringify(data) }); export const updatePriceListGroup = (groupId, data)=>request(`/price-list/groups/${groupId}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deletePriceListGroup = (groupId)=>request(`/price-list/groups/${groupId}`, { method: 'DELETE' }); export const createPriceListItem = (groupId, data)=>request(`/price-list/groups/${groupId}/items`, { method: 'POST', body: JSON.stringify(data) }); export const updatePriceListItem = (itemId, data)=>request(`/price-list/items/${itemId}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deletePriceListItem = (itemId)=>request(`/price-list/items/${itemId}`, { method: 'DELETE' }); export const getSkillSuggestions = (categorySlugs)=>{ const params = categorySlugs?.length ? '?' + categorySlugs.map((s)=>`category=${encodeURIComponent(s)}`).join('&') : ''; return request(`/skill-suggestions${params}`); }; export const initiateTopUp = (amount)=>request('/payments/topup/init', { method: 'POST', body: JSON.stringify({ amount }) }); export const getPaymentHistory = ()=>request('/payments/history'); export const getBalanceHistory = (limit = 50)=>request(`/payments/balance-history?limit=${limit}`); export const getPlanHistory = (limit = 50)=>request(`/users/me/plan-history?limit=${limit}`); export const getAdminBalanceHistory = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.userId) p.set('userId', params.userId); if (params.kind) p.set('kind', params.kind); p.set('limit', '50'); return request(`/admin/balance-history?${p}`); }; export const adminTopUpUserBalance = (id, data)=>request(`/admin/users/${id}/balance/topup`, { method: 'POST', body: JSON.stringify(data) }); export const adminWithdrawUserBalance = (id, data)=>request(`/admin/users/${id}/balance/withdraw`, { method: 'POST', body: JSON.stringify(data) }); export const previewPlanChange = (planId)=>request('/payments/plan/preview', { method: 'POST', body: JSON.stringify({ planId }) }); export const getPlans = (role)=>{ const qs = role ? `?role=${role}` : ''; return request(`/plans${qs}`); }; export const getMyDashboard = ()=>request('/dashboard/me'); export const getDailyUsage = ()=>request('/plans/daily-usage'); export const purchasePlan = (planId, payFromBalance = true)=>request('/payments/plan/purchase', { method: 'POST', body: JSON.stringify({ planId, payFromBalance }) }); // ─── Statuses ────────────────────────────────────────────────────────────── export const getMyStatuses = ()=>request('/statuses/me'); export const toggleStatus = (statusType, active)=>request('/statuses/toggle', { method: 'POST', body: JSON.stringify({ statusType, active }) }); export const getAutoResponseSettings = ()=>request('/auto-response'); export const updateAutoResponseSettings = (data)=>request('/auto-response', { method: 'PUT', body: JSON.stringify(data) }); // ─── FOMO ────────────────────────────────────────────────────────────────── export const getSpecialistFomoDashboard = ()=>request('/fomo/specialist'); export const getCustomerFomoDashboard = ()=>request('/fomo/customer'); export const getFomoRecommendations = ()=>request('/fomo/recommendations'); // ─── Auto-match ──────────────────────────────────────────────────────────── export const getAutoMatchResults = (taskId)=>request(`/auto-match/${taskId}`); export const runAutoMatch = (taskId)=>request(`/auto-match/${taskId}`, { method: 'POST' }); // ─── Google Calendar ─────────────────────────────────────────────────────── export const getGoogleCalendarStatus = ()=>request('/google/calendar/status'); export const disconnectGoogleCalendar = ()=>request('/google/calendar/disconnect', { method: 'DELETE' }); export const importFromGoogleCalendar = ()=>request('/google/calendar/import', { method: 'POST' }); export const getGoogleCalendarConnectUrl = ()=>`${BASE}/api/google/calendar/connect`; // ─── Personal site ───────────────────────────────────────────────────────── export const getPublicSiteProfile = (slug)=>request(`/users/site/${slug}`); export const getSiteStats = ()=>request('/users/me/site-stats'); export const trackSiteMessage = (slug)=>request(`/users/site/${slug}/track-message`, { method: 'POST' }).catch(()=>{}); // ─── Task stats (FOMO) ───────────────────────────────────────────────────── export const getTaskStats = (taskId)=>request(`/tasks/${taskId}/stats`); // ─── Support tickets ─────────────────────────────────────────────────────── export const sendPublicSupportMessage = (data)=>request('/support/public', { method: 'POST', body: JSON.stringify(data) }); export const createSupportTicket = (data)=>request('/support', { method: 'POST', body: JSON.stringify(data) }); export const getMySupportTickets = (page = 1)=>request(`/support/my?page=${page}`); export const getAdminSupportTickets = (params)=>request(`/support${params ? '?' + new URLSearchParams(params) : ''}`); export const replyToSupportTicket = (id, data)=>request(`/support/${id}/reply`, { method: 'PATCH', body: JSON.stringify(data) }); export const setSupportTicketStatus = (id, status)=>request(`/support/${id}/status`, { method: 'PATCH', body: JSON.stringify({ status }) }); _58>5;`fy) _/ q w " ( o u  [ a 4:_MSY_|/5QW _!MSZ`TZw}  _ /!5!p!v!!!}""##$$$$%%%&c&i&_'e'((q(w(1*7*++9-_?----- ....////P0V0001111S2Y2223333W4]44_4L5R555[6a67799V9\9::::;;<<6=<=>>>>??@@A_%A[AaAC CCCCDUD[DDD,E2EEEKFQFFFTGZGGG}HH!I'IIIDJ_JJJJ[KaKDLJLLL-M3MMMMM (/* binding */ updateCategory), /* harmony export */ $H: () => (/* binding */ acceptOffer), /* harmony export */ $M: () => (/* binding */ getUnreadCount), /* harmony export */ Bb: () => (/* binding */ getMySpecialistCards), /* harmony export */ Bm: () => (/* binding */ getUserRating), /* harmony export */ Bq: () => (/* binding */ getSpecialistCards), /* harmony export */ Br: () => (/* binding */ getAdminNotifLogs), /* harmony export */ C0: () => (/* binding */ applyMyReferral), /* harmony export */ CX: () => (/* binding */ updateAdminSettings), /* harmony export */ Ck: () => (/* binding */ getPriceList), /* harmony export */ Cs: () => (/* binding */ previewPlanChange), /* harmony export */ D1: () => (/* binding */ setAvailabilityRange), /* harmony export */ Em: () => (/* binding */ request), /* harmony export */ F7: () => (/* binding */ getSpecialists), /* harmony export */ F9: () => (/* binding */ getTaskInvite), /* harmony export */ FI: () => (/* binding */ sendTestEmail), /* harmony export */ Fu: () => (/* binding */ getMyTasks), /* harmony export */ GB: () => (/* binding */ deleteTaskAdmin), /* harmony export */ GE: () => (/* binding */ getSkillDedup), /* harmony export */ Gp: () => (/* binding */ getAutoResponseSettings), /* harmony export */ H: () => (/* binding */ getMyDashboard), /* harmony export */ H6: () => (/* binding */ getTaskReviews), /* harmony export */ He: () => (/* binding */ activateUser), /* harmony export */ I: () => (/* binding */ autoTranslateTasks), /* harmony export */ Ic: () => (/* binding */ deletePriceListGroup), /* harmony export */ Ip: () => (/* binding */ markRead), /* harmony export */ Je: () => (/* binding */ purchasePlan), /* harmony export */ K7: () => (/* binding */ deleteCategory), /* harmony export */ KD: () => (/* binding */ getAdminCategories), /* harmony export */ KZ: () => (/* binding */ getAdminSupportTickets), /* harmony export */ Lb: () => (/* binding */ declineOffer), /* harmony export */ Lp: () => (/* binding */ getAdminEmailTemplates), /* harmony export */ ML: () => (/* binding */ getCustomerFomoDashboard), /* harmony export */ Mm: () => (/* binding */ changeUserRole), /* harmony export */ NL: () => (/* binding */ markAllRead), /* harmony export */ Nt: () => (/* binding */ updateLocation), /* harmony export */ O8: () => (/* binding */ sendPublicSupportMessage), /* harmony export */ OM: () => (/* binding */ setAvailability), /* harmony export */ OV: () => (/* binding */ runAutoMatch), /* harmony export */ OX: () => (/* binding */ getAdminPlans), /* harmony export */ On: () => (/* binding */ getCanMessage), /* harmony export */ P0: () => (/* binding */ adminTopUpUserBalance), /* harmony export */ QN: () => (/* binding */ getOrCreateDirectRoom), /* harmony export */ QY: () => (/* binding */ getTasksTranslationPreview), /* harmony export */ RN: () => (/* binding */ getSiteStats), /* harmony export */ RQ: () => (/* binding */ updateAutoResponseSettings), /* harmony export */ Rt: () => (/* binding */ completeTask), /* harmony export */ S$: () => (/* binding */ getPublicSiteProfile), /* harmony export */ S9: () => (/* binding */ createSkill), /* harmony export */ Sw: () => (/* binding */ getOffers), /* harmony export */ T9: () => (/* binding */ getPlans), /* harmony export */ Tr: () => (/* binding */ getNotifications), /* harmony export */ U9: () => (/* binding */ deletePriceListItem), /* harmony export */ UE: () => (/* binding */ trackSiteMessage), /* harmony export */ UT: () => (/* binding */ createTask), /* harmony export */ Uq: () => (/* binding */ mergeSkillDuplicates), /* harmony export */ V: () => (/* binding */ addSpecialistFavorite), /* harmony export */ V7: () => (/* binding */ adminBroadcastPush), /* harmony export */ VL: () => (/* binding */ getMessages), /* harmony export */ VM: () => (/* binding */ getUserProfile), /* harmony export */ Vs: () => (/* binding */ getLocations), /* harmony export */ Wi: () => (/* binding */ deactivateUser), /* harmony export */ Xz: () => (/* binding */ getSpecialistAvailability), /* harmony export */ YQ: () => (/* binding */ getTranslationsStats), /* harmony export */ Yj: () => (/* binding */ getAdminTasks), /* harmony export */ Z2: () => (/* binding */ createPriceListItem), /* harmony export */ Zp: () => (/* binding */ getChatRooms), /* harmony export */ _z: () => (/* binding */ sendMessage), /* harmony export */ aT: () => (/* binding */ getMyOffers), /* harmony export */ bR: () => (/* binding */ deletePlan), /* harmony export */ bW: () => (/* binding */ getCategories), /* harmony export */ bc: () => (/* binding */ toggleStatus), /* harmony export */ bi: () => (/* binding */ getAdminNotifStats), /* harmony export */ bx: () => (/* binding */ createReview), /* harmony export */ cJ: () => (/* binding */ getAdminReferrals), /* harmony export */ cS: () => (/* binding */ getAdminUsers), /* harmony export */ cl: () => (/* binding */ verifyTelegramToken), /* harmony export */ cp: () => (/* binding */ autoTranslate), /* harmony export */ dE: () => (/* binding */ getAdminStats), /* harmony export */ eR: () => (/* binding */ createSpecialistCard), /* harmony export */ eU: () => (/* binding */ updateReportStatus), /* harmony export */ ew: () => (/* binding */ getPlanHistory), /* harmony export */ f5: () => (/* binding */ deleteSpecialistCard), /* harmony export */ fP: () => (/* binding */ updateSkill), /* harmony export */ fm: () => (/* binding */ getBalanceHistory), /* harmony export */ fu: () => (/* binding */ autoTranslateEmailTemplates), /* harmony export */ g0: () => (/* binding */ getAdminBalanceHistory), /* harmony export */ g1: () => (/* binding */ adminSendPushToUser), /* harmony export */ gg: () => (/* binding */ getTask), /* harmony export */ hD: () => (/* binding */ adminWithdrawUserBalance), /* harmony export */ hl: () => (/* binding */ updatePortfolioItem), /* harmony export */ hp: () => (/* binding */ deleteSkill), /* harmony export */ iN: () => (/* binding */ getMyAvailability), /* harmony export */ i_: () => (/* binding */ getAdminSkills), /* harmony export */ j_: () => (/* binding */ getAdminAiLogs), /* harmony export */ jd: () => (/* binding */ getAdminUser), /* harmony export */ jg: () => (/* binding */ updateAdminEmailTemplate), /* harmony export */ k_: () => (/* binding */ getAdminLocations), /* harmony export */ lC: () => (/* binding */ updateTask), /* harmony export */ mq: () => (/* binding */ createSupportTicket), /* harmony export */ nT: () => (/* binding */ replyToSupportTicket), /* harmony export */ nf: () => (/* binding */ cancelTaskAdmin), /* harmony export */ oD: () => (/* binding */ updatePriceListGroup), /* harmony export */ oh: () => (/* binding */ initiateTopUp), /* harmony export */ oq: () => (/* binding */ adminUpdateSpecialistCard), /* harmony export */ pD: () => (/* binding */ getSpecialistFavorites), /* harmony export */ pK: () => (/* binding */ getPaymentHistory), /* harmony export */ q7: () => (/* binding */ getMyReviews), /* harmony export */ qT: () => (/* binding */ createPlan), /* harmony export */ qX: () => (/* binding */ testTelegramConnection), /* harmony export */ qt: () => (/* binding */ getAdminMailLogs), /* harmony export */ rC: () => (/* binding */ getAdminSettings), /* harmony export */ rl: () => (/* binding */ getSkillSuggestions), /* harmony export */ sD: () => (/* binding */ removeSpecialistFavorite), /* harmony export */ s_: () => (/* binding */ getAdminSpecialistCards), /* harmony export */ st: () => (/* binding */ getMyReferralInfo), /* harmony export */ td: () => (/* binding */ updatePlan), /* harmony export */ ts: () => (/* binding */ createOffer), /* harmony export */ u0: () => (/* binding */ setSupportTicketStatus), /* harmony export */ u4: () => (/* binding */ getAdminMailStats), /* harmony export */ uQ: () => (/* binding */ verifyAdminUserEmail), /* harmony export */ v9: () => (/* binding */ getUserReviews), /* harmony export */ vD: () => (/* binding */ createPriceListGroup), /* harmony export */ vh: () => (/* binding */ getTaskStats), /* harmony export */ vy: () => (/* binding */ getAdminUserSpecialistCards), /* harmony export */ wc: () => (/* binding */ translateAdminEmailTemplate), /* harmony export */ wl: () => (/* binding */ updateAdminUser), /* harmony export */ yJ: () => (/* binding */ createLocation), /* harmony export */ yO: () => (/* binding */ getAdminActivityLogs), /* harmony export */ yk: () => (/* binding */ dismissNotification), /* harmony export */ z4: () => (/* binding */ getDailyUsage), /* harmony export */ z5: () => (/* binding */ getAdminReports), /* harmony export */ z6: () => (/* binding */ getMyStatuses), /* harmony export */ zB: () => (/* binding */ deletePortfolioItem), /* harmony export */ zR: () => (/* binding */ deleteLocation), /* harmony export */ zZ: () => (/* binding */ createCategory), /* harmony export */ zc: () => (/* binding */ updateSpecialistCard), /* harmony export */ zk: () => (/* binding */ getSpecialistFomoDashboard) /* harmony export */ }); /* unused harmony exports getTasks, getTaskBudgetRange, searchTasks, getTasksForSpecialist, getTaskCountsByCategory, cancelTask, updateNotifSettings, getFavorites, addFavorite, removeFavorite, getTranslationsMissing, saveTranslations, getMyPortfolio, addPortfolioItem, getSpecialistPortfolio, saveSiteSeo, updatePriceListItem, getFomoRecommendations, getAutoMatchResults, getGoogleCalendarStatus, disconnectGoogleCalendar, importFromGoogleCalendar, getGoogleCalendarConnectUrl, getMySupportTickets */ // SSR: use INTERNAL_API_URL (http://localhost:4000) to avoid external DNS/SSL round-trip // Browser: use NEXT_PUBLIC_API_URL (https://api.canhelp.gr) const BASE = true ? process.env.INTERNAL_API_URL || 'http://localhost:4000' : 0; async function request(path, init) { const url = `${BASE}/api${path}`; if (true) console.log('[api] SSR fetch', url); const res = await fetch(url, { ...init, credentials: 'include', headers: { 'Content-Type': 'application/json', ...init?.headers } }); if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); const msg = typeof err.error === 'string' ? err.error : typeof err.message === 'string' ? err.message : res.statusText || 'Request failed'; throw new Error(msg); } return res.json(); } // ─── Tasks ──────────────────────────────────────────────────────────────── const getTasks = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks${qs}`); }; const getTaskBudgetRange = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks/budget-range${qs}`); }; const searchTasks = (params)=>request(`/tasks/search?${new URLSearchParams(params)}`); const getMyTasks = ()=>request('/tasks/my'); const getTasksForSpecialist = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks/for-me${qs}`); }; const getTaskCountsByCategory = ()=>request('/tasks/counts-by-category'); const getTask = (id)=>request(`/tasks/${id}`); const createTask = (data)=>request('/tasks', { method: 'POST', body: JSON.stringify(data) }); const updateTask = (id, data)=>request(`/tasks/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const completeTask = (id)=>request(`/tasks/${id}/complete`, { method: 'PATCH' }); const cancelTask = (id)=>request(`/tasks/${id}/cancel`, { method: 'PATCH' }); // ─── Offers ──────────────────────────────────────────────────────────────── const getOffers = (taskId)=>request(`/offers?taskId=${taskId}`); const getMyOffers = ()=>request('/offers/my'); const createOffer = (data)=>request('/offers', { method: 'POST', body: JSON.stringify(data) }); const acceptOffer = (id)=>request(`/offers/${id}/accept`, { method: 'PATCH' }); const declineOffer = (id)=>request(`/offers/${id}/decline`, { method: 'PATCH' }); const getUserProfile = (id, locale)=>request(`/users/${id}/profile${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); const getSpecialists = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/users/specialists${qs}`); }; const createReview = (data)=>request('/reviews', { method: 'POST', body: JSON.stringify(data) }); const getTaskReviews = (taskId)=>request(`/reviews/task/${taskId}`); const getMyReviews = ()=>request('/reviews/my'); // ─── Chat ────────────────────────────────────────────────────────────────── const getChatRooms = ()=>request('/chat/rooms'); const getOrCreateDirectRoom = (userId)=>request(`/chat/direct/${userId}`); const getCanMessage = (userId)=>request(`/chat/can-message/${userId}`); const getMessages = (roomId)=>request(`/chat/rooms/${roomId}/messages`); const sendMessage = (roomId, body)=>request('/chat/messages', { method: 'POST', body: JSON.stringify({ roomId, body }) }); // ─── Notifications ──────────────────────────────────────────────────────── const updateNotifSettings = (data)=>request('/users/me', { method: 'PATCH', body: JSON.stringify(data) }); const getNotifications = ()=>request('/notifications'); const getUnreadCount = ()=>request('/notifications/count'); const markRead = (id)=>request(`/notifications/${id}/read`, { method: 'PATCH' }); const markAllRead = ()=>request('/notifications/read-all', { method: 'PATCH' }); const getTaskInvite = (taskId)=>request(`/notifications?type=task_invite&referenceId=${taskId}`); const dismissNotification = (id)=>request(`/notifications/${id}`, { method: 'DELETE' }); // ─── Referral ───────────────────────────────────────────────────────────── const getMyReferralInfo = ()=>request('/users/me/referral'); const applyMyReferral = (refCode)=>request('/users/me/referral/apply', { method: 'POST', body: JSON.stringify({ refCode }) }); // ─── Reviews ────────────────────────────────────────────────────────────── const getUserReviews = (userId)=>request(`/reviews/user/${userId}`); const getUserRating = (userId)=>request(`/reviews/user/${userId}/rating`); // ─── Categories ─────────────────────────────────────────────────────────── const getCategories = ()=>request('/categories'); // ─── Locations ──────────────────────────────────────────────────────────── const getLocations = ()=>request('/locations'); // ─── Favorites ──────────────────────────────────────────────────────────── const getFavorites = ()=>request('/favorites'); const addFavorite = (taskId)=>request(`/favorites/${taskId}`, { method: 'POST' }); const removeFavorite = (taskId)=>request(`/favorites/${taskId}`, { method: 'DELETE' }); const getSpecialistFavorites = ()=>request('/favorites/specialists'); const addSpecialistFavorite = (specialistId)=>request(`/favorites/specialists/${specialistId}`, { method: 'POST' }); const removeSpecialistFavorite = (specialistId)=>request(`/favorites/specialists/${specialistId}`, { method: 'DELETE' }); // ─── Admin ───────────────────────────────────────────────────────────────── // ─── Admin Categories ────────────────────────────────────────────────────── const getAdminCategories = ()=>request('/admin/categories'); const createCategory = (data)=>request('/admin/categories', { method: 'POST', body: JSON.stringify(data) }); const updateCategory = (id, data)=>request(`/admin/categories/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const deleteCategory = (id)=>request(`/admin/categories/${id}`, { method: 'DELETE' }); // ─── Admin Skills ────────────────────────────────────────────────────────── const getAdminSkills = (categorySlug)=>request(`/admin/skills?categorySlug=${encodeURIComponent(categorySlug)}`); const createSkill = (data)=>request('/admin/skills', { method: 'POST', body: JSON.stringify(data) }); const updateSkill = (id, data)=>request(`/admin/skills/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const deleteSkill = (id)=>request(`/admin/skills/${id}`, { method: 'DELETE' }); const getSkillDedup = (categorySlug)=>request(`/admin/skills/dedup${categorySlug ? `?categorySlug=${encodeURIComponent(categorySlug)}` : ''}`); const mergeSkillDuplicates = (keepId, deleteIds)=>request('/admin/skills/dedup/merge', { method: 'POST', body: JSON.stringify({ keepId, deleteIds }) }); // ─── Admin ───────────────────────────────────────────────────────────────── const getAdminStats = ()=>request('/admin/stats'); const getAdminUsers = (page = 1, q, role)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (role) p.set('role', role); return request(`/admin/users?${p}`); }; const deactivateUser = (id)=>request(`/admin/users/${id}/deactivate`, { method: 'PATCH' }); const activateUser = (id)=>request(`/admin/users/${id}/activate`, { method: 'PATCH' }); const changeUserRole = (id, role)=>request(`/admin/users/${id}/role`, { method: 'PATCH', body: JSON.stringify({ role }) }); const getAdminUser = (id)=>request(`/admin/users/${id}`); const getAdminUserSpecialistCards = (userId)=>request(`/admin/users/${userId}/specialist-cards`); const adminUpdateSpecialistCard = (id, data)=>request(`/admin/specialist-cards/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const getAdminSpecialistCards = (page = 1, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request(`/admin/specialist-cards?${p}`); }; const updateAdminUser = (id, data)=>request(`/admin/users/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const verifyAdminUserEmail = (id)=>request(`/admin/users/${id}/verify-email`, { method: 'PATCH' }); const getAdminTasks = (page = 1, q, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (status) p.set('status', status); return request(`/admin/tasks?${p}`); }; const cancelTaskAdmin = (id)=>request(`/admin/tasks/${id}/cancel`, { method: 'PATCH' }); const deleteTaskAdmin = (id)=>request(`/admin/tasks/${id}`, { method: 'DELETE' }); const getAdminReports = (page = 1, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request(`/admin/reports?${p}`); }; const updateReportStatus = (id, status)=>request(`/admin/reports/${id}/status`, { method: 'PATCH', body: JSON.stringify({ status }) }); const getAdminAiLogs = (page = 1)=>request(`/admin/ai-logs?page=${page}&limit=50`); const getAdminActivityLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.userId) p.set('userId', params.userId); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/activity-logs?${p}`); }; const getAdminMailLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/mail-logs?${p}`); }; const getAdminNotifLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.type) p.set('type', params.type); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/notification-logs?${p}`); }; const getAdminNotifStats = ()=>request('/admin/notification-stats'); const getAdminMailStats = ()=>request('/admin/mail-stats'); const getAdminReferrals = ()=>request('/admin/referrals'); const adminSendPushToUser = (userId, data)=>request(`/admin/push/user/${userId}`, { method: 'POST', body: JSON.stringify(data) }); const adminBroadcastPush = (data)=>request('/admin/push/broadcast', { method: 'POST', body: JSON.stringify(data) }); // ─── Admin Locations ─────────────────────────────────────────────────────── const getAdminLocations = ()=>request('/admin/locations'); const createLocation = (data)=>request('/admin/locations', { method: 'POST', body: JSON.stringify(data) }); const updateLocation = (id, data)=>request(`/admin/locations/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const deleteLocation = (id)=>request(`/admin/locations/${id}`, { method: 'DELETE' }); // ─── Admin Plans ─────────────────────────────────────────────────────────── const getAdminPlans = ()=>request('/admin/plans'); const createPlan = (data)=>request('/admin/plans', { method: 'POST', body: JSON.stringify(data) }); const updatePlan = (id, data)=>request(`/admin/plans/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const deletePlan = (id)=>request(`/admin/plans/${id}`, { method: 'DELETE' }); // ─── Admin Settings ──────────────────────────────────────────────────────── const getAdminSettings = ()=>request('/admin/settings'); const updateAdminSettings = (data)=>request('/admin/settings', { method: 'PUT', body: JSON.stringify(data) }); const getAdminEmailTemplates = ()=>request('/admin/settings/templates'); const updateAdminEmailTemplate = (key, data)=>request(`/admin/settings/templates/${key}`, { method: 'PUT', body: JSON.stringify(data) }); const translateAdminEmailTemplate = (data)=>request('/admin/settings/templates/translate', { method: 'POST', body: JSON.stringify(data) }); const sendTestEmail = ()=>request('/admin/settings/test-email', { method: 'POST' }); const testTelegramConnection = (botToken, chatId)=>fetch(`${BASE}/api/admin/settings/test-telegram`, { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken, chatId }) }).then((r)=>r.json()); const verifyTelegramToken = (botToken)=>fetch(`${BASE}/api/admin/settings/verify-telegram-token`, { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken }) }).then((r)=>r.json()); const getTranslationsStats = ()=>request('/admin/translations/stats'); const getTranslationsMissing = (table, missingLang, page = 1, limit = 50)=>request(`/admin/translations/${table}?missingLang=${missingLang}&page=${page}&limit=${limit}`); const saveTranslations = (table, items)=>request(`/admin/translations/${table}/save`, { method: 'POST', body: JSON.stringify({ items }) }); const autoTranslate = (table, missingLang, fromLang, batchSize = 500)=>request('/admin/translations/auto-translate', { method: 'POST', body: JSON.stringify({ table, missingLang, fromLang, batchSize }) }); const autoTranslateTasks = (batchSize = 500)=>request('/admin/translations/auto-translate-tasks', { method: 'POST', body: JSON.stringify({ batchSize }) }); const getTasksTranslationPreview = (lang, limit = 50)=>request(`/admin/translations/tasks-preview?lang=${lang}&limit=${limit}`); const autoTranslateEmailTemplates = (missingLang, fromLang = 'el')=>request('/admin/translations/auto-translate-templates', { method: 'POST', body: JSON.stringify({ missingLang, fromLang }) }); // ─── Availability ────────────────────────────────────────────────────────── const getMyAvailability = (month)=>request(`/availability/my${month ? `?month=${month}` : ''}`); const setAvailability = (date, status, note)=>request('/availability/set', { method: 'POST', body: JSON.stringify({ date, status, note }) }); const setAvailabilityRange = (from, to, status)=>request('/availability/set-range', { method: 'POST', body: JSON.stringify({ from, to, status }) }); const getSpecialistAvailability = (userId, month)=>request(`/availability/user/${userId}${month ? `?month=${month}` : ''}`); const getMyPortfolio = ()=>request('/portfolio/my'); const addPortfolioItem = (formData)=>fetch(`${BASE}/api/portfolio`, { method: 'POST', credentials: 'include', body: formData }).then(async (res)=>{ if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); throw new Error(err.error || 'Upload failed'); } return res.json(); }); const updatePortfolioItem = (id, data)=>request(`/portfolio/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const deletePortfolioItem = (id)=>request(`/portfolio/${id}`, { method: 'DELETE' }); const getSpecialistPortfolio = (userId)=>request(`/portfolio/user/${userId}`); const getMySpecialistCards = ()=>request('/specialist-cards/my'); const createSpecialistCard = (data)=>request('/specialist-cards', { method: 'POST', body: JSON.stringify(data) }); const updateSpecialistCard = (id, data)=>request(`/specialist-cards/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const saveSiteSeo = (data)=>request('/users/me/site-seo', { method: 'POST', body: JSON.stringify(data) }); const deleteSpecialistCard = (id)=>request(`/specialist-cards/${id}`, { method: 'DELETE' }); const getSpecialistCards = (userId, locale)=>request(`/specialist-cards/user/${userId}${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); const getPriceList = (cardId, locale)=>request(`/price-list/${cardId}${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); const createPriceListGroup = (cardId, data)=>request(`/price-list/${cardId}/groups`, { method: 'POST', body: JSON.stringify(data) }); const updatePriceListGroup = (groupId, data)=>request(`/price-list/groups/${groupId}`, { method: 'PATCH', body: JSON.stringify(data) }); const deletePriceListGroup = (groupId)=>request(`/price-list/groups/${groupId}`, { method: 'DELETE' }); const createPriceListItem = (groupId, data)=>request(`/price-list/groups/${groupId}/items`, { method: 'POST', body: JSON.stringify(data) }); const updatePriceListItem = (itemId, data)=>request(`/price-list/items/${itemId}`, { method: 'PATCH', body: JSON.stringify(data) }); const deletePriceListItem = (itemId)=>request(`/price-list/items/${itemId}`, { method: 'DELETE' }); const getSkillSuggestions = (categorySlugs)=>{ const params = categorySlugs?.length ? '?' + categorySlugs.map((s)=>`category=${encodeURIComponent(s)}`).join('&') : ''; return request(`/skill-suggestions${params}`); }; const initiateTopUp = (amount)=>request('/payments/topup/init', { method: 'POST', body: JSON.stringify({ amount }) }); const getPaymentHistory = ()=>request('/payments/history'); const getBalanceHistory = (limit = 50)=>request(`/payments/balance-history?limit=${limit}`); const getPlanHistory = (limit = 50)=>request(`/users/me/plan-history?limit=${limit}`); const getAdminBalanceHistory = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.userId) p.set('userId', params.userId); if (params.kind) p.set('kind', params.kind); p.set('limit', '50'); return request(`/admin/balance-history?${p}`); }; const adminTopUpUserBalance = (id, data)=>request(`/admin/users/${id}/balance/topup`, { method: 'POST', body: JSON.stringify(data) }); const adminWithdrawUserBalance = (id, data)=>request(`/admin/users/${id}/balance/withdraw`, { method: 'POST', body: JSON.stringify(data) }); const previewPlanChange = (planId)=>request('/payments/plan/preview', { method: 'POST', body: JSON.stringify({ planId }) }); const getPlans = (role)=>{ const qs = role ? `?role=${role}` : ''; return request(`/plans${qs}`); }; const getMyDashboard = ()=>request('/dashboard/me'); const getDailyUsage = ()=>request('/plans/daily-usage'); const purchasePlan = (planId, payFromBalance = true)=>request('/payments/plan/purchase', { method: 'POST', body: JSON.stringify({ planId, payFromBalance }) }); // ─── Statuses ────────────────────────────────────────────────────────────── const getMyStatuses = ()=>request('/statuses/me'); const toggleStatus = (statusType, active)=>request('/statuses/toggle', { method: 'POST', body: JSON.stringify({ statusType, active }) }); const getAutoResponseSettings = ()=>request('/auto-response'); const updateAutoResponseSettings = (data)=>request('/auto-response', { method: 'PUT', body: JSON.stringify(data) }); // ─── FOMO ────────────────────────────────────────────────────────────────── const getSpecialistFomoDashboard = ()=>request('/fomo/specialist'); const getCustomerFomoDashboard = ()=>request('/fomo/customer'); const getFomoRecommendations = ()=>request('/fomo/recommendations'); // ─── Auto-match ──────────────────────────────────────────────────────────── const getAutoMatchResults = (taskId)=>request(`/auto-match/${taskId}`); const runAutoMatch = (taskId)=>request(`/auto-match/${taskId}`, { method: 'POST' }); // ─── Google Calendar ─────────────────────────────────────────────────────── const getGoogleCalendarStatus = ()=>request('/google/calendar/status'); const disconnectGoogleCalendar = ()=>request('/google/calendar/disconnect', { method: 'DELETE' }); const importFromGoogleCalendar = ()=>request('/google/calendar/import', { method: 'POST' }); const getGoogleCalendarConnectUrl = ()=>`${BASE}/api/google/calendar/connect`; // ─── Personal site ───────────────────────────────────────────────────────── const getPublicSiteProfile = (slug)=>request(`/users/site/${slug}`); const getSiteStats = ()=>request('/users/me/site-stats'); const trackSiteMessage = (slug)=>request(`/users/site/${slug}/track-message`, { method: 'POST' }).catch(()=>{}); // ─── Task stats (FOMO) ───────────────────────────────────────────────────── const getTaskStats = (taskId)=>request(`/tasks/${taskId}/stats`); // ─── Support tickets ─────────────────────────────────────────────────────── const sendPublicSupportMessage = (data)=>request('/support/public', { method: 'POST', body: JSON.stringify(data) }); const createSupportTicket = (data)=>request('/support', { method: 'POST', body: JSON.stringify(data) }); const getMySupportTickets = (page = 1)=>request(`/support/my?page=${page}`); const getAdminSupportTickets = (params)=>request(`/support${params ? '?' + new URLSearchParams(params) : ''}`); const replyToSupportTicket = (id, data)=>request(`/support/${id}/reply`, { method: 'PATCH', body: JSON.stringify(data) }); const setSupportTicketStatus = (id, status)=>request(`/support/${id}/status`, { method: 'PATCH', body: JSON.stringify({ status }) }); ^a b&/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $7: () => (/* binding */ updateCategory), /* harmony export */ $H: () => (/* binding */ acceptOffer), /* harmony export */ $M: () => (/* binding */ getUnreadCount), /* harmony export */ Bb: () => (/* binding */ getMySpecialistCards), /* harmony export */ Bm: () => (/* binding */ getUserRating), /* harmony export */ Bq: () => (/* binding */ getSpecialistCards), /* harmony export */ Br: () => (/* binding */ getAdminNotifLogs), /* harmony export */ C0: () => (/* binding */ applyMyReferral), /* harmony export */ CX: () => (/* binding */ updateAdminSettings), /* harmony export */ Ck: () => (/* binding */ getPriceList), /* harmony export */ Cs: () => (/* binding */ previewPlanChange), /* harmony export */ D1: () => (/* binding */ setAvailabilityRange), /* harmony export */ Em: () => (/* binding */ request), /* harmony export */ F7: () => (/* binding */ getSpecialists), /* harmony export */ F9: () => (/* binding */ getTaskInvite), /* harmony export */ FI: () => (/* binding */ sendTestEmail), /* harmony export */ Fu: () => (/* binding */ getMyTasks), /* harmony export */ GB: () => (/* binding */ deleteTaskAdmin), /* harmony export */ GE: () => (/* binding */ getSkillDedup), /* harmony export */ Gp: () => (/* binding */ getAutoResponseSettings), /* harmony export */ H: () => (/* binding */ getMyDashboard), /* harmony export */ H6: () => (/* binding */ getTaskReviews), /* harmony export */ He: () => (/* binding */ activateUser), /* harmony export */ I: () => (/* binding */ autoTranslateTasks), /* harmony export */ Ic: () => (/* binding */ deletePriceListGroup), /* harmony export */ Ip: () => (/* binding */ markRead), /* harmony export */ Je: () => (/* binding */ purchasePlan), /* harmony export */ K7: () => (/* binding */ deleteCategory), /* harmony export */ KD: () => (/* binding */ getAdminCategories), /* harmony export */ KZ: () => (/* binding */ getAdminSupportTickets), /* harmony export */ Lb: () => (/* binding */ declineOffer), /* harmony export */ Lp: () => (/* binding */ getAdminEmailTemplates), /* harmony export */ ML: () => (/* binding */ getCustomerFomoDashboard), /* harmony export */ Mm: () => (/* binding */ changeUserRole), /* harmony export */ NL: () => (/* binding */ markAllRead), /* harmony export */ Nt: () => (/* binding */ updateLocation), /* harmony export */ O8: () => (/* binding */ sendPublicSupportMessage), /* harmony export */ OM: () => (/* binding */ setAvailability), /* harmony export */ OV: () => (/* binding */ runAutoMatch), /* harmony export */ OX: () => (/* binding */ getAdminPlans), /* harmony export */ On: () => (/* binding */ getCanMessage), /* harmony export */ P0: () => (/* binding */ adminTopUpUserBalance), /* harmony export */ QN: () => (/* binding */ getOrCreateDirectRoom), /* harmony export */ QY: () => (/* binding */ getTasksTranslationPreview), /* harmony export */ RN: () => (/* binding */ getSiteStats), /* harmony export */ RQ: () => (/* binding */ updateAutoResponseSettings), /* harmony export */ Rt: () => (/* binding */ completeTask), /* harmony export */ S$: () => (/* binding */ getPublicSiteProfile), /* harmony export */ S9: () => (/* binding */ createSkill), /* harmony export */ Sw: () => (/* binding */ getOffers), /* harmony export */ T9: () => (/* binding */ getPlans), /* harmony export */ Tr: () => (/* binding */ getNotifications), /* harmony export */ U9: () => (/* binding */ deletePriceListItem), /* harmony export */ UE: () => (/* binding */ trackSiteMessage), /* harmony export */ UT: () => (/* binding */ createTask), /* harmony export */ Uq: () => (/* binding */ mergeSkillDuplicates), /* harmony export */ V: () => (/* binding */ addSpecialistFavorite), /* harmony export */ V7: () => (/* binding */ adminBroadcastPush), /* harmony export */ VL: () => (/* binding */ getMessages), /* harmony export */ VM: () => (/* binding */ getUserProfile), /* harmony export */ Vs: () => (/* binding */ getLocations), /* harmony export */ Wi: () => (/* binding */ deactivateUser), /* harmony export */ Xz: () => (/* binding */ getSpecialistAvailability), /* harmony export */ YQ: () => (/* binding */ getTranslationsStats), /* harmony export */ Yj: () => (/* binding */ getAdminTasks), /* harmony export */ Z2: () => (/* binding */ createPriceListItem), /* harmony export */ Zp: () => (/* binding */ getChatRooms), /* harmony export */ _z: () => (/* binding */ sendMessage), /* harmony export */ aT: () => (/* binding */ getMyOffers), /* harmony export */ bR: () => (/* binding */ deletePlan), /* harmony export */ bW: () => (/* binding */ getCategories), /* harmony export */ bc: () => (/* binding */ toggleStatus), /* harmony export */ bi: () => (/* binding */ getAdminNotifStats), /* harmony export */ bx: () => (/* binding */ createReview), /* harmony export */ cJ: () => (/* binding */ getAdminReferrals), /* harmony export */ cS: () => (/* binding */ getAdminUsers), /* harmony export */ cl: () => (/* binding */ verifyTelegramToken), /* harmony export */ cp: () => (/* binding */ autoTranslate), /* harmony export */ dE: () => (/* binding */ getAdminStats), /* harmony export */ eR: () => (/* binding */ createSpecialistCard), /* harmony export */ eU: () => (/* binding */ updateReportStatus), /* harmony export */ ew: () => (/* binding */ getPlanHistory), /* harmony export */ f5: () => (/* binding */ deleteSpecialistCard), /* harmony export */ fP: () => (/* binding */ updateSkill), /* harmony export */ fm: () => (/* binding */ getBalanceHistory), /* harmony export */ fu: () => (/* binding */ autoTranslateEmailTemplates), /* harmony export */ g0: () => (/* binding */ getAdminBalanceHistory), /* harmony export */ g1: () => (/* binding */ adminSendPushToUser), /* harmony export */ gg: () => (/* binding */ getTask), /* harmony export */ hD: () => (/* binding */ adminWithdrawUserBalance), /* harmony export */ hl: () => (/* binding */ updatePortfolioItem), /* harmony export */ hp: () => (/* binding */ deleteSkill), /* harmony export */ iN: () => (/* binding */ getMyAvailability), /* harmony export */ i_: () => (/* binding */ getAdminSkills), /* harmony export */ j_: () => (/* binding */ getAdminAiLogs), /* harmony export */ jd: () => (/* binding */ getAdminUser), /* harmony export */ jg: () => (/* binding */ updateAdminEmailTemplate), /* harmony export */ k_: () => (/* binding */ getAdminLocations), /* harmony export */ lC: () => (/* binding */ updateTask), /* harmony export */ mq: () => (/* binding */ createSupportTicket), /* harmony export */ nT: () => (/* binding */ replyToSupportTicket), /* harmony export */ nf: () => (/* binding */ cancelTaskAdmin), /* harmony export */ oD: () => (/* binding */ updatePriceListGroup), /* harmony export */ oh: () => (/* binding */ initiateTopUp), /* harmony export */ oq: () => (/* binding */ adminUpdateSpecialistCard), /* harmony export */ pD: () => (/* binding */ getSpecialistFavorites), /* harmony export */ pK: () => (/* binding */ getPaymentHistory), /* harmony export */ q7: () => (/* binding */ getMyReviews), /* harmony export */ qT: () => (/* binding */ createPlan), /* harmony export */ qX: () => (/* binding */ testTelegramConnection), /* harmony export */ qt: () => (/* binding */ getAdminMailLogs), /* harmony export */ rC: () => (/* binding */ getAdminSettings), /* harmony export */ rl: () => (/* binding */ getSkillSuggestions), /* harmony export */ sD: () => (/* binding */ removeSpecialistFavorite), /* harmony export */ s_: () => (/* binding */ getAdminSpecialistCards), /* harmony export */ st: () => (/* binding */ getMyReferralInfo), /* harmony export */ td: () => (/* binding */ updatePlan), /* harmony export */ ts: () => (/* binding */ createOffer), /* harmony export */ u0: () => (/* binding */ setSupportTicketStatus), /* harmony export */ u4: () => (/* binding */ getAdminMailStats), /* harmony export */ uQ: () => (/* binding */ verifyAdminUserEmail), /* harmony export */ v9: () => (/* binding */ getUserReviews), /* harmony export */ vD: () => (/* binding */ createPriceListGroup), /* harmony export */ vh: () => (/* binding */ getTaskStats), /* harmony export */ vy: () => (/* binding */ getAdminUserSpecialistCards), /* harmony export */ wc: () => (/* binding */ translateAdminEmailTemplate), /* harmony export */ wl: () => (/* binding */ updateAdminUser), /* harmony export */ yJ: () => (/* binding */ createLocation), /* harmony export */ yO: () => (/* binding */ getAdminActivityLogs), /* harmony export */ yk: () => (/* binding */ dismissNotification), /* harmony export */ z4: () => (/* binding */ getDailyUsage), /* harmony export */ z5: () => (/* binding */ getAdminReports), /* harmony export */ z6: () => (/* binding */ getMyStatuses), /* harmony export */ zB: () => (/* binding */ deletePortfolioItem), /* harmony export */ zR: () => (/* binding */ deleteLocation), /* harmony export */ zZ: () => (/* binding */ createCategory), /* harmony export */ zc: () => (/* binding */ updateSpecialistCard), /* harmony export */ zk: () => (/* binding */ getSpecialistFomoDashboard) /* harmony export */ }); /* unused harmony exports getTasks, getTaskBudgetRange, searchTasks, getTasksForSpecialist, getTaskCountsByCategory, cancelTask, updateNotifSettings, getFavorites, addFavorite, removeFavorite, getTranslationsMissing, saveTranslations, getMyPortfolio, addPortfolioItem, getSpecialistPortfolio, saveSiteSeo, updatePriceListItem, getFomoRecommendations, getAutoMatchResults, getGoogleCalendarStatus, disconnectGoogleCalendar, importFromGoogleCalendar, getGoogleCalendarConnectUrl, getMySupportTickets */ cijKL  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourcej/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FavoriteSpecialistButton: () => (/* binding */ FavoriteSpecialistButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13260); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(91864); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource/* __next_internal_client_entry_do_not_use__ FavoriteSpecialistButton auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { useState } from 'react'; import { useSession } from '@/lib/auth'; import { addSpecialistFavorite, removeSpecialistFavorite } from '@/lib/api'; export function FavoriteSpecialistButton({ specialistId, initialFavorite = false, favoriteLabel, unfavoriteLabel }) { const { data: session } = useSession(); const [isFavorite, setIsFavorite] = useState(initialFavorite); const [loading, setLoading] = useState(false); if (!session) return null; async function toggle(e) { e.preventDefault(); e.stopPropagation(); setLoading(true); try { if (isFavorite) { await removeSpecialistFavorite(specialistId); setIsFavorite(false); } else { await addSpecialistFavorite(specialistId); setIsFavorite(true); } } catch {} setLoading(false); } return /*#__PURE__*/ _jsx("button", { onClick: toggle, disabled: loading, title: isFavorite ? unfavoriteLabel : favoriteLabel, className: `absolute top-3 right-3 w-8 h-8 flex items-center justify-center rounded-full text-base transition disabled:opacity-50 ${isFavorite ? 'bg-pink-50 text-pink-500 hover:bg-pink-100' : 'bg-gray-50 text-gray-300 hover:text-pink-400 hover:bg-pink-50'}`, children: isFavorite ? '❤️' : '🤍' }); } c N}R%{!$(0,_lib_auth__WEBPACK_IMPORTED_MODULE_2__/* .useSession */ .wV)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .removeSpecialistFavorite */ .sD)(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .addSpecialistFavorite */ .V)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)RYj/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FavoriteSpecialistButton: () => (/* binding */ FavoriteSpecialistButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13260); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(91864); Z/* __next_internal_client_entry_do_not_use__ FavoriteSpecialistButton auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { useState } from 'react'; import { useSession } from '@/lib/auth'; import { addSpecialistFavorite, removeSpecialistFavorite } from '@/lib/api'; export function FavoriteSpecialistButton({ specialistId, initialFavorite = false, favoriteLabel, unfavoriteLabel }) { const { data: session } = useSession(); const [isFavorite, setIsFavorite] = useState(initialFavorite); const [loading, setLoading] = useState(false); if (!session) return null; async function toggle(e) { e.preventDefault(); e.stopPropagation(); setLoading(true); try { if (isFavorite) { await removeSpecialistFavorite(specialistId); setIsFavorite(false); } else { await addSpecialistFavorite(specialistId); setIsFavorite(true); } } catch {} setLoading(false); } return /*#__PURE__*/ _jsx("button", { onClick: toggle, disabled: loading, title: isFavorite ? unfavoriteLabel : favoriteLabel, className: `absolute top-3 right-3 w-8 h-8 flex items-center justify-center rounded-full text-base transition disabled:opacity-50 ${isFavorite ? 'bg-pink-50 text-pink-500 hover:bg-pink-100' : 'bg-gray-50 text-gray-300 hover:text-pink-400 hover:bg-pink-50'}`, children: isFavorite ? '❤️' : '🤍' }); }  78125undefined127159undefined161200undefined202277undefined279285undefined427436(0,_lib_auth__WEBPACK_IMPORTED_MODULE_2__/* .useSession */ .wV)undefined481488(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined542549(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined770793(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .removeSpecialistFavorite */ .sD)undefined891911(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .addSpecialistFavorite */ .V)undefined10571060(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined[\^_=?>@ _Lwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource=// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ SpecialistsPage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(5939); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(3498); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ../../node_modules/next/dist/api/headers.js var headers = __webpack_require__(56057); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(59902); // EXTERNAL MODULE: ./src/lib/translations.ts var translations = __webpack_require__(75112); ;// ./src/lib/formatName.ts webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!fullName?.trim()) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return `${parts[0]} ${parts[1][0].toUpperCase()}.`; } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName?.trim()) { const l = lastName?.trim(); return l ? `${firstName.trim()} ${l[0].toUpperCase()}.` : firstName.trim(); } return shortName(fallbackName); } C buffersourcesizemapshash/** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!fullName?.trim()) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return `${parts[0]} ${parts[1][0].toUpperCase()}.`; } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ function formatShortName(firstName, lastName, fallbackName) { if (firstName?.trim()) { const l = lastName?.trim(); return l ? `${firstName.trim()} ${l[0].toUpperCase()}.` : firstName.trim(); } return shortName(fallbackName); } ReplaceSourceRawSource$/** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!fullName?.trim()) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return `${parts[0]} ${parts[1][0].toUpperCase()}.`; } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName?.trim()) { const l = lastName?.trim(); return l ? `${firstName.trim()} ${l[0].toUpperCase()}.` : firstName.trim(); } return shortName(fallbackName); } 136142undefined523529undefined! ;// ./src/lib/formatLastSeen.ts  webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceWexport function formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); } Pfunction formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); } Wexport function formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); }  06undefined // EXTERNAL MODULE: ./src/components/FavoriteSpecialistButton.tsx var FavoriteSpecialistButton = __webpack_require__(57650); // EXTERNAL MODULE: ./src/components/SpecialistsFiltersClient.tsx var SpecialistsFiltersClient = __webpack_require__(50815); ;// ./src/components/PlanBadge.tsx  webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge({ tier, verified, size = 'sm', className = '' }) { if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: `inline-flex items-center gap-1 rounded-full font-semibold ${sizeClass} ${tierConfig[tier].class} ${className}`, children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: `inline-flex items-center gap-0.5 rounded-full font-semibold ${sizeClass} bg-green-100 text-green-700 border border-green-200 ${className}`, children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: `inline-flex items-center rounded-full font-semibold ${sizeClass} ${cfg.class} ${className}`, children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon({ className = '' }) { return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon({ className = '' }) { return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } b>_VY9<]`'* U X ' *  C __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._ const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; function PlanBadge({ tier, verified, size = 'sm', className = '' }) { if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: `inline-flex items-center gap-1 rounded-full font-semibold ${sizeClass} ${tierConfig[tier].class} ${className}`, children: [ tier === 'ultimate' ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: `inline-flex items-center gap-0.5 rounded-full font-semibold ${sizeClass} bg-green-100 text-green-700 border border-green-200 ${className}`, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: `inline-flex items-center rounded-full font-semibold ${sizeClass} ${cfg.class} ${className}`, children: [ tier === 'pro' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon({ className = '' }) { return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon({ className = '' }) { return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge({ tier, verified, size = 'sm', className = '' }) { if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: `inline-flex items-center gap-1 rounded-full font-semibold ${sizeClass} ${tierConfig[tier].class} ${className}`, children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: `inline-flex items-center gap-0.5 rounded-full font-semibold ${sizeClass} bg-green-100 text-green-700 border border-green-200 ${className}`, children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: `inline-flex items-center rounded-full font-semibold ${sizeClass} ${cfg.class} ${className}`, children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon({ className = '' }) { return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon({ className = '' }) { return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } 9062undefined342345__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined513516__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined910913__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined10811084__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined12631269undefined15501554__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined17781781__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined18851888__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined20872090__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined23022305__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined24522456__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined26452648__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined27782781__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined29832986__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31113114__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined33403344__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined34833486__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined37433746__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined`_a S'0Z  ;  ! ~A(0,react_jsx_runtime.jsx)(0,react_jsx_runtime.jsxs)$ ;// ./src/app/specialists/page.tsx  Kwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceCimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import Link from 'next/link'; import { cookies } from 'next/headers'; import { getSpecialists, getCategories, getLocations } from '@/lib/api'; import { getTranslations } from '@/lib/translations'; import { formatShortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { FavoriteSpecialistButton } from '@/components/FavoriteSpecialistButton'; import { SpecialistsFiltersClient } from '@/components/SpecialistsFiltersClient'; import { PlanBadge } from '@/components/PlanBadge'; export default async function SpecialistsPage({ searchParams }) { const params = await searchParams; const page = Number(params.page || 1); const cookieStore = await cookies(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const t = getTranslations(locale); const cookieLocation = decodeURIComponent(cookieStore.get('canhelp_location')?.value ?? ''); // Location filter only applies when explicitly set in URL params, not from cookie const effectiveLocation = params.location; let specialists = []; let total = 0; let catTree = []; let locationTree = []; let favoriteIds = new Set(); const BASE = process.env.INTERNAL_API_URL || 'http://localhost:4000'; const cookieHeader = cookieStore.getAll().map((c)=>`${c.name}=${c.value}`).join('; '); try { const [result, cats, locs] = await Promise.all([ getSpecialists({ page: String(page), limit: '20', locale, ...params, ...effectiveLocation ? { location: effectiveLocation } : {} }), getCategories().catch(()=>[]), getLocations().catch(()=>[]) ]); console.log('[SpecialistsPage] got', result.total, 'specialists, data.length=', result.data.length); specialists = result.data; total = result.total; catTree = cats; locationTree = locs; } catch (err) { console.error('[SpecialistsPage] fetch error:', err); } if (cookieHeader) { try { const favRes = await fetch(`${BASE}/api/favorites/specialists`, { headers: { Cookie: cookieHeader } }); if (favRes.ok) { const favData = await favRes.json(); favoriteIds = new Set(favData.map((row)=>row.specialist?.id).filter(Boolean)); } } catch {} } const totalPages = Math.ceil(total / 20); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const buildUrl = (overrides)=>{ const merged = { ...params, ...effectiveLocation ? { location: effectiveLocation } : {}, ...overrides }; const qs = Object.entries(merged).filter(([, v])=>v !== undefined && v !== '').map(([k, v])=>`${k}=${encodeURIComponent(v)}`).join('&'); return `/specialists${qs ? '?' + qs : ''}`; }; return /*#__PURE__*/ _jsx("div", { className: "max-w-7xl mx-auto px-4 py-8", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-col md:flex-row gap-8", children: [ /*#__PURE__*/ _jsx("aside", { className: "md:w-64 shrink-0", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 mb-4", children: t('tasks.search') }), /*#__PURE__*/ _jsx(SpecialistsFiltersClient, { catTree: catTree, locations: locationTree, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialLanguages: params.language ? params.language.split(',').filter(Boolean) : [] }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ (params.q || params.category || params.location || params.language) && /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs("h1", { className: "text-xl font-bold text-white", children: [ total, " ", t('specialists.title').toLowerCase() ] }) }), specialists.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/70", children: /*#__PURE__*/ _jsx("p", { className: "text-lg", children: t('specialists.empty') }) }) : /*#__PURE__*/ _jsx("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: specialists.map((user)=>{ const displayName = formatShortName(user.firstName, user.lastName, user.name); const initials = `${user.firstName?.[0] ?? ''}${user.lastName?.[0] ?? ''}`.toUpperCase() || user.name?.[0]?.toUpperCase() || '?'; return /*#__PURE__*/ _jsxs("div", { className: "relative bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-green-300 transition flex flex-col", children: [ /*#__PURE__*/ _jsx(Link, { href: `/users/${user.id}`, className: "absolute inset-0 rounded-xl", "aria-label": displayName }), /*#__PURE__*/ _jsx(FavoriteSpecialistButton, { specialistId: user.id, initialFavorite: favoriteIds.has(user.id), favoriteLabel: t('specialist.favorite'), unfavoriteLabel: t('specialist.unfavorite') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: user.image ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-900 truncate", children: displayName }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now') ] }), user.rating && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-yellow-400 text-sm", children: "★" }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-700", children: Number(user.rating).toFixed(1) }) ] }), user.todayStatus === 'available' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), user.todayStatus === 'busy' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-red-700 bg-red-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), user.cards && user.cards.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-1.5 mb-2", children: [ user.cards.slice(0, 2).map((card)=>/*#__PURE__*/ _jsx("span", { className: "text-xs bg-gray-100 text-gray-700 px-2 py-0.5 rounded-full font-medium", children: card.title }, card.id)), user.cards.length > 2 && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "+", user.cards.length - 2 ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 line-clamp-2 flex-1 mt-1", children: user.bio || t('specialists.no_bio') }), user.lastSeenAt && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-3", children: formatLastSeen(user.lastSeenAt, t) }) ] }, user.id); }) }), totalPages > 1 && /*#__PURE__*/ _jsx("div", { className: "flex justify-center gap-2 mt-8", children: Array.from({ length: totalPages }, (_, i)=>i + 1).map((p)=>/*#__PURE__*/ _jsx(Link, { href: buildUrl({ page: String(p) }), className: `w-10 h-10 flex items-center justify-center rounded-lg text-sm font-medium ${p === page ? 'bg-green-600 text-white' : 'bg-white border border-gray-200 text-gray-700 hover:border-green-400'}`, children: p }, p)) }) ] }) ] }) }); } e?>@\^_79npFHVXf I M _ 7;IM  be7EIMhkmp_`cY ] ?!B!""####%%%%'')),)Y+]+x,{,--<0X@01133V5Y588998;<;d=g=>>??L?S@V@UAXAZA]A__WEBPACK_MODULE_REFERENCE__2_5b22636f6f6b696573225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__4_5b226765745472616e736c6174696f6e73225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__3_5b226765745370656369616c69737473225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__3_5b2267657443617465676f72696573225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__3_5b226765744c6f636174696f6e73225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__8_5b225370656369616c6973747346696c74657273436c69656e74225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__7_5b224661766f726974655370656369616c697374427574746f6e225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b22666f726d61744c6173745365656e225d_call_directImport_asiSafe1__._KP async function SpecialistsPage({ searchParams }) { const params = await searchParams; const page = Number(params.page || 1); const cookieStore = await __WEBPACK_MODULE_REFERENCE__2_5b22636f6f6b696573225d_call_directImport_asiSafe1__._(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const t = __WEBPACK_MODULE_REFERENCE__4_5b226765745472616e736c6174696f6e73225d_call_directImport_asiSafe1__._(locale); const cookieLocation = decodeURIComponent(cookieStore.get('canhelp_location')?.value ?? ''); // Location filter only applies when explicitly set in URL params, not from cookie const effectiveLocation = params.location; let specialists = []; let total = 0; let catTree = []; let locationTree = []; let favoriteIds = new Set(); const BASE = process.env.INTERNAL_API_URL || 'http://localhost:4000'; const cookieHeader = cookieStore.getAll().map((c)=>`${c.name}=${c.value}`).join('; '); try { const [result, cats, locs] = await Promise.all([ __WEBPACK_MODULE_REFERENCE__3_5b226765745370656369616c69737473225d_call_directImport_asiSafe1__._({ page: String(page), limit: '20', locale, ...params, ...effectiveLocation ? { location: effectiveLocation } : {} }), __WEBPACK_MODULE_REFERENCE__3_5b2267657443617465676f72696573225d_call_directImport_asiSafe1__._().catch(()=>[]), __WEBPACK_MODULE_REFERENCE__3_5b226765744c6f636174696f6e73225d_call_directImport_asiSafe1__._().catch(()=>[]) ]); console.log('[SpecialistsPage] got', result.total, 'specialists, data.length=', result.data.length); specialists = result.data; total = result.total; catTree = cats; locationTree = locs; } catch (err) { console.error('[SpecialistsPage] fetch error:', err); } if (cookieHeader) { try { const favRes = await fetch(`${BASE}/api/favorites/specialists`, { headers: { Cookie: cookieHeader } }); if (favRes.ok) { const favData = await favRes.json(); favoriteIds = new Set(favData.map((row)=>row.specialist?.id).filter(Boolean)); } } catch {} } const totalPages = Math.ceil(total / 20); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const buildUrl = (overrides)=>{ const merged = { ...params, ...effectiveLocation ? { location: effectiveLocation } : {}, ...overrides }; const qs = Object.entries(merged).filter(([, v])=>v !== undefined && v !== '').map(([k, v])=>`${k}=${encodeURIComponent(v)}`).join('&'); return `/specialists${qs ? '?' + qs : ''}`; }; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "max-w-7xl mx-auto px-4 py-8", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex flex-col md:flex-row gap-8", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("aside", { className: "md:w-64 shrink-0", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h3", { className: "font-semibold text-gray-900 mb-4", children: t('tasks.search') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__8_5b225370656369616c6973747346696c74657273436c69656e74225d_directImport_asiSafe1__._, { catTree: catTree, locations: locationTree, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialLanguages: params.language ? params.language.split(',').filter(Boolean) : [] }) ] }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex-1", children: [ (params.q || params.category || params.location || params.language) && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "mb-6", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("h1", { className: "text-xl font-bold text-white", children: [ total, " ", t('specialists.title').toLowerCase() ] }) }), specialists.length === 0 ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "text-center py-20 text-white/70", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-lg", children: t('specialists.empty') }) }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: specialists.map((user)=>{ const displayName = __WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._(user.firstName, user.lastName, user.name); const initials = `${user.firstName?.[0] ?? ''}${user.lastName?.[0] ?? ''}`.toUpperCase() || user.name?.[0]?.toUpperCase() || '?'; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "relative bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-green-300 transition flex flex-col", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: `/users/${user.id}`, className: "absolute inset-0 rounded-xl", "aria-label": displayName }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__7_5b224661766f726974655370656369616c697374427574746f6e225d_directImport_asiSafe1__._, { specialistId: user.id, initialFavorite: favoriteIds.has(user.id), favoriteLabel: t('specialist.favorite'), unfavoriteLabel: t('specialist.unfavorite') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: user.image ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { className: "font-semibold text-gray-900 truncate", children: displayName }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-2 flex-wrap", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__._, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__._, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now') ] }), user.rating && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-yellow-400 text-sm", children: "★" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-sm font-medium text-gray-700", children: Number(user.rating).toFixed(1) }) ] }), user.todayStatus === 'available' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), user.todayStatus === 'busy' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-red-700 bg-red-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), user.cards && user.cards.length > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex flex-wrap gap-1.5 mb-2", children: [ user.cards.slice(0, 2).map((card)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-xs bg-gray-100 text-gray-700 px-2 py-0.5 rounded-full font-medium", children: card.title }, card.id)), user.cards.length > 2 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-xs text-gray-400", children: [ "+", user.cards.length - 2 ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-sm text-gray-500 line-clamp-2 flex-1 mt-1", children: user.bio || t('specialists.no_bio') }), user.lastSeenAt && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs text-gray-400 mt-3", children: __WEBPACK_MODULE_REFERENCE__6_5b22666f726d61744c6173745365656e225d_call_directImport_asiSafe1__._(user.lastSeenAt, t) }) ] }, user.id); }) }), totalPages > 1 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "flex justify-center gap-2 mt-8", children: Array.from({ length: totalPages }, (_, i)=>i + 1).map((p)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: buildUrl({ page: String(p) }), className: `w-10 h-10 flex items-center justify-center rounded-lg text-sm font-medium ${p === page ? 'bg-green-600 text-white' : 'bg-white border border-gray-200 text-gray-700 hover:border-green-400'}`, children: p }, p)) }) ] }) ] }) }); } Cimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import Link from 'next/link'; import { cookies } from 'next/headers'; import { getSpecialists, getCategories, getLocations } from '@/lib/api'; import { getTranslations } from '@/lib/translations'; import { formatShortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { FavoriteSpecialistButton } from '@/components/FavoriteSpecialistButton'; import { SpecialistsFiltersClient } from '@/components/SpecialistsFiltersClient'; import { PlanBadge } from '@/components/PlanBadge'; export default async function SpecialistsPage({ searchParams }) { const params = await searchParams; const page = Number(params.page || 1); const cookieStore = await cookies(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const t = getTranslations(locale); const cookieLocation = decodeURIComponent(cookieStore.get('canhelp_location')?.value ?? ''); // Location filter only applies when explicitly set in URL params, not from cookie const effectiveLocation = params.location; let specialists = []; let total = 0; let catTree = []; let locationTree = []; let favoriteIds = new Set(); const BASE = process.env.INTERNAL_API_URL || 'http://localhost:4000'; const cookieHeader = cookieStore.getAll().map((c)=>`${c.name}=${c.value}`).join('; '); try { const [result, cats, locs] = await Promise.all([ getSpecialists({ page: String(page), limit: '20', locale, ...params, ...effectiveLocation ? { location: effectiveLocation } : {} }), getCategories().catch(()=>[]), getLocations().catch(()=>[]) ]); console.log('[SpecialistsPage] got', result.total, 'specialists, data.length=', result.data.length); specialists = result.data; total = result.total; catTree = cats; locationTree = locs; } catch (err) { console.error('[SpecialistsPage] fetch error:', err); } if (cookieHeader) { try { const favRes = await fetch(`${BASE}/api/favorites/specialists`, { headers: { Cookie: cookieHeader } }); if (favRes.ok) { const favData = await favRes.json(); favoriteIds = new Set(favData.map((row)=>row.specialist?.id).filter(Boolean)); } } catch {} } const totalPages = Math.ceil(total / 20); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const buildUrl = (overrides)=>{ const merged = { ...params, ...effectiveLocation ? { location: effectiveLocation } : {}, ...overrides }; const qs = Object.entries(merged).filter(([, v])=>v !== undefined && v !== '').map(([k, v])=>`${k}=${encodeURIComponent(v)}`).join('&'); return `/specialists${qs ? '?' + qs : ''}`; }; return /*#__PURE__*/ _jsx("div", { className: "max-w-7xl mx-auto px-4 py-8", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-col md:flex-row gap-8", children: [ /*#__PURE__*/ _jsx("aside", { className: "md:w-64 shrink-0", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 mb-4", children: t('tasks.search') }), /*#__PURE__*/ _jsx(SpecialistsFiltersClient, { catTree: catTree, locations: locationTree, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialLanguages: params.language ? params.language.split(',').filter(Boolean) : [] }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ (params.q || params.category || params.location || params.language) && /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs("h1", { className: "text-xl font-bold text-white", children: [ total, " ", t('specialists.title').toLowerCase() ] }) }), specialists.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/70", children: /*#__PURE__*/ _jsx("p", { className: "text-lg", children: t('specialists.empty') }) }) : /*#__PURE__*/ _jsx("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: specialists.map((user)=>{ const displayName = formatShortName(user.firstName, user.lastName, user.name); const initials = `${user.firstName?.[0] ?? ''}${user.lastName?.[0] ?? ''}`.toUpperCase() || user.name?.[0]?.toUpperCase() || '?'; return /*#__PURE__*/ _jsxs("div", { className: "relative bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-green-300 transition flex flex-col", children: [ /*#__PURE__*/ _jsx(Link, { href: `/users/${user.id}`, className: "absolute inset-0 rounded-xl", "aria-label": displayName }), /*#__PURE__*/ _jsx(FavoriteSpecialistButton, { specialistId: user.id, initialFavorite: favoriteIds.has(user.id), favoriteLabel: t('specialist.favorite'), unfavoriteLabel: t('specialist.unfavorite') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: user.image ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-900 truncate", children: displayName }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now') ] }), user.rating && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-yellow-400 text-sm", children: "★" }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-700", children: Number(user.rating).toFixed(1) }) ] }), user.todayStatus === 'available' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), user.todayStatus === 'busy' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-red-700 bg-red-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), user.cards && user.cards.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-1.5 mb-2", children: [ user.cards.slice(0, 2).map((card)=>/*#__PURE__*/ _jsx("span", { className: "text-xs bg-gray-100 text-gray-700 px-2 py-0.5 rounded-full font-medium", children: card.title }, card.id)), user.cards.length > 2 && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "+", user.cards.length - 2 ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 line-clamp-2 flex-1 mt-1", children: user.bio || t('specialists.no_bio') }), user.lastSeenAt && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-3", children: formatLastSeen(user.lastSeenAt, t) }) ] }, user.id); }) }), totalPages > 1 && /*#__PURE__*/ _jsx("div", { className: "flex justify-center gap-2 mt-8", children: Array.from({ length: totalPages }, (_, i)=>i + 1).map((p)=>/*#__PURE__*/ _jsx(Link, { href: buildUrl({ page: String(p) }), className: `w-10 h-10 flex items-center justify-center rounded-lg text-sm font-medium ${p === page ? 'bg-green-600 text-white' : 'bg-white border border-gray-200 text-gray-700 hover:border-green-400'}`, children: p }, p)) }) ] }) ] }) }); } s062undefined6492undefined94132undefined134205undefined207259undefined261311undefined313366undefined368448undefined450530undefined532582undefined584598undefined762768__WEBPACK_MODULE_REFERENCE__2_5b22636f6f6b696573225d_call_directImport_asiSafe1__._undefined856870__WEBPACK_MODULE_REFERENCE__4_5b226765745472616e736c6174696f6e73225d_call_directImport_asiSafe1__._undefined14831496__WEBPACK_MODULE_REFERENCE__3_5b226765745370656369616c69737473225d_call_directImport_asiSafe1__._undefined17561768__WEBPACK_MODULE_REFERENCE__3_5b2267657443617465676f72696573225d_call_directImport_asiSafe1__._undefined17991810__WEBPACK_MODULE_REFERENCE__3_5b226765744c6f636174696f6e73225d_call_directImport_asiSafe1__._undefined33053308__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined34013405__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined35283531__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined36393643__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined38313834__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined40574060__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined40624085__WEBPACK_MODULE_REFERENCE__8_5b225370656369616c6973747346696c74657273436c69656e74225d_directImport_asiSafe1__._undefined46274631__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined48244827__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined49374941__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined53855388__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined55255528__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined57305733__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined59435957__WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._undefined62176221__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined65046507__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined65096512__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined68426845__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined68476870__WEBPACK_MODULE_REFERENCE__7_5b224661766f726974655370656369616c697374427574746f6e225d_directImport_asiSafe1__._undefined73007304__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined75207523__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined78447847__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined82818285__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined85118514__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined88478851__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined91659168__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined91709178__WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined96519654__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined96569664__WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1014610150__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1053710540__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1109711101__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1138411387__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1176511768__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1234812352__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1271612719__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1329013294__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1365413657__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1452014524__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1477414777__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1516015164__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1571615719__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1604016043__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1619116204__WEBPACK_MODULE_REFERENCE__6_5b22666f726d61744c6173745365656e225d_call_directImport_asiSafe1__._undefined1646716470__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1672516728__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1673016733__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined`4_W~[2 | % V^B`m%q-w_J^0GI*,I!!m""#B$%@&"'l'()?****_,,-R-4//1M1z334+566399:5;p==$?n?BCD]DE(FPHHI%JGJK LjLiMMMN(0,headers/* cookies */.UL)(0,translations/* getTranslations */.$)(0,api/* getSpecialists */.F7)(0,api/* getCategories */.bW)(0,api/* getLocations */.Vs)SpecialistsFiltersClient.SpecialistsFiltersClientformatShortName(link_default())FavoriteSpecialistButton.FavoriteSpecialistButtonPlanBadgeformatLastSeenF`M=// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ SpecialistsPage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(5939); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(3498); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ../../node_modules/next/dist/api/headers.js var headers = __webpack_require__(56057); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(59902); // EXTERNAL MODULE: ./src/lib/translations.ts var translations = __webpack_require__(75112); ;// ./src/lib/formatName.ts  ReplaceSourceM$/** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!fullName?.trim()) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return `${parts[0]} ${parts[1][0].toUpperCase()}.`; } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName?.trim()) { const l = lastName?.trim(); return l ? `${firstName.trim()} ${l[0].toUpperCase()}.` : firstName.trim(); } return shortName(fallbackName); } 136142undefined523529undefined RawSource! ;// ./src/lib/formatLastSeen.ts IWexport function formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); }  06undefined // EXTERNAL MODULE: ./src/components/FavoriteSpecialistButton.tsx var FavoriteSpecialistButton = __webpack_require__(57650); // EXTERNAL MODULE: ./src/components/SpecialistsFiltersClient.tsx var SpecialistsFiltersClient = __webpack_require__(50815); ;// ./src/components/PlanBadge.tsx Fimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge({ tier, verified, size = 'sm', className = '' }) { if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: `inline-flex items-center gap-1 rounded-full font-semibold ${sizeClass} ${tierConfig[tier].class} ${className}`, children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: `inline-flex items-center gap-0.5 rounded-full font-semibold ${sizeClass} bg-green-100 text-green-700 border border-green-200 ${className}`, children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: `inline-flex items-center rounded-full font-semibold ${sizeClass} ${cfg.class} ${className}`, children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon({ className = '' }) { return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon({ className = '' }) { return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } 9062undefined342345__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined513516__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined910913__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined10811084__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined12631269undefined15501554__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined17781781__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined18851888__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined20872090__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined23022305__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined24522456__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined26452648__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined27782781__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined29832986__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31113114__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined33403344__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined34833486__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined37433746__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined279353(0,react_jsx_runtime.jsx)undefined521595(0,react_jsx_runtime.jsx)undefined9891063(0,react_jsx_runtime.jsx)undefined12311305(0,react_jsx_runtime.jsx)undefined17641840(0,react_jsx_runtime.jsxs)undefined20642138(0,react_jsx_runtime.jsx)undefined22422316(0,react_jsx_runtime.jsx)undefined25152589(0,react_jsx_runtime.jsx)undefined28012875(0,react_jsx_runtime.jsx)undefined30223098(0,react_jsx_runtime.jsxs)undefined32873361(0,react_jsx_runtime.jsx)undefined34913565(0,react_jsx_runtime.jsx)undefined37673841(0,react_jsx_runtime.jsx)undefined39664040(0,react_jsx_runtime.jsx)undefined42664342(0,react_jsx_runtime.jsxs)undefined44814555(0,react_jsx_runtime.jsx)undefined48124886(0,react_jsx_runtime.jsx)undefinedRawSource$ ;// ./src/app/specialists/page.tsx BCimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import Link from 'next/link'; import { cookies } from 'next/headers'; import { getSpecialists, getCategories, getLocations } from '@/lib/api'; import { getTranslations } from '@/lib/translations'; import { formatShortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { FavoriteSpecialistButton } from '@/components/FavoriteSpecialistButton'; import { SpecialistsFiltersClient } from '@/components/SpecialistsFiltersClient'; import { PlanBadge } from '@/components/PlanBadge'; export default async function SpecialistsPage({ searchParams }) { const params = await searchParams; const page = Number(params.page || 1); const cookieStore = await cookies(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const t = getTranslations(locale); const cookieLocation = decodeURIComponent(cookieStore.get('canhelp_location')?.value ?? ''); // Location filter only applies when explicitly set in URL params, not from cookie const effectiveLocation = params.location; let specialists = []; let total = 0; let catTree = []; let locationTree = []; let favoriteIds = new Set(); const BASE = process.env.INTERNAL_API_URL || 'http://localhost:4000'; const cookieHeader = cookieStore.getAll().map((c)=>`${c.name}=${c.value}`).join('; '); try { const [result, cats, locs] = await Promise.all([ getSpecialists({ page: String(page), limit: '20', locale, ...params, ...effectiveLocation ? { location: effectiveLocation } : {} }), getCategories().catch(()=>[]), getLocations().catch(()=>[]) ]); console.log('[SpecialistsPage] got', result.total, 'specialists, data.length=', result.data.length); specialists = result.data; total = result.total; catTree = cats; locationTree = locs; } catch (err) { console.error('[SpecialistsPage] fetch error:', err); } if (cookieHeader) { try { const favRes = await fetch(`${BASE}/api/favorites/specialists`, { headers: { Cookie: cookieHeader } }); if (favRes.ok) { const favData = await favRes.json(); favoriteIds = new Set(favData.map((row)=>row.specialist?.id).filter(Boolean)); } } catch {} } const totalPages = Math.ceil(total / 20); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const buildUrl = (overrides)=>{ const merged = { ...params, ...effectiveLocation ? { location: effectiveLocation } : {}, ...overrides }; const qs = Object.entries(merged).filter(([, v])=>v !== undefined && v !== '').map(([k, v])=>`${k}=${encodeURIComponent(v)}`).join('&'); return `/specialists${qs ? '?' + qs : ''}`; }; return /*#__PURE__*/ _jsx("div", { className: "max-w-7xl mx-auto px-4 py-8", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-col md:flex-row gap-8", children: [ /*#__PURE__*/ _jsx("aside", { className: "md:w-64 shrink-0", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 mb-4", children: t('tasks.search') }), /*#__PURE__*/ _jsx(SpecialistsFiltersClient, { catTree: catTree, locations: locationTree, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialLanguages: params.language ? params.language.split(',').filter(Boolean) : [] }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ (params.q || params.category || params.location || params.language) && /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs("h1", { className: "text-xl font-bold text-white", children: [ total, " ", t('specialists.title').toLowerCase() ] }) }), specialists.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/70", children: /*#__PURE__*/ _jsx("p", { className: "text-lg", children: t('specialists.empty') }) }) : /*#__PURE__*/ _jsx("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: specialists.map((user)=>{ const displayName = formatShortName(user.firstName, user.lastName, user.name); const initials = `${user.firstName?.[0] ?? ''}${user.lastName?.[0] ?? ''}`.toUpperCase() || user.name?.[0]?.toUpperCase() || '?'; return /*#__PURE__*/ _jsxs("div", { className: "relative bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-green-300 transition flex flex-col", children: [ /*#__PURE__*/ _jsx(Link, { href: `/users/${user.id}`, className: "absolute inset-0 rounded-xl", "aria-label": displayName }), /*#__PURE__*/ _jsx(FavoriteSpecialistButton, { specialistId: user.id, initialFavorite: favoriteIds.has(user.id), favoriteLabel: t('specialist.favorite'), unfavoriteLabel: t('specialist.unfavorite') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: user.image ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-900 truncate", children: displayName }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now') ] }), user.rating && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-yellow-400 text-sm", children: "★" }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-700", children: Number(user.rating).toFixed(1) }) ] }), user.todayStatus === 'available' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), user.todayStatus === 'busy' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-red-700 bg-red-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), user.cards && user.cards.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-1.5 mb-2", children: [ user.cards.slice(0, 2).map((card)=>/*#__PURE__*/ _jsx("span", { className: "text-xs bg-gray-100 text-gray-700 px-2 py-0.5 rounded-full font-medium", children: card.title }, card.id)), user.cards.length > 2 && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "+", user.cards.length - 2 ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 line-clamp-2 flex-1 mt-1", children: user.bio || t('specialists.no_bio') }), user.lastSeenAt && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-3", children: formatLastSeen(user.lastSeenAt, t) }) ] }, user.id); }) }), totalPages > 1 && /*#__PURE__*/ _jsx("div", { className: "flex justify-center gap-2 mt-8", children: Array.from({ length: totalPages }, (_, i)=>i + 1).map((p)=>/*#__PURE__*/ _jsx(Link, { href: buildUrl({ page: String(p) }), className: `w-10 h-10 flex items-center justify-center rounded-lg text-sm font-medium ${p === page ? 'bg-green-600 text-white' : 'bg-white border border-gray-200 text-gray-700 hover:border-green-400'}`, children: p }, p)) }) ] }) ] }) }); } s062undefined6492undefined94132undefined134205undefined207259undefined261311undefined313366undefined368448undefined450530undefined532582undefined584598undefined762768__WEBPACK_MODULE_REFERENCE__2_5b22636f6f6b696573225d_call_directImport_asiSafe1__._undefined856870__WEBPACK_MODULE_REFERENCE__4_5b226765745472616e736c6174696f6e73225d_call_directImport_asiSafe1__._undefined14831496__WEBPACK_MODULE_REFERENCE__3_5b226765745370656369616c69737473225d_call_directImport_asiSafe1__._undefined17561768__WEBPACK_MODULE_REFERENCE__3_5b2267657443617465676f72696573225d_call_directImport_asiSafe1__._undefined17991810__WEBPACK_MODULE_REFERENCE__3_5b226765744c6f636174696f6e73225d_call_directImport_asiSafe1__._undefined33053308__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined34013405__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined35283531__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined36393643__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined38313834__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined40574060__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined40624085__WEBPACK_MODULE_REFERENCE__8_5b225370656369616c6973747346696c74657273436c69656e74225d_directImport_asiSafe1__._undefined46274631__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined48244827__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined49374941__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined53855388__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined55255528__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined57305733__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined59435957__WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._undefined62176221__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined65046507__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined65096512__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined68426845__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined68476870__WEBPACK_MODULE_REFERENCE__7_5b224661766f726974655370656369616c697374427574746f6e225d_directImport_asiSafe1__._undefined73007304__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined75207523__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined78447847__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined82818285__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined85118514__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined88478851__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined91659168__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined91709178__WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined96519654__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined96569664__WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1014610150__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1053710540__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1109711101__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1138411387__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1176511768__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1234812352__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1271612719__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1329013294__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1365413657__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1452014524__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1477414777__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1516015164__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1571615719__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1604016043__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1619116204__WEBPACK_MODULE_REFERENCE__6_5b22666f726d61744c6173745365656e225d_call_directImport_asiSafe1__._undefined1646716470__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1672516728__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1673016733__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined173255(0,headers/* cookies */.UL)undefined343441(0,translations/* getTranslations */.$)undefined10541150(0,api/* getSpecialists */.F7)undefined14101504(0,api/* getCategories */.bW)undefined15351627(0,api/* getLocations */.Vs)undefined31223196(0,react_jsx_runtime.jsx)undefined32893365(0,react_jsx_runtime.jsxs)undefined34883562(0,react_jsx_runtime.jsx)undefined36703746(0,react_jsx_runtime.jsxs)undefined39344008(0,react_jsx_runtime.jsx)undefined42314305(0,react_jsx_runtime.jsx)undefined43074418SpecialistsFiltersClient.SpecialistsFiltersClientundefined49605036(0,react_jsx_runtime.jsxs)undefined52295303(0,react_jsx_runtime.jsx)undefined54135489(0,react_jsx_runtime.jsxs)undefined59336007(0,react_jsx_runtime.jsx)undefined61446218(0,react_jsx_runtime.jsx)undefined64206494(0,react_jsx_runtime.jsx)undefined67046802formatShortNameundefined70627138(0,react_jsx_runtime.jsxs)undefined74217495(0,react_jsx_runtime.jsx)undefined74977574(link_default())undefined79047978(0,react_jsx_runtime.jsx)undefined79808091FavoriteSpecialistButton.FavoriteSpecialistButtonundefined85218597(0,react_jsx_runtime.jsxs)undefined88138887(0,react_jsx_runtime.jsx)undefined92089282(0,react_jsx_runtime.jsx)undefined97169792(0,react_jsx_runtime.jsxs)undefined1001810092(0,react_jsx_runtime.jsx)undefined1042510501(0,react_jsx_runtime.jsxs)undefined1081510889(0,react_jsx_runtime.jsx)undefined1089110972PlanBadgeundefined1144511519(0,react_jsx_runtime.jsx)undefined1152111602PlanBadgeundefined1208412160(0,react_jsx_runtime.jsxs)undefined1254712621(0,react_jsx_runtime.jsx)undefined1317813254(0,react_jsx_runtime.jsxs)undefined1353713611(0,react_jsx_runtime.jsx)undefined1398914063(0,react_jsx_runtime.jsx)undefined1464314719(0,react_jsx_runtime.jsxs)undefined1508315157(0,react_jsx_runtime.jsx)undefined1572815804(0,react_jsx_runtime.jsxs)undefined1616416238(0,react_jsx_runtime.jsx)undefined1710117177(0,react_jsx_runtime.jsxs)undefined1742717501(0,react_jsx_runtime.jsx)undefined1788417960(0,react_jsx_runtime.jsxs)undefined1851218586(0,react_jsx_runtime.jsx)undefined1890718981(0,react_jsx_runtime.jsx)undefined1912919225formatLastSeenundefined1948819562(0,react_jsx_runtime.jsx)undefined1981719891(0,react_jsx_runtime.jsx)undefined1989319970(link_default())undefinedtopLevelDeclarations`react_jsx_runtimereact_jsx_runtime_namespaceObjectreact_jsx_runtime_defaultapp_dir_linklink_namespaceObjectlink_defaultheadersapitranslationsshortNameformatShortNameformatName_namespaceObjectformatLastSeenformatLastSeen_namespaceObjectFavoriteSpecialistButtonSpecialistsFiltersClienttierConfigPlanBadgeStarIconVerifiedIconPlanBadge_namespaceObjectSpecialistsPagepage_namespaceObject+,*() ɰwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceN // EXPORTS __webpack_require__.d(__webpack_exports__, { Header: () => (/* binding */ Header) }); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(78157); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(94496); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(71159); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(13260); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(96484); // EXTERNAL MODULE: ./src/lib/formatName.ts var formatName = __webpack_require__(48178); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js var react = __webpack_require__(31768); // EXTERNAL MODULE: ./src/lib/translations.ts var translations = __webpack_require__(12998); ;// ./src/components/LanguageSwitcher.tsx webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Xwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourcec/* __next_internal_client_entry_do_not_use__ LanguageSwitcher auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useRef, useEffect } from 'react'; import { useLocale } from '@/context/locale'; import { LOCALES } from '@/lib/translations'; export function LanguageSwitcher() { const { locale, setLocale } = useLocale(); const [open, setOpen] = useState(false); const ref = useRef(null); const current = LOCALES.find((l)=>l.code === locale) ?? LOCALES[0]; // Close on outside click process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) setOpen(false); } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); return /*#__PURE__*/ _jsxs("div", { ref: ref, className: "relative", children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setOpen(!open), className: "flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-gray-200 hover:border-green-400 hover:bg-green-50 transition text-sm font-medium text-gray-700", "aria-label": "Change language", children: [ /*#__PURE__*/ _jsx("span", { children: current.code.toUpperCase() }), /*#__PURE__*/ _jsx("svg", { className: `w-3.5 h-3.5 text-gray-400 transition-transform ${open ? 'rotate-180' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _jsx("div", { className: "absolute right-0 mt-1 w-40 bg-white border border-gray-200 rounded-xl shadow-lg z-50 overflow-hidden", children: LOCALES.map((loc)=>/*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setLocale(loc.code); setOpen(false); }, className: `w-full flex items-center gap-2.5 px-3.5 py-2.5 text-sm hover:bg-green-50 transition ${locale === loc.code ? 'bg-green-50 text-green-700 font-medium' : 'text-gray-700'}`, children: [ /*#__PURE__*/ _jsx("span", { children: loc.label }), locale === loc.code && /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 ml-auto text-green-600", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ _jsx("path", { fillRule: "evenodd", d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z", clipRule: "evenodd" }) }) ] }, loc.code)) }) ] }); } aF_^fS[fiGJeJh  1 5  __WEBPACK_MODULE_REFERENCE__4_5b227573654c6f63616c65225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_call_asiSafe1__.___WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._buffersourcesizemapshashD/* __next_internal_client_entry_do_not_use__ LanguageSwitcher auto */ function LanguageSwitcher() { const { locale, setLocale } = __WEBPACK_MODULE_REFERENCE__4_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._(); const [open, setOpen] = __WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const ref = __WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._(null); const current = __WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_call_asiSafe1__._.find((l)=>l.code === locale) ?? __WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_asiSafe1__._[0]; // Close on outside click process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && __WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) setOpen(false); } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { ref: ref, className: "relative", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("button", { onClick: ()=>setOpen(!open), className: "flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-gray-200 hover:border-green-400 hover:bg-green-50 transition text-sm font-medium text-gray-700", "aria-label": "Change language", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { children: current.code.toUpperCase() }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: `w-3.5 h-3.5 text-gray-400 transition-transform ${open ? 'rotate-180' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "absolute right-0 mt-1 w-40 bg-white border border-gray-200 rounded-xl shadow-lg z-50 overflow-hidden", children: __WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_call_asiSafe1__._.map((loc)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("button", { onClick: ()=>{ setLocale(loc.code); setOpen(false); }, className: `w-full flex items-center gap-2.5 px-3.5 py-2.5 text-sm hover:bg-green-50 transition ${locale === loc.code ? 'bg-green-50 text-green-700 font-medium' : 'text-gray-700'}`, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { children: loc.label }), locale === loc.code && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-3.5 h-3.5 ml-auto text-green-600", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { fillRule: "evenodd", d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z", clipRule: "evenodd" }) }) ] }, loc.code)) }) ] }); } {"finalSource":false}mapbufferedMap ReplaceSourceRawSourcec/* __next_internal_client_entry_do_not_use__ LanguageSwitcher auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useRef, useEffect } from 'react'; import { useLocale } from '@/context/locale'; import { LOCALES } from '@/lib/translations'; export function LanguageSwitcher() { const { locale, setLocale } = useLocale(); const [open, setOpen] = useState(false); const ref = useRef(null); const current = LOCALES.find((l)=>l.code === locale) ?? LOCALES[0]; // Close on outside click process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) setOpen(false); } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); return /*#__PURE__*/ _jsxs("div", { ref: ref, className: "relative", children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setOpen(!open), className: "flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-gray-200 hover:border-green-400 hover:bg-green-50 transition text-sm font-medium text-gray-700", "aria-label": "Change language", children: [ /*#__PURE__*/ _jsx("span", { children: current.code.toUpperCase() }), /*#__PURE__*/ _jsx("svg", { className: `w-3.5 h-3.5 text-gray-400 transition-transform ${open ? 'rotate-180' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _jsx("div", { className: "absolute right-0 mt-1 w-40 bg-white border border-gray-200 rounded-xl shadow-lg z-50 overflow-hidden", children: LOCALES.map((loc)=>/*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setLocale(loc.code); setOpen(false); }, className: `w-full flex items-center gap-2.5 px-3.5 py-2.5 text-sm hover:bg-green-50 transition ${locale === loc.code ? 'bg-green-50 text-green-700 font-medium' : 'text-gray-700'}`, children: [ /*#__PURE__*/ _jsx("span", { children: loc.label }), locale === loc.code && /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 ml-auto text-green-600", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ _jsx("path", { fillRule: "evenodd", d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z", clipRule: "evenodd" }) }) ] }, loc.code)) }) ] }); } r70132undefined134185undefined187231undefined233277undefined279285undefined350358__WEBPACK_MODULE_REFERENCE__4_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined391398__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined424429__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined458464__WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_call_asiSafe1__._undefined498504__WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_asiSafe1__._undefined595603__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined908912__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined10181022__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined13821385__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined15161519__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined18631866__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined21492152__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined23202326__WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_call_asiSafe1__._undefined23532357__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined28142817__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined29782981__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined32373240__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined`_Uo!C4eg> A T?A?(0,context_locale/* useLocale */.Y)(0,react.useState)(0,react.useRef)translations/* LOCALES */.YZ(0,react.useEffect)(0,react_jsx_runtime.jsxs)(0,react_jsx_runtime.jsx) // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(91864); // EXTERNAL MODULE: ../../node_modules/socket.io-client/build/esm-debug/index.js + 30 modules var esm_debug = __webpack_require__(44826); ;// ./src/hooks/useEffectiveRole.ts  nwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* __next_internal_client_entry_do_not_use__ useEffectiveRole auto */ import { useSession } from '@/lib/auth'; import { useEffect, useState } from 'react'; function readPreviewRole() { if (typeof document === 'undefined') return null; const m = document.cookie.match(/(?:^|;\s*)canhelp_preview_role=([^;]+)/); return m?.[1] ?? null; } /** * Returns the effective role for the current user. * For admins, respects the `canhelp_preview_role` cookie set by AdminRolePreview widget. * Updates reactively when the widget dispatches `canhelp:preview-role`. */ export function useEffectiveRole() { const { data: session } = useSession(); const userRole = session?.user?.role; const isAdmin = userRole === 'admin'; const [previewRole, setPreviewRole] = useState(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isAdmin) return; setPreviewRole(readPreviewRole()); const sync = ()=>setPreviewRole(readPreviewRole()); window.addEventListener('canhelp:preview-role', sync); document.addEventListener('visibilitychange', sync); return ()=>{ window.removeEventListener('canhelp:preview-role', sync); document.removeEventListener('visibilitychange', sync); }; }, [ isAdmin ]); if (!userRole) return null; if (isAdmin && previewRole) return previewRole; return userRole; } bFmoH:@} PX__WEBPACK_MODULE_REFERENCE__3_5b2275736553657373696f6e225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._&/* __next_internal_client_entry_do_not_use__ useEffectiveRole auto */ function readPreviewRole() { if (typeof document === 'undefined') return null; const m = document.cookie.match(/(?:^|;\s*)canhelp_preview_role=([^;]+)/); return m?.[1] ?? null; } /** * Returns the effective role for the current user. * For admins, respects the `canhelp_preview_role` cookie set by AdminRolePreview widget. * Updates reactively when the widget dispatches `canhelp:preview-role`. */ function useEffectiveRole() { const { data: session } = __WEBPACK_MODULE_REFERENCE__3_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._(); const userRole = session?.user?.role; const isAdmin = userRole === 'admin'; const [previewRole, setPreviewRole] = __WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && __WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (!isAdmin) return; setPreviewRole(readPreviewRole()); const sync = ()=>setPreviewRole(readPreviewRole()); window.addEventListener('canhelp:preview-role', sync); document.addEventListener('visibilitychange', sync); return ()=>{ window.removeEventListener('canhelp:preview-role', sync); document.removeEventListener('visibilitychange', sync); }; }, [ isAdmin ]); if (!userRole) return null; if (isAdmin && previewRole) return previewRole; return userRole; }  /* __next_internal_client_entry_do_not_use__ useEffectiveRole auto */ import { useSession } from '@/lib/auth'; import { useEffect, useState } from 'react'; function readPreviewRole() { if (typeof document === 'undefined') return null; const m = document.cookie.match(/(?:^|;\s*)canhelp_preview_role=([^;]+)/); return m?.[1] ?? null; } /** * Returns the effective role for the current user. * For admins, respects the `canhelp_preview_role` cookie set by AdminRolePreview widget. * Updates reactively when the widget dispatches `canhelp:preview-role`. */ export function useEffectiveRole() { const { data: session } = useSession(); const userRole = session?.user?.role; const isAdmin = userRole === 'admin'; const [previewRole, setPreviewRole] = useState(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isAdmin) return; setPreviewRole(readPreviewRole()); const sync = ()=>setPreviewRole(readPreviewRole()); window.addEventListener('canhelp:preview-role', sync); document.addEventListener('visibilitychange', sync); return ()=>{ window.removeEventListener('canhelp:preview-role', sync); document.removeEventListener('visibilitychange', sync); }; }, [ isAdmin ]); if (!userRole) return null; if (isAdmin && previewRole) return previewRole; return userRole; } ^70109undefined111154undefined570576undefined637646__WEBPACK_MODULE_REFERENCE__3_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._undefined777784__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined848856__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefinedE"zQ(0,auth/* useSession */.wV) // EXTERNAL MODULE: ../../node_modules/next/dist/api/app-dynamic.js var app_dynamic = __webpack_require__(47262); ;// ./src/components/Header.tsx   Hwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource5/* __next_internal_client_entry_do_not_use__ Header auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import Link from 'next/link'; import { useRouter, usePathname } from 'next/navigation'; import { useSession, signOut } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { formatShortName } from '@/lib/formatName'; import { LanguageSwitcher } from './LanguageSwitcher'; import { useState, useRef, useEffect } from 'react'; import { getUnreadCount, getMyDashboard } from '@/lib/api'; import { io } from 'socket.io-client'; import { useEffectiveRole } from '@/hooks/useEffectiveRole'; import dynamic from 'next/dynamic'; const SupportModal = dynamic(async ()=>{ typeof require.resolveWeak !== "undefined" && require.resolveWeak("./SupportModal"); }, { loadableGenerated: { modules: [ "components/Header.tsx -> " + "./SupportModal" ] }, ssr: false }); const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function Header() { const router = useRouter(); const pathname = usePathname(); const { data: session } = useSession(); const { t, locale } = useLocale(); const [menuOpen, setMenuOpen] = useState(false); const [profileOpen, setProfileOpen] = useState(false); const [supportOpen, setSupportOpen] = useState(false); const [unreadNotif, setUnreadNotif] = useState(0); const [unreadChat, setUnreadChat] = useState(0); const [msgToast, setMsgToast] = useState(null); const [planTier, setPlanTier] = useState(null); const profileRef = useRef(null); const headerRef = useRef(null); const toastTimer = useRef(null); const pathnameRef = useRef(pathname); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ pathnameRef.current = pathname; }, [ pathname ]); // Close dropdowns on outside click process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ function handleClick(e) { if (profileRef.current && !profileRef.current.contains(e.target)) { setProfileOpen(false); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); const isAdmin = session?.user?.role === 'admin'; const effectiveRole = useEffectiveRole(); const isSpecialist = effectiveRole === 'specialist'; const isActive = (href, exact = false)=>exact ? pathname === href : pathname === href || pathname.startsWith(href + '/'); const navCls = (href, exact = false)=>`font-medium text-sm transition ${isActive(href, exact) ? 'text-green-600' : 'text-gray-600 hover:text-green-600'}`; const mobileNavCls = (href, exact = false)=>`flex items-center gap-2 font-medium py-1 ${isActive(href, exact) ? 'text-green-600' : 'text-gray-700'}`; // Reset chat badge when entering chat process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (pathname === '/chat') setUnreadChat(0); }, [ pathname ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!session) return; const socket = io(API_URL, { withCredentials: true, transports: [ 'websocket', 'polling' ] }); socket.on('new_message', (msg)=>{ if (pathnameRef.current === '/chat') return; setUnreadChat((c)=>c + 1); if (toastTimer.current) clearTimeout(toastTimer.current); setMsgToast(msg); toastTimer.current = setTimeout(()=>setMsgToast(null), 5000); }); return ()=>{ socket.disconnect(); if (toastTimer.current) clearTimeout(toastTimer.current); }; }, [ session ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!session) { setUnreadNotif(0); return; } const fetch = ()=>getUnreadCount().then((r)=>setUnreadNotif(r.count)).catch(()=>{}); fetch(); const timer = setInterval(fetch, 30000); return ()=>clearInterval(timer); }, [ session ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!session) { setPlanTier(null); return; } getMyDashboard().then((d)=>setPlanTier(d.plan?.tier ?? null)).catch(()=>{}); }, [ session ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ const onScroll = ()=>{ if (!headerRef.current) return; if (window.scrollY > 40) { headerRef.current.classList.add('header-shrink'); } else { headerRef.current.classList.remove('header-shrink'); } }; window.addEventListener('scroll', onScroll); return ()=>window.removeEventListener('scroll', onScroll); }, []); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("header", { ref: headerRef, className: "header-base bg-white border-b border-gray-200 sticky top-0 z-50 transition-all duration-300", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between h-16 header-content transition-all duration-300", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/", className: "flex items-center gap-2 shrink-0", children: [ /*#__PURE__*/ _jsx("img", { src: "/logo.png", alt: "CanHelp", className: "w-8 h-8 object-contain" }), /*#__PURE__*/ _jsx("span", { className: "logo-text text-2xl font-bold text-green-600 transition-all duration-300", children: "CanHelp" }) ] }), /*#__PURE__*/ _jsxs("nav", { className: "hidden md:flex items-center gap-5 ml-auto", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: navCls('/tasks'), children: t('nav.find_tasks') }), /*#__PURE__*/ _jsx(Link, { href: "/dashboard", className: navCls('/dashboard'), children: t('nav.dashboard') }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/tasks/new", className: navCls('/tasks/new', true), children: t('dashboard.new_task') }), " ", /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: navCls('/tasks'), children: t('nav.tasks') }), " ", /*#__PURE__*/ _jsx(Link, { href: "/specialists", className: navCls('/specialists'), children: t('nav.specialists') }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: navCls('/pricing', true), children: t('nav.pricing', 'Pricing') }), session ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ _jsx("svg", { className: `w-5 h-5 ${unreadNotif > 0 ? 'text-green-600' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ _jsx("svg", { className: `w-5 h-5 ${unreadChat > 0 ? 'text-green-500' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }), /*#__PURE__*/ _jsxs("div", { className: "relative", ref: profileRef, children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setProfileOpen(!profileOpen), className: "flex items-center gap-1.5 text-sm font-medium text-gray-600 hover:text-green-600", children: [ /*#__PURE__*/ _jsx("span", { className: "truncate max-w-[100px]", children: formatShortName(session.user.firstName, session.user.lastName, session.user.name) }), planTier === 'pro' && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-green-100 text-green-700 leading-none", children: "Pro" }), planTier === 'ultimate' && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 shadow-sm shadow-amber-300/50 leading-none", children: "★" }), /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), profileOpen && /*#__PURE__*/ _jsxs("div", { className: "absolute right-0 mt-2 w-52 bg-white border border-gray-200 rounded-xl shadow-lg py-1 z-50", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: `w-4 h-4 shrink-0 ${unreadNotif > 0 ? 'text-green-600' : 'text-gray-400'}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: `w-4 h-4 shrink-0 ${unreadChat > 0 ? 'text-green-500' : 'text-gray-400'}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ _jsxs(Link, { href: "/schedule", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ _jsxs(Link, { href: "/admin", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" }) }), t('nav.profile') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/favorites", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), /*#__PURE__*/ _jsx("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ _jsxs("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-green-50", onClick: ()=>{ setProfileOpen(false); setSupportOpen(true); }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z" }) }), t('support.title') ] }), /*#__PURE__*/ _jsx("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ _jsxs("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-red-500 hover:bg-red-50", onClick: ()=>{ setProfileOpen(false); signOut().then(()=>{ window.location.href = '/'; }); }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/login", className: "text-gray-600 hover:text-green-600 font-medium text-sm", children: t('nav.login') }), /*#__PURE__*/ _jsx(Link, { href: "/register", className: "bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 font-medium text-sm", children: t('nav.register') }) ] }), /*#__PURE__*/ _jsx(LanguageSwitcher, {}) ] }), /*#__PURE__*/ _jsxs("div", { className: "md:hidden flex items-center gap-2", children: [ /*#__PURE__*/ _jsx(LanguageSwitcher, {}), /*#__PURE__*/ _jsx("button", { className: "p-2", onClick: ()=>setMenuOpen(!menuOpen), "aria-label": "Toggle menu", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-gray-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: menuOpen ? /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) : /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 12h16M4 18h16" }) }) }) ] }) ] }), menuOpen && /*#__PURE__*/ _jsxs("div", { className: "md:hidden py-4 border-t border-gray-100 flex flex-col gap-3", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), t('nav.find_tasks') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" }) }), t('nav.tasks') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }), session ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: mobileNavCls('/chat', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: `w-4 h-4 shrink-0 ${unreadChat > 0 ? 'text-green-500' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "ml-1 px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full", children: unreadChat }) ] }), isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: mobileNavCls('/notifications', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: `w-4 h-4 shrink-0 ${unreadNotif > 0 ? 'text-green-600' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/favorites", className: mobileNavCls('/favorites', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ _jsxs(Link, { href: "/schedule", className: mobileNavCls('/schedule', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ _jsxs(Link, { href: "/admin", className: mobileNavCls('/admin'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: mobileNavCls('/profile', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" }) }), t('nav.profile') ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setMenuOpen(false); signOut().then(()=>{ window.location.href = '/'; }); }, className: "flex items-center gap-2 text-left text-red-500 py-1 font-medium", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/login", className: "text-gray-700 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.login') }), /*#__PURE__*/ _jsx(Link, { href: "/register", className: "text-green-600 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.register') }) ] }) ] }) ] }) }), msgToast && /*#__PURE__*/ _jsx("div", { className: "fixed bottom-5 right-5 z-[200] max-w-sm w-full", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white border border-gray-200 rounded-xl shadow-xl p-4 flex items-start gap-3 animate-fade-in", children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl shrink-0", children: "\uD83D\uDCAC" }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 text-sm", children: t('chat.toast_title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 truncate mt-0.5", children: msgToast.body }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-end gap-2 shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>setMsgToast(null), className: "text-gray-400 hover:text-gray-600 text-lg leading-none", "aria-label": "close", children: "\xd7" }), /*#__PURE__*/ _jsx(Link, { href: `/chat?room=${msgToast.roomId}`, onClick: ()=>setMsgToast(null), className: "text-xs text-green-600 hover:underline font-medium", children: t('chat.toast_open') }) ] }) ] }) }), supportOpen && /*#__PURE__*/ _jsx(SupportModal, { onClose: ()=>setSupportOpen(false) }) ] }); } @`<_IK}%'LN -_  ;C]g%Y`.5UZy~_ j y m u qycp _osuxeh|y}_  c"f"h"k"'$*$,$/$%%%% &&&&i'l'))1,4,v.z.|../_/11^4a46677r9u98:F:2;5;= = ??4A7ACCEEEEEEEEH_HJJMMMM0P3PRR"W&W(W0WWWWWZZ\\``aa&e*e,e/eZg_]gjjmmnn)r-r/r2rbtetvvu{y{{{~{}}RVX[_c_ptvy-136>A&)+/ߢHKU_X  )qtvùƹ_%) x|~[^&) }_GJ!$.24< _;?AIVYQTbe]`OSUX_),$'y}  r v x {   6:<_?-!1!!!##h%k% ((((((((*X* *#*b,e,,,--~..//0071;111m3p3r3u3o5r5__WEBPACK_MODULE_REFERENCE__12_5b2264656661756c74225d_call_directImport_asiSafe1__._ true/*require.resolve*/null /* weak dependency, without id */"https://api.canhelp.gr"0__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__2_5b22757365506174686e616d65225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__3_5b2275736553657373696f6e225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__4_5b227573654c6f63616c65225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__11_5b22757365456666656374697665526f6c65225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__10_5b22696f225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__9_5b22676574556e72656164436f756e74225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__9_5b226765744d7944617368626f617264225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__3_5b227369676e4f7574225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__8_5b224c616e67756167655377697463686572225d_directImport_asiSafe1__._u/* __next_internal_client_entry_do_not_use__ Header auto */ const SupportModal = __WEBPACK_MODULE_REFERENCE__12_5b2264656661756c74225d_call_directImport_asiSafe1__._(async ()=>{ true && /*require.resolve*/(null /* weak dependency, without id */); }, { loadableGenerated: { modules: [ "components/Header.tsx -> " + "./SupportModal" ] }, ssr: false }); const API_URL = "https://api.canhelp.gr" || 0; function Header() { const router = __WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._(); const pathname = __WEBPACK_MODULE_REFERENCE__2_5b22757365506174686e616d65225d_call_directImport_asiSafe1__._(); const { data: session } = __WEBPACK_MODULE_REFERENCE__3_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._(); const { t, locale } = __WEBPACK_MODULE_REFERENCE__4_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._(); const [menuOpen, setMenuOpen] = __WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [profileOpen, setProfileOpen] = __WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [supportOpen, setSupportOpen] = __WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [unreadNotif, setUnreadNotif] = __WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._(0); const [unreadChat, setUnreadChat] = __WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._(0); const [msgToast, setMsgToast] = __WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [planTier, setPlanTier] = __WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const profileRef = __WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._(null); const headerRef = __WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._(null); const toastTimer = __WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._(null); const pathnameRef = __WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._(pathname); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && __WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ pathnameRef.current = pathname; }, [ pathname ]); // Close dropdowns on outside click process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && __WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ function handleClick(e) { if (profileRef.current && !profileRef.current.contains(e.target)) { setProfileOpen(false); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); const isAdmin = session?.user?.role === 'admin'; const effectiveRole = __WEBPACK_MODULE_REFERENCE__11_5b22757365456666656374697665526f6c65225d_call_directImport_asiSafe1__._(); const isSpecialist = effectiveRole === 'specialist'; const isActive = (href, exact = false)=>exact ? pathname === href : pathname === href || pathname.startsWith(href + '/'); const navCls = (href, exact = false)=>`font-medium text-sm transition ${isActive(href, exact) ? 'text-green-600' : 'text-gray-600 hover:text-green-600'}`; const mobileNavCls = (href, exact = false)=>`flex items-center gap-2 font-medium py-1 ${isActive(href, exact) ? 'text-green-600' : 'text-gray-700'}`; // Reset chat badge when entering chat process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && __WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (pathname === '/chat') setUnreadChat(0); }, [ pathname ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && __WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (!session) return; const socket = __WEBPACK_MODULE_REFERENCE__10_5b22696f225d_call_directImport_asiSafe1__._(API_URL, { withCredentials: true, transports: [ 'websocket', 'polling' ] }); socket.on('new_message', (msg)=>{ if (pathnameRef.current === '/chat') return; setUnreadChat((c)=>c + 1); if (toastTimer.current) clearTimeout(toastTimer.current); setMsgToast(msg); toastTimer.current = setTimeout(()=>setMsgToast(null), 5000); }); return ()=>{ socket.disconnect(); if (toastTimer.current) clearTimeout(toastTimer.current); }; }, [ session ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && __WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (!session) { setUnreadNotif(0); return; } const fetch = ()=>__WEBPACK_MODULE_REFERENCE__9_5b22676574556e72656164436f756e74225d_call_directImport_asiSafe1__._().then((r)=>setUnreadNotif(r.count)).catch(()=>{}); fetch(); const timer = setInterval(fetch, 30000); return ()=>clearInterval(timer); }, [ session ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && __WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (!session) { setPlanTier(null); return; } __WEBPACK_MODULE_REFERENCE__9_5b226765744d7944617368626f617264225d_call_directImport_asiSafe1__._().then((d)=>setPlanTier(d.plan?.tier ?? null)).catch(()=>{}); }, [ session ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && __WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ const onScroll = ()=>{ if (!headerRef.current) return; if (window.scrollY > 40) { headerRef.current.classList.add('header-shrink'); } else { headerRef.current.classList.remove('header-shrink'); } }; window.addEventListener('scroll', onScroll); return ()=>window.removeEventListener('scroll', onScroll); }, []); return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("header", { ref: headerRef, className: "header-base bg-white border-b border-gray-200 sticky top-0 z-50 transition-all duration-300", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center justify-between h-16 header-content transition-all duration-300", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/", className: "flex items-center gap-2 shrink-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("img", { src: "/logo.png", alt: "CanHelp", className: "w-8 h-8 object-contain" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "logo-text text-2xl font-bold text-green-600 transition-all duration-300", children: "CanHelp" }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("nav", { className: "hidden md:flex items-center gap-5 ml-auto", children: [ isSpecialist ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks", className: navCls('/tasks'), children: t('nav.find_tasks') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/dashboard", className: navCls('/dashboard'), children: t('nav.dashboard') }) ] }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks/new", className: navCls('/tasks/new', true), children: t('dashboard.new_task') }), " ", /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks", className: navCls('/tasks'), children: t('nav.tasks') }), " ", /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/specialists", className: navCls('/specialists'), children: t('nav.specialists') }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/pricing", className: navCls('/pricing', true), children: t('nav.pricing', 'Pricing') }), session ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/notifications", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: `w-5 h-5 ${unreadNotif > 0 ? 'text-green-600' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), unreadNotif > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/chat", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: `w-5 h-5 ${unreadChat > 0 ? 'text-green-500' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), unreadChat > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "relative", ref: profileRef, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("button", { onClick: ()=>setProfileOpen(!profileOpen), className: "flex items-center gap-1.5 text-sm font-medium text-gray-600 hover:text-green-600", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "truncate max-w-[100px]", children: __WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._(session.user.firstName, session.user.lastName, session.user.name) }), planTier === 'pro' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-green-100 text-green-700 leading-none", children: "Pro" }), planTier === 'ultimate' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 shadow-sm shadow-amber-300/50 leading-none", children: "★" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), profileOpen && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "absolute right-0 mt-2 w-52 bg-white border border-gray-200 rounded-xl shadow-lg py-1 z-50", children: [ isSpecialist ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks/new", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/specialists", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/notifications", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: `w-4 h-4 shrink-0 ${unreadNotif > 0 ? 'text-green-600' : 'text-gray-400'}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/chat", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: `w-4 h-4 shrink-0 ${unreadChat > 0 ? 'text-green-500' : 'text-gray-400'}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "flex items-center gap-1.5", children: [ t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/dashboard", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/schedule", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/admin", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/profile", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" }) }), t('nav.profile') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/favorites", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-green-50", onClick: ()=>{ setProfileOpen(false); setSupportOpen(true); }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z" }) }), t('support.title') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-red-500 hover:bg-red-50", onClick: ()=>{ setProfileOpen(false); __WEBPACK_MODULE_REFERENCE__3_5b227369676e4f7574225d_call_directImport_asiSafe1__._().then(()=>{ window.location.href = '/'; }); }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) ] }) ] }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/login", className: "text-gray-600 hover:text-green-600 font-medium text-sm", children: t('nav.login') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/register", className: "bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 font-medium text-sm", children: t('nav.register') }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__8_5b224c616e67756167655377697463686572225d_directImport_asiSafe1__._, {}) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "md:hidden flex items-center gap-2", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__8_5b224c616e67756167655377697463686572225d_directImport_asiSafe1__._, {}), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "p-2", onClick: ()=>setMenuOpen(!menuOpen), "aria-label": "Toggle menu", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-5 h-5 text-gray-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: menuOpen ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 12h16M4 18h16" }) }) }) ] }) ] }), menuOpen && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "md:hidden py-4 border-t border-gray-100 flex flex-col gap-3", children: [ isSpecialist ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), t('nav.find_tasks') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" }) }), t('nav.tasks') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }), session ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/chat", className: mobileNavCls('/chat', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: `w-4 h-4 shrink-0 ${unreadChat > 0 ? 'text-green-500' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "ml-1 px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full", children: unreadChat }) ] }), isSpecialist ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/notifications", className: mobileNavCls('/notifications', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: `w-4 h-4 shrink-0 ${unreadNotif > 0 ? 'text-green-600' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/favorites", className: mobileNavCls('/favorites', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/schedule", className: mobileNavCls('/schedule', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/admin", className: mobileNavCls('/admin'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/profile", className: mobileNavCls('/profile', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" }) }), t('nav.profile') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("button", { onClick: ()=>{ setMenuOpen(false); __WEBPACK_MODULE_REFERENCE__3_5b227369676e4f7574225d_call_directImport_asiSafe1__._().then(()=>{ window.location.href = '/'; }); }, className: "flex items-center gap-2 text-left text-red-500 py-1 font-medium", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/login", className: "text-gray-700 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.login') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/register", className: "text-green-600 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.register') }) ] }) ] }) ] }) }), msgToast && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "fixed bottom-5 right-5 z-[200] max-w-sm w-full", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "bg-white border border-gray-200 rounded-xl shadow-xl p-4 flex items-start gap-3 animate-fade-in", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-2xl shrink-0", children: "\uD83D\uDCAC" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "font-semibold text-gray-900 text-sm", children: t('chat.toast_title') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs text-gray-500 truncate mt-0.5", children: msgToast.body }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex flex-col items-end gap-2 shrink-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { onClick: ()=>setMsgToast(null), className: "text-gray-400 hover:text-gray-600 text-lg leading-none", "aria-label": "close", children: "\xd7" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: `/chat?room=${msgToast.roomId}`, onClick: ()=>setMsgToast(null), className: "text-xs text-green-600 hover:underline font-medium", children: t('chat.toast_open') }) ] }) ] }) }), supportOpen && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(SupportModal, { onClose: ()=>setSupportOpen(false) }) ] }); }  5/* __next_internal_client_entry_do_not_use__ Header auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import Link from 'next/link'; import { useRouter, usePathname } from 'next/navigation'; import { useSession, signOut } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { formatShortName } from '@/lib/formatName'; import { LanguageSwitcher } from './LanguageSwitcher'; import { useState, useRef, useEffect } from 'react'; import { getUnreadCount, getMyDashboard } from '@/lib/api'; import { io } from 'socket.io-client'; import { useEffectiveRole } from '@/hooks/useEffectiveRole'; import dynamic from 'next/dynamic'; const SupportModal = dynamic(async ()=>{ typeof require.resolveWeak !== "undefined" && require.resolveWeak("./SupportModal"); }, { loadableGenerated: { modules: [ "components/Header.tsx -> " + "./SupportModal" ] }, ssr: false }); const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function Header() { const router = useRouter(); const pathname = usePathname(); const { data: session } = useSession(); const { t, locale } = useLocale(); const [menuOpen, setMenuOpen] = useState(false); const [profileOpen, setProfileOpen] = useState(false); const [supportOpen, setSupportOpen] = useState(false); const [unreadNotif, setUnreadNotif] = useState(0); const [unreadChat, setUnreadChat] = useState(0); const [msgToast, setMsgToast] = useState(null); const [planTier, setPlanTier] = useState(null); const profileRef = useRef(null); const headerRef = useRef(null); const toastTimer = useRef(null); const pathnameRef = useRef(pathname); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ pathnameRef.current = pathname; }, [ pathname ]); // Close dropdowns on outside click process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ function handleClick(e) { if (profileRef.current && !profileRef.current.contains(e.target)) { setProfileOpen(false); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); const isAdmin = session?.user?.role === 'admin'; const effectiveRole = useEffectiveRole(); const isSpecialist = effectiveRole === 'specialist'; const isActive = (href, exact = false)=>exact ? pathname === href : pathname === href || pathname.startsWith(href + '/'); const navCls = (href, exact = false)=>`font-medium text-sm transition ${isActive(href, exact) ? 'text-green-600' : 'text-gray-600 hover:text-green-600'}`; const mobileNavCls = (href, exact = false)=>`flex items-center gap-2 font-medium py-1 ${isActive(href, exact) ? 'text-green-600' : 'text-gray-700'}`; // Reset chat badge when entering chat process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (pathname === '/chat') setUnreadChat(0); }, [ pathname ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!session) return; const socket = io(API_URL, { withCredentials: true, transports: [ 'websocket', 'polling' ] }); socket.on('new_message', (msg)=>{ if (pathnameRef.current === '/chat') return; setUnreadChat((c)=>c + 1); if (toastTimer.current) clearTimeout(toastTimer.current); setMsgToast(msg); toastTimer.current = setTimeout(()=>setMsgToast(null), 5000); }); return ()=>{ socket.disconnect(); if (toastTimer.current) clearTimeout(toastTimer.current); }; }, [ session ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!session) { setUnreadNotif(0); return; } const fetch = ()=>getUnreadCount().then((r)=>setUnreadNotif(r.count)).catch(()=>{}); fetch(); const timer = setInterval(fetch, 30000); return ()=>clearInterval(timer); }, [ session ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!session) { setPlanTier(null); return; } getMyDashboard().then((d)=>setPlanTier(d.plan?.tier ?? null)).catch(()=>{}); }, [ session ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ const onScroll = ()=>{ if (!headerRef.current) return; if (window.scrollY > 40) { headerRef.current.classList.add('header-shrink'); } else { headerRef.current.classList.remove('header-shrink'); } }; window.addEventListener('scroll', onScroll); return ()=>window.removeEventListener('scroll', onScroll); }, []); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("header", { ref: headerRef, className: "header-base bg-white border-b border-gray-200 sticky top-0 z-50 transition-all duration-300", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between h-16 header-content transition-all duration-300", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/", className: "flex items-center gap-2 shrink-0", children: [ /*#__PURE__*/ _jsx("img", { src: "/logo.png", alt: "CanHelp", className: "w-8 h-8 object-contain" }), /*#__PURE__*/ _jsx("span", { className: "logo-text text-2xl font-bold text-green-600 transition-all duration-300", children: "CanHelp" }) ] }), /*#__PURE__*/ _jsxs("nav", { className: "hidden md:flex items-center gap-5 ml-auto", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: navCls('/tasks'), children: t('nav.find_tasks') }), /*#__PURE__*/ _jsx(Link, { href: "/dashboard", className: navCls('/dashboard'), children: t('nav.dashboard') }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/tasks/new", className: navCls('/tasks/new', true), children: t('dashboard.new_task') }), " ", /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: navCls('/tasks'), children: t('nav.tasks') }), " ", /*#__PURE__*/ _jsx(Link, { href: "/specialists", className: navCls('/specialists'), children: t('nav.specialists') }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: navCls('/pricing', true), children: t('nav.pricing', 'Pricing') }), session ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ _jsx("svg", { className: `w-5 h-5 ${unreadNotif > 0 ? 'text-green-600' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ _jsx("svg", { className: `w-5 h-5 ${unreadChat > 0 ? 'text-green-500' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }), /*#__PURE__*/ _jsxs("div", { className: "relative", ref: profileRef, children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setProfileOpen(!profileOpen), className: "flex items-center gap-1.5 text-sm font-medium text-gray-600 hover:text-green-600", children: [ /*#__PURE__*/ _jsx("span", { className: "truncate max-w-[100px]", children: formatShortName(session.user.firstName, session.user.lastName, session.user.name) }), planTier === 'pro' && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-green-100 text-green-700 leading-none", children: "Pro" }), planTier === 'ultimate' && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 shadow-sm shadow-amber-300/50 leading-none", children: "★" }), /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), profileOpen && /*#__PURE__*/ _jsxs("div", { className: "absolute right-0 mt-2 w-52 bg-white border border-gray-200 rounded-xl shadow-lg py-1 z-50", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: `w-4 h-4 shrink-0 ${unreadNotif > 0 ? 'text-green-600' : 'text-gray-400'}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: `w-4 h-4 shrink-0 ${unreadChat > 0 ? 'text-green-500' : 'text-gray-400'}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ _jsxs(Link, { href: "/schedule", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ _jsxs(Link, { href: "/admin", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" }) }), t('nav.profile') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/favorites", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), /*#__PURE__*/ _jsx("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ _jsxs("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-green-50", onClick: ()=>{ setProfileOpen(false); setSupportOpen(true); }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z" }) }), t('support.title') ] }), /*#__PURE__*/ _jsx("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ _jsxs("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-red-500 hover:bg-red-50", onClick: ()=>{ setProfileOpen(false); signOut().then(()=>{ window.location.href = '/'; }); }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/login", className: "text-gray-600 hover:text-green-600 font-medium text-sm", children: t('nav.login') }), /*#__PURE__*/ _jsx(Link, { href: "/register", className: "bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 font-medium text-sm", children: t('nav.register') }) ] }), /*#__PURE__*/ _jsx(LanguageSwitcher, {}) ] }), /*#__PURE__*/ _jsxs("div", { className: "md:hidden flex items-center gap-2", children: [ /*#__PURE__*/ _jsx(LanguageSwitcher, {}), /*#__PURE__*/ _jsx("button", { className: "p-2", onClick: ()=>setMenuOpen(!menuOpen), "aria-label": "Toggle menu", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-gray-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: menuOpen ? /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) : /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 12h16M4 18h16" }) }) }) ] }) ] }), menuOpen && /*#__PURE__*/ _jsxs("div", { className: "md:hidden py-4 border-t border-gray-100 flex flex-col gap-3", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), t('nav.find_tasks') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" }) }), t('nav.tasks') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }), session ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: mobileNavCls('/chat', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: `w-4 h-4 shrink-0 ${unreadChat > 0 ? 'text-green-500' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "ml-1 px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full", children: unreadChat }) ] }), isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: mobileNavCls('/notifications', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: `w-4 h-4 shrink-0 ${unreadNotif > 0 ? 'text-green-600' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/favorites", className: mobileNavCls('/favorites', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ _jsxs(Link, { href: "/schedule", className: mobileNavCls('/schedule', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ _jsxs(Link, { href: "/admin", className: mobileNavCls('/admin'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: mobileNavCls('/profile', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" }) }), t('nav.profile') ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setMenuOpen(false); signOut().then(()=>{ window.location.href = '/'; }); }, className: "flex items-center gap-2 text-left text-red-500 py-1 font-medium", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/login", className: "text-gray-700 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.login') }), /*#__PURE__*/ _jsx(Link, { href: "/register", className: "text-green-600 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.register') }) ] }) ] }) ] }) }), msgToast && /*#__PURE__*/ _jsx("div", { className: "fixed bottom-5 right-5 z-[200] max-w-sm w-full", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white border border-gray-200 rounded-xl shadow-xl p-4 flex items-start gap-3 animate-fade-in", children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl shrink-0", children: "\uD83D\uDCAC" }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 text-sm", children: t('chat.toast_title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 truncate mt-0.5", children: msgToast.body }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-end gap-2 shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>setMsgToast(null), className: "text-gray-400 hover:text-gray-600 text-lg leading-none", "aria-label": "close", children: "\xd7" }), /*#__PURE__*/ _jsx(Link, { href: `/chat?room=${msgToast.roomId}`, onClick: ()=>setMsgToast(null), className: "text-xs text-green-600 hover:underline font-medium", children: t('chat.toast_open') }) ] }) ] }) }), supportOpen && /*#__PURE__*/ _jsx(SupportModal, { onClose: ()=>setSupportOpen(false) }) ] }); } Y60145undefined147175undefined177233undefined235283undefined285329undefined331381undefined383436undefined438489undefined491549undefined551588undefined590649undefined651685undefined708714__WEBPACK_MODULE_REFERENCE__12_5b2264656661756c74225d_call_directImport_asiSafe1__._undefined732773 trueundefined778796/*require.resolve*/undefined798813null /* weak dependency, without id */undefined9771007"https://api.canhelp.gr"undefined101210340undefined10371043undefined10831091__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._undefined11171127__WEBPACK_MODULE_REFERENCE__2_5b22757365506174686e616d65225d_call_directImport_asiSafe1__._undefined11621171__WEBPACK_MODULE_REFERENCE__3_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._undefined12021210__WEBPACK_MODULE_REFERENCE__4_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined12511258__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined13101317__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined13691376__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined14281435__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined14811488__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined15301537__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined15821589__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined16211626__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined16571662__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined16941699__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined17321737__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined18051813__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined19901998__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined24102425__WEBPACK_MODULE_REFERENCE__11_5b22757365456666656374697665526f6c65225d_call_directImport_asiSafe1__._undefined30243032__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined31813189__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined32503251__WEBPACK_MODULE_REFERENCE__10_5b22696f225d_call_directImport_asiSafe1__._undefined39533961__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined40804093__WEBPACK_MODULE_REFERENCE__9_5b22676574556e72656164436f756e74225d_call_directImport_asiSafe1__._undefined43424350__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined44514464__WEBPACK_MODULE_REFERENCE__9_5b226765744d7944617368626f617264225d_call_directImport_asiSafe1__._undefined46164624__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined50845088__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined50905098__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined51495152__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined53605364__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined55185522__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined57435747__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined57495752__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined59895992__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined63036306__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined66756679__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined68996903__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined69056913__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined70367039__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined70417044__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined73947397__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined73997402__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined78017805__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined78077815__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined79387941__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined79437946__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined83828385__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined83878390__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined88038806__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined88088811__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined92559258__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined92609263__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined96019605__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined96079615__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined97389742__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined97449747__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined1008910092__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1063010633__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1131311316__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1189411898__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1190011903__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined1223612239__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1277612779__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1340613409__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1398713991__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1428014284__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1470614709__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1490414918__WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._undefined1515415157__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1562315626__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1613916142__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1669216695__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1733717341__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1768117685__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1768717695__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined1786617870__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1787217875__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined1843518438__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1910019103__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1995719961__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1996319966__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined2052820531__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2119321196__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2230622310__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2231222320__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined2249122495__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2249722500__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined2306423067__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2377123774__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2457924583__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2504825051__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2589425898__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2590025903__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined2645826461__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2716427167__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2792027924__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2837928382__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2922529229__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2923129234__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined2979429797__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3045930462__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3160531609__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3161131614__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3213332136__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3275032753__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3361833622__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3362433627__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3414334147__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3484334846__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3582635829__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3672036724__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3672636729__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3724737250__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3786437867__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3870138705__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3870738710__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3923039233__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3984739850__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4074240745__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4100341007__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4169541698__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4231242315__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4324443247__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4350543509__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4393543941__WEBPACK_MODULE_REFERENCE__3_5b227369676e4f7574225d_call_directImport_asiSafe1__._undefined4437344376__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4497644979__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4608646090__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4609246100__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined4622346226__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4622846231__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined4661646619__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4662146624__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined4712547128__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4713047145__WEBPACK_MODULE_REFERENCE__8_5b224c616e67756167655377697463686572225d_directImport_asiSafe1__._undefined4727247276__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4747347476__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4747847493__WEBPACK_MODULE_REFERENCE__8_5b224c616e67756167655377697463686572225d_directImport_asiSafe1__._undefined4755547558__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4785647859__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4830548308__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4861848621__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4918949193__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4940749411__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4941349421__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined4952849532__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4953449537__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined4987649879__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5033550338__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5093550939__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5094150944__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5129151294__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5175051753__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5248452488__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5249052498__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined5260552609__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5261152614__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5296752970__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5342653429__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5399553999__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5400154004__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5434354346__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5480254805__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5548155485__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5548755490__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5584155844__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5630056303__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5713457138__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5714057148__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined5725557259__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5726157264__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5760757610__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5810858111__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5875358756__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5919559199__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5920159209__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined5933259336__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5933859341__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5973459737__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6024160244__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6088260886__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6088860891__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6128261285__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6178961792__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6266262666__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6266862676__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined6279962803__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6280562808__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6320963212__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6375963762__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6442364427__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6479664799__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6543765441__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6544365446__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6583365836__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6634066343__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6719367197__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6719967202__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6755567558__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6801468017__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6872268726__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6872868731__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6908269085__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6954669549__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7019870202__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7020470207__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7054670550__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7106971072__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7193271935__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7258672590__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7259272595__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7294472947__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7340873411__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7402974033__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7422274228__WEBPACK_MODULE_REFERENCE__3_5b227369676e4f7574225d_call_directImport_asiSafe1__._undefined7466274665__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7511275115__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7578875792__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7579475802__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined7590975912__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7591475917__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7631576318__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7632076323__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7689876901__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7702977033__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7724477247__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7743877442__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7759677599__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7784477847__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7813578139__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7831778320__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7870178704__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7870678709__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7921579218__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined@`]_D^3R%Y5i?i>^=B _ I ; M8u|I]UwGaGp_ By 4""\####t$$$ %k&&&'(((0))))D*+B,D,_,..x.z..0001n222 3333!4w557%8:;Y====A??AAaD_DF9GZHHLJJYKKLLN OQXQ~SSJVVW6X8XX2Y~YYY[G\^'_}b_bbcJee*hthlmmgmn^n`nnp+qs5tZwwwyy }X}Z}}ۂ%_b)s Yӎi*vxŖ̘|ƛ'suŸơʤ2_HNHֵص%-wݺ';5l _UW!km;t?NP7ai3k_*04*t<aiew_CE/A13); z       t|}_0E^ /!'#q#&#'%'t'';(=((*e*,,g//$1_n1384:44 6T6L88;4<6<<=.>?@@CMCOCCDEEG\GI1J3JJKL&N_pNQRTTT (/* binding */ Header) }); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(78157); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(94496); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(71159); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(13260); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(96484); // EXTERNAL MODULE: ./src/lib/formatName.ts var formatName = __webpack_require__(48178); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js var react = __webpack_require__(31768); // EXTERNAL MODULE: ./src/lib/translations.ts var translations = __webpack_require__(12998); ;// ./src/components/LanguageSwitcher.tsx /* __next_internal_client_entry_do_not_use__ LanguageSwitcher auto */ function LanguageSwitcher() { const { locale, setLocale } = (0,context_locale/* useLocale */.Y)(); const [open, setOpen] = (0,react.useState)(false); const ref = (0,react.useRef)(null); const current = translations/* LOCALES */.YZ.find((l)=>l.code === locale) ?? translations/* LOCALES */.YZ[0]; // Close on outside click process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react.useEffect)(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) setOpen(false); } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); return /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { ref: ref, className: "relative", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("button", { onClick: ()=>setOpen(!open), className: "flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-gray-200 hover:border-green-400 hover:bg-green-50 transition text-sm font-medium text-gray-700", "aria-label": "Change language", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { children: current.code.toUpperCase() }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: `w-3.5 h-3.5 text-gray-400 transition-transform ${open ? 'rotate-180' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "absolute right-0 mt-1 w-40 bg-white border border-gray-200 rounded-xl shadow-lg z-50 overflow-hidden", children: translations/* LOCALES */.YZ.map((loc)=>/*#__PURE__*/ (0,react_jsx_runtime.jsxs)("button", { onClick: ()=>{ setLocale(loc.code); setOpen(false); }, className: `w-full flex items-center gap-2.5 px-3.5 py-2.5 text-sm hover:bg-green-50 transition ${locale === loc.code ? 'bg-green-50 text-green-700 font-medium' : 'text-gray-700'}`, children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { children: loc.label }), locale === loc.code && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: "w-3.5 h-3.5 ml-auto text-green-600", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { fillRule: "evenodd", d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z", clipRule: "evenodd" }) }) ] }, loc.code)) }) ] }); } // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(91864); // EXTERNAL MODULE: ../../node_modules/socket.io-client/build/esm-debug/index.js + 30 modules var esm_debug = __webpack_require__(44826); ;// ./src/hooks/useEffectiveRole.ts /* __next_internal_client_entry_do_not_use__ useEffectiveRole auto */ function readPreviewRole() { if (typeof document === 'undefined') return null; const m = document.cookie.match(/(?:^|;\s*)canhelp_preview_role=([^;]+)/); return m?.[1] ?? null; } /** * Returns the effective role for the current user. * For admins, respects the `canhelp_preview_role` cookie set by AdminRolePreview widget. * Updates reactively when the widget dispatches `canhelp:preview-role`. */ function useEffectiveRole() { const { data: session } = (0,auth/* useSession */.wV)(); const userRole = session?.user?.role; const isAdmin = userRole === 'admin'; const [previewRole, setPreviewRole] = (0,react.useState)(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react.useEffect)(()=>{ if (!isAdmin) return; setPreviewRole(readPreviewRole()); const sync = ()=>setPreviewRole(readPreviewRole()); window.addEventListener('canhelp:preview-role', sync); document.addEventListener('visibilitychange', sync); return ()=>{ window.removeEventListener('canhelp:preview-role', sync); document.removeEventListener('visibilitychange', sync); }; }, [ isAdmin ]); if (!userRole) return null; if (isAdmin && previewRole) return previewRole; return userRole; } // EXTERNAL MODULE: ../../node_modules/next/dist/api/app-dynamic.js var app_dynamic = __webpack_require__(47262); ;// ./src/components/Header.tsx /* __next_internal_client_entry_do_not_use__ Header auto */ const SupportModal = (0,app_dynamic["default"])(async ()=>{ true && /*require.resolve*/(null /* weak dependency, without id */); }, { loadableGenerated: { modules: [ "components/Header.tsx -> " + "./SupportModal" ] }, ssr: false }); const API_URL = "https://api.canhelp.gr" || 0; function Header() { const router = (0,navigation.useRouter)(); const pathname = (0,navigation.usePathname)(); const { data: session } = (0,auth/* useSession */.wV)(); const { t, locale } = (0,context_locale/* useLocale */.Y)(); const [menuOpen, setMenuOpen] = (0,react.useState)(false); const [profileOpen, setProfileOpen] = (0,react.useState)(false); const [supportOpen, setSupportOpen] = (0,react.useState)(false); const [unreadNotif, setUnreadNotif] = (0,react.useState)(0); const [unreadChat, setUnreadChat] = (0,react.useState)(0); const [msgToast, setMsgToast] = (0,react.useState)(null); const [planTier, setPlanTier] = (0,react.useState)(null); const profileRef = (0,react.useRef)(null); const headerRef = (0,react.useRef)(null); const toastTimer = (0,react.useRef)(null); const pathnameRef = (0,react.useRef)(pathname); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react.useEffect)(()=>{ pathnameRef.current = pathname; }, [ pathname ]); // Close dropdowns on outside click process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react.useEffect)(()=>{ function handleClick(e) { if (profileRef.current && !profileRef.current.contains(e.target)) { setProfileOpen(false); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); const isAdmin = session?.user?.role === 'admin'; const effectiveRole = useEffectiveRole(); const isSpecialist = effectiveRole === 'specialist'; const isActive = (href, exact = false)=>exact ? pathname === href : pathname === href || pathname.startsWith(href + '/'); const navCls = (href, exact = false)=>`font-medium text-sm transition ${isActive(href, exact) ? 'text-green-600' : 'text-gray-600 hover:text-green-600'}`; const mobileNavCls = (href, exact = false)=>`flex items-center gap-2 font-medium py-1 ${isActive(href, exact) ? 'text-green-600' : 'text-gray-700'}`; // Reset chat badge when entering chat process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react.useEffect)(()=>{ if (pathname === '/chat') setUnreadChat(0); }, [ pathname ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react.useEffect)(()=>{ if (!session) return; const socket = (0,esm_debug.io)(API_URL, { withCredentials: true, transports: [ 'websocket', 'polling' ] }); socket.on('new_message', (msg)=>{ if (pathnameRef.current === '/chat') return; setUnreadChat((c)=>c + 1); if (toastTimer.current) clearTimeout(toastTimer.current); setMsgToast(msg); toastTimer.current = setTimeout(()=>setMsgToast(null), 5000); }); return ()=>{ socket.disconnect(); if (toastTimer.current) clearTimeout(toastTimer.current); }; }, [ session ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react.useEffect)(()=>{ if (!session) { setUnreadNotif(0); return; } const fetch = ()=>(0,api/* getUnreadCount */.$M)().then((r)=>setUnreadNotif(r.count)).catch(()=>{}); fetch(); const timer = setInterval(fetch, 30000); return ()=>clearInterval(timer); }, [ session ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react.useEffect)(()=>{ if (!session) { setPlanTier(null); return; } (0,api/* getMyDashboard */.H)().then((d)=>setPlanTier(d.plan?.tier ?? null)).catch(()=>{}); }, [ session ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react.useEffect)(()=>{ const onScroll = ()=>{ if (!headerRef.current) return; if (window.scrollY > 40) { headerRef.current.classList.add('header-shrink'); } else { headerRef.current.classList.remove('header-shrink'); } }; window.addEventListener('scroll', onScroll); return ()=>window.removeEventListener('scroll', onScroll); }, []); return /*#__PURE__*/ (0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("header", { ref: headerRef, className: "header-base bg-white border-b border-gray-200 sticky top-0 z-50 transition-all duration-300", children: /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between h-16 header-content transition-all duration-300", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)((link_default()), { href: "/", className: "flex items-center gap-2 shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("img", { src: "/logo.png", alt: "CanHelp", className: "w-8 h-8 object-contain" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "logo-text text-2xl font-bold text-green-600 transition-all duration-300", children: "CanHelp" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("nav", { className: "hidden md:flex items-center gap-5 ml-auto", children: [ isSpecialist ? /*#__PURE__*/ (0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)((link_default()), { href: "/tasks", className: navCls('/tasks'), children: t('nav.find_tasks') }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)((link_default()), { href: "/dashboard", className: navCls('/dashboard'), children: t('nav.dashboard') }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)((link_default()), { href: "/tasks/new", className: navCls('/tasks/new', true), children: t('dashboard.new_task') }), " ", /*#__PURE__*/ (0,react_jsx_runtime.jsx)((link_default()), { href: "/tasks", className: navCls('/tasks'), children: t('nav.tasks') }), " ", /*#__PURE__*/ (0,react_jsx_runtime.jsx)((link_default()), { href: "/specialists", className: navCls('/specialists'), children: t('nav.specialists') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)((link_default()), { href: "/pricing", className: navCls('/pricing', true), children: t('nav.pricing', 'Pricing') }), session ? /*#__PURE__*/ (0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)((link_default()), { href: "/notifications", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: `w-5 h-5 ${unreadNotif > 0 ? 'text-green-600' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), unreadNotif > 0 && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)((link_default()), { href: "/chat", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: `w-5 h-5 ${unreadChat > 0 ? 'text-green-500' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), unreadChat > 0 && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "relative", ref: profileRef, children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("button", { onClick: ()=>setProfileOpen(!profileOpen), className: "flex items-center gap-1.5 text-sm font-medium text-gray-600 hover:text-green-600", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "truncate max-w-[100px]", children: (0,formatName/* formatShortName */.H)(session.user.firstName, session.user.lastName, session.user.name) }), planTier === 'pro' && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-green-100 text-green-700 leading-none", children: "Pro" }), planTier === 'ultimate' && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 shadow-sm shadow-amber-300/50 leading-none", children: "★" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), profileOpen && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "absolute right-0 mt-2 w-52 bg-white border border-gray-200 rounded-xl shadow-lg py-1 z-50", children: [ isSpecialist ? /*#__PURE__*/ (0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)((link_default()), { href: "/tasks/new", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)((link_default()), { href: "/specialists", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)((link_default()), { href: "/notifications", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: `w-4 h-4 shrink-0 ${unreadNotif > 0 ? 'text-green-600' : 'text-gray-400'}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)((link_default()), { href: "/chat", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: `w-4 h-4 shrink-0 ${unreadChat > 0 ? 'text-green-500' : 'text-gray-400'}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5", children: [ t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)((link_default()), { href: "/dashboard", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)((link_default()), { href: "/schedule", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)((link_default()), { href: "/admin", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)((link_default()), { href: "/profile", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" }) }), t('nav.profile') ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)((link_default()), { href: "/favorites", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-green-50", onClick: ()=>{ setProfileOpen(false); setSupportOpen(true); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z" }) }), t('support.title') ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-red-500 hover:bg-red-50", onClick: ()=>{ setProfileOpen(false); (0,auth/* signOut */.CI)().then(()=>{ window.location.href = '/'; }); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) ] }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)((link_default()), { href: "/login", className: "text-gray-600 hover:text-green-600 font-medium text-sm", children: t('nav.login') }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)((link_default()), { href: "/register", className: "bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 font-medium text-sm", children: t('nav.register') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)(LanguageSwitcher, {}) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "md:hidden flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)(LanguageSwitcher, {}), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("button", { className: "p-2", onClick: ()=>setMenuOpen(!menuOpen), "aria-label": "Toggle menu", children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: "w-5 h-5 text-gray-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: menuOpen ? /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) : /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 12h16M4 18h16" }) }) }) ] }) ] }), menuOpen && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "md:hidden py-4 border-t border-gray-100 flex flex-col gap-3", children: [ isSpecialist ? /*#__PURE__*/ (0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)((link_default()), { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), t('nav.find_tasks') ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)((link_default()), { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)((link_default()), { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)((link_default()), { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" }) }), t('nav.tasks') ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)((link_default()), { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }), session ? /*#__PURE__*/ (0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)((link_default()), { href: "/chat", className: mobileNavCls('/chat', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: `w-4 h-4 shrink-0 ${unreadChat > 0 ? 'text-green-500' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "ml-1 px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full", children: unreadChat }) ] }), isSpecialist ? /*#__PURE__*/ (0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)((link_default()), { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)((link_default()), { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)((link_default()), { href: "/notifications", className: mobileNavCls('/notifications', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: `w-4 h-4 shrink-0 ${unreadNotif > 0 ? 'text-green-600' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)((link_default()), { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)((link_default()), { href: "/favorites", className: mobileNavCls('/favorites', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)((link_default()), { href: "/schedule", className: mobileNavCls('/schedule', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)((link_default()), { href: "/admin", className: mobileNavCls('/admin'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)((link_default()), { href: "/profile", className: mobileNavCls('/profile', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" }) }), t('nav.profile') ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("button", { onClick: ()=>{ setMenuOpen(false); (0,auth/* signOut */.CI)().then(()=>{ window.location.href = '/'; }); }, className: "flex items-center gap-2 text-left text-red-500 py-1 font-medium", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)((link_default()), { href: "/login", className: "text-gray-700 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.login') }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)((link_default()), { href: "/register", className: "text-green-600 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.register') }) ] }) ] }) ] }) }), msgToast && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "fixed bottom-5 right-5 z-[200] max-w-sm w-full", children: /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "bg-white border border-gray-200 rounded-xl shadow-xl p-4 flex items-start gap-3 animate-fade-in", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "text-2xl shrink-0", children: "\uD83D\uDCAC" }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "font-semibold text-gray-900 text-sm", children: t('chat.toast_title') }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "text-xs text-gray-500 truncate mt-0.5", children: msgToast.body }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "flex flex-col items-end gap-2 shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("button", { onClick: ()=>setMsgToast(null), className: "text-gray-400 hover:text-gray-600 text-lg leading-none", "aria-label": "close", children: "\xd7" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)((link_default()), { href: `/chat?room=${msgToast.roomId}`, onClick: ()=>setMsgToast(null), className: "text-xs text-green-600 hover:underline font-medium", children: t('chat.toast_open') }) ] }) ] }) }), supportOpen && /*#__PURE__*/ (0,react_jsx_runtime.jsx)(SupportModal, { onClose: ()=>setSupportOpen(false) }) ] }); }  `N // EXPORTS __webpack_require__.d(__webpack_exports__, { Header: () => (/* binding */ Header) }); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(78157); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(94496); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(71159); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(13260); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(96484); // EXTERNAL MODULE: ./src/lib/formatName.ts var formatName = __webpack_require__(48178); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js var react = __webpack_require__(31768); // EXTERNAL MODULE: ./src/lib/translations.ts var translations = __webpack_require__(12998); ;// ./src/components/LanguageSwitcher.tsx c/* __next_internal_client_entry_do_not_use__ LanguageSwitcher auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useRef, useEffect } from 'react'; import { useLocale } from '@/context/locale'; import { LOCALES } from '@/lib/translations'; export function LanguageSwitcher() { const { locale, setLocale } = useLocale(); const [open, setOpen] = useState(false); const ref = useRef(null); const current = LOCALES.find((l)=>l.code === locale) ?? LOCALES[0]; // Close on outside click process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) setOpen(false); } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); return /*#__PURE__*/ _jsxs("div", { ref: ref, className: "relative", children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setOpen(!open), className: "flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-gray-200 hover:border-green-400 hover:bg-green-50 transition text-sm font-medium text-gray-700", "aria-label": "Change language", children: [ /*#__PURE__*/ _jsx("span", { children: current.code.toUpperCase() }), /*#__PURE__*/ _jsx("svg", { className: `w-3.5 h-3.5 text-gray-400 transition-transform ${open ? 'rotate-180' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _jsx("div", { className: "absolute right-0 mt-1 w-40 bg-white border border-gray-200 rounded-xl shadow-lg z-50 overflow-hidden", children: LOCALES.map((loc)=>/*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setLocale(loc.code); setOpen(false); }, className: `w-full flex items-center gap-2.5 px-3.5 py-2.5 text-sm hover:bg-green-50 transition ${locale === loc.code ? 'bg-green-50 text-green-700 font-medium' : 'text-gray-700'}`, children: [ /*#__PURE__*/ _jsx("span", { children: loc.label }), locale === loc.code && /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 ml-auto text-green-600", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ _jsx("path", { fillRule: "evenodd", d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z", clipRule: "evenodd" }) }) ] }, loc.code)) }) ] }); } r70132undefined134185undefined187231undefined233277undefined279285undefined350358__WEBPACK_MODULE_REFERENCE__4_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined391398__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined424429__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined458464__WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_call_asiSafe1__._undefined498504__WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_asiSafe1__._undefined595603__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined908912__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined10181022__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined13821385__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined15161519__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined18631866__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined21492152__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined23202326__WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_call_asiSafe1__._undefined23532357__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined28142817__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined29782981__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined32373240__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined138224(0,context_locale/* useLocale */.Y)undefined257341(0,react.useState)undefined367447(0,react.useRef)undefined476545translations/* LOCALES */.YZundefined579643translations/* LOCALES */.YZundefined734820(0,react.useEffect)undefined11251201(0,react_jsx_runtime.jsxs)undefined13071383(0,react_jsx_runtime.jsxs)undefined17431817(0,react_jsx_runtime.jsx)undefined19482022(0,react_jsx_runtime.jsx)undefined23662440(0,react_jsx_runtime.jsx)undefined27232797(0,react_jsx_runtime.jsx)undefined29653034translations/* LOCALES */.YZundefined30613137(0,react_jsx_runtime.jsxs)undefined35943668(0,react_jsx_runtime.jsx)undefined38293903(0,react_jsx_runtime.jsx)undefined41594233(0,react_jsx_runtime.jsx)undefinedRawSource // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(91864); // EXTERNAL MODULE: ../../node_modules/socket.io-client/build/esm-debug/index.js + 30 modules var esm_debug = __webpack_require__(44826); ;// ./src/hooks/useEffectiveRole.ts /* __next_internal_client_entry_do_not_use__ useEffectiveRole auto */ import { useSession } from '@/lib/auth'; import { useEffect, useState } from 'react'; function readPreviewRole() { if (typeof document === 'undefined') return null; const m = document.cookie.match(/(?:^|;\s*)canhelp_preview_role=([^;]+)/); return m?.[1] ?? null; } /** * Returns the effective role for the current user. * For admins, respects the `canhelp_preview_role` cookie set by AdminRolePreview widget. * Updates reactively when the widget dispatches `canhelp:preview-role`. */ export function useEffectiveRole() { const { data: session } = useSession(); const userRole = session?.user?.role; const isAdmin = userRole === 'admin'; const [previewRole, setPreviewRole] = useState(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isAdmin) return; setPreviewRole(readPreviewRole()); const sync = ()=>setPreviewRole(readPreviewRole()); window.addEventListener('canhelp:preview-role', sync); document.addEventListener('visibilitychange', sync); return ()=>{ window.removeEventListener('canhelp:preview-role', sync); document.removeEventListener('visibilitychange', sync); }; }, [ isAdmin ]); if (!userRole) return null; if (isAdmin && previewRole) return previewRole; return userRole; } ^70109undefined111154undefined570576undefined637646__WEBPACK_MODULE_REFERENCE__3_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._undefined777784__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined848856__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefinedv546634(0,auth/* useSession */.wV)undefined765849(0,react.useState)undefined913999(0,react.useEffect)undefinedRawSource // EXTERNAL MODULE: ../../node_modules/next/dist/api/app-dynamic.js var app_dynamic = __webpack_require__(47262); ;// ./src/components/Header.tsx 5/* __next_internal_client_entry_do_not_use__ Header auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import Link from 'next/link'; import { useRouter, usePathname } from 'next/navigation'; import { useSession, signOut } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { formatShortName } from '@/lib/formatName'; import { LanguageSwitcher } from './LanguageSwitcher'; import { useState, useRef, useEffect } from 'react'; import { getUnreadCount, getMyDashboard } from '@/lib/api'; import { io } from 'socket.io-client'; import { useEffectiveRole } from '@/hooks/useEffectiveRole'; import dynamic from 'next/dynamic'; const SupportModal = dynamic(async ()=>{ typeof require.resolveWeak !== "undefined" && require.resolveWeak("./SupportModal"); }, { loadableGenerated: { modules: [ "components/Header.tsx -> " + "./SupportModal" ] }, ssr: false }); const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function Header() { const router = useRouter(); const pathname = usePathname(); const { data: session } = useSession(); const { t, locale } = useLocale(); const [menuOpen, setMenuOpen] = useState(false); const [profileOpen, setProfileOpen] = useState(false); const [supportOpen, setSupportOpen] = useState(false); const [unreadNotif, setUnreadNotif] = useState(0); const [unreadChat, setUnreadChat] = useState(0); const [msgToast, setMsgToast] = useState(null); const [planTier, setPlanTier] = useState(null); const profileRef = useRef(null); const headerRef = useRef(null); const toastTimer = useRef(null); const pathnameRef = useRef(pathname); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ pathnameRef.current = pathname; }, [ pathname ]); // Close dropdowns on outside click process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ function handleClick(e) { if (profileRef.current && !profileRef.current.contains(e.target)) { setProfileOpen(false); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); const isAdmin = session?.user?.role === 'admin'; const effectiveRole = useEffectiveRole(); const isSpecialist = effectiveRole === 'specialist'; const isActive = (href, exact = false)=>exact ? pathname === href : pathname === href || pathname.startsWith(href + '/'); const navCls = (href, exact = false)=>`font-medium text-sm transition ${isActive(href, exact) ? 'text-green-600' : 'text-gray-600 hover:text-green-600'}`; const mobileNavCls = (href, exact = false)=>`flex items-center gap-2 font-medium py-1 ${isActive(href, exact) ? 'text-green-600' : 'text-gray-700'}`; // Reset chat badge when entering chat process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (pathname === '/chat') setUnreadChat(0); }, [ pathname ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!session) return; const socket = io(API_URL, { withCredentials: true, transports: [ 'websocket', 'polling' ] }); socket.on('new_message', (msg)=>{ if (pathnameRef.current === '/chat') return; setUnreadChat((c)=>c + 1); if (toastTimer.current) clearTimeout(toastTimer.current); setMsgToast(msg); toastTimer.current = setTimeout(()=>setMsgToast(null), 5000); }); return ()=>{ socket.disconnect(); if (toastTimer.current) clearTimeout(toastTimer.current); }; }, [ session ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!session) { setUnreadNotif(0); return; } const fetch = ()=>getUnreadCount().then((r)=>setUnreadNotif(r.count)).catch(()=>{}); fetch(); const timer = setInterval(fetch, 30000); return ()=>clearInterval(timer); }, [ session ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!session) { setPlanTier(null); return; } getMyDashboard().then((d)=>setPlanTier(d.plan?.tier ?? null)).catch(()=>{}); }, [ session ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ const onScroll = ()=>{ if (!headerRef.current) return; if (window.scrollY > 40) { headerRef.current.classList.add('header-shrink'); } else { headerRef.current.classList.remove('header-shrink'); } }; window.addEventListener('scroll', onScroll); return ()=>window.removeEventListener('scroll', onScroll); }, []); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("header", { ref: headerRef, className: "header-base bg-white border-b border-gray-200 sticky top-0 z-50 transition-all duration-300", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between h-16 header-content transition-all duration-300", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/", className: "flex items-center gap-2 shrink-0", children: [ /*#__PURE__*/ _jsx("img", { src: "/logo.png", alt: "CanHelp", className: "w-8 h-8 object-contain" }), /*#__PURE__*/ _jsx("span", { className: "logo-text text-2xl font-bold text-green-600 transition-all duration-300", children: "CanHelp" }) ] }), /*#__PURE__*/ _jsxs("nav", { className: "hidden md:flex items-center gap-5 ml-auto", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: navCls('/tasks'), children: t('nav.find_tasks') }), /*#__PURE__*/ _jsx(Link, { href: "/dashboard", className: navCls('/dashboard'), children: t('nav.dashboard') }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/tasks/new", className: navCls('/tasks/new', true), children: t('dashboard.new_task') }), " ", /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: navCls('/tasks'), children: t('nav.tasks') }), " ", /*#__PURE__*/ _jsx(Link, { href: "/specialists", className: navCls('/specialists'), children: t('nav.specialists') }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: navCls('/pricing', true), children: t('nav.pricing', 'Pricing') }), session ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ _jsx("svg", { className: `w-5 h-5 ${unreadNotif > 0 ? 'text-green-600' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ _jsx("svg", { className: `w-5 h-5 ${unreadChat > 0 ? 'text-green-500' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }), /*#__PURE__*/ _jsxs("div", { className: "relative", ref: profileRef, children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setProfileOpen(!profileOpen), className: "flex items-center gap-1.5 text-sm font-medium text-gray-600 hover:text-green-600", children: [ /*#__PURE__*/ _jsx("span", { className: "truncate max-w-[100px]", children: formatShortName(session.user.firstName, session.user.lastName, session.user.name) }), planTier === 'pro' && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-green-100 text-green-700 leading-none", children: "Pro" }), planTier === 'ultimate' && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 shadow-sm shadow-amber-300/50 leading-none", children: "★" }), /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), profileOpen && /*#__PURE__*/ _jsxs("div", { className: "absolute right-0 mt-2 w-52 bg-white border border-gray-200 rounded-xl shadow-lg py-1 z-50", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: `w-4 h-4 shrink-0 ${unreadNotif > 0 ? 'text-green-600' : 'text-gray-400'}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: `w-4 h-4 shrink-0 ${unreadChat > 0 ? 'text-green-500' : 'text-gray-400'}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ _jsxs(Link, { href: "/schedule", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ _jsxs(Link, { href: "/admin", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" }) }), t('nav.profile') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/favorites", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), /*#__PURE__*/ _jsx("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ _jsxs("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-green-50", onClick: ()=>{ setProfileOpen(false); setSupportOpen(true); }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z" }) }), t('support.title') ] }), /*#__PURE__*/ _jsx("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ _jsxs("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-red-500 hover:bg-red-50", onClick: ()=>{ setProfileOpen(false); signOut().then(()=>{ window.location.href = '/'; }); }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/login", className: "text-gray-600 hover:text-green-600 font-medium text-sm", children: t('nav.login') }), /*#__PURE__*/ _jsx(Link, { href: "/register", className: "bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 font-medium text-sm", children: t('nav.register') }) ] }), /*#__PURE__*/ _jsx(LanguageSwitcher, {}) ] }), /*#__PURE__*/ _jsxs("div", { className: "md:hidden flex items-center gap-2", children: [ /*#__PURE__*/ _jsx(LanguageSwitcher, {}), /*#__PURE__*/ _jsx("button", { className: "p-2", onClick: ()=>setMenuOpen(!menuOpen), "aria-label": "Toggle menu", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-gray-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: menuOpen ? /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) : /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 12h16M4 18h16" }) }) }) ] }) ] }), menuOpen && /*#__PURE__*/ _jsxs("div", { className: "md:hidden py-4 border-t border-gray-100 flex flex-col gap-3", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), t('nav.find_tasks') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" }) }), t('nav.tasks') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }), session ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: mobileNavCls('/chat', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: `w-4 h-4 shrink-0 ${unreadChat > 0 ? 'text-green-500' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "ml-1 px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full", children: unreadChat }) ] }), isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: mobileNavCls('/notifications', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: `w-4 h-4 shrink-0 ${unreadNotif > 0 ? 'text-green-600' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/favorites", className: mobileNavCls('/favorites', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ _jsxs(Link, { href: "/schedule", className: mobileNavCls('/schedule', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ _jsxs(Link, { href: "/admin", className: mobileNavCls('/admin'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: mobileNavCls('/profile', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" }) }), t('nav.profile') ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setMenuOpen(false); signOut().then(()=>{ window.location.href = '/'; }); }, className: "flex items-center gap-2 text-left text-red-500 py-1 font-medium", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/login", className: "text-gray-700 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.login') }), /*#__PURE__*/ _jsx(Link, { href: "/register", className: "text-green-600 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.register') }) ] }) ] }) ] }) }), msgToast && /*#__PURE__*/ _jsx("div", { className: "fixed bottom-5 right-5 z-[200] max-w-sm w-full", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white border border-gray-200 rounded-xl shadow-xl p-4 flex items-start gap-3 animate-fade-in", children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl shrink-0", children: "\uD83D\uDCAC" }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 text-sm", children: t('chat.toast_title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 truncate mt-0.5", children: msgToast.body }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-end gap-2 shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>setMsgToast(null), className: "text-gray-400 hover:text-gray-600 text-lg leading-none", "aria-label": "close", children: "\xd7" }), /*#__PURE__*/ _jsx(Link, { href: `/chat?room=${msgToast.roomId}`, onClick: ()=>setMsgToast(null), className: "text-xs text-green-600 hover:underline font-medium", children: t('chat.toast_open') }) ] }) ] }) }), supportOpen && /*#__PURE__*/ _jsx(SupportModal, { onClose: ()=>setSupportOpen(false) }) ] }); } Y60145undefined147175undefined177233undefined235283undefined285329undefined331381undefined383436undefined438489undefined491549undefined551588undefined590649undefined651685undefined708714__WEBPACK_MODULE_REFERENCE__12_5b2264656661756c74225d_call_directImport_asiSafe1__._undefined732773 trueundefined778796/*require.resolve*/undefined798813null /* weak dependency, without id */undefined9771007"https://api.canhelp.gr"undefined101210340undefined10371043undefined10831091__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._undefined11171127__WEBPACK_MODULE_REFERENCE__2_5b22757365506174686e616d65225d_call_directImport_asiSafe1__._undefined11621171__WEBPACK_MODULE_REFERENCE__3_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._undefined12021210__WEBPACK_MODULE_REFERENCE__4_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined12511258__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined13101317__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined13691376__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined14281435__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined14811488__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined15301537__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined15821589__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined16211626__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined16571662__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined16941699__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined17321737__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined18051813__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined19901998__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined24102425__WEBPACK_MODULE_REFERENCE__11_5b22757365456666656374697665526f6c65225d_call_directImport_asiSafe1__._undefined30243032__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined31813189__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined32503251__WEBPACK_MODULE_REFERENCE__10_5b22696f225d_call_directImport_asiSafe1__._undefined39533961__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined40804093__WEBPACK_MODULE_REFERENCE__9_5b22676574556e72656164436f756e74225d_call_directImport_asiSafe1__._undefined43424350__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined44514464__WEBPACK_MODULE_REFERENCE__9_5b226765744d7944617368626f617264225d_call_directImport_asiSafe1__._undefined46164624__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined50845088__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined50905098__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined51495152__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined53605364__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined55185522__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined57435747__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined57495752__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined59895992__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined63036306__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined66756679__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined68996903__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined69056913__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined70367039__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined70417044__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined73947397__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined73997402__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined78017805__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined78077815__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined79387941__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined79437946__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined83828385__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined83878390__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined88038806__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined88088811__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined92559258__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined92609263__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined96019605__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined96079615__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined97389742__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined97449747__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined1008910092__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1063010633__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1131311316__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1189411898__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1190011903__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined1223612239__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1277612779__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1340613409__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1398713991__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1428014284__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1470614709__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1490414918__WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._undefined1515415157__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1562315626__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1613916142__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1669216695__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1733717341__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1768117685__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1768717695__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined1786617870__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1787217875__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined1843518438__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1910019103__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1995719961__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1996319966__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined2052820531__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2119321196__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2230622310__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2231222320__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined2249122495__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2249722500__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined2306423067__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2377123774__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2457924583__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2504825051__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2589425898__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2590025903__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined2645826461__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2716427167__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2792027924__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2837928382__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2922529229__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2923129234__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined2979429797__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3045930462__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3160531609__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3161131614__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3213332136__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3275032753__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3361833622__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3362433627__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3414334147__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3484334846__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3582635829__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3672036724__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3672636729__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3724737250__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3786437867__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3870138705__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3870738710__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3923039233__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3984739850__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4074240745__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4100341007__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4169541698__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4231242315__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4324443247__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4350543509__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4393543941__WEBPACK_MODULE_REFERENCE__3_5b227369676e4f7574225d_call_directImport_asiSafe1__._undefined4437344376__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4497644979__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4608646090__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4609246100__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined4622346226__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4622846231__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined4661646619__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4662146624__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined4712547128__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4713047145__WEBPACK_MODULE_REFERENCE__8_5b224c616e67756167655377697463686572225d_directImport_asiSafe1__._undefined4727247276__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4747347476__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4747847493__WEBPACK_MODULE_REFERENCE__8_5b224c616e67756167655377697463686572225d_directImport_asiSafe1__._undefined4755547558__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4785647859__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4830548308__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4861848621__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4918949193__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4940749411__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4941349421__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined4952849532__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4953449537__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined4987649879__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5033550338__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5093550939__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5094150944__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5129151294__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5175051753__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5248452488__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5249052498__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined5260552609__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5261152614__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5296752970__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5342653429__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5399553999__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5400154004__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5434354346__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5480254805__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5548155485__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5548755490__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5584155844__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5630056303__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5713457138__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5714057148__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined5725557259__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5726157264__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5760757610__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5810858111__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5875358756__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5919559199__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5920159209__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined5933259336__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5933859341__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5973459737__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6024160244__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6088260886__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6088860891__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6128261285__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6178961792__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6266262666__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6266862676__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined6279962803__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6280562808__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6320963212__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6375963762__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6442364427__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6479664799__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6543765441__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6544365446__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6583365836__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6634066343__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6719367197__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6719967202__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6755567558__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6801468017__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6872268726__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6872868731__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6908269085__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6954669549__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7019870202__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7020470207__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7054670550__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7106971072__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7193271935__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7258672590__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7259272595__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7294472947__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7340873411__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7402974033__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7422274228__WEBPACK_MODULE_REFERENCE__3_5b227369676e4f7574225d_call_directImport_asiSafe1__._undefined7466274665__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7511275115__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7578875792__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7579475802__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined7590975912__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7591475917__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7631576318__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7632076323__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7689876901__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7702977033__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7724477247__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7743877442__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7759677599__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7784477847__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7813578139__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7831778320__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7870178704__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7870678709__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7921579218__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefinedy&93176(0,app_dynamic["default"])undefined494580(0,navigation.useRouter)undefined606696(0,navigation.usePathname)undefined731819(0,auth/* useSession */.wV)undefined850936(0,context_locale/* useLocale */.Y)undefined9771061(0,react.useState)undefined11131197(0,react.useState)undefined12491333(0,react.useState)undefined13851469(0,react.useState)undefined15151599(0,react.useState)undefined16411725(0,react.useState)undefined17701854(0,react.useState)undefined18861966(0,react.useRef)undefined19972077(0,react.useRef)undefined21092189(0,react.useRef)undefined22222302(0,react.useRef)undefined23702456(0,react.useEffect)undefined26332719(0,react.useEffect)undefined31313232useEffectiveRoleundefined38313917(0,react.useEffect)undefined40664152(0,react.useEffect)undefined42134286(0,esm_debug.io)undefined49885074(0,react.useEffect)undefined51935289(0,api/* getUnreadCount */.$M)undefined55385624(0,react.useEffect)undefined57255821(0,api/* getMyDashboard */.H)undefined59736059(0,react.useEffect)undefined65196595(0,react_jsx_runtime.jsxs)undefined65976676react_jsx_runtime.Fragmentundefined67276801(0,react_jsx_runtime.jsx)undefined70097085(0,react_jsx_runtime.jsxs)undefined72397315(0,react_jsx_runtime.jsxs)undefined75367612(0,react_jsx_runtime.jsxs)undefined76147691(link_default())undefined79288002(0,react_jsx_runtime.jsx)undefined83138387(0,react_jsx_runtime.jsx)undefined87568832(0,react_jsx_runtime.jsxs)undefined90529128(0,react_jsx_runtime.jsxs)undefined91309209react_jsx_runtime.Fragmentundefined93329406(0,react_jsx_runtime.jsx)undefined94089485(link_default())undefined98359909(0,react_jsx_runtime.jsx)undefined99119988(link_default())undefined1038710463(0,react_jsx_runtime.jsxs)undefined1046510544react_jsx_runtime.Fragmentundefined1066710741(0,react_jsx_runtime.jsx)undefined1074310820(link_default())undefined1125611330(0,react_jsx_runtime.jsx)undefined1133211409(link_default())undefined1182211896(0,react_jsx_runtime.jsx)undefined1189811975(link_default())undefined1241912493(0,react_jsx_runtime.jsx)undefined1249512572(link_default())undefined1291012986(0,react_jsx_runtime.jsxs)undefined1298813067react_jsx_runtime.Fragmentundefined1319013266(0,react_jsx_runtime.jsxs)undefined1326813345(link_default())undefined1368713761(0,react_jsx_runtime.jsx)undefined1429914373(0,react_jsx_runtime.jsx)undefined1505315127(0,react_jsx_runtime.jsx)undefined1570515781(0,react_jsx_runtime.jsxs)undefined1578315860(link_default())undefined1619316267(0,react_jsx_runtime.jsx)undefined1680416878(0,react_jsx_runtime.jsx)undefined1750517579(0,react_jsx_runtime.jsx)undefined1815718233(0,react_jsx_runtime.jsxs)undefined1852218598(0,react_jsx_runtime.jsxs)undefined1902019094(0,react_jsx_runtime.jsx)undefined1928919387(0,formatName/* formatShortName */.H)undefined1962319697(0,react_jsx_runtime.jsx)undefined2016320237(0,react_jsx_runtime.jsx)undefined2075020824(0,react_jsx_runtime.jsx)undefined2137421448(0,react_jsx_runtime.jsx)undefined2209022166(0,react_jsx_runtime.jsxs)undefined2250622582(0,react_jsx_runtime.jsxs)undefined2258422663react_jsx_runtime.Fragmentundefined2283422910(0,react_jsx_runtime.jsxs)undefined2291222989(link_default())undefined2354923623(0,react_jsx_runtime.jsx)undefined2428524359(0,react_jsx_runtime.jsx)undefined2521325289(0,react_jsx_runtime.jsxs)undefined2529125368(link_default())undefined2593026004(0,react_jsx_runtime.jsx)undefined2666626740(0,react_jsx_runtime.jsx)undefined2785027926(0,react_jsx_runtime.jsxs)undefined2792828007react_jsx_runtime.Fragmentundefined2817828254(0,react_jsx_runtime.jsxs)undefined2825628333(link_default())undefined2889728971(0,react_jsx_runtime.jsx)undefined2967529749(0,react_jsx_runtime.jsx)undefined3055430630(0,react_jsx_runtime.jsxs)undefined3109531169(0,react_jsx_runtime.jsx)undefined3201232088(0,react_jsx_runtime.jsxs)undefined3209032167(link_default())undefined3272232796(0,react_jsx_runtime.jsx)undefined3349933573(0,react_jsx_runtime.jsx)undefined3432634402(0,react_jsx_runtime.jsxs)undefined3485734931(0,react_jsx_runtime.jsx)undefined3577435850(0,react_jsx_runtime.jsxs)undefined3585235929(link_default())undefined3648936563(0,react_jsx_runtime.jsx)undefined3722537299(0,react_jsx_runtime.jsx)undefined3844238518(0,react_jsx_runtime.jsxs)undefined3852038597(link_default())undefined3911639190(0,react_jsx_runtime.jsx)undefined3980439878(0,react_jsx_runtime.jsx)undefined4074340819(0,react_jsx_runtime.jsxs)undefined4082140898(link_default())undefined4141441490(0,react_jsx_runtime.jsxs)undefined4218642260(0,react_jsx_runtime.jsx)undefined4324043314(0,react_jsx_runtime.jsx)undefined4420544281(0,react_jsx_runtime.jsxs)undefined4428344360(link_default())undefined4487844952(0,react_jsx_runtime.jsx)undefined4556645640(0,react_jsx_runtime.jsx)undefined4647446550(0,react_jsx_runtime.jsxs)undefined4655246629(link_default())undefined4714947223(0,react_jsx_runtime.jsx)undefined4783747911(0,react_jsx_runtime.jsx)undefined4880348877(0,react_jsx_runtime.jsx)undefined4913549211(0,react_jsx_runtime.jsxs)undefined4989949973(0,react_jsx_runtime.jsx)undefined5058750661(0,react_jsx_runtime.jsx)undefined5159051664(0,react_jsx_runtime.jsx)undefined5192251998(0,react_jsx_runtime.jsxs)undefined5242452506(0,auth/* signOut */.CI)undefined5293853012(0,react_jsx_runtime.jsx)undefined5361253686(0,react_jsx_runtime.jsx)undefined5479354869(0,react_jsx_runtime.jsxs)undefined5487154950react_jsx_runtime.Fragmentundefined5507355147(0,react_jsx_runtime.jsx)undefined5514955226(link_default())undefined5561155685(0,react_jsx_runtime.jsx)undefined5568755764(link_default())undefined5626556339(0,react_jsx_runtime.jsx)undefined5634156436LanguageSwitcherundefined5656356639(0,react_jsx_runtime.jsxs)undefined5683656910(0,react_jsx_runtime.jsx)undefined5691257007LanguageSwitcherundefined5706957143(0,react_jsx_runtime.jsx)undefined5744157515(0,react_jsx_runtime.jsx)undefined5796158035(0,react_jsx_runtime.jsx)undefined5834558419(0,react_jsx_runtime.jsx)undefined5898759063(0,react_jsx_runtime.jsxs)undefined5927759353(0,react_jsx_runtime.jsxs)undefined5935559434react_jsx_runtime.Fragmentundefined5954159617(0,react_jsx_runtime.jsxs)undefined5961959696(link_default())undefined6003560109(0,react_jsx_runtime.jsx)undefined6056560639(0,react_jsx_runtime.jsx)undefined6123661312(0,react_jsx_runtime.jsxs)undefined6131461391(link_default())undefined6173861812(0,react_jsx_runtime.jsx)undefined6226862342(0,react_jsx_runtime.jsx)undefined6307363149(0,react_jsx_runtime.jsxs)undefined6315163230react_jsx_runtime.Fragmentundefined6333763413(0,react_jsx_runtime.jsxs)undefined6341563492(link_default())undefined6384563919(0,react_jsx_runtime.jsx)undefined6437564449(0,react_jsx_runtime.jsx)undefined6501565091(0,react_jsx_runtime.jsxs)undefined6509365170(link_default())undefined6550965583(0,react_jsx_runtime.jsx)undefined6603966113(0,react_jsx_runtime.jsx)undefined6678966865(0,react_jsx_runtime.jsxs)undefined6686766944(link_default())undefined6729567369(0,react_jsx_runtime.jsx)undefined6782567899(0,react_jsx_runtime.jsx)undefined6873068806(0,react_jsx_runtime.jsxs)undefined6880868887react_jsx_runtime.Fragmentundefined6899469070(0,react_jsx_runtime.jsxs)undefined6907269149(link_default())undefined6949269566(0,react_jsx_runtime.jsx)undefined7006470138(0,react_jsx_runtime.jsx)undefined7078070854(0,react_jsx_runtime.jsx)undefined7129371369(0,react_jsx_runtime.jsxs)undefined7137171450react_jsx_runtime.Fragmentundefined7157371649(0,react_jsx_runtime.jsxs)undefined7165171728(link_default())undefined7212172195(0,react_jsx_runtime.jsx)undefined7269972773(0,react_jsx_runtime.jsx)undefined7341173487(0,react_jsx_runtime.jsxs)undefined7348973566(link_default())undefined7395774031(0,react_jsx_runtime.jsx)undefined7453574609(0,react_jsx_runtime.jsx)undefined7547975555(0,react_jsx_runtime.jsxs)undefined7555775636react_jsx_runtime.Fragmentundefined7575975835(0,react_jsx_runtime.jsxs)undefined7583775914(link_default())undefined7631576389(0,react_jsx_runtime.jsx)undefined7693677010(0,react_jsx_runtime.jsx)undefined7767177747(0,react_jsx_runtime.jsxs)undefined7811678190(0,react_jsx_runtime.jsx)undefined7882878904(0,react_jsx_runtime.jsxs)undefined7890678983(link_default())undefined7937079444(0,react_jsx_runtime.jsx)undefined7994880022(0,react_jsx_runtime.jsx)undefined8087280948(0,react_jsx_runtime.jsxs)undefined8095081027(link_default())undefined8138081454(0,react_jsx_runtime.jsx)undefined8191081984(0,react_jsx_runtime.jsx)undefined8268982765(0,react_jsx_runtime.jsxs)undefined8276782844(link_default())undefined8319583269(0,react_jsx_runtime.jsx)undefined8373083804(0,react_jsx_runtime.jsx)undefined8445384529(0,react_jsx_runtime.jsxs)undefined8453184608(link_default())undefined8494785023(0,react_jsx_runtime.jsxs)undefined8554285616(0,react_jsx_runtime.jsx)undefined8647686550(0,react_jsx_runtime.jsx)undefined8720187277(0,react_jsx_runtime.jsxs)undefined8727987356(link_default())undefined8770587779(0,react_jsx_runtime.jsx)undefined8824088314(0,react_jsx_runtime.jsx)undefined8893289008(0,react_jsx_runtime.jsxs)undefined8919789279(0,auth/* signOut */.CI)undefined8971389787(0,react_jsx_runtime.jsx)undefined9023490308(0,react_jsx_runtime.jsx)undefined9098191057(0,react_jsx_runtime.jsxs)undefined9105991138react_jsx_runtime.Fragmentundefined9124591319(0,react_jsx_runtime.jsx)undefined9132191398(link_default())undefined9179691870(0,react_jsx_runtime.jsx)undefined9187291949(link_default())undefined9252492598(0,react_jsx_runtime.jsx)undefined9272692802(0,react_jsx_runtime.jsxs)undefined9301393087(0,react_jsx_runtime.jsx)undefined9327893354(0,react_jsx_runtime.jsxs)undefined9350893582(0,react_jsx_runtime.jsx)undefined9382793901(0,react_jsx_runtime.jsx)undefined9418994265(0,react_jsx_runtime.jsxs)undefined9444394517(0,react_jsx_runtime.jsx)undefined9489894972(0,react_jsx_runtime.jsx)undefined9497495051(link_default())undefined9555795631(0,react_jsx_runtime.jsx)undefined`׊navigationauthcontext_localeformatNamereactreact_namespaceObjectreact_defaultӐLanguageSwitcherLanguageSwitcher_namespaceObjectЉesm_debugreadPreviewRoleuseEffectiveRoleuseEffectiveRole_namespaceObjectapp_dynamicSupportModalAPI_URLHeaderHeader_namespaceObject swebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSource`=webpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceb(() => { var exports = {}; exports.id = 240; exports.ids = [240]; exports.modules = { /***/ 261: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource 'webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Hmodule.exports = require("next/dist/shared/lib/router/utils/app-paths");  /***/ }) buffersourcesizemapshashv/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }) {"finalSource":true}mapbufferedMap ConcatSourceRawSource$/***/ ((module) => { "use strict";  RawSourceHmodule.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }), /***/ 3295:  <webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; ]module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js"); /***/ })  ]module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");, /***/ 10846:  3webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js"); /***/ })  Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");, /***/ 12187:  rwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource awebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/become-specialist/page.tsx"); `\Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 81293))buffersourcesizemapshashbPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 81293)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSource_import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/become-specialist/page.tsx"); l092Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 81293))undefined /***/ }) V/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { ReplaceSourceRawSource_import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/become-specialist/page.tsx"); l092Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 81293))undefined, /***/ 19121:  8webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Ymodule.exports = require("next/dist/server/app-render/action-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/action-async-storage.external.js"); /***/ })  Ymodule.exports = require("next/dist/server/app-render/action-async-storage.external.js");, /***/ 24015:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource<// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/become-specialist/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/become-specialist/page.tsx", "default", ); `=G: ԁ@/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference));buffersourcesizemapshashh__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/become-specialist/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/become-specialist/page.tsx", "default", )); {"finalSource":true}mapbufferedMap ConcatSourceRawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); ReplaceSourceRawSource<// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/become-specialist/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/become-specialist/page.tsx", "default", ); 61134undefined136150/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (undefined136150undefined151173(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined570570.5);undefined /***/ })  _/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); <// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/become-specialist/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/become-specialist/page.tsx", "default", ); 61134undefined136150/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (undefined136150undefined151173(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined570570.5);undefined, /***/ 26713:  $webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Emodule.exports = require("next/dist/shared/lib/router/utils/is-bot");  /***/ }) s/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/is-bot"); /***/ })  Emodule.exports = require("next/dist/shared/lib/router/utils/is-bot");, /***/ 27910:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("stream");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("stream"); /***/ })  #module.exports = require("stream");, /***/ 28354:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("util");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("util"); /***/ })  !module.exports = require("util");, /***/ 29021:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; module.exports = require("fs");  /***/ }) M/***/ ((module) => { "use strict"; module.exports = require("fs"); /***/ })  module.exports = require("fs");, /***/ 29294:  6webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-async-storage.external.js"); /***/ })  Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");, /***/ 29569:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource,const module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/become-specialist/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'become-specialist', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/become-specialist/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/become-specialist/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/become-specialist/page", pathname: "/become-specialist", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/become-specialist/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map @bb{_:S.$&dfPRFH_ac  V X H J ( _df|R') -5Mpuv_D*" + O ^ *!D!!"2";"c"{"/#B#$m$r$_$x--/!/6+6g6o6668/888M9U9::::;;;>S@`@DDEEH_HHH)I\IM*M[ThTV%V[[``aaabjbub'd2dwddddfg3gAgi_illrrs suuHu]uwwk}y}؂{0GWlݓД۔_}\iϞSh֢%zZsT2=ķӷ6QTĿ`oJQQ_3EPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 24015))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))__webpack_require__next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModulenext_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind".next"0 falsefalse{}(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERnext_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADER(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)0(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestnext_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponsenext_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T) true(__webpack_require__(33873).join)0next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERnext_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERnext_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARnext_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERnext_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodenext_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSnext_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKind(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)buffersourcesizemapshash__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); const module0 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570)); const module1 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23)); const module2 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506)); const module3 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23)); const module4 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23)); const page5 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 24015)); // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'become-specialist', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/become-specialist/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))).default(props))], apple: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))).default(props))], apple: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/become-specialist/page.tsx"]; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; // Create and export the route module that will be consumed. const routeModule = new next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModule({ definition: { kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, page: "/become-specialist/page", pathname: "/become-specialist", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: ".next" || 0, relativeProjectDir: false || '' }); async function handler(req, res, ctx) { var _this; let srcPage = "/become-specialist/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const initialPostponed = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)(userAgent); const isHtmlBot = (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isPrefetchRSCRequest') ?? req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isRSCRequest') ?? Boolean(req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADER]); const isPossibleServerAction = (0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = (0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = false && 0; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { (0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)(req.headers); } const ComponentMod = { ...next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__, tree, pages, GlobalError: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default()), handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { (0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: (0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequest(req); const nextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (false) {} return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: (0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: true ? (__webpack_require__(33873).join)(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : 0, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = (0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.PRERENDER && (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND) { throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.PAGES, html: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && ((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'renderFallbackShell') || isDebugFallbackShell) ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(matchedSegment, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(cachedData.rscData, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map {"finalSource":true}mapbufferedMap ConcatSourceRawSource#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); ReplaceSourceRawSource,const module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/become-specialist/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'become-specialist', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/become-specialist/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/become-specialist/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/become-specialist/page", pathname: "/become-specialist", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/become-specialist/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map %'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558650Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 24015))undefined653793undefined795909undefined911987undefined9891060undefined10621124undefined11261195undefined11971273undefined12751360undefined13621445undefined14471523undefined15251606undefined16081701undefined17031807undefined18091889undefined18911969undefined19712062undefined20642245undefined22472323undefined23252390undefined23922465undefined24672524undefined25262632undefined26342707undefined27092773undefined27752856undefined32873509Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined35673796Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined43564578Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined46364865Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined50605082undefined50845220undefined52225244undefined52755293__webpack_require__undefined53515357undefined54585584undefined55865671undefined56735786undefined58495855undefined58805897next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined59335941next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined62216256".next"undefined626162620undefined62896327 falseundefined63396345undefined66376657falseundefined66606724{}undefined68706909falseundefined69416954(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined70457058(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined78247839(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined82268235(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined82718286(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined84318444(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined84908516next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined86958708(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined87548763next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined88038827(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined90079026(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined92189325 falseundefined933093440undefined1164011653(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1203812065(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1385013867(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1392713935next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1398613985: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1435414383(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1451514535(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1466914677(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1497714991next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1503115046next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1527415311falseundefined1531415889{}undefined1646716480next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1756717580(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1785917872(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1859118627 trueundefined1863118650(__webpack_require__(33873).join)undefined18729187800undefined1974119754(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2159521608(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2203222053next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2349223506next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2475224769(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2505825069next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2508425088(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2519425205next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2563925650next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2571925730next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2581925830next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2636326374next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2641926433next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2708527093next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2783927860(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2938829402next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2944129452next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2995429967(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3002430045(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3062030628next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3210732121next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3347333496next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3596335976next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3627136285next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3716837191next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3746337484next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3760237623next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3785337868(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3809638107next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3813638158next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3881438829(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3903739048next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3931139324(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3977239785(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4065540676next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4155541576next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4168641707next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4226042277next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4248142504next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4340043415(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4444344458(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4466644677next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4471044732next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4544945561falseundefined4556445914{}undefined4593945954(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4689846909next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4704447059(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4767047697falseundefined4770047770{}undefined4907849092next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined5001650031(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5090650919next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5101851025next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5128151295next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5150751525(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefined /***/ })  _/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; #__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); ,const module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/become-specialist/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'become-specialist', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/become-specialist/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/become-specialist/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/become-specialist/page", pathname: "/become-specialist", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/become-specialist/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map %'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558650Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 24015))undefined653793undefined795909undefined911987undefined9891060undefined10621124undefined11261195undefined11971273undefined12751360undefined13621445undefined14471523undefined15251606undefined16081701undefined17031807undefined18091889undefined18911969undefined19712062undefined20642245undefined22472323undefined23252390undefined23922465undefined24672524undefined25262632undefined26342707undefined27092773undefined27752856undefined32873509Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined35673796Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined43564578Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined46364865Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined50605082undefined50845220undefined52225244undefined52755293__webpack_require__undefined53515357undefined54585584undefined55865671undefined56735786undefined58495855undefined58805897next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined59335941next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined62216256".next"undefined626162620undefined62896327 falseundefined63396345undefined66376657falseundefined66606724{}undefined68706909falseundefined69416954(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined70457058(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined78247839(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined82268235(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined82718286(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined84318444(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined84908516next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined86958708(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined87548763next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined88038827(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined90079026(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined92189325 falseundefined933093440undefined1164011653(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1203812065(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1385013867(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1392713935next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1398613985: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1435414383(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1451514535(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1466914677(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1497714991next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1503115046next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1527415311falseundefined1531415889{}undefined1646716480next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1756717580(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1785917872(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1859118627 trueundefined1863118650(__webpack_require__(33873).join)undefined18729187800undefined1974119754(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2159521608(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2203222053next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2349223506next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2475224769(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2505825069next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2508425088(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2519425205next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2563925650next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2571925730next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2581925830next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2636326374next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2641926433next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2708527093next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2783927860(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2938829402next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2944129452next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2995429967(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3002430045(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3062030628next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3210732121next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3347333496next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3596335976next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3627136285next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3716837191next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3746337484next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3760237623next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3785337868(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3809638107next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3813638158next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3881438829(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3903739048next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3931139324(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3977239785(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4065540676next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4155541576next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4168641707next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4226042277next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4248142504next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4340043415(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4444344458(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4466644677next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4471044732next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4544945561falseundefined4556445914{}undefined4593945954(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4689846909next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4704447059(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4767047697falseundefined4770047770{}undefined4907849092next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined5001650031(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5090650919next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5101851025next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5128151295next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5150751525(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefined, /***/ 33873:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("path");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("path"); /***/ })  !module.exports = require("path");, /***/ 34631:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("tls");  /***/ }) N/***/ ((module) => { "use strict"; module.exports = require("tls"); /***/ })   module.exports = require("tls");, /***/ 41025:  @webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; amodule.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js");  /***/ }) v/***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js"); /***/ }) wz {|}amodule.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js");|~, /***/ 55511:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("crypto");  /***/ }) mQ/***/ ((module) => { "use strict"; module.exports = require("crypto"); /***/ }) nq rst#module.exports = require("crypto");su, /***/ 55591:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; "module.exports = require("https");  /***/ }) dP/***/ ((module) => { "use strict"; module.exports = require("https"); /***/ }) eh ijk"module.exports = require("https");jl, /***/ 63033:  ;webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; \module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");  /***/ }) [/***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js"); /***/ }) \_ `ab\module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");ac, /***/ 74075:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("zlib");  /***/ }) RO/***/ ((module) => { "use strict"; module.exports = require("zlib"); /***/ }) SV WXY!module.exports = require("zlib");XZ, /***/ 79428:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("buffer");  /***/ }) IQ/***/ ((module) => { "use strict"; module.exports = require("buffer"); /***/ }) JM NOP#module.exports = require("buffer");OQ, /***/ 79551:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("url");  /***/ }) @N/***/ ((module) => { "use strict"; module.exports = require("url"); /***/ }) AD EFG module.exports = require("url");FH, /***/ 79646:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; *module.exports = require("child_process");  /***/ }) 7X/***/ ((module) => { "use strict"; module.exports = require("child_process"); /***/ }) 8; <=>*module.exports = require("child_process");=?, /***/ 81293:  ETwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource &webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceK__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ BecomeSpecialistPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13260); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(96484); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource0/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { request } from '@/lib/api'; export default function BecomeSpecialistPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t } = useLocale(); const [loading, setLoading] = useState(false); const [error, setError] = useState(''); async function handleBecome() { setLoading(true); setError(''); try { await request('/users/me/offer-help', { method: 'POST' }); router.push('/specialist-setup'); } catch { setError(t('common.error')); setLoading(false); } } if (isPending) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const steps = [ { n: 1, title: t('become_specialist.step1.title'), desc: t('become_specialist.step1.desc'), icon: '🗂️' }, { n: 2, title: t('become_specialist.step2.title'), desc: t('become_specialist.step2.desc'), icon: '🔍' }, { n: 3, title: t('become_specialist.step3.title'), desc: t('become_specialist.step3.desc'), icon: '💰' } ]; const benefits = [ { icon: '🎯', text: t('become_specialist.benefit1') }, { icon: '⭐', text: t('become_specialist.benefit2') }, { icon: '📅', text: t('become_specialist.benefit3') }, { icon: '❤️', text: t('become_specialist.benefit4') } ]; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("section", { className: "bg-gradient-to-br from-green-700 to-green-600 text-white py-20 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto text-center", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-4xl md:text-5xl font-bold mb-4", children: t('become_specialist.hero.title') }), /*#__PURE__*/ _jsx("p", { className: "text-xl text-green-100 mb-8", children: t('become_specialist.hero.subtitle') }) ] }) }), /*#__PURE__*/ _jsxs("section", { className: "max-w-4xl mx-auto px-4 py-16", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-white mb-10 text-center", children: t('become_specialist.how.title') }), /*#__PURE__*/ _jsx("div", { className: "grid md:grid-cols-3 gap-8", children: steps.map((step)=>/*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-14 h-14 bg-green-50 border-2 border-green-200 rounded-2xl flex items-center justify-center text-2xl mx-auto mb-4", children: step.icon }), /*#__PURE__*/ _jsx("div", { className: "w-7 h-7 bg-green-600 text-white rounded-full flex items-center justify-center text-sm font-bold mx-auto -mt-1 mb-3", children: step.n }), /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-white text-lg mb-2", children: step.title }), /*#__PURE__*/ _jsx("p", { className: "text-green-100 text-sm leading-relaxed", children: step.desc }) ] }, step.n)) }) ] }), /*#__PURE__*/ _jsx("section", { className: "bg-gray-50 py-14 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-8 text-center", children: t('become_specialist.benefits.title') }), /*#__PURE__*/ _jsx("div", { className: "grid sm:grid-cols-2 gap-4", children: benefits.map((b, i)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-4 bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl shrink-0", children: b.icon }), /*#__PURE__*/ _jsx("p", { className: "text-gray-700 font-medium leading-snug", children: b.text }) ] }, i)) }) ] }) }), /*#__PURE__*/ _jsx("section", { className: "py-16 px-4 text-center", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-md mx-auto", children: [ error && /*#__PURE__*/ _jsx("p", { className: "text-red-500 text-sm mb-4", children: error }), session ? /*#__PURE__*/ _jsx("button", { onClick: handleBecome, disabled: loading, className: "w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 disabled:opacity-60 transition", children: loading ? t('common.loading') : t('profile.become_specialist') }) : /*#__PURE__*/ _jsx("a", { href: "/register", className: "block w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 transition text-center", children: t('profile.become_specialist') }) ] }) }) ] }); } c'={}_!#FHV@G)-fi  _ |    *-wz*-!$J*-*-(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)buffersourcesizemapshashConcatSourceRawSourceK__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ BecomeSpecialistPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13260); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(96484); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); ReplaceSourceRawSource0/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { request } from '@/lib/api'; export default function BecomeSpecialistPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t } = useLocale(); const [loading, setLoading] = useState(false); const [error, setError] = useState(''); async function handleBecome() { setLoading(true); setError(''); try { await request('/users/me/offer-help', { method: 'POST' }); router.push('/specialist-setup'); } catch { setError(t('common.error')); setLoading(false); } } if (isPending) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const steps = [ { n: 1, title: t('become_specialist.step1.title'), desc: t('become_specialist.step1.desc'), icon: '🗂️' }, { n: 2, title: t('become_specialist.step2.title'), desc: t('become_specialist.step2.desc'), icon: '🔍' }, { n: 3, title: t('become_specialist.step3.title'), desc: t('become_specialist.step3.desc'), icon: '💰' } ]; const benefits = [ { icon: '🎯', text: t('become_specialist.benefit1') }, { icon: '⭐', text: t('become_specialist.benefit2') }, { icon: '📅', text: t('become_specialist.benefit3') }, { icon: '❤️', text: t('become_specialist.benefit4') } ]; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("section", { className: "bg-gradient-to-br from-green-700 to-green-600 text-white py-20 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto text-center", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-4xl md:text-5xl font-bold mb-4", children: t('become_specialist.hero.title') }), /*#__PURE__*/ _jsx("p", { className: "text-xl text-green-100 mb-8", children: t('become_specialist.hero.subtitle') }) ] }) }), /*#__PURE__*/ _jsxs("section", { className: "max-w-4xl mx-auto px-4 py-16", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-white mb-10 text-center", children: t('become_specialist.how.title') }), /*#__PURE__*/ _jsx("div", { className: "grid md:grid-cols-3 gap-8", children: steps.map((step)=>/*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-14 h-14 bg-green-50 border-2 border-green-200 rounded-2xl flex items-center justify-center text-2xl mx-auto mb-4", children: step.icon }), /*#__PURE__*/ _jsx("div", { className: "w-7 h-7 bg-green-600 text-white rounded-full flex items-center justify-center text-sm font-bold mx-auto -mt-1 mb-3", children: step.n }), /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-white text-lg mb-2", children: step.title }), /*#__PURE__*/ _jsx("p", { className: "text-green-100 text-sm leading-relaxed", children: step.desc }) ] }, step.n)) }) ] }), /*#__PURE__*/ _jsx("section", { className: "bg-gray-50 py-14 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-8 text-center", children: t('become_specialist.benefits.title') }), /*#__PURE__*/ _jsx("div", { className: "grid sm:grid-cols-2 gap-4", children: benefits.map((b, i)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-4 bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl shrink-0", children: b.icon }), /*#__PURE__*/ _jsx("p", { className: "text-gray-700 font-medium leading-snug", children: b.text }) ] }, i)) }) ] }) }), /*#__PURE__*/ _jsx("section", { className: "py-16 px-4 text-center", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-md mx-auto", children: [ error && /*#__PURE__*/ _jsx("p", { className: "text-red-500 text-sm mb-4", children: error }), session ? /*#__PURE__*/ _jsx("button", { onClick: handleBecome, disabled: loading, className: "w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 disabled:opacity-60 transition", children: loading ? t('common.loading') : t('profile.become_specialist') }) : /*#__PURE__*/ _jsx("a", { href: "/register", className: "block w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 transition text-center", children: t('profile.become_specialist') }) ] }) }) ] }); } R 61123undefined125157undefined159202undefined204243undefined245289undefined291326undefined328342undefined418427(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)undefined451459(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined482490(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined529536(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined576583(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined706712(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)undefined990993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined20892093(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined21502153(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23062310(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined24552458(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined26842687(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined29512955(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined30913094(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined33153318(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34593463(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined36263629(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined39593962(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42894292(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined45454548(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49064909(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined50165020(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined51535156(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54005403(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined55555559(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined57925795(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined60426045(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined64426445(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined65536557(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined66986701(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined68986901(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined73197322(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) . 55K__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ BecomeSpecialistPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13260); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(96484); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); R0/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { request } from '@/lib/api'; export default function BecomeSpecialistPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t } = useLocale(); const [loading, setLoading] = useState(false); const [error, setError] = useState(''); async function handleBecome() { setLoading(true); setError(''); try { await request('/users/me/offer-help', { method: 'POST' }); router.push('/specialist-setup'); } catch { setError(t('common.error')); setLoading(false); } } if (isPending) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const steps = [ { n: 1, title: t('become_specialist.step1.title'), desc: t('become_specialist.step1.desc'), icon: '🗂️' }, { n: 2, title: t('become_specialist.step2.title'), desc: t('become_specialist.step2.desc'), icon: '🔍' }, { n: 3, title: t('become_specialist.step3.title'), desc: t('become_specialist.step3.desc'), icon: '💰' } ]; const benefits = [ { icon: '🎯', text: t('become_specialist.benefit1') }, { icon: '⭐', text: t('become_specialist.benefit2') }, { icon: '📅', text: t('become_specialist.benefit3') }, { icon: '❤️', text: t('become_specialist.benefit4') } ]; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("section", { className: "bg-gradient-to-br from-green-700 to-green-600 text-white py-20 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto text-center", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-4xl md:text-5xl font-bold mb-4", children: t('become_specialist.hero.title') }), /*#__PURE__*/ _jsx("p", { className: "text-xl text-green-100 mb-8", children: t('become_specialist.hero.subtitle') }) ] }) }), /*#__PURE__*/ _jsxs("section", { className: "max-w-4xl mx-auto px-4 py-16", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-white mb-10 text-center", children: t('become_specialist.how.title') }), /*#__PURE__*/ _jsx("div", { className: "grid md:grid-cols-3 gap-8", children: steps.map((step)=>/*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-14 h-14 bg-green-50 border-2 border-green-200 rounded-2xl flex items-center justify-center text-2xl mx-auto mb-4", children: step.icon }), /*#__PURE__*/ _jsx("div", { className: "w-7 h-7 bg-green-600 text-white rounded-full flex items-center justify-center text-sm font-bold mx-auto -mt-1 mb-3", children: step.n }), /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-white text-lg mb-2", children: step.title }), /*#__PURE__*/ _jsx("p", { className: "text-green-100 text-sm leading-relaxed", children: step.desc }) ] }, step.n)) }) ] }), /*#__PURE__*/ _jsx("section", { className: "bg-gray-50 py-14 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-8 text-center", children: t('become_specialist.benefits.title') }), /*#__PURE__*/ _jsx("div", { className: "grid sm:grid-cols-2 gap-4", children: benefits.map((b, i)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-4 bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl shrink-0", children: b.icon }), /*#__PURE__*/ _jsx("p", { className: "text-gray-700 font-medium leading-snug", children: b.text }) ] }, i)) }) ] }) }), /*#__PURE__*/ _jsx("section", { className: "py-16 px-4 text-center", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-md mx-auto", children: [ error && /*#__PURE__*/ _jsx("p", { className: "text-red-500 text-sm mb-4", children: error }), session ? /*#__PURE__*/ _jsx("button", { onClick: handleBecome, disabled: loading, className: "w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 disabled:opacity-60 transition", children: loading ? t('common.loading') : t('profile.become_specialist') }) : /*#__PURE__*/ _jsx("a", { href: "/register", className: "block w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 transition text-center", children: t('profile.become_specialist') }) ] }) }) ] }); } R 61123undefined125157undefined159202undefined204243undefined245289undefined291326undefined328342undefined418427(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)undefined451459(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined482490(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined529536(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined576583(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined706712(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)undefined990993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined20892093(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined21502153(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23062310(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined24552458(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined26842687(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined29512955(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined30913094(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined33153318(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34593463(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined36263629(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined39593962(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42894292(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined45454548(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49064909(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined50165020(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined51535156(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54005403(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined55555559(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined57925795(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined60426045(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined64426445(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined65536557(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined66986701(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined68986901(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined73197322(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined46, /***/ 81630:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("http");  /***/ }) %O/***/ ((module) => { "use strict"; module.exports = require("http"); /***/ }) &) *+,!module.exports = require("http");+-, /***/ 83997:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("tty");  /***/ }) N/***/ ((module) => { "use strict"; module.exports = require("tty"); /***/ })   !"# module.exports = require("tty");"$, /***/ 86439:  +webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");  /***/ }) z/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/no-fallback-error.external"); /***/ })  Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");, /***/ 91645:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("net");  /***/ })  N/***/ ((module) => { "use strict"; module.exports = require("net"); /***/ })    module.exports = require("net");, /***/ 94735:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("events");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("events"); /***/ })  #module.exports = require("events"); , /***/ 98115:  rwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource awebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/become-specialist/page.tsx"); `\Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 24015))buffersourcesizemapshashbPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 24015)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSource_import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/become-specialist/page.tsx"); l092Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 24015))undefined /***/ }) l092Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 24015))undefinedw }; ; // load runtime var __webpack_require__ = require("../../webpack-runtime.js"); __webpack_require__.C(exports); var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [901,652,809], () => (__webpack_exec__(29569))); ,module.exports = __webpack_exports__; })(); @b(() => { var exports = {}; exports.id = 240; exports.ids = [240]; exports.modules = { /***/ 261: $/***/ ((module) => { "use strict"; Hmodule.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }), /***/ 3295: $/***/ ((module) => { "use strict"; ]module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");, /***/ 10846: Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");, /***/ 12187: V/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { _import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/become-specialist/page.tsx"); l092Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 81293))undefined, /***/ 19121: Ymodule.exports = require("next/dist/server/app-render/action-async-storage.external.js");, /***/ 24015: _/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); <// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/become-specialist/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/become-specialist/page.tsx", "default", ); 61134undefined136150/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (undefined136150undefined151173(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined570570.5);undefined, /***/ 26713: Emodule.exports = require("next/dist/shared/lib/router/utils/is-bot");, /***/ 27910: #module.exports = require("stream");, /***/ 28354: !module.exports = require("util");, /***/ 29021: module.exports = require("fs");, /***/ 29294: Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");, /***/ 29569: _/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; #__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); ,const module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/become-specialist/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'become-specialist', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/become-specialist/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/become-specialist/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/become-specialist/page", pathname: "/become-specialist", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/become-specialist/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map %'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558650Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 24015))undefined653793undefined795909undefined911987undefined9891060undefined10621124undefined11261195undefined11971273undefined12751360undefined13621445undefined14471523undefined15251606undefined16081701undefined17031807undefined18091889undefined18911969undefined19712062undefined20642245undefined22472323undefined23252390undefined23922465undefined24672524undefined25262632undefined26342707undefined27092773undefined27752856undefined32873509Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined35673796Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined43564578Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined46364865Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined50605082undefined50845220undefined52225244undefined52755293__webpack_require__undefined53515357undefined54585584undefined55865671undefined56735786undefined58495855undefined58805897next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined59335941next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined62216256".next"undefined626162620undefined62896327 falseundefined63396345undefined66376657falseundefined66606724{}undefined68706909falseundefined69416954(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined70457058(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined78247839(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined82268235(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined82718286(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined84318444(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined84908516next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined86958708(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined87548763next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined88038827(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined90079026(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined92189325 falseundefined933093440undefined1164011653(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1203812065(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1385013867(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1392713935next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1398613985: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1435414383(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1451514535(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1466914677(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1497714991next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1503115046next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1527415311falseundefined1531415889{}undefined1646716480next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1756717580(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1785917872(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1859118627 trueundefined1863118650(__webpack_require__(33873).join)undefined18729187800undefined1974119754(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2159521608(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2203222053next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2349223506next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2475224769(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2505825069next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2508425088(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2519425205next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2563925650next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2571925730next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2581925830next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2636326374next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2641926433next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2708527093next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2783927860(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2938829402next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2944129452next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2995429967(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3002430045(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3062030628next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3210732121next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3347333496next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3596335976next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3627136285next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3716837191next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3746337484next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3760237623next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3785337868(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3809638107next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3813638158next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3881438829(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3903739048next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3931139324(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3977239785(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4065540676next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4155541576next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4168641707next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4226042277next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4248142504next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4340043415(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4444344458(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4466644677next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4471044732next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4544945561falseundefined4556445914{}undefined4593945954(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4689846909next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4704447059(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4767047697falseundefined4770047770{}undefined4907849092next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined5001650031(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5090650919next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5101851025next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5128151295next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5150751525(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefined, /***/ 33873: !module.exports = require("path");, /***/ 34631:  module.exports = require("tls");, /***/ 41025: amodule.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js");, /***/ 55511: #module.exports = require("crypto");, /***/ 55591: ~"module.exports = require("https");}}, /***/ 63033: |\module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");{{, /***/ 74075: z!module.exports = require("zlib");yy, /***/ 79428: x#module.exports = require("buffer");ww, /***/ 79551: v module.exports = require("url");uu, /***/ 79646: t*module.exports = require("child_process");ss, /***/ 81293: rr, /***/ 81630: q!module.exports = require("http");pp, /***/ 83997: o module.exports = require("tty");nn, /***/ 86439: mLmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");ll, /***/ 91645: k module.exports = require("net");jj, /***/ 94735: i#module.exports = require("events");hh, /***/ 98115: l092Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 24015))undefinedffw }; ; // load runtime var __webpack_require__ = require("../../webpack-runtime.js"); __webpack_require__.C(exports); evar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [901,652,809], () => (__webpack_exec__(29569))); d,module.exports = __webpack_exports__; })(); Iwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSource`=webpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceb(() => { var exports = {}; exports.id = 466; exports.ids = [466]; exports.modules = { /***/ 261: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource 'webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Hmodule.exports = require("next/dist/shared/lib/router/utils/app-paths");  /***/ }) buffersourcesizemapshashv/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }) {"finalSource":true}mapbufferedMap ConcatSourceRawSource$/***/ ((module) => { "use strict";  RawSourceHmodule.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }), /***/ 2199:  cwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Y-webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ DeleteAccountPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13260); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource$/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import { useSession } from '@/lib/auth'; import { createSupportTicket } from '@/lib/api'; export default function DeleteAccountPage() { const { t } = useLocale(); const { data: session } = useSession(); const [reason, setReason] = useState(''); const [confirmed, setConfirmed] = useState(false); const [submitting, setSubmitting] = useState(false); const [done, setDone] = useState(false); const [error, setError] = useState(null); const handleSubmit = async (e)=>{ e.preventDefault(); if (!confirmed || submitting) return; setSubmitting(true); setError(null); try { await createSupportTicket({ type: 'delete_account', subject: 'Account deletion request', body: reason.trim() || 'No reason provided.' }); setDone(true); } catch (err) { setError(err?.message ?? 'Error'); } finally{ setSubmitting(false); } }; return /*#__PURE__*/ _jsx("main", { className: "py-12 px-4 sm:px-6", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-lg mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10", children: [ /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs(Link, { href: "/", className: "text-sm text-green-600 hover:underline", children: [ "← ", t('nav.home') ] }) }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-extrabold text-gray-900 mb-2", children: t('delete_account.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-8", children: t('delete_account.subtitle') }), done ? /*#__PURE__*/ _jsxs("div", { className: "rounded-xl bg-green-50 border border-green-200 p-6 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex items-center justify-center mx-auto mb-4", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-green-800 mb-1", children: t('delete_account.success_title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-green-700", children: t('delete_account.success_body') }) ] }) : !session?.user ? /*#__PURE__*/ _jsxs("div", { className: "rounded-xl bg-amber-50 border border-amber-200 p-6 text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-amber-800 mb-4", children: t('delete_account.login_required') }), /*#__PURE__*/ _jsx(Link, { href: "/login", className: "inline-flex items-center gap-2 px-5 py-2.5 bg-green-600 hover:bg-green-700 text-white text-sm font-semibold rounded-xl transition", children: t('delete_account.login_btn') }) ] }) : /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 rounded-xl bg-red-50 border border-red-200 p-4", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-red-500 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-700", children: t('delete_account.warning') }) ] }), /*#__PURE__*/ _jsx("div", { className: "rounded-xl bg-gray-50 border border-gray-200 px-4 py-3 text-sm text-gray-700", children: /*#__PURE__*/ _jsx("span", { className: "font-medium", children: session.user.email }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: t('delete_account.reason_label') }), /*#__PURE__*/ _jsx("textarea", { value: reason, onChange: (e)=>setReason(e.target.value), placeholder: t('delete_account.reason_placeholder'), rows: 4, maxLength: 2000, className: "w-full rounded-xl border border-gray-200 px-4 py-3 text-sm text-gray-800 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-green-500 resize-none" }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-start gap-3 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: confirmed, onChange: (e)=>setConfirmed(e.target.checked), className: "mt-0.5 w-4 h-4 rounded border-gray-300 text-red-600 focus:ring-red-500 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('delete_account.confirm_label') }) ] }), error && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600", children: error }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: !confirmed || submitting, className: "w-full py-3 rounded-xl bg-red-600 hover:bg-red-700 disabled:opacity-40 disabled:cursor-not-allowed text-white font-semibold text-sm transition", children: submitting ? t('delete_account.submitting') : t('delete_account.submit') }) ] }) ] }) }); } c/={}_CESKRx|UY_ptvyB F  Q T >A7;GKZ;> dg ;!>!!!(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSupportTicket */ .mq)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(next_link__WEBPACK_IMPORTED_MODULE_2___default())buffersourcesizemapshashConcatSourceRawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ DeleteAccountPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13260); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); ReplaceSourceRawSource$/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import { useSession } from '@/lib/auth'; import { createSupportTicket } from '@/lib/api'; export default function DeleteAccountPage() { const { t } = useLocale(); const { data: session } = useSession(); const [reason, setReason] = useState(''); const [confirmed, setConfirmed] = useState(false); const [submitting, setSubmitting] = useState(false); const [done, setDone] = useState(false); const [error, setError] = useState(null); const handleSubmit = async (e)=>{ e.preventDefault(); if (!confirmed || submitting) return; setSubmitting(true); setError(null); try { await createSupportTicket({ type: 'delete_account', subject: 'Account deletion request', body: reason.trim() || 'No reason provided.' }); setDone(true); } catch (err) { setError(err?.message ?? 'Error'); } finally{ setSubmitting(false); } }; return /*#__PURE__*/ _jsx("main", { className: "py-12 px-4 sm:px-6", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-lg mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10", children: [ /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs(Link, { href: "/", className: "text-sm text-green-600 hover:underline", children: [ "← ", t('nav.home') ] }) }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-extrabold text-gray-900 mb-2", children: t('delete_account.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-8", children: t('delete_account.subtitle') }), done ? /*#__PURE__*/ _jsxs("div", { className: "rounded-xl bg-green-50 border border-green-200 p-6 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex items-center justify-center mx-auto mb-4", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-green-800 mb-1", children: t('delete_account.success_title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-green-700", children: t('delete_account.success_body') }) ] }) : !session?.user ? /*#__PURE__*/ _jsxs("div", { className: "rounded-xl bg-amber-50 border border-amber-200 p-6 text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-amber-800 mb-4", children: t('delete_account.login_required') }), /*#__PURE__*/ _jsx(Link, { href: "/login", className: "inline-flex items-center gap-2 px-5 py-2.5 bg-green-600 hover:bg-green-700 text-white text-sm font-semibold rounded-xl transition", children: t('delete_account.login_btn') }) ] }) : /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 rounded-xl bg-red-50 border border-red-200 p-4", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-red-500 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-700", children: t('delete_account.warning') }) ] }), /*#__PURE__*/ _jsx("div", { className: "rounded-xl bg-gray-50 border border-gray-200 px-4 py-3 text-sm text-gray-700", children: /*#__PURE__*/ _jsx("span", { className: "font-medium", children: session.user.email }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: t('delete_account.reason_label') }), /*#__PURE__*/ _jsx("textarea", { value: reason, onChange: (e)=>setReason(e.target.value), placeholder: t('delete_account.reason_placeholder'), rows: 4, maxLength: 2000, className: "w-full rounded-xl border border-gray-200 px-4 py-3 text-sm text-gray-800 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-green-500 resize-none" }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-start gap-3 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: confirmed, onChange: (e)=>setConfirmed(e.target.checked), className: "mt-0.5 w-4 h-4 rounded border-gray-300 text-red-600 focus:ring-red-500 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('delete_account.confirm_label') }) ] }), error && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600", children: error }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: !confirmed || submitting, className: "w-full py-3 rounded-xl bg-red-600 hover:bg-red-700 disabled:opacity-40 disabled:cursor-not-allowed text-white font-semibold text-sm transition", children: submitting ? t('delete_account.submitting') : t('delete_account.submit') }) ] }) ] }) }); } t 61123undefined125157undefined159187undefined189233undefined235274undefined276323undefined325339undefined389397(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined432441(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined478485(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined530537(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined587594(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined632639(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined679686(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined892910(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSupportTicket */ .mq)undefined12771280(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined13651369(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined15511554(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined16481652(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined16541657(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined19851988(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined21812184(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23702374(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined25522555(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined27422745(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined30853088(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34093412(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined36463649(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined38953899(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined40774080(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42984301(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43034306(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined46794683(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined48534857(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined50545057(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54355438(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined58445847(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined61326135(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined63176320(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined65486552(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined66496652(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined69236926(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined75977601(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined77807783(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined82008203(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined85078510(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined86928695(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ })  _/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ DeleteAccountPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13260); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); ReplaceSourceRawSource$/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import { useSession } from '@/lib/auth'; import { createSupportTicket } from '@/lib/api'; export default function DeleteAccountPage() { const { t } = useLocale(); const { data: session } = useSession(); const [reason, setReason] = useState(''); const [confirmed, setConfirmed] = useState(false); const [submitting, setSubmitting] = useState(false); const [done, setDone] = useState(false); const [error, setError] = useState(null); const handleSubmit = async (e)=>{ e.preventDefault(); if (!confirmed || submitting) return; setSubmitting(true); setError(null); try { await createSupportTicket({ type: 'delete_account', subject: 'Account deletion request', body: reason.trim() || 'No reason provided.' }); setDone(true); } catch (err) { setError(err?.message ?? 'Error'); } finally{ setSubmitting(false); } }; return /*#__PURE__*/ _jsx("main", { className: "py-12 px-4 sm:px-6", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-lg mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10", children: [ /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs(Link, { href: "/", className: "text-sm text-green-600 hover:underline", children: [ "← ", t('nav.home') ] }) }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-extrabold text-gray-900 mb-2", children: t('delete_account.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-8", children: t('delete_account.subtitle') }), done ? /*#__PURE__*/ _jsxs("div", { className: "rounded-xl bg-green-50 border border-green-200 p-6 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex items-center justify-center mx-auto mb-4", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-green-800 mb-1", children: t('delete_account.success_title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-green-700", children: t('delete_account.success_body') }) ] }) : !session?.user ? /*#__PURE__*/ _jsxs("div", { className: "rounded-xl bg-amber-50 border border-amber-200 p-6 text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-amber-800 mb-4", children: t('delete_account.login_required') }), /*#__PURE__*/ _jsx(Link, { href: "/login", className: "inline-flex items-center gap-2 px-5 py-2.5 bg-green-600 hover:bg-green-700 text-white text-sm font-semibold rounded-xl transition", children: t('delete_account.login_btn') }) ] }) : /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 rounded-xl bg-red-50 border border-red-200 p-4", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-red-500 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-700", children: t('delete_account.warning') }) ] }), /*#__PURE__*/ _jsx("div", { className: "rounded-xl bg-gray-50 border border-gray-200 px-4 py-3 text-sm text-gray-700", children: /*#__PURE__*/ _jsx("span", { className: "font-medium", children: session.user.email }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: t('delete_account.reason_label') }), /*#__PURE__*/ _jsx("textarea", { value: reason, onChange: (e)=>setReason(e.target.value), placeholder: t('delete_account.reason_placeholder'), rows: 4, maxLength: 2000, className: "w-full rounded-xl border border-gray-200 px-4 py-3 text-sm text-gray-800 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-green-500 resize-none" }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-start gap-3 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: confirmed, onChange: (e)=>setConfirmed(e.target.checked), className: "mt-0.5 w-4 h-4 rounded border-gray-300 text-red-600 focus:ring-red-500 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('delete_account.confirm_label') }) ] }), error && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600", children: error }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: !confirmed || submitting, className: "w-full py-3 rounded-xl bg-red-600 hover:bg-red-700 disabled:opacity-40 disabled:cursor-not-allowed text-white font-semibold text-sm transition", children: submitting ? t('delete_account.submitting') : t('delete_account.submit') }) ] }) ] }) }); } t 61123undefined125157undefined159187undefined189233undefined235274undefined276323undefined325339undefined389397(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined432441(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined478485(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined530537(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined587594(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined632639(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined679686(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined892910(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSupportTicket */ .mq)undefined12771280(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined13651369(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined15511554(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined16481652(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined16541657(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined19851988(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined21812184(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23702374(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined25522555(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined27422745(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined30853088(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34093412(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined36463649(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined38953899(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined40774080(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42984301(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43034306(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined46794683(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined48534857(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined50545057(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54355438(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined58445847(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined61326135(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined63176320(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined65486552(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined66496652(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined69236926(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined75977601(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined77807783(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined82008203(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined85078510(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined86928695(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 2777:  Rwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceconst module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/delete-account/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'delete-account', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/delete-account/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/delete-account/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/delete-account/page", pathname: "/delete-account", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/delete-account/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map @bb{_:S.!#acMOCE_ ^`    S U E G % _XZpF!);^cd_/p}{  : I !/!!!"&"N"f"#-##X$]$_k$c-p-. /66R6Z666788889@9l:z:::;;;=>@K@DDEEH_HHHIGIMMFTSTUV[[``aaaaUb`bddbdmdddffg,gi_illrrrrtt3uHuwwV}d}Âfs2BW͒ȓדƔ_hszGTϞ>S֢ܥseptE^Tm(!<?KZ5<<J0Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6533))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))__webpack_require__next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModulenext_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind".next"0 falsefalse{}(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERnext_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADER(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)0(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestnext_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponsenext_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T) true(__webpack_require__(33873).join)0next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERnext_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERnext_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARnext_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERnext_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodenext_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSnext_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKind(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)buffersourcesizemapshash__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); const module0 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570)); const module1 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23)); const module2 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506)); const module3 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23)); const module4 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23)); const page5 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6533)); // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'delete-account', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/delete-account/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))).default(props))], apple: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))).default(props))], apple: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/delete-account/page.tsx"]; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; // Create and export the route module that will be consumed. const routeModule = new next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModule({ definition: { kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, page: "/delete-account/page", pathname: "/delete-account", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: ".next" || 0, relativeProjectDir: false || '' }); async function handler(req, res, ctx) { var _this; let srcPage = "/delete-account/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const initialPostponed = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)(userAgent); const isHtmlBot = (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isPrefetchRSCRequest') ?? req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isRSCRequest') ?? Boolean(req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADER]); const isPossibleServerAction = (0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = (0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = false && 0; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { (0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)(req.headers); } const ComponentMod = { ...next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__, tree, pages, GlobalError: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default()), handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { (0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: (0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequest(req); const nextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (false) {} return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: (0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: true ? (__webpack_require__(33873).join)(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : 0, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = (0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.PRERENDER && (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND) { throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.PAGES, html: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && ((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'renderFallbackShell') || isDebugFallbackShell) ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(matchedSegment, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(cachedData.rscData, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map {"finalSource":true}mapbufferedMap ConcatSourceRawSource#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); ReplaceSourceRawSourceconst module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/delete-account/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'delete-account', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/delete-account/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/delete-account/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/delete-account/page", pathname: "/delete-account", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/delete-account/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map $'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558647Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6533))undefined650790undefined792906undefined908984undefined9861057undefined10591121undefined11231192undefined11941270undefined12721357undefined13591442undefined14441520undefined15221603undefined16051698undefined17001804undefined18061886undefined18881966undefined19682059undefined20612242undefined22442320undefined23222387undefined23892462undefined24642521undefined25232629undefined26312704undefined27062770undefined27722853undefined32783500Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined35583787Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined43474569Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined46274856Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined50485070undefined50725208undefined52105232undefined52635281__webpack_require__undefined53395345undefined54465572undefined55745659undefined56615774undefined58375843undefined58685885next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined59215929next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined62036238".next"undefined624362440undefined62716309 falseundefined63216327undefined66166636falseundefined66396703{}undefined68496888falseundefined69206933(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined70247037(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined78037818(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined82058214(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined82508265(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined84108423(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined84698495next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined86748687(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined87338742next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined87828806(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined89869005(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined91979304 falseundefined930993230undefined1161911632(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1201712044(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1382913846(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1390613914next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1396513964: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1433314362(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1449414514(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1464814656(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1495614970next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1501015025next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1525315290falseundefined1529315868{}undefined1644616459next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1754617559(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1783817851(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1857018606 trueundefined1861018629(__webpack_require__(33873).join)undefined18708187590undefined1972019733(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2157421587(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2201122032next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2347123485next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2473124748(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2503725048next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2506325067(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2517325184next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2561825629next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2569825709next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2579825809next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2634226353next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2639826412next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2706427072next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2781827839(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2936729381next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2942029431next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2993329946(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3000330024(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3059930607next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3208632100next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3345233475next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3594235955next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3625036264next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3714737170next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3744237463next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3758137602next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3783237847(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3807538086next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3811538137next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3879338808(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3901639027next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3929039303(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3975139764(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4063440655next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4153441555next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4166541686next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4223942256next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4246042483next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4337943394(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4442244437(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4464544656next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4468944711next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4542845540falseundefined4554345893{}undefined4591845933(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4687746888next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4702347038(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4764947676falseundefined4767947749{}undefined4905749071next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined4999550010(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5088550898next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5099751004next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5126051274next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5148651504(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefined /***/ })  #__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); const module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/delete-account/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'delete-account', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/delete-account/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/delete-account/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/delete-account/page", pathname: "/delete-account", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/delete-account/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map $'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558647Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6533))undefined650790undefined792906undefined908984undefined9861057undefined10591121undefined11231192undefined11941270undefined12721357undefined13591442undefined14441520undefined15221603undefined16051698undefined17001804undefined18061886undefined18881966undefined19682059undefined20612242undefined22442320undefined23222387undefined23892462undefined24642521undefined25232629undefined26312704undefined27062770undefined27722853undefined32783500Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined35583787Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined43474569Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined46274856Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined50485070undefined50725208undefined52105232undefined52635281__webpack_require__undefined53395345undefined54465572undefined55745659undefined56615774undefined58375843undefined58685885next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined59215929next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined62036238".next"undefined624362440undefined62716309 falseundefined63216327undefined66166636falseundefined66396703{}undefined68496888falseundefined69206933(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined70247037(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined78037818(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined82058214(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined82508265(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined84108423(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined84698495next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined86748687(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined87338742next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined87828806(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined89869005(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined91979304 falseundefined930993230undefined1161911632(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1201712044(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1382913846(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1390613914next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1396513964: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1433314362(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1449414514(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1464814656(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1495614970next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1501015025next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1525315290falseundefined1529315868{}undefined1644616459next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1754617559(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1783817851(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1857018606 trueundefined1861018629(__webpack_require__(33873).join)undefined18708187590undefined1972019733(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2157421587(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2201122032next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2347123485next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2473124748(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2503725048next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2506325067(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2517325184next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2561825629next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2569825709next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2579825809next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2634226353next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2639826412next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2706427072next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2781827839(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2936729381next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2942029431next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2993329946(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3000330024(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3059930607next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3208632100next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3345233475next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3594235955next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3625036264next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3714737170next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3744237463next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3758137602next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3783237847(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3807538086next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3811538137next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3879338808(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3901639027next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3929039303(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3975139764(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4063440655next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4153441555next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4166541686next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4223942256next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4246042483next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4337943394(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4442244437(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4464544656next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4468944711next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4542845540falseundefined4554345893{}undefined4591845933(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4687746888next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4702347038(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4764947676falseundefined4767947749{}undefined4905749071next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined4999550010(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5088550898next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5099751004next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5126051274next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5148651504(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefined, /***/ 3295:  <webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; ]module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js"); /***/ })  ]module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");, /***/ 6533:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource6// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/delete-account/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/delete-account/page.tsx", "default", ); `=G4 @/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference));buffersourcesizemapshashb__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/delete-account/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/delete-account/page.tsx", "default", )); {"finalSource":true}mapbufferedMap ConcatSourceRawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); ReplaceSourceRawSource6// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/delete-account/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/delete-account/page.tsx", "default", ); 61134undefined136150/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (undefined136150undefined151173(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined564564.5);undefined /***/ })  __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); 6// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/delete-account/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/delete-account/page.tsx", "default", ); 61134undefined136150/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (undefined136150undefined151173(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined564564.5);undefined, /***/ 10846:  3webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js"); /***/ })  Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");, /***/ 19121:  8webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Ymodule.exports = require("next/dist/server/app-render/action-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/action-async-storage.external.js"); /***/ })  Ymodule.exports = require("next/dist/server/app-render/action-async-storage.external.js");, /***/ 26713:  $webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Emodule.exports = require("next/dist/shared/lib/router/utils/is-bot");  /***/ }) s/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/is-bot"); /***/ })  Emodule.exports = require("next/dist/shared/lib/router/utils/is-bot");, /***/ 27910:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("stream");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("stream"); /***/ })  #module.exports = require("stream");, /***/ 28354:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("util");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("util"); /***/ })  !module.exports = require("util");, /***/ 29021:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; module.exports = require("fs");  /***/ }) M/***/ ((module) => { "use strict"; module.exports = require("fs"); /***/ })  module.exports = require("fs");, /***/ 29294:  6webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-async-storage.external.js"); /***/ })  Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");, /***/ 31619:  iwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource ]webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource\import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/delete-account/page.tsx"); `YPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6533))buffersourcesizemapshashaPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6533)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSource\import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/delete-account/page.tsx"); k089Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6533))undefined /***/ }) V/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { \import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/delete-account/page.tsx"); k089Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6533))undefined, /***/ 33873:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("path");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("path"); /***/ })  !module.exports = require("path");, /***/ 34631:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("tls");  /***/ }) wN/***/ ((module) => { "use strict"; module.exports = require("tls"); /***/ }) x{ |}~ module.exports = require("tls");}, /***/ 41025:  @webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; amodule.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js");  /***/ }) n/***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js"); /***/ }) or stuamodule.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js");tv, /***/ 55511:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("crypto");  /***/ }) eQ/***/ ((module) => { "use strict"; module.exports = require("crypto"); /***/ }) fi jkl#module.exports = require("crypto");km, /***/ 55591:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; "module.exports = require("https");  /***/ }) \P/***/ ((module) => { "use strict"; module.exports = require("https"); /***/ }) ]` abc"module.exports = require("https");bd, /***/ 63033:  ;webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; \module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");  /***/ }) S/***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js"); /***/ }) TW XYZ\module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");Y[, /***/ 74075:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("zlib");  /***/ }) JO/***/ ((module) => { "use strict"; module.exports = require("zlib"); /***/ }) KN OPQ!module.exports = require("zlib");PR, /***/ 79428:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("buffer");  /***/ }) AQ/***/ ((module) => { "use strict"; module.exports = require("buffer"); /***/ }) BE FGH#module.exports = require("buffer");GI, /***/ 79551:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("url");  /***/ }) 8N/***/ ((module) => { "use strict"; module.exports = require("url"); /***/ }) 9< =>? module.exports = require("url");>@, /***/ 79646:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; *module.exports = require("child_process");  /***/ }) /X/***/ ((module) => { "use strict"; module.exports = require("child_process"); /***/ }) 03 456*module.exports = require("child_process");57, /***/ 81630:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("http");  /***/ }) &O/***/ ((module) => { "use strict"; module.exports = require("http"); /***/ }) '* +,-!module.exports = require("http");,., /***/ 83997:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("tty");  /***/ }) N/***/ ((module) => { "use strict"; module.exports = require("tty"); /***/ }) ! "#$ module.exports = require("tty");#%, /***/ 86439:  +webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");  /***/ }) z/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/no-fallback-error.external"); /***/ })  Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");, /***/ 91645:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("net");  /***/ })  N/***/ ((module) => { "use strict"; module.exports = require("net"); /***/ })    module.exports = require("net");, /***/ 94735:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("events");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("events"); /***/ })   #module.exports = require("events"); , /***/ 97275:  iwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource ]webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource\import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/delete-account/page.tsx"); `YPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2199))buffersourcesizemapshashaPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2199)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSource\import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/delete-account/page.tsx"); k089Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2199))undefined /***/ }) p qk089Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2199))undefinedw }; ; // load runtime var __webpack_require__ = require("../../webpack-runtime.js"); __webpack_require__.C(exports); var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [901,652,809], () => (__webpack_exec__(2777))); ,module.exports = __webpack_exports__; })(); @b(() => { var exports = {}; exports.id = 466; exports.ids = [466]; exports.modules = { /***/ 261: ^^^, /***/ 2199: ]], /***/ 2777: const module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/delete-account/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'delete-account', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/delete-account/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/delete-account/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/delete-account/page", pathname: "/delete-account", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/delete-account/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map $'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558647Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6533))undefined650790undefined792906undefined908984undefined9861057undefined10591121undefined11231192undefined11941270undefined12721357undefined13591442undefined14441520undefined15221603undefined16051698undefined17001804undefined18061886undefined18881966undefined19682059undefined20612242undefined22442320undefined23222387undefined23892462undefined24642521undefined25232629undefined26312704undefined27062770undefined27722853undefined32783500Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined35583787Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined43474569Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined46274856Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined50485070undefined50725208undefined52105232undefined52635281__webpack_require__undefined53395345undefined54465572undefined55745659undefined56615774undefined58375843undefined58685885next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined59215929next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined62036238".next"undefined624362440undefined62716309 falseundefined63216327undefined66166636falseundefined66396703{}undefined68496888falseundefined69206933(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined70247037(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined78037818(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined82058214(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined82508265(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined84108423(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined84698495next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined86748687(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined87338742next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined87828806(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined89869005(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined91979304 falseundefined930993230undefined1161911632(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1201712044(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1382913846(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1390613914next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1396513964: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1433314362(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1449414514(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1464814656(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1495614970next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1501015025next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1525315290falseundefined1529315868{}undefined1644616459next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1754617559(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1783817851(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1857018606 trueundefined1861018629(__webpack_require__(33873).join)undefined18708187590undefined1972019733(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2157421587(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2201122032next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2347123485next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2473124748(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2503725048next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2506325067(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2517325184next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2561825629next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2569825709next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2579825809next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2634226353next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2639826412next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2706427072next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2781827839(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2936729381next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2942029431next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2993329946(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3000330024(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3059930607next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3208632100next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3345233475next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3594235955next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3625036264next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3714737170next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3744237463next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3758137602next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3783237847(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3807538086next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3811538137next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3879338808(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3901639027next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3929039303(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3975139764(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4063440655next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4153441555next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4166541686next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4223942256next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4246042483next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4337943394(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4442244437(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4464544656next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4468944711next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4542845540falseundefined4554345893{}undefined4591845933(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4687746888next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4702347038(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4764947676falseundefined4767947749{}undefined4905749071next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined4999550010(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5088550898next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5099751004next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5126051274next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5148651504(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefinedZZZZZ, /***/ 6533: 6// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/delete-account/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/delete-account/page.tsx", "default", ); 61134undefined136150/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (undefined136150undefined151173(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined564564.5);undefinedWWWWWWWWWWWWWWWWWWWWWWW, /***/ 31619: \import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/delete-account/page.tsx"); k089Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6533))undefinedTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT, /***/ 97275: k089Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2199))undefinedRRRvar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [901,652,809], () => (__webpack_exec__(2777))); Q >webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSource`=webpack/lib/util/registerExternalSerializerwebpack-sources/RawSource`(() => { var exports = {}; exports.id = 40; exports.ids = [40]; exports.modules = { /***/ 261: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource 'webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Hmodule.exports = require("next/dist/shared/lib/router/utils/app-paths");  /***/ }) buffersourcesizemapshashv/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }) {"finalSource":true}mapbufferedMap ConcatSourceRawSource$/***/ ((module) => { "use strict";  RawSourceHmodule.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }), /***/ 2843:  bwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Ywebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceWimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/favorites/page.tsx"); `TPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 32351))buffersourcesizemapshashbPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 32351)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceWimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/favorites/page.tsx"); l084Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 32351))undefined /***/ }) V/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { ReplaceSourceRawSourceWimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/favorites/page.tsx"); l084Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 32351))undefined, /***/ 3295:  <webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; ]module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js"); /***/ })  ]module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");, /***/ 10846:  3webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js"); /***/ })  Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");, /***/ 13459:  bwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Ywebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceWimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/favorites/page.tsx"); `TPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 66681))buffersourcesizemapshashbPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 66681)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceWimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/favorites/page.tsx"); l084Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 66681))undefined /***/ }) l084Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 66681))undefined, /***/ 19121:  8webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Ymodule.exports = require("next/dist/server/app-render/action-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/action-async-storage.external.js"); /***/ })  Ymodule.exports = require("next/dist/server/app-render/action-async-storage.external.js");, /***/ 26713:  $webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Emodule.exports = require("next/dist/shared/lib/router/utils/is-bot");  /***/ }) s/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/is-bot"); /***/ })  Emodule.exports = require("next/dist/shared/lib/router/utils/is-bot");, /***/ 27910:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("stream");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("stream"); /***/ })  #module.exports = require("stream");, /***/ 28354:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("util");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("util"); /***/ })  !module.exports = require("util");, /***/ 29021:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; module.exports = require("fs");  /***/ }) M/***/ ((module) => { "use strict"; module.exports = require("fs"); /***/ })  module.exports = require("fs");, /***/ 29294:  6webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-async-storage.external.js"); /***/ })  Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");, /***/ 32351:  nwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource,// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/favorites/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/favorites/page.tsx", "default", ); `=G* T@/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference));buffersourcesizemapshashX__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/favorites/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/favorites/page.tsx", "default", )); {"finalSource":true}mapbufferedMap ConcatSourceRawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); ReplaceSourceRawSource,// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/favorites/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/favorites/page.tsx", "default", ); 61134undefined136150/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (undefined136150undefined151173(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined554554.5);undefined /***/ })  _/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); ,// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/favorites/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/favorites/page.tsx", "default", ); 61134undefined136150/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (undefined136150undefined151173(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined554554.5);undefined, /***/ 33873:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("path");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("path"); /***/ })  !module.exports = require("path");, /***/ 34631:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("tls");  /***/ }) N/***/ ((module) => { "use strict"; module.exports = require("tls"); /***/ })   module.exports = require("tls");, /***/ 41025:  @webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; amodule.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js");  /***/ }) y/***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js"); /***/ }) z} ~amodule.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js");, /***/ 42309:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceconst module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/favorites/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'favorites', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/favorites/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/favorites/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/favorites/page", pathname: "/favorites", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/favorites/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map @bb{_:S.\^HJ>@_ Y[ N P @ B _DF\{2 z @EFa_ MZXg & !!!!"+"C"" ##5$:$_H$@-M-..55/676j6i677{8899I:W:::r;;;=@(@gDtDEEgH_HHHH$ILL#T0TUU[[x``aaaa2b=bcc?dJdddfff gi_illrrrrttu%udwlw3}A}CPw4_֔fuEPWd$10ܤХP_crBMnQı";TJb~(7' Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 32351))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))__webpack_require__next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModulenext_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind".next"0 falsefalse{}(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERnext_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADER(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)0(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestnext_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponsenext_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T) true(__webpack_require__(33873).join)0next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERnext_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERnext_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARnext_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERnext_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodenext_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSnext_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKind(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)buffersourcesizemapshash__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); const module0 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570)); const module1 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23)); const module2 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506)); const module3 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23)); const module4 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23)); const page5 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 32351)); // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'favorites', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/favorites/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))).default(props))], apple: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))).default(props))], apple: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/favorites/page.tsx"]; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; // Create and export the route module that will be consumed. const routeModule = new next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModule({ definition: { kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, page: "/favorites/page", pathname: "/favorites", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: ".next" || 0, relativeProjectDir: false || '' }); async function handler(req, res, ctx) { var _this; let srcPage = "/favorites/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const initialPostponed = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)(userAgent); const isHtmlBot = (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isPrefetchRSCRequest') ?? req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isRSCRequest') ?? Boolean(req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADER]); const isPossibleServerAction = (0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = (0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = false && 0; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { (0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)(req.headers); } const ComponentMod = { ...next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__, tree, pages, GlobalError: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default()), handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { (0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: (0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequest(req); const nextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (false) {} return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: (0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: true ? (__webpack_require__(33873).join)(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : 0, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = (0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.PRERENDER && (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND) { throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.PAGES, html: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && ((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'renderFallbackShell') || isDebugFallbackShell) ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(matchedSegment, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(cachedData.rscData, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map {"finalSource":true}mapbufferedMap ConcatSourceRawSource#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); ReplaceSourceRawSourceconst module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/favorites/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'favorites', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/favorites/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/favorites/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/favorites/page", pathname: "/favorites", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/favorites/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map %'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558642Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 32351))undefined645785undefined787901undefined903979undefined9811052undefined10541116undefined11181187undefined11891265undefined12671352undefined13541437undefined14391515undefined15171598undefined16001693undefined16951799undefined18011881undefined18831961undefined19632054undefined20562237undefined22392315undefined23172382undefined23842457undefined24592516undefined25182624undefined26262699undefined27012765undefined27672848undefined32633485Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined35433772Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined43324554Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined46124841Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined50285050undefined50525188undefined51905212undefined52435261__webpack_require__undefined53195325undefined54265552undefined55545639undefined56415754undefined58175823undefined58485865next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined59015909next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined61736208".next"undefined621362140undefined62416279 falseundefined62916297undefined65816601falseundefined66046668{}undefined68146853falseundefined68856898(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined69897002(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined77687783(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined81708179(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined82158230(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined83758388(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined84348460next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined86398652(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined86988707next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined87478771(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined89518970(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined91629269 falseundefined927492880undefined1158411597(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1198212009(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1379413811(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1387113879next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1393013929: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1429814327(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1445914479(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1461314621(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1492114935next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1497514990next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1521815255falseundefined1525815833{}undefined1641116424next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1751117524(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1780317816(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1853518571 trueundefined1857518594(__webpack_require__(33873).join)undefined18673187240undefined1968519698(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2153921552(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2197621997next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2343623450next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2469624713(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2500225013next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2502825032(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2513825149next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2558325594next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2566325674next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2576325774next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2630726318next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2636326377next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2702927037next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2778327804(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2933229346next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2938529396next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2989829911(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2996829989(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3056430572next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3205132065next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3341733440next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3590735920next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3621536229next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3711237135next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3740737428next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3754637567next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3779737812(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3804038051next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3808038102next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3875838773(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3898138992next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3925539268(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3971639729(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4059940620next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4149941520next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4163041651next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4220442221next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4242542448next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4334443359(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4438744402(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4461044621next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4465444676next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4539345505falseundefined4550845858{}undefined4588345898(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4684246853next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4698847003(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4761447641falseundefined4764447714{}undefined4902249036next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined4996049975(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5085050863next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5096250969next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5122551239next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5145151469(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefined /***/ }) p ww#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); const module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/favorites/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'favorites', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/favorites/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/favorites/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/favorites/page", pathname: "/favorites", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/favorites/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map %'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558642Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 32351))undefined645785undefined787901undefined903979undefined9811052undefined10541116undefined11181187undefined11891265undefined12671352undefined13541437undefined14391515undefined15171598undefined16001693undefined16951799undefined18011881undefined18831961undefined19632054undefined20562237undefined22392315undefined23172382undefined23842457undefined24592516undefined25182624undefined26262699undefined27012765undefined27672848undefined32633485Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined35433772Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined43324554Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined46124841Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined50285050undefined50525188undefined51905212undefined52435261__webpack_require__undefined53195325undefined54265552undefined55545639undefined56415754undefined58175823undefined58485865next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined59015909next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined61736208".next"undefined621362140undefined62416279 falseundefined62916297undefined65816601falseundefined66046668{}undefined68146853falseundefined68856898(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined69897002(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined77687783(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined81708179(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined82158230(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined83758388(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined84348460next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined86398652(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined86988707next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined87478771(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined89518970(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined91629269 falseundefined927492880undefined1158411597(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1198212009(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1379413811(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1387113879next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1393013929: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1429814327(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1445914479(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1461314621(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1492114935next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1497514990next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1521815255falseundefined1525815833{}undefined1641116424next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1751117524(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1780317816(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1853518571 trueundefined1857518594(__webpack_require__(33873).join)undefined18673187240undefined1968519698(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2153921552(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2197621997next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2343623450next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2469624713(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2500225013next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2502825032(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2513825149next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2558325594next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2566325674next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2576325774next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2630726318next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2636326377next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2702927037next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2778327804(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2933229346next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2938529396next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2989829911(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2996829989(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3056430572next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3205132065next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3341733440next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3590735920next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3621536229next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3711237135next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3740737428next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3754637567next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3779737812(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3804038051next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3808038102next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3875838773(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3898138992next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3925539268(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3971639729(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4059940620next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4149941520next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4163041651next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4220442221next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4242542448next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4334443359(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4438744402(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4461044621next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4465444676next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4539345505falseundefined4550845858{}undefined4588345898(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4684246853next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4698847003(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4761447641falseundefined4764447714{}undefined4902249036next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined4996049975(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5085050863next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5096250969next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5122551239next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5145151469(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefinedvx, /***/ 55511:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("crypto");  /***/ }) gQ/***/ ((module) => { "use strict"; module.exports = require("crypto"); /***/ }) hk lmn#module.exports = require("crypto");mo, /***/ 55591:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; "module.exports = require("https");  /***/ }) ^P/***/ ((module) => { "use strict"; module.exports = require("https"); /***/ }) _b cde"module.exports = require("https");df, /***/ 63033:  ;webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; \module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");  /***/ }) U/***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js"); /***/ }) VY Z[\\module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");[], /***/ 66681:  Fwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ FavoritesPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(71159); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13260); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(96484); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(91864); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(48178); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource'/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getSpecialistFavorites, removeSpecialistFavorite } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; export default function FavoritesPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t } = useLocale(); const [favorites, setFavorites] = useState([]); const [loading, setLoading] = useState(true); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isPending && !session) { router.push('/login'); return; } if (!session) return; getSpecialistFavorites().then(setFavorites).catch(()=>{}).finally(()=>setLoading(false)); }, [ session, isPending ]); async function handleRemove(specialistId) { await removeSpecialistFavorite(specialistId).catch(()=>{}); setFavorites((prev)=>prev.filter((r)=>r.specialist?.id !== specialistId)); } if (isPending || loading) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } return /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white mb-6", children: t('favorites.specialists.title') }), favorites.length === 0 ? /*#__PURE__*/ _jsxs("div", { className: "text-center py-20 text-white/70", children: [ /*#__PURE__*/ _jsx("p", { className: "text-4xl mb-4", children: "\uD83E\uDD0D" }), /*#__PURE__*/ _jsx("p", { className: "text-lg", children: t('favorites.specialists.empty') }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: "mt-4 inline-block text-white hover:text-white/80 text-sm", children: [ t('specialists.view'), " →" ] }) ] }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: favorites.map((row)=>{ const u = row.specialist; if (!u) return null; const name = formatShortName(u.firstName, u.lastName, u.name); const initials = `${u.firstName?.[0] ?? ''}${u.lastName?.[0] ?? ''}`.toUpperCase() || u.name?.[0]?.toUpperCase() || '?'; return /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4 bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm transition", children: [ /*#__PURE__*/ _jsxs(Link, { href: `/users/${u.id}`, className: "flex items-center gap-3 flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: u.image ? /*#__PURE__*/ _jsx("img", { src: u.image, alt: name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 truncate", children: name }), u.bio && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 line-clamp-1", children: u.bio }) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>handleRemove(u.id), title: t('specialist.unfavorite'), className: "flex-shrink-0 w-8 h-8 flex items-center justify-center text-pink-400 hover:text-pink-600 hover:bg-pink-50 rounded-full transition", children: "❤️" }) ] }, row.id); }) }) ] }); } c$={}_JL!*BJai t@_CJMLO  x { W e ? C $ ( * -  FIdDg!(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getSpecialistFavorites */ .pD)(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .removeSpecialistFavorite */ .sD)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(next_link__WEBPACK_IMPORTED_MODULE_2___default())(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_7__/* .formatShortName */ .H)buffersourcesizemapshashConcatSourceRawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ FavoritesPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(71159); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13260); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(96484); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(91864); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(48178); ReplaceSourceRawSource'/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getSpecialistFavorites, removeSpecialistFavorite } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; export default function FavoritesPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t } = useLocale(); const [favorites, setFavorites] = useState([]); const [loading, setLoading] = useState(true); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isPending && !session) { router.push('/login'); return; } if (!session) return; getSpecialistFavorites().then(setFavorites).catch(()=>{}).finally(()=>setLoading(false)); }, [ session, isPending ]); async function handleRemove(specialistId) { await removeSpecialistFavorite(specialistId).catch(()=>{}); setFavorites((prev)=>prev.filter((r)=>r.specialist?.id !== specialistId)); } if (isPending || loading) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } return /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white mb-6", children: t('favorites.specialists.title') }), favorites.length === 0 ? /*#__PURE__*/ _jsxs("div", { className: "text-center py-20 text-white/70", children: [ /*#__PURE__*/ _jsx("p", { className: "text-4xl mb-4", children: "\uD83E\uDD0D" }), /*#__PURE__*/ _jsx("p", { className: "text-lg", children: t('favorites.specialists.empty') }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: "mt-4 inline-block text-white hover:text-white/80 text-sm", children: [ t('specialists.view'), " →" ] }) ] }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: favorites.map((row)=>{ const u = row.specialist; if (!u) return null; const name = formatShortName(u.firstName, u.lastName, u.name); const initials = `${u.firstName?.[0] ?? ''}${u.lastName?.[0] ?? ''}`.toUpperCase() || u.name?.[0]?.toUpperCase() || '?'; return /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4 bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm transition", children: [ /*#__PURE__*/ _jsxs(Link, { href: `/users/${u.id}`, className: "flex items-center gap-3 flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: u.image ? /*#__PURE__*/ _jsx("img", { src: u.image, alt: name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 truncate", children: name }), u.bio && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 line-clamp-1", children: u.bio }) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>handleRemove(u.id), title: t('specialist.unfavorite'), className: "flex-shrink-0 w-8 h-8 flex items-center justify-center text-pink-400 hover:text-pink-600 hover:bg-pink-50 rounded-full transition", children: "❤️" }) ] }, row.id); }) }) ] }); } 661123undefined125168undefined170198undefined200243undefined245284undefined286330undefined332408undefined410460undefined462476undefined545554(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined578586(0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)undefined609617(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)undefined660667(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined708715(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined779787(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined936957(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getSpecialistFavorites */ .pD)undefined11401163(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .removeSpecialistFavorite */ .sD)undefined13441347(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined14981502(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined16101613(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined18141818(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined19531956(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined21242127(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23072311(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined23132316(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined26802683(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined29032917(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_7__/* .formatShortName */ .H)undefined31353139(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined33643368(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined33703373(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined36133616(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined39103913(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42654269(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined44524455(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined47414744(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined51505153(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) L SS__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ FavoritesPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(71159); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13260); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(96484); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(91864); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(48178); ^'/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getSpecialistFavorites, removeSpecialistFavorite } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; export default function FavoritesPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t } = useLocale(); const [favorites, setFavorites] = useState([]); const [loading, setLoading] = useState(true); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isPending && !session) { router.push('/login'); return; } if (!session) return; getSpecialistFavorites().then(setFavorites).catch(()=>{}).finally(()=>setLoading(false)); }, [ session, isPending ]); async function handleRemove(specialistId) { await removeSpecialistFavorite(specialistId).catch(()=>{}); setFavorites((prev)=>prev.filter((r)=>r.specialist?.id !== specialistId)); } if (isPending || loading) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } return /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white mb-6", children: t('favorites.specialists.title') }), favorites.length === 0 ? /*#__PURE__*/ _jsxs("div", { className: "text-center py-20 text-white/70", children: [ /*#__PURE__*/ _jsx("p", { className: "text-4xl mb-4", children: "\uD83E\uDD0D" }), /*#__PURE__*/ _jsx("p", { className: "text-lg", children: t('favorites.specialists.empty') }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: "mt-4 inline-block text-white hover:text-white/80 text-sm", children: [ t('specialists.view'), " →" ] }) ] }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: favorites.map((row)=>{ const u = row.specialist; if (!u) return null; const name = formatShortName(u.firstName, u.lastName, u.name); const initials = `${u.firstName?.[0] ?? ''}${u.lastName?.[0] ?? ''}`.toUpperCase() || u.name?.[0]?.toUpperCase() || '?'; return /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4 bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm transition", children: [ /*#__PURE__*/ _jsxs(Link, { href: `/users/${u.id}`, className: "flex items-center gap-3 flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: u.image ? /*#__PURE__*/ _jsx("img", { src: u.image, alt: name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 truncate", children: name }), u.bio && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 line-clamp-1", children: u.bio }) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>handleRemove(u.id), title: t('specialist.unfavorite'), className: "flex-shrink-0 w-8 h-8 flex items-center justify-center text-pink-400 hover:text-pink-600 hover:bg-pink-50 rounded-full transition", children: "❤️" }) ] }, row.id); }) }) ] }); } 661123undefined125168undefined170198undefined200243undefined245284undefined286330undefined332408undefined410460undefined462476undefined545554(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined578586(0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)undefined609617(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)undefined660667(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined708715(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined779787(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined936957(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getSpecialistFavorites */ .pD)undefined11401163(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .removeSpecialistFavorite */ .sD)undefined13441347(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined14981502(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined16101613(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined18141818(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined19531956(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined21242127(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23072311(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined23132316(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined26802683(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined29032917(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_7__/* .formatShortName */ .H)undefined31353139(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined33643368(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined33703373(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined36133616(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined39103913(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42654269(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined44524455(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined47414744(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined51505153(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefinedRT, /***/ 74075:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("zlib");  /***/ }) CO/***/ ((module) => { "use strict"; module.exports = require("zlib"); /***/ }) DG HIJ!module.exports = require("zlib");IK, /***/ 79428:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("buffer");  /***/ }) :Q/***/ ((module) => { "use strict"; module.exports = require("buffer"); /***/ }) ;> ?@A#module.exports = require("buffer");@B, /***/ 79551:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("url");  /***/ }) 1N/***/ ((module) => { "use strict"; module.exports = require("url"); /***/ }) 25 678 module.exports = require("url");79, /***/ 79646:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; *module.exports = require("child_process");  /***/ }) (X/***/ ((module) => { "use strict"; module.exports = require("child_process"); /***/ }) ), -./*module.exports = require("child_process");.0, /***/ 81630:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("http");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("http"); /***/ })  # $%&!module.exports = require("http");%', /***/ 83997:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("tty");  /***/ }) N/***/ ((module) => { "use strict"; module.exports = require("tty"); /***/ })   module.exports = require("tty");, /***/ 86439:  +webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");  /***/ })  z/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/no-fallback-error.external"); /***/ })  Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");, /***/ 91645:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("net");  /***/ }) N/***/ ((module) => { "use strict"; module.exports = require("net"); /***/ })      module.exports = require("net");  , /***/ 94735:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("events");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("events"); /***/ })  #module.exports = require("events");w }; ; // load runtime var __webpack_require__ = require("../../webpack-runtime.js"); __webpack_require__.C(exports); var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [901,652,809], () => (__webpack_exec__(42309))); ,module.exports = __webpack_exports__; })(); @`(() => { var exports = {}; exports.id = 40; exports.ids = [40]; exports.modules = { /***/ 261: LLL, /***/ 2843: Wimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/favorites/page.tsx"); l084Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 32351))undefinedIIIIIIII, /***/ 13459: l084Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 66681))undefinedGGGGGGGGGGGGGGGGGGGG, /***/ 32351: ,// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/favorites/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/favorites/page.tsx", "default", ); 61134undefined136150/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (undefined136150undefined151173(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined554554.5);undefinedDDDDDDDDDDD, /***/ 42309: const module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/favorites/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'favorites', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/favorites/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/favorites/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/favorites/page", pathname: "/favorites", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/favorites/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map %'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558642Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 32351))undefined645785undefined787901undefined903979undefined9811052undefined10541116undefined11181187undefined11891265undefined12671352undefined13541437undefined14391515undefined15171598undefined16001693undefined16951799undefined18011881undefined18831961undefined19632054undefined20562237undefined22392315undefined23172382undefined23842457undefined24592516undefined25182624undefined26262699undefined27012765undefined27672848undefined32633485Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined35433772Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined43324554Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined46124841Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined50285050undefined50525188undefined51905212undefined52435261__webpack_require__undefined53195325undefined54265552undefined55545639undefined56415754undefined58175823undefined58485865next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined59015909next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined61736208".next"undefined621362140undefined62416279 falseundefined62916297undefined65816601falseundefined66046668{}undefined68146853falseundefined68856898(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined69897002(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined77687783(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined81708179(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined82158230(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined83758388(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined84348460next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined86398652(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined86988707next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined87478771(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined89518970(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined91629269 falseundefined927492880undefined1158411597(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1198212009(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1379413811(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1387113879next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1393013929: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1429814327(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1445914479(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1461314621(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1492114935next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1497514990next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1521815255falseundefined1525815833{}undefined1641116424next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1751117524(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1780317816(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1853518571 trueundefined1857518594(__webpack_require__(33873).join)undefined18673187240undefined1968519698(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2153921552(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2197621997next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2343623450next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2469624713(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2500225013next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2502825032(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2513825149next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2558325594next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2566325674next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2576325774next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2630726318next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2636326377next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2702927037next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2778327804(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2933229346next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2938529396next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2989829911(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2996829989(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3056430572next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3205132065next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3341733440next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3590735920next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3621536229next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3711237135next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3740737428next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3754637567next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3779737812(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3804038051next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3808038102next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3875838773(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3898138992next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3925539268(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3971639729(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4059940620next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4149941520next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4163041651next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4220442221next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4242542448next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4334443359(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4438744402(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4461044621next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4465444676next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4539345505falseundefined4550845858{}undefined4588345898(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4684246853next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4698847003(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4761447641falseundefined4764447714{}undefined4902249036next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined4996049975(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5085050863next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5096250969next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5122551239next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5145151469(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefinedAAAAAAAAAAA, /***/ 66681: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [901,652,809], () => (__webpack_exec__(42309))); ? `webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSource`=webpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceb(() => { var exports = {}; exports.id = 407; exports.ids = [407]; exports.modules = { /***/ 261: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource 'webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Hmodule.exports = require("next/dist/shared/lib/router/utils/app-paths");  /***/ }) buffersourcesizemapshashv/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }) {"finalSource":true}mapbufferedMap ConcatSourceRawSource$/***/ ((module) => { "use strict";  RawSourceHmodule.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }), /***/ 1985:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceconst module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/payment/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'payment', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/payment/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/payment/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/payment/page", pathname: "/payment", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/payment/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map @bb{_:S.Z\FH<>_WY L N > @  _<>Ts*r 49:U{_?LJY  !!!!"5"""#'$,$_:$2-?-..55!6)6\6[677m8899;:I:q::d;;;= @@YDfD}EEYH_}HHHHILLT"TUU~[[j`{`aaaa$b/bcc1d (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); const module0 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570)); const module1 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23)); const module2 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506)); const module3 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23)); const module4 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23)); const page5 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 37660)); // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'payment', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/payment/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))).default(props))], apple: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))).default(props))], apple: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/payment/page.tsx"]; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; // Create and export the route module that will be consumed. const routeModule = new next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModule({ definition: { kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, page: "/payment/page", pathname: "/payment", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: ".next" || 0, relativeProjectDir: false || '' }); async function handler(req, res, ctx) { var _this; let srcPage = "/payment/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const initialPostponed = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)(userAgent); const isHtmlBot = (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isPrefetchRSCRequest') ?? req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isRSCRequest') ?? Boolean(req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADER]); const isPossibleServerAction = (0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = (0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = false && 0; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { (0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)(req.headers); } const ComponentMod = { ...next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__, tree, pages, GlobalError: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default()), handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { (0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: (0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequest(req); const nextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (false) {} return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: (0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: true ? (__webpack_require__(33873).join)(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : 0, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = (0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.PRERENDER && (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND) { throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.PAGES, html: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && ((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'renderFallbackShell') || isDebugFallbackShell) ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(matchedSegment, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(cachedData.rscData, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map {"finalSource":true}mapbufferedMap ConcatSourceRawSource#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); ReplaceSourceRawSourceconst module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/payment/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'payment', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/payment/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/payment/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/payment/page", pathname: "/payment", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/payment/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map %'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558640Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 37660))undefined643783undefined785899undefined901977undefined9791050undefined10521114undefined11161185undefined11871263undefined12651350undefined13521435undefined14371513undefined15151596undefined15981691undefined16931797undefined17991879undefined18811959undefined19612052undefined20542235undefined22372313undefined23152380undefined23822455undefined24572514undefined25162622undefined26242697undefined26992763undefined27652846undefined32573479Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined35373766Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined43264548Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined46064835Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined50205042undefined50445180undefined51825204undefined52355253__webpack_require__undefined53115317undefined54185544undefined55465631undefined56335746undefined58095815undefined58405857next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined58935901next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined61616196".next"undefined620162020undefined62296267 falseundefined62796285undefined65676587falseundefined65906654{}undefined68006839falseundefined68716884(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined69756988(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined77547769(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined81568165(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined82018216(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined83618374(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined84208446next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined86258638(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined86848693next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined87338757(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined89378956(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined91489255 falseundefined926092740undefined1157011583(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1196811995(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1378013797(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1385713865next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1391613915: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1428414313(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1444514465(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1459914607(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1490714921next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1496114976next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1520415241falseundefined1524415819{}undefined1639716410next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1749717510(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1778917802(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1852118557 trueundefined1856118580(__webpack_require__(33873).join)undefined18659187100undefined1967119684(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2152521538(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2196221983next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2342223436next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2468224699(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2498824999next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2501425018(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2512425135next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2556925580next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2564925660next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2574925760next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2629326304next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2634926363next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2701527023next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2776927790(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2931829332next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2937129382next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2988429897(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2995429975(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3055030558next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3203732051next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3340333426next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3589335906next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3620136215next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3709837121next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3739337414next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3753237553next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3778337798(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3802638037next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3806638088next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3874438759(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3896738978next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3924139254(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3970239715(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4058540606next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4148541506next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4161641637next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4219042207next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4241142434next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4333043345(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4437344388(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4459644607next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4464044662next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4537945491falseundefined4549445844{}undefined4586945884(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4682846839next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4697446989(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4760047627falseundefined4763047700{}undefined4900849022next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined4994649961(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5083650849next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5094850955next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5121151225next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5143751455(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefined /***/ })  _/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; #__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); ReplaceSourceRawSourceconst module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/payment/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'payment', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/payment/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/payment/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/payment/page", pathname: "/payment", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/payment/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map %'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558640Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 37660))undefined643783undefined785899undefined901977undefined9791050undefined10521114undefined11161185undefined11871263undefined12651350undefined13521435undefined14371513undefined15151596undefined15981691undefined16931797undefined17991879undefined18811959undefined19612052undefined20542235undefined22372313undefined23152380undefined23822455undefined24572514undefined25162622undefined26242697undefined26992763undefined27652846undefined32573479Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined35373766Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined43264548Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined46064835Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined50205042undefined50445180undefined51825204undefined52355253__webpack_require__undefined53115317undefined54185544undefined55465631undefined56335746undefined58095815undefined58405857next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined58935901next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined61616196".next"undefined620162020undefined62296267 falseundefined62796285undefined65676587falseundefined65906654{}undefined68006839falseundefined68716884(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined69756988(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined77547769(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined81568165(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined82018216(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined83618374(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined84208446next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined86258638(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined86848693next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined87338757(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined89378956(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined91489255 falseundefined926092740undefined1157011583(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1196811995(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1378013797(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1385713865next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1391613915: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1428414313(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1444514465(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1459914607(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1490714921next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1496114976next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1520415241falseundefined1524415819{}undefined1639716410next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1749717510(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1778917802(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1852118557 trueundefined1856118580(__webpack_require__(33873).join)undefined18659187100undefined1967119684(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2152521538(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2196221983next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2342223436next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2468224699(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2498824999next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2501425018(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2512425135next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2556925580next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2564925660next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2574925760next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2629326304next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2634926363next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2701527023next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2776927790(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2931829332next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2937129382next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2988429897(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2995429975(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3055030558next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3203732051next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3340333426next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3589335906next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3620136215next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3709837121next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3739337414next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3753237553next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3778337798(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3802638037next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3806638088next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3874438759(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3896738978next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3924139254(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3970239715(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4058540606next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4148541506next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4161641637next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4219042207next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4241142434next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4333043345(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4437344388(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4459644607next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4464044662next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4537945491falseundefined4549445844{}undefined4586945884(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4682846839next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4697446989(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4760047627falseundefined4763047700{}undefined4900849022next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined4994649961(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5083650849next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5094850955next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5121151225next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5143751455(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefined, /***/ 3295:  <webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; ]module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js"); /***/ })  ]module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");, /***/ 10846:  3webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js"); /***/ })  Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");, /***/ 19121:  8webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Ymodule.exports = require("next/dist/server/app-render/action-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/action-async-storage.external.js"); /***/ })  Ymodule.exports = require("next/dist/server/app-render/action-async-storage.external.js");, /***/ 26713:  $webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Emodule.exports = require("next/dist/shared/lib/router/utils/is-bot");  /***/ }) s/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/is-bot"); /***/ })  Emodule.exports = require("next/dist/shared/lib/router/utils/is-bot");, /***/ 27910:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("stream");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("stream"); /***/ })  #module.exports = require("stream");, /***/ 28354:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("util");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("util"); /***/ })  !module.exports = require("util");, /***/ 29021:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; module.exports = require("fs");  /***/ }) M/***/ ((module) => { "use strict"; module.exports = require("fs"); /***/ })  module.exports = require("fs");, /***/ 29294:  6webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-async-storage.external.js"); /***/ })  Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");, /***/ 33873:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("path");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("path"); /***/ })  !module.exports = require("path");, /***/ 34631:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("tls");  /***/ }) N/***/ ((module) => { "use strict"; module.exports = require("tls"); /***/ })   module.exports = require("tls");, /***/ 37660:  bwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource(// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/payment/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/payment/page.tsx", "default", ); `=G& 4@/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference));buffersourcesizemapshashT__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/payment/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/payment/page.tsx", "default", )); {"finalSource":true}mapbufferedMap ConcatSourceRawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); ReplaceSourceRawSource(// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/payment/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/payment/page.tsx", "default", ); 61134undefined136150/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (undefined136150undefined151173(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined550550.5);undefined /***/ })  __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); (// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/payment/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/payment/page.tsx", "default", ); 61134undefined136150/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (undefined136150undefined151173(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined550550.5);undefined, /***/ 41025:  @webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; amodule.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js"); /***/ })  amodule.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js");, /***/ 49206:  .Twebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource z'webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PaymentPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(96484); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; import { useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; // Status is determined either by: // 1. ?status=cancelled (from our cancel redirect) // 2. ?ref=ORDER_REF → we poll /payments/history to check the order status export default function PaymentPage() { const searchParams = useSearchParams(); const { t } = useLocale(); const statusParam = searchParams.get('status'); const ref = searchParams.get('ref'); const [status, setStatus] = useState(statusParam === 'cancelled' ? 'cancelled' : ref ? 'loading' : 'pending'); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (statusParam === 'cancelled') { setStatus('cancelled'); return; } if (!ref) return; // Poll payment history to find the order status let attempts = 0; const MAX = 12 // ~24 seconds total ; const INTERVAL = 2000; const check = async ()=>{ attempts++; try { const history = await api.getPaymentHistory(); const payment = history.find((p)=>p.orderRef === ref); if (payment && payment.status !== 'pending') { setStatus(payment.status); return; } } catch {} if (attempts < MAX) { setTimeout(check, INTERVAL); } else { setStatus('pending'); // timeout - show pending message } }; setTimeout(check, INTERVAL); }, [ ref, statusParam ]); const config = { success: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-green-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), title: t('payment.success.title'), desc: t('payment.success.desc'), color: 'text-green-700', bg: 'bg-green-50', border: 'border-green-200' }, cancelled: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-yellow-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z" }) }), title: t('payment.cancelled.title'), desc: t('payment.cancelled.desc'), color: 'text-yellow-700', bg: 'bg-yellow-50', border: 'border-yellow-200' }, failed: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-red-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" }) }), title: t('payment.cancelled.title'), desc: t('payment.cancelled.desc'), color: 'text-red-700', bg: 'bg-red-50', border: 'border-red-200' }, pending: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z" }) }), title: t('payment.pending.title'), desc: t('payment.pending.desc'), color: 'text-green-700', bg: 'bg-green-50', border: 'border-green-200' }, loading: { icon: /*#__PURE__*/ _jsxs("svg", { className: "w-16 h-16 text-gray-400 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), title: t('payment.pending.title'), desc: t('payment.pending.desc'), color: 'text-gray-700', bg: 'bg-gray-50', border: 'border-gray-200' } }; const current = config[status] ?? config.pending; return /*#__PURE__*/ _jsx("div", { className: "min-h-screen bg-gray-50 flex items-center justify-center p-4", children: /*#__PURE__*/ _jsxs("div", { className: `bg-white rounded-2xl border ${current.border} shadow-sm p-10 max-w-sm w-full text-center`, children: [ /*#__PURE__*/ _jsx("div", { className: "flex justify-center mb-5", children: current.icon }), /*#__PURE__*/ _jsx("h1", { className: `text-2xl font-bold mb-2 ${current.color}`, children: current.title }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-8", children: current.desc }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: "inline-flex items-center gap-2 px-6 py-3 bg-green-600 hover:bg-green-700 text-white font-semibold rounded-xl transition-colors text-sm", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 19l-7-7m0 0l7-7m-7 7h18" }) }), t('payment.back_to_profile') ] }) ] }) }); } c ={}_')I-;RZfn+q t m p e h ^\a[^qt'* #(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPaymentHistory */ .pK(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(next_link__WEBPACK_IMPORTED_MODULE_3___default())buffersourcesizemapshashConcatSourceRawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PaymentPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(96484); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); ReplaceSourceRawSource/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; import { useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; // Status is determined either by: // 1. ?status=cancelled (from our cancel redirect) // 2. ?ref=ORDER_REF → we poll /payments/history to check the order status export default function PaymentPage() { const searchParams = useSearchParams(); const { t } = useLocale(); const statusParam = searchParams.get('status'); const ref = searchParams.get('ref'); const [status, setStatus] = useState(statusParam === 'cancelled' ? 'cancelled' : ref ? 'loading' : 'pending'); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (statusParam === 'cancelled') { setStatus('cancelled'); return; } if (!ref) return; // Poll payment history to find the order status let attempts = 0; const MAX = 12 // ~24 seconds total ; const INTERVAL = 2000; const check = async ()=>{ attempts++; try { const history = await api.getPaymentHistory(); const payment = history.find((p)=>p.orderRef === ref); if (payment && payment.status !== 'pending') { setStatus(payment.status); return; } } catch {} if (attempts < MAX) { setTimeout(check, INTERVAL); } else { setStatus('pending'); // timeout - show pending message } }; setTimeout(check, INTERVAL); }, [ ref, statusParam ]); const config = { success: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-green-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), title: t('payment.success.title'), desc: t('payment.success.desc'), color: 'text-green-700', bg: 'bg-green-50', border: 'border-green-200' }, cancelled: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-yellow-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z" }) }), title: t('payment.cancelled.title'), desc: t('payment.cancelled.desc'), color: 'text-yellow-700', bg: 'bg-yellow-50', border: 'border-yellow-200' }, failed: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-red-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" }) }), title: t('payment.cancelled.title'), desc: t('payment.cancelled.desc'), color: 'text-red-700', bg: 'bg-red-50', border: 'border-red-200' }, pending: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z" }) }), title: t('payment.pending.title'), desc: t('payment.pending.desc'), color: 'text-green-700', bg: 'bg-green-50', border: 'border-green-200' }, loading: { icon: /*#__PURE__*/ _jsxs("svg", { className: "w-16 h-16 text-gray-400 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), title: t('payment.pending.title'), desc: t('payment.pending.desc'), color: 'text-gray-700', bg: 'bg-gray-50', border: 'border-gray-200' } }; const current = config[status] ?? config.pending; return /*#__PURE__*/ _jsx("div", { className: "min-h-screen bg-gray-50 flex items-center justify-center p-4", children: /*#__PURE__*/ _jsxs("div", { className: `bg-white rounded-2xl border ${current.border} shadow-sm p-10 max-w-sm w-full text-center`, children: [ /*#__PURE__*/ _jsx("div", { className: "flex justify-center mb-5", children: current.icon }), /*#__PURE__*/ _jsx("h1", { className: `text-2xl font-bold mb-2 ${current.color}`, children: current.title }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-8", children: current.desc }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: "inline-flex items-center gap-2 px-6 py-3 bg-green-600 hover:bg-green-700 text-white font-semibold rounded-xl transition-colors text-sm", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 19l-7-7m0 0l7-7m-7 7h18" }) }), t('payment.back_to_profile') ] }) ] }) }); } c61123undefined125168undefined170219undefined221249undefined251295undefined297329undefined492506undefined557571(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)undefined594602(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined732739(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined870878(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined13031323_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPaymentHistory */ .pKundefined19351938(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined21862189(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined26732676(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined29252928(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34293432(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined36783681(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42784281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined45284531(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49995003(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined52115214(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined55255528(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined60346037(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined61636167(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined63476350(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined65136516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined66956698(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined68616865(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined68676870(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined71527155(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined74567459(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) w ~~__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PaymentPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(96484); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); /* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; import { useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; // Status is determined either by: // 1. ?status=cancelled (from our cancel redirect) // 2. ?ref=ORDER_REF → we poll /payments/history to check the order status export default function PaymentPage() { const searchParams = useSearchParams(); const { t } = useLocale(); const statusParam = searchParams.get('status'); const ref = searchParams.get('ref'); const [status, setStatus] = useState(statusParam === 'cancelled' ? 'cancelled' : ref ? 'loading' : 'pending'); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (statusParam === 'cancelled') { setStatus('cancelled'); return; } if (!ref) return; // Poll payment history to find the order status let attempts = 0; const MAX = 12 // ~24 seconds total ; const INTERVAL = 2000; const check = async ()=>{ attempts++; try { const history = await api.getPaymentHistory(); const payment = history.find((p)=>p.orderRef === ref); if (payment && payment.status !== 'pending') { setStatus(payment.status); return; } } catch {} if (attempts < MAX) { setTimeout(check, INTERVAL); } else { setStatus('pending'); // timeout - show pending message } }; setTimeout(check, INTERVAL); }, [ ref, statusParam ]); const config = { success: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-green-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), title: t('payment.success.title'), desc: t('payment.success.desc'), color: 'text-green-700', bg: 'bg-green-50', border: 'border-green-200' }, cancelled: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-yellow-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z" }) }), title: t('payment.cancelled.title'), desc: t('payment.cancelled.desc'), color: 'text-yellow-700', bg: 'bg-yellow-50', border: 'border-yellow-200' }, failed: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-red-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" }) }), title: t('payment.cancelled.title'), desc: t('payment.cancelled.desc'), color: 'text-red-700', bg: 'bg-red-50', border: 'border-red-200' }, pending: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z" }) }), title: t('payment.pending.title'), desc: t('payment.pending.desc'), color: 'text-green-700', bg: 'bg-green-50', border: 'border-green-200' }, loading: { icon: /*#__PURE__*/ _jsxs("svg", { className: "w-16 h-16 text-gray-400 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), title: t('payment.pending.title'), desc: t('payment.pending.desc'), color: 'text-gray-700', bg: 'bg-gray-50', border: 'border-gray-200' } }; const current = config[status] ?? config.pending; return /*#__PURE__*/ _jsx("div", { className: "min-h-screen bg-gray-50 flex items-center justify-center p-4", children: /*#__PURE__*/ _jsxs("div", { className: `bg-white rounded-2xl border ${current.border} shadow-sm p-10 max-w-sm w-full text-center`, children: [ /*#__PURE__*/ _jsx("div", { className: "flex justify-center mb-5", children: current.icon }), /*#__PURE__*/ _jsx("h1", { className: `text-2xl font-bold mb-2 ${current.color}`, children: current.title }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-8", children: current.desc }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: "inline-flex items-center gap-2 px-6 py-3 bg-green-600 hover:bg-green-700 text-white font-semibold rounded-xl transition-colors text-sm", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 19l-7-7m0 0l7-7m-7 7h18" }) }), t('payment.back_to_profile') ] }) ] }) }); } c61123undefined125168undefined170219undefined221249undefined251295undefined297329undefined492506undefined557571(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)undefined594602(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined732739(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined870878(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined13031323_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPaymentHistory */ .pKundefined19351938(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined21862189(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined26732676(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined29252928(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34293432(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined36783681(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42784281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined45284531(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49995003(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined52115214(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined55255528(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined60346037(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined61636167(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined63476350(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined65136516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined66956698(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined68616865(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined68676870(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined71527155(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined74567459(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined}, /***/ 55511:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("crypto");  /***/ }) nQ/***/ ((module) => { "use strict"; module.exports = require("crypto"); /***/ }) or stu#module.exports = require("crypto");tv, /***/ 55591:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; "module.exports = require("https");  /***/ }) eP/***/ ((module) => { "use strict"; module.exports = require("https"); /***/ }) fi jkl"module.exports = require("https");km, /***/ 56980:  ^webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Wwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceUimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/payment/page.tsx"); `RPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 37660))buffersourcesizemapshashbPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 37660)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceUimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/payment/page.tsx"); l082Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 37660))undefined /***/ }) \cV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { oUimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/payment/page.tsx"); l082Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 37660))undefinedbd, /***/ 59188:  ^webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Wwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceUimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/payment/page.tsx"); `RPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 49206))buffersourcesizemapshashbPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 49206)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceUimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/payment/page.tsx"); l082Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 49206))undefined /***/ }) SZgl082Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 49206))undefined[], /***/ 63033:  ;webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; \module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");  /***/ }) L/***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js"); /***/ }) MP QRS\module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");RT, /***/ 74075:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("zlib");  /***/ }) CO/***/ ((module) => { "use strict"; module.exports = require("zlib"); /***/ }) DG HIJ!module.exports = require("zlib");IK, /***/ 79428:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("buffer");  /***/ }) :Q/***/ ((module) => { "use strict"; module.exports = require("buffer"); /***/ }) ;> ?@A#module.exports = require("buffer");@B, /***/ 79551:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("url");  /***/ }) 1N/***/ ((module) => { "use strict"; module.exports = require("url"); /***/ }) 25 678 module.exports = require("url");79, /***/ 79646:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; *module.exports = require("child_process");  /***/ }) (X/***/ ((module) => { "use strict"; module.exports = require("child_process"); /***/ }) ), -./*module.exports = require("child_process");.0, /***/ 81630:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("http");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("http"); /***/ })  # $%&!module.exports = require("http");%', /***/ 83997:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("tty");  /***/ }) N/***/ ((module) => { "use strict"; module.exports = require("tty"); /***/ })   module.exports = require("tty");, /***/ 86439:  +webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");  /***/ })  z/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/no-fallback-error.external"); /***/ })  Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");, /***/ 91645:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("net");  /***/ }) N/***/ ((module) => { "use strict"; module.exports = require("net"); /***/ })      module.exports = require("net");  , /***/ 94735:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("events");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("events"); /***/ })  #module.exports = require("events");w }; ; // load runtime var __webpack_require__ = require("../../webpack-runtime.js"); __webpack_require__.C(exports); var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [901,652,809], () => (__webpack_exec__(1985))); ,module.exports = __webpack_exports__; })(); }@b(() => { var exports = {}; exports.id = 407; exports.ids = [407]; exports.modules = { /***/ 261: :::, /***/ 1985: const module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/payment/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'payment', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/payment/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/payment/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/payment/page", pathname: "/payment", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/payment/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map %'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558640Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 37660))undefined643783undefined785899undefined901977undefined9791050undefined10521114undefined11161185undefined11871263undefined12651350undefined13521435undefined14371513undefined15151596undefined15981691undefined16931797undefined17991879undefined18811959undefined19612052undefined20542235undefined22372313undefined23152380undefined23822455undefined24572514undefined25162622undefined26242697undefined26992763undefined27652846undefined32573479Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined35373766Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined43264548Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined46064835Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined50205042undefined50445180undefined51825204undefined52355253__webpack_require__undefined53115317undefined54185544undefined55465631undefined56335746undefined58095815undefined58405857next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined58935901next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined61616196".next"undefined620162020undefined62296267 falseundefined62796285undefined65676587falseundefined65906654{}undefined68006839falseundefined68716884(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined69756988(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined77547769(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined81568165(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined82018216(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined83618374(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined84208446next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined86258638(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined86848693next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined87338757(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined89378956(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined91489255 falseundefined926092740undefined1157011583(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1196811995(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1378013797(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1385713865next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1391613915: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1428414313(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1444514465(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1459914607(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1490714921next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1496114976next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1520415241falseundefined1524415819{}undefined1639716410next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1749717510(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1778917802(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1852118557 trueundefined1856118580(__webpack_require__(33873).join)undefined18659187100undefined1967119684(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2152521538(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2196221983next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2342223436next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2468224699(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2498824999next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2501425018(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2512425135next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2556925580next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2564925660next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2574925760next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2629326304next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2634926363next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2701527023next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2776927790(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2931829332next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2937129382next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2988429897(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2995429975(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3055030558next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3203732051next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3340333426next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3589335906next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3620136215next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3709837121next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3739337414next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3753237553next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3778337798(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3802638037next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3806638088next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3874438759(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3896738978next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3924139254(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3970239715(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4058540606next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4148541506next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4161641637next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4219042207next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4241142434next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4333043345(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4437344388(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4459644607next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4464044662next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4537945491falseundefined4549445844{}undefined4586945884(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4682846839next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4697446989(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4760047627falseundefined4763047700{}undefined4900849022next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined4994649961(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5083650849next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5094850955next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5121151225next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5143751455(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefined77777777777777777777777777777777, /***/ 37660: (// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/payment/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/payment/page.tsx", "default", ); 61134undefined136150/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (undefined136150undefined151173(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined550550.5);undefined44}444, /***/ 49206: ||~33|333|333, /***/ 56980: {}Uimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/payment/page.tsx"); l082Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 37660))undefined00, /***/ 59188: xzl082Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 49206))undefined..w...w...w...w...w...w...w...w...w...w....var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [901,652,809], () => (__webpack_exec__(1985))); - Lwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSource`=webpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceb(() => { var exports = {}; exports.id = 826; exports.ids = [826]; exports.modules = { /***/ 261: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource 'webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Hmodule.exports = require("next/dist/shared/lib/router/utils/app-paths");  /***/ }) buffersourcesizemapshashv/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }) {"finalSource":true}mapbufferedMap ConcatSourceRawSource$/***/ ((module) => { "use strict";  RawSourceHmodule.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }), /***/ 3295:  <webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; ]module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js"); /***/ })  ]module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");, /***/ 10846:  3webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js"); /***/ })  Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");, /***/ 19121:  8webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Ymodule.exports = require("next/dist/server/app-render/action-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/action-async-storage.external.js"); /***/ })  Ymodule.exports = require("next/dist/server/app-render/action-async-storage.external.js");, /***/ 26713:  $webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Emodule.exports = require("next/dist/shared/lib/router/utils/is-bot");  /***/ }) s/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/is-bot"); /***/ })  Emodule.exports = require("next/dist/shared/lib/router/utils/is-bot");, /***/ 27811:  `webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Xwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceVimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/schedule/page.tsx"); `SPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 88431))buffersourcesizemapshashbPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 88431)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceVimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/schedule/page.tsx"); l083Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 88431))undefined /***/ }) V/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { ReplaceSourceRawSourceVimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/schedule/page.tsx"); l083Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 88431))undefined, /***/ 27910:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("stream");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("stream"); /***/ })  #module.exports = require("stream");, /***/ 28354:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("util");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("util"); /***/ })  !module.exports = require("util");, /***/ 28491:  `webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Xwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceVimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/schedule/page.tsx"); `SPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 53749))buffersourcesizemapshashbPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 53749)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceVimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/schedule/page.tsx"); l083Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 53749))undefined /***/ }) l083Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 53749))undefined, /***/ 29021:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; module.exports = require("fs");  /***/ }) M/***/ ((module) => { "use strict"; module.exports = require("fs"); /***/ })  module.exports = require("fs");, /***/ 29294:  6webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-async-storage.external.js"); /***/ })  Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");, /***/ 33873:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("path");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("path"); /***/ })  !module.exports = require("path");, /***/ 34631:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("tls");  /***/ }) N/***/ ((module) => { "use strict"; module.exports = require("tls"); /***/ })   module.exports = require("tls");, /***/ 41025:  @webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; amodule.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js"); /***/ })  amodule.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js");, /***/ 53749:  hwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource*// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/schedule/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/schedule/page.tsx", "default", ); `=G( D@/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference));buffersourcesizemapshashV__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/schedule/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/schedule/page.tsx", "default", )); {"finalSource":true}mapbufferedMap ConcatSourceRawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); ReplaceSourceRawSource*// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/schedule/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/schedule/page.tsx", "default", ); 61134undefined136150/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (undefined136150undefined151173(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined552552.5);undefined /***/ }) z _/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); *// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/schedule/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/schedule/page.tsx", "default", ); 61134undefined136150/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (undefined136150undefined151173(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined552552.5);undefined, /***/ 55511:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("crypto");  /***/ }) pQ/***/ ((module) => { "use strict"; module.exports = require("crypto"); /***/ }) qt uvw#module.exports = require("crypto");vx, /***/ 55591:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; "module.exports = require("https");  /***/ }) gP/***/ ((module) => { "use strict"; module.exports = require("https"); /***/ }) hk lmn"module.exports = require("https");mo, /***/ 63033:  ;webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; \module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");  /***/ }) ^/***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js"); /***/ }) _b cde\module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");df, /***/ 63449:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceconst module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/schedule/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'schedule', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/schedule/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/schedule/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/schedule/page", pathname: "/schedule", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/schedule/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map @bb{_:S.[]GI=?_XZ M O ? A  _@BXw.v :?@[_FSQ`  !!!!!$"<""##.$3$_A$9-F-..55(606c6b677t8899B:P:x::k;;;=@!@`DmDEE`H_HHHHILLT)TUU[[q``aaaa+b6bcc8dCdddfffgi_illrrrrtt uu]wew,}:}<Ip~-_ϔ_n>IP]*)դɥIX\k;Fg}J4TC[w!0  Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 53749))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))__webpack_require__next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModulenext_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind".next"0 falsefalse{}(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERnext_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADER(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)0(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestnext_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponsenext_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T) true(__webpack_require__(33873).join)0next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERnext_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERnext_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARnext_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERnext_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodenext_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSnext_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKind(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)buffersourcesizemapshash__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); const module0 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570)); const module1 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23)); const module2 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506)); const module3 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23)); const module4 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23)); const page5 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 53749)); // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'schedule', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/schedule/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))).default(props))], apple: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))).default(props))], apple: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/schedule/page.tsx"]; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; // Create and export the route module that will be consumed. const routeModule = new next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModule({ definition: { kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, page: "/schedule/page", pathname: "/schedule", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: ".next" || 0, relativeProjectDir: false || '' }); async function handler(req, res, ctx) { var _this; let srcPage = "/schedule/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const initialPostponed = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)(userAgent); const isHtmlBot = (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isPrefetchRSCRequest') ?? req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isRSCRequest') ?? Boolean(req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADER]); const isPossibleServerAction = (0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = (0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = false && 0; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { (0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)(req.headers); } const ComponentMod = { ...next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__, tree, pages, GlobalError: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default()), handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { (0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: (0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequest(req); const nextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (false) {} return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: (0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: true ? (__webpack_require__(33873).join)(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : 0, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = (0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.PRERENDER && (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND) { throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.PAGES, html: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && ((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'renderFallbackShell') || isDebugFallbackShell) ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(matchedSegment, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(cachedData.rscData, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map {"finalSource":true}mapbufferedMap ConcatSourceRawSource#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); ReplaceSourceRawSourceconst module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/schedule/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'schedule', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/schedule/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/schedule/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/schedule/page", pathname: "/schedule", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/schedule/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map %'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558641Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 53749))undefined644784undefined786900undefined902978undefined9801051undefined10531115undefined11171186undefined11881264undefined12661351undefined13531436undefined14381514undefined15161597undefined15991692undefined16941798undefined18001880undefined18821960undefined19622053undefined20552236undefined22382314undefined23162381undefined23832456undefined24582515undefined25172623undefined26252698undefined27002764undefined27662847undefined32603482Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined35403769Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined43294551Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined46094838Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined50245046undefined50485184undefined51865208undefined52395257__webpack_require__undefined53155321undefined54225548undefined55505635undefined56375750undefined58135819undefined58445861next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined58975905next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined61676202".next"undefined620762080undefined62356273 falseundefined62856291undefined65746594falseundefined65976661{}undefined68076846falseundefined68786891(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined69826995(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined77617776(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined81638172(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined82088223(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined83688381(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined84278453next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined86328645(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined86918700next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined87408764(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined89448963(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined91559262 falseundefined926792810undefined1157711590(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1197512002(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1378713804(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1386413872next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1392313922: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1429114320(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1445214472(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1460614614(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1491414928next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1496814983next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1521115248falseundefined1525115826{}undefined1640416417next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1750417517(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1779617809(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1852818564 trueundefined1856818587(__webpack_require__(33873).join)undefined18666187170undefined1967819691(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2153221545(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2196921990next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2342923443next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2468924706(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2499525006next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2502125025(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2513125142next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2557625587next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2565625667next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2575625767next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2630026311next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2635626370next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2702227030next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2777627797(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2932529339next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2937829389next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2989129904(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2996129982(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3055730565next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3204432058next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3341033433next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3590035913next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3620836222next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3710537128next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3740037421next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3753937560next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3779037805(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3803338044next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3807338095next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3875138766(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3897438985next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3924839261(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3970939722(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4059240613next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4149241513next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4162341644next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4219742214next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4241842441next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4333743352(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4438044395(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4460344614next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4464744669next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4538645498falseundefined4550145851{}undefined4587645891(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4683546846next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4698146996(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4760747634falseundefined4763747707{}undefined4901549029next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined4995349968(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5084350856next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5095550962next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5121851232next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5144451462(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefined /***/ }) U \\#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); const module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/schedule/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'schedule', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/schedule/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/schedule/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/schedule/page", pathname: "/schedule", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/schedule/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map %'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558641Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 53749))undefined644784undefined786900undefined902978undefined9801051undefined10531115undefined11171186undefined11881264undefined12661351undefined13531436undefined14381514undefined15161597undefined15991692undefined16941798undefined18001880undefined18821960undefined19622053undefined20552236undefined22382314undefined23162381undefined23832456undefined24582515undefined25172623undefined26252698undefined27002764undefined27662847undefined32603482Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined35403769Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined43294551Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined46094838Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined50245046undefined50485184undefined51865208undefined52395257__webpack_require__undefined53155321undefined54225548undefined55505635undefined56375750undefined58135819undefined58445861next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined58975905next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined61676202".next"undefined620762080undefined62356273 falseundefined62856291undefined65746594falseundefined65976661{}undefined68076846falseundefined68786891(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined69826995(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined77617776(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined81638172(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined82088223(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined83688381(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined84278453next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined86328645(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined86918700next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined87408764(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined89448963(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined91559262 falseundefined926792810undefined1157711590(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1197512002(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1378713804(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1386413872next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1392313922: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1429114320(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1445214472(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1460614614(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1491414928next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1496814983next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1521115248falseundefined1525115826{}undefined1640416417next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1750417517(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1779617809(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1852818564 trueundefined1856818587(__webpack_require__(33873).join)undefined18666187170undefined1967819691(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2153221545(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2196921990next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2342923443next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2468924706(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2499525006next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2502125025(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2513125142next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2557625587next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2565625667next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2575625767next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2630026311next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2635626370next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2702227030next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2777627797(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2932529339next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2937829389next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2989129904(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2996129982(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3055730565next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3204432058next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3341033433next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3590035913next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3620836222next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3710537128next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3740037421next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3753937560next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3779037805(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3803338044next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3807338095next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3875138766(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3897438985next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3924839261(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3970939722(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4059240613next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4149241513next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4162341644next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4219742214next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4241842441next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4333743352(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4438044395(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4460344614next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4464744669next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4538645498falseundefined4550145851{}undefined4587645891(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4683546846next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4698146996(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4760747634falseundefined4763747707{}undefined4901549029next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined4995349968(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5084350856next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5095550962next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5121851232next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5144451462(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefined[], /***/ 74075:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("zlib");  /***/ }) LO/***/ ((module) => { "use strict"; module.exports = require("zlib"); /***/ }) MP QRS!module.exports = require("zlib");RT, /***/ 79428:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("buffer");  /***/ }) CQ/***/ ((module) => { "use strict"; module.exports = require("buffer"); /***/ }) DG HIJ#module.exports = require("buffer");IK, /***/ 79551:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("url");  /***/ }) :N/***/ ((module) => { "use strict"; module.exports = require("url"); /***/ }) ;> ?@A module.exports = require("url");@B, /***/ 79646:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; *module.exports = require("child_process");  /***/ }) 1X/***/ ((module) => { "use strict"; module.exports = require("child_process"); /***/ }) 25 678*module.exports = require("child_process");79, /***/ 81630:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("http");  /***/ }) (O/***/ ((module) => { "use strict"; module.exports = require("http"); /***/ }) ), -./!module.exports = require("http");.0, /***/ 83997:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("tty");  /***/ }) N/***/ ((module) => { "use strict"; module.exports = require("tty"); /***/ })  # $%& module.exports = require("tty");%', /***/ 86439:  +webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");  /***/ }) z/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/no-fallback-error.external"); /***/ })  Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");, /***/ 88431:  -webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource ΋webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceC__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SchedulePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13260); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(96484); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource~/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect, useCallback } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getMyAvailability, setAvailability, setAvailabilityRange, request } from '@/lib/api'; const STATUS_CYCLE = { available: 'busy', busy: null }; const WEEK_DAYS_BY_LOCALE = { ru: [ 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс' ], en: [ 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su' ], el: [ 'Δε', 'Τρ', 'Τε', 'Πε', 'Πα', 'Σά', 'Κυ' ] }; const MONTHS_BY_LOCALE = { ru: [ 'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь' ], en: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], el: [ 'Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος' ] }; function toMonthKey(year, month) { return `${year}-${String(month + 1).padStart(2, '0')}`; } function toDateKey(year, month, day) { return `${year}-${String(month + 1).padStart(2, '0')}-${String(day).padStart(2, '0')}`; } export default function SchedulePage() { const { data: session, isPending } = useSession(); const router = useRouter(); const searchParams = useSearchParams(); const { locale, t } = useLocale(); const now = new Date(); const [viewYear, setViewYear] = useState(now.getFullYear()); const [viewMonth, setViewMonth] = useState(now.getMonth()); // availability map: 'YYYY-MM-DD' → 'available'|'busy' const [avail, setAvail] = useState({}); const [saving, setSaving] = useState(null) // date being saved ; // Range selection state const [rangeStart, setRangeStart] = useState(null); const [rangeMode, setRangeMode] = useState(false); const [rangeStatus, setRangeStatus] = useState('available'); // Google Calendar state const [gcalStatus, setGcalStatus] = useState(null); const [gcalLoading, setGcalLoading] = useState(false); const [gcalToast, setGcalToast] = useState(null); const today = new Date().toISOString().slice(0, 10); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isPending && !session) router.push('/login'); if (!isPending && session && session.user?.role !== 'specialist' && session.user?.role !== 'admin') router.push('/profile'); }, [ session, isPending ]); // Load Google Calendar status const loadGcalStatus = useCallback(()=>{ request('/google/calendar/status').then(setGcalStatus).catch(()=>setGcalStatus({ connected: false })); }, []); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!session) return; loadGcalStatus(); // Handle callback redirect params const gcalParam = searchParams.get('gcal'); if (gcalParam === 'connected') { setGcalToast(t('schedule.gcalConnected')); setTimeout(()=>setGcalToast(null), 5000); router.replace('/schedule'); } else if (gcalParam === 'error') { setGcalToast(t('schedule.gcalError')); setTimeout(()=>setGcalToast(null), 5000); router.replace('/schedule'); } }, [ session ]); const loadMonth = useCallback((year, month)=>{ const key = toMonthKey(year, month); getMyAvailability(key).then((rows)=>{ setAvail((prev)=>{ const next = { ...prev }; rows.forEach((r)=>{ next[r.date] = r.status; }); return next; }); }).catch(()=>{}); }, []); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!session) return; loadMonth(viewYear, viewMonth); // preload next month too const next = new Date(viewYear, viewMonth + 1, 1); loadMonth(next.getFullYear(), next.getMonth()); }, [ session, viewYear, viewMonth, loadMonth ]); function prevMonth() { if (viewMonth === 0) { setViewYear((y)=>y - 1); setViewMonth(11); } else setViewMonth((m)=>m - 1); } function nextMonth() { if (viewMonth === 11) { setViewYear((y)=>y + 1); setViewMonth(0); } else setViewMonth((m)=>m + 1); } async function toggleDay(dateKey) { if (dateKey < today) return; // past — ignore if (rangeMode) { if (!rangeStart) { setRangeStart(dateKey); return; } // Second click — apply range const from = rangeStart < dateKey ? rangeStart : dateKey; const to = rangeStart < dateKey ? dateKey : rangeStart; setRangeStart(null); setSaving('range'); try { await setAvailabilityRange(from, to, rangeStatus); // Update local state setAvail((prev)=>{ const next = { ...prev }; const cur = new Date(from); const end = new Date(to); while(cur <= end){ const d = cur.toISOString().slice(0, 10); if (d >= today) next[d] = rangeStatus; cur.setDate(cur.getDate() + 1); } return next; }); } catch {} setSaving(null); return; } const current = avail[dateKey] ?? null; const next = current === null ? 'available' : STATUS_CYCLE[current]; setSaving(dateKey); // Optimistic setAvail((prev)=>({ ...prev, [dateKey]: next })); try { await setAvailability(dateKey, next); } catch { // Revert on error setAvail((prev)=>({ ...prev, [dateKey]: current })); } setSaving(null); } if (isPending) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-gray-500", children: t('common.loading') }); const role = session?.user?.role; if (!session || role !== 'specialist' && role !== 'admin') return null; const apiBase = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; async function connectGcal() { window.location.href = `${apiBase}/api/google/calendar/connect`; } async function disconnectGcal() { if (!confirm(t('schedule.gcalDisconnectConfirm'))) return; setGcalLoading(true); try { await request('/google/calendar/disconnect', { method: 'DELETE' }); setGcalStatus({ connected: false }); } catch {} setGcalLoading(false); } async function importFromGcal() { setGcalLoading(true); try { const res = await request('/google/calendar/import', { method: 'POST' }); setGcalToast(t('schedule.gcalImportDone').replace('{n}', String(res.imported ?? 0))); setTimeout(()=>setGcalToast(null), 5000); // Refresh calendar display loadMonth(viewYear, viewMonth); } catch {} setGcalLoading(false); } return /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ gcalToast && /*#__PURE__*/ _jsx("div", { className: "fixed top-4 right-4 z-50 bg-white border border-gray-200 shadow-lg rounded-xl px-4 py-3 text-sm text-gray-800 max-w-xs", children: gcalToast }), /*#__PURE__*/ _jsxs("div", { className: "mb-8", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white", children: t('schedule.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-white/70 mt-1", children: t('schedule.subtitle') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-4 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-emerald-100 border-2 border-emerald-400 flex items-center justify-center text-xs", children: "✓" }), t('schedule.available') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-red-100 border-2 border-red-400 flex items-center justify-center text-xs", children: "✗" }), t('schedule.busy') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-white/20 border border-white/30" }), t('schedule.unset') ] }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-white/50 self-center", children: t('schedule.click_hint') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6 p-3 bg-white rounded-xl border border-gray-200", children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ _jsx("div", { onClick: ()=>{ setRangeMode((v)=>!v); setRangeStart(null); }, className: `w-10 h-6 rounded-full transition-colors relative cursor-pointer ${rangeMode ? 'bg-green-500' : 'bg-gray-200'}`, children: /*#__PURE__*/ _jsx("span", { className: `absolute top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ${rangeMode ? 'translate-x-5' : 'translate-x-1'}` }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-700", children: t('schedule.range_mode') }) ] }), rangeMode && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 ml-4", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>setRangeStatus('available'), className: `px-3 py-1 rounded-lg text-sm font-medium border transition ${rangeStatus === 'available' ? 'bg-emerald-100 border-emerald-400 text-emerald-700' : 'bg-white border-gray-200 text-gray-500'}`, children: t('schedule.available') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setRangeStatus('busy'), className: `px-3 py-1 rounded-lg text-sm font-medium border transition ${rangeStatus === 'busy' ? 'bg-red-100 border-red-400 text-red-700' : 'bg-white border-gray-200 text-gray-500'}`, children: t('schedule.busy') }), rangeStart && /*#__PURE__*/ _jsx("span", { className: "text-xs text-green-600", children: t('schedule.range_from').replace('{date}', rangeStart) }) ] }) ] }), /*#__PURE__*/ _jsx(AvailCalendar, { year: viewYear, month: viewMonth, avail: avail, saving: saving, rangeStart: rangeStart, today: today, onToggle: toggleDay, onPrev: prevMonth, onNext: nextMonth }), /*#__PURE__*/ _jsxs("div", { className: "mt-6 bg-white rounded-2xl border border-gray-200 p-5 shadow-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-4", children: [ /*#__PURE__*/ _jsxs("svg", { width: "22", height: "22", viewBox: "0 0 48 48", fill: "none", children: [ /*#__PURE__*/ _jsx("rect", { width: "48", height: "48", rx: "8", fill: "#fff" }), /*#__PURE__*/ _jsx("path", { d: "M34 14H14a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V16a2 2 0 0 0-2-2z", fill: "#4285F4" }), /*#__PURE__*/ _jsx("path", { d: "M28 20h-8v2h8v-2zm0 4h-8v2h8v-2zm-2 4h-6v2h6v-2z", fill: "#fff" }), /*#__PURE__*/ _jsx("circle", { cx: "18", cy: "18", r: "2", fill: "#DB4437" }), /*#__PURE__*/ _jsx("circle", { cx: "30", cy: "18", r: "2", fill: "#DB4437" }), /*#__PURE__*/ _jsx("rect", { x: "17", y: "12", width: "2", height: "6", rx: "1", fill: "#DB4437" }), /*#__PURE__*/ _jsx("rect", { x: "29", y: "12", width: "2", height: "6", rx: "1", fill: "#DB4437" }) ] }), /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 text-sm", children: t('schedule.googleCalendar') }) ] }), gcalStatus === null ? /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('common.loading') }) : gcalStatus.connected ? /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [ /*#__PURE__*/ _jsx("circle", { cx: "8", cy: "8", r: "8", fill: "#22c55e" }), /*#__PURE__*/ _jsx("path", { d: "M5 8l2 2 4-4", stroke: "#fff", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }), /*#__PURE__*/ _jsxs("span", { className: "text-sm text-gray-700", children: [ t('schedule.connectedAs'), " ", /*#__PURE__*/ _jsx("span", { className: "font-medium", children: gcalStatus.email }) ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('schedule.gcalAutoSyncNote') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: importFromGcal, disabled: gcalLoading, className: "px-3 py-1.5 rounded-lg border border-green-200 bg-green-50 text-green-700 text-xs font-medium hover:bg-green-100 disabled:opacity-50 transition", children: gcalLoading ? t('common.loading') : t('schedule.importFromGoogle') }), /*#__PURE__*/ _jsx("button", { onClick: disconnectGcal, disabled: gcalLoading, className: "px-3 py-1.5 rounded-lg border border-gray-200 bg-white text-gray-500 text-xs font-medium hover:bg-gray-50 disabled:opacity-50 transition", children: t('schedule.disconnectGoogle') }) ] }) ] }) : /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('schedule.gcalConnectDesc') }), /*#__PURE__*/ _jsxs("button", { onClick: connectGcal, className: "flex items-center gap-2 px-4 py-2 rounded-xl border border-gray-200 bg-white hover:bg-gray-50 transition text-sm font-medium text-gray-700", children: [ /*#__PURE__*/ _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 48 48", fill: "none", children: [ /*#__PURE__*/ _jsx("path", { d: "M44.5 20H24v8.5h11.8C34.7 33.9 30.1 37 24 37c-7.2 0-13-5.8-13-13s5.8-13 13-13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 11.8 2 2 11.8 2 24s9.8 22 22 22c11 0 21-8 21-22 0-1.3-.2-2.7-.5-4z", fill: "#FFC107" }), /*#__PURE__*/ _jsx("path", { d: "M6.3 14.7l7 5.1C15 16.1 19.1 13 24 13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 16.3 2 9.7 7.4 6.3 14.7z", fill: "#FF3D00" }), /*#__PURE__*/ _jsx("path", { d: "M24 46c5.5 0 10.5-1.9 14.4-5.1l-6.7-5.5C29.5 37 26.9 38 24 38c-6.1 0-11.2-4-13-9.5l-7 5.4C7.6 41.9 15.2 46 24 46z", fill: "#4CAF50" }), /*#__PURE__*/ _jsx("path", { d: "M44.5 20H24v8.5h11.8c-.9 2.8-2.8 5.1-5.3 6.6l6.7 5.5C41.5 37.3 45 31.1 45 24c0-1.3-.2-2.7-.5-4z", fill: "#1976D2" }) ] }), t('schedule.connectGoogle') ] }) ] }) ] }) ] }); } function AvailCalendar({ year, month, avail, saving, rangeStart, today, onToggle, onPrev, onNext }) { const { locale, t } = useLocale(); const weekDays = WEEK_DAYS_BY_LOCALE[locale] ?? WEEK_DAYS_BY_LOCALE.ru; const months = MONTHS_BY_LOCALE[locale] ?? MONTHS_BY_LOCALE.ru; const firstDay = new Date(year, month, 1); // Monday-based: 0=Mon, 6=Sun const startDow = (firstDay.getDay() + 6) % 7; const daysInMonth = new Date(year, month + 1, 0).getDate(); const prevMonthDays = new Date(year, month, 0).getDate(); const cells = []; // Leading days from prev month for(let i = startDow - 1; i >= 0; i--){ cells.push({ day: prevMonthDays - i, cur: false, dateKey: '' }); } // Current month days for(let d = 1; d <= daysInMonth; d++){ cells.push({ day: d, cur: true, dateKey: toDateKey(year, month, d) }); } // Trailing days const remainder = cells.length % 7; if (remainder !== 0) { for(let d = 1; d <= 7 - remainder; d++){ cells.push({ day: d, cur: false, dateKey: '' }); } } // Count summary — only future dates (>= today) const monthPrefix = toDateKey(year, month, 1).slice(0, 7); const availCount = Object.entries(avail).filter(([k, v])=>k.startsWith(monthPrefix) && k >= today && v === 'available').length; const busyCount = Object.entries(avail).filter(([k, v])=>k.startsWith(monthPrefix) && k >= today && v === 'busy').length; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden shadow-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("button", { onClick: onPrev, className: "w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition", children: "‹" }), /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsxs("h2", { className: "font-semibold text-gray-900", children: [ months[month], " ", year ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mt-0.5", children: [ /*#__PURE__*/ _jsxs("span", { className: "text-emerald-600 font-medium", children: [ availCount, " ", t('schedule.free') ] }), ' · ', /*#__PURE__*/ _jsxs("span", { className: "text-red-500 font-medium", children: [ busyCount, " ", t('schedule.busy_count') ] }) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: onNext, className: "w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition", children: "›" }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7 border-b border-gray-100", children: weekDays.map((d)=>/*#__PURE__*/ _jsx("div", { className: "py-2 text-center text-xs font-medium text-gray-400", children: d }, d)) }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7", children: cells.map((cell, idx)=>{ if (!cell.cur) { return /*#__PURE__*/ _jsx("div", { className: "p-1 h-12 flex items-center justify-center text-sm text-gray-200", children: cell.day }, `empty-${idx}`); } const status = avail[cell.dateKey] ?? null; const isPast = cell.dateKey < today; const isToday = cell.dateKey === today; const isSaving = saving === cell.dateKey; const isRangeStart = rangeStart === cell.dateKey; let cellCls = 'h-12 flex flex-col items-center justify-center rounded-xl m-0.5 text-sm font-medium transition-all select-none '; if (isPast) { cellCls += 'text-gray-200 cursor-default '; } else if (status === 'available') { cellCls += 'bg-emerald-100 border-2 border-emerald-400 text-emerald-700 cursor-pointer hover:bg-emerald-200 '; } else if (status === 'busy') { cellCls += 'bg-red-100 border-2 border-red-400 text-red-700 cursor-pointer hover:bg-red-200 '; } else { cellCls += 'bg-gray-50 border border-gray-200 text-gray-700 cursor-pointer hover:bg-green-50 hover:border-green-300 '; } if (isToday) cellCls += 'ring-2 ring-blue-400 ring-offset-1 '; if (isRangeStart) cellCls += '!ring-2 !ring-green-500 !ring-offset-1 scale-105 '; if (isSaving) cellCls += 'opacity-60 pointer-events-none '; return /*#__PURE__*/ _jsxs("button", { className: cellCls, onClick: ()=>onToggle(cell.dateKey), disabled: isPast || isSaving, title: status === 'available' ? t('schedule.available') : status === 'busy' ? t('schedule.busy') : t('schedule.click_to_set'), children: [ /*#__PURE__*/ _jsx("span", { children: cell.day }), !isPast && status === 'available' && /*#__PURE__*/ _jsx("span", { className: "text-[9px] leading-none text-emerald-600", children: t('schedule.available').toLowerCase() }), !isPast && status === 'busy' && /*#__PURE__*/ _jsx("span", { className: "text-[9px] leading-none text-red-500", children: t('schedule.busy').toLowerCase() }), isSaving && /*#__PURE__*/ _jsx("span", { className: "text-[8px] text-gray-400", children: "..." }) ] }, cell.dateKey); }) }) ] }); } cl={}_JL9GLS 0 7  _ k r \ d ~ 5ETg5CQTIgl_ !!!^"a"#"###}$$.%1%&&Y'\'((w)z)**q+u+(,_,,,,|..//00e1h1639344;6>677U8Y888!:$:[;^;v<y<s=v=>_>??~AATCWCDDAEEEEEFFGGBIEI[K_KLL-N0NOOOOQQ0T_4TTTUUVWZX]X ZZn[q[\\__eeffffggxh|hiijjlTlnnooppOqRqrrxx#z&zzz{{||(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyAvailability */ .iN)(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .setAvailabilityRange */ .D1)(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .setAvailability */ .OM)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)"https://api.canhelp.gr"0(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)buffersourcesizemapshashConcatSourceRawSourceC__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SchedulePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13260); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(96484); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); ReplaceSourceRawSource~/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect, useCallback } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getMyAvailability, setAvailability, setAvailabilityRange, request } from '@/lib/api'; const STATUS_CYCLE = { available: 'busy', busy: null }; const WEEK_DAYS_BY_LOCALE = { ru: [ 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс' ], en: [ 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su' ], el: [ 'Δε', 'Τρ', 'Τε', 'Πε', 'Πα', 'Σά', 'Κυ' ] }; const MONTHS_BY_LOCALE = { ru: [ 'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь' ], en: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], el: [ 'Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος' ] }; function toMonthKey(year, month) { return `${year}-${String(month + 1).padStart(2, '0')}`; } function toDateKey(year, month, day) { return `${year}-${String(month + 1).padStart(2, '0')}-${String(day).padStart(2, '0')}`; } export default function SchedulePage() { const { data: session, isPending } = useSession(); const router = useRouter(); const searchParams = useSearchParams(); const { locale, t } = useLocale(); const now = new Date(); const [viewYear, setViewYear] = useState(now.getFullYear()); const [viewMonth, setViewMonth] = useState(now.getMonth()); // availability map: 'YYYY-MM-DD' → 'available'|'busy' const [avail, setAvail] = useState({}); const [saving, setSaving] = useState(null) // date being saved ; // Range selection state const [rangeStart, setRangeStart] = useState(null); const [rangeMode, setRangeMode] = useState(false); const [rangeStatus, setRangeStatus] = useState('available'); // Google Calendar state const [gcalStatus, setGcalStatus] = useState(null); const [gcalLoading, setGcalLoading] = useState(false); const [gcalToast, setGcalToast] = useState(null); const today = new Date().toISOString().slice(0, 10); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isPending && !session) router.push('/login'); if (!isPending && session && session.user?.role !== 'specialist' && session.user?.role !== 'admin') router.push('/profile'); }, [ session, isPending ]); // Load Google Calendar status const loadGcalStatus = useCallback(()=>{ request('/google/calendar/status').then(setGcalStatus).catch(()=>setGcalStatus({ connected: false })); }, []); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!session) return; loadGcalStatus(); // Handle callback redirect params const gcalParam = searchParams.get('gcal'); if (gcalParam === 'connected') { setGcalToast(t('schedule.gcalConnected')); setTimeout(()=>setGcalToast(null), 5000); router.replace('/schedule'); } else if (gcalParam === 'error') { setGcalToast(t('schedule.gcalError')); setTimeout(()=>setGcalToast(null), 5000); router.replace('/schedule'); } }, [ session ]); const loadMonth = useCallback((year, month)=>{ const key = toMonthKey(year, month); getMyAvailability(key).then((rows)=>{ setAvail((prev)=>{ const next = { ...prev }; rows.forEach((r)=>{ next[r.date] = r.status; }); return next; }); }).catch(()=>{}); }, []); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!session) return; loadMonth(viewYear, viewMonth); // preload next month too const next = new Date(viewYear, viewMonth + 1, 1); loadMonth(next.getFullYear(), next.getMonth()); }, [ session, viewYear, viewMonth, loadMonth ]); function prevMonth() { if (viewMonth === 0) { setViewYear((y)=>y - 1); setViewMonth(11); } else setViewMonth((m)=>m - 1); } function nextMonth() { if (viewMonth === 11) { setViewYear((y)=>y + 1); setViewMonth(0); } else setViewMonth((m)=>m + 1); } async function toggleDay(dateKey) { if (dateKey < today) return; // past — ignore if (rangeMode) { if (!rangeStart) { setRangeStart(dateKey); return; } // Second click — apply range const from = rangeStart < dateKey ? rangeStart : dateKey; const to = rangeStart < dateKey ? dateKey : rangeStart; setRangeStart(null); setSaving('range'); try { await setAvailabilityRange(from, to, rangeStatus); // Update local state setAvail((prev)=>{ const next = { ...prev }; const cur = new Date(from); const end = new Date(to); while(cur <= end){ const d = cur.toISOString().slice(0, 10); if (d >= today) next[d] = rangeStatus; cur.setDate(cur.getDate() + 1); } return next; }); } catch {} setSaving(null); return; } const current = avail[dateKey] ?? null; const next = current === null ? 'available' : STATUS_CYCLE[current]; setSaving(dateKey); // Optimistic setAvail((prev)=>({ ...prev, [dateKey]: next })); try { await setAvailability(dateKey, next); } catch { // Revert on error setAvail((prev)=>({ ...prev, [dateKey]: current })); } setSaving(null); } if (isPending) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-gray-500", children: t('common.loading') }); const role = session?.user?.role; if (!session || role !== 'specialist' && role !== 'admin') return null; const apiBase = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; async function connectGcal() { window.location.href = `${apiBase}/api/google/calendar/connect`; } async function disconnectGcal() { if (!confirm(t('schedule.gcalDisconnectConfirm'))) return; setGcalLoading(true); try { await request('/google/calendar/disconnect', { method: 'DELETE' }); setGcalStatus({ connected: false }); } catch {} setGcalLoading(false); } async function importFromGcal() { setGcalLoading(true); try { const res = await request('/google/calendar/import', { method: 'POST' }); setGcalToast(t('schedule.gcalImportDone').replace('{n}', String(res.imported ?? 0))); setTimeout(()=>setGcalToast(null), 5000); // Refresh calendar display loadMonth(viewYear, viewMonth); } catch {} setGcalLoading(false); } return /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ gcalToast && /*#__PURE__*/ _jsx("div", { className: "fixed top-4 right-4 z-50 bg-white border border-gray-200 shadow-lg rounded-xl px-4 py-3 text-sm text-gray-800 max-w-xs", children: gcalToast }), /*#__PURE__*/ _jsxs("div", { className: "mb-8", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white", children: t('schedule.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-white/70 mt-1", children: t('schedule.subtitle') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-4 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-emerald-100 border-2 border-emerald-400 flex items-center justify-center text-xs", children: "✓" }), t('schedule.available') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-red-100 border-2 border-red-400 flex items-center justify-center text-xs", children: "✗" }), t('schedule.busy') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-white/20 border border-white/30" }), t('schedule.unset') ] }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-white/50 self-center", children: t('schedule.click_hint') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6 p-3 bg-white rounded-xl border border-gray-200", children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ _jsx("div", { onClick: ()=>{ setRangeMode((v)=>!v); setRangeStart(null); }, className: `w-10 h-6 rounded-full transition-colors relative cursor-pointer ${rangeMode ? 'bg-green-500' : 'bg-gray-200'}`, children: /*#__PURE__*/ _jsx("span", { className: `absolute top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ${rangeMode ? 'translate-x-5' : 'translate-x-1'}` }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-700", children: t('schedule.range_mode') }) ] }), rangeMode && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 ml-4", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>setRangeStatus('available'), className: `px-3 py-1 rounded-lg text-sm font-medium border transition ${rangeStatus === 'available' ? 'bg-emerald-100 border-emerald-400 text-emerald-700' : 'bg-white border-gray-200 text-gray-500'}`, children: t('schedule.available') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setRangeStatus('busy'), className: `px-3 py-1 rounded-lg text-sm font-medium border transition ${rangeStatus === 'busy' ? 'bg-red-100 border-red-400 text-red-700' : 'bg-white border-gray-200 text-gray-500'}`, children: t('schedule.busy') }), rangeStart && /*#__PURE__*/ _jsx("span", { className: "text-xs text-green-600", children: t('schedule.range_from').replace('{date}', rangeStart) }) ] }) ] }), /*#__PURE__*/ _jsx(AvailCalendar, { year: viewYear, month: viewMonth, avail: avail, saving: saving, rangeStart: rangeStart, today: today, onToggle: toggleDay, onPrev: prevMonth, onNext: nextMonth }), /*#__PURE__*/ _jsxs("div", { className: "mt-6 bg-white rounded-2xl border border-gray-200 p-5 shadow-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-4", children: [ /*#__PURE__*/ _jsxs("svg", { width: "22", height: "22", viewBox: "0 0 48 48", fill: "none", children: [ /*#__PURE__*/ _jsx("rect", { width: "48", height: "48", rx: "8", fill: "#fff" }), /*#__PURE__*/ _jsx("path", { d: "M34 14H14a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V16a2 2 0 0 0-2-2z", fill: "#4285F4" }), /*#__PURE__*/ _jsx("path", { d: "M28 20h-8v2h8v-2zm0 4h-8v2h8v-2zm-2 4h-6v2h6v-2z", fill: "#fff" }), /*#__PURE__*/ _jsx("circle", { cx: "18", cy: "18", r: "2", fill: "#DB4437" }), /*#__PURE__*/ _jsx("circle", { cx: "30", cy: "18", r: "2", fill: "#DB4437" }), /*#__PURE__*/ _jsx("rect", { x: "17", y: "12", width: "2", height: "6", rx: "1", fill: "#DB4437" }), /*#__PURE__*/ _jsx("rect", { x: "29", y: "12", width: "2", height: "6", rx: "1", fill: "#DB4437" }) ] }), /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 text-sm", children: t('schedule.googleCalendar') }) ] }), gcalStatus === null ? /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('common.loading') }) : gcalStatus.connected ? /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [ /*#__PURE__*/ _jsx("circle", { cx: "8", cy: "8", r: "8", fill: "#22c55e" }), /*#__PURE__*/ _jsx("path", { d: "M5 8l2 2 4-4", stroke: "#fff", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }), /*#__PURE__*/ _jsxs("span", { className: "text-sm text-gray-700", children: [ t('schedule.connectedAs'), " ", /*#__PURE__*/ _jsx("span", { className: "font-medium", children: gcalStatus.email }) ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('schedule.gcalAutoSyncNote') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: importFromGcal, disabled: gcalLoading, className: "px-3 py-1.5 rounded-lg border border-green-200 bg-green-50 text-green-700 text-xs font-medium hover:bg-green-100 disabled:opacity-50 transition", children: gcalLoading ? t('common.loading') : t('schedule.importFromGoogle') }), /*#__PURE__*/ _jsx("button", { onClick: disconnectGcal, disabled: gcalLoading, className: "px-3 py-1.5 rounded-lg border border-gray-200 bg-white text-gray-500 text-xs font-medium hover:bg-gray-50 disabled:opacity-50 transition", children: t('schedule.disconnectGoogle') }) ] }) ] }) : /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('schedule.gcalConnectDesc') }), /*#__PURE__*/ _jsxs("button", { onClick: connectGcal, className: "flex items-center gap-2 px-4 py-2 rounded-xl border border-gray-200 bg-white hover:bg-gray-50 transition text-sm font-medium text-gray-700", children: [ /*#__PURE__*/ _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 48 48", fill: "none", children: [ /*#__PURE__*/ _jsx("path", { d: "M44.5 20H24v8.5h11.8C34.7 33.9 30.1 37 24 37c-7.2 0-13-5.8-13-13s5.8-13 13-13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 11.8 2 2 11.8 2 24s9.8 22 22 22c11 0 21-8 21-22 0-1.3-.2-2.7-.5-4z", fill: "#FFC107" }), /*#__PURE__*/ _jsx("path", { d: "M6.3 14.7l7 5.1C15 16.1 19.1 13 24 13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 16.3 2 9.7 7.4 6.3 14.7z", fill: "#FF3D00" }), /*#__PURE__*/ _jsx("path", { d: "M24 46c5.5 0 10.5-1.9 14.4-5.1l-6.7-5.5C29.5 37 26.9 38 24 38c-6.1 0-11.2-4-13-9.5l-7 5.4C7.6 41.9 15.2 46 24 46z", fill: "#4CAF50" }), /*#__PURE__*/ _jsx("path", { d: "M44.5 20H24v8.5h11.8c-.9 2.8-2.8 5.1-5.3 6.6l6.7 5.5C41.5 37.3 45 31.1 45 24c0-1.3-.2-2.7-.5-4z", fill: "#1976D2" }) ] }), t('schedule.connectGoogle') ] }) ] }) ] }) ] }); } function AvailCalendar({ year, month, avail, saving, rangeStart, today, onToggle, onPrev, onNext }) { const { locale, t } = useLocale(); const weekDays = WEEK_DAYS_BY_LOCALE[locale] ?? WEEK_DAYS_BY_LOCALE.ru; const months = MONTHS_BY_LOCALE[locale] ?? MONTHS_BY_LOCALE.ru; const firstDay = new Date(year, month, 1); // Monday-based: 0=Mon, 6=Sun const startDow = (firstDay.getDay() + 6) % 7; const daysInMonth = new Date(year, month + 1, 0).getDate(); const prevMonthDays = new Date(year, month, 0).getDate(); const cells = []; // Leading days from prev month for(let i = startDow - 1; i >= 0; i--){ cells.push({ day: prevMonthDays - i, cur: false, dateKey: '' }); } // Current month days for(let d = 1; d <= daysInMonth; d++){ cells.push({ day: d, cur: true, dateKey: toDateKey(year, month, d) }); } // Trailing days const remainder = cells.length % 7; if (remainder !== 0) { for(let d = 1; d <= 7 - remainder; d++){ cells.push({ day: d, cur: false, dateKey: '' }); } } // Count summary — only future dates (>= today) const monthPrefix = toDateKey(year, month, 1).slice(0, 7); const availCount = Object.entries(avail).filter(([k, v])=>k.startsWith(monthPrefix) && k >= today && v === 'available').length; const busyCount = Object.entries(avail).filter(([k, v])=>k.startsWith(monthPrefix) && k >= today && v === 'busy').length; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden shadow-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("button", { onClick: onPrev, className: "w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition", children: "‹" }), /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsxs("h2", { className: "font-semibold text-gray-900", children: [ months[month], " ", year ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mt-0.5", children: [ /*#__PURE__*/ _jsxs("span", { className: "text-emerald-600 font-medium", children: [ availCount, " ", t('schedule.free') ] }), ' · ', /*#__PURE__*/ _jsxs("span", { className: "text-red-500 font-medium", children: [ busyCount, " ", t('schedule.busy_count') ] }) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: onNext, className: "w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition", children: "›" }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7 border-b border-gray-100", children: weekDays.map((d)=>/*#__PURE__*/ _jsx("div", { className: "py-2 text-center text-xs font-medium text-gray-400", children: d }, d)) }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7", children: cells.map((cell, idx)=>{ if (!cell.cur) { return /*#__PURE__*/ _jsx("div", { className: "p-1 h-12 flex items-center justify-center text-sm text-gray-200", children: cell.day }, `empty-${idx}`); } const status = avail[cell.dateKey] ?? null; const isPast = cell.dateKey < today; const isToday = cell.dateKey === today; const isSaving = saving === cell.dateKey; const isRangeStart = rangeStart === cell.dateKey; let cellCls = 'h-12 flex flex-col items-center justify-center rounded-xl m-0.5 text-sm font-medium transition-all select-none '; if (isPast) { cellCls += 'text-gray-200 cursor-default '; } else if (status === 'available') { cellCls += 'bg-emerald-100 border-2 border-emerald-400 text-emerald-700 cursor-pointer hover:bg-emerald-200 '; } else if (status === 'busy') { cellCls += 'bg-red-100 border-2 border-red-400 text-red-700 cursor-pointer hover:bg-red-200 '; } else { cellCls += 'bg-gray-50 border border-gray-200 text-gray-700 cursor-pointer hover:bg-green-50 hover:border-green-300 '; } if (isToday) cellCls += 'ring-2 ring-blue-400 ring-offset-1 '; if (isRangeStart) cellCls += '!ring-2 !ring-green-500 !ring-offset-1 scale-105 '; if (isSaving) cellCls += 'opacity-60 pointer-events-none '; return /*#__PURE__*/ _jsxs("button", { className: cellCls, onClick: ()=>onToggle(cell.dateKey), disabled: isPast || isSaving, title: status === 'available' ? t('schedule.available') : status === 'busy' ? t('schedule.busy') : t('schedule.click_to_set'), children: [ /*#__PURE__*/ _jsx("span", { children: cell.day }), !isPast && status === 'available' && /*#__PURE__*/ _jsx("span", { className: "text-[9px] leading-none text-emerald-600", children: t('schedule.available').toLowerCase() }), !isPast && status === 'busy' && /*#__PURE__*/ _jsx("span", { className: "text-[9px] leading-none text-red-500", children: t('schedule.busy').toLowerCase() }), isSaving && /*#__PURE__*/ _jsx("span", { className: "text-[8px] text-gray-400", children: "..." }) ] }, cell.dateKey); }) }) ] }); } 61123undefined125181undefined183243undefined245284undefined286330undefined332425undefined18491863undefined19311940(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)undefined19641972(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined20022016(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)undefined20472055(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined21242131(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined21912198(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined23062313(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined23522359(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24622469(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25162523(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25752582(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26672674(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined27252732(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined27802787(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined29082916(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined32303240(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined32563262(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)undefined34543462(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined40674077(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined41494165(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyAvailability */ .iN)undefined45354543(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined57165735(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .setAvailabilityRange */ .D1)undefined67096723(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .setAvailability */ .OM)undefined69936996(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined72417271"https://api.canhelp.gr"undefined727672980undefined75827588(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)undefined79187924(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)undefined83208324(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined84458448(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined86868690(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined87988801(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined89918994(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined92089212(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined93419345(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined95189521(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined98969900(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1007310076(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1043810442(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1061510618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1089310896(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1112111125(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1130411308(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1147611479(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1190011903(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1219512198(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1248512489(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1264512648(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1311013113(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1356213565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1388313886(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1425114255(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1442114425(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1458114585(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1488114884(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1519515198(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1547815481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1573115734(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1604216045(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1635316356(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1676616769(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1723617239(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1753917542(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1772917733(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1787017874(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1804918053(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1839718400(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1875418757(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1929119295(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1961319616(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2001320016(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2024020244(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2041620419(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2096620969(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2155221556(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2169321696(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2191921923(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2227022274(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2261822621(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2305323056(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2340623409(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2375923762(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2447624484(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined2598525989(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2613826142(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2631426317(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2660126605(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2674426748(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2711727121(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2729927303(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2779327797(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2834328346(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2865528658(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2879928802(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2900729010(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2920129204(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3086130865(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3126731270(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3144431447(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3173231735(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3199131994(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ })   C__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SchedulePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13260); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(96484); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); C~/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect, useCallback } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getMyAvailability, setAvailability, setAvailabilityRange, request } from '@/lib/api'; const STATUS_CYCLE = { available: 'busy', busy: null }; const WEEK_DAYS_BY_LOCALE = { ru: [ 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс' ], en: [ 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su' ], el: [ 'Δε', 'Τρ', 'Τε', 'Πε', 'Πα', 'Σά', 'Κυ' ] }; const MONTHS_BY_LOCALE = { ru: [ 'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь' ], en: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], el: [ 'Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος' ] }; function toMonthKey(year, month) { return `${year}-${String(month + 1).padStart(2, '0')}`; } function toDateKey(year, month, day) { return `${year}-${String(month + 1).padStart(2, '0')}-${String(day).padStart(2, '0')}`; } export default function SchedulePage() { const { data: session, isPending } = useSession(); const router = useRouter(); const searchParams = useSearchParams(); const { locale, t } = useLocale(); const now = new Date(); const [viewYear, setViewYear] = useState(now.getFullYear()); const [viewMonth, setViewMonth] = useState(now.getMonth()); // availability map: 'YYYY-MM-DD' → 'available'|'busy' const [avail, setAvail] = useState({}); const [saving, setSaving] = useState(null) // date being saved ; // Range selection state const [rangeStart, setRangeStart] = useState(null); const [rangeMode, setRangeMode] = useState(false); const [rangeStatus, setRangeStatus] = useState('available'); // Google Calendar state const [gcalStatus, setGcalStatus] = useState(null); const [gcalLoading, setGcalLoading] = useState(false); const [gcalToast, setGcalToast] = useState(null); const today = new Date().toISOString().slice(0, 10); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isPending && !session) router.push('/login'); if (!isPending && session && session.user?.role !== 'specialist' && session.user?.role !== 'admin') router.push('/profile'); }, [ session, isPending ]); // Load Google Calendar status const loadGcalStatus = useCallback(()=>{ request('/google/calendar/status').then(setGcalStatus).catch(()=>setGcalStatus({ connected: false })); }, []); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!session) return; loadGcalStatus(); // Handle callback redirect params const gcalParam = searchParams.get('gcal'); if (gcalParam === 'connected') { setGcalToast(t('schedule.gcalConnected')); setTimeout(()=>setGcalToast(null), 5000); router.replace('/schedule'); } else if (gcalParam === 'error') { setGcalToast(t('schedule.gcalError')); setTimeout(()=>setGcalToast(null), 5000); router.replace('/schedule'); } }, [ session ]); const loadMonth = useCallback((year, month)=>{ const key = toMonthKey(year, month); getMyAvailability(key).then((rows)=>{ setAvail((prev)=>{ const next = { ...prev }; rows.forEach((r)=>{ next[r.date] = r.status; }); return next; }); }).catch(()=>{}); }, []); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!session) return; loadMonth(viewYear, viewMonth); // preload next month too const next = new Date(viewYear, viewMonth + 1, 1); loadMonth(next.getFullYear(), next.getMonth()); }, [ session, viewYear, viewMonth, loadMonth ]); function prevMonth() { if (viewMonth === 0) { setViewYear((y)=>y - 1); setViewMonth(11); } else setViewMonth((m)=>m - 1); } function nextMonth() { if (viewMonth === 11) { setViewYear((y)=>y + 1); setViewMonth(0); } else setViewMonth((m)=>m + 1); } async function toggleDay(dateKey) { if (dateKey < today) return; // past — ignore if (rangeMode) { if (!rangeStart) { setRangeStart(dateKey); return; } // Second click — apply range const from = rangeStart < dateKey ? rangeStart : dateKey; const to = rangeStart < dateKey ? dateKey : rangeStart; setRangeStart(null); setSaving('range'); try { await setAvailabilityRange(from, to, rangeStatus); // Update local state setAvail((prev)=>{ const next = { ...prev }; const cur = new Date(from); const end = new Date(to); while(cur <= end){ const d = cur.toISOString().slice(0, 10); if (d >= today) next[d] = rangeStatus; cur.setDate(cur.getDate() + 1); } return next; }); } catch {} setSaving(null); return; } const current = avail[dateKey] ?? null; const next = current === null ? 'available' : STATUS_CYCLE[current]; setSaving(dateKey); // Optimistic setAvail((prev)=>({ ...prev, [dateKey]: next })); try { await setAvailability(dateKey, next); } catch { // Revert on error setAvail((prev)=>({ ...prev, [dateKey]: current })); } setSaving(null); } if (isPending) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-gray-500", children: t('common.loading') }); const role = session?.user?.role; if (!session || role !== 'specialist' && role !== 'admin') return null; const apiBase = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; async function connectGcal() { window.location.href = `${apiBase}/api/google/calendar/connect`; } async function disconnectGcal() { if (!confirm(t('schedule.gcalDisconnectConfirm'))) return; setGcalLoading(true); try { await request('/google/calendar/disconnect', { method: 'DELETE' }); setGcalStatus({ connected: false }); } catch {} setGcalLoading(false); } async function importFromGcal() { setGcalLoading(true); try { const res = await request('/google/calendar/import', { method: 'POST' }); setGcalToast(t('schedule.gcalImportDone').replace('{n}', String(res.imported ?? 0))); setTimeout(()=>setGcalToast(null), 5000); // Refresh calendar display loadMonth(viewYear, viewMonth); } catch {} setGcalLoading(false); } return /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ gcalToast && /*#__PURE__*/ _jsx("div", { className: "fixed top-4 right-4 z-50 bg-white border border-gray-200 shadow-lg rounded-xl px-4 py-3 text-sm text-gray-800 max-w-xs", children: gcalToast }), /*#__PURE__*/ _jsxs("div", { className: "mb-8", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white", children: t('schedule.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-white/70 mt-1", children: t('schedule.subtitle') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-4 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-emerald-100 border-2 border-emerald-400 flex items-center justify-center text-xs", children: "✓" }), t('schedule.available') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-red-100 border-2 border-red-400 flex items-center justify-center text-xs", children: "✗" }), t('schedule.busy') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-white/20 border border-white/30" }), t('schedule.unset') ] }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-white/50 self-center", children: t('schedule.click_hint') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6 p-3 bg-white rounded-xl border border-gray-200", children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ _jsx("div", { onClick: ()=>{ setRangeMode((v)=>!v); setRangeStart(null); }, className: `w-10 h-6 rounded-full transition-colors relative cursor-pointer ${rangeMode ? 'bg-green-500' : 'bg-gray-200'}`, children: /*#__PURE__*/ _jsx("span", { className: `absolute top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ${rangeMode ? 'translate-x-5' : 'translate-x-1'}` }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-700", children: t('schedule.range_mode') }) ] }), rangeMode && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 ml-4", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>setRangeStatus('available'), className: `px-3 py-1 rounded-lg text-sm font-medium border transition ${rangeStatus === 'available' ? 'bg-emerald-100 border-emerald-400 text-emerald-700' : 'bg-white border-gray-200 text-gray-500'}`, children: t('schedule.available') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setRangeStatus('busy'), className: `px-3 py-1 rounded-lg text-sm font-medium border transition ${rangeStatus === 'busy' ? 'bg-red-100 border-red-400 text-red-700' : 'bg-white border-gray-200 text-gray-500'}`, children: t('schedule.busy') }), rangeStart && /*#__PURE__*/ _jsx("span", { className: "text-xs text-green-600", children: t('schedule.range_from').replace('{date}', rangeStart) }) ] }) ] }), /*#__PURE__*/ _jsx(AvailCalendar, { year: viewYear, month: viewMonth, avail: avail, saving: saving, rangeStart: rangeStart, today: today, onToggle: toggleDay, onPrev: prevMonth, onNext: nextMonth }), /*#__PURE__*/ _jsxs("div", { className: "mt-6 bg-white rounded-2xl border border-gray-200 p-5 shadow-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-4", children: [ /*#__PURE__*/ _jsxs("svg", { width: "22", height: "22", viewBox: "0 0 48 48", fill: "none", children: [ /*#__PURE__*/ _jsx("rect", { width: "48", height: "48", rx: "8", fill: "#fff" }), /*#__PURE__*/ _jsx("path", { d: "M34 14H14a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V16a2 2 0 0 0-2-2z", fill: "#4285F4" }), /*#__PURE__*/ _jsx("path", { d: "M28 20h-8v2h8v-2zm0 4h-8v2h8v-2zm-2 4h-6v2h6v-2z", fill: "#fff" }), /*#__PURE__*/ _jsx("circle", { cx: "18", cy: "18", r: "2", fill: "#DB4437" }), /*#__PURE__*/ _jsx("circle", { cx: "30", cy: "18", r: "2", fill: "#DB4437" }), /*#__PURE__*/ _jsx("rect", { x: "17", y: "12", width: "2", height: "6", rx: "1", fill: "#DB4437" }), /*#__PURE__*/ _jsx("rect", { x: "29", y: "12", width: "2", height: "6", rx: "1", fill: "#DB4437" }) ] }), /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 text-sm", children: t('schedule.googleCalendar') }) ] }), gcalStatus === null ? /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('common.loading') }) : gcalStatus.connected ? /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [ /*#__PURE__*/ _jsx("circle", { cx: "8", cy: "8", r: "8", fill: "#22c55e" }), /*#__PURE__*/ _jsx("path", { d: "M5 8l2 2 4-4", stroke: "#fff", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }), /*#__PURE__*/ _jsxs("span", { className: "text-sm text-gray-700", children: [ t('schedule.connectedAs'), " ", /*#__PURE__*/ _jsx("span", { className: "font-medium", children: gcalStatus.email }) ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('schedule.gcalAutoSyncNote') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: importFromGcal, disabled: gcalLoading, className: "px-3 py-1.5 rounded-lg border border-green-200 bg-green-50 text-green-700 text-xs font-medium hover:bg-green-100 disabled:opacity-50 transition", children: gcalLoading ? t('common.loading') : t('schedule.importFromGoogle') }), /*#__PURE__*/ _jsx("button", { onClick: disconnectGcal, disabled: gcalLoading, className: "px-3 py-1.5 rounded-lg border border-gray-200 bg-white text-gray-500 text-xs font-medium hover:bg-gray-50 disabled:opacity-50 transition", children: t('schedule.disconnectGoogle') }) ] }) ] }) : /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('schedule.gcalConnectDesc') }), /*#__PURE__*/ _jsxs("button", { onClick: connectGcal, className: "flex items-center gap-2 px-4 py-2 rounded-xl border border-gray-200 bg-white hover:bg-gray-50 transition text-sm font-medium text-gray-700", children: [ /*#__PURE__*/ _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 48 48", fill: "none", children: [ /*#__PURE__*/ _jsx("path", { d: "M44.5 20H24v8.5h11.8C34.7 33.9 30.1 37 24 37c-7.2 0-13-5.8-13-13s5.8-13 13-13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 11.8 2 2 11.8 2 24s9.8 22 22 22c11 0 21-8 21-22 0-1.3-.2-2.7-.5-4z", fill: "#FFC107" }), /*#__PURE__*/ _jsx("path", { d: "M6.3 14.7l7 5.1C15 16.1 19.1 13 24 13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 16.3 2 9.7 7.4 6.3 14.7z", fill: "#FF3D00" }), /*#__PURE__*/ _jsx("path", { d: "M24 46c5.5 0 10.5-1.9 14.4-5.1l-6.7-5.5C29.5 37 26.9 38 24 38c-6.1 0-11.2-4-13-9.5l-7 5.4C7.6 41.9 15.2 46 24 46z", fill: "#4CAF50" }), /*#__PURE__*/ _jsx("path", { d: "M44.5 20H24v8.5h11.8c-.9 2.8-2.8 5.1-5.3 6.6l6.7 5.5C41.5 37.3 45 31.1 45 24c0-1.3-.2-2.7-.5-4z", fill: "#1976D2" }) ] }), t('schedule.connectGoogle') ] }) ] }) ] }) ] }); } function AvailCalendar({ year, month, avail, saving, rangeStart, today, onToggle, onPrev, onNext }) { const { locale, t } = useLocale(); const weekDays = WEEK_DAYS_BY_LOCALE[locale] ?? WEEK_DAYS_BY_LOCALE.ru; const months = MONTHS_BY_LOCALE[locale] ?? MONTHS_BY_LOCALE.ru; const firstDay = new Date(year, month, 1); // Monday-based: 0=Mon, 6=Sun const startDow = (firstDay.getDay() + 6) % 7; const daysInMonth = new Date(year, month + 1, 0).getDate(); const prevMonthDays = new Date(year, month, 0).getDate(); const cells = []; // Leading days from prev month for(let i = startDow - 1; i >= 0; i--){ cells.push({ day: prevMonthDays - i, cur: false, dateKey: '' }); } // Current month days for(let d = 1; d <= daysInMonth; d++){ cells.push({ day: d, cur: true, dateKey: toDateKey(year, month, d) }); } // Trailing days const remainder = cells.length % 7; if (remainder !== 0) { for(let d = 1; d <= 7 - remainder; d++){ cells.push({ day: d, cur: false, dateKey: '' }); } } // Count summary — only future dates (>= today) const monthPrefix = toDateKey(year, month, 1).slice(0, 7); const availCount = Object.entries(avail).filter(([k, v])=>k.startsWith(monthPrefix) && k >= today && v === 'available').length; const busyCount = Object.entries(avail).filter(([k, v])=>k.startsWith(monthPrefix) && k >= today && v === 'busy').length; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden shadow-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("button", { onClick: onPrev, className: "w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition", children: "‹" }), /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsxs("h2", { className: "font-semibold text-gray-900", children: [ months[month], " ", year ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mt-0.5", children: [ /*#__PURE__*/ _jsxs("span", { className: "text-emerald-600 font-medium", children: [ availCount, " ", t('schedule.free') ] }), ' · ', /*#__PURE__*/ _jsxs("span", { className: "text-red-500 font-medium", children: [ busyCount, " ", t('schedule.busy_count') ] }) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: onNext, className: "w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition", children: "›" }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7 border-b border-gray-100", children: weekDays.map((d)=>/*#__PURE__*/ _jsx("div", { className: "py-2 text-center text-xs font-medium text-gray-400", children: d }, d)) }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7", children: cells.map((cell, idx)=>{ if (!cell.cur) { return /*#__PURE__*/ _jsx("div", { className: "p-1 h-12 flex items-center justify-center text-sm text-gray-200", children: cell.day }, `empty-${idx}`); } const status = avail[cell.dateKey] ?? null; const isPast = cell.dateKey < today; const isToday = cell.dateKey === today; const isSaving = saving === cell.dateKey; const isRangeStart = rangeStart === cell.dateKey; let cellCls = 'h-12 flex flex-col items-center justify-center rounded-xl m-0.5 text-sm font-medium transition-all select-none '; if (isPast) { cellCls += 'text-gray-200 cursor-default '; } else if (status === 'available') { cellCls += 'bg-emerald-100 border-2 border-emerald-400 text-emerald-700 cursor-pointer hover:bg-emerald-200 '; } else if (status === 'busy') { cellCls += 'bg-red-100 border-2 border-red-400 text-red-700 cursor-pointer hover:bg-red-200 '; } else { cellCls += 'bg-gray-50 border border-gray-200 text-gray-700 cursor-pointer hover:bg-green-50 hover:border-green-300 '; } if (isToday) cellCls += 'ring-2 ring-blue-400 ring-offset-1 '; if (isRangeStart) cellCls += '!ring-2 !ring-green-500 !ring-offset-1 scale-105 '; if (isSaving) cellCls += 'opacity-60 pointer-events-none '; return /*#__PURE__*/ _jsxs("button", { className: cellCls, onClick: ()=>onToggle(cell.dateKey), disabled: isPast || isSaving, title: status === 'available' ? t('schedule.available') : status === 'busy' ? t('schedule.busy') : t('schedule.click_to_set'), children: [ /*#__PURE__*/ _jsx("span", { children: cell.day }), !isPast && status === 'available' && /*#__PURE__*/ _jsx("span", { className: "text-[9px] leading-none text-emerald-600", children: t('schedule.available').toLowerCase() }), !isPast && status === 'busy' && /*#__PURE__*/ _jsx("span", { className: "text-[9px] leading-none text-red-500", children: t('schedule.busy').toLowerCase() }), isSaving && /*#__PURE__*/ _jsx("span", { className: "text-[8px] text-gray-400", children: "..." }) ] }, cell.dateKey); }) }) ] }); } 61123undefined125181undefined183243undefined245284undefined286330undefined332425undefined18491863undefined19311940(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)undefined19641972(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined20022016(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)undefined20472055(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined21242131(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined21912198(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined23062313(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined23522359(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24622469(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25162523(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25752582(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26672674(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined27252732(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined27802787(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined29082916(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined32303240(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined32563262(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)undefined34543462(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined40674077(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined41494165(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyAvailability */ .iN)undefined45354543(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined57165735(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .setAvailabilityRange */ .D1)undefined67096723(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .setAvailability */ .OM)undefined69936996(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined72417271"https://api.canhelp.gr"undefined727672980undefined75827588(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)undefined79187924(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)undefined83208324(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined84458448(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined86868690(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined87988801(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined89918994(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined92089212(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined93419345(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined95189521(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined98969900(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1007310076(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1043810442(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1061510618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1089310896(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1112111125(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1130411308(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1147611479(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1190011903(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1219512198(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1248512489(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1264512648(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1311013113(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1356213565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1388313886(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1425114255(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1442114425(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1458114585(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1488114884(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1519515198(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1547815481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1573115734(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1604216045(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1635316356(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1676616769(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1723617239(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1753917542(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1772917733(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1787017874(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1804918053(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1839718400(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1875418757(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1929119295(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1961319616(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2001320016(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2024020244(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2041620419(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2096620969(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2155221556(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2169321696(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2191921923(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2227022274(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2261822621(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2305323056(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2340623409(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2375923762(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2447624484(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined2598525989(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2613826142(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2631426317(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2660126605(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2674426748(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2711727121(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2729927303(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2779327797(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2834328346(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2865528658(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2879928802(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2900729010(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2920129204(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3086130865(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3126731270(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3144431447(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3173231735(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3199131994(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 91645:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("net");  /***/ }) N/***/ ((module) => { "use strict"; module.exports = require("net"); /***/ })      module.exports = require("net");  , /***/ 94735:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("events");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("events"); /***/ })  #module.exports = require("events");w }; ; // load runtime var __webpack_require__ = require("../../webpack-runtime.js"); __webpack_require__.C(exports); var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [901,652,809], () => (__webpack_exec__(63449))); ,module.exports = __webpack_exports__; })(); k@rb(() => { var exports = {}; exports.id = 826; exports.ids = [826]; exports.modules = { /***/ 261: q(((q(((q(((q(((q(((, /***/ 27811: prVimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/schedule/page.tsx"); l083Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 88431))undefined%~%n%%~%n%%~%, /***/ 28491: mol083Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 53749))undefined#|#l~##|#l~##|#l~##|#l~##|#l~##|#, /***/ 53749: kkm*// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/schedule/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/schedule/page.tsx", "default", ); 61134undefined136150/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (undefined136150undefined151173(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined552552.5);undefined y i{  y i{  y i{  y , /***/ 63449: hhjconst module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/schedule/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'schedule', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/schedule/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/schedule/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/schedule/page", pathname: "/schedule", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/schedule/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map %'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558641Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 53749))undefined644784undefined786900undefined902978undefined9801051undefined10531115undefined11171186undefined11881264undefined12661351undefined13531436undefined14381514undefined15161597undefined15991692undefined16941798undefined18001880undefined18821960undefined19622053undefined20552236undefined22382314undefined23162381undefined23832456undefined24582515undefined25172623undefined26252698undefined27002764undefined27662847undefined32603482Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined35403769Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined43294551Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined46094838Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined50245046undefined50485184undefined51865208undefined52395257__webpack_require__undefined53155321undefined54225548undefined55505635undefined56375750undefined58135819undefined58445861next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined58975905next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined61676202".next"undefined620762080undefined62356273 falseundefined62856291undefined65746594falseundefined65976661{}undefined68076846falseundefined68786891(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined69826995(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined77617776(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined81638172(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined82088223(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined83688381(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined84278453next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined86328645(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined86918700next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined87408764(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined89448963(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined91559262 falseundefined926792810undefined1157711590(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1197512002(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1378713804(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1386413872next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1392313922: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1429114320(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1445214472(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1460614614(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1491414928next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1496814983next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1521115248falseundefined1525115826{}undefined1640416417next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1750417517(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1779617809(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1852818564 trueundefined1856818587(__webpack_require__(33873).join)undefined18666187170undefined1967819691(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2153221545(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2196921990next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2342923443next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2468924706(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2499525006next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2502125025(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2513125142next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2557625587next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2565625667next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2575625767next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2630026311next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2635626370next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2702227030next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2777627797(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2932529339next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2937829389next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2989129904(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2996129982(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3055730565next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3204432058next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3341033433next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3590035913next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3620836222next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3710537128next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3740037421next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3753937560next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3779037805(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3803338044next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3807338095next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3875138766(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3897438985next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3924839261(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3970939722(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4059240613next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4149241513next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4162341644next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4219742214next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4241842441next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4333743352(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4438044395(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4460344614next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4464744669next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4538645498falseundefined4550145851{}undefined4587645891(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4683546846next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4698146996(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4760747634falseundefined4763747707{}undefined4901549029next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined4995349968(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5084350856next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5095550962next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5121851232next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5144451462(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefinedvfxvfxvfxvfxvfxvfxvfxv, /***/ 88431: eeguewuewuvar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [901,652,809], () => (__webpack_exec__(63449)));  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSource`?webpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceb(() => { var exports = {}; exports.id = 442; exports.ids = [442]; exports.modules = { /***/ 261: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource 'webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Hmodule.exports = require("next/dist/shared/lib/router/utils/app-paths");  /***/ }) buffersourcesizemapshashv/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }) {"finalSource":true}mapbufferedMap ConcatSourceRawSource$/***/ ((module) => { "use strict";  RawSourceHmodule.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }), /***/ 2069:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource:// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx", "default", ); `=G8 ā@/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference));buffersourcesizemapshashf__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx", "default", )); {"finalSource":true}mapbufferedMap ConcatSourceRawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); ReplaceSourceRawSource:// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx", "default", ); 61134undefined136150/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (undefined136150undefined151173(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined568568.5);undefined /***/ })  _/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); ReplaceSourceRawSource:// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx", "default", ); 61134undefined136150/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (undefined136150undefined151173(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined568568.5);undefined, /***/ 3295:  <webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; ]module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js"); /***/ })  ]module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");, /***/ 10846:  3webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js"); /***/ })  Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");, /***/ 19121:  8webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Ymodule.exports = require("next/dist/server/app-render/action-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/action-async-storage.external.js"); /***/ })  Ymodule.exports = require("next/dist/server/app-render/action-async-storage.external.js");, /***/ 26713:  $webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Emodule.exports = require("next/dist/shared/lib/router/utils/is-bot");  /***/ }) s/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/is-bot"); /***/ })  Emodule.exports = require("next/dist/shared/lib/router/utils/is-bot");, /***/ 27910:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("stream");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("stream"); /***/ })  #module.exports = require("stream");, /***/ 28354:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("util");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("util"); /***/ })  !module.exports = require("util");, /***/ 28527:  lwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SpecialistSetupPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13260); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(96484); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(44972); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect, useRef } from 'react'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; import { CategoryIcon, isCategoryIconUrl } from '@/components/CategoryIcon'; const TOTAL_STEPS = 5; // ─── Step indicator ──────────────────────────────────────────────────────── function StepIndicator({ current, total }) { return /*#__PURE__*/ _jsx("div", { className: "flex items-center justify-center gap-2 mb-8", children: Array.from({ length: total }, (_, i)=>i + 1).map((n)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("div", { className: `w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold transition-colors ${n < current ? 'bg-green-500 text-white' : n === current ? 'bg-green-600 text-white ring-4 ring-blue-200' : 'bg-gray-200 text-gray-400'}`, children: n < current ? /*#__PURE__*/ _jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /*#__PURE__*/ _jsx("path", { d: "M2 7l4 4 6-6", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) : n }), n < total && /*#__PURE__*/ _jsx("div", { className: `w-8 h-0.5 ${n < current ? 'bg-green-500' : 'bg-gray-200'}` }) ] }, n)) }); } // ─── Step 1: Welcome ─────────────────────────────────────────────────────── function Step1Welcome({ t, onNext }) { return /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6", children: /*#__PURE__*/ _jsxs("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "#2563eb", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "7", r: "4" }) ] }) }), /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: t('specialist_setup.step1.title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-600 font-medium mb-4", children: t('specialist_setup.step1.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm leading-relaxed mb-8 max-w-sm mx-auto", children: t('specialist_setup.step1.desc') }), /*#__PURE__*/ _jsxs("div", { className: "bg-gray-50 rounded-xl p-5 text-left mb-8 max-w-sm mx-auto", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-gray-700 mb-3", children: t('specialist_setup.step1.what_next') }), /*#__PURE__*/ _jsx("ul", { className: "space-y-2", children: [ t('specialist_setup.step1.item1'), t('specialist_setup.step1.item2'), t('specialist_setup.step1.item3'), t('specialist_setup.step1.item4'), t('specialist_setup.step1.item5') ].map((item, i)=>/*#__PURE__*/ _jsxs("li", { className: "flex items-center gap-2 text-sm text-gray-600", children: [ /*#__PURE__*/ _jsx("span", { className: "w-5 h-5 bg-green-100 text-green-600 rounded-full flex items-center justify-center text-xs font-bold shrink-0", children: i + 1 }), item ] }, i)) }) ] }), /*#__PURE__*/ _jsxs("button", { onClick: onNext, className: "w-full max-w-xs bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 transition", children: [ t('specialist_setup.next'), " →" ] }) ] }); } // ─── Step 2: Basic profile ───────────────────────────────────────────────── function Step2Profile({ t, onNext, onBack }) { const [bio, setBio] = useState(''); const [phone, setPhone] = useState(''); const [saving, setSaving] = useState(false); const [avatarUrl, setAvatarUrl] = useState(null); const [uploading, setUploading] = useState(false); const fileRef = useRef(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ api.request('/users/me', {}).then((u)=>{ setBio(u.bio ?? ''); setPhone(u.phone ?? ''); setAvatarUrl(u.image ?? null); }).catch(()=>{}); }, []); async function handleAvatarChange(e) { const file = e.target.files?.[0]; if (!file) return; setUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch(`${process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'}/api/uploads`, { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = `${process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'}${url}`; await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ image: fullUrl }) }); setAvatarUrl(fullUrl); } catch {} finally{ setUploading(false); if (fileRef.current) fileRef.current.value = ''; } } async function handleSave() { setSaving(true); try { await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ bio: bio || undefined, phone: phone || undefined }) }); onNext(); } catch {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step2.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step2.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-5", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step2.photo_label') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ _jsx("div", { className: "w-16 h-16 rounded-full bg-gray-100 border-2 border-gray-200 overflow-hidden shrink-0 flex items-center justify-center", children: avatarUrl ? /*#__PURE__*/ _jsx("img", { src: avatarUrl, alt: "", className: "w-full h-full object-cover" }) : /*#__PURE__*/ _jsxs("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", stroke: "#9ca3af", strokeWidth: "2", children: [ /*#__PURE__*/ _jsx("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "7", r: "4" }) ] }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>fileRef.current?.click(), disabled: uploading, className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium text-gray-700 disabled:opacity-50 transition", children: uploading ? t('specialist_setup.step2.photo_uploading') : t('specialist_setup.step2.photo_btn') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('specialist_setup.step2.photo_hint') }) ] }), /*#__PURE__*/ _jsx("input", { ref: fileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleAvatarChange }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-4", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step2.bio_label') }), /*#__PURE__*/ _jsx("textarea", { value: bio, onChange: (e)=>setBio(e.target.value), rows: 4, maxLength: 1000, placeholder: t('specialist_setup.step2.bio_placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step2.phone_label') }), /*#__PURE__*/ _jsx("input", { type: "tel", value: phone, onChange: (e)=>setPhone(e.target.value), placeholder: t('specialist_setup.step2.phone_placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 3: Service card ────────────────────────────────────────────────── function Step3Card({ t, onNext, onBack, onCardCreated }) { const [title, setTitle] = useState(''); const [desc, setDesc] = useState(''); const [saving, setSaving] = useState(false); const [error, setError] = useState(''); async function handleSave() { if (!title.trim()) { setError(t('specialist_setup.step3.title_required')); return; } setError(''); setSaving(true); try { const card = await api.createSpecialistCard({ title: title.trim(), description: desc || undefined }); onCardCreated(card); onNext(); } catch {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step3.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step3.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-4", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step3.title_label') }), /*#__PURE__*/ _jsx("input", { value: title, onChange: (e)=>{ setTitle(e.target.value); if (error) setError(''); }, maxLength: 200, placeholder: t('specialist_setup.step3.title_placeholder'), className: `w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ${error ? 'border-red-400' : 'border-gray-300'}` }), error && /*#__PURE__*/ _jsx("p", { className: "text-red-500 text-xs mt-1", children: error }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step3.desc_label') }), /*#__PURE__*/ _jsx("textarea", { value: desc, onChange: (e)=>setDesc(e.target.value), rows: 5, maxLength: 1000, placeholder: t('specialist_setup.step3.desc_placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 4: Skills & Categories ────────────────────────────────────────── function Step4Skills({ t, onNext, onBack, card, catLocale }) { const [skills, setSkills] = useState(card?.skills ?? []); const [skillInput, setSkillInput] = useState(''); const [categories, setCategories] = useState(card?.categories ?? []); const [allCategories, setAllCategories] = useState([]); const [suggestions, setSuggestions] = useState([]); const [saving, setSaving] = useState(false); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ api.getCategories().then(setAllCategories).catch(()=>{}); }, []); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ api.getSkillSuggestions(categories.length > 0 ? categories : undefined).then(setSuggestions).catch(()=>{}); }, [ categories ]); function addSkill(s) { const trimmed = s.trim(); if (trimmed && !skills.includes(trimmed)) setSkills([ ...skills, trimmed ]); setSkillInput(''); } function toggleCategory(slug, childSlugs = []) { if (categories.includes(slug)) { setCategories(categories.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setCategories([ ...new Set([ ...categories, slug, ...childSlugs ]) ]); } } async function handleSave() { if (!card) { onNext(); return; } setSaving(true); try { await api.updateSpecialistCard(card.id, { skills, categories }); onNext(); } catch {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step4.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step4.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step4.skills_label') }), skills.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2 mb-2", children: skills.map((s)=>/*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: [ s, /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSkills(skills.filter((x)=>x !== s)), className: "text-gray-400 hover:text-green-700 leading-none text-base", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') { e.preventDefault(); addSkill(skillInput); } }, placeholder: t('specialist_setup.step4.skills_placeholder'), className: "flex-1 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>addSkill(skillInput), className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium", children: t('specialist_setup.step4.skills_add') }) ] }), suggestions.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mt-2", children: suggestions.map((s)=>s.names[catLocale] ?? s.names.el).filter((name, i, arr)=>arr.indexOf(name) === i && !skills.includes(name)).slice(0, 12).map((name)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>addSkill(name), className: "text-xs px-2.5 py-1 border border-gray-200 rounded-full text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: [ "+ ", name ] }, name)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step4.categories_label') }), /*#__PURE__*/ _jsx("div", { className: "space-y-2 max-h-64 overflow-y-auto border border-gray-200 rounded-xl p-3", children: allCategories.map((cat)=>{ const catName = cat.names?.[catLocale] ?? cat.names?.el ?? cat.slug; const children = cat.children ?? []; const childSlugs = children.map((c)=>c.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: categories.includes(cat.slug), onChange: ()=>toggleCategory(cat.slug, childSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("span", { className: "text-sm font-medium text-gray-800 inline-flex items-center gap-1", children: [ cat.icon && /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: catName, className: isCategoryIconUrl(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }), catName ] }) ] }), children.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-1.5 space-y-1.5", children: children.map((sub)=>{ const subName = sub.names?.[catLocale] ?? sub.names?.el ?? sub.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: categories.includes(sub.slug), onChange: ()=>toggleCategory(sub.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: subName }) ] }, sub.id); }) }) ] }, cat.id); }) }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 5: Geography ───────────────────────────────────────────────────── function Step5Geography({ t, onNext, onBack, card, catLocale }) { const [locations, setLocations] = useState(card?.locations ?? []); const [locationTree, setLocationTree] = useState([]); const [saving, setSaving] = useState(false); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ api.getLocations().then(setLocationTree).catch(()=>{}); }, []); function toggleLocation(slug, childSlugs = []) { if (locations.includes(slug)) { setLocations(locations.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocations([ ...new Set([ ...locations, slug, ...childSlugs ]) ]); } } async function handleSave() { if (!card) { onNext(); return; } setSaving(true); try { await api.updateSpecialistCard(card.id, { locations }); onNext(); } catch {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step5.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-2", children: t('specialist_setup.step5.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mb-5", children: t('specialist_setup.step5.hint') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3 max-h-72 overflow-y-auto border border-gray-200 rounded-xl p-3 mb-6", children: locationTree.map((city)=>{ const cityName = city.names?.[catLocale] ?? city.names?.el ?? city.slug; const districts = city.children ?? []; const districtSlugs = districts.map((d)=>d.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: locations.includes(city.slug), onChange: ()=>toggleLocation(city.slug, districtSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: cityName }) ] }), districts.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-1.5 space-y-1.5", children: districts.map((d)=>{ const dName = d.names?.[catLocale] ?? d.names?.el ?? d.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: locations.includes(d.slug), onChange: ()=>toggleLocation(d.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: dName }) ] }, d.id); }) }) ] }, city.id); }) }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving, isLast: true }) ] }); } // ─── Done screen ─────────────────────────────────────────────────────────── function StepDone({ t }) { return /*#__PURE__*/ _jsxs("div", { className: "text-center py-4", children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6", children: /*#__PURE__*/ _jsx("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "#16a34a", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _jsx("path", { d: "M20 6L9 17l-5-5" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: t('specialist_setup.done.title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-600 font-medium mb-4", children: t('specialist_setup.done.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm leading-relaxed mb-8 max-w-sm mx-auto", children: t('specialist_setup.done.desc') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col sm:flex-row gap-3 justify-center", children: [ /*#__PURE__*/ _jsx("a", { href: "/profile", className: "px-6 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 transition text-center", children: t('specialist_setup.go_to_profile') }), /*#__PURE__*/ _jsx("a", { href: "/tasks", className: "px-6 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition text-center", children: t('specialist_setup.browse_tasks') }) ] }) ] }); } // ─── Navigation buttons ──────────────────────────────────────────────────── function NavButtons({ t, onBack, onNext, loading, isLast }) { return /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: onBack, className: "flex-1 px-4 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition", children: [ "← ", t('specialist_setup.back') ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: onNext, disabled: loading, className: "flex-[2] px-4 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 transition", children: loading ? '...' : isLast ? t('specialist_setup.finish') : `${t('specialist_setup.next')} →` }) ] }); } // ─── Main page ───────────────────────────────────────────────────────────── export default function SpecialistSetupPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t, locale } = useLocale(); const [step, setStep] = useState(1); const [card, setCard] = useState(null); const catLocale = locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : locale === 'en' ? 'en' : 'el'; process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); if (isPending || !session) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const isDone = step > TOTAL_STEPS; return /*#__PURE__*/ _jsx("div", { className: "min-h-screen py-10 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-lg mx-auto", children: [ /*#__PURE__*/ _jsxs("div", { className: "text-center mb-6", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-lg font-semibold text-white/90", children: t('specialist_setup.page_title') }), !isDone && /*#__PURE__*/ _jsx("p", { className: "text-sm text-white/50 mt-0.5", children: t('specialist_setup.step_of').replace('{current}', String(step)).replace('{total}', String(TOTAL_STEPS)) }) ] }), !isDone && /*#__PURE__*/ _jsx(StepIndicator, { current: step, total: TOTAL_STEPS }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 p-6 shadow-sm", children: [ isDone && /*#__PURE__*/ _jsx(StepDone, { t: t }), step === 1 && /*#__PURE__*/ _jsx(Step1Welcome, { t: t, onNext: ()=>setStep(2) }), step === 2 && /*#__PURE__*/ _jsx(Step2Profile, { t: t, onNext: ()=>setStep(3), onBack: ()=>setStep(1) }), step === 3 && /*#__PURE__*/ _jsx(Step3Card, { t: t, onNext: ()=>setStep(4), onBack: ()=>setStep(2), onCardCreated: setCard }), step === 4 && /*#__PURE__*/ _jsx(Step4Skills, { t: t, onNext: ()=>setStep(5), onBack: ()=>setStep(3), card: card, catLocale: catLocale }), step === 5 && /*#__PURE__*/ _jsx(Step5Geography, { t: t, onNext: ()=>setStep(6), onBack: ()=>setStep(4), card: card, catLocale: catLocale }) ] }), step >= 2 && step <= TOTAL_STEPS && /*#__PURE__*/ _jsx("div", { className: "text-center mt-4", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setStep(step + 1), className: "text-sm text-white/50 hover:text-white/80 transition", children: t('specialist_setup.skip') }) }) ] }) }); } @b={}_46VXQT or  @ C _ 36RV.5el_ ' '5SXn=G7 ; !!"""##$_$%%&&''Z(](**,,--3.6.//1!111t2w2K4N455555_6*61637J7M8Q888@9C999^:a:E;H;==d>h>>>??AAC&CeClCC_CCC#D*DQDXDDDDD.E6EFE\EHHIIIJJJcKgKKKLL^MbMuN_xNjPnPPPSTUUVV3Y7YYYZZf\j\\\]]__````aac_ceef f"h%hjjkk6l=ldlklllll;oRopp@pCpppqqNrQrt_tatet'u*uvv@xCxmyqyKzNz2|5|~~gkqtru(+ڃ݃_>Avzو݈LO=Kތ07ލ\_(X,<?x{fi̘ϘMP(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em"https://api.canhelp.gr"00_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSpecialistCard */ .eR_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bW_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSkillSuggestions */ .rl_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zc_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .CategoryIcon */ .Ez(0,_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .isCategoryIconUrl */ .V)_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vs(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)buffersourcesizemapshashConcatSourceRawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SpecialistSetupPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13260); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(96484); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(44972); ReplaceSourceRawSource/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect, useRef } from 'react'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; import { CategoryIcon, isCategoryIconUrl } from '@/components/CategoryIcon'; const TOTAL_STEPS = 5; // ─── Step indicator ──────────────────────────────────────────────────────── function StepIndicator({ current, total }) { return /*#__PURE__*/ _jsx("div", { className: "flex items-center justify-center gap-2 mb-8", children: Array.from({ length: total }, (_, i)=>i + 1).map((n)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("div", { className: `w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold transition-colors ${n < current ? 'bg-green-500 text-white' : n === current ? 'bg-green-600 text-white ring-4 ring-blue-200' : 'bg-gray-200 text-gray-400'}`, children: n < current ? /*#__PURE__*/ _jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /*#__PURE__*/ _jsx("path", { d: "M2 7l4 4 6-6", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) : n }), n < total && /*#__PURE__*/ _jsx("div", { className: `w-8 h-0.5 ${n < current ? 'bg-green-500' : 'bg-gray-200'}` }) ] }, n)) }); } // ─── Step 1: Welcome ─────────────────────────────────────────────────────── function Step1Welcome({ t, onNext }) { return /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6", children: /*#__PURE__*/ _jsxs("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "#2563eb", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "7", r: "4" }) ] }) }), /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: t('specialist_setup.step1.title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-600 font-medium mb-4", children: t('specialist_setup.step1.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm leading-relaxed mb-8 max-w-sm mx-auto", children: t('specialist_setup.step1.desc') }), /*#__PURE__*/ _jsxs("div", { className: "bg-gray-50 rounded-xl p-5 text-left mb-8 max-w-sm mx-auto", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-gray-700 mb-3", children: t('specialist_setup.step1.what_next') }), /*#__PURE__*/ _jsx("ul", { className: "space-y-2", children: [ t('specialist_setup.step1.item1'), t('specialist_setup.step1.item2'), t('specialist_setup.step1.item3'), t('specialist_setup.step1.item4'), t('specialist_setup.step1.item5') ].map((item, i)=>/*#__PURE__*/ _jsxs("li", { className: "flex items-center gap-2 text-sm text-gray-600", children: [ /*#__PURE__*/ _jsx("span", { className: "w-5 h-5 bg-green-100 text-green-600 rounded-full flex items-center justify-center text-xs font-bold shrink-0", children: i + 1 }), item ] }, i)) }) ] }), /*#__PURE__*/ _jsxs("button", { onClick: onNext, className: "w-full max-w-xs bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 transition", children: [ t('specialist_setup.next'), " →" ] }) ] }); } // ─── Step 2: Basic profile ───────────────────────────────────────────────── function Step2Profile({ t, onNext, onBack }) { const [bio, setBio] = useState(''); const [phone, setPhone] = useState(''); const [saving, setSaving] = useState(false); const [avatarUrl, setAvatarUrl] = useState(null); const [uploading, setUploading] = useState(false); const fileRef = useRef(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ api.request('/users/me', {}).then((u)=>{ setBio(u.bio ?? ''); setPhone(u.phone ?? ''); setAvatarUrl(u.image ?? null); }).catch(()=>{}); }, []); async function handleAvatarChange(e) { const file = e.target.files?.[0]; if (!file) return; setUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch(`${process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'}/api/uploads`, { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = `${process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'}${url}`; await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ image: fullUrl }) }); setAvatarUrl(fullUrl); } catch {} finally{ setUploading(false); if (fileRef.current) fileRef.current.value = ''; } } async function handleSave() { setSaving(true); try { await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ bio: bio || undefined, phone: phone || undefined }) }); onNext(); } catch {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step2.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step2.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-5", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step2.photo_label') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ _jsx("div", { className: "w-16 h-16 rounded-full bg-gray-100 border-2 border-gray-200 overflow-hidden shrink-0 flex items-center justify-center", children: avatarUrl ? /*#__PURE__*/ _jsx("img", { src: avatarUrl, alt: "", className: "w-full h-full object-cover" }) : /*#__PURE__*/ _jsxs("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", stroke: "#9ca3af", strokeWidth: "2", children: [ /*#__PURE__*/ _jsx("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "7", r: "4" }) ] }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>fileRef.current?.click(), disabled: uploading, className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium text-gray-700 disabled:opacity-50 transition", children: uploading ? t('specialist_setup.step2.photo_uploading') : t('specialist_setup.step2.photo_btn') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('specialist_setup.step2.photo_hint') }) ] }), /*#__PURE__*/ _jsx("input", { ref: fileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleAvatarChange }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-4", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step2.bio_label') }), /*#__PURE__*/ _jsx("textarea", { value: bio, onChange: (e)=>setBio(e.target.value), rows: 4, maxLength: 1000, placeholder: t('specialist_setup.step2.bio_placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step2.phone_label') }), /*#__PURE__*/ _jsx("input", { type: "tel", value: phone, onChange: (e)=>setPhone(e.target.value), placeholder: t('specialist_setup.step2.phone_placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 3: Service card ────────────────────────────────────────────────── function Step3Card({ t, onNext, onBack, onCardCreated }) { const [title, setTitle] = useState(''); const [desc, setDesc] = useState(''); const [saving, setSaving] = useState(false); const [error, setError] = useState(''); async function handleSave() { if (!title.trim()) { setError(t('specialist_setup.step3.title_required')); return; } setError(''); setSaving(true); try { const card = await api.createSpecialistCard({ title: title.trim(), description: desc || undefined }); onCardCreated(card); onNext(); } catch {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step3.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step3.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-4", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step3.title_label') }), /*#__PURE__*/ _jsx("input", { value: title, onChange: (e)=>{ setTitle(e.target.value); if (error) setError(''); }, maxLength: 200, placeholder: t('specialist_setup.step3.title_placeholder'), className: `w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ${error ? 'border-red-400' : 'border-gray-300'}` }), error && /*#__PURE__*/ _jsx("p", { className: "text-red-500 text-xs mt-1", children: error }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step3.desc_label') }), /*#__PURE__*/ _jsx("textarea", { value: desc, onChange: (e)=>setDesc(e.target.value), rows: 5, maxLength: 1000, placeholder: t('specialist_setup.step3.desc_placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 4: Skills & Categories ────────────────────────────────────────── function Step4Skills({ t, onNext, onBack, card, catLocale }) { const [skills, setSkills] = useState(card?.skills ?? []); const [skillInput, setSkillInput] = useState(''); const [categories, setCategories] = useState(card?.categories ?? []); const [allCategories, setAllCategories] = useState([]); const [suggestions, setSuggestions] = useState([]); const [saving, setSaving] = useState(false); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ api.getCategories().then(setAllCategories).catch(()=>{}); }, []); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ api.getSkillSuggestions(categories.length > 0 ? categories : undefined).then(setSuggestions).catch(()=>{}); }, [ categories ]); function addSkill(s) { const trimmed = s.trim(); if (trimmed && !skills.includes(trimmed)) setSkills([ ...skills, trimmed ]); setSkillInput(''); } function toggleCategory(slug, childSlugs = []) { if (categories.includes(slug)) { setCategories(categories.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setCategories([ ...new Set([ ...categories, slug, ...childSlugs ]) ]); } } async function handleSave() { if (!card) { onNext(); return; } setSaving(true); try { await api.updateSpecialistCard(card.id, { skills, categories }); onNext(); } catch {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step4.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step4.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step4.skills_label') }), skills.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2 mb-2", children: skills.map((s)=>/*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: [ s, /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSkills(skills.filter((x)=>x !== s)), className: "text-gray-400 hover:text-green-700 leading-none text-base", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') { e.preventDefault(); addSkill(skillInput); } }, placeholder: t('specialist_setup.step4.skills_placeholder'), className: "flex-1 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>addSkill(skillInput), className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium", children: t('specialist_setup.step4.skills_add') }) ] }), suggestions.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mt-2", children: suggestions.map((s)=>s.names[catLocale] ?? s.names.el).filter((name, i, arr)=>arr.indexOf(name) === i && !skills.includes(name)).slice(0, 12).map((name)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>addSkill(name), className: "text-xs px-2.5 py-1 border border-gray-200 rounded-full text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: [ "+ ", name ] }, name)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step4.categories_label') }), /*#__PURE__*/ _jsx("div", { className: "space-y-2 max-h-64 overflow-y-auto border border-gray-200 rounded-xl p-3", children: allCategories.map((cat)=>{ const catName = cat.names?.[catLocale] ?? cat.names?.el ?? cat.slug; const children = cat.children ?? []; const childSlugs = children.map((c)=>c.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: categories.includes(cat.slug), onChange: ()=>toggleCategory(cat.slug, childSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("span", { className: "text-sm font-medium text-gray-800 inline-flex items-center gap-1", children: [ cat.icon && /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: catName, className: isCategoryIconUrl(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }), catName ] }) ] }), children.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-1.5 space-y-1.5", children: children.map((sub)=>{ const subName = sub.names?.[catLocale] ?? sub.names?.el ?? sub.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: categories.includes(sub.slug), onChange: ()=>toggleCategory(sub.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: subName }) ] }, sub.id); }) }) ] }, cat.id); }) }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 5: Geography ───────────────────────────────────────────────────── function Step5Geography({ t, onNext, onBack, card, catLocale }) { const [locations, setLocations] = useState(card?.locations ?? []); const [locationTree, setLocationTree] = useState([]); const [saving, setSaving] = useState(false); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ api.getLocations().then(setLocationTree).catch(()=>{}); }, []); function toggleLocation(slug, childSlugs = []) { if (locations.includes(slug)) { setLocations(locations.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocations([ ...new Set([ ...locations, slug, ...childSlugs ]) ]); } } async function handleSave() { if (!card) { onNext(); return; } setSaving(true); try { await api.updateSpecialistCard(card.id, { locations }); onNext(); } catch {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step5.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-2", children: t('specialist_setup.step5.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mb-5", children: t('specialist_setup.step5.hint') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3 max-h-72 overflow-y-auto border border-gray-200 rounded-xl p-3 mb-6", children: locationTree.map((city)=>{ const cityName = city.names?.[catLocale] ?? city.names?.el ?? city.slug; const districts = city.children ?? []; const districtSlugs = districts.map((d)=>d.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: locations.includes(city.slug), onChange: ()=>toggleLocation(city.slug, districtSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: cityName }) ] }), districts.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-1.5 space-y-1.5", children: districts.map((d)=>{ const dName = d.names?.[catLocale] ?? d.names?.el ?? d.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: locations.includes(d.slug), onChange: ()=>toggleLocation(d.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: dName }) ] }, d.id); }) }) ] }, city.id); }) }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving, isLast: true }) ] }); } // ─── Done screen ─────────────────────────────────────────────────────────── function StepDone({ t }) { return /*#__PURE__*/ _jsxs("div", { className: "text-center py-4", children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6", children: /*#__PURE__*/ _jsx("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "#16a34a", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _jsx("path", { d: "M20 6L9 17l-5-5" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: t('specialist_setup.done.title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-600 font-medium mb-4", children: t('specialist_setup.done.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm leading-relaxed mb-8 max-w-sm mx-auto", children: t('specialist_setup.done.desc') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col sm:flex-row gap-3 justify-center", children: [ /*#__PURE__*/ _jsx("a", { href: "/profile", className: "px-6 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 transition text-center", children: t('specialist_setup.go_to_profile') }), /*#__PURE__*/ _jsx("a", { href: "/tasks", className: "px-6 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition text-center", children: t('specialist_setup.browse_tasks') }) ] }) ] }); } // ─── Navigation buttons ──────────────────────────────────────────────────── function NavButtons({ t, onBack, onNext, loading, isLast }) { return /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: onBack, className: "flex-1 px-4 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition", children: [ "← ", t('specialist_setup.back') ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: onNext, disabled: loading, className: "flex-[2] px-4 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 transition", children: loading ? '...' : isLast ? t('specialist_setup.finish') : `${t('specialist_setup.next')} →` }) ] }); } // ─── Main page ───────────────────────────────────────────────────────────── export default function SpecialistSetupPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t, locale } = useLocale(); const [step, setStep] = useState(1); const [card, setCard] = useState(null); const catLocale = locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : locale === 'en' ? 'en' : 'el'; process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); if (isPending || !session) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const isDone = step > TOTAL_STEPS; return /*#__PURE__*/ _jsx("div", { className: "min-h-screen py-10 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-lg mx-auto", children: [ /*#__PURE__*/ _jsxs("div", { className: "text-center mb-6", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-lg font-semibold text-white/90", children: t('specialist_setup.page_title') }), !isDone && /*#__PURE__*/ _jsx("p", { className: "text-sm text-white/50 mt-0.5", children: t('specialist_setup.step_of').replace('{current}', String(step)).replace('{total}', String(TOTAL_STEPS)) }) ] }), !isDone && /*#__PURE__*/ _jsx(StepIndicator, { current: step, total: TOTAL_STEPS }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 p-6 shadow-sm", children: [ isDone && /*#__PURE__*/ _jsx(StepDone, { t: t }), step === 1 && /*#__PURE__*/ _jsx(Step1Welcome, { t: t, onNext: ()=>setStep(2) }), step === 2 && /*#__PURE__*/ _jsx(Step2Profile, { t: t, onNext: ()=>setStep(3), onBack: ()=>setStep(1) }), step === 3 && /*#__PURE__*/ _jsx(Step3Card, { t: t, onNext: ()=>setStep(4), onBack: ()=>setStep(2), onCardCreated: setCard }), step === 4 && /*#__PURE__*/ _jsx(Step4Skills, { t: t, onNext: ()=>setStep(5), onBack: ()=>setStep(3), card: card, catLocale: catLocale }), step === 5 && /*#__PURE__*/ _jsx(Step5Geography, { t: t, onNext: ()=>setStep(6), onBack: ()=>setStep(4), card: card, catLocale: catLocale }) ] }), step >= 2 && step <= TOTAL_STEPS && /*#__PURE__*/ _jsx("div", { className: "text-center mt-4", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setStep(step + 1), className: "text-sm text-white/50 hover:text-white/80 transition", children: t('specialist_setup.skip') }) }) ] }) }); } .61123undefined125176undefined178221undefined223262undefined264308undefined310342undefined344419undefined593596(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined779783(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined910913(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined12521255(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined14931496(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined19031906(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined22252229(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined23202323(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined24862490(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined28802883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined30363039(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined32733276(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34563459(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined36353638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined38383842(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined40034006(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42244227(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined46904694(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined48904893(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined53575361(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined58445851(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined58885895(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined59345941(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined59895996(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined60436050(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined60806085(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined61496157(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined61736183_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined66386668"https://api.canhelp.gr"undefined667366950undefined69656995"https://api.canhelp.gr"undefined700070220undefined70517061_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined74857495_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined78307834(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined78917894(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined80738076(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined82478251(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined83598362(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined85808584(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined87358738(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined89818984(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined92199223(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined96529655(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined98569859(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1022110225(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1033010333(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1094910952(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1127811281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1171511719(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1182711830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1205612059(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1257312577(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1268512688(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1291612919(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1338713390(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1373113738(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1377313780(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1381913826(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1386613873(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1413114154_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSpecialistCard */ .eRundefined1441314417(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1447414477(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1465614659(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1483014834(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1494214945(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1517315176(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1577315776(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1597215976(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1608416087(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1631416317(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1683416837(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1718317190(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1725317260(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1730717314(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1738717394(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1744317450(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1748917496(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1756117569(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined1758517601_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bWundefined1771017718(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined1773417756_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSkillSuggestions */ .rlundefined1865718680_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zcundefined1888218886(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1894318946(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1912519128(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1929919303(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1941119414(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1966419667(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1980619810(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2008520088(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2058620590(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2072820731(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2150221505(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2197321976(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2225522259(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2283522839(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2294722950(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2318323186(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2365423658(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2376323767(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2398523988(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2448924493(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2477024773(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2477524786_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .CategoryIcon */ .Ezundefined2500025016(0,_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .isCategoryIconUrl */ .V)undefined2553025533(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2587225876(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2611826121(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2665826661(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2726627269(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2762527632(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2770227709(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2774827755(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2782027828(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined2784427859_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vsundefined2847528498_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zcundefined2867528679(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2873628739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2891828921(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2909229095(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2926229265(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2970029704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2979329797(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2999129994(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3045130454(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3078430787(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3108531089(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3130731310(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3179431797(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3227832281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3261532619(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3271532718(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3288132884(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3325033253(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3339433397(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3357633579(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3375433757(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3395633960(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3411034113(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3443134434(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3493434938(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3503335037(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3540435407(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3590135915undefined3599035999(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)undefined3602336031(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined3606236070(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined3610336110(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3614436151(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3631836326(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined3650736510(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3670036703(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3679236796(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3690436908(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3704037043(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3727937282(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3761537618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3776137765(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3794837951(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3807838081(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3826438267(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3850238505(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3878938792(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3911639119(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3950139504(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3961039613(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ })  __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SpecialistSetupPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13260); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(96484); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(44972); /* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect, useRef } from 'react'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; import { CategoryIcon, isCategoryIconUrl } from '@/components/CategoryIcon'; const TOTAL_STEPS = 5; // ─── Step indicator ──────────────────────────────────────────────────────── function StepIndicator({ current, total }) { return /*#__PURE__*/ _jsx("div", { className: "flex items-center justify-center gap-2 mb-8", children: Array.from({ length: total }, (_, i)=>i + 1).map((n)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("div", { className: `w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold transition-colors ${n < current ? 'bg-green-500 text-white' : n === current ? 'bg-green-600 text-white ring-4 ring-blue-200' : 'bg-gray-200 text-gray-400'}`, children: n < current ? /*#__PURE__*/ _jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /*#__PURE__*/ _jsx("path", { d: "M2 7l4 4 6-6", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) : n }), n < total && /*#__PURE__*/ _jsx("div", { className: `w-8 h-0.5 ${n < current ? 'bg-green-500' : 'bg-gray-200'}` }) ] }, n)) }); } // ─── Step 1: Welcome ─────────────────────────────────────────────────────── function Step1Welcome({ t, onNext }) { return /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6", children: /*#__PURE__*/ _jsxs("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "#2563eb", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "7", r: "4" }) ] }) }), /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: t('specialist_setup.step1.title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-600 font-medium mb-4", children: t('specialist_setup.step1.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm leading-relaxed mb-8 max-w-sm mx-auto", children: t('specialist_setup.step1.desc') }), /*#__PURE__*/ _jsxs("div", { className: "bg-gray-50 rounded-xl p-5 text-left mb-8 max-w-sm mx-auto", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-gray-700 mb-3", children: t('specialist_setup.step1.what_next') }), /*#__PURE__*/ _jsx("ul", { className: "space-y-2", children: [ t('specialist_setup.step1.item1'), t('specialist_setup.step1.item2'), t('specialist_setup.step1.item3'), t('specialist_setup.step1.item4'), t('specialist_setup.step1.item5') ].map((item, i)=>/*#__PURE__*/ _jsxs("li", { className: "flex items-center gap-2 text-sm text-gray-600", children: [ /*#__PURE__*/ _jsx("span", { className: "w-5 h-5 bg-green-100 text-green-600 rounded-full flex items-center justify-center text-xs font-bold shrink-0", children: i + 1 }), item ] }, i)) }) ] }), /*#__PURE__*/ _jsxs("button", { onClick: onNext, className: "w-full max-w-xs bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 transition", children: [ t('specialist_setup.next'), " →" ] }) ] }); } // ─── Step 2: Basic profile ───────────────────────────────────────────────── function Step2Profile({ t, onNext, onBack }) { const [bio, setBio] = useState(''); const [phone, setPhone] = useState(''); const [saving, setSaving] = useState(false); const [avatarUrl, setAvatarUrl] = useState(null); const [uploading, setUploading] = useState(false); const fileRef = useRef(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ api.request('/users/me', {}).then((u)=>{ setBio(u.bio ?? ''); setPhone(u.phone ?? ''); setAvatarUrl(u.image ?? null); }).catch(()=>{}); }, []); async function handleAvatarChange(e) { const file = e.target.files?.[0]; if (!file) return; setUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch(`${process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'}/api/uploads`, { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = `${process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'}${url}`; await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ image: fullUrl }) }); setAvatarUrl(fullUrl); } catch {} finally{ setUploading(false); if (fileRef.current) fileRef.current.value = ''; } } async function handleSave() { setSaving(true); try { await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ bio: bio || undefined, phone: phone || undefined }) }); onNext(); } catch {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step2.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step2.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-5", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step2.photo_label') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ _jsx("div", { className: "w-16 h-16 rounded-full bg-gray-100 border-2 border-gray-200 overflow-hidden shrink-0 flex items-center justify-center", children: avatarUrl ? /*#__PURE__*/ _jsx("img", { src: avatarUrl, alt: "", className: "w-full h-full object-cover" }) : /*#__PURE__*/ _jsxs("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", stroke: "#9ca3af", strokeWidth: "2", children: [ /*#__PURE__*/ _jsx("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "7", r: "4" }) ] }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>fileRef.current?.click(), disabled: uploading, className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium text-gray-700 disabled:opacity-50 transition", children: uploading ? t('specialist_setup.step2.photo_uploading') : t('specialist_setup.step2.photo_btn') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('specialist_setup.step2.photo_hint') }) ] }), /*#__PURE__*/ _jsx("input", { ref: fileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleAvatarChange }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-4", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step2.bio_label') }), /*#__PURE__*/ _jsx("textarea", { value: bio, onChange: (e)=>setBio(e.target.value), rows: 4, maxLength: 1000, placeholder: t('specialist_setup.step2.bio_placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step2.phone_label') }), /*#__PURE__*/ _jsx("input", { type: "tel", value: phone, onChange: (e)=>setPhone(e.target.value), placeholder: t('specialist_setup.step2.phone_placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 3: Service card ────────────────────────────────────────────────── function Step3Card({ t, onNext, onBack, onCardCreated }) { const [title, setTitle] = useState(''); const [desc, setDesc] = useState(''); const [saving, setSaving] = useState(false); const [error, setError] = useState(''); async function handleSave() { if (!title.trim()) { setError(t('specialist_setup.step3.title_required')); return; } setError(''); setSaving(true); try { const card = await api.createSpecialistCard({ title: title.trim(), description: desc || undefined }); onCardCreated(card); onNext(); } catch {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step3.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step3.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-4", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step3.title_label') }), /*#__PURE__*/ _jsx("input", { value: title, onChange: (e)=>{ setTitle(e.target.value); if (error) setError(''); }, maxLength: 200, placeholder: t('specialist_setup.step3.title_placeholder'), className: `w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ${error ? 'border-red-400' : 'border-gray-300'}` }), error && /*#__PURE__*/ _jsx("p", { className: "text-red-500 text-xs mt-1", children: error }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step3.desc_label') }), /*#__PURE__*/ _jsx("textarea", { value: desc, onChange: (e)=>setDesc(e.target.value), rows: 5, maxLength: 1000, placeholder: t('specialist_setup.step3.desc_placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 4: Skills & Categories ────────────────────────────────────────── function Step4Skills({ t, onNext, onBack, card, catLocale }) { const [skills, setSkills] = useState(card?.skills ?? []); const [skillInput, setSkillInput] = useState(''); const [categories, setCategories] = useState(card?.categories ?? []); const [allCategories, setAllCategories] = useState([]); const [suggestions, setSuggestions] = useState([]); const [saving, setSaving] = useState(false); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ api.getCategories().then(setAllCategories).catch(()=>{}); }, []); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ api.getSkillSuggestions(categories.length > 0 ? categories : undefined).then(setSuggestions).catch(()=>{}); }, [ categories ]); function addSkill(s) { const trimmed = s.trim(); if (trimmed && !skills.includes(trimmed)) setSkills([ ...skills, trimmed ]); setSkillInput(''); } function toggleCategory(slug, childSlugs = []) { if (categories.includes(slug)) { setCategories(categories.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setCategories([ ...new Set([ ...categories, slug, ...childSlugs ]) ]); } } async function handleSave() { if (!card) { onNext(); return; } setSaving(true); try { await api.updateSpecialistCard(card.id, { skills, categories }); onNext(); } catch {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step4.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step4.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step4.skills_label') }), skills.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2 mb-2", children: skills.map((s)=>/*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: [ s, /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSkills(skills.filter((x)=>x !== s)), className: "text-gray-400 hover:text-green-700 leading-none text-base", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') { e.preventDefault(); addSkill(skillInput); } }, placeholder: t('specialist_setup.step4.skills_placeholder'), className: "flex-1 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>addSkill(skillInput), className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium", children: t('specialist_setup.step4.skills_add') }) ] }), suggestions.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mt-2", children: suggestions.map((s)=>s.names[catLocale] ?? s.names.el).filter((name, i, arr)=>arr.indexOf(name) === i && !skills.includes(name)).slice(0, 12).map((name)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>addSkill(name), className: "text-xs px-2.5 py-1 border border-gray-200 rounded-full text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: [ "+ ", name ] }, name)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step4.categories_label') }), /*#__PURE__*/ _jsx("div", { className: "space-y-2 max-h-64 overflow-y-auto border border-gray-200 rounded-xl p-3", children: allCategories.map((cat)=>{ const catName = cat.names?.[catLocale] ?? cat.names?.el ?? cat.slug; const children = cat.children ?? []; const childSlugs = children.map((c)=>c.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: categories.includes(cat.slug), onChange: ()=>toggleCategory(cat.slug, childSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("span", { className: "text-sm font-medium text-gray-800 inline-flex items-center gap-1", children: [ cat.icon && /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: catName, className: isCategoryIconUrl(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }), catName ] }) ] }), children.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-1.5 space-y-1.5", children: children.map((sub)=>{ const subName = sub.names?.[catLocale] ?? sub.names?.el ?? sub.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: categories.includes(sub.slug), onChange: ()=>toggleCategory(sub.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: subName }) ] }, sub.id); }) }) ] }, cat.id); }) }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 5: Geography ───────────────────────────────────────────────────── function Step5Geography({ t, onNext, onBack, card, catLocale }) { const [locations, setLocations] = useState(card?.locations ?? []); const [locationTree, setLocationTree] = useState([]); const [saving, setSaving] = useState(false); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ api.getLocations().then(setLocationTree).catch(()=>{}); }, []); function toggleLocation(slug, childSlugs = []) { if (locations.includes(slug)) { setLocations(locations.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocations([ ...new Set([ ...locations, slug, ...childSlugs ]) ]); } } async function handleSave() { if (!card) { onNext(); return; } setSaving(true); try { await api.updateSpecialistCard(card.id, { locations }); onNext(); } catch {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step5.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-2", children: t('specialist_setup.step5.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mb-5", children: t('specialist_setup.step5.hint') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3 max-h-72 overflow-y-auto border border-gray-200 rounded-xl p-3 mb-6", children: locationTree.map((city)=>{ const cityName = city.names?.[catLocale] ?? city.names?.el ?? city.slug; const districts = city.children ?? []; const districtSlugs = districts.map((d)=>d.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: locations.includes(city.slug), onChange: ()=>toggleLocation(city.slug, districtSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: cityName }) ] }), districts.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-1.5 space-y-1.5", children: districts.map((d)=>{ const dName = d.names?.[catLocale] ?? d.names?.el ?? d.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: locations.includes(d.slug), onChange: ()=>toggleLocation(d.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: dName }) ] }, d.id); }) }) ] }, city.id); }) }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving, isLast: true }) ] }); } // ─── Done screen ─────────────────────────────────────────────────────────── function StepDone({ t }) { return /*#__PURE__*/ _jsxs("div", { className: "text-center py-4", children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6", children: /*#__PURE__*/ _jsx("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "#16a34a", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _jsx("path", { d: "M20 6L9 17l-5-5" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: t('specialist_setup.done.title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-600 font-medium mb-4", children: t('specialist_setup.done.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm leading-relaxed mb-8 max-w-sm mx-auto", children: t('specialist_setup.done.desc') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col sm:flex-row gap-3 justify-center", children: [ /*#__PURE__*/ _jsx("a", { href: "/profile", className: "px-6 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 transition text-center", children: t('specialist_setup.go_to_profile') }), /*#__PURE__*/ _jsx("a", { href: "/tasks", className: "px-6 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition text-center", children: t('specialist_setup.browse_tasks') }) ] }) ] }); } // ─── Navigation buttons ──────────────────────────────────────────────────── function NavButtons({ t, onBack, onNext, loading, isLast }) { return /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: onBack, className: "flex-1 px-4 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition", children: [ "← ", t('specialist_setup.back') ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: onNext, disabled: loading, className: "flex-[2] px-4 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 transition", children: loading ? '...' : isLast ? t('specialist_setup.finish') : `${t('specialist_setup.next')} →` }) ] }); } // ─── Main page ───────────────────────────────────────────────────────────── export default function SpecialistSetupPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t, locale } = useLocale(); const [step, setStep] = useState(1); const [card, setCard] = useState(null); const catLocale = locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : locale === 'en' ? 'en' : 'el'; process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); if (isPending || !session) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const isDone = step > TOTAL_STEPS; return /*#__PURE__*/ _jsx("div", { className: "min-h-screen py-10 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-lg mx-auto", children: [ /*#__PURE__*/ _jsxs("div", { className: "text-center mb-6", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-lg font-semibold text-white/90", children: t('specialist_setup.page_title') }), !isDone && /*#__PURE__*/ _jsx("p", { className: "text-sm text-white/50 mt-0.5", children: t('specialist_setup.step_of').replace('{current}', String(step)).replace('{total}', String(TOTAL_STEPS)) }) ] }), !isDone && /*#__PURE__*/ _jsx(StepIndicator, { current: step, total: TOTAL_STEPS }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 p-6 shadow-sm", children: [ isDone && /*#__PURE__*/ _jsx(StepDone, { t: t }), step === 1 && /*#__PURE__*/ _jsx(Step1Welcome, { t: t, onNext: ()=>setStep(2) }), step === 2 && /*#__PURE__*/ _jsx(Step2Profile, { t: t, onNext: ()=>setStep(3), onBack: ()=>setStep(1) }), step === 3 && /*#__PURE__*/ _jsx(Step3Card, { t: t, onNext: ()=>setStep(4), onBack: ()=>setStep(2), onCardCreated: setCard }), step === 4 && /*#__PURE__*/ _jsx(Step4Skills, { t: t, onNext: ()=>setStep(5), onBack: ()=>setStep(3), card: card, catLocale: catLocale }), step === 5 && /*#__PURE__*/ _jsx(Step5Geography, { t: t, onNext: ()=>setStep(6), onBack: ()=>setStep(4), card: card, catLocale: catLocale }) ] }), step >= 2 && step <= TOTAL_STEPS && /*#__PURE__*/ _jsx("div", { className: "text-center mt-4", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setStep(step + 1), className: "text-sm text-white/50 hover:text-white/80 transition", children: t('specialist_setup.skip') }) }) ] }) }); } .61123undefined125176undefined178221undefined223262undefined264308undefined310342undefined344419undefined593596(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined779783(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined910913(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined12521255(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined14931496(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined19031906(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined22252229(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined23202323(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined24862490(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined28802883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined30363039(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined32733276(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34563459(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined36353638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined38383842(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined40034006(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42244227(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined46904694(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined48904893(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined53575361(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined58445851(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined58885895(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined59345941(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined59895996(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined60436050(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined60806085(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined61496157(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined61736183_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined66386668"https://api.canhelp.gr"undefined667366950undefined69656995"https://api.canhelp.gr"undefined700070220undefined70517061_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined74857495_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined78307834(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined78917894(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined80738076(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined82478251(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined83598362(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined85808584(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined87358738(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined89818984(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined92199223(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined96529655(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined98569859(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1022110225(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1033010333(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1094910952(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1127811281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1171511719(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1182711830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1205612059(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1257312577(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1268512688(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1291612919(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1338713390(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1373113738(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1377313780(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1381913826(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1386613873(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1413114154_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSpecialistCard */ .eRundefined1441314417(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1447414477(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1465614659(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1483014834(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1494214945(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1517315176(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1577315776(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1597215976(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1608416087(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1631416317(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1683416837(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1718317190(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1725317260(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1730717314(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1738717394(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1744317450(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1748917496(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1756117569(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined1758517601_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bWundefined1771017718(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined1773417756_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSkillSuggestions */ .rlundefined1865718680_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zcundefined1888218886(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1894318946(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1912519128(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1929919303(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1941119414(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1966419667(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1980619810(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2008520088(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2058620590(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2072820731(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2150221505(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2197321976(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2225522259(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2283522839(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2294722950(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2318323186(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2365423658(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2376323767(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2398523988(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2448924493(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2477024773(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2477524786_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .CategoryIcon */ .Ezundefined2500025016(0,_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .isCategoryIconUrl */ .V)undefined2553025533(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2587225876(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2611826121(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2665826661(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2726627269(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2762527632(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2770227709(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2774827755(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2782027828(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined2784427859_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vsundefined2847528498_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zcundefined2867528679(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2873628739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2891828921(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2909229095(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2926229265(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2970029704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2979329797(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2999129994(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3045130454(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3078430787(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3108531089(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3130731310(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3179431797(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3227832281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3261532619(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3271532718(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3288132884(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3325033253(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3339433397(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3357633579(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3375433757(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3395633960(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3411034113(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3443134434(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3493434938(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3503335037(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3540435407(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3590135915undefined3599035999(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)undefined3602336031(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined3606236070(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined3610336110(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3614436151(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3631836326(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined3650736510(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3670036703(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3679236796(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3690436908(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3704037043(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3727937282(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3761537618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3776137765(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3794837951(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3807838081(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3826438267(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3850238505(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3878938792(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3911639119(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3950139504(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3961039613(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 29021:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; module.exports = require("fs");  /***/ }) M/***/ ((module) => { "use strict"; module.exports = require("fs"); /***/ })  module.exports = require("fs");, /***/ 29294:  6webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-async-storage.external.js"); /***/ })  Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");, /***/ 33873:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("path");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("path"); /***/ })  !module.exports = require("path");, /***/ 34631:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("tls");  /***/ }) N/***/ ((module) => { "use strict"; module.exports = require("tls"); /***/ })   module.exports = require("tls");, /***/ 41025:  @webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; amodule.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js"); /***/ })  amodule.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js");, /***/ 44972:  &webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource7import { jsx as _jsx } from "react/jsx-runtime"; import React, { useEffect, useMemo, useState } from 'react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } export function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return `${API_URL}${icon}`; return icon; } export function CategoryIcon({ icon, alt = '', className, fallback = '📦' }) { const value = (icon || '').trim(); const [hasError, setHasError] = useState(false); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ setHasError(false); }, [ value ]); const url = useMemo(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ _jsx("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ _jsx("span", { className: className, children: fallback }); } return /*#__PURE__*/ _jsx("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ _jsx("span", { className: className, children: value || fallback }); } e/1l~V @FPS| "https://api.canhelp.gr"0(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)buffersourcesizemapshash /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); const API_URL = "https://api.canhelp.gr" || 0; function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return `${API_URL}${icon}`; return icon; } function CategoryIcon({ icon, alt = '', className, fallback = '📦' }) { const value = (icon || '').trim(); const [hasError, setHasError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setHasError(false); }, [ value ]); const url = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: fallback }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: value || fallback }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); ReplaceSourceRawSource7import { jsx as _jsx } from "react/jsx-runtime"; import React, { useEffect, useMemo, useState } from 'react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } export function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return `${API_URL}${icon}`; return icon; } export function CategoryIcon({ icon, alt = '', className, fallback = '📦' }) { const value = (icon || '').trim(); const [hasError, setHasError] = useState(false); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ setHasError(false); }, [ value ]); const url = useMemo(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ _jsx("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ _jsx("span", { className: className, children: fallback }); } return /*#__PURE__*/ _jsx("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ _jsx("span", { className: className, children: value || fallback }); } T047undefined49108undefined126156"https://api.canhelp.gr"undefined1611830undefined186192undefined387393undefined515521undefined669676(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined741749(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined832838(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)undefined11041107(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined14041407(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined15471550(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined17541757(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) wB /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); const API_URL = "https://api.canhelp.gr" || 0; function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return `${API_URL}${icon}`; return icon; } function CategoryIcon({ icon, alt = '', className, fallback = '📦' }) { const value = (icon || '').trim(); const [hasError, setHasError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setHasError(false); }, [ value ]); const url = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: fallback }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: value || fallback }); } /***/ }) x{  ||/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); 7import { jsx as _jsx } from "react/jsx-runtime"; import React, { useEffect, useMemo, useState } from 'react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } export function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return `${API_URL}${icon}`; return icon; } export function CategoryIcon({ icon, alt = '', className, fallback = '📦' }) { const value = (icon || '').trim(); const [hasError, setHasError] = useState(false); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ setHasError(false); }, [ value ]); const url = useMemo(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ _jsx("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ _jsx("span", { className: className, children: fallback }); } return /*#__PURE__*/ _jsx("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ _jsx("span", { className: className, children: value || fallback }); } T047undefined49108undefined126156"https://api.canhelp.gr"undefined1611830undefined186192undefined387393undefined515521undefined669676(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined741749(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined832838(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)undefined11041107(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined14041407(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined15471550(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined17541757(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined{}, /***/ 46767:  pwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource `webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource^import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx"); `[Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 28527))buffersourcesizemapshashbPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 28527)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSource^import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx"); l091Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 28527))undefined /***/ }) lsV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { ^import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx"); l091Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 28527))undefinedrt, /***/ 55511:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("crypto");  /***/ }) cQ/***/ ((module) => { "use strict"; module.exports = require("crypto"); /***/ }) dg hij#module.exports = require("crypto");ik, /***/ 55591:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; "module.exports = require("https");  /***/ }) ZP/***/ ((module) => { "use strict"; module.exports = require("https"); /***/ }) [^ _`a"module.exports = require("https");`b, /***/ 63033:  ;webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; \module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js"); /***/ }) RU VWX\module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");WY, /***/ 74075:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("zlib");  /***/ }) HO/***/ ((module) => { "use strict"; module.exports = require("zlib"); /***/ }) IL MNO!module.exports = require("zlib");NP, /***/ 79428:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("buffer");  /***/ }) ?Q/***/ ((module) => { "use strict"; module.exports = require("buffer"); /***/ }) @C DEF#module.exports = require("buffer");EG, /***/ 79551:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("url");  /***/ }) 6N/***/ ((module) => { "use strict"; module.exports = require("url"); /***/ }) 7: ;<= module.exports = require("url");<>, /***/ 79646:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; *module.exports = require("child_process");  /***/ }) -X/***/ ((module) => { "use strict"; module.exports = require("child_process"); /***/ }) .1 234*module.exports = require("child_process");35, /***/ 81630:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("http");  /***/ }) $O/***/ ((module) => { "use strict"; module.exports = require("http"); /***/ }) %( )*+!module.exports = require("http");*,, /***/ 83997:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("tty");  /***/ }) N/***/ ((module) => { "use strict"; module.exports = require("tty"); /***/ })   !" module.exports = require("tty");!#, /***/ 84113:  zwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource%const module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'specialist-setup', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/specialist-setup/page", pathname: "/specialist-setup", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/specialist-setup/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map @bb{_:S.#%ceOQEG_`b   U W G I ' _`bxN#%)1Gjop_=#~ $ H W #!=!!!+"4"\"t"(#;##f$k$_y$q-~-./6$6`6h666 8(888F9N9z::::;;; >L@Y@DDEEH_HHH"IUIM#MTTaT VV[[``aaaacbnb d+dpd{dddff,g:gi_illrrrstuAuVuwwd}r}тt)@Peے֓ɔԔ_vUbȞݞLaϢ s~SlT{+6̷/JMYhCJJX,>Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2069))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))__webpack_require__next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModulenext_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind".next"0 falsefalse{}(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERnext_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADER(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)0(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestnext_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponsenext_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T) true(__webpack_require__(33873).join)0next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERnext_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERnext_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARnext_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERnext_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodenext_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSnext_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKind(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)buffersourcesizemapshash__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); const module0 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570)); const module1 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23)); const module2 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506)); const module3 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23)); const module4 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23)); const page5 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2069)); // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'specialist-setup', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))).default(props))], apple: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))).default(props))], apple: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx"]; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; // Create and export the route module that will be consumed. const routeModule = new next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModule({ definition: { kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, page: "/specialist-setup/page", pathname: "/specialist-setup", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: ".next" || 0, relativeProjectDir: false || '' }); async function handler(req, res, ctx) { var _this; let srcPage = "/specialist-setup/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const initialPostponed = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)(userAgent); const isHtmlBot = (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isPrefetchRSCRequest') ?? req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isRSCRequest') ?? Boolean(req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADER]); const isPossibleServerAction = (0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = (0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = false && 0; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { (0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)(req.headers); } const ComponentMod = { ...next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__, tree, pages, GlobalError: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default()), handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { (0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: (0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequest(req); const nextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (false) {} return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: (0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: true ? (__webpack_require__(33873).join)(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : 0, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = (0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.PRERENDER && (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND) { throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.PAGES, html: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && ((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'renderFallbackShell') || isDebugFallbackShell) ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(matchedSegment, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(cachedData.rscData, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map {"finalSource":true}mapbufferedMap ConcatSourceRawSource#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); ReplaceSourceRawSource%const module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'specialist-setup', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/specialist-setup/page", pathname: "/specialist-setup", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/specialist-setup/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map $'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558649Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2069))undefined652792undefined794908undefined910986undefined9881059undefined10611123undefined11251194undefined11961272undefined12741359undefined13611444undefined14461522undefined15241605undefined16071700undefined17021806undefined18081888undefined18901968undefined19702061undefined20632244undefined22462322undefined23242389undefined23912464undefined24662523undefined25252631undefined26332706undefined27082772undefined27742855undefined32843506Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined35643793Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined43534575Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined46334862Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined50565078undefined50805216undefined52185240undefined52715289__webpack_require__undefined53475353undefined54545580undefined55825667undefined56695782undefined58455851undefined58765893next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined59295937next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined62156250".next"undefined625562560undefined62836321 falseundefined63336339undefined66306650falseundefined66536717{}undefined68636902falseundefined69346947(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined70387051(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined78177832(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined82198228(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined82648279(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined84248437(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined84838509next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined86888701(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined87478756next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined87968820(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined90009019(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined92119318 falseundefined932393370undefined1163311646(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1203112058(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1384313860(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1392013928next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1397913978: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1434714376(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1450814528(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1466214670(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1497014984next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1502415039next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1526715304falseundefined1530715882{}undefined1646016473next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1756017573(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1785217865(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1858418620 trueundefined1862418643(__webpack_require__(33873).join)undefined18722187730undefined1973419747(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2158821601(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2202522046next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2348523499next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2474524762(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2505125062next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2507725081(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2518725198next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2563225643next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2571225723next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2581225823next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2635626367next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2641226426next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2707827086next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2783227853(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2938129395next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2943429445next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2994729960(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3001730038(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3061330621next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3210032114next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3346633489next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3595635969next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3626436278next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3716137184next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3745637477next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3759537616next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3784637861(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3808938100next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3812938151next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3880738822(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3903039041next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3930439317(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3976539778(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4064840669next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4154841569next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4167941700next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4225342270next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4247442497next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4339343408(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4443644451(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4465944670next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4470344725next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4544245554falseundefined4555745907{}undefined4593245947(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4689146902next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4703747052(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4766347690falseundefined4769347763{}undefined4907149085next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined5000950024(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5089950912next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5101151018next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5127451288next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5150051518(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefined /***/ })  $#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); %%const module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'specialist-setup', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/specialist-setup/page", pathname: "/specialist-setup", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/specialist-setup/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map $'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558649Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2069))undefined652792undefined794908undefined910986undefined9881059undefined10611123undefined11251194undefined11961272undefined12741359undefined13611444undefined14461522undefined15241605undefined16071700undefined17021806undefined18081888undefined18901968undefined19702061undefined20632244undefined22462322undefined23242389undefined23912464undefined24662523undefined25252631undefined26332706undefined27082772undefined27742855undefined32843506Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined35643793Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined43534575Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined46334862Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined50565078undefined50805216undefined52185240undefined52715289__webpack_require__undefined53475353undefined54545580undefined55825667undefined56695782undefined58455851undefined58765893next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined59295937next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined62156250".next"undefined625562560undefined62836321 falseundefined63336339undefined66306650falseundefined66536717{}undefined68636902falseundefined69346947(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined70387051(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined78177832(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined82198228(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined82648279(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined84248437(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined84838509next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined86888701(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined87478756next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined87968820(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined90009019(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined92119318 falseundefined932393370undefined1163311646(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1203112058(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1384313860(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1392013928next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1397913978: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1434714376(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1450814528(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1466214670(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1497014984next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1502415039next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1526715304falseundefined1530715882{}undefined1646016473next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1756017573(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1785217865(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1858418620 trueundefined1862418643(__webpack_require__(33873).join)undefined18722187730undefined1973419747(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2158821601(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2202522046next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2348523499next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2474524762(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2505125062next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2507725081(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2518725198next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2563225643next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2571225723next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2581225823next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2635626367next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2641226426next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2707827086next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2783227853(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2938129395next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2943429445next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2994729960(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3001730038(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3061330621next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3210032114next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3346633489next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3595635969next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3626436278next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3716137184next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3745637477next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3759537616next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3784637861(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3808938100next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3812938151next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3880738822(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3903039041next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3930439317(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3976539778(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4064840669next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4154841569next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4167941700next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4225342270next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4247442497next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4339343408(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4443644451(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4465944670next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4470344725next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4544245554falseundefined4555745907{}undefined4593245947(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4689146902next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4703747052(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4766347690falseundefined4769347763{}undefined4907149085next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined5000950024(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5089950912next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5101151018next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5127451288next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5150051518(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefined, /***/ 86439:  +webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");  /***/ })  z/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/no-fallback-error.external"); /***/ })    Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");, /***/ 91645:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("net");  /***/ }) N/***/ ((module) => { "use strict"; module.exports = require("net"); /***/ })   module.exports = require("net");, /***/ 93623:  mwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource _webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource^import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx"); `[Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2069))buffersourcesizemapshashaPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2069)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSource^import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx"); k091Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2069))undefined /***/ })  k091Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2069))undefined, /***/ 94735:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("events");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("events"); /***/ })  #module.exports = require("events");w }; ; // load runtime var __webpack_require__ = require("../../webpack-runtime.js"); __webpack_require__.C(exports); var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [901,652,809], () => (__webpack_exec__(84113))); ,module.exports = __webpack_exports__; })(); Y@`b(() => { var exports = {}; exports.id = 442; exports.ids = [442]; exports.modules = { /***/ 261: _mno, /***/ 2069: ^^|`:// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx", "default", ); 61134undefined136150/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (undefined136150undefined151173(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined568568.5);undefinedlm\nolp\nqlv\nwl}\n~l\nl\nl, /***/ 28527: [[]k[mk[mk[mk[mk[mk, /***/ 44972: ZZ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); [7import { jsx as _jsx } from "react/jsx-runtime"; import React, { useEffect, useMemo, useState } from 'react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } export function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return `${API_URL}${icon}`; return icon; } export function CategoryIcon({ icon, alt = '', className, fallback = '📦' }) { const value = (icon || '').trim(); const [hasError, setHasError] = useState(false); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ setHasError(false); }, [ value ]); const url = useMemo(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ _jsx("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ _jsx("span", { className: className, children: fallback }); } return /*#__PURE__*/ _jsx("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ _jsx("span", { className: className, children: value || fallback }); } T047undefined49108undefined126156"https://api.canhelp.gr"undefined1611830undefined186192undefined387393undefined515521undefined669676(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined741749(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined832838(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)undefined11041107(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined14041407(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined15471550(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined17541757(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefinedg, /***/ 46767: VmX^import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx"); l091Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 28527))undefined d Tf  d Tf  d Tf  d Tf  d Tf  d Tf  d Tf  d Tf  d Tf  d , /***/ 84113: SSU%const module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'specialist-setup', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/specialist-setup/page", pathname: "/specialist-setup", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/specialist-setup/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map $'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558649Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2069))undefined652792undefined794908undefined910986undefined9881059undefined10611123undefined11251194undefined11961272undefined12741359undefined13611444undefined14461522undefined15241605undefined16071700undefined17021806undefined18081888undefined18901968undefined19702061undefined20632244undefined22462322undefined23242389undefined23912464undefined24662523undefined25252631undefined26332706undefined27082772undefined27742855undefined32843506Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined35643793Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined43534575Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined46334862Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined50565078undefined50805216undefined52185240undefined52715289__webpack_require__undefined53475353undefined54545580undefined55825667undefined56695782undefined58455851undefined58765893next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined59295937next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined62156250".next"undefined625562560undefined62836321 falseundefined63336339undefined66306650falseundefined66536717{}undefined68636902falseundefined69346947(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined70387051(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined78177832(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined82198228(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined82648279(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined84248437(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined84838509next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined86888701(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined87478756next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined87968820(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined90009019(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined92119318 falseundefined932393370undefined1163311646(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1203112058(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1384313860(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1392013928next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1397913978: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1434714376(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1450814528(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1466214670(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1497014984next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1502415039next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1526715304falseundefined1530715882{}undefined1646016473next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1756017573(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1785217865(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1858418620 trueundefined1862418643(__webpack_require__(33873).join)undefined18722187730undefined1973419747(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2158821601(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2202522046next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2348523499next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2474524762(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2505125062next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2507725081(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2518725198next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2563225643next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2571225723next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2581225823next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2635626367next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2641226426next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2707827086next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2783227853(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2938129395next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2943429445next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2994729960(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3001730038(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3061330621next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3210032114next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3346633489next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3595635969next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3626436278next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3716137184next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3745637477next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3759537616next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3784637861(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3808938100next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3812938151next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3880738822(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3903039041next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3930439317(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3976539778(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4064840669next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4154841569next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4167941700next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4225342270next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4247442497next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4339343408(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4443644451(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4465944670next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4470344725next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4544245554falseundefined4555745907{}undefined4593245947(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4689146902next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4703747052(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4766347690falseundefined4769347763{}undefined4907149085next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined5000950024(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5089950912next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5101151018next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5127451288next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5150051518(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefinedaQcaQca, /***/ 93623: PgRk091Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2069))undefined_Oa_var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [901,652,809], () => (__webpack_exec__(84113)));  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSource`Cwebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceb(() => { var exports = {}; exports.id = 755; exports.ids = [755]; exports.modules = { /***/ 261: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource 'webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Hmodule.exports = require("next/dist/shared/lib/router/utils/app-paths");  /***/ }) buffersourcesizemapshashv/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }) {"finalSource":true}mapbufferedMap ConcatSourceRawSource$/***/ ((module) => { "use strict";  RawSourceHmodule.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }), /***/ 3295:  <webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; ]module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js"); /***/ })  ]module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");, /***/ 10846:  3webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js"); /***/ })  Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");, /***/ 17320:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceimport(/* webpackMode: "eager", webpackExports: ["FavoriteSpecialistButton"] */ "/opt/canhelp/apps/web/src/components/FavoriteSpecialistButton.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["SpecialistsFiltersClient"] */ "/opt/canhelp/apps/web/src/components/SpecialistsFiltersClient.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["__esModule","default"] */ "/opt/canhelp/node_modules/next/dist/client/app-dir/link.js"); D+0Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 30284))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 84237))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 94496, 23))buffersourcesizemapshash0Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 30284)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 84237)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 94496, 23)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceimport(/* webpackMode: "eager", webpackExports: ["FavoriteSpecialistButton"] */ "/opt/canhelp/apps/web/src/components/FavoriteSpecialistButton.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["SpecialistsFiltersClient"] */ "/opt/canhelp/apps/web/src/components/SpecialistsFiltersClient.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["__esModule","default"] */ "/opt/canhelp/node_modules/next/dist/client/app-dir/link.js"); Q0147Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 30284))undefined152299Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 84237))undefined304440Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 94496, 23))undefined /***/ }) V/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { ReplaceSourceRawSourceimport(/* webpackMode: "eager", webpackExports: ["FavoriteSpecialistButton"] */ "/opt/canhelp/apps/web/src/components/FavoriteSpecialistButton.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["SpecialistsFiltersClient"] */ "/opt/canhelp/apps/web/src/components/SpecialistsFiltersClient.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["__esModule","default"] */ "/opt/canhelp/node_modules/next/dist/client/app-dir/link.js"); Q0147Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 30284))undefined152299Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 84237))undefined304440Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 94496, 23))undefined, /***/ 19121:  8webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Ymodule.exports = require("next/dist/server/app-render/action-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/action-async-storage.external.js"); /***/ })  Ymodule.exports = require("next/dist/server/app-render/action-async-storage.external.js");, /***/ 26713:  $webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Emodule.exports = require("next/dist/shared/lib/router/utils/is-bot");  /***/ }) s/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/is-bot"); /***/ })  Emodule.exports = require("next/dist/shared/lib/router/utils/is-bot");, /***/ 27910:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("stream");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("stream"); /***/ })  #module.exports = require("stream");, /***/ 28354:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("util");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("util"); /***/ })  !module.exports = require("util");, /***/ 29021:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; module.exports = require("fs");  /***/ }) M/***/ ((module) => { "use strict"; module.exports = require("fs"); /***/ })  module.exports = require("fs");, /***/ 29294:  6webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-async-storage.external.js"); /***/ })  Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");, /***/ 30284:  #webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourcej/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FavoriteSpecialistButton: () => (/* binding */ FavoriteSpecialistButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13260); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(91864); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource/* __next_internal_client_entry_do_not_use__ FavoriteSpecialistButton auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { useState } from 'react'; import { useSession } from '@/lib/auth'; import { addSpecialistFavorite, removeSpecialistFavorite } from '@/lib/api'; export function FavoriteSpecialistButton({ specialistId, initialFavorite = false, favoriteLabel, unfavoriteLabel }) { const { data: session } = useSession(); const [isFavorite, setIsFavorite] = useState(initialFavorite); const [loading, setLoading] = useState(false); if (!session) return null; async function toggle(e) { e.preventDefault(); e.stopPropagation(); setLoading(true); try { if (isFavorite) { await removeSpecialistFavorite(specialistId); setIsFavorite(false); } else { await addSpecialistFavorite(specialistId); setIsFavorite(true); } } catch {} setLoading(false); } return /*#__PURE__*/ _jsx("button", { onClick: toggle, disabled: loading, title: isFavorite ? unfavoriteLabel : favoriteLabel, className: `absolute top-3 right-3 w-8 h-8 flex items-center justify-center rounded-full text-base transition disabled:opacity-50 ${isFavorite ? 'bg-pink-50 text-pink-500 hover:bg-pink-100' : 'bg-gray-50 text-gray-300 hover:text-pink-400 hover:bg-pink-50'}`, children: isFavorite ? '❤️' : '🤍' }); } c N}R%{!$(0,_lib_auth__WEBPACK_IMPORTED_MODULE_2__/* .useSession */ .wV)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .removeSpecialistFavorite */ .sD)(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .addSpecialistFavorite */ .V)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)buffersourcesizemapshashConcatSourceRawSourcej/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FavoriteSpecialistButton: () => (/* binding */ FavoriteSpecialistButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13260); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(91864); ReplaceSourceRawSource/* __next_internal_client_entry_do_not_use__ FavoriteSpecialistButton auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { useState } from 'react'; import { useSession } from '@/lib/auth'; import { addSpecialistFavorite, removeSpecialistFavorite } from '@/lib/api'; export function FavoriteSpecialistButton({ specialistId, initialFavorite = false, favoriteLabel, unfavoriteLabel }) { const { data: session } = useSession(); const [isFavorite, setIsFavorite] = useState(initialFavorite); const [loading, setLoading] = useState(false); if (!session) return null; async function toggle(e) { e.preventDefault(); e.stopPropagation(); setLoading(true); try { if (isFavorite) { await removeSpecialistFavorite(specialistId); setIsFavorite(false); } else { await addSpecialistFavorite(specialistId); setIsFavorite(true); } } catch {} setLoading(false); } return /*#__PURE__*/ _jsx("button", { onClick: toggle, disabled: loading, title: isFavorite ? unfavoriteLabel : favoriteLabel, className: `absolute top-3 right-3 w-8 h-8 flex items-center justify-center rounded-full text-base transition disabled:opacity-50 ${isFavorite ? 'bg-pink-50 text-pink-500 hover:bg-pink-100' : 'bg-gray-50 text-gray-300 hover:text-pink-400 hover:bg-pink-50'}`, children: isFavorite ? '❤️' : '🤍' }); }  78125undefined127159undefined161200undefined202277undefined279285undefined427436(0,_lib_auth__WEBPACK_IMPORTED_MODULE_2__/* .useSession */ .wV)undefined481488(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined542549(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined770793(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .removeSpecialistFavorite */ .sD)undefined891911(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .addSpecialistFavorite */ .V)undefined10571060(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ })  _/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; j/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FavoriteSpecialistButton: () => (/* binding */ FavoriteSpecialistButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13260); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(91864); /* __next_internal_client_entry_do_not_use__ FavoriteSpecialistButton auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { useState } from 'react'; import { useSession } from '@/lib/auth'; import { addSpecialistFavorite, removeSpecialistFavorite } from '@/lib/api'; export function FavoriteSpecialistButton({ specialistId, initialFavorite = false, favoriteLabel, unfavoriteLabel }) { const { data: session } = useSession(); const [isFavorite, setIsFavorite] = useState(initialFavorite); const [loading, setLoading] = useState(false); if (!session) return null; async function toggle(e) { e.preventDefault(); e.stopPropagation(); setLoading(true); try { if (isFavorite) { await removeSpecialistFavorite(specialistId); setIsFavorite(false); } else { await addSpecialistFavorite(specialistId); setIsFavorite(true); } } catch {} setLoading(false); } return /*#__PURE__*/ _jsx("button", { onClick: toggle, disabled: loading, title: isFavorite ? unfavoriteLabel : favoriteLabel, className: `absolute top-3 right-3 w-8 h-8 flex items-center justify-center rounded-full text-base transition disabled:opacity-50 ${isFavorite ? 'bg-pink-50 text-pink-500 hover:bg-pink-100' : 'bg-gray-50 text-gray-300 hover:text-pink-400 hover:bg-pink-50'}`, children: isFavorite ? '❤️' : '🤍' }); }  78125undefined127159undefined161200undefined202277undefined279285undefined427436(0,_lib_auth__WEBPACK_IMPORTED_MODULE_2__/* .useSession */ .wV)undefined481488(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined542549(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined770793(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .removeSpecialistFavorite */ .sD)undefined891911(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .addSpecialistFavorite */ .V)undefined10571060(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 30472:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceimport(/* webpackMode: "eager", webpackExports: ["FavoriteSpecialistButton"] */ "/opt/canhelp/apps/web/src/components/FavoriteSpecialistButton.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["SpecialistsFiltersClient"] */ "/opt/canhelp/apps/web/src/components/SpecialistsFiltersClient.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["__esModule","default"] */ "/opt/canhelp/node_modules/next/dist/client/app-dir/link.js"); D+0Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 57650))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 50815))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3498, 23))buffersourcesizemapshash/Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 57650)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 50815)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3498, 23)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceimport(/* webpackMode: "eager", webpackExports: ["FavoriteSpecialistButton"] */ "/opt/canhelp/apps/web/src/components/FavoriteSpecialistButton.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["SpecialistsFiltersClient"] */ "/opt/canhelp/apps/web/src/components/SpecialistsFiltersClient.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["__esModule","default"] */ "/opt/canhelp/node_modules/next/dist/client/app-dir/link.js"); P0147Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 57650))undefined152299Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 50815))undefined304440Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3498, 23))undefined /***/ }) P0147Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 57650))undefined152299Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 50815))undefined304440Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3498, 23))undefined, /***/ 33873:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("path");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("path"); /***/ })  !module.exports = require("path");, /***/ 34631:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("tls");  /***/ }) N/***/ ((module) => { "use strict"; module.exports = require("tls"); /***/ })   module.exports = require("tls");, /***/ 41025:  @webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; amodule.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js");  /***/ }) y/***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js"); /***/ }) z} ~amodule.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js");, /***/ 50815:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ SpecialistsFiltersClient: () => (/* binding */ SpecialistsFiltersClient) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceL// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const SpecialistsFiltersClient = registerClientReference( function() { throw new Error("Attempted to call SpecialistsFiltersClient() from the server but SpecialistsFiltersClient is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/components/SpecialistsFiltersClient.tsx", "SpecialistsFiltersClient", ); `=D(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)buffersourcesizemapshash-/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ SpecialistsFiltersClient: () => (/* binding */ SpecialistsFiltersClient) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. const SpecialistsFiltersClient = (0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)( function() { throw new Error("Attempted to call SpecialistsFiltersClient() from the server but SpecialistsFiltersClient is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/components/SpecialistsFiltersClient.tsx", "SpecialistsFiltersClient", ); {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ SpecialistsFiltersClient: () => (/* binding */ SpecialistsFiltersClient) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); ReplaceSourceRawSourceL// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const SpecialistsFiltersClient = registerClientReference( function() { throw new Error("Attempted to call SpecialistsFiltersClient() from the server but SpecialistsFiltersClient is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/components/SpecialistsFiltersClient.tsx", "SpecialistsFiltersClient", );61134undefined136142undefined176198(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined /***/ }) p ww/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ SpecialistsFiltersClient: () => (/* binding */ SpecialistsFiltersClient) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); L// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const SpecialistsFiltersClient = registerClientReference( function() { throw new Error("Attempted to call SpecialistsFiltersClient() from the server but SpecialistsFiltersClient is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/components/SpecialistsFiltersClient.tsx", "SpecialistsFiltersClient", );61134undefined136142undefined176198(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefinedvx, /***/ 55511:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("crypto");  /***/ }) gQ/***/ ((module) => { "use strict"; module.exports = require("crypto"); /***/ }) hk lmn#module.exports = require("crypto");mo, /***/ 55591:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; "module.exports = require("https");  /***/ }) ^P/***/ ((module) => { "use strict"; module.exports = require("https"); /***/ }) _b cde"module.exports = require("https");df, /***/ 57650:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FavoriteSpecialistButton: () => (/* binding */ FavoriteSpecialistButton) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceL// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const FavoriteSpecialistButton = registerClientReference( function() { throw new Error("Attempted to call FavoriteSpecialistButton() from the server but FavoriteSpecialistButton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/components/FavoriteSpecialistButton.tsx", "FavoriteSpecialistButton", ); `=D(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)buffersourcesizemapshash-/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FavoriteSpecialistButton: () => (/* binding */ FavoriteSpecialistButton) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. const FavoriteSpecialistButton = (0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)( function() { throw new Error("Attempted to call FavoriteSpecialistButton() from the server but FavoriteSpecialistButton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/components/FavoriteSpecialistButton.tsx", "FavoriteSpecialistButton", ); {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FavoriteSpecialistButton: () => (/* binding */ FavoriteSpecialistButton) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); ReplaceSourceRawSourceL// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const FavoriteSpecialistButton = registerClientReference( function() { throw new Error("Attempted to call FavoriteSpecialistButton() from the server but FavoriteSpecialistButton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/components/FavoriteSpecialistButton.tsx", "FavoriteSpecialistButton", );61134undefined136142undefined176198(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined /***/ }) U \\/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FavoriteSpecialistButton: () => (/* binding */ FavoriteSpecialistButton) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); yL// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const FavoriteSpecialistButton = registerClientReference( function() { throw new Error("Attempted to call FavoriteSpecialistButton() from the server but FavoriteSpecialistButton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/components/FavoriteSpecialistButton.tsx", "FavoriteSpecialistButton", );\^, /***/ 60928:  ^webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource _Lwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource=// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ SpecialistsPage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(5939); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(3498); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ../../node_modules/next/dist/api/headers.js var headers = __webpack_require__(56057); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(59902); // EXTERNAL MODULE: ./src/lib/translations.ts var translations = __webpack_require__(75112); ;// ./src/lib/formatName.ts webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!fullName?.trim()) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return `${parts[0]} ${parts[1][0].toUpperCase()}.`; } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName?.trim()) { const l = lastName?.trim(); return l ? `${firstName.trim()} ${l[0].toUpperCase()}.` : firstName.trim(); } return shortName(fallbackName); } C buffersourcesizemapshash/** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!fullName?.trim()) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return `${parts[0]} ${parts[1][0].toUpperCase()}.`; } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ function formatShortName(firstName, lastName, fallbackName) { if (firstName?.trim()) { const l = lastName?.trim(); return l ? `${firstName.trim()} ${l[0].toUpperCase()}.` : firstName.trim(); } return shortName(fallbackName); } ReplaceSourceRawSource$/** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!fullName?.trim()) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return `${parts[0]} ${parts[1][0].toUpperCase()}.`; } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName?.trim()) { const l = lastName?.trim(); return l ? `${firstName.trim()} ${l[0].toUpperCase()}.` : firstName.trim(); } return shortName(fallbackName); } 136142undefined523529undefined! ;// ./src/lib/formatLastSeen.ts  webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceWexport function formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); } Pfunction formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); } Wexport function formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); }  06undefined // EXTERNAL MODULE: ./src/components/FavoriteSpecialistButton.tsx var FavoriteSpecialistButton = __webpack_require__(57650); // EXTERNAL MODULE: ./src/components/SpecialistsFiltersClient.tsx var SpecialistsFiltersClient = __webpack_require__(50815); ;// ./src/components/PlanBadge.tsx  webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge({ tier, verified, size = 'sm', className = '' }) { if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: `inline-flex items-center gap-1 rounded-full font-semibold ${sizeClass} ${tierConfig[tier].class} ${className}`, children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: `inline-flex items-center gap-0.5 rounded-full font-semibold ${sizeClass} bg-green-100 text-green-700 border border-green-200 ${className}`, children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: `inline-flex items-center rounded-full font-semibold ${sizeClass} ${cfg.class} ${className}`, children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon({ className = '' }) { return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon({ className = '' }) { return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } b>_VY9<]`'* U X ' *  C __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._ const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; function PlanBadge({ tier, verified, size = 'sm', className = '' }) { if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: `inline-flex items-center gap-1 rounded-full font-semibold ${sizeClass} ${tierConfig[tier].class} ${className}`, children: [ tier === 'ultimate' ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: `inline-flex items-center gap-0.5 rounded-full font-semibold ${sizeClass} bg-green-100 text-green-700 border border-green-200 ${className}`, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: `inline-flex items-center rounded-full font-semibold ${sizeClass} ${cfg.class} ${className}`, children: [ tier === 'pro' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon({ className = '' }) { return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon({ className = '' }) { return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge({ tier, verified, size = 'sm', className = '' }) { if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: `inline-flex items-center gap-1 rounded-full font-semibold ${sizeClass} ${tierConfig[tier].class} ${className}`, children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: `inline-flex items-center gap-0.5 rounded-full font-semibold ${sizeClass} bg-green-100 text-green-700 border border-green-200 ${className}`, children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: `inline-flex items-center rounded-full font-semibold ${sizeClass} ${cfg.class} ${className}`, children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon({ className = '' }) { return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon({ className = '' }) { return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } 9062undefined342345__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined513516__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined910913__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined10811084__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined12631269undefined15501554__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined17781781__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined18851888__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined20872090__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined23022305__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined24522456__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined26452648__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined27782781__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined29832986__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31113114__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined33403344__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined34833486__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined37433746__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined`_a S'0Z  ;  ! ~A(0,react_jsx_runtime.jsx)(0,react_jsx_runtime.jsxs)$ ;// ./src/app/specialists/page.tsx  Kwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceCimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import Link from 'next/link'; import { cookies } from 'next/headers'; import { getSpecialists, getCategories, getLocations } from '@/lib/api'; import { getTranslations } from '@/lib/translations'; import { formatShortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { FavoriteSpecialistButton } from '@/components/FavoriteSpecialistButton'; import { SpecialistsFiltersClient } from '@/components/SpecialistsFiltersClient'; import { PlanBadge } from '@/components/PlanBadge'; export default async function SpecialistsPage({ searchParams }) { const params = await searchParams; const page = Number(params.page || 1); const cookieStore = await cookies(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const t = getTranslations(locale); const cookieLocation = decodeURIComponent(cookieStore.get('canhelp_location')?.value ?? ''); // Location filter only applies when explicitly set in URL params, not from cookie const effectiveLocation = params.location; let specialists = []; let total = 0; let catTree = []; let locationTree = []; let favoriteIds = new Set(); const BASE = process.env.INTERNAL_API_URL || 'http://localhost:4000'; const cookieHeader = cookieStore.getAll().map((c)=>`${c.name}=${c.value}`).join('; '); try { const [result, cats, locs] = await Promise.all([ getSpecialists({ page: String(page), limit: '20', locale, ...params, ...effectiveLocation ? { location: effectiveLocation } : {} }), getCategories().catch(()=>[]), getLocations().catch(()=>[]) ]); console.log('[SpecialistsPage] got', result.total, 'specialists, data.length=', result.data.length); specialists = result.data; total = result.total; catTree = cats; locationTree = locs; } catch (err) { console.error('[SpecialistsPage] fetch error:', err); } if (cookieHeader) { try { const favRes = await fetch(`${BASE}/api/favorites/specialists`, { headers: { Cookie: cookieHeader } }); if (favRes.ok) { const favData = await favRes.json(); favoriteIds = new Set(favData.map((row)=>row.specialist?.id).filter(Boolean)); } } catch {} } const totalPages = Math.ceil(total / 20); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const buildUrl = (overrides)=>{ const merged = { ...params, ...effectiveLocation ? { location: effectiveLocation } : {}, ...overrides }; const qs = Object.entries(merged).filter(([, v])=>v !== undefined && v !== '').map(([k, v])=>`${k}=${encodeURIComponent(v)}`).join('&'); return `/specialists${qs ? '?' + qs : ''}`; }; return /*#__PURE__*/ _jsx("div", { className: "max-w-7xl mx-auto px-4 py-8", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-col md:flex-row gap-8", children: [ /*#__PURE__*/ _jsx("aside", { className: "md:w-64 shrink-0", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 mb-4", children: t('tasks.search') }), /*#__PURE__*/ _jsx(SpecialistsFiltersClient, { catTree: catTree, locations: locationTree, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialLanguages: params.language ? params.language.split(',').filter(Boolean) : [] }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ (params.q || params.category || params.location || params.language) && /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs("h1", { className: "text-xl font-bold text-white", children: [ total, " ", t('specialists.title').toLowerCase() ] }) }), specialists.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/70", children: /*#__PURE__*/ _jsx("p", { className: "text-lg", children: t('specialists.empty') }) }) : /*#__PURE__*/ _jsx("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: specialists.map((user)=>{ const displayName = formatShortName(user.firstName, user.lastName, user.name); const initials = `${user.firstName?.[0] ?? ''}${user.lastName?.[0] ?? ''}`.toUpperCase() || user.name?.[0]?.toUpperCase() || '?'; return /*#__PURE__*/ _jsxs("div", { className: "relative bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-green-300 transition flex flex-col", children: [ /*#__PURE__*/ _jsx(Link, { href: `/users/${user.id}`, className: "absolute inset-0 rounded-xl", "aria-label": displayName }), /*#__PURE__*/ _jsx(FavoriteSpecialistButton, { specialistId: user.id, initialFavorite: favoriteIds.has(user.id), favoriteLabel: t('specialist.favorite'), unfavoriteLabel: t('specialist.unfavorite') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: user.image ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-900 truncate", children: displayName }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now') ] }), user.rating && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-yellow-400 text-sm", children: "★" }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-700", children: Number(user.rating).toFixed(1) }) ] }), user.todayStatus === 'available' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), user.todayStatus === 'busy' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-red-700 bg-red-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), user.cards && user.cards.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-1.5 mb-2", children: [ user.cards.slice(0, 2).map((card)=>/*#__PURE__*/ _jsx("span", { className: "text-xs bg-gray-100 text-gray-700 px-2 py-0.5 rounded-full font-medium", children: card.title }, card.id)), user.cards.length > 2 && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "+", user.cards.length - 2 ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 line-clamp-2 flex-1 mt-1", children: user.bio || t('specialists.no_bio') }), user.lastSeenAt && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-3", children: formatLastSeen(user.lastSeenAt, t) }) ] }, user.id); }) }), totalPages > 1 && /*#__PURE__*/ _jsx("div", { className: "flex justify-center gap-2 mt-8", children: Array.from({ length: totalPages }, (_, i)=>i + 1).map((p)=>/*#__PURE__*/ _jsx(Link, { href: buildUrl({ page: String(p) }), className: `w-10 h-10 flex items-center justify-center rounded-lg text-sm font-medium ${p === page ? 'bg-green-600 text-white' : 'bg-white border border-gray-200 text-gray-700 hover:border-green-400'}`, children: p }, p)) }) ] }) ] }) }); } e?>@\^_79npFHVXf I M _ 7;IM  be7EIMhkmp_`cY ] ?!B!""####%%%%'')),)Y+]+x,{,--<0X@01133V5Y588998;<;d=g=>>??L?S@V@UAXAZA]A__WEBPACK_MODULE_REFERENCE__2_5b22636f6f6b696573225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__4_5b226765745472616e736c6174696f6e73225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__3_5b226765745370656369616c69737473225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__3_5b2267657443617465676f72696573225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__3_5b226765744c6f636174696f6e73225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__8_5b225370656369616c6973747346696c74657273436c69656e74225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__7_5b224661766f726974655370656369616c697374427574746f6e225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b22666f726d61744c6173745365656e225d_call_directImport_asiSafe1__._KP async function SpecialistsPage({ searchParams }) { const params = await searchParams; const page = Number(params.page || 1); const cookieStore = await __WEBPACK_MODULE_REFERENCE__2_5b22636f6f6b696573225d_call_directImport_asiSafe1__._(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const t = __WEBPACK_MODULE_REFERENCE__4_5b226765745472616e736c6174696f6e73225d_call_directImport_asiSafe1__._(locale); const cookieLocation = decodeURIComponent(cookieStore.get('canhelp_location')?.value ?? ''); // Location filter only applies when explicitly set in URL params, not from cookie const effectiveLocation = params.location; let specialists = []; let total = 0; let catTree = []; let locationTree = []; let favoriteIds = new Set(); const BASE = process.env.INTERNAL_API_URL || 'http://localhost:4000'; const cookieHeader = cookieStore.getAll().map((c)=>`${c.name}=${c.value}`).join('; '); try { const [result, cats, locs] = await Promise.all([ __WEBPACK_MODULE_REFERENCE__3_5b226765745370656369616c69737473225d_call_directImport_asiSafe1__._({ page: String(page), limit: '20', locale, ...params, ...effectiveLocation ? { location: effectiveLocation } : {} }), __WEBPACK_MODULE_REFERENCE__3_5b2267657443617465676f72696573225d_call_directImport_asiSafe1__._().catch(()=>[]), __WEBPACK_MODULE_REFERENCE__3_5b226765744c6f636174696f6e73225d_call_directImport_asiSafe1__._().catch(()=>[]) ]); console.log('[SpecialistsPage] got', result.total, 'specialists, data.length=', result.data.length); specialists = result.data; total = result.total; catTree = cats; locationTree = locs; } catch (err) { console.error('[SpecialistsPage] fetch error:', err); } if (cookieHeader) { try { const favRes = await fetch(`${BASE}/api/favorites/specialists`, { headers: { Cookie: cookieHeader } }); if (favRes.ok) { const favData = await favRes.json(); favoriteIds = new Set(favData.map((row)=>row.specialist?.id).filter(Boolean)); } } catch {} } const totalPages = Math.ceil(total / 20); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const buildUrl = (overrides)=>{ const merged = { ...params, ...effectiveLocation ? { location: effectiveLocation } : {}, ...overrides }; const qs = Object.entries(merged).filter(([, v])=>v !== undefined && v !== '').map(([k, v])=>`${k}=${encodeURIComponent(v)}`).join('&'); return `/specialists${qs ? '?' + qs : ''}`; }; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "max-w-7xl mx-auto px-4 py-8", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex flex-col md:flex-row gap-8", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("aside", { className: "md:w-64 shrink-0", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h3", { className: "font-semibold text-gray-900 mb-4", children: t('tasks.search') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__8_5b225370656369616c6973747346696c74657273436c69656e74225d_directImport_asiSafe1__._, { catTree: catTree, locations: locationTree, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialLanguages: params.language ? params.language.split(',').filter(Boolean) : [] }) ] }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex-1", children: [ (params.q || params.category || params.location || params.language) && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "mb-6", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("h1", { className: "text-xl font-bold text-white", children: [ total, " ", t('specialists.title').toLowerCase() ] }) }), specialists.length === 0 ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "text-center py-20 text-white/70", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-lg", children: t('specialists.empty') }) }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: specialists.map((user)=>{ const displayName = __WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._(user.firstName, user.lastName, user.name); const initials = `${user.firstName?.[0] ?? ''}${user.lastName?.[0] ?? ''}`.toUpperCase() || user.name?.[0]?.toUpperCase() || '?'; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "relative bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-green-300 transition flex flex-col", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: `/users/${user.id}`, className: "absolute inset-0 rounded-xl", "aria-label": displayName }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__7_5b224661766f726974655370656369616c697374427574746f6e225d_directImport_asiSafe1__._, { specialistId: user.id, initialFavorite: favoriteIds.has(user.id), favoriteLabel: t('specialist.favorite'), unfavoriteLabel: t('specialist.unfavorite') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: user.image ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { className: "font-semibold text-gray-900 truncate", children: displayName }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-2 flex-wrap", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__._, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__._, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now') ] }), user.rating && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-yellow-400 text-sm", children: "★" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-sm font-medium text-gray-700", children: Number(user.rating).toFixed(1) }) ] }), user.todayStatus === 'available' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), user.todayStatus === 'busy' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-red-700 bg-red-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), user.cards && user.cards.length > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex flex-wrap gap-1.5 mb-2", children: [ user.cards.slice(0, 2).map((card)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-xs bg-gray-100 text-gray-700 px-2 py-0.5 rounded-full font-medium", children: card.title }, card.id)), user.cards.length > 2 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-xs text-gray-400", children: [ "+", user.cards.length - 2 ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-sm text-gray-500 line-clamp-2 flex-1 mt-1", children: user.bio || t('specialists.no_bio') }), user.lastSeenAt && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs text-gray-400 mt-3", children: __WEBPACK_MODULE_REFERENCE__6_5b22666f726d61744c6173745365656e225d_call_directImport_asiSafe1__._(user.lastSeenAt, t) }) ] }, user.id); }) }), totalPages > 1 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "flex justify-center gap-2 mt-8", children: Array.from({ length: totalPages }, (_, i)=>i + 1).map((p)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: buildUrl({ page: String(p) }), className: `w-10 h-10 flex items-center justify-center rounded-lg text-sm font-medium ${p === page ? 'bg-green-600 text-white' : 'bg-white border border-gray-200 text-gray-700 hover:border-green-400'}`, children: p }, p)) }) ] }) ] }) }); } Cimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import Link from 'next/link'; import { cookies } from 'next/headers'; import { getSpecialists, getCategories, getLocations } from '@/lib/api'; import { getTranslations } from '@/lib/translations'; import { formatShortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { FavoriteSpecialistButton } from '@/components/FavoriteSpecialistButton'; import { SpecialistsFiltersClient } from '@/components/SpecialistsFiltersClient'; import { PlanBadge } from '@/components/PlanBadge'; export default async function SpecialistsPage({ searchParams }) { const params = await searchParams; const page = Number(params.page || 1); const cookieStore = await cookies(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const t = getTranslations(locale); const cookieLocation = decodeURIComponent(cookieStore.get('canhelp_location')?.value ?? ''); // Location filter only applies when explicitly set in URL params, not from cookie const effectiveLocation = params.location; let specialists = []; let total = 0; let catTree = []; let locationTree = []; let favoriteIds = new Set(); const BASE = process.env.INTERNAL_API_URL || 'http://localhost:4000'; const cookieHeader = cookieStore.getAll().map((c)=>`${c.name}=${c.value}`).join('; '); try { const [result, cats, locs] = await Promise.all([ getSpecialists({ page: String(page), limit: '20', locale, ...params, ...effectiveLocation ? { location: effectiveLocation } : {} }), getCategories().catch(()=>[]), getLocations().catch(()=>[]) ]); console.log('[SpecialistsPage] got', result.total, 'specialists, data.length=', result.data.length); specialists = result.data; total = result.total; catTree = cats; locationTree = locs; } catch (err) { console.error('[SpecialistsPage] fetch error:', err); } if (cookieHeader) { try { const favRes = await fetch(`${BASE}/api/favorites/specialists`, { headers: { Cookie: cookieHeader } }); if (favRes.ok) { const favData = await favRes.json(); favoriteIds = new Set(favData.map((row)=>row.specialist?.id).filter(Boolean)); } } catch {} } const totalPages = Math.ceil(total / 20); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const buildUrl = (overrides)=>{ const merged = { ...params, ...effectiveLocation ? { location: effectiveLocation } : {}, ...overrides }; const qs = Object.entries(merged).filter(([, v])=>v !== undefined && v !== '').map(([k, v])=>`${k}=${encodeURIComponent(v)}`).join('&'); return `/specialists${qs ? '?' + qs : ''}`; }; return /*#__PURE__*/ _jsx("div", { className: "max-w-7xl mx-auto px-4 py-8", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-col md:flex-row gap-8", children: [ /*#__PURE__*/ _jsx("aside", { className: "md:w-64 shrink-0", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 mb-4", children: t('tasks.search') }), /*#__PURE__*/ _jsx(SpecialistsFiltersClient, { catTree: catTree, locations: locationTree, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialLanguages: params.language ? params.language.split(',').filter(Boolean) : [] }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ (params.q || params.category || params.location || params.language) && /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs("h1", { className: "text-xl font-bold text-white", children: [ total, " ", t('specialists.title').toLowerCase() ] }) }), specialists.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/70", children: /*#__PURE__*/ _jsx("p", { className: "text-lg", children: t('specialists.empty') }) }) : /*#__PURE__*/ _jsx("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: specialists.map((user)=>{ const displayName = formatShortName(user.firstName, user.lastName, user.name); const initials = `${user.firstName?.[0] ?? ''}${user.lastName?.[0] ?? ''}`.toUpperCase() || user.name?.[0]?.toUpperCase() || '?'; return /*#__PURE__*/ _jsxs("div", { className: "relative bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-green-300 transition flex flex-col", children: [ /*#__PURE__*/ _jsx(Link, { href: `/users/${user.id}`, className: "absolute inset-0 rounded-xl", "aria-label": displayName }), /*#__PURE__*/ _jsx(FavoriteSpecialistButton, { specialistId: user.id, initialFavorite: favoriteIds.has(user.id), favoriteLabel: t('specialist.favorite'), unfavoriteLabel: t('specialist.unfavorite') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: user.image ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-900 truncate", children: displayName }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now') ] }), user.rating && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-yellow-400 text-sm", children: "★" }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-700", children: Number(user.rating).toFixed(1) }) ] }), user.todayStatus === 'available' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), user.todayStatus === 'busy' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-red-700 bg-red-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), user.cards && user.cards.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-1.5 mb-2", children: [ user.cards.slice(0, 2).map((card)=>/*#__PURE__*/ _jsx("span", { className: "text-xs bg-gray-100 text-gray-700 px-2 py-0.5 rounded-full font-medium", children: card.title }, card.id)), user.cards.length > 2 && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "+", user.cards.length - 2 ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 line-clamp-2 flex-1 mt-1", children: user.bio || t('specialists.no_bio') }), user.lastSeenAt && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-3", children: formatLastSeen(user.lastSeenAt, t) }) ] }, user.id); }) }), totalPages > 1 && /*#__PURE__*/ _jsx("div", { className: "flex justify-center gap-2 mt-8", children: Array.from({ length: totalPages }, (_, i)=>i + 1).map((p)=>/*#__PURE__*/ _jsx(Link, { href: buildUrl({ page: String(p) }), className: `w-10 h-10 flex items-center justify-center rounded-lg text-sm font-medium ${p === page ? 'bg-green-600 text-white' : 'bg-white border border-gray-200 text-gray-700 hover:border-green-400'}`, children: p }, p)) }) ] }) ] }) }); } s062undefined6492undefined94132undefined134205undefined207259undefined261311undefined313366undefined368448undefined450530undefined532582undefined584598undefined762768__WEBPACK_MODULE_REFERENCE__2_5b22636f6f6b696573225d_call_directImport_asiSafe1__._undefined856870__WEBPACK_MODULE_REFERENCE__4_5b226765745472616e736c6174696f6e73225d_call_directImport_asiSafe1__._undefined14831496__WEBPACK_MODULE_REFERENCE__3_5b226765745370656369616c69737473225d_call_directImport_asiSafe1__._undefined17561768__WEBPACK_MODULE_REFERENCE__3_5b2267657443617465676f72696573225d_call_directImport_asiSafe1__._undefined17991810__WEBPACK_MODULE_REFERENCE__3_5b226765744c6f636174696f6e73225d_call_directImport_asiSafe1__._undefined33053308__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined34013405__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined35283531__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined36393643__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined38313834__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined40574060__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined40624085__WEBPACK_MODULE_REFERENCE__8_5b225370656369616c6973747346696c74657273436c69656e74225d_directImport_asiSafe1__._undefined46274631__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined48244827__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined49374941__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined53855388__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined55255528__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined57305733__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined59435957__WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._undefined62176221__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined65046507__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined65096512__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined68426845__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined68476870__WEBPACK_MODULE_REFERENCE__7_5b224661766f726974655370656369616c697374427574746f6e225d_directImport_asiSafe1__._undefined73007304__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined75207523__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined78447847__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined82818285__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined85118514__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined88478851__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined91659168__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined91709178__WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined96519654__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined96569664__WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1014610150__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1053710540__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1109711101__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1138411387__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1176511768__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1234812352__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1271612719__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1329013294__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1365413657__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1452014524__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1477414777__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1516015164__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1571615719__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1604016043__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1619116204__WEBPACK_MODULE_REFERENCE__6_5b22666f726d61744c6173745365656e225d_call_directImport_asiSafe1__._undefined1646716470__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1672516728__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1673016733__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined`4_W~[2 | % V^B`m%q-w_J^0GI*,I!!m""#B$%@&"'l'()?****_,,-R-4//1M1z334+566399:5;p==$?n?BCD]DE(FPHHI%JGJK LjLiMMMN(0,headers/* cookies */.UL)(0,translations/* getTranslations */.$)(0,api/* getSpecialists */.F7)(0,api/* getCategories */.bW)(0,api/* getLocations */.Vs)SpecialistsFiltersClient.SpecialistsFiltersClientformatShortName(link_default())FavoriteSpecialistButton.FavoriteSpecialistButtonPlanBadgeformatLastSeenbuffersourcesizemapshash`ConcatSourceRawSource=// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ SpecialistsPage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(5939); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(3498); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ../../node_modules/next/dist/api/headers.js var headers = __webpack_require__(56057); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(59902); // EXTERNAL MODULE: ./src/lib/translations.ts var translations = __webpack_require__(75112); ;// ./src/lib/formatName.ts  ReplaceSourceReplaceSourceRawSource$/** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!fullName?.trim()) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return `${parts[0]} ${parts[1][0].toUpperCase()}.`; } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName?.trim()) { const l = lastName?.trim(); return l ? `${firstName.trim()} ${l[0].toUpperCase()}.` : firstName.trim(); } return shortName(fallbackName); } 136142undefined523529undefined RawSource! ;// ./src/lib/formatLastSeen.ts Wexport function formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); }  06undefined // EXTERNAL MODULE: ./src/components/FavoriteSpecialistButton.tsx var FavoriteSpecialistButton = __webpack_require__(57650); // EXTERNAL MODULE: ./src/components/SpecialistsFiltersClient.tsx var SpecialistsFiltersClient = __webpack_require__(50815); ;// ./src/components/PlanBadge.tsx import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge({ tier, verified, size = 'sm', className = '' }) { if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: `inline-flex items-center gap-1 rounded-full font-semibold ${sizeClass} ${tierConfig[tier].class} ${className}`, children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: `inline-flex items-center gap-0.5 rounded-full font-semibold ${sizeClass} bg-green-100 text-green-700 border border-green-200 ${className}`, children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: `inline-flex items-center rounded-full font-semibold ${sizeClass} ${cfg.class} ${className}`, children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon({ className = '' }) { return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon({ className = '' }) { return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } 9062undefined342345__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined513516__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined910913__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined10811084__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined12631269undefined15501554__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined17781781__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined18851888__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined20872090__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined23022305__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined24522456__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined26452648__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined27782781__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined29832986__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31113114__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined33403344__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined34833486__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined37433746__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined279353(0,react_jsx_runtime.jsx)undefined521595(0,react_jsx_runtime.jsx)undefined9891063(0,react_jsx_runtime.jsx)undefined12311305(0,react_jsx_runtime.jsx)undefined17641840(0,react_jsx_runtime.jsxs)undefined20642138(0,react_jsx_runtime.jsx)undefined22422316(0,react_jsx_runtime.jsx)undefined25152589(0,react_jsx_runtime.jsx)undefined28012875(0,react_jsx_runtime.jsx)undefined30223098(0,react_jsx_runtime.jsxs)undefined32873361(0,react_jsx_runtime.jsx)undefined34913565(0,react_jsx_runtime.jsx)undefined37673841(0,react_jsx_runtime.jsx)undefined39664040(0,react_jsx_runtime.jsx)undefined42664342(0,react_jsx_runtime.jsxs)undefined44814555(0,react_jsx_runtime.jsx)undefined48124886(0,react_jsx_runtime.jsx)undefinedRawSource$ ;// ./src/app/specialists/page.tsx Cimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import Link from 'next/link'; import { cookies } from 'next/headers'; import { getSpecialists, getCategories, getLocations } from '@/lib/api'; import { getTranslations } from '@/lib/translations'; import { formatShortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { FavoriteSpecialistButton } from '@/components/FavoriteSpecialistButton'; import { SpecialistsFiltersClient } from '@/components/SpecialistsFiltersClient'; import { PlanBadge } from '@/components/PlanBadge'; export default async function SpecialistsPage({ searchParams }) { const params = await searchParams; const page = Number(params.page || 1); const cookieStore = await cookies(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const t = getTranslations(locale); const cookieLocation = decodeURIComponent(cookieStore.get('canhelp_location')?.value ?? ''); // Location filter only applies when explicitly set in URL params, not from cookie const effectiveLocation = params.location; let specialists = []; let total = 0; let catTree = []; let locationTree = []; let favoriteIds = new Set(); const BASE = process.env.INTERNAL_API_URL || 'http://localhost:4000'; const cookieHeader = cookieStore.getAll().map((c)=>`${c.name}=${c.value}`).join('; '); try { const [result, cats, locs] = await Promise.all([ getSpecialists({ page: String(page), limit: '20', locale, ...params, ...effectiveLocation ? { location: effectiveLocation } : {} }), getCategories().catch(()=>[]), getLocations().catch(()=>[]) ]); console.log('[SpecialistsPage] got', result.total, 'specialists, data.length=', result.data.length); specialists = result.data; total = result.total; catTree = cats; locationTree = locs; } catch (err) { console.error('[SpecialistsPage] fetch error:', err); } if (cookieHeader) { try { const favRes = await fetch(`${BASE}/api/favorites/specialists`, { headers: { Cookie: cookieHeader } }); if (favRes.ok) { const favData = await favRes.json(); favoriteIds = new Set(favData.map((row)=>row.specialist?.id).filter(Boolean)); } } catch {} } const totalPages = Math.ceil(total / 20); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const buildUrl = (overrides)=>{ const merged = { ...params, ...effectiveLocation ? { location: effectiveLocation } : {}, ...overrides }; const qs = Object.entries(merged).filter(([, v])=>v !== undefined && v !== '').map(([k, v])=>`${k}=${encodeURIComponent(v)}`).join('&'); return `/specialists${qs ? '?' + qs : ''}`; }; return /*#__PURE__*/ _jsx("div", { className: "max-w-7xl mx-auto px-4 py-8", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-col md:flex-row gap-8", children: [ /*#__PURE__*/ _jsx("aside", { className: "md:w-64 shrink-0", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 mb-4", children: t('tasks.search') }), /*#__PURE__*/ _jsx(SpecialistsFiltersClient, { catTree: catTree, locations: locationTree, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialLanguages: params.language ? params.language.split(',').filter(Boolean) : [] }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ (params.q || params.category || params.location || params.language) && /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs("h1", { className: "text-xl font-bold text-white", children: [ total, " ", t('specialists.title').toLowerCase() ] }) }), specialists.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/70", children: /*#__PURE__*/ _jsx("p", { className: "text-lg", children: t('specialists.empty') }) }) : /*#__PURE__*/ _jsx("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: specialists.map((user)=>{ const displayName = formatShortName(user.firstName, user.lastName, user.name); const initials = `${user.firstName?.[0] ?? ''}${user.lastName?.[0] ?? ''}`.toUpperCase() || user.name?.[0]?.toUpperCase() || '?'; return /*#__PURE__*/ _jsxs("div", { className: "relative bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-green-300 transition flex flex-col", children: [ /*#__PURE__*/ _jsx(Link, { href: `/users/${user.id}`, className: "absolute inset-0 rounded-xl", "aria-label": displayName }), /*#__PURE__*/ _jsx(FavoriteSpecialistButton, { specialistId: user.id, initialFavorite: favoriteIds.has(user.id), favoriteLabel: t('specialist.favorite'), unfavoriteLabel: t('specialist.unfavorite') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: user.image ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-900 truncate", children: displayName }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now') ] }), user.rating && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-yellow-400 text-sm", children: "★" }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-700", children: Number(user.rating).toFixed(1) }) ] }), user.todayStatus === 'available' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), user.todayStatus === 'busy' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-red-700 bg-red-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), user.cards && user.cards.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-1.5 mb-2", children: [ user.cards.slice(0, 2).map((card)=>/*#__PURE__*/ _jsx("span", { className: "text-xs bg-gray-100 text-gray-700 px-2 py-0.5 rounded-full font-medium", children: card.title }, card.id)), user.cards.length > 2 && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "+", user.cards.length - 2 ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 line-clamp-2 flex-1 mt-1", children: user.bio || t('specialists.no_bio') }), user.lastSeenAt && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-3", children: formatLastSeen(user.lastSeenAt, t) }) ] }, user.id); }) }), totalPages > 1 && /*#__PURE__*/ _jsx("div", { className: "flex justify-center gap-2 mt-8", children: Array.from({ length: totalPages }, (_, i)=>i + 1).map((p)=>/*#__PURE__*/ _jsx(Link, { href: buildUrl({ page: String(p) }), className: `w-10 h-10 flex items-center justify-center rounded-lg text-sm font-medium ${p === page ? 'bg-green-600 text-white' : 'bg-white border border-gray-200 text-gray-700 hover:border-green-400'}`, children: p }, p)) }) ] }) ] }) }); } s062undefined6492undefined94132undefined134205undefined207259undefined261311undefined313366undefined368448undefined450530undefined532582undefined584598undefined762768__WEBPACK_MODULE_REFERENCE__2_5b22636f6f6b696573225d_call_directImport_asiSafe1__._undefined856870__WEBPACK_MODULE_REFERENCE__4_5b226765745472616e736c6174696f6e73225d_call_directImport_asiSafe1__._undefined14831496__WEBPACK_MODULE_REFERENCE__3_5b226765745370656369616c69737473225d_call_directImport_asiSafe1__._undefined17561768__WEBPACK_MODULE_REFERENCE__3_5b2267657443617465676f72696573225d_call_directImport_asiSafe1__._undefined17991810__WEBPACK_MODULE_REFERENCE__3_5b226765744c6f636174696f6e73225d_call_directImport_asiSafe1__._undefined33053308__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined34013405__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined35283531__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined36393643__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined38313834__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined40574060__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined40624085__WEBPACK_MODULE_REFERENCE__8_5b225370656369616c6973747346696c74657273436c69656e74225d_directImport_asiSafe1__._undefined46274631__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined48244827__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined49374941__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined53855388__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined55255528__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined57305733__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined59435957__WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._undefined62176221__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined65046507__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined65096512__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined68426845__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined68476870__WEBPACK_MODULE_REFERENCE__7_5b224661766f726974655370656369616c697374427574746f6e225d_directImport_asiSafe1__._undefined73007304__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined75207523__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined78447847__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined82818285__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined85118514__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined88478851__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined91659168__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined91709178__WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined96519654__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined96569664__WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1014610150__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1053710540__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1109711101__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1138411387__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1176511768__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1234812352__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1271612719__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1329013294__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1365413657__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1452014524__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1477414777__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1516015164__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1571615719__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1604016043__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1619116204__WEBPACK_MODULE_REFERENCE__6_5b22666f726d61744c6173745365656e225d_call_directImport_asiSafe1__._undefined1646716470__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1672516728__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1673016733__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined173255(0,headers/* cookies */.UL)undefined343441(0,translations/* getTranslations */.$)undefined10541150(0,api/* getSpecialists */.F7)undefined14101504(0,api/* getCategories */.bW)undefined15351627(0,api/* getLocations */.Vs)undefined31223196(0,react_jsx_runtime.jsx)undefined32893365(0,react_jsx_runtime.jsxs)undefined34883562(0,react_jsx_runtime.jsx)undefined36703746(0,react_jsx_runtime.jsxs)undefined39344008(0,react_jsx_runtime.jsx)undefined42314305(0,react_jsx_runtime.jsx)undefined43074418SpecialistsFiltersClient.SpecialistsFiltersClientundefined49605036(0,react_jsx_runtime.jsxs)undefined52295303(0,react_jsx_runtime.jsx)undefined54135489(0,react_jsx_runtime.jsxs)undefined59336007(0,react_jsx_runtime.jsx)undefined61446218(0,react_jsx_runtime.jsx)undefined64206494(0,react_jsx_runtime.jsx)undefined67046802formatShortNameundefined70627138(0,react_jsx_runtime.jsxs)undefined74217495(0,react_jsx_runtime.jsx)undefined74977574(link_default())undefined79047978(0,react_jsx_runtime.jsx)undefined79808091FavoriteSpecialistButton.FavoriteSpecialistButtonundefined85218597(0,react_jsx_runtime.jsxs)undefined88138887(0,react_jsx_runtime.jsx)undefined92089282(0,react_jsx_runtime.jsx)undefined97169792(0,react_jsx_runtime.jsxs)undefined1001810092(0,react_jsx_runtime.jsx)undefined1042510501(0,react_jsx_runtime.jsxs)undefined1081510889(0,react_jsx_runtime.jsx)undefined1089110972PlanBadgeundefined1144511519(0,react_jsx_runtime.jsx)undefined1152111602PlanBadgeundefined1208412160(0,react_jsx_runtime.jsxs)undefined1254712621(0,react_jsx_runtime.jsx)undefined1317813254(0,react_jsx_runtime.jsxs)undefined1353713611(0,react_jsx_runtime.jsx)undefined1398914063(0,react_jsx_runtime.jsx)undefined1464314719(0,react_jsx_runtime.jsxs)undefined1508315157(0,react_jsx_runtime.jsx)undefined1572815804(0,react_jsx_runtime.jsxs)undefined1616416238(0,react_jsx_runtime.jsx)undefined1710117177(0,react_jsx_runtime.jsxs)undefined1742717501(0,react_jsx_runtime.jsx)undefined1788417960(0,react_jsx_runtime.jsxs)undefined1851218586(0,react_jsx_runtime.jsx)undefined1890718981(0,react_jsx_runtime.jsx)undefined1912919225formatLastSeenundefined1948819562(0,react_jsx_runtime.jsx)undefined1981719891(0,react_jsx_runtime.jsx)undefined1989319970(link_default())undefined /***/ }) M`TT=// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ SpecialistsPage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(5939); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(3498); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ../../node_modules/next/dist/api/headers.js var headers = __webpack_require__(56057); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(59902); // EXTERNAL MODULE: ./src/lib/translations.ts var translations = __webpack_require__(75112); ;// ./src/lib/formatName.ts  ReplaceSourcep$/** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!fullName?.trim()) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return `${parts[0]} ${parts[1][0].toUpperCase()}.`; } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName?.trim()) { const l = lastName?.trim(); return l ? `${firstName.trim()} ${l[0].toUpperCase()}.` : firstName.trim(); } return shortName(fallbackName); } 136142undefined523529undefinedR! ;// ./src/lib/formatLastSeen.ts mWexport function formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); }  06undefinedO // EXTERNAL MODULE: ./src/components/FavoriteSpecialistButton.tsx var FavoriteSpecialistButton = __webpack_require__(57650); // EXTERNAL MODULE: ./src/components/SpecialistsFiltersClient.tsx var SpecialistsFiltersClient = __webpack_require__(50815); ;// ./src/components/PlanBadge.tsx jimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge({ tier, verified, size = 'sm', className = '' }) { if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: `inline-flex items-center gap-1 rounded-full font-semibold ${sizeClass} ${tierConfig[tier].class} ${className}`, children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: `inline-flex items-center gap-0.5 rounded-full font-semibold ${sizeClass} bg-green-100 text-green-700 border border-green-200 ${className}`, children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: `inline-flex items-center rounded-full font-semibold ${sizeClass} ${cfg.class} ${className}`, children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon({ className = '' }) { return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon({ className = '' }) { return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } 9062undefined342345__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined513516__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined910913__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined10811084__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined12631269undefined15501554__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined17781781__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined18851888__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined20872090__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined23022305__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined24522456__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined26452648__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined27782781__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined29832986__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31113114__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined33403344__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined34833486__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined37433746__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined279353(0,react_jsx_runtime.jsx)undefined521595(0,react_jsx_runtime.jsx)undefined9891063(0,react_jsx_runtime.jsx)undefined12311305(0,react_jsx_runtime.jsx)undefined17641840(0,react_jsx_runtime.jsxs)undefined20642138(0,react_jsx_runtime.jsx)undefined22422316(0,react_jsx_runtime.jsx)undefined25152589(0,react_jsx_runtime.jsx)undefined28012875(0,react_jsx_runtime.jsx)undefined30223098(0,react_jsx_runtime.jsxs)undefined32873361(0,react_jsx_runtime.jsx)undefined34913565(0,react_jsx_runtime.jsx)undefined37673841(0,react_jsx_runtime.jsx)undefined39664040(0,react_jsx_runtime.jsx)undefined42664342(0,react_jsx_runtime.jsxs)undefined44814555(0,react_jsx_runtime.jsx)undefined48124886(0,react_jsx_runtime.jsx)undefinedRawSource$ ;// ./src/app/specialists/page.tsx fCimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import Link from 'next/link'; import { cookies } from 'next/headers'; import { getSpecialists, getCategories, getLocations } from '@/lib/api'; import { getTranslations } from '@/lib/translations'; import { formatShortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { FavoriteSpecialistButton } from '@/components/FavoriteSpecialistButton'; import { SpecialistsFiltersClient } from '@/components/SpecialistsFiltersClient'; import { PlanBadge } from '@/components/PlanBadge'; export default async function SpecialistsPage({ searchParams }) { const params = await searchParams; const page = Number(params.page || 1); const cookieStore = await cookies(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const t = getTranslations(locale); const cookieLocation = decodeURIComponent(cookieStore.get('canhelp_location')?.value ?? ''); // Location filter only applies when explicitly set in URL params, not from cookie const effectiveLocation = params.location; let specialists = []; let total = 0; let catTree = []; let locationTree = []; let favoriteIds = new Set(); const BASE = process.env.INTERNAL_API_URL || 'http://localhost:4000'; const cookieHeader = cookieStore.getAll().map((c)=>`${c.name}=${c.value}`).join('; '); try { const [result, cats, locs] = await Promise.all([ getSpecialists({ page: String(page), limit: '20', locale, ...params, ...effectiveLocation ? { location: effectiveLocation } : {} }), getCategories().catch(()=>[]), getLocations().catch(()=>[]) ]); console.log('[SpecialistsPage] got', result.total, 'specialists, data.length=', result.data.length); specialists = result.data; total = result.total; catTree = cats; locationTree = locs; } catch (err) { console.error('[SpecialistsPage] fetch error:', err); } if (cookieHeader) { try { const favRes = await fetch(`${BASE}/api/favorites/specialists`, { headers: { Cookie: cookieHeader } }); if (favRes.ok) { const favData = await favRes.json(); favoriteIds = new Set(favData.map((row)=>row.specialist?.id).filter(Boolean)); } } catch {} } const totalPages = Math.ceil(total / 20); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const buildUrl = (overrides)=>{ const merged = { ...params, ...effectiveLocation ? { location: effectiveLocation } : {}, ...overrides }; const qs = Object.entries(merged).filter(([, v])=>v !== undefined && v !== '').map(([k, v])=>`${k}=${encodeURIComponent(v)}`).join('&'); return `/specialists${qs ? '?' + qs : ''}`; }; return /*#__PURE__*/ _jsx("div", { className: "max-w-7xl mx-auto px-4 py-8", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-col md:flex-row gap-8", children: [ /*#__PURE__*/ _jsx("aside", { className: "md:w-64 shrink-0", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 mb-4", children: t('tasks.search') }), /*#__PURE__*/ _jsx(SpecialistsFiltersClient, { catTree: catTree, locations: locationTree, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialLanguages: params.language ? params.language.split(',').filter(Boolean) : [] }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ (params.q || params.category || params.location || params.language) && /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs("h1", { className: "text-xl font-bold text-white", children: [ total, " ", t('specialists.title').toLowerCase() ] }) }), specialists.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/70", children: /*#__PURE__*/ _jsx("p", { className: "text-lg", children: t('specialists.empty') }) }) : /*#__PURE__*/ _jsx("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: specialists.map((user)=>{ const displayName = formatShortName(user.firstName, user.lastName, user.name); const initials = `${user.firstName?.[0] ?? ''}${user.lastName?.[0] ?? ''}`.toUpperCase() || user.name?.[0]?.toUpperCase() || '?'; return /*#__PURE__*/ _jsxs("div", { className: "relative bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-green-300 transition flex flex-col", children: [ /*#__PURE__*/ _jsx(Link, { href: `/users/${user.id}`, className: "absolute inset-0 rounded-xl", "aria-label": displayName }), /*#__PURE__*/ _jsx(FavoriteSpecialistButton, { specialistId: user.id, initialFavorite: favoriteIds.has(user.id), favoriteLabel: t('specialist.favorite'), unfavoriteLabel: t('specialist.unfavorite') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: user.image ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-900 truncate", children: displayName }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now') ] }), user.rating && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-yellow-400 text-sm", children: "★" }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-700", children: Number(user.rating).toFixed(1) }) ] }), user.todayStatus === 'available' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), user.todayStatus === 'busy' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-red-700 bg-red-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), user.cards && user.cards.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-1.5 mb-2", children: [ user.cards.slice(0, 2).map((card)=>/*#__PURE__*/ _jsx("span", { className: "text-xs bg-gray-100 text-gray-700 px-2 py-0.5 rounded-full font-medium", children: card.title }, card.id)), user.cards.length > 2 && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "+", user.cards.length - 2 ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 line-clamp-2 flex-1 mt-1", children: user.bio || t('specialists.no_bio') }), user.lastSeenAt && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-3", children: formatLastSeen(user.lastSeenAt, t) }) ] }, user.id); }) }), totalPages > 1 && /*#__PURE__*/ _jsx("div", { className: "flex justify-center gap-2 mt-8", children: Array.from({ length: totalPages }, (_, i)=>i + 1).map((p)=>/*#__PURE__*/ _jsx(Link, { href: buildUrl({ page: String(p) }), className: `w-10 h-10 flex items-center justify-center rounded-lg text-sm font-medium ${p === page ? 'bg-green-600 text-white' : 'bg-white border border-gray-200 text-gray-700 hover:border-green-400'}`, children: p }, p)) }) ] }) ] }) }); } s062undefined6492undefined94132undefined134205undefined207259undefined261311undefined313366undefined368448undefined450530undefined532582undefined584598undefined762768__WEBPACK_MODULE_REFERENCE__2_5b22636f6f6b696573225d_call_directImport_asiSafe1__._undefined856870__WEBPACK_MODULE_REFERENCE__4_5b226765745472616e736c6174696f6e73225d_call_directImport_asiSafe1__._undefined14831496__WEBPACK_MODULE_REFERENCE__3_5b226765745370656369616c69737473225d_call_directImport_asiSafe1__._undefined17561768__WEBPACK_MODULE_REFERENCE__3_5b2267657443617465676f72696573225d_call_directImport_asiSafe1__._undefined17991810__WEBPACK_MODULE_REFERENCE__3_5b226765744c6f636174696f6e73225d_call_directImport_asiSafe1__._undefined33053308__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined34013405__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined35283531__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined36393643__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined38313834__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined40574060__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined40624085__WEBPACK_MODULE_REFERENCE__8_5b225370656369616c6973747346696c74657273436c69656e74225d_directImport_asiSafe1__._undefined46274631__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined48244827__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined49374941__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined53855388__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined55255528__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined57305733__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined59435957__WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._undefined62176221__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined65046507__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined65096512__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined68426845__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined68476870__WEBPACK_MODULE_REFERENCE__7_5b224661766f726974655370656369616c697374427574746f6e225d_directImport_asiSafe1__._undefined73007304__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined75207523__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined78447847__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined82818285__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined85118514__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined88478851__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined91659168__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined91709178__WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined96519654__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined96569664__WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1014610150__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1053710540__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1109711101__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1138411387__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1176511768__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1234812352__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1271612719__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1329013294__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1365413657__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1452014524__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1477414777__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1516015164__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1571615719__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1604016043__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1619116204__WEBPACK_MODULE_REFERENCE__6_5b22666f726d61744c6173745365656e225d_call_directImport_asiSafe1__._undefined1646716470__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1672516728__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1673016733__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined173255(0,headers/* cookies */.UL)undefined343441(0,translations/* getTranslations */.$)undefined10541150(0,api/* getSpecialists */.F7)undefined14101504(0,api/* getCategories */.bW)undefined15351627(0,api/* getLocations */.Vs)undefined31223196(0,react_jsx_runtime.jsx)undefined32893365(0,react_jsx_runtime.jsxs)undefined34883562(0,react_jsx_runtime.jsx)undefined36703746(0,react_jsx_runtime.jsxs)undefined39344008(0,react_jsx_runtime.jsx)undefined42314305(0,react_jsx_runtime.jsx)undefined43074418SpecialistsFiltersClient.SpecialistsFiltersClientundefined49605036(0,react_jsx_runtime.jsxs)undefined52295303(0,react_jsx_runtime.jsx)undefined54135489(0,react_jsx_runtime.jsxs)undefined59336007(0,react_jsx_runtime.jsx)undefined61446218(0,react_jsx_runtime.jsx)undefined64206494(0,react_jsx_runtime.jsx)undefined67046802formatShortNameundefined70627138(0,react_jsx_runtime.jsxs)undefined74217495(0,react_jsx_runtime.jsx)undefined74977574(link_default())undefined79047978(0,react_jsx_runtime.jsx)undefined79808091FavoriteSpecialistButton.FavoriteSpecialistButtonundefined85218597(0,react_jsx_runtime.jsxs)undefined88138887(0,react_jsx_runtime.jsx)undefined92089282(0,react_jsx_runtime.jsx)undefined97169792(0,react_jsx_runtime.jsxs)undefined1001810092(0,react_jsx_runtime.jsx)undefined1042510501(0,react_jsx_runtime.jsxs)undefined1081510889(0,react_jsx_runtime.jsx)undefined1089110972PlanBadgeundefined1144511519(0,react_jsx_runtime.jsx)undefined1152111602PlanBadgeundefined1208412160(0,react_jsx_runtime.jsxs)undefined1254712621(0,react_jsx_runtime.jsx)undefined1317813254(0,react_jsx_runtime.jsxs)undefined1353713611(0,react_jsx_runtime.jsx)undefined1398914063(0,react_jsx_runtime.jsx)undefined1464314719(0,react_jsx_runtime.jsxs)undefined1508315157(0,react_jsx_runtime.jsx)undefined1572815804(0,react_jsx_runtime.jsxs)undefined1616416238(0,react_jsx_runtime.jsx)undefined1710117177(0,react_jsx_runtime.jsxs)undefined1742717501(0,react_jsx_runtime.jsx)undefined1788417960(0,react_jsx_runtime.jsxs)undefined1851218586(0,react_jsx_runtime.jsx)undefined1890718981(0,react_jsx_runtime.jsx)undefined1912919225formatLastSeenundefined1948819562(0,react_jsx_runtime.jsx)undefined1981719891(0,react_jsx_runtime.jsx)undefined1989319970(link_default())undefinedGI, /***/ 63033:  ;webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; \module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");  /***/ }) 8/***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js"); /***/ }) 9< =>?\module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");>@, /***/ 74075:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("zlib");  /***/ }) /O/***/ ((module) => { "use strict"; module.exports = require("zlib"); /***/ }) 03 456!module.exports = require("zlib");57, /***/ 79428:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("buffer");  /***/ }) &Q/***/ ((module) => { "use strict"; module.exports = require("buffer"); /***/ }) '* +,-#module.exports = require("buffer");,., /***/ 79551:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("url");  /***/ }) N/***/ ((module) => { "use strict"; module.exports = require("url"); /***/ }) ! "#$ module.exports = require("url");#%, /***/ 79646:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; *module.exports = require("child_process");  /***/ }) X/***/ ((module) => { "use strict"; module.exports = require("child_process"); /***/ })  *module.exports = require("child_process");, /***/ 81045:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceconst module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/specialists/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'specialists', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/specialists/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/specialists/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/specialists/page", pathname: "/specialists", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/specialists/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map @bb{_:S. ^`JL@B_  []   P R B D " _ LNd:)LQRm_[hfu % 4 !!!!""9"Q"###C$H$_V$N-[-..56=6E6x6w67888#9+9W:e:::;;;=)@6@uDDEEuH_HHHH2ILM1T>TUU[[``aaaa@bKbcdMdXdddff ggi_illrrrrttu3urwzwA}O}Q^-B͒“Δ_tS^er2?)>ǥޥ^mqP[|_ϱұ0ITX '*p6E ''5 Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 60928))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))__webpack_require__next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModulenext_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind".next"0 falsefalse{}(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERnext_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADER(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)0(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestnext_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponsenext_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T) true(__webpack_require__(33873).join)0next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERnext_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERnext_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARnext_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERnext_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodenext_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSnext_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKind(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)buffersourcesizemapshash__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); const module0 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570)); const module1 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23)); const module2 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506)); const module3 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23)); const module4 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23)); const page5 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 60928)); // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'specialists', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/specialists/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))).default(props))], apple: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))).default(props))], apple: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/specialists/page.tsx"]; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; // Create and export the route module that will be consumed. const routeModule = new next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModule({ definition: { kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, page: "/specialists/page", pathname: "/specialists", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: ".next" || 0, relativeProjectDir: false || '' }); async function handler(req, res, ctx) { var _this; let srcPage = "/specialists/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const initialPostponed = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)(userAgent); const isHtmlBot = (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isPrefetchRSCRequest') ?? req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isRSCRequest') ?? Boolean(req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADER]); const isPossibleServerAction = (0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = (0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = false && 0; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { (0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)(req.headers); } const ComponentMod = { ...next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__, tree, pages, GlobalError: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default()), handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { (0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: (0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequest(req); const nextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (false) {} return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: (0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: true ? (__webpack_require__(33873).join)(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : 0, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = (0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.PRERENDER && (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND) { throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.PAGES, html: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && ((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'renderFallbackShell') || isDebugFallbackShell) ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(matchedSegment, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(cachedData.rscData, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map {"finalSource":true}mapbufferedMap ConcatSourceRawSource#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); ReplaceSourceRawSourceconst module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/specialists/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'specialists', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/specialists/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/specialists/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/specialists/page", pathname: "/specialists", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/specialists/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map %'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558644Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 60928))undefined647787undefined789903undefined905981undefined9831054undefined10561118undefined11201189undefined11911267undefined12691354undefined13561439undefined14411517undefined15191600undefined16021695undefined16971801undefined18031883undefined18851963undefined19652056undefined20582239undefined22412317undefined23192384undefined23862459undefined24612518undefined25202626undefined26282701undefined27032767undefined27692850undefined32693491Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined35493778Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined43384560Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined46184847Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined50365058undefined50605196undefined51985220undefined52515269__webpack_require__undefined53275333undefined54345560undefined55625647undefined56495762undefined58255831undefined58565873next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined59095917next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined61856220".next"undefined622562260undefined62536291 falseundefined63036309undefined65956615falseundefined66186682{}undefined68286867falseundefined68996912(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined70037016(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined77827797(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined81848193(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined82298244(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined83898402(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined84488474next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined86538666(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined87128721next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined87618785(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined89658984(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined91769283 falseundefined928893020undefined1159811611(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1199612023(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1380813825(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1388513893next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1394413943: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1431214341(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1447314493(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1462714635(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1493514949next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1498915004next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1523215269falseundefined1527215847{}undefined1642516438next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1752517538(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1781717830(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1854918585 trueundefined1858918608(__webpack_require__(33873).join)undefined18687187380undefined1969919712(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2155321566(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2199022011next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2345023464next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2471024727(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2501625027next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2504225046(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2515225163next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2559725608next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2567725688next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2577725788next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2632126332next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2637726391next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2704327051next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2779727818(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2934629360next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2939929410next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2991229925(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2998230003(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3057830586next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3206532079next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3343133454next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3592135934next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3622936243next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3712637149next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3742137442next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3756037581next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3781137826(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3805438065next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3809438116next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3877238787(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3899539006next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3926939282(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3973039743(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4061340634next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4151341534next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4164441665next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4221842235next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4243942462next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4335843373(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4440144416(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4462444635next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4466844690next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4540745519falseundefined4552245872{}undefined4589745912(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4685646867next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4700247017(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4762847655falseundefined4765847728{}undefined4903649050next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined4997449989(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5086450877next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5097650983next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5123951253next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5146551483(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefined /***/ })   o#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); /const module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/specialists/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'specialists', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/specialists/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/specialists/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/specialists/page", pathname: "/specialists", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/specialists/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map %'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558644Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 60928))undefined647787undefined789903undefined905981undefined9831054undefined10561118undefined11201189undefined11911267undefined12691354undefined13561439undefined14411517undefined15191600undefined16021695undefined16971801undefined18031883undefined18851963undefined19652056undefined20582239undefined22412317undefined23192384undefined23862459undefined24612518undefined25202626undefined26282701undefined27032767undefined27692850undefined32693491Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined35493778Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined43384560Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined46184847Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined50365058undefined50605196undefined51985220undefined52515269__webpack_require__undefined53275333undefined54345560undefined55625647undefined56495762undefined58255831undefined58565873next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined59095917next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined61856220".next"undefined622562260undefined62536291 falseundefined63036309undefined65956615falseundefined66186682{}undefined68286867falseundefined68996912(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined70037016(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined77827797(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined81848193(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined82298244(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined83898402(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined84488474next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined86538666(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined87128721next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined87618785(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined89658984(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined91769283 falseundefined928893020undefined1159811611(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1199612023(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1380813825(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1388513893next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1394413943: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1431214341(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1447314493(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1462714635(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1493514949next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1498915004next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1523215269falseundefined1527215847{}undefined1642516438next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1752517538(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1781717830(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1854918585 trueundefined1858918608(__webpack_require__(33873).join)undefined18687187380undefined1969919712(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2155321566(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2199022011next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2345023464next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2471024727(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2501625027next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2504225046(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2515225163next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2559725608next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2567725688next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2577725788next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2632126332next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2637726391next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2704327051next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2779727818(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2934629360next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2939929410next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2991229925(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2998230003(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3057830586next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3206532079next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3343133454next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3592135934next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3622936243next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3712637149next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3742137442next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3756037581next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3781137826(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3805438065next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3809438116next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3877238787(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3899539006next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3926939282(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3973039743(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4061340634next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4151341534next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4164441665next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4221842235next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4243942462next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4335843373(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4440144416(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4462444635next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4466844690next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4540745519falseundefined4552245872{}undefined4589745912(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4685646867next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4700247017(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4762847655falseundefined4765847728{}undefined4903649050next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined4997449989(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5086450877next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5097650983next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5123951253next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5146551483(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefined, /***/ 81630:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("http");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("http"); /***/ })   !module.exports = require("http"); , /***/ 83997:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("tty");  /***/ }) N/***/ ((module) => { "use strict"; module.exports = require("tty"); /***/ })   module.exports = require("tty");, /***/ 84237:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource )webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource]/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ SpecialistsFiltersClient: () => (/* binding */ SpecialistsFiltersClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(88142); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53863); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource9!/* __next_internal_client_entry_do_not_use__ SpecialistsFiltersClient auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useRouter } from 'next/navigation'; import { useLocale } from '@/context/locale'; import { TaskCategoryPicker } from '@/components/TaskCategoryPicker'; import { TaskLocationPicker } from '@/components/TaskLocationPicker'; const LANG_OPTIONS = [ { code: 'el', label: 'Ελληνικά' }, { code: 'en', label: 'English' }, { code: 'ru', label: 'Русский' }, { code: 'uk', label: 'Українська' }, { code: 'de', label: 'Deutsch' }, { code: 'fr', label: 'Français' }, { code: 'it', label: 'Italiano' }, { code: 'es', label: 'Español' }, { code: 'ar', label: 'العربية' }, { code: 'zh', label: '中文' } ]; export function SpecialistsFiltersClient({ catTree, locations, initialQ, initialCategory, initialLocation, initialLanguages = [] }) { const router = useRouter(); const { t, locale } = useLocale(); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const [selectedCategory, setSelectedCategory] = useState(initialCategory ?? ''); const [selectedLocation, setSelectedLocation] = useState(initialLocation ?? ''); const [selectedLanguages, setSelectedLanguages] = useState(initialLanguages); const hasFilter = !!(initialQ || initialCategory || initialLocation || initialLanguages.length); const navigate = (q, category, location, languages)=>{ const qs = new URLSearchParams(); if (q) qs.set('q', q); if (category) qs.set('category', category); if (location) qs.set('location', location); if (languages.length) qs.set('language', languages.join(',')); router.push(`/specialists${qs.toString() ? '?' + qs.toString() : ''}`); }; const handleCategoryChange = (slug)=>{ setSelectedCategory(slug); navigate(initialQ ?? '', slug, selectedLocation, selectedLanguages); }; const handleLocationChange = (slug)=>{ setSelectedLocation(slug); navigate(initialQ ?? '', selectedCategory, slug, selectedLanguages); }; const toggleLanguage = (code)=>{ const next = selectedLanguages.includes(code) ? selectedLanguages.filter((l)=>l !== code) : [ ...selectedLanguages, code ]; setSelectedLanguages(next); navigate(initialQ ?? '', selectedCategory, selectedLocation, next); }; const handleSubmit = (e)=>{ e.preventDefault(); const fd = new FormData(e.currentTarget); const q = fd.get('q') || ''; navigate(q, selectedCategory, selectedLocation, selectedLanguages); }; const handleReset = ()=>{ setSelectedCategory(''); setSelectedLocation(''); setSelectedLanguages([]); router.push('/specialists'); }; const locationAnyLabel = t('create.field.location.any'); const locationAllLabel = t('create.field.location.all'); const catPlaceholder = t('filter.category.all'); const catLabel = t('create.field.category'); const locLabel = t('filter.location'); const langLabel = t('filter.language'); const resetLabel = t('tasks.filter.reset'); return /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "space-y-4", children: [ /*#__PURE__*/ _jsx("div", { children: /*#__PURE__*/ _jsx("input", { name: "q", defaultValue: initialQ, placeholder: t('specialists.search'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) }), catTree.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: catLabel }), /*#__PURE__*/ _jsx(TaskCategoryPicker, { categories: catTree, locale: catLocale, value: selectedCategory, onChange: handleCategoryChange, placeholder: catPlaceholder }) ] }), locations.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: locLabel }), /*#__PURE__*/ _jsx(TaskLocationPicker, { locations: locations, value: selectedLocation, onChange: handleLocationChange, anyLabel: locationAnyLabel, allLabel: locationAllLabel }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-2", children: langLabel }), /*#__PURE__*/ _jsx("div", { className: "space-y-1", children: LANG_OPTIONS.map((lang)=>{ const checked = selectedLanguages.includes(lang.code); return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer group py-0.5", children: [ /*#__PURE__*/ _jsx("span", { className: `w-4 h-4 rounded flex items-center justify-center border transition-colors flex-shrink-0 ${checked ? 'bg-green-600 border-green-600' : 'border-gray-300 group-hover:border-green-400'}`, onClick: ()=>toggleLanguage(lang.code), children: checked && /*#__PURE__*/ _jsx("svg", { className: "w-2.5 h-2.5 text-white", viewBox: "0 0 10 8", fill: "none", children: /*#__PURE__*/ _jsx("path", { d: "M1 4l3 3 5-6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) }), /*#__PURE__*/ _jsx("span", { className: `text-sm select-none transition-colors ${checked ? 'text-green-700 font-medium' : 'text-gray-700'}`, onClick: ()=>toggleLanguage(lang.code), children: lang.label }) ] }, lang.code); }) }) ] }), /*#__PURE__*/ _jsx("button", { type: "submit", className: "w-full bg-green-600 text-white py-2 rounded-lg text-sm font-medium hover:bg-green-700", children: t('specialists.search.btn') }), hasFilter && /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleReset, className: "w-full border border-gray-200 text-gray-500 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 hover:text-gray-700 transition-colors", children: resetLabel }) ] }); } a!N_  OQ]d  *-`c%_(hl}69gj@(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__/* .TaskCategoryPicker */ .W_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__/* .TaskLocationPicker */ .Vbuffersourcesizemapshashl)/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ SpecialistsFiltersClient: () => (/* binding */ SpecialistsFiltersClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(88142); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53863); /* __next_internal_client_entry_do_not_use__ SpecialistsFiltersClient auto */ const LANG_OPTIONS = [ { code: 'el', label: 'Ελληνικά' }, { code: 'en', label: 'English' }, { code: 'ru', label: 'Русский' }, { code: 'uk', label: 'Українська' }, { code: 'de', label: 'Deutsch' }, { code: 'fr', label: 'Français' }, { code: 'it', label: 'Italiano' }, { code: 'es', label: 'Español' }, { code: 'ar', label: 'العربية' }, { code: 'zh', label: '中文' } ]; function SpecialistsFiltersClient({ catTree, locations, initialQ, initialCategory, initialLocation, initialLanguages = [] }) { const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const [selectedCategory, setSelectedCategory] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialCategory ?? ''); const [selectedLocation, setSelectedLocation] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialLocation ?? ''); const [selectedLanguages, setSelectedLanguages] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialLanguages); const hasFilter = !!(initialQ || initialCategory || initialLocation || initialLanguages.length); const navigate = (q, category, location, languages)=>{ const qs = new URLSearchParams(); if (q) qs.set('q', q); if (category) qs.set('category', category); if (location) qs.set('location', location); if (languages.length) qs.set('language', languages.join(',')); router.push(`/specialists${qs.toString() ? '?' + qs.toString() : ''}`); }; const handleCategoryChange = (slug)=>{ setSelectedCategory(slug); navigate(initialQ ?? '', slug, selectedLocation, selectedLanguages); }; const handleLocationChange = (slug)=>{ setSelectedLocation(slug); navigate(initialQ ?? '', selectedCategory, slug, selectedLanguages); }; const toggleLanguage = (code)=>{ const next = selectedLanguages.includes(code) ? selectedLanguages.filter((l)=>l !== code) : [ ...selectedLanguages, code ]; setSelectedLanguages(next); navigate(initialQ ?? '', selectedCategory, selectedLocation, next); }; const handleSubmit = (e)=>{ e.preventDefault(); const fd = new FormData(e.currentTarget); const q = fd.get('q') || ''; navigate(q, selectedCategory, selectedLocation, selectedLanguages); }; const handleReset = ()=>{ setSelectedCategory(''); setSelectedLocation(''); setSelectedLanguages([]); router.push('/specialists'); }; const locationAnyLabel = t('create.field.location.any'); const locationAllLabel = t('create.field.location.all'); const catPlaceholder = t('filter.category.all'); const catLabel = t('create.field.category'); const locLabel = t('filter.location'); const langLabel = t('filter.language'); const resetLabel = t('tasks.filter.reset'); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "q", defaultValue: initialQ, placeholder: t('specialists.search'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) }), catTree.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: catLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__/* .TaskCategoryPicker */ .W, { categories: catTree, locale: catLocale, value: selectedCategory, onChange: handleCategoryChange, placeholder: catPlaceholder }) ] }), locations.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: locLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__/* .TaskLocationPicker */ .V, { locations: locations, value: selectedLocation, onChange: handleLocationChange, anyLabel: locationAnyLabel, allLabel: locationAllLabel }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-2", children: langLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-1", children: LANG_OPTIONS.map((lang)=>{ const checked = selectedLanguages.includes(lang.code); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer group py-0.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: `w-4 h-4 rounded flex items-center justify-center border transition-colors flex-shrink-0 ${checked ? 'bg-green-600 border-green-600' : 'border-gray-300 group-hover:border-green-400'}`, onClick: ()=>toggleLanguage(lang.code), children: checked && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-2.5 h-2.5 text-white", viewBox: "0 0 10 8", fill: "none", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M1 4l3 3 5-6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: `text-sm select-none transition-colors ${checked ? 'text-green-700 font-medium' : 'text-gray-700'}`, onClick: ()=>toggleLanguage(lang.code), children: lang.label }) ] }, lang.code); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", className: "w-full bg-green-600 text-white py-2 rounded-lg text-sm font-medium hover:bg-green-700", children: t('specialists.search.btn') }), hasFilter && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handleReset, className: "w-full border border-gray-200 text-gray-500 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 hover:text-gray-700 transition-colors", children: resetLabel }) ] }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource]/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ SpecialistsFiltersClient: () => (/* binding */ SpecialistsFiltersClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(88142); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53863); ReplaceSourceRawSource9!/* __next_internal_client_entry_do_not_use__ SpecialistsFiltersClient auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useRouter } from 'next/navigation'; import { useLocale } from '@/context/locale'; import { TaskCategoryPicker } from '@/components/TaskCategoryPicker'; import { TaskLocationPicker } from '@/components/TaskLocationPicker'; const LANG_OPTIONS = [ { code: 'el', label: 'Ελληνικά' }, { code: 'en', label: 'English' }, { code: 'ru', label: 'Русский' }, { code: 'uk', label: 'Українська' }, { code: 'de', label: 'Deutsch' }, { code: 'fr', label: 'Français' }, { code: 'it', label: 'Italiano' }, { code: 'es', label: 'Español' }, { code: 'ar', label: 'العربية' }, { code: 'zh', label: '中文' } ]; export function SpecialistsFiltersClient({ catTree, locations, initialQ, initialCategory, initialLocation, initialLanguages = [] }) { const router = useRouter(); const { t, locale } = useLocale(); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const [selectedCategory, setSelectedCategory] = useState(initialCategory ?? ''); const [selectedLocation, setSelectedLocation] = useState(initialLocation ?? ''); const [selectedLanguages, setSelectedLanguages] = useState(initialLanguages); const hasFilter = !!(initialQ || initialCategory || initialLocation || initialLanguages.length); const navigate = (q, category, location, languages)=>{ const qs = new URLSearchParams(); if (q) qs.set('q', q); if (category) qs.set('category', category); if (location) qs.set('location', location); if (languages.length) qs.set('language', languages.join(',')); router.push(`/specialists${qs.toString() ? '?' + qs.toString() : ''}`); }; const handleCategoryChange = (slug)=>{ setSelectedCategory(slug); navigate(initialQ ?? '', slug, selectedLocation, selectedLanguages); }; const handleLocationChange = (slug)=>{ setSelectedLocation(slug); navigate(initialQ ?? '', selectedCategory, slug, selectedLanguages); }; const toggleLanguage = (code)=>{ const next = selectedLanguages.includes(code) ? selectedLanguages.filter((l)=>l !== code) : [ ...selectedLanguages, code ]; setSelectedLanguages(next); navigate(initialQ ?? '', selectedCategory, selectedLocation, next); }; const handleSubmit = (e)=>{ e.preventDefault(); const fd = new FormData(e.currentTarget); const q = fd.get('q') || ''; navigate(q, selectedCategory, selectedLocation, selectedLanguages); }; const handleReset = ()=>{ setSelectedCategory(''); setSelectedLocation(''); setSelectedLanguages([]); router.push('/specialists'); }; const locationAnyLabel = t('create.field.location.any'); const locationAllLabel = t('create.field.location.all'); const catPlaceholder = t('filter.category.all'); const catLabel = t('create.field.category'); const locLabel = t('filter.location'); const langLabel = t('filter.language'); const resetLabel = t('tasks.filter.reset'); return /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "space-y-4", children: [ /*#__PURE__*/ _jsx("div", { children: /*#__PURE__*/ _jsx("input", { name: "q", defaultValue: initialQ, placeholder: t('specialists.search'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) }), catTree.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: catLabel }), /*#__PURE__*/ _jsx(TaskCategoryPicker, { categories: catTree, locale: catLocale, value: selectedCategory, onChange: handleCategoryChange, placeholder: catPlaceholder }) ] }), locations.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: locLabel }), /*#__PURE__*/ _jsx(TaskLocationPicker, { locations: locations, value: selectedLocation, onChange: handleLocationChange, anyLabel: locationAnyLabel, allLabel: locationAllLabel }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-2", children: langLabel }), /*#__PURE__*/ _jsx("div", { className: "space-y-1", children: LANG_OPTIONS.map((lang)=>{ const checked = selectedLanguages.includes(lang.code); return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer group py-0.5", children: [ /*#__PURE__*/ _jsx("span", { className: `w-4 h-4 rounded flex items-center justify-center border transition-colors flex-shrink-0 ${checked ? 'bg-green-600 border-green-600' : 'border-gray-300 group-hover:border-green-400'}`, onClick: ()=>toggleLanguage(lang.code), children: checked && /*#__PURE__*/ _jsx("svg", { className: "w-2.5 h-2.5 text-white", viewBox: "0 0 10 8", fill: "none", children: /*#__PURE__*/ _jsx("path", { d: "M1 4l3 3 5-6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) }), /*#__PURE__*/ _jsx("span", { className: `text-sm select-none transition-colors ${checked ? 'text-green-700 font-medium' : 'text-gray-700'}`, onClick: ()=>toggleLanguage(lang.code), children: lang.label }) ] }, lang.code); }) }) ] }), /*#__PURE__*/ _jsx("button", { type: "submit", className: "w-full bg-green-600 text-white py-2 rounded-lg text-sm font-medium hover:bg-green-700", children: t('specialists.search.btn') }), hasFilter && /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleReset, className: "w-full border border-gray-200 text-gray-500 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 hover:text-gray-700 transition-colors", children: resetLabel }) ] }); } 78140undefined142174undefined176219undefined221265undefined267335undefined337405undefined10131019undefined11661174(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined12051213(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined13731380(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined14581465(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15451552(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined35003504(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined36263629(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined36803683(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined40564060(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined41334136(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43334336(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43384355_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__/* .TaskCategoryPicker */ .Wundefined47124716(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined47894792(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49894992(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49945011_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__/* .TaskLocationPicker */ .Vundefined53535357(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined54305433(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined56315634(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined58865890(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined60976100(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined65036506(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined67896792(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined73357338(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined78697872(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined81438146(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ })  T]/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ SpecialistsFiltersClient: () => (/* binding */ SpecialistsFiltersClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(88142); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53863); 9!/* __next_internal_client_entry_do_not_use__ SpecialistsFiltersClient auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useRouter } from 'next/navigation'; import { useLocale } from '@/context/locale'; import { TaskCategoryPicker } from '@/components/TaskCategoryPicker'; import { TaskLocationPicker } from '@/components/TaskLocationPicker'; const LANG_OPTIONS = [ { code: 'el', label: 'Ελληνικά' }, { code: 'en', label: 'English' }, { code: 'ru', label: 'Русский' }, { code: 'uk', label: 'Українська' }, { code: 'de', label: 'Deutsch' }, { code: 'fr', label: 'Français' }, { code: 'it', label: 'Italiano' }, { code: 'es', label: 'Español' }, { code: 'ar', label: 'العربية' }, { code: 'zh', label: '中文' } ]; export function SpecialistsFiltersClient({ catTree, locations, initialQ, initialCategory, initialLocation, initialLanguages = [] }) { const router = useRouter(); const { t, locale } = useLocale(); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const [selectedCategory, setSelectedCategory] = useState(initialCategory ?? ''); const [selectedLocation, setSelectedLocation] = useState(initialLocation ?? ''); const [selectedLanguages, setSelectedLanguages] = useState(initialLanguages); const hasFilter = !!(initialQ || initialCategory || initialLocation || initialLanguages.length); const navigate = (q, category, location, languages)=>{ const qs = new URLSearchParams(); if (q) qs.set('q', q); if (category) qs.set('category', category); if (location) qs.set('location', location); if (languages.length) qs.set('language', languages.join(',')); router.push(`/specialists${qs.toString() ? '?' + qs.toString() : ''}`); }; const handleCategoryChange = (slug)=>{ setSelectedCategory(slug); navigate(initialQ ?? '', slug, selectedLocation, selectedLanguages); }; const handleLocationChange = (slug)=>{ setSelectedLocation(slug); navigate(initialQ ?? '', selectedCategory, slug, selectedLanguages); }; const toggleLanguage = (code)=>{ const next = selectedLanguages.includes(code) ? selectedLanguages.filter((l)=>l !== code) : [ ...selectedLanguages, code ]; setSelectedLanguages(next); navigate(initialQ ?? '', selectedCategory, selectedLocation, next); }; const handleSubmit = (e)=>{ e.preventDefault(); const fd = new FormData(e.currentTarget); const q = fd.get('q') || ''; navigate(q, selectedCategory, selectedLocation, selectedLanguages); }; const handleReset = ()=>{ setSelectedCategory(''); setSelectedLocation(''); setSelectedLanguages([]); router.push('/specialists'); }; const locationAnyLabel = t('create.field.location.any'); const locationAllLabel = t('create.field.location.all'); const catPlaceholder = t('filter.category.all'); const catLabel = t('create.field.category'); const locLabel = t('filter.location'); const langLabel = t('filter.language'); const resetLabel = t('tasks.filter.reset'); return /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "space-y-4", children: [ /*#__PURE__*/ _jsx("div", { children: /*#__PURE__*/ _jsx("input", { name: "q", defaultValue: initialQ, placeholder: t('specialists.search'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) }), catTree.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: catLabel }), /*#__PURE__*/ _jsx(TaskCategoryPicker, { categories: catTree, locale: catLocale, value: selectedCategory, onChange: handleCategoryChange, placeholder: catPlaceholder }) ] }), locations.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: locLabel }), /*#__PURE__*/ _jsx(TaskLocationPicker, { locations: locations, value: selectedLocation, onChange: handleLocationChange, anyLabel: locationAnyLabel, allLabel: locationAllLabel }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-2", children: langLabel }), /*#__PURE__*/ _jsx("div", { className: "space-y-1", children: LANG_OPTIONS.map((lang)=>{ const checked = selectedLanguages.includes(lang.code); return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer group py-0.5", children: [ /*#__PURE__*/ _jsx("span", { className: `w-4 h-4 rounded flex items-center justify-center border transition-colors flex-shrink-0 ${checked ? 'bg-green-600 border-green-600' : 'border-gray-300 group-hover:border-green-400'}`, onClick: ()=>toggleLanguage(lang.code), children: checked && /*#__PURE__*/ _jsx("svg", { className: "w-2.5 h-2.5 text-white", viewBox: "0 0 10 8", fill: "none", children: /*#__PURE__*/ _jsx("path", { d: "M1 4l3 3 5-6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) }), /*#__PURE__*/ _jsx("span", { className: `text-sm select-none transition-colors ${checked ? 'text-green-700 font-medium' : 'text-gray-700'}`, onClick: ()=>toggleLanguage(lang.code), children: lang.label }) ] }, lang.code); }) }) ] }), /*#__PURE__*/ _jsx("button", { type: "submit", className: "w-full bg-green-600 text-white py-2 rounded-lg text-sm font-medium hover:bg-green-700", children: t('specialists.search.btn') }), hasFilter && /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleReset, className: "w-full border border-gray-200 text-gray-500 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 hover:text-gray-700 transition-colors", children: resetLabel }) ] }); } 78140undefined142174undefined176219undefined221265undefined267335undefined337405undefined10131019undefined11661174(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined12051213(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined13731380(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined14581465(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15451552(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined35003504(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined36263629(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined36803683(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined40564060(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined41334136(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43334336(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43384355_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__/* .TaskCategoryPicker */ .Wundefined47124716(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined47894792(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49894992(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49945011_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__/* .TaskLocationPicker */ .Vundefined53535357(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined54305433(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined56315634(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined58865890(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined60976100(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined65036506(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined67896792(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined73357338(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined78697872(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined81438146(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 86439:  +webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");  /***/ }) z/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/no-fallback-error.external"); /***/ })  Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");, /***/ 91645:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("net");  /***/ }) N/***/ ((module) => { "use strict"; module.exports = require("net"); /***/ })   module.exports = require("net");, /***/ 94735:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("events");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("events"); /***/ })  #module.exports = require("events");w }; ; // load runtime var __webpack_require__ = require("../../webpack-runtime.js"); __webpack_require__.C(exports); var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [901,652,809,902,331,22], () => (__webpack_exec__(81045))); ,module.exports = __webpack_exports__; })(); C@.Jb(() => { var exports = {}; exports.id = 755; exports.ids = [755]; exports.modules = { /***/ 261: IWXYZI[\Y]I[^Y, /***/ 17320: H_Jimport(/* webpackMode: "eager", webpackExports: ["FavoriteSpecialistButton"] */ "/opt/canhelp/apps/web/src/components/FavoriteSpecialistButton.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["SpecialistsFiltersClient"] */ "/opt/canhelp/apps/web/src/components/SpecialistsFiltersClient.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["__esModule","default"] */ "/opt/canhelp/node_modules/next/dist/client/app-dir/link.js"); Q0147Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 30284))undefined152299Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 84237))undefined304440Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 94496, 23))undefinedV`FXaVgFXhViFXjVkFXlVmFXnVoFXpV, /***/ 30284: EqEGU, /***/ 30472: D[FP0147Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 57650))undefined152299Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 50815))undefined304440Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3498, 23))undefinedSsCUtSuCUvSwCUxS, /***/ 50815: BnB/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ SpecialistsFiltersClient: () => (/* binding */ SpecialistsFiltersClient) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); CL// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const SpecialistsFiltersClient = registerClientReference( function() { throw new Error("Attempted to call SpecialistsFiltersClient() from the server but SpecialistsFiltersClient is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/components/SpecialistsFiltersClient.tsx", "SpecialistsFiltersClient", );61134undefined136142undefined176198(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefinedOu?QvOw?QxO, /***/ 57650: >j>/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FavoriteSpecialistButton: () => (/* binding */ FavoriteSpecialistButton) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); ?L// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const FavoriteSpecialistButton = registerClientReference( function() { throw new Error("Attempted to call FavoriteSpecialistButton() from the server but FavoriteSpecialistButton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/components/FavoriteSpecialistButton.tsx", "FavoriteSpecialistButton", );L, /***/ 60928: ;g;====Ku;MvKw;MxKy;MzK{;M|K};M~K, /***/ 81045: :f:g<const module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/specialists/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'specialists', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/specialists/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/specialists/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/specialists/page", pathname: "/specialists", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/specialists/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map %'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558644Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 60928))undefined647787undefined789903undefined905981undefined9831054undefined10561118undefined11201189undefined11911267undefined12691354undefined13561439undefined14411517undefined15191600undefined16021695undefined16971801undefined18031883undefined18851963undefined19652056undefined20582239undefined22412317undefined23192384undefined23862459undefined24612518undefined25202626undefined26282701undefined27032767undefined27692850undefined32693491Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined35493778Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined43384560Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined46184847Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined50365058undefined50605196undefined51985220undefined52515269__webpack_require__undefined53275333undefined54345560undefined55625647undefined56495762undefined58255831undefined58565873next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined59095917next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined61856220".next"undefined622562260undefined62536291 falseundefined63036309undefined65956615falseundefined66186682{}undefined68286867falseundefined68996912(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined70037016(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined77827797(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined81848193(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined82298244(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined83898402(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined84488474next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined86538666(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined87128721next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined87618785(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined89658984(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined91769283 falseundefined928893020undefined1159811611(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1199612023(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1380813825(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1388513893next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1394413943: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1431214341(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1447314493(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1462714635(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1493514949next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1498915004next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1523215269falseundefined1527215847{}undefined1642516438next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1752517538(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1781717830(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1854918585 trueundefined1858918608(__webpack_require__(33873).join)undefined18687187380undefined1969919712(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2155321566(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2199022011next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2345023464next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2471024727(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2501625027next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2504225046(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2515225163next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2559725608next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2567725688next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2577725788next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2632126332next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2637726391next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2704327051next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2779727818(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2934629360next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2939929410next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2991229925(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2998230003(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3057830586next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3206532079next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3343133454next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3592135934next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3622936243next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3712637149next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3742137442next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3756037581next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3781137826(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3805438065next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3809438116next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3877238787(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3899539006next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3926939282(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3973039743(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4061340634next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4151341534next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4164441665next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4221842235next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4243942462next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4335843373(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4440144416(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4462444635next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4466844690next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4540745519falseundefined4552245872{}undefined4589745912(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4685646867next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4700247017(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4762847655falseundefined4765847728{}undefined4903649050next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined4997449989(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5086450877next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5097650983next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5123951253next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5146551483(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefinedH}8J~H8JH, /***/ 84237: 7c7]/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ SpecialistsFiltersClient: () => (/* binding */ SpecialistsFiltersClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(88142); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53863); 89!/* __next_internal_client_entry_do_not_use__ SpecialistsFiltersClient auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useRouter } from 'next/navigation'; import { useLocale } from '@/context/locale'; import { TaskCategoryPicker } from '@/components/TaskCategoryPicker'; import { TaskLocationPicker } from '@/components/TaskLocationPicker'; const LANG_OPTIONS = [ { code: 'el', label: 'Ελληνικά' }, { code: 'en', label: 'English' }, { code: 'ru', label: 'Русский' }, { code: 'uk', label: 'Українська' }, { code: 'de', label: 'Deutsch' }, { code: 'fr', label: 'Français' }, { code: 'it', label: 'Italiano' }, { code: 'es', label: 'Español' }, { code: 'ar', label: 'العربية' }, { code: 'zh', label: '中文' } ]; export function SpecialistsFiltersClient({ catTree, locations, initialQ, initialCategory, initialLocation, initialLanguages = [] }) { const router = useRouter(); const { t, locale } = useLocale(); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const [selectedCategory, setSelectedCategory] = useState(initialCategory ?? ''); const [selectedLocation, setSelectedLocation] = useState(initialLocation ?? ''); const [selectedLanguages, setSelectedLanguages] = useState(initialLanguages); const hasFilter = !!(initialQ || initialCategory || initialLocation || initialLanguages.length); const navigate = (q, category, location, languages)=>{ const qs = new URLSearchParams(); if (q) qs.set('q', q); if (category) qs.set('category', category); if (location) qs.set('location', location); if (languages.length) qs.set('language', languages.join(',')); router.push(`/specialists${qs.toString() ? '?' + qs.toString() : ''}`); }; const handleCategoryChange = (slug)=>{ setSelectedCategory(slug); navigate(initialQ ?? '', slug, selectedLocation, selectedLanguages); }; const handleLocationChange = (slug)=>{ setSelectedLocation(slug); navigate(initialQ ?? '', selectedCategory, slug, selectedLanguages); }; const toggleLanguage = (code)=>{ const next = selectedLanguages.includes(code) ? selectedLanguages.filter((l)=>l !== code) : [ ...selectedLanguages, code ]; setSelectedLanguages(next); navigate(initialQ ?? '', selectedCategory, selectedLocation, next); }; const handleSubmit = (e)=>{ e.preventDefault(); const fd = new FormData(e.currentTarget); const q = fd.get('q') || ''; navigate(q, selectedCategory, selectedLocation, selectedLanguages); }; const handleReset = ()=>{ setSelectedCategory(''); setSelectedLocation(''); setSelectedLanguages([]); router.push('/specialists'); }; const locationAnyLabel = t('create.field.location.any'); const locationAllLabel = t('create.field.location.all'); const catPlaceholder = t('filter.category.all'); const catLabel = t('create.field.category'); const locLabel = t('filter.location'); const langLabel = t('filter.language'); const resetLabel = t('tasks.filter.reset'); return /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "space-y-4", children: [ /*#__PURE__*/ _jsx("div", { children: /*#__PURE__*/ _jsx("input", { name: "q", defaultValue: initialQ, placeholder: t('specialists.search'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) }), catTree.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: catLabel }), /*#__PURE__*/ _jsx(TaskCategoryPicker, { categories: catTree, locale: catLocale, value: selectedCategory, onChange: handleCategoryChange, placeholder: catPlaceholder }) ] }), locations.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: locLabel }), /*#__PURE__*/ _jsx(TaskLocationPicker, { locations: locations, value: selectedLocation, onChange: handleLocationChange, anyLabel: locationAnyLabel, allLabel: locationAllLabel }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-2", children: langLabel }), /*#__PURE__*/ _jsx("div", { className: "space-y-1", children: LANG_OPTIONS.map((lang)=>{ const checked = selectedLanguages.includes(lang.code); return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer group py-0.5", children: [ /*#__PURE__*/ _jsx("span", { className: `w-4 h-4 rounded flex items-center justify-center border transition-colors flex-shrink-0 ${checked ? 'bg-green-600 border-green-600' : 'border-gray-300 group-hover:border-green-400'}`, onClick: ()=>toggleLanguage(lang.code), children: checked && /*#__PURE__*/ _jsx("svg", { className: "w-2.5 h-2.5 text-white", viewBox: "0 0 10 8", fill: "none", children: /*#__PURE__*/ _jsx("path", { d: "M1 4l3 3 5-6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) }), /*#__PURE__*/ _jsx("span", { className: `text-sm select-none transition-colors ${checked ? 'text-green-700 font-medium' : 'text-gray-700'}`, onClick: ()=>toggleLanguage(lang.code), children: lang.label }) ] }, lang.code); }) }) ] }), /*#__PURE__*/ _jsx("button", { type: "submit", className: "w-full bg-green-600 text-white py-2 rounded-lg text-sm font-medium hover:bg-green-700", children: t('specialists.search.btn') }), hasFilter && /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleReset, className: "w-full border border-gray-200 text-gray-500 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 hover:text-gray-700 transition-colors", children: resetLabel }) ] }); } 78140undefined142174undefined176219undefined221265undefined267335undefined337405undefined10131019undefined11661174(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined12051213(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined13731380(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined14581465(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15451552(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined35003504(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined36263629(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined36803683(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined40564060(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined41334136(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43334336(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43384355_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__/* .TaskCategoryPicker */ .Wundefined47124716(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined47894792(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49894992(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49945011_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__/* .TaskLocationPicker */ .Vundefined53535357(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined54305433(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined56315634(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined58865890(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined60976100(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined65036506(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined67896792(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined73357338(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined78697872(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined81438146(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefinedD}4F~D4FD4FDvar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [901,652,809,902,331,22], () => (__webpack_exec__(81045)));  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSource`?webpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceb(() => { var exports = {}; exports.id = 174; exports.ids = [174]; exports.modules = { /***/ 261: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource 'webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Hmodule.exports = require("next/dist/shared/lib/router/utils/app-paths");  /***/ }) buffersourcesizemapshashv/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }) {"finalSource":true}mapbufferedMap ConcatSourceRawSource$/***/ ((module) => { "use strict";  RawSourceHmodule.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }), /***/ 3295:  <webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; ]module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js"); /***/ })  ]module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");, /***/ 7497:  bwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource(// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/support/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/support/page.tsx", "default", ); `=G& 4@/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference));buffersourcesizemapshashT__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/support/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/support/page.tsx", "default", )); {"finalSource":true}mapbufferedMap ConcatSourceRawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); ReplaceSourceRawSource(// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/support/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/support/page.tsx", "default", ); 61134undefined136150/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (undefined136150undefined151173(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined550550.5);undefined /***/ })  _/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); ReplaceSourceRawSource(// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/support/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/support/page.tsx", "default", ); 61134undefined136150/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (undefined136150undefined151173(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined550550.5);undefined, /***/ 10846:  3webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js"); /***/ })  Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");, /***/ 19121:  8webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Ymodule.exports = require("next/dist/server/app-render/action-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/action-async-storage.external.js"); /***/ })  Ymodule.exports = require("next/dist/server/app-render/action-async-storage.external.js");, /***/ 26713:  $webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Emodule.exports = require("next/dist/shared/lib/router/utils/is-bot");  /***/ }) s/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/is-bot"); /***/ })  Emodule.exports = require("next/dist/shared/lib/router/utils/is-bot");, /***/ 27910:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("stream");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("stream"); /***/ })  #module.exports = require("stream");, /***/ 28354:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("util");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("util"); /***/ })  !module.exports = require("util");, /***/ 29021:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; module.exports = require("fs");  /***/ }) M/***/ ((module) => { "use strict"; module.exports = require("fs"); /***/ })  module.exports = require("fs");, /***/ 29294:  6webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-async-storage.external.js"); /***/ })  Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");, /***/ 31179:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource ?webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SupportPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _components_Turnstile__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(32589); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceo5/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import { CAPTCHA_ENABLED, TurnstileWidget } from '@/components/Turnstile'; import { sendPublicSupportMessage } from '@/lib/api'; const SUPPORT_EMAIL = 'info@canhelp.gr'; const CONTENT = { el: { title: 'Υποστήριξη CanHelp', intro: 'Αν χρειάζεστε βοήθεια με την εφαρμογή, στείλτε μας email ή χρησιμοποιήστε τη φόρμα επικοινωνίας μέσα στην εφαρμογή.', points: [ 'Περιγράψτε σύντομα το πρόβλημα και, αν γίνεται, επισυνάψτε στιγμιότυπο οθόνης.', 'Αν το ζήτημα αφορά σύνδεση, αναφέρετε τη συσκευή και την έκδοση της εφαρμογής.', 'Απαντάμε συνήθως μέσα σε 1-2 εργάσιμες ημέρες.' ] }, en: { title: 'CanHelp Support', intro: 'If you need help with the app, email us or use the in-app contact form.', points: [ 'Briefly describe the issue and attach a screenshot if possible.', 'If it is a login problem, include your device and app version.', 'We usually reply within 1-2 business days.' ] }, ru: { title: 'Поддержка CanHelp', intro: 'Если вам нужна помощь с приложением, напишите нам на email или используйте форму связи в приложении.', points: [ 'Кратко опишите проблему и, если возможно, приложите скриншот.', 'Если проблема со входом, укажите устройство и версию приложения.', 'Обычно мы отвечаем в течение 1-2 рабочих дней.' ] }, uk: { title: 'Підтримка CanHelp', intro: 'Якщо вам потрібна допомога з додатком, напишіть нам на email або скористайтеся формою зв’язку в додатку.', points: [ 'Коротко опишіть проблему та, якщо можливо, додайте скріншот.', 'Якщо проблема зі входом, вкажіть пристрій і версію додатка.', 'Зазвичай ми відповідаємо протягом 1-2 робочих днів.' ] } }; export default function SupportPage() { const { locale, t } = useLocale(); const content = CONTENT[locale] ?? CONTENT.en; const [name, setName] = useState(''); const [email, setEmail] = useState(''); const [subject, setSubject] = useState(''); const [body, setBody] = useState(''); const [captchaToken, setCaptchaToken] = useState(CAPTCHA_ENABLED ? '' : 'dev'); const [loading, setLoading] = useState(false); const [sent, setSent] = useState(false); const [error, setError] = useState(''); async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); try { await sendPublicSupportMessage({ name: name.trim(), email: email.trim(), subject: subject.trim(), body: body.trim(), captchaToken }); setSent(true); } catch (err) { if ((err?.message || '').toLowerCase().includes('captcha')) { setError('Security check failed. Please try again.'); setCaptchaToken(''); } else { setError('Failed to send message. Please try again.'); } } finally{ setLoading(false); } } return /*#__PURE__*/ _jsx("main", { className: "py-12 px-4 sm:px-6", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10", children: [ /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs(Link, { href: "/", className: "text-sm text-green-600 hover:underline", children: [ "← ", t('nav.home') ] }) }), /*#__PURE__*/ _jsx("h1", { className: "text-3xl font-extrabold text-gray-900 mb-3", children: content.title }), /*#__PURE__*/ _jsx("p", { className: "text-gray-600 leading-relaxed", children: content.intro }), /*#__PURE__*/ _jsx("div", { className: "mt-8 space-y-3", children: content.points.map((point)=>/*#__PURE__*/ _jsxs("div", { className: "flex gap-3 items-start rounded-xl border border-gray-100 bg-gray-50 px-4 py-3 text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("span", { className: "mt-0.5 h-2 w-2 rounded-full bg-green-500 shrink-0" }), /*#__PURE__*/ _jsx("span", { children: point }) ] }, point)) }), /*#__PURE__*/ _jsxs("div", { className: "mt-8 flex flex-col sm:flex-row gap-3 sm:items-center", children: [ /*#__PURE__*/ _jsx("a", { href: `mailto:${SUPPORT_EMAIL}`, className: "inline-flex items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 transition", children: SUPPORT_EMAIL }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-500", children: t('nav.privacy') }) ] }), /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "mt-10 space-y-4 rounded-2xl border border-gray-100 bg-gray-50 p-5 sm:p-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-semibold text-gray-900 mb-1", children: "Send a message to support" }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: "We will forward it directly to the admin team." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Name" }), /*#__PURE__*/ _jsx("input", { value: name, onChange: (e)=>setName(e.target.value), required: true, minLength: 2, maxLength: 100, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "Your name" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Email" }), /*#__PURE__*/ _jsx("input", { type: "email", value: email, onChange: (e)=>setEmail(e.target.value), required: true, maxLength: 200, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "name@example.com" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Subject" }), /*#__PURE__*/ _jsx("input", { value: subject, onChange: (e)=>setSubject(e.target.value), required: true, minLength: 3, maxLength: 200, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "What do you need help with?" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Message" }), /*#__PURE__*/ _jsx("textarea", { value: body, onChange: (e)=>setBody(e.target.value), required: true, minLength: 10, maxLength: 5000, rows: 6, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500 resize-none", placeholder: "Describe the problem in detail" }) ] }), /*#__PURE__*/ _jsx("div", { children: /*#__PURE__*/ _jsx(TurnstileWidget, { onSuccess: setCaptchaToken, onError: ()=>setCaptchaToken(''), onExpire: ()=>setCaptchaToken('') }) }), error && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600", children: error }), sent ? /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-green-200 bg-green-50 px-4 py-3 text-sm text-green-800", children: "Your message has been sent." }) : /*#__PURE__*/ _jsx("button", { type: "submit", disabled: loading || CAPTCHA_ENABLED && !captchaToken, className: "inline-flex w-full items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 disabled:opacity-50", children: loading ? 'Sending...' : 'Send message' }) ] }) ] }) }); } c8={}_46j@N  : A d k   D K _ l o 14 VY_;?Y\orY ] !! %%o%r%h&k&))w)z)p*s*U-LX-----..//000 1(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .CAPTCHA_ENABLED */ .l(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .sendPublicSupportMessage */ .O8)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(next_link__WEBPACK_IMPORTED_MODULE_2___default())_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .TurnstileWidget */ .$buffersourcesizemapshashConcatSourceRawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SupportPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _components_Turnstile__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(32589); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); ReplaceSourceRawSourceo5/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import { CAPTCHA_ENABLED, TurnstileWidget } from '@/components/Turnstile'; import { sendPublicSupportMessage } from '@/lib/api'; const SUPPORT_EMAIL = 'info@canhelp.gr'; const CONTENT = { el: { title: 'Υποστήριξη CanHelp', intro: 'Αν χρειάζεστε βοήθεια με την εφαρμογή, στείλτε μας email ή χρησιμοποιήστε τη φόρμα επικοινωνίας μέσα στην εφαρμογή.', points: [ 'Περιγράψτε σύντομα το πρόβλημα και, αν γίνεται, επισυνάψτε στιγμιότυπο οθόνης.', 'Αν το ζήτημα αφορά σύνδεση, αναφέρετε τη συσκευή και την έκδοση της εφαρμογής.', 'Απαντάμε συνήθως μέσα σε 1-2 εργάσιμες ημέρες.' ] }, en: { title: 'CanHelp Support', intro: 'If you need help with the app, email us or use the in-app contact form.', points: [ 'Briefly describe the issue and attach a screenshot if possible.', 'If it is a login problem, include your device and app version.', 'We usually reply within 1-2 business days.' ] }, ru: { title: 'Поддержка CanHelp', intro: 'Если вам нужна помощь с приложением, напишите нам на email или используйте форму связи в приложении.', points: [ 'Кратко опишите проблему и, если возможно, приложите скриншот.', 'Если проблема со входом, укажите устройство и версию приложения.', 'Обычно мы отвечаем в течение 1-2 рабочих дней.' ] }, uk: { title: 'Підтримка CanHelp', intro: 'Якщо вам потрібна допомога з додатком, напишіть нам на email або скористайтеся формою зв’язку в додатку.', points: [ 'Коротко опишіть проблему та, якщо можливо, додайте скріншот.', 'Якщо проблема зі входом, вкажіть пристрій і версію додатка.', 'Зазвичай ми відповідаємо протягом 1-2 робочих днів.' ] } }; export default function SupportPage() { const { locale, t } = useLocale(); const content = CONTENT[locale] ?? CONTENT.en; const [name, setName] = useState(''); const [email, setEmail] = useState(''); const [subject, setSubject] = useState(''); const [body, setBody] = useState(''); const [captchaToken, setCaptchaToken] = useState(CAPTCHA_ENABLED ? '' : 'dev'); const [loading, setLoading] = useState(false); const [sent, setSent] = useState(false); const [error, setError] = useState(''); async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); try { await sendPublicSupportMessage({ name: name.trim(), email: email.trim(), subject: subject.trim(), body: body.trim(), captchaToken }); setSent(true); } catch (err) { if ((err?.message || '').toLowerCase().includes('captcha')) { setError('Security check failed. Please try again.'); setCaptchaToken(''); } else { setError('Failed to send message. Please try again.'); } } finally{ setLoading(false); } } return /*#__PURE__*/ _jsx("main", { className: "py-12 px-4 sm:px-6", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10", children: [ /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs(Link, { href: "/", className: "text-sm text-green-600 hover:underline", children: [ "← ", t('nav.home') ] }) }), /*#__PURE__*/ _jsx("h1", { className: "text-3xl font-extrabold text-gray-900 mb-3", children: content.title }), /*#__PURE__*/ _jsx("p", { className: "text-gray-600 leading-relaxed", children: content.intro }), /*#__PURE__*/ _jsx("div", { className: "mt-8 space-y-3", children: content.points.map((point)=>/*#__PURE__*/ _jsxs("div", { className: "flex gap-3 items-start rounded-xl border border-gray-100 bg-gray-50 px-4 py-3 text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("span", { className: "mt-0.5 h-2 w-2 rounded-full bg-green-500 shrink-0" }), /*#__PURE__*/ _jsx("span", { children: point }) ] }, point)) }), /*#__PURE__*/ _jsxs("div", { className: "mt-8 flex flex-col sm:flex-row gap-3 sm:items-center", children: [ /*#__PURE__*/ _jsx("a", { href: `mailto:${SUPPORT_EMAIL}`, className: "inline-flex items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 transition", children: SUPPORT_EMAIL }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-500", children: t('nav.privacy') }) ] }), /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "mt-10 space-y-4 rounded-2xl border border-gray-100 bg-gray-50 p-5 sm:p-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-semibold text-gray-900 mb-1", children: "Send a message to support" }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: "We will forward it directly to the admin team." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Name" }), /*#__PURE__*/ _jsx("input", { value: name, onChange: (e)=>setName(e.target.value), required: true, minLength: 2, maxLength: 100, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "Your name" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Email" }), /*#__PURE__*/ _jsx("input", { type: "email", value: email, onChange: (e)=>setEmail(e.target.value), required: true, maxLength: 200, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "name@example.com" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Subject" }), /*#__PURE__*/ _jsx("input", { value: subject, onChange: (e)=>setSubject(e.target.value), required: true, minLength: 3, maxLength: 200, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "What do you need help with?" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Message" }), /*#__PURE__*/ _jsx("textarea", { value: body, onChange: (e)=>setBody(e.target.value), required: true, minLength: 10, maxLength: 5000, rows: 6, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500 resize-none", placeholder: "Describe the problem in detail" }) ] }), /*#__PURE__*/ _jsx("div", { children: /*#__PURE__*/ _jsx(TurnstileWidget, { onSuccess: setCaptchaToken, onError: ()=>setCaptchaToken(''), onExpire: ()=>setCaptchaToken('') }) }), error && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600", children: error }), sent ? /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-green-200 bg-green-50 px-4 py-3 text-sm text-green-800", children: "Your message has been sent." }) : /*#__PURE__*/ _jsx("button", { type: "submit", disabled: loading || CAPTCHA_ENABLED && !captchaToken, className: "inline-flex w-full items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 disabled:opacity-50", children: loading ? 'Sending...' : 'Send message' }) ] }) ] }) }); } F61123undefined125157undefined159187undefined189233undefined235308undefined310362undefined21122126undefined21782186(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined22702277(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined23142321(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined23622369(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24042411(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24622469(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24712485_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .CAPTCHA_ENABLED */ .lundefined25362543(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25812588(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26282635(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined27872810(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .sendPublicSupportMessage */ .O8)undefined34363439(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined35243528(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined37113714(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined38083812(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined38143817(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined41454148(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43294332(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined44994502(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined46344638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined48774880(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined50735076(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined52905294(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined54625465(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined58305833(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined60636067(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined63006304(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined64016404(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined66616664(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined69716975(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined71407144(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined72577260(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined75357538(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined82818285(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined83988401(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined86778680(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined94829486(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined95839586(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined98329835(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1051410518(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1061510618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1086410867(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1160511608(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1167111674(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1167611690_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .TurnstileWidget */ .$undefined1199311996(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1218512188(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1243212435(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1254212556_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .CAPTCHA_ENABLED */ .lundefined /***/ })  __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SupportPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _components_Turnstile__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(32589); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91864); o5/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import { CAPTCHA_ENABLED, TurnstileWidget } from '@/components/Turnstile'; import { sendPublicSupportMessage } from '@/lib/api'; const SUPPORT_EMAIL = 'info@canhelp.gr'; const CONTENT = { el: { title: 'Υποστήριξη CanHelp', intro: 'Αν χρειάζεστε βοήθεια με την εφαρμογή, στείλτε μας email ή χρησιμοποιήστε τη φόρμα επικοινωνίας μέσα στην εφαρμογή.', points: [ 'Περιγράψτε σύντομα το πρόβλημα και, αν γίνεται, επισυνάψτε στιγμιότυπο οθόνης.', 'Αν το ζήτημα αφορά σύνδεση, αναφέρετε τη συσκευή και την έκδοση της εφαρμογής.', 'Απαντάμε συνήθως μέσα σε 1-2 εργάσιμες ημέρες.' ] }, en: { title: 'CanHelp Support', intro: 'If you need help with the app, email us or use the in-app contact form.', points: [ 'Briefly describe the issue and attach a screenshot if possible.', 'If it is a login problem, include your device and app version.', 'We usually reply within 1-2 business days.' ] }, ru: { title: 'Поддержка CanHelp', intro: 'Если вам нужна помощь с приложением, напишите нам на email или используйте форму связи в приложении.', points: [ 'Кратко опишите проблему и, если возможно, приложите скриншот.', 'Если проблема со входом, укажите устройство и версию приложения.', 'Обычно мы отвечаем в течение 1-2 рабочих дней.' ] }, uk: { title: 'Підтримка CanHelp', intro: 'Якщо вам потрібна допомога з додатком, напишіть нам на email або скористайтеся формою зв’язку в додатку.', points: [ 'Коротко опишіть проблему та, якщо можливо, додайте скріншот.', 'Якщо проблема зі входом, вкажіть пристрій і версію додатка.', 'Зазвичай ми відповідаємо протягом 1-2 робочих днів.' ] } }; export default function SupportPage() { const { locale, t } = useLocale(); const content = CONTENT[locale] ?? CONTENT.en; const [name, setName] = useState(''); const [email, setEmail] = useState(''); const [subject, setSubject] = useState(''); const [body, setBody] = useState(''); const [captchaToken, setCaptchaToken] = useState(CAPTCHA_ENABLED ? '' : 'dev'); const [loading, setLoading] = useState(false); const [sent, setSent] = useState(false); const [error, setError] = useState(''); async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); try { await sendPublicSupportMessage({ name: name.trim(), email: email.trim(), subject: subject.trim(), body: body.trim(), captchaToken }); setSent(true); } catch (err) { if ((err?.message || '').toLowerCase().includes('captcha')) { setError('Security check failed. Please try again.'); setCaptchaToken(''); } else { setError('Failed to send message. Please try again.'); } } finally{ setLoading(false); } } return /*#__PURE__*/ _jsx("main", { className: "py-12 px-4 sm:px-6", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10", children: [ /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs(Link, { href: "/", className: "text-sm text-green-600 hover:underline", children: [ "← ", t('nav.home') ] }) }), /*#__PURE__*/ _jsx("h1", { className: "text-3xl font-extrabold text-gray-900 mb-3", children: content.title }), /*#__PURE__*/ _jsx("p", { className: "text-gray-600 leading-relaxed", children: content.intro }), /*#__PURE__*/ _jsx("div", { className: "mt-8 space-y-3", children: content.points.map((point)=>/*#__PURE__*/ _jsxs("div", { className: "flex gap-3 items-start rounded-xl border border-gray-100 bg-gray-50 px-4 py-3 text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("span", { className: "mt-0.5 h-2 w-2 rounded-full bg-green-500 shrink-0" }), /*#__PURE__*/ _jsx("span", { children: point }) ] }, point)) }), /*#__PURE__*/ _jsxs("div", { className: "mt-8 flex flex-col sm:flex-row gap-3 sm:items-center", children: [ /*#__PURE__*/ _jsx("a", { href: `mailto:${SUPPORT_EMAIL}`, className: "inline-flex items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 transition", children: SUPPORT_EMAIL }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-500", children: t('nav.privacy') }) ] }), /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "mt-10 space-y-4 rounded-2xl border border-gray-100 bg-gray-50 p-5 sm:p-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-semibold text-gray-900 mb-1", children: "Send a message to support" }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: "We will forward it directly to the admin team." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Name" }), /*#__PURE__*/ _jsx("input", { value: name, onChange: (e)=>setName(e.target.value), required: true, minLength: 2, maxLength: 100, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "Your name" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Email" }), /*#__PURE__*/ _jsx("input", { type: "email", value: email, onChange: (e)=>setEmail(e.target.value), required: true, maxLength: 200, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "name@example.com" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Subject" }), /*#__PURE__*/ _jsx("input", { value: subject, onChange: (e)=>setSubject(e.target.value), required: true, minLength: 3, maxLength: 200, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "What do you need help with?" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Message" }), /*#__PURE__*/ _jsx("textarea", { value: body, onChange: (e)=>setBody(e.target.value), required: true, minLength: 10, maxLength: 5000, rows: 6, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500 resize-none", placeholder: "Describe the problem in detail" }) ] }), /*#__PURE__*/ _jsx("div", { children: /*#__PURE__*/ _jsx(TurnstileWidget, { onSuccess: setCaptchaToken, onError: ()=>setCaptchaToken(''), onExpire: ()=>setCaptchaToken('') }) }), error && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600", children: error }), sent ? /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-green-200 bg-green-50 px-4 py-3 text-sm text-green-800", children: "Your message has been sent." }) : /*#__PURE__*/ _jsx("button", { type: "submit", disabled: loading || CAPTCHA_ENABLED && !captchaToken, className: "inline-flex w-full items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 disabled:opacity-50", children: loading ? 'Sending...' : 'Send message' }) ] }) ] }) }); } F61123undefined125157undefined159187undefined189233undefined235308undefined310362undefined21122126undefined21782186(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined22702277(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined23142321(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined23622369(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24042411(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24622469(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24712485_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .CAPTCHA_ENABLED */ .lundefined25362543(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25812588(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26282635(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined27872810(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .sendPublicSupportMessage */ .O8)undefined34363439(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined35243528(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined37113714(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined38083812(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined38143817(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined41454148(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43294332(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined44994502(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined46344638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined48774880(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined50735076(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined52905294(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined54625465(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined58305833(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined60636067(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined63006304(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined64016404(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined66616664(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined69716975(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined71407144(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined72577260(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined75357538(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined82818285(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined83988401(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined86778680(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined94829486(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined95839586(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined98329835(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1051410518(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1061510618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1086410867(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1160511608(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1167111674(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1167611690_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .TurnstileWidget */ .$undefined1199311996(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1218512188(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1243212435(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1254212556_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .CAPTCHA_ENABLED */ .lundefined, /***/ 32589:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Dwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource // EXPORTS __webpack_require__.d(__webpack_exports__, { l: () => (/* binding */ CAPTCHA_ENABLED), $: () => (/* binding */ TurnstileWidget) }); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(78157); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js var react = __webpack_require__(31768); ;// ../../node_modules/@marsidev/react-turnstile/dist/index.js webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource ,webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource'/* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ import { forwardRef as e, useCallback as t, useEffect as n, useImperativeHandle as r, useMemo as i, useRef as a, useState as o } from "react"; import { jsx as s } from "react/jsx-runtime"; var c = /*#__PURE__*/ e(({ as: e = `div`, ...t }, n)=>s(e, { ...t, ref: n })); const l = `https://challenges.cloudflare.com/turnstile/v0/api.js`, u = `cf-turnstile-script`, d = `cf-turnstile`, f = `onloadTurnstileCallback`, p = (e)=>!!document.getElementById(e), m = ({ render: e = `explicit`, onLoadCallbackName: t = f, scriptOptions: { nonce: n = ``, defer: r = !0, async: i = !0, id: a = ``, appendTo: o, onError: s, crossOrigin: c = `` } = {} })=>{ let u = a || `cf-turnstile-script`; if (p(u)) return; let d = document.createElement(`script`); d.id = u, d.src = `${l}?onload=${t}&render=${e}`, !document.querySelector(`script[src="${d.src}"]`) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === `body` ? document.body : document.getElementsByTagName(`head`)[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: `hidden` }, flexible: { minWidth: 300, width: `100%`, height: 65 }, interactionOnly: { width: `fit-content`, height: `auto`, display: `flex` } }; function g(e) { if (e !== `invisible` && e !== `interactionOnly`) return e; } function _(e = u) { let [t, r] = o(!1); return process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && n(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = `unloaded`, y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === `ready` && e(void 0); }), x = (e = f)=>(v === `unloaded` && (v = `loading`, window[e] = ()=>{ y.resolve(), v = `ready`, delete window[e]; }), b), S = /*#__PURE__*/ e((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = `div`, injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = t(()=>P === void 0 ? {} : d.execution === `execute` ? h.invisible : d.appearance === `interaction-only` ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = o(F()), R = a(null), [z, B] = o(!1), V = a(void 0), H = a(!1), U = O || `cf-turnstile`, W = a({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); n(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = u?.id || `cf-turnstile-script`, K = _(G), q = u?.onLoadCallbackName || `onloadTurnstileCallback`, J = d.appearance || `always`, Y = i(()=>({ sitekey: f, action: d.action, cData: d.cData, theme: d.theme || `auto`, language: d.language || `auto`, tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || `auto`, "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || `auto`, "refresh-timeout": d.refreshTimeout || `auto`, execution: d.execution || `render`, appearance: d.appearance || `always`, "feedback-enabled": d.feedbackEnabled ?? !0, callback: (e)=>{ H.current = !0, M ? y?.(e) : W.current.onSuccess?.(e); }, "error-callback": M ? S : (...e)=>W.current.onError?.(...e), "expired-callback": M ? b : (...e)=>W.current.onExpire?.(...e), "before-interactive-callback": M ? C : (...e)=>W.current.onBeforeInteractive?.(...e), "after-interactive-callback": M ? w : (...e)=>W.current.onAfterInteractive?.(...e), "unsupported-callback": M ? T : (...e)=>W.current.onUnsupported?.(...e), "timeout-callback": M ? E : (...e)=>W.current.onTimeout?.(...e) }), [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = t(()=>"undefined" < `u` && !!window.turnstile, []); return n(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), n(function() { v !== `ready` && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), n(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && p?.(V.current)); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), r(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!e?.getResponse || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } return e.getResponse(V.current); }, async getResponsePromise (e = 3e4, t = 100) { return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error(`No response received`)); } catch (e) { return i && clearTimeout(i), console.warn(`Failed to get response`, e), r(Error(`Failed to get response`)); } i ||= setTimeout(()=>{ i && clearTimeout(i), r(Error(`Timeout`)); }, e), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!e?.reset || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } d.execution === `execute` && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn(`Failed to reset Turnstile widget ${V.current}`, e); } }, remove () { if (!e?.remove || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!e?.render || !R.current || !X() || V.current) { console.warn(`Turnstile has not been loaded or container not found`); return; } let t = e.render(R.current, Y); return V.current = t, V.current && p?.(V.current), d.execution !== `execute` && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== `execute`) { console.warn(`Execution mode is not set to "execute"`); return; } if (!e?.execute || !R.current || !V.current || !X()) { console.warn(`Turnstile has not been loaded or container not found`); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !e?.isExpired || !V.current || !X() ? (console.warn(`Turnstile has not been loaded`), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), n(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), n(()=>{ L(F()); }, [ d.execution, P, J ]), n(()=>{ !K || typeof D != `function` || D(); }, [ K ]), s(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = `Turnstile`; export { d as DEFAULT_CONTAINER_ID, f as DEFAULT_ONLOAD_NAME, u as DEFAULT_SCRIPT_ID, l as SCRIPT_URL, S as Turnstile }; `_@XXxxZ Z w w [ !!QQWgl}vv$$0&0&&&&&}''__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(/* unused pure expression or super */ null && ())__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._ false0__WEBPACK_MODULE_REFERENCE__1_5b22757365496d706572617469766548616e646c65225d_call_directImport_asiSafe1__._buffersourcesizemapshashy./* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ var c = /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._(({ as: e = `div`, ...t }, n)=>__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(e, { ...t, ref: n })); const l = `https://challenges.cloudflare.com/turnstile/v0/api.js`, u = `cf-turnstile-script`, d = (/* unused pure expression or super */ null && (`cf-turnstile`)), f = `onloadTurnstileCallback`, p = (e)=>!!document.getElementById(e), m = ({ render: e = `explicit`, onLoadCallbackName: t = f, scriptOptions: { nonce: n = ``, defer: r = !0, async: i = !0, id: a = ``, appendTo: o, onError: s, crossOrigin: c = `` } = {} })=>{ let u = a || `cf-turnstile-script`; if (p(u)) return; let d = document.createElement(`script`); d.id = u, d.src = `${l}?onload=${t}&render=${e}`, !document.querySelector(`script[src="${d.src}"]`) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === `body` ? document.body : document.getElementsByTagName(`head`)[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: `hidden` }, flexible: { minWidth: 300, width: `100%`, height: 65 }, interactionOnly: { width: `fit-content`, height: `auto`, display: `flex` } }; function g(e) { if (e !== `invisible` && e !== `interactionOnly`) return e; } function _(e = u) { let [t, r] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(!1); return process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = `unloaded`, y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === `ready` && e(void 0); }), x = (e = f)=>(v === `unloaded` && (v = `loading`, window[e] = ()=>{ y.resolve(), v = `ready`, delete window[e]; }), b), S = /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = `div`, injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = __WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._(()=>P === void 0 ? {} : d.execution === `execute` ? h.invisible : d.appearance === `interaction-only` ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(F()), R = __WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._(null), [z, B] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(!1), V = __WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._(void 0), H = __WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._(!1), U = O || `cf-turnstile`, W = __WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = u?.id || `cf-turnstile-script`, K = _(G), q = u?.onLoadCallbackName || `onloadTurnstileCallback`, J = d.appearance || `always`, Y = __WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._(()=>({ sitekey: f, action: d.action, cData: d.cData, theme: d.theme || `auto`, language: d.language || `auto`, tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || `auto`, "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || `auto`, "refresh-timeout": d.refreshTimeout || `auto`, execution: d.execution || `render`, appearance: d.appearance || `always`, "feedback-enabled": d.feedbackEnabled ?? !0, callback: (e)=>{ H.current = !0, M ? y?.(e) : W.current.onSuccess?.(e); }, "error-callback": M ? S : (...e)=>W.current.onError?.(...e), "expired-callback": M ? b : (...e)=>W.current.onExpire?.(...e), "before-interactive-callback": M ? C : (...e)=>W.current.onBeforeInteractive?.(...e), "after-interactive-callback": M ? w : (...e)=>W.current.onAfterInteractive?.(...e), "unsupported-callback": M ? T : (...e)=>W.current.onUnsupported?.(...e), "timeout-callback": M ? E : (...e)=>W.current.onTimeout?.(...e) }), [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = __WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._(()=> false && 0, []); return __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(function() { v !== `ready` && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && p?.(V.current)); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), __WEBPACK_MODULE_REFERENCE__1_5b22757365496d706572617469766548616e646c65225d_call_directImport_asiSafe1__._(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!e?.getResponse || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } return e.getResponse(V.current); }, async getResponsePromise (e = 3e4, t = 100) { return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error(`No response received`)); } catch (e) { return i && clearTimeout(i), console.warn(`Failed to get response`, e), r(Error(`Failed to get response`)); } i ||= setTimeout(()=>{ i && clearTimeout(i), r(Error(`Timeout`)); }, e), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!e?.reset || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } d.execution === `execute` && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn(`Failed to reset Turnstile widget ${V.current}`, e); } }, remove () { if (!e?.remove || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!e?.render || !R.current || !X() || V.current) { console.warn(`Turnstile has not been loaded or container not found`); return; } let t = e.render(R.current, Y); return V.current = t, V.current && p?.(V.current), d.execution !== `execute` && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== `execute`) { console.warn(`Execution mode is not set to "execute"`); return; } if (!e?.execute || !R.current || !V.current || !X()) { console.warn(`Turnstile has not been loaded or container not found`); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !e?.isExpired || !V.current || !X() ? (console.warn(`Turnstile has not been loaded`), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ L(F()); }, [ d.execution, P, J ]), __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ !K || typeof D != `function` || D(); }, [ K ]), __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = `Turnstile`; {"finalSource":false}mapbufferedMap ReplaceSourceRawSource'/* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ import { forwardRef as e, useCallback as t, useEffect as n, useImperativeHandle as r, useMemo as i, useRef as a, useState as o } from "react"; import { jsx as s } from "react/jsx-runtime"; var c = /*#__PURE__*/ e(({ as: e = `div`, ...t }, n)=>s(e, { ...t, ref: n })); const l = `https://challenges.cloudflare.com/turnstile/v0/api.js`, u = `cf-turnstile-script`, d = `cf-turnstile`, f = `onloadTurnstileCallback`, p = (e)=>!!document.getElementById(e), m = ({ render: e = `explicit`, onLoadCallbackName: t = f, scriptOptions: { nonce: n = ``, defer: r = !0, async: i = !0, id: a = ``, appendTo: o, onError: s, crossOrigin: c = `` } = {} })=>{ let u = a || `cf-turnstile-script`; if (p(u)) return; let d = document.createElement(`script`); d.id = u, d.src = `${l}?onload=${t}&render=${e}`, !document.querySelector(`script[src="${d.src}"]`) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === `body` ? document.body : document.getElementsByTagName(`head`)[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: `hidden` }, flexible: { minWidth: 300, width: `100%`, height: 65 }, interactionOnly: { width: `fit-content`, height: `auto`, display: `flex` } }; function g(e) { if (e !== `invisible` && e !== `interactionOnly`) return e; } function _(e = u) { let [t, r] = o(!1); return process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && n(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = `unloaded`, y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === `ready` && e(void 0); }), x = (e = f)=>(v === `unloaded` && (v = `loading`, window[e] = ()=>{ y.resolve(), v = `ready`, delete window[e]; }), b), S = /*#__PURE__*/ e((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = `div`, injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = t(()=>P === void 0 ? {} : d.execution === `execute` ? h.invisible : d.appearance === `interaction-only` ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = o(F()), R = a(null), [z, B] = o(!1), V = a(void 0), H = a(!1), U = O || `cf-turnstile`, W = a({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); n(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = u?.id || `cf-turnstile-script`, K = _(G), q = u?.onLoadCallbackName || `onloadTurnstileCallback`, J = d.appearance || `always`, Y = i(()=>({ sitekey: f, action: d.action, cData: d.cData, theme: d.theme || `auto`, language: d.language || `auto`, tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || `auto`, "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || `auto`, "refresh-timeout": d.refreshTimeout || `auto`, execution: d.execution || `render`, appearance: d.appearance || `always`, "feedback-enabled": d.feedbackEnabled ?? !0, callback: (e)=>{ H.current = !0, M ? y?.(e) : W.current.onSuccess?.(e); }, "error-callback": M ? S : (...e)=>W.current.onError?.(...e), "expired-callback": M ? b : (...e)=>W.current.onExpire?.(...e), "before-interactive-callback": M ? C : (...e)=>W.current.onBeforeInteractive?.(...e), "after-interactive-callback": M ? w : (...e)=>W.current.onAfterInteractive?.(...e), "unsupported-callback": M ? T : (...e)=>W.current.onUnsupported?.(...e), "timeout-callback": M ? E : (...e)=>W.current.onTimeout?.(...e) }), [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = t(()=>"undefined" < `u` && !!window.turnstile, []); return n(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), n(function() { v !== `ready` && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), n(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && p?.(V.current)); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), r(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!e?.getResponse || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } return e.getResponse(V.current); }, async getResponsePromise (e = 3e4, t = 100) { return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error(`No response received`)); } catch (e) { return i && clearTimeout(i), console.warn(`Failed to get response`, e), r(Error(`Failed to get response`)); } i ||= setTimeout(()=>{ i && clearTimeout(i), r(Error(`Timeout`)); }, e), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!e?.reset || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } d.execution === `execute` && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn(`Failed to reset Turnstile widget ${V.current}`, e); } }, remove () { if (!e?.remove || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!e?.render || !R.current || !X() || V.current) { console.warn(`Turnstile has not been loaded or container not found`); return; } let t = e.render(R.current, Y); return V.current = t, V.current && p?.(V.current), d.execution !== `execute` && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== `execute`) { console.warn(`Execution mode is not set to "execute"`); return; } if (!e?.execute || !R.current || !V.current || !X()) { console.warn(`Turnstile has not been loaded or container not found`); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !e?.isExpired || !V.current || !X() ? (console.warn(`Turnstile has not been loaded`), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), n(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), n(()=>{ L(F()); }, [ d.execution, P, J ]), n(()=>{ !K || typeof D != `function` || D(); }, [ K ]), s(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = `Turnstile`; export { d as DEFAULT_CONTAINER_ID, f as DEFAULT_ONLOAD_NAME, u as DEFAULT_SCRIPT_ID, l as SCRIPT_URL, S as Turnstile };  133274undefined276320undefined344344__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._undefined376376__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined519518(/* unused pure expression or super */ null && (undefined533532))undefined17541754__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined18231823__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined23942394__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._undefined27312731__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined29352935__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined29472947__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined29652965__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined29762976__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined29912991__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined30273027__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined32163216__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined36173617__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined54575457__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined54635479 falseundefined548455010undefined55205520__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined57715771__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined58815881__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined62626262__WEBPACK_MODULE_REFERENCE__1_5b22757365496d706572617469766548616e646c65225d_call_directImport_asiSafe1__._undefined94499449__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined97769776__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined98599859__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined99399939__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1010910228undefined`__G u @ L  ]l0C&V)M$z>%**5,,,4---(0,react.forwardRef)(0,react_jsx_runtime.jsx)(0,react.useState)(0,react.useEffect)(0,react.useCallback)(0,react.useRef)(0,react.useMemo)(0,react.useImperativeHandle)$ ;// ./src/components/Turnstile.tsx  pwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { Turnstile } from '@marsidev/react-turnstile'; const SITE_KEY = process.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY ?? ''; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ export const CAPTCHA_ENABLED = !!SITE_KEY; export function TurnstileWidget({ onSuccess, onError, onExpire }) { if (!SITE_KEY) return null; return /*#__PURE__*/ _jsx(Turnstile, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); } `UNCInt"0x4AAAAAAC_FtTQJ0_6Cp9-9"0__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__2_5b225475726e7374696c65225d_directImport_asiSafe1__._/* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ const SITE_KEY = "0x4AAAAAAC_FtTQJ0_6Cp9-9" ?? 0; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ const CAPTCHA_ENABLED = !!SITE_KEY; function TurnstileWidget({ onSuccess, onError, onExpire }) { if (!SITE_KEY) return null; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__2_5b225475726e7374696c65225d_directImport_asiSafe1__._, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); }  /* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { Turnstile } from '@marsidev/react-turnstile'; const SITE_KEY = process.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY ?? ''; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ export const CAPTCHA_ENABLED = !!SITE_KEY; export function TurnstileWidget({ onSuccess, onError, onExpire }) { if (!SITE_KEY) return null; return /*#__PURE__*/ _jsx(Turnstile, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); } /85132undefined134187undefined206247"0x4AAAAAAC_FtTQJ0_6Cp9-9"undefined2522530undefined323329undefined366372undefined491494__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined496504__WEBPACK_MODULE_REFERENCE__2_5b225475726e7374696c65225d_directImport_asiSafe1__._undefinedCfSbuffersourcesizemapshash- // EXPORTS __webpack_require__.d(__webpack_exports__, { l: () => (/* binding */ CAPTCHA_ENABLED), $: () => (/* binding */ TurnstileWidget) }); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(78157); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js var react = __webpack_require__(31768); ;// ../../node_modules/@marsidev/react-turnstile/dist/index.js /* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ var c = /*#__PURE__*/ (0,react.forwardRef)(({ as: e = `div`, ...t }, n)=>(0,react_jsx_runtime.jsx)(e, { ...t, ref: n })); const l = `https://challenges.cloudflare.com/turnstile/v0/api.js`, u = `cf-turnstile-script`, d = (/* unused pure expression or super */ null && (`cf-turnstile`)), f = `onloadTurnstileCallback`, p = (e)=>!!document.getElementById(e), m = ({ render: e = `explicit`, onLoadCallbackName: t = f, scriptOptions: { nonce: n = ``, defer: r = !0, async: i = !0, id: a = ``, appendTo: o, onError: s, crossOrigin: c = `` } = {} })=>{ let u = a || `cf-turnstile-script`; if (p(u)) return; let d = document.createElement(`script`); d.id = u, d.src = `${l}?onload=${t}&render=${e}`, !document.querySelector(`script[src="${d.src}"]`) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === `body` ? document.body : document.getElementsByTagName(`head`)[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: `hidden` }, flexible: { minWidth: 300, width: `100%`, height: 65 }, interactionOnly: { width: `fit-content`, height: `auto`, display: `flex` } }; function g(e) { if (e !== `invisible` && e !== `interactionOnly`) return e; } function _(e = u) { let [t, r] = (0,react.useState)(!1); return process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react.useEffect)(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = `unloaded`, y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === `ready` && e(void 0); }), x = (e = f)=>(v === `unloaded` && (v = `loading`, window[e] = ()=>{ y.resolve(), v = `ready`, delete window[e]; }), b), S = /*#__PURE__*/ (0,react.forwardRef)((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = `div`, injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = (0,react.useCallback)(()=>P === void 0 ? {} : d.execution === `execute` ? h.invisible : d.appearance === `interaction-only` ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = (0,react.useState)(F()), R = (0,react.useRef)(null), [z, B] = (0,react.useState)(!1), V = (0,react.useRef)(void 0), H = (0,react.useRef)(!1), U = O || `cf-turnstile`, W = (0,react.useRef)({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); (0,react.useEffect)(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = u?.id || `cf-turnstile-script`, K = _(G), q = u?.onLoadCallbackName || `onloadTurnstileCallback`, J = d.appearance || `always`, Y = (0,react.useMemo)(()=>({ sitekey: f, action: d.action, cData: d.cData, theme: d.theme || `auto`, language: d.language || `auto`, tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || `auto`, "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || `auto`, "refresh-timeout": d.refreshTimeout || `auto`, execution: d.execution || `render`, appearance: d.appearance || `always`, "feedback-enabled": d.feedbackEnabled ?? !0, callback: (e)=>{ H.current = !0, M ? y?.(e) : W.current.onSuccess?.(e); }, "error-callback": M ? S : (...e)=>W.current.onError?.(...e), "expired-callback": M ? b : (...e)=>W.current.onExpire?.(...e), "before-interactive-callback": M ? C : (...e)=>W.current.onBeforeInteractive?.(...e), "after-interactive-callback": M ? w : (...e)=>W.current.onAfterInteractive?.(...e), "unsupported-callback": M ? T : (...e)=>W.current.onUnsupported?.(...e), "timeout-callback": M ? E : (...e)=>W.current.onTimeout?.(...e) }), [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = (0,react.useCallback)(()=> false && 0, []); return (0,react.useEffect)(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), (0,react.useEffect)(function() { v !== `ready` && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), (0,react.useEffect)(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && p?.(V.current)); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), (0,react.useImperativeHandle)(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!e?.getResponse || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } return e.getResponse(V.current); }, async getResponsePromise (e = 3e4, t = 100) { return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error(`No response received`)); } catch (e) { return i && clearTimeout(i), console.warn(`Failed to get response`, e), r(Error(`Failed to get response`)); } i ||= setTimeout(()=>{ i && clearTimeout(i), r(Error(`Timeout`)); }, e), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!e?.reset || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } d.execution === `execute` && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn(`Failed to reset Turnstile widget ${V.current}`, e); } }, remove () { if (!e?.remove || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!e?.render || !R.current || !X() || V.current) { console.warn(`Turnstile has not been loaded or container not found`); return; } let t = e.render(R.current, Y); return V.current = t, V.current && p?.(V.current), d.execution !== `execute` && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== `execute`) { console.warn(`Execution mode is not set to "execute"`); return; } if (!e?.execute || !R.current || !V.current || !X()) { console.warn(`Turnstile has not been loaded or container not found`); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !e?.isExpired || !V.current || !X() ? (console.warn(`Turnstile has not been loaded`), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), (0,react.useEffect)(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), (0,react.useEffect)(()=>{ L(F()); }, [ d.execution, P, J ]), (0,react.useEffect)(()=>{ !K || typeof D != `function` || D(); }, [ K ]), (0,react_jsx_runtime.jsx)(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = `Turnstile`; ;// ./src/components/Turnstile.tsx /* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ const SITE_KEY = "0x4AAAAAAC_FtTQJ0_6Cp9-9" ?? 0; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ const CAPTCHA_ENABLED = !!SITE_KEY; function TurnstileWidget({ onSuccess, onError, onExpire }) { if (!SITE_KEY) return null; return /*#__PURE__*/ (0,react_jsx_runtime.jsx)(S, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); } {"finalSource":true}mapbufferedMap ` ConcatSourceRawSource // EXPORTS __webpack_require__.d(__webpack_exports__, { l: () => (/* binding */ CAPTCHA_ENABLED), $: () => (/* binding */ TurnstileWidget) }); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(78157); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js var react = __webpack_require__(31768); ;// ../../node_modules/@marsidev/react-turnstile/dist/index.js  ReplaceSourceReplaceSourceRawSource'/* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ import { forwardRef as e, useCallback as t, useEffect as n, useImperativeHandle as r, useMemo as i, useRef as a, useState as o } from "react"; import { jsx as s } from "react/jsx-runtime"; var c = /*#__PURE__*/ e(({ as: e = `div`, ...t }, n)=>s(e, { ...t, ref: n })); const l = `https://challenges.cloudflare.com/turnstile/v0/api.js`, u = `cf-turnstile-script`, d = `cf-turnstile`, f = `onloadTurnstileCallback`, p = (e)=>!!document.getElementById(e), m = ({ render: e = `explicit`, onLoadCallbackName: t = f, scriptOptions: { nonce: n = ``, defer: r = !0, async: i = !0, id: a = ``, appendTo: o, onError: s, crossOrigin: c = `` } = {} })=>{ let u = a || `cf-turnstile-script`; if (p(u)) return; let d = document.createElement(`script`); d.id = u, d.src = `${l}?onload=${t}&render=${e}`, !document.querySelector(`script[src="${d.src}"]`) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === `body` ? document.body : document.getElementsByTagName(`head`)[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: `hidden` }, flexible: { minWidth: 300, width: `100%`, height: 65 }, interactionOnly: { width: `fit-content`, height: `auto`, display: `flex` } }; function g(e) { if (e !== `invisible` && e !== `interactionOnly`) return e; } function _(e = u) { let [t, r] = o(!1); return process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && n(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = `unloaded`, y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === `ready` && e(void 0); }), x = (e = f)=>(v === `unloaded` && (v = `loading`, window[e] = ()=>{ y.resolve(), v = `ready`, delete window[e]; }), b), S = /*#__PURE__*/ e((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = `div`, injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = t(()=>P === void 0 ? {} : d.execution === `execute` ? h.invisible : d.appearance === `interaction-only` ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = o(F()), R = a(null), [z, B] = o(!1), V = a(void 0), H = a(!1), U = O || `cf-turnstile`, W = a({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); n(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = u?.id || `cf-turnstile-script`, K = _(G), q = u?.onLoadCallbackName || `onloadTurnstileCallback`, J = d.appearance || `always`, Y = i(()=>({ sitekey: f, action: d.action, cData: d.cData, theme: d.theme || `auto`, language: d.language || `auto`, tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || `auto`, "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || `auto`, "refresh-timeout": d.refreshTimeout || `auto`, execution: d.execution || `render`, appearance: d.appearance || `always`, "feedback-enabled": d.feedbackEnabled ?? !0, callback: (e)=>{ H.current = !0, M ? y?.(e) : W.current.onSuccess?.(e); }, "error-callback": M ? S : (...e)=>W.current.onError?.(...e), "expired-callback": M ? b : (...e)=>W.current.onExpire?.(...e), "before-interactive-callback": M ? C : (...e)=>W.current.onBeforeInteractive?.(...e), "after-interactive-callback": M ? w : (...e)=>W.current.onAfterInteractive?.(...e), "unsupported-callback": M ? T : (...e)=>W.current.onUnsupported?.(...e), "timeout-callback": M ? E : (...e)=>W.current.onTimeout?.(...e) }), [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = t(()=>"undefined" < `u` && !!window.turnstile, []); return n(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), n(function() { v !== `ready` && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), n(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && p?.(V.current)); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), r(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!e?.getResponse || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } return e.getResponse(V.current); }, async getResponsePromise (e = 3e4, t = 100) { return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error(`No response received`)); } catch (e) { return i && clearTimeout(i), console.warn(`Failed to get response`, e), r(Error(`Failed to get response`)); } i ||= setTimeout(()=>{ i && clearTimeout(i), r(Error(`Timeout`)); }, e), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!e?.reset || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } d.execution === `execute` && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn(`Failed to reset Turnstile widget ${V.current}`, e); } }, remove () { if (!e?.remove || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!e?.render || !R.current || !X() || V.current) { console.warn(`Turnstile has not been loaded or container not found`); return; } let t = e.render(R.current, Y); return V.current = t, V.current && p?.(V.current), d.execution !== `execute` && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== `execute`) { console.warn(`Execution mode is not set to "execute"`); return; } if (!e?.execute || !R.current || !V.current || !X()) { console.warn(`Turnstile has not been loaded or container not found`); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !e?.isExpired || !V.current || !X() ? (console.warn(`Turnstile has not been loaded`), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), n(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), n(()=>{ L(F()); }, [ d.execution, P, J ]), n(()=>{ !K || typeof D != `function` || D(); }, [ K ]), s(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = `Turnstile`; export { d as DEFAULT_CONTAINER_ID, f as DEFAULT_ONLOAD_NAME, u as DEFAULT_SCRIPT_ID, l as SCRIPT_URL, S as Turnstile };  133274undefined276320undefined344344__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._undefined376376__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined519518(/* unused pure expression or super */ null && (undefined533532))undefined17541754__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined18231823__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined23942394__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._undefined27312731__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined29352935__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined29472947__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined29652965__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined29762976__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined29912991__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined30273027__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined32163216__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined36173617__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined54575457__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined54635479 falseundefined548455010undefined55205520__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined57715771__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined58815881__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined62626262__WEBPACK_MODULE_REFERENCE__1_5b22757365496d706572617469766548616e646c65225d_call_directImport_asiSafe1__._undefined94499449__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined97769776__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined98599859__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined99399939__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1010910228undefinedT157245(0,react.forwardRef)undefined277351(0,react_jsx_runtime.jsx)undefined17791863(0,react.useState)undefined19322018(0,react.useEffect)undefined25892677(0,react.forwardRef)undefined30143104(0,react.useCallback)undefined33083392(0,react.useState)undefined34043484(0,react.useRef)undefined35023586(0,react.useState)undefined35973677(0,react.useRef)undefined36923772(0,react.useRef)undefined38083888(0,react.useRef)undefined40774163(0,react.useEffect)undefined45644646(0,react.useMemo)undefined64866576(0,react.useCallback)undefined66116697(0,react.useEffect)undefined69487034(0,react.useEffect)undefined71447230(0,react.useEffect)undefined76117717(0,react.useImperativeHandle)undefined1090410990(0,react.useEffect)undefined1131711403(0,react.useEffect)undefined1148611572(0,react.useEffect)undefined1165211726(0,react_jsx_runtime.jsx)undefinedRawSource$ ;// ./src/components/Turnstile.tsx /* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { Turnstile } from '@marsidev/react-turnstile'; const SITE_KEY = process.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY ?? ''; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ export const CAPTCHA_ENABLED = !!SITE_KEY; export function TurnstileWidget({ onSuccess, onError, onExpire }) { if (!SITE_KEY) return null; return /*#__PURE__*/ _jsx(Turnstile, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); } /85132undefined134187undefined206247"0x4AAAAAAC_FtTQJ0_6Cp9-9"undefined2522530undefined323329undefined366372undefined491494__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined496504__WEBPACK_MODULE_REFERENCE__2_5b225475726e7374696c65225d_directImport_asiSafe1__._undefined8358432(0,react_jsx_runtime.jsx)undefined434515Sundefined /***/ }) ` // EXPORTS __webpack_require__.d(__webpack_exports__, { l: () => (/* binding */ CAPTCHA_ENABLED), $: () => (/* binding */ TurnstileWidget) }); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(78157); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js var react = __webpack_require__(31768); ;// ../../node_modules/@marsidev/react-turnstile/dist/index.js  ReplaceSource'/* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ import { forwardRef as e, useCallback as t, useEffect as n, useImperativeHandle as r, useMemo as i, useRef as a, useState as o } from "react"; import { jsx as s } from "react/jsx-runtime"; var c = /*#__PURE__*/ e(({ as: e = `div`, ...t }, n)=>s(e, { ...t, ref: n })); const l = `https://challenges.cloudflare.com/turnstile/v0/api.js`, u = `cf-turnstile-script`, d = `cf-turnstile`, f = `onloadTurnstileCallback`, p = (e)=>!!document.getElementById(e), m = ({ render: e = `explicit`, onLoadCallbackName: t = f, scriptOptions: { nonce: n = ``, defer: r = !0, async: i = !0, id: a = ``, appendTo: o, onError: s, crossOrigin: c = `` } = {} })=>{ let u = a || `cf-turnstile-script`; if (p(u)) return; let d = document.createElement(`script`); d.id = u, d.src = `${l}?onload=${t}&render=${e}`, !document.querySelector(`script[src="${d.src}"]`) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === `body` ? document.body : document.getElementsByTagName(`head`)[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: `hidden` }, flexible: { minWidth: 300, width: `100%`, height: 65 }, interactionOnly: { width: `fit-content`, height: `auto`, display: `flex` } }; function g(e) { if (e !== `invisible` && e !== `interactionOnly`) return e; } function _(e = u) { let [t, r] = o(!1); return process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && n(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = `unloaded`, y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === `ready` && e(void 0); }), x = (e = f)=>(v === `unloaded` && (v = `loading`, window[e] = ()=>{ y.resolve(), v = `ready`, delete window[e]; }), b), S = /*#__PURE__*/ e((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = `div`, injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = t(()=>P === void 0 ? {} : d.execution === `execute` ? h.invisible : d.appearance === `interaction-only` ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = o(F()), R = a(null), [z, B] = o(!1), V = a(void 0), H = a(!1), U = O || `cf-turnstile`, W = a({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); n(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = u?.id || `cf-turnstile-script`, K = _(G), q = u?.onLoadCallbackName || `onloadTurnstileCallback`, J = d.appearance || `always`, Y = i(()=>({ sitekey: f, action: d.action, cData: d.cData, theme: d.theme || `auto`, language: d.language || `auto`, tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || `auto`, "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || `auto`, "refresh-timeout": d.refreshTimeout || `auto`, execution: d.execution || `render`, appearance: d.appearance || `always`, "feedback-enabled": d.feedbackEnabled ?? !0, callback: (e)=>{ H.current = !0, M ? y?.(e) : W.current.onSuccess?.(e); }, "error-callback": M ? S : (...e)=>W.current.onError?.(...e), "expired-callback": M ? b : (...e)=>W.current.onExpire?.(...e), "before-interactive-callback": M ? C : (...e)=>W.current.onBeforeInteractive?.(...e), "after-interactive-callback": M ? w : (...e)=>W.current.onAfterInteractive?.(...e), "unsupported-callback": M ? T : (...e)=>W.current.onUnsupported?.(...e), "timeout-callback": M ? E : (...e)=>W.current.onTimeout?.(...e) }), [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = t(()=>"undefined" < `u` && !!window.turnstile, []); return n(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), n(function() { v !== `ready` && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), n(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && p?.(V.current)); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), r(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!e?.getResponse || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } return e.getResponse(V.current); }, async getResponsePromise (e = 3e4, t = 100) { return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error(`No response received`)); } catch (e) { return i && clearTimeout(i), console.warn(`Failed to get response`, e), r(Error(`Failed to get response`)); } i ||= setTimeout(()=>{ i && clearTimeout(i), r(Error(`Timeout`)); }, e), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!e?.reset || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } d.execution === `execute` && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn(`Failed to reset Turnstile widget ${V.current}`, e); } }, remove () { if (!e?.remove || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!e?.render || !R.current || !X() || V.current) { console.warn(`Turnstile has not been loaded or container not found`); return; } let t = e.render(R.current, Y); return V.current = t, V.current && p?.(V.current), d.execution !== `execute` && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== `execute`) { console.warn(`Execution mode is not set to "execute"`); return; } if (!e?.execute || !R.current || !V.current || !X()) { console.warn(`Turnstile has not been loaded or container not found`); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !e?.isExpired || !V.current || !X() ? (console.warn(`Turnstile has not been loaded`), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), n(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), n(()=>{ L(F()); }, [ d.execution, P, J ]), n(()=>{ !K || typeof D != `function` || D(); }, [ K ]), s(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = `Turnstile`; export { d as DEFAULT_CONTAINER_ID, f as DEFAULT_ONLOAD_NAME, u as DEFAULT_SCRIPT_ID, l as SCRIPT_URL, S as Turnstile };  133274undefined276320undefined344344__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._undefined376376__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined519518(/* unused pure expression or super */ null && (undefined533532))undefined17541754__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined18231823__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined23942394__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._undefined27312731__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined29352935__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined29472947__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined29652965__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined29762976__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined29912991__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined30273027__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined32163216__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined36173617__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined54575457__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined54635479 falseundefined548455010undefined55205520__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined57715771__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined58815881__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined62626262__WEBPACK_MODULE_REFERENCE__1_5b22757365496d706572617469766548616e646c65225d_call_directImport_asiSafe1__._undefined94499449__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined97769776__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined98599859__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined99399939__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1010910228undefinedT157245(0,react.forwardRef)undefined277351(0,react_jsx_runtime.jsx)undefined17791863(0,react.useState)undefined19322018(0,react.useEffect)undefined25892677(0,react.forwardRef)undefined30143104(0,react.useCallback)undefined33083392(0,react.useState)undefined34043484(0,react.useRef)undefined35023586(0,react.useState)undefined35973677(0,react.useRef)undefined36923772(0,react.useRef)undefined38083888(0,react.useRef)undefined40774163(0,react.useEffect)undefined45644646(0,react.useMemo)undefined64866576(0,react.useCallback)undefined66116697(0,react.useEffect)undefined69487034(0,react.useEffect)undefined71447230(0,react.useEffect)undefined76117717(0,react.useImperativeHandle)undefined1090410990(0,react.useEffect)undefined1131711403(0,react.useEffect)undefined1148611572(0,react.useEffect)undefined1165211726(0,react_jsx_runtime.jsx)undefinedRawSource$ ;// ./src/components/Turnstile.tsx /* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { Turnstile } from '@marsidev/react-turnstile'; const SITE_KEY = process.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY ?? ''; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ export const CAPTCHA_ENABLED = !!SITE_KEY; export function TurnstileWidget({ onSuccess, onError, onExpire }) { if (!SITE_KEY) return null; return /*#__PURE__*/ _jsx(Turnstile, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); } /85132undefined134187undefined206247"0x4AAAAAAC_FtTQJ0_6Cp9-9"undefined2522530undefined323329undefined366372undefined491494__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined496504__WEBPACK_MODULE_REFERENCE__2_5b225475726e7374696c65225d_directImport_asiSafe1__._undefined8358432(0,react_jsx_runtime.jsx)undefined434515Sundefined, /***/ 33873:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("path");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("path"); /***/ })  !module.exports = require("path");, /***/ 34631:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("tls");  /***/ }) zN/***/ ((module) => { "use strict"; module.exports = require("tls"); /***/ }) {~  module.exports = require("tls");, /***/ 41025:  @webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; amodule.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js");  /***/ }) q/***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js"); /***/ }) ru vwxamodule.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js");wy, /***/ 45997:  ^webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Wwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceUimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/support/page.tsx"); `RPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 31179))buffersourcesizemapshashbPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 31179)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceUimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/support/page.tsx"); l082Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 31179))undefined /***/ }) hoV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Uimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/support/page.tsx"); l082Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 31179))undefinednp, /***/ 55511:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("crypto");  /***/ }) _Q/***/ ((module) => { "use strict"; module.exports = require("crypto"); /***/ }) `c def#module.exports = require("crypto");eg, /***/ 55591:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; "module.exports = require("https");  /***/ }) VP/***/ ((module) => { "use strict"; module.exports = require("https"); /***/ }) WZ [\]"module.exports = require("https");\^, /***/ 62937:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceconst module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/support/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'support', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/support/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/support/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/support/page", pathname: "/support", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/support/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map @bb{_:S.Z\FH<>_WY L N > @  _<>Ts*r 49:U{_?LJY  !!!!"5"""#'$,$_:$2-?-..55!6)6\6[677m8899;:I:q::d;;;= @@YDfD}EEYH_}HHHHILLT"TUU~[[j`{`aaaa$b/bcc1d (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); const module0 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570)); const module1 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23)); const module2 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506)); const module3 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23)); const module4 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23)); const page5 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 7497)); // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'support', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/support/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))).default(props))], apple: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))).default(props))], apple: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/support/page.tsx"]; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; // Create and export the route module that will be consumed. const routeModule = new next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModule({ definition: { kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, page: "/support/page", pathname: "/support", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: ".next" || 0, relativeProjectDir: false || '' }); async function handler(req, res, ctx) { var _this; let srcPage = "/support/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const initialPostponed = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)(userAgent); const isHtmlBot = (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isPrefetchRSCRequest') ?? req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isRSCRequest') ?? Boolean(req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADER]); const isPossibleServerAction = (0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = (0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = false && 0; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { (0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)(req.headers); } const ComponentMod = { ...next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__, tree, pages, GlobalError: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default()), handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { (0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: (0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequest(req); const nextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (false) {} return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: (0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: true ? (__webpack_require__(33873).join)(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : 0, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = (0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.PRERENDER && (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND) { throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.PAGES, html: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && ((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'renderFallbackShell') || isDebugFallbackShell) ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(matchedSegment, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(cachedData.rscData, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map {"finalSource":true}mapbufferedMap ConcatSourceRawSource#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); ReplaceSourceRawSourceconst module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/support/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'support', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/support/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/support/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/support/page", pathname: "/support", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/support/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map $'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558640Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 7497))undefined643783undefined785899undefined901977undefined9791050undefined10521114undefined11161185undefined11871263undefined12651350undefined13521435undefined14371513undefined15151596undefined15981691undefined16931797undefined17991879undefined18811959undefined19612052undefined20542235undefined22372313undefined23152380undefined23822455undefined24572514undefined25162622undefined26242697undefined26992763undefined27652846undefined32573479Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined35373766Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined43264548Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined46064835Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined50205042undefined50445180undefined51825204undefined52355253__webpack_require__undefined53115317undefined54185544undefined55465631undefined56335746undefined58095815undefined58405857next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined58935901next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined61616196".next"undefined620162020undefined62296267 falseundefined62796285undefined65676587falseundefined65906654{}undefined68006839falseundefined68716884(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined69756988(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined77547769(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined81568165(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined82018216(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined83618374(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined84208446next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined86258638(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined86848693next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined87338757(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined89378956(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined91489255 falseundefined926092740undefined1157011583(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1196811995(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1378013797(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1385713865next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1391613915: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1428414313(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1444514465(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1459914607(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1490714921next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1496114976next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1520415241falseundefined1524415819{}undefined1639716410next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1749717510(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1778917802(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1852118557 trueundefined1856118580(__webpack_require__(33873).join)undefined18659187100undefined1967119684(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2152521538(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2196221983next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2342223436next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2468224699(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2498824999next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2501425018(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2512425135next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2556925580next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2564925660next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2574925760next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2629326304next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2634926363next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2701527023next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2776927790(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2931829332next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2937129382next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2988429897(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2995429975(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3055030558next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3203732051next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3340333426next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3589335906next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3620136215next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3709837121next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3739337414next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3753237553next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3778337798(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3802638037next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3806638088next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3874438759(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3896738978next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3924139254(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3970239715(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4058540606next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4148541506next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4161641637next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4219042207next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4241142434next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4333043345(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4437344388(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4459644607next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4464044662next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4537945491falseundefined4549445844{}undefined4586945884(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4682846839next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4697446989(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4760047627falseundefined4763047700{}undefined4900849022next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined4994649961(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5083650849next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5094850955next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5121151225next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5143751455(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefined /***/ }) M ThT#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); iconst module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/support/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'support', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/support/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/support/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/support/page", pathname: "/support", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/support/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map $'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558640Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 7497))undefined643783undefined785899undefined901977undefined9791050undefined10521114undefined11161185undefined11871263undefined12651350undefined13521435undefined14371513undefined15151596undefined15981691undefined16931797undefined17991879undefined18811959undefined19612052undefined20542235undefined22372313undefined23152380undefined23822455undefined24572514undefined25162622undefined26242697undefined26992763undefined27652846undefined32573479Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined35373766Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined43264548Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined46064835Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined50205042undefined50445180undefined51825204undefined52355253__webpack_require__undefined53115317undefined54185544undefined55465631undefined56335746undefined58095815undefined58405857next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined58935901next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined61616196".next"undefined620162020undefined62296267 falseundefined62796285undefined65676587falseundefined65906654{}undefined68006839falseundefined68716884(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined69756988(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined77547769(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined81568165(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined82018216(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined83618374(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined84208446next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined86258638(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined86848693next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined87338757(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined89378956(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined91489255 falseundefined926092740undefined1157011583(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1196811995(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1378013797(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1385713865next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1391613915: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1428414313(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1444514465(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1459914607(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1490714921next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1496114976next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1520415241falseundefined1524415819{}undefined1639716410next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1749717510(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1778917802(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1852118557 trueundefined1856118580(__webpack_require__(33873).join)undefined18659187100undefined1967119684(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2152521538(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2196221983next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2342223436next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2468224699(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2498824999next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2501425018(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2512425135next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2556925580next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2564925660next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2574925760next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2629326304next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2634926363next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2701527023next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2776927790(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2931829332next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2937129382next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2988429897(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2995429975(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3055030558next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3203732051next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3340333426next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3589335906next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3620136215next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3709837121next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3739337414next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3753237553next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3778337798(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3802638037next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3806638088next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3874438759(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3896738978next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3924139254(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3970239715(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4058540606next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4148541506next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4161641637next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4219042207next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4241142434next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4333043345(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4437344388(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4459644607next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4464044662next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4537945491falseundefined4549445844{}undefined4586945884(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4682846839next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4697446989(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4760047627falseundefined4763047700{}undefined4900849022next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined4994649961(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5083650849next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5094850955next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5121151225next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5143751455(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefinedSU, /***/ 63033:  ;webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; \module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");  /***/ }) D/***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js"); /***/ }) EH IJK\module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");JL, /***/ 74075:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("zlib");  /***/ }) ;O/***/ ((module) => { "use strict"; module.exports = require("zlib"); /***/ }) <? @AB!module.exports = require("zlib");AC, /***/ 79428:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("buffer");  /***/ }) 2Q/***/ ((module) => { "use strict"; module.exports = require("buffer"); /***/ }) 36 789#module.exports = require("buffer");8:, /***/ 79551:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("url");  /***/ }) )N/***/ ((module) => { "use strict"; module.exports = require("url"); /***/ }) *- ./0 module.exports = require("url");/1, /***/ 79646:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; *module.exports = require("child_process");  /***/ })  X/***/ ((module) => { "use strict"; module.exports = require("child_process"); /***/ }) !$ %&'*module.exports = require("child_process");&(, /***/ 81630:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("http");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("http"); /***/ })  !module.exports = require("http");, /***/ 83997:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("tty");  /***/ }) N/***/ ((module) => { "use strict"; module.exports = require("tty"); /***/ })   module.exports = require("tty");, /***/ 86439:  +webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");  /***/ }) z/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/no-fallback-error.external"); /***/ })      Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");  , /***/ 91645:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("net");  /***/ }) N/***/ ((module) => { "use strict"; module.exports = require("net"); /***/ })   module.exports = require("net");, /***/ 94735:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("events");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("events"); /***/ })  #module.exports = require("events");, /***/ 98733:  [webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Vwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceUimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/support/page.tsx"); `RPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 7497))buffersourcesizemapshashaPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 7497)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceUimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/support/page.tsx"); k082Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 7497))undefined /***/ }) k082Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 7497))undefinedw }; ; // load runtime var __webpack_require__ = require("../../webpack-runtime.js"); __webpack_require__.C(exports); var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [901,652,809], () => (__webpack_exec__(62937))); ,module.exports = __webpack_exports__; })(); (@ /b(() => { var exports = {}; exports.id = 174; exports.ids = [174]; exports.modules = { /***/ 261: .<=>?.@A>, /***/ 7497: -Y-K/(// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/support/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/support/page.tsx", "default", ); <@,>A<F,>G<M,>N<O,>P<Q,>R<S,>T<U,>V<, /***/ 31179: +W+-;, /***/ 32589: *V* // EXPORTS __webpack_require__.d(__webpack_exports__, { l: () => (/* binding */ CAPTCHA_ENABLED), $: () => (/* binding */ TurnstileWidget) }); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(78157); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js var react = __webpack_require__(31768); ;// ../../node_modules/@marsidev/react-turnstile/dist/index.js +'/* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ import { forwardRef as e, useCallback as t, useEffect as n, useImperativeHandle as r, useMemo as i, useRef as a, useState as o } from "react"; import { jsx as s } from "react/jsx-runtime"; var c = /*#__PURE__*/ e(({ as: e = `div`, ...t }, n)=>s(e, { ...t, ref: n })); const l = `https://challenges.cloudflare.com/turnstile/v0/api.js`, u = `cf-turnstile-script`, d = `cf-turnstile`, f = `onloadTurnstileCallback`, p = (e)=>!!document.getElementById(e), m = ({ render: e = `explicit`, onLoadCallbackName: t = f, scriptOptions: { nonce: n = ``, defer: r = !0, async: i = !0, id: a = ``, appendTo: o, onError: s, crossOrigin: c = `` } = {} })=>{ let u = a || `cf-turnstile-script`; if (p(u)) return; let d = document.createElement(`script`); d.id = u, d.src = `${l}?onload=${t}&render=${e}`, !document.querySelector(`script[src="${d.src}"]`) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === `body` ? document.body : document.getElementsByTagName(`head`)[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: `hidden` }, flexible: { minWidth: 300, width: `100%`, height: 65 }, interactionOnly: { width: `fit-content`, height: `auto`, display: `flex` } }; function g(e) { if (e !== `invisible` && e !== `interactionOnly`) return e; } function _(e = u) { let [t, r] = o(!1); return process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && n(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = `unloaded`, y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === `ready` && e(void 0); }), x = (e = f)=>(v === `unloaded` && (v = `loading`, window[e] = ()=>{ y.resolve(), v = `ready`, delete window[e]; }), b), S = /*#__PURE__*/ e((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = `div`, injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = t(()=>P === void 0 ? {} : d.execution === `execute` ? h.invisible : d.appearance === `interaction-only` ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = o(F()), R = a(null), [z, B] = o(!1), V = a(void 0), H = a(!1), U = O || `cf-turnstile`, W = a({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); n(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = u?.id || `cf-turnstile-script`, K = _(G), q = u?.onLoadCallbackName || `onloadTurnstileCallback`, J = d.appearance || `always`, Y = i(()=>({ sitekey: f, action: d.action, cData: d.cData, theme: d.theme || `auto`, language: d.language || `auto`, tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || `auto`, "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || `auto`, "refresh-timeout": d.refreshTimeout || `auto`, execution: d.execution || `render`, appearance: d.appearance || `always`, "feedback-enabled": d.feedbackEnabled ?? !0, callback: (e)=>{ H.current = !0, M ? y?.(e) : W.current.onSuccess?.(e); }, "error-callback": M ? S : (...e)=>W.current.onError?.(...e), "expired-callback": M ? b : (...e)=>W.current.onExpire?.(...e), "before-interactive-callback": M ? C : (...e)=>W.current.onBeforeInteractive?.(...e), "after-interactive-callback": M ? w : (...e)=>W.current.onAfterInteractive?.(...e), "unsupported-callback": M ? T : (...e)=>W.current.onUnsupported?.(...e), "timeout-callback": M ? E : (...e)=>W.current.onTimeout?.(...e) }), [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = t(()=>"undefined" < `u` && !!window.turnstile, []); return n(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), n(function() { v !== `ready` && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), n(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && p?.(V.current)); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), r(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!e?.getResponse || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } return e.getResponse(V.current); }, async getResponsePromise (e = 3e4, t = 100) { return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error(`No response received`)); } catch (e) { return i && clearTimeout(i), console.warn(`Failed to get response`, e), r(Error(`Failed to get response`)); } i ||= setTimeout(()=>{ i && clearTimeout(i), r(Error(`Timeout`)); }, e), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!e?.reset || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } d.execution === `execute` && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn(`Failed to reset Turnstile widget ${V.current}`, e); } }, remove () { if (!e?.remove || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!e?.render || !R.current || !X() || V.current) { console.warn(`Turnstile has not been loaded or container not found`); return; } let t = e.render(R.current, Y); return V.current = t, V.current && p?.(V.current), d.execution !== `execute` && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== `execute`) { console.warn(`Execution mode is not set to "execute"`); return; } if (!e?.execute || !R.current || !V.current || !X()) { console.warn(`Turnstile has not been loaded or container not found`); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !e?.isExpired || !V.current || !X() ? (console.warn(`Turnstile has not been loaded`), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), n(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), n(()=>{ L(F()); }, [ d.execution, P, J ]), n(()=>{ !K || typeof D != `function` || D(); }, [ K ]), s(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = `Turnstile`; export { d as DEFAULT_CONTAINER_ID, f as DEFAULT_ONLOAD_NAME, u as DEFAULT_SCRIPT_ID, l as SCRIPT_URL, S as Turnstile };  133274undefined276320undefined344344__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._undefined376376__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined519518(/* unused pure expression or super */ null && (undefined533532))undefined17541754__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined18231823__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined23942394__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._undefined27312731__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined29352935__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined29472947__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined29652965__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined29762976__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined29912991__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined30273027__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined32163216__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined36173617__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined54575457__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined54635479 falseundefined548455010undefined55205520__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined57715771__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined58815881__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined62626262__WEBPACK_MODULE_REFERENCE__1_5b22757365496d706572617469766548616e646c65225d_call_directImport_asiSafe1__._undefined94499449__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined97769776__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined98599859__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined99399939__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1010910228undefinedT157245(0,react.forwardRef)undefined277351(0,react_jsx_runtime.jsx)undefined17791863(0,react.useState)undefined19322018(0,react.useEffect)undefined25892677(0,react.forwardRef)undefined30143104(0,react.useCallback)undefined33083392(0,react.useState)undefined34043484(0,react.useRef)undefined35023586(0,react.useState)undefined35973677(0,react.useRef)undefined36923772(0,react.useRef)undefined38083888(0,react.useRef)undefined40774163(0,react.useEffect)undefined45644646(0,react.useMemo)undefined64866576(0,react.useCallback)undefined66116697(0,react.useEffect)undefined69487034(0,react.useEffect)undefined71447230(0,react.useEffect)undefined76117717(0,react.useImperativeHandle)undefined1090410990(0,react.useEffect)undefined1131711403(0,react.useEffect)undefined1148611572(0,react.useEffect)undefined1165211726(0,react_jsx_runtime.jsx)undefinedRawSource$ ;// ./src/components/Turnstile.tsx '/* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { Turnstile } from '@marsidev/react-turnstile'; const SITE_KEY = process.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY ?? ''; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ export const CAPTCHA_ENABLED = !!SITE_KEY; export function TurnstileWidget({ onSuccess, onError, onExpire }) { if (!SITE_KEY) return null; return /*#__PURE__*/ _jsx(Turnstile, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); } /85132undefined134187undefined206247"0x4AAAAAAC_FtTQJ0_6Cp9-9"undefined2522530undefined323329undefined366372undefined491494__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined496504__WEBPACK_MODULE_REFERENCE__2_5b225475726e7374696c65225d_directImport_asiSafe1__._undefined8358432(0,react_jsx_runtime.jsx)undefined434515Sundefined2R"4S2T"4U2V"4W2, /***/ 45997: !8#Uimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/support/page.tsx"); l082Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 31179))undefined/U1V/W1X/, /***/ 62937: JK const module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/support/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'support', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/support/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/support/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/support/page", pathname: "/support", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/support/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map $'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558640Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 7497))undefined643783undefined785899undefined901977undefined9791050undefined10521114undefined11161185undefined11871263undefined12651350undefined13521435undefined14371513undefined15151596undefined15981691undefined16931797undefined17991879undefined18811959undefined19612052undefined20542235undefined22372313undefined23152380undefined23822455undefined24572514undefined25162622undefined26242697undefined26992763undefined27652846undefined32573479Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined35373766Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined43264548Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined46064835Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined50205042undefined50445180undefined51825204undefined52355253__webpack_require__undefined53115317undefined54185544undefined55465631undefined56335746undefined58095815undefined58405857next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined58935901next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined61616196".next"undefined620162020undefined62296267 falseundefined62796285undefined65676587falseundefined65906654{}undefined68006839falseundefined68716884(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined69756988(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined77547769(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined81568165(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined82018216(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined83618374(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined84208446next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined86258638(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined86848693next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined87338757(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined89378956(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined91489255 falseundefined926092740undefined1157011583(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1196811995(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1378013797(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1385713865next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1391613915: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1428414313(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1444514465(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1459914607(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1490714921next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1496114976next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1520415241falseundefined1524415819{}undefined1639716410next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1749717510(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1778917802(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1852118557 trueundefined1856118580(__webpack_require__(33873).join)undefined18659187100undefined1967119684(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2152521538(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2196221983next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2342223436next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2468224699(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2498824999next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2501425018(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2512425135next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2556925580next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2564925660next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2574925760next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2629326304next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2634926363next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2701527023next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2776927790(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2931829332next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2937129382next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2988429897(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2995429975(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3055030558next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3203732051next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3340333426next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3589335906next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3620136215next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3709837121next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3739337414next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3753237553next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3778337798(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3802638037next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3806638088next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3874438759(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3896738978next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3924139254(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3970239715(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4058540606next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4148541506next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4161641637next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4219042207next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4241142434next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4333043345(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4437344388(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4459644607next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4464044662next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4537945491falseundefined4549445844{}undefined4586945884(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4682846839next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4697446989(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4760047627falseundefined4763047700{}undefined4900849022next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined4994649961(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5083650849next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5094850955next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5121151225next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5143751455(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefined,V.W,X.Y,Z.[,\.],^._,a.b,c.d,e.f,g.h,i.j,, /***/ 98733: 2k082Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 7497))undefined*kvar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [901,652,809], () => (__webpack_exec__(62937))); l Qwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSource`Qwebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceb(() => { var exports = {}; exports.id = 147; exports.ids = [147]; exports.modules = { /***/ 261: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource 'webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Hmodule.exports = require("next/dist/shared/lib/router/utils/app-paths");  /***/ }) buffersourcesizemapshashv/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }) {"finalSource":true}mapbufferedMap ConcatSourceRawSource$/***/ ((module) => { "use strict";  RawSourceHmodule.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }), /***/ 3295:  <webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; ]module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js"); /***/ })  ]module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");, /***/ 8225:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Wwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskMapDynamic: () => (/* binding */ TaskMapDynamic) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dynamic__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(47262); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceM/* __next_internal_client_entry_do_not_use__ TaskMapDynamic auto */ import { jsx as _jsx } from "react/jsx-runtime"; import dynamic from 'next/dynamic'; export const TaskMapDynamic = dynamic(async ()=>{ typeof require.resolveWeak !== "undefined" && require.resolveWeak("./TaskMapClient"); }, { loadableGenerated: { modules: [ "app/tasks/TaskMapDynamic.tsx -> " + "./TaskMapClient" ] }, ssr: false, loading: ()=>/*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-gray-200 bg-gray-50 flex items-center justify-center", style: { height: 580 }, children: /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 border-2 border-green-500 border-t-transparent rounded-full animate-spin" }) }) });  bDsuN!(0,next_dynamic__WEBPACK_IMPORTED_MODULE_1__["default"]) true/*require.resolve*/null /* weak dependency, without id */(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)buffersourcesizemapshash/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskMapDynamic: () => (/* binding */ TaskMapDynamic) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dynamic__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(47262); /* __next_internal_client_entry_do_not_use__ TaskMapDynamic auto */ const TaskMapDynamic = (0,next_dynamic__WEBPACK_IMPORTED_MODULE_1__["default"])(async ()=>{ true && /*require.resolve*/(null /* weak dependency, without id */); }, { loadableGenerated: { modules: [ "app/tasks/TaskMapDynamic.tsx -> " + "./TaskMapClient" ] }, ssr: false, loading: ()=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "rounded-xl border border-gray-200 bg-gray-50 flex items-center justify-center", style: { height: 580 }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 border-2 border-green-500 border-t-transparent rounded-full animate-spin" }) }) }); {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskMapDynamic: () => (/* binding */ TaskMapDynamic) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dynamic__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(47262); ReplaceSourceRawSourceM/* __next_internal_client_entry_do_not_use__ TaskMapDynamic auto */ import { jsx as _jsx } from "react/jsx-runtime"; import dynamic from 'next/dynamic'; export const TaskMapDynamic = dynamic(async ()=>{ typeof require.resolveWeak !== "undefined" && require.resolveWeak("./TaskMapClient"); }, { loadableGenerated: { modules: [ "app/tasks/TaskMapDynamic.tsx -> " + "./TaskMapClient" ] }, ssr: false, loading: ()=>/*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-gray-200 bg-gray-50 flex items-center justify-center", style: { height: 580 }, children: /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 border-2 border-green-500 border-t-transparent rounded-full animate-spin" }) }) }); h68115undefined117151undefined153159undefined183189(0,next_dynamic__WEBPACK_IMPORTED_MODULE_1__["default"])undefined207248 trueundefined253271/*require.resolve*/undefined273289null /* weak dependency, without id */undefined473476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined691694(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ })  _/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskMapDynamic: () => (/* binding */ TaskMapDynamic) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dynamic__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(47262); ReplaceSourceRawSourceM/* __next_internal_client_entry_do_not_use__ TaskMapDynamic auto */ import { jsx as _jsx } from "react/jsx-runtime"; import dynamic from 'next/dynamic'; export const TaskMapDynamic = dynamic(async ()=>{ typeof require.resolveWeak !== "undefined" && require.resolveWeak("./TaskMapClient"); }, { loadableGenerated: { modules: [ "app/tasks/TaskMapDynamic.tsx -> " + "./TaskMapClient" ] }, ssr: false, loading: ()=>/*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-gray-200 bg-gray-50 flex items-center justify-center", style: { height: 580 }, children: /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 border-2 border-green-500 border-t-transparent rounded-full animate-spin" }) }) }); h68115undefined117151undefined153159undefined183189(0,next_dynamic__WEBPACK_IMPORTED_MODULE_1__["default"])undefined207248 trueundefined253271/*require.resolve*/undefined273289null /* weak dependency, without id */undefined473476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined691694(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 8293:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource <webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceexport function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ export function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } export function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } CDJbuffersourcesizemapshash/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); ReplaceSourceRawSourceexport function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ export function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } export function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } )06undefined324330undefined486492undefined /***/ }) /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } /***/ })   /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); export function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ export function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } export function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } )06undefined324330undefined486492undefined, /***/ 10846:  3webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js"); /***/ })  Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");, /***/ 12905:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceconst module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/tasks/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'tasks', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/tasks/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/tasks/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/tasks/page", pathname: "/tasks", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/tasks/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map @bb{_:S.~ XZDF:<_UW J L < >  _46Lk}"j(-.Io{_1><K !!!!"'"""#$$_,$$-1-..5566N6M677_8s889-:;:c:r:V;{;~;=? @KDXDoE|EKH_oHsHHHILLTTUUp[~[\`m`aaaab!bcc#d.dddffffyi_ikllxrrrrttt uHwPw}%}m'4[iܐ|_JY)4;H{Ѥ4CGV&1Rh5T.޶pFbp  Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 21440))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))__webpack_require__next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModulenext_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind".next"0 falsefalse{}(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERnext_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADER(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)0(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestnext_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponsenext_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T) true(__webpack_require__(33873).join)0next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERnext_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERnext_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARnext_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERnext_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodenext_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSnext_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKind(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)buffersourcesizemapshash__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); const module0 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570)); const module1 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23)); const module2 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506)); const module3 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23)); const module4 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23)); const page5 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 21440)); // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'tasks', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/tasks/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))).default(props))], apple: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))).default(props))], apple: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/tasks/page.tsx"]; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; // Create and export the route module that will be consumed. const routeModule = new next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModule({ definition: { kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, page: "/tasks/page", pathname: "/tasks", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: ".next" || 0, relativeProjectDir: false || '' }); async function handler(req, res, ctx) { var _this; let srcPage = "/tasks/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const initialPostponed = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)(userAgent); const isHtmlBot = (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isPrefetchRSCRequest') ?? req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isRSCRequest') ?? Boolean(req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADER]); const isPossibleServerAction = (0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = (0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = false && 0; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { (0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)(req.headers); } const ComponentMod = { ...next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__, tree, pages, GlobalError: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default()), handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { (0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: (0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequest(req); const nextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (false) {} return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: (0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: true ? (__webpack_require__(33873).join)(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : 0, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = (0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.PRERENDER && (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND) { throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.PAGES, html: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && ((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'renderFallbackShell') || isDebugFallbackShell) ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(matchedSegment, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(cachedData.rscData, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map {"finalSource":true}mapbufferedMap ConcatSourceRawSource#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); ReplaceSourceRawSourceconst module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/tasks/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'tasks', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/tasks/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/tasks/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/tasks/page", pathname: "/tasks", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/tasks/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map %'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558638Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 21440))undefined641781undefined783897undefined899975undefined9771048undefined10501112undefined11141183undefined11851261undefined12631348undefined13501433undefined14351511undefined15131594undefined15961689undefined16911795undefined17971877undefined18791957undefined19592050undefined20522233undefined22352311undefined23132378undefined23802453undefined24552512undefined25142620undefined26222695undefined26972761undefined27632844undefined32513473Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined35313760Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined43204542Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined46004829Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined50125034undefined50365172undefined51745196undefined52275245__webpack_require__undefined53035309undefined54105536undefined55385623undefined56255738undefined58015807undefined58325849next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined58855893next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined61496184".next"undefined618961900undefined62176255 falseundefined62676273undefined65536573falseundefined65766640{}undefined67866825falseundefined68576870(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined69616974(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined77407755(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined81428151(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined81878202(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined83478360(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined84068432next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined86118624(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined86708679next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined87198743(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined89238942(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined91349241 falseundefined924692600undefined1155611569(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1195411981(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1376613783(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1384313851next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1390213901: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1427014299(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1443114451(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1458514593(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1489314907next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1494714962next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1519015227falseundefined1523015805{}undefined1638316396next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1748317496(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1777517788(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1850718543 trueundefined1854718566(__webpack_require__(33873).join)undefined18645186960undefined1965719670(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2151121524(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2194821969next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2340823422next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2466824685(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2497424985next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2500025004(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2511025121next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2555525566next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2563525646next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2573525746next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2627926290next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2633526349next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2700127009next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2775527776(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2930429318next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2935729368next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2987029883(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2994029961(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3053630544next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3202332037next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3338933412next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3587935892next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3618736201next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3708437107next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3737937400next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3751837539next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3776937784(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3801238023next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3805238074next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3873038745(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3895338964next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3922739240(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3968839701(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4057140592next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4147141492next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4160241623next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4217642193next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4239742420next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4331643331(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4435944374(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4458244593next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4462644648next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4536545477falseundefined4548045830{}undefined4585545870(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4681446825next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4696046975(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4758647613falseundefined4761647686{}undefined4899449008next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined4993249947(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5082250835next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5093450941next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5119751211next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5142351441(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefined /***/ })  #__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); const module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/tasks/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'tasks', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/tasks/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/tasks/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/tasks/page", pathname: "/tasks", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/tasks/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map %'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558638Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 21440))undefined641781undefined783897undefined899975undefined9771048undefined10501112undefined11141183undefined11851261undefined12631348undefined13501433undefined14351511undefined15131594undefined15961689undefined16911795undefined17971877undefined18791957undefined19592050undefined20522233undefined22352311undefined23132378undefined23802453undefined24552512undefined25142620undefined26222695undefined26972761undefined27632844undefined32513473Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined35313760Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined43204542Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined46004829Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined50125034undefined50365172undefined51745196undefined52275245__webpack_require__undefined53035309undefined54105536undefined55385623undefined56255738undefined58015807undefined58325849next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined58855893next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined61496184".next"undefined618961900undefined62176255 falseundefined62676273undefined65536573falseundefined65766640{}undefined67866825falseundefined68576870(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined69616974(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined77407755(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined81428151(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined81878202(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined83478360(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined84068432next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined86118624(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined86708679next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined87198743(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined89238942(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined91349241 falseundefined924692600undefined1155611569(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1195411981(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1376613783(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1384313851next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1390213901: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1427014299(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1443114451(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1458514593(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1489314907next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1494714962next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1519015227falseundefined1523015805{}undefined1638316396next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1748317496(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1777517788(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1850718543 trueundefined1854718566(__webpack_require__(33873).join)undefined18645186960undefined1965719670(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2151121524(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2194821969next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2340823422next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2466824685(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2497424985next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2500025004(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2511025121next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2555525566next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2563525646next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2573525746next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2627926290next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2633526349next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2700127009next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2775527776(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2930429318next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2935729368next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2987029883(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2994029961(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3053630544next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3202332037next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3338933412next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3587935892next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3618736201next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3708437107next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3737937400next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3751837539next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3776937784(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3801238023next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3805238074next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3873038745(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3895338964next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3922739240(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3968839701(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4057140592next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4147141492next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4160241623next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4217642193next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4239742420next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4331643331(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4435944374(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4458244593next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4462644648next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4536545477falseundefined4548045830{}undefined4585545870(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4681446825next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4696046975(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4758647613falseundefined4761647686{}undefined4899449008next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined4993249947(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5082250835next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5093450941next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5119751211next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5142351441(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefined, /***/ 19121:  8webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Ymodule.exports = require("next/dist/server/app-render/action-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/action-async-storage.external.js"); /***/ })  Ymodule.exports = require("next/dist/server/app-render/action-async-storage.external.js");, /***/ 21440:  /webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource  Iwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ TasksPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5939); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3498); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_headers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56057); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(59902); /* harmony import */ var _lib_translations__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(75112); /* harmony import */ var _TaskListClient__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(70535); /* harmony import */ var _TaskFiltersClient__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(34052); /* harmony import */ var _TasksAuthGuard__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(52386); /* harmony import */ var _TaskMapDynamic__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(97107); /* harmony import */ var _TaskViewToggle__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(77241); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource<import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import Link from 'next/link'; import { cookies } from 'next/headers'; import { getCategories, getLocations, getTaskBudgetRange } from '@/lib/api'; import { getTranslations } from '@/lib/translations'; import { TaskListClient } from './TaskListClient'; import { TaskFiltersClient } from './TaskFiltersClient'; import { TasksAuthGuard } from './TasksAuthGuard'; import { TaskMapDynamic } from './TaskMapDynamic'; import { TaskViewToggle } from './TaskViewToggle'; // SSR uses INTERNAL_API_URL (or localhost:4000 directly) to avoid external DNS/CORS round-trip const API_BASE = "undefined" === 'undefined' ? process.env.INTERNAL_API_URL || 'http://localhost:4000' : process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export default async function TasksPage({ searchParams }) { const params = await searchParams; const page = Number(params.page || 1); const cookieStore = await cookies(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const cookieLocation = decodeURIComponent(cookieStore.get('canhelp_location')?.value ?? ''); const t = getTranslations(locale); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const cookieHeader = cookieStore.getAll().map((c)=>`${c.name}=${c.value}`).join('; '); // Detect if user is a logged-in specialist (has session cookie) let isSpecialistSession = false; if (cookieHeader) { try { const INTERNAL = process.env.INTERNAL_API_URL || 'http://localhost:4000'; const sessRes = await fetch(`${INTERNAL}/api/auth/get-session`, { headers: { Cookie: cookieHeader } }); if (sessRes.ok) { const sess = await sessRes.json(); const role = sess?.user?.role; isSpecialistSession = role === 'specialist' || role === 'admin'; } } catch {} } // Guests and customers default to 'all'; specialists default to 'for_me' const mode = params.mode === 'all' ? 'all' : params.mode === 'for_me' ? 'for_me' : isSpecialistSession ? 'for_me' : 'all'; let tasks = []; let total = 0; let noCards = false; let categories = []; let locationTree = []; let budgetRange = { min: 0, max: 0 }; // In 'all' mode only respect explicit URL param; cookie location only applies to 'for_me' // (for_me filtering is handled server-side by specialist cards, so cookie is unused there too) const effectiveLocation = params.location ?? (mode === 'for_me' ? cookieLocation : ''); const { q, category } = params; const rangeParams = {}; if (q) rangeParams.q = q; if (category) rangeParams.category = category; if (effectiveLocation) rangeParams.location = effectiveLocation; const effectiveParams = { page: String(page), limit: '10', ...params, ...effectiveLocation ? { location: effectiveLocation } : {} }; delete effectiveParams.mode; try { ; [categories, locationTree, budgetRange] = await Promise.all([ getCategories(), getLocations(), getTaskBudgetRange(Object.keys(rangeParams).length ? rangeParams : undefined) ]); } catch {} try { if (mode === 'for_me') { const forMeParams = new URLSearchParams(effectiveParams); const res = await fetch(`${API_BASE}/api/tasks/for-me?${forMeParams}`, { headers: { Cookie: cookieHeader }, cache: 'no-store' }); if (res.ok) { const json = await res.json(); if (json.noCards) { noCards = true; } else { tasks = json.data ?? []; total = json.total ?? 0; } } } else { const allParams = new URLSearchParams(effectiveParams); const res = await fetch(`${API_BASE}/api/tasks?${allParams}`, { headers: { Cookie: cookieHeader }, cache: 'no-store' }); if (res.ok) { const json = await res.json(); tasks = json.data ?? []; total = json.total ?? 0; } } } catch {} const catMap = {}; for (const cat of categories){ catMap[cat.slug] = cat.names[catLocale] ?? cat.names.el; for (const sub of cat.children ?? []){ catMap[sub.slug] = sub.names[catLocale] ?? sub.names.el; } } const locMap = {}; for (const city of locationTree){ locMap[city.slug] = city.names[catLocale] ?? city.names.el; for (const d of city.children ?? []){ locMap[d.slug] = d.names[catLocale] ?? d.names.el; } } const view = params.view === 'map' ? 'map' : 'list'; const hasFilter = !!(params.q || params.category || params.location || params.budgetMin || params.budgetMax); const filterParams = {}; if (params.q) filterParams.q = params.q; if (params.category) filterParams.category = params.category; if (params.location) filterParams.location = params.location; if (params.budgetMin) filterParams.budgetMin = params.budgetMin; if (params.budgetMax) filterParams.budgetMax = params.budgetMax; return /*#__PURE__*/ _jsxs("div", { className: "max-w-7xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsx(TasksAuthGuard, {}), view === 'map' ? /* ── Full-screen map layout ────────────────────────────── */ /*#__PURE__*/ _jsxs("div", { className: "relative -mx-4 -mt-8", style: { height: 'calc(100vh - 64px)' }, children: [ /*#__PURE__*/ _jsx("div", { className: "absolute left-4 top-4 z-[2000] w-72 bg-white rounded-xl shadow-lg border border-gray-200 overflow-hidden", children: /*#__PURE__*/ _jsxs("details", { open: true, className: "group", children: [ /*#__PURE__*/ _jsxs("summary", { className: "flex items-center justify-between px-4 py-3 cursor-pointer select-none font-semibold text-gray-800 text-sm hover:bg-gray-50", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M3 4a1 1 0 011-1h16a1 1 0 011 1v2a1 1 0 01-.293.707L13 13.414V19a1 1 0 01-.553.894l-4 2A1 1 0 017 21v-7.586L3.293 6.707A1 1 0 013 6V4z" }) }), t('tasks.filters') ] }), /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 group-open:rotate-180 transition-transform", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "px-4 pb-4 pt-1 max-h-[calc(100vh-160px)] overflow-y-auto", children: /*#__PURE__*/ _jsx(TaskFiltersClient, { categories: categories, locationTree: locationTree, budgetRange: budgetRange, initialMode: mode, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialBudgetMin: params.budgetMin, initialBudgetMax: params.budgetMax }) }) ] }) }), /*#__PURE__*/ _jsx("div", { className: "absolute top-4 right-4 z-[2000]", children: /*#__PURE__*/ _jsx(TaskViewToggle, { view: view }) }), /*#__PURE__*/ _jsx(TaskMapDynamic, { filterParams: filterParams, catMap: catMap, locMap: locMap, mode: mode, fullscreen: true }) ] }) : /* ── List layout ───────────────────────────────────────── */ /*#__PURE__*/ _jsxs("div", { className: "flex flex-col md:flex-row gap-8", children: [ /*#__PURE__*/ _jsx("aside", { className: "md:w-64 shrink-0", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 mb-4", children: t('tasks.filters') }), /*#__PURE__*/ _jsx(TaskFiltersClient, { categories: categories, locationTree: locationTree, budgetRange: budgetRange, initialMode: mode, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialBudgetMin: params.budgetMin, initialBudgetMax: params.budgetMax }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ /*#__PURE__*/ _jsxs("div", { className: "mb-4 flex items-center justify-between", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-xl font-bold text-white", children: hasFilter ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ total, " ", t('tasks.title') ] }) : t('nav.tasks') }), /*#__PURE__*/ _jsx(TaskViewToggle, { view: view }) ] }), noCards ? /*#__PURE__*/ _jsxs("div", { className: "bg-white/15 border border-white/30 rounded-xl p-8 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "text-4xl mb-3", children: "\uD83D\uDDC2️" }), /*#__PURE__*/ _jsx("p", { className: "text-white font-medium mb-2", children: t('find_tasks.no_cards') }), /*#__PURE__*/ _jsx(Link, { href: "/profile", className: "inline-block mt-2 px-5 py-2 bg-white text-green-600 rounded-lg text-sm font-medium hover:bg-green-50 transition", children: t('find_tasks.add_card') }) ] }) : /*#__PURE__*/ _jsx(TaskListClient, { initialTasks: tasks, initialTotal: total, filterParams: filterParams, locale: locale, catMap: catMap, locMap: locMap, mode: mode }, [ mode, params.q, params.category, params.location, params.budgetMin, params.budgetMax, page ].join('|')) ] }) ] }) ] }); } e:UWsu_ QS#'*8 _JMO\x|9=`d8;J!M!@#C#### $4'7''_'''K(N(P(]())E*H***++{,~,,,o/s///00g1k1m1u1#3&3(3N53 44445566668888 true0(0,next_headers__WEBPACK_IMPORTED_MODULE_2__/* .cookies */ .UL)(0,_lib_translations__WEBPACK_IMPORTED_MODULE_4__/* .getTranslations */ .$)(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .getCategories */ .bW)(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .getLocations */ .Vs)(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .getTaskBudgetRange */ .CC)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)_TasksAuthGuard__WEBPACK_IMPORTED_MODULE_7__.TasksAuthGuard_TaskFiltersClient__WEBPACK_IMPORTED_MODULE_6__.TaskFiltersClient_TaskViewToggle__WEBPACK_IMPORTED_MODULE_9__.TaskViewToggle_TaskMapDynamic__WEBPACK_IMPORTED_MODULE_8__.TaskMapDynamicreact_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment(next_link__WEBPACK_IMPORTED_MODULE_1___default())_TaskListClient__WEBPACK_IMPORTED_MODULE_5__.TaskListClientbuffersourcesizemapshashConcatSourceRawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ TasksPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5939); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3498); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_headers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56057); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(59902); /* harmony import */ var _lib_translations__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(75112); /* harmony import */ var _TaskListClient__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(70535); /* harmony import */ var _TaskFiltersClient__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(34052); /* harmony import */ var _TasksAuthGuard__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(52386); /* harmony import */ var _TaskMapDynamic__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(97107); /* harmony import */ var _TaskViewToggle__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(77241); ReplaceSourceRawSource<import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import Link from 'next/link'; import { cookies } from 'next/headers'; import { getCategories, getLocations, getTaskBudgetRange } from '@/lib/api'; import { getTranslations } from '@/lib/translations'; import { TaskListClient } from './TaskListClient'; import { TaskFiltersClient } from './TaskFiltersClient'; import { TasksAuthGuard } from './TasksAuthGuard'; import { TaskMapDynamic } from './TaskMapDynamic'; import { TaskViewToggle } from './TaskViewToggle'; // SSR uses INTERNAL_API_URL (or localhost:4000 directly) to avoid external DNS/CORS round-trip const API_BASE = "undefined" === 'undefined' ? process.env.INTERNAL_API_URL || 'http://localhost:4000' : process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export default async function TasksPage({ searchParams }) { const params = await searchParams; const page = Number(params.page || 1); const cookieStore = await cookies(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const cookieLocation = decodeURIComponent(cookieStore.get('canhelp_location')?.value ?? ''); const t = getTranslations(locale); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const cookieHeader = cookieStore.getAll().map((c)=>`${c.name}=${c.value}`).join('; '); // Detect if user is a logged-in specialist (has session cookie) let isSpecialistSession = false; if (cookieHeader) { try { const INTERNAL = process.env.INTERNAL_API_URL || 'http://localhost:4000'; const sessRes = await fetch(`${INTERNAL}/api/auth/get-session`, { headers: { Cookie: cookieHeader } }); if (sessRes.ok) { const sess = await sessRes.json(); const role = sess?.user?.role; isSpecialistSession = role === 'specialist' || role === 'admin'; } } catch {} } // Guests and customers default to 'all'; specialists default to 'for_me' const mode = params.mode === 'all' ? 'all' : params.mode === 'for_me' ? 'for_me' : isSpecialistSession ? 'for_me' : 'all'; let tasks = []; let total = 0; let noCards = false; let categories = []; let locationTree = []; let budgetRange = { min: 0, max: 0 }; // In 'all' mode only respect explicit URL param; cookie location only applies to 'for_me' // (for_me filtering is handled server-side by specialist cards, so cookie is unused there too) const effectiveLocation = params.location ?? (mode === 'for_me' ? cookieLocation : ''); const { q, category } = params; const rangeParams = {}; if (q) rangeParams.q = q; if (category) rangeParams.category = category; if (effectiveLocation) rangeParams.location = effectiveLocation; const effectiveParams = { page: String(page), limit: '10', ...params, ...effectiveLocation ? { location: effectiveLocation } : {} }; delete effectiveParams.mode; try { ; [categories, locationTree, budgetRange] = await Promise.all([ getCategories(), getLocations(), getTaskBudgetRange(Object.keys(rangeParams).length ? rangeParams : undefined) ]); } catch {} try { if (mode === 'for_me') { const forMeParams = new URLSearchParams(effectiveParams); const res = await fetch(`${API_BASE}/api/tasks/for-me?${forMeParams}`, { headers: { Cookie: cookieHeader }, cache: 'no-store' }); if (res.ok) { const json = await res.json(); if (json.noCards) { noCards = true; } else { tasks = json.data ?? []; total = json.total ?? 0; } } } else { const allParams = new URLSearchParams(effectiveParams); const res = await fetch(`${API_BASE}/api/tasks?${allParams}`, { headers: { Cookie: cookieHeader }, cache: 'no-store' }); if (res.ok) { const json = await res.json(); tasks = json.data ?? []; total = json.total ?? 0; } } } catch {} const catMap = {}; for (const cat of categories){ catMap[cat.slug] = cat.names[catLocale] ?? cat.names.el; for (const sub of cat.children ?? []){ catMap[sub.slug] = sub.names[catLocale] ?? sub.names.el; } } const locMap = {}; for (const city of locationTree){ locMap[city.slug] = city.names[catLocale] ?? city.names.el; for (const d of city.children ?? []){ locMap[d.slug] = d.names[catLocale] ?? d.names.el; } } const view = params.view === 'map' ? 'map' : 'list'; const hasFilter = !!(params.q || params.category || params.location || params.budgetMin || params.budgetMax); const filterParams = {}; if (params.q) filterParams.q = params.q; if (params.category) filterParams.category = params.category; if (params.location) filterParams.location = params.location; if (params.budgetMin) filterParams.budgetMin = params.budgetMin; if (params.budgetMax) filterParams.budgetMax = params.budgetMax; return /*#__PURE__*/ _jsxs("div", { className: "max-w-7xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsx(TasksAuthGuard, {}), view === 'map' ? /* ── Full-screen map layout ────────────────────────────── */ /*#__PURE__*/ _jsxs("div", { className: "relative -mx-4 -mt-8", style: { height: 'calc(100vh - 64px)' }, children: [ /*#__PURE__*/ _jsx("div", { className: "absolute left-4 top-4 z-[2000] w-72 bg-white rounded-xl shadow-lg border border-gray-200 overflow-hidden", children: /*#__PURE__*/ _jsxs("details", { open: true, className: "group", children: [ /*#__PURE__*/ _jsxs("summary", { className: "flex items-center justify-between px-4 py-3 cursor-pointer select-none font-semibold text-gray-800 text-sm hover:bg-gray-50", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M3 4a1 1 0 011-1h16a1 1 0 011 1v2a1 1 0 01-.293.707L13 13.414V19a1 1 0 01-.553.894l-4 2A1 1 0 017 21v-7.586L3.293 6.707A1 1 0 013 6V4z" }) }), t('tasks.filters') ] }), /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 group-open:rotate-180 transition-transform", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "px-4 pb-4 pt-1 max-h-[calc(100vh-160px)] overflow-y-auto", children: /*#__PURE__*/ _jsx(TaskFiltersClient, { categories: categories, locationTree: locationTree, budgetRange: budgetRange, initialMode: mode, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialBudgetMin: params.budgetMin, initialBudgetMax: params.budgetMax }) }) ] }) }), /*#__PURE__*/ _jsx("div", { className: "absolute top-4 right-4 z-[2000]", children: /*#__PURE__*/ _jsx(TaskViewToggle, { view: view }) }), /*#__PURE__*/ _jsx(TaskMapDynamic, { filterParams: filterParams, catMap: catMap, locMap: locMap, mode: mode, fullscreen: true }) ] }) : /* ── List layout ───────────────────────────────────────── */ /*#__PURE__*/ _jsxs("div", { className: "flex flex-col md:flex-row gap-8", children: [ /*#__PURE__*/ _jsx("aside", { className: "md:w-64 shrink-0", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 mb-4", children: t('tasks.filters') }), /*#__PURE__*/ _jsx(TaskFiltersClient, { categories: categories, locationTree: locationTree, budgetRange: budgetRange, initialMode: mode, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialBudgetMin: params.budgetMin, initialBudgetMax: params.budgetMax }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ /*#__PURE__*/ _jsxs("div", { className: "mb-4 flex items-center justify-between", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-xl font-bold text-white", children: hasFilter ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ total, " ", t('tasks.title') ] }) : t('nav.tasks') }), /*#__PURE__*/ _jsx(TaskViewToggle, { view: view }) ] }), noCards ? /*#__PURE__*/ _jsxs("div", { className: "bg-white/15 border border-white/30 rounded-xl p-8 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "text-4xl mb-3", children: "\uD83D\uDDC2️" }), /*#__PURE__*/ _jsx("p", { className: "text-white font-medium mb-2", children: t('find_tasks.no_cards') }), /*#__PURE__*/ _jsx(Link, { href: "/profile", className: "inline-block mt-2 px-5 py-2 bg-white text-green-600 rounded-lg text-sm font-medium hover:bg-green-50 transition", children: t('find_tasks.add_card') }) ] }) : /*#__PURE__*/ _jsx(TaskListClient, { initialTasks: tasks, initialTotal: total, filterParams: filterParams, locale: locale, catMap: catMap, locMap: locMap, mode: mode }, [ mode, params.q, params.category, params.location, params.budgetMin, params.budgetMax, page ].join('|')) ] }) ] }) ] }); }  085undefined87115undefined117155undefined157232undefined234286undefined288337undefined339394undefined396445undefined447496undefined498547undefined662688 trueundefined7508070undefined810824undefined982988(0,next_headers__WEBPACK_IMPORTED_MODULE_2__/* .cookies */ .UL)undefined11731187(0,_lib_translations__WEBPACK_IMPORTED_MODULE_4__/* .getTranslations */ .$)undefined32633275(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .getCategories */ .bW)undefined32923303(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .getLocations */ .Vs)undefined33203337(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .getTaskBudgetRange */ .CC)undefined55955599(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined57065709(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined57115724_TasksAuthGuard__WEBPACK_IMPORTED_MODULE_7__.TasksAuthGuardundefined58385842(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined60596062(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined62646268(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined64576461(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined67526756(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined69686971(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined73637366(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined81258128(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined85228525(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined90249027(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined92059208(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined92109226_TaskFiltersClient__WEBPACK_IMPORTED_MODULE_6__.TaskFiltersClientundefined1003610039(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1016810171(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1017310186_TaskViewToggle__WEBPACK_IMPORTED_MODULE_9__.TaskViewToggleundefined1031510318(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1032010333_TaskMapDynamic__WEBPACK_IMPORTED_MODULE_8__.TaskMapDynamicundefined1068210686(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1082110824(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1094010944(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1114411147(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1138711390(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1139211408_TaskFiltersClient__WEBPACK_IMPORTED_MODULE_6__.TaskFiltersClientundefined1214312147(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1228112285(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1247512478(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1264712651(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1265312661react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined1309113094(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1309613109_TaskViewToggle__WEBPACK_IMPORTED_MODULE_9__.TaskViewToggleundefined1332213326(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1353913542(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1377713780(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1403614039(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1404114044(next_link__WEBPACK_IMPORTED_MODULE_1___default())undefined1446814471(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1447314486_TaskListClient__WEBPACK_IMPORTED_MODULE_5__.TaskListClientundefined /***/ })  __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ TasksPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5939); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3498); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_headers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56057); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(59902); /* harmony import */ var _lib_translations__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(75112); /* harmony import */ var _TaskListClient__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(70535); /* harmony import */ var _TaskFiltersClient__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(34052); /* harmony import */ var _TasksAuthGuard__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(52386); /* harmony import */ var _TaskMapDynamic__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(97107); /* harmony import */ var _TaskViewToggle__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(77241); <import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import Link from 'next/link'; import { cookies } from 'next/headers'; import { getCategories, getLocations, getTaskBudgetRange } from '@/lib/api'; import { getTranslations } from '@/lib/translations'; import { TaskListClient } from './TaskListClient'; import { TaskFiltersClient } from './TaskFiltersClient'; import { TasksAuthGuard } from './TasksAuthGuard'; import { TaskMapDynamic } from './TaskMapDynamic'; import { TaskViewToggle } from './TaskViewToggle'; // SSR uses INTERNAL_API_URL (or localhost:4000 directly) to avoid external DNS/CORS round-trip const API_BASE = "undefined" === 'undefined' ? process.env.INTERNAL_API_URL || 'http://localhost:4000' : process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export default async function TasksPage({ searchParams }) { const params = await searchParams; const page = Number(params.page || 1); const cookieStore = await cookies(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const cookieLocation = decodeURIComponent(cookieStore.get('canhelp_location')?.value ?? ''); const t = getTranslations(locale); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const cookieHeader = cookieStore.getAll().map((c)=>`${c.name}=${c.value}`).join('; '); // Detect if user is a logged-in specialist (has session cookie) let isSpecialistSession = false; if (cookieHeader) { try { const INTERNAL = process.env.INTERNAL_API_URL || 'http://localhost:4000'; const sessRes = await fetch(`${INTERNAL}/api/auth/get-session`, { headers: { Cookie: cookieHeader } }); if (sessRes.ok) { const sess = await sessRes.json(); const role = sess?.user?.role; isSpecialistSession = role === 'specialist' || role === 'admin'; } } catch {} } // Guests and customers default to 'all'; specialists default to 'for_me' const mode = params.mode === 'all' ? 'all' : params.mode === 'for_me' ? 'for_me' : isSpecialistSession ? 'for_me' : 'all'; let tasks = []; let total = 0; let noCards = false; let categories = []; let locationTree = []; let budgetRange = { min: 0, max: 0 }; // In 'all' mode only respect explicit URL param; cookie location only applies to 'for_me' // (for_me filtering is handled server-side by specialist cards, so cookie is unused there too) const effectiveLocation = params.location ?? (mode === 'for_me' ? cookieLocation : ''); const { q, category } = params; const rangeParams = {}; if (q) rangeParams.q = q; if (category) rangeParams.category = category; if (effectiveLocation) rangeParams.location = effectiveLocation; const effectiveParams = { page: String(page), limit: '10', ...params, ...effectiveLocation ? { location: effectiveLocation } : {} }; delete effectiveParams.mode; try { ; [categories, locationTree, budgetRange] = await Promise.all([ getCategories(), getLocations(), getTaskBudgetRange(Object.keys(rangeParams).length ? rangeParams : undefined) ]); } catch {} try { if (mode === 'for_me') { const forMeParams = new URLSearchParams(effectiveParams); const res = await fetch(`${API_BASE}/api/tasks/for-me?${forMeParams}`, { headers: { Cookie: cookieHeader }, cache: 'no-store' }); if (res.ok) { const json = await res.json(); if (json.noCards) { noCards = true; } else { tasks = json.data ?? []; total = json.total ?? 0; } } } else { const allParams = new URLSearchParams(effectiveParams); const res = await fetch(`${API_BASE}/api/tasks?${allParams}`, { headers: { Cookie: cookieHeader }, cache: 'no-store' }); if (res.ok) { const json = await res.json(); tasks = json.data ?? []; total = json.total ?? 0; } } } catch {} const catMap = {}; for (const cat of categories){ catMap[cat.slug] = cat.names[catLocale] ?? cat.names.el; for (const sub of cat.children ?? []){ catMap[sub.slug] = sub.names[catLocale] ?? sub.names.el; } } const locMap = {}; for (const city of locationTree){ locMap[city.slug] = city.names[catLocale] ?? city.names.el; for (const d of city.children ?? []){ locMap[d.slug] = d.names[catLocale] ?? d.names.el; } } const view = params.view === 'map' ? 'map' : 'list'; const hasFilter = !!(params.q || params.category || params.location || params.budgetMin || params.budgetMax); const filterParams = {}; if (params.q) filterParams.q = params.q; if (params.category) filterParams.category = params.category; if (params.location) filterParams.location = params.location; if (params.budgetMin) filterParams.budgetMin = params.budgetMin; if (params.budgetMax) filterParams.budgetMax = params.budgetMax; return /*#__PURE__*/ _jsxs("div", { className: "max-w-7xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsx(TasksAuthGuard, {}), view === 'map' ? /* ── Full-screen map layout ────────────────────────────── */ /*#__PURE__*/ _jsxs("div", { className: "relative -mx-4 -mt-8", style: { height: 'calc(100vh - 64px)' }, children: [ /*#__PURE__*/ _jsx("div", { className: "absolute left-4 top-4 z-[2000] w-72 bg-white rounded-xl shadow-lg border border-gray-200 overflow-hidden", children: /*#__PURE__*/ _jsxs("details", { open: true, className: "group", children: [ /*#__PURE__*/ _jsxs("summary", { className: "flex items-center justify-between px-4 py-3 cursor-pointer select-none font-semibold text-gray-800 text-sm hover:bg-gray-50", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M3 4a1 1 0 011-1h16a1 1 0 011 1v2a1 1 0 01-.293.707L13 13.414V19a1 1 0 01-.553.894l-4 2A1 1 0 017 21v-7.586L3.293 6.707A1 1 0 013 6V4z" }) }), t('tasks.filters') ] }), /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 group-open:rotate-180 transition-transform", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "px-4 pb-4 pt-1 max-h-[calc(100vh-160px)] overflow-y-auto", children: /*#__PURE__*/ _jsx(TaskFiltersClient, { categories: categories, locationTree: locationTree, budgetRange: budgetRange, initialMode: mode, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialBudgetMin: params.budgetMin, initialBudgetMax: params.budgetMax }) }) ] }) }), /*#__PURE__*/ _jsx("div", { className: "absolute top-4 right-4 z-[2000]", children: /*#__PURE__*/ _jsx(TaskViewToggle, { view: view }) }), /*#__PURE__*/ _jsx(TaskMapDynamic, { filterParams: filterParams, catMap: catMap, locMap: locMap, mode: mode, fullscreen: true }) ] }) : /* ── List layout ───────────────────────────────────────── */ /*#__PURE__*/ _jsxs("div", { className: "flex flex-col md:flex-row gap-8", children: [ /*#__PURE__*/ _jsx("aside", { className: "md:w-64 shrink-0", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 mb-4", children: t('tasks.filters') }), /*#__PURE__*/ _jsx(TaskFiltersClient, { categories: categories, locationTree: locationTree, budgetRange: budgetRange, initialMode: mode, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialBudgetMin: params.budgetMin, initialBudgetMax: params.budgetMax }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ /*#__PURE__*/ _jsxs("div", { className: "mb-4 flex items-center justify-between", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-xl font-bold text-white", children: hasFilter ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ total, " ", t('tasks.title') ] }) : t('nav.tasks') }), /*#__PURE__*/ _jsx(TaskViewToggle, { view: view }) ] }), noCards ? /*#__PURE__*/ _jsxs("div", { className: "bg-white/15 border border-white/30 rounded-xl p-8 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "text-4xl mb-3", children: "\uD83D\uDDC2️" }), /*#__PURE__*/ _jsx("p", { className: "text-white font-medium mb-2", children: t('find_tasks.no_cards') }), /*#__PURE__*/ _jsx(Link, { href: "/profile", className: "inline-block mt-2 px-5 py-2 bg-white text-green-600 rounded-lg text-sm font-medium hover:bg-green-50 transition", children: t('find_tasks.add_card') }) ] }) : /*#__PURE__*/ _jsx(TaskListClient, { initialTasks: tasks, initialTotal: total, filterParams: filterParams, locale: locale, catMap: catMap, locMap: locMap, mode: mode }, [ mode, params.q, params.category, params.location, params.budgetMin, params.budgetMax, page ].join('|')) ] }) ] }) ] }); }  085undefined87115undefined117155undefined157232undefined234286undefined288337undefined339394undefined396445undefined447496undefined498547undefined662688 trueundefined7508070undefined810824undefined982988(0,next_headers__WEBPACK_IMPORTED_MODULE_2__/* .cookies */ .UL)undefined11731187(0,_lib_translations__WEBPACK_IMPORTED_MODULE_4__/* .getTranslations */ .$)undefined32633275(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .getCategories */ .bW)undefined32923303(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .getLocations */ .Vs)undefined33203337(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .getTaskBudgetRange */ .CC)undefined55955599(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined57065709(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined57115724_TasksAuthGuard__WEBPACK_IMPORTED_MODULE_7__.TasksAuthGuardundefined58385842(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined60596062(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined62646268(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined64576461(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined67526756(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined69686971(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined73637366(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined81258128(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined85228525(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined90249027(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined92059208(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined92109226_TaskFiltersClient__WEBPACK_IMPORTED_MODULE_6__.TaskFiltersClientundefined1003610039(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1016810171(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1017310186_TaskViewToggle__WEBPACK_IMPORTED_MODULE_9__.TaskViewToggleundefined1031510318(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1032010333_TaskMapDynamic__WEBPACK_IMPORTED_MODULE_8__.TaskMapDynamicundefined1068210686(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1082110824(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1094010944(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1114411147(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1138711390(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1139211408_TaskFiltersClient__WEBPACK_IMPORTED_MODULE_6__.TaskFiltersClientundefined1214312147(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1228112285(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1247512478(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1264712651(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1265312661react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined1309113094(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1309613109_TaskViewToggle__WEBPACK_IMPORTED_MODULE_9__.TaskViewToggleundefined1332213326(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1353913542(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1377713780(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1403614039(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1404114044(next_link__WEBPACK_IMPORTED_MODULE_1___default())undefined1446814471(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1447314486_TaskListClient__WEBPACK_IMPORTED_MODULE_5__.TaskListClientundefined, /***/ 26713:  $webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Emodule.exports = require("next/dist/shared/lib/router/utils/is-bot");  /***/ }) s/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/is-bot"); /***/ })  Emodule.exports = require("next/dist/shared/lib/router/utils/is-bot");, /***/ 27910:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("stream");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("stream"); /***/ })  #module.exports = require("stream");, /***/ 28354:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("util");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("util"); /***/ })  !module.exports = require("util");, /***/ 29021:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; module.exports = require("fs");  /***/ }) M/***/ ((module) => { "use strict"; module.exports = require("fs"); /***/ })  module.exports = require("fs");, /***/ 29294:  6webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-async-storage.external.js"); /***/ })  Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");, /***/ 33873:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("path");  /***/ }) ~O/***/ ((module) => { "use strict"; module.exports = require("path"); /***/ })  !module.exports = require("path");, /***/ 34052:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource vwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskFiltersClient: () => (/* binding */ TaskFiltersClient) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource(// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const TaskFiltersClient = registerClientReference( function() { throw new Error("Attempted to call TaskFiltersClient() from the server but TaskFiltersClient is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/TaskFiltersClient.tsx", "TaskFiltersClient", ); `=D(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)buffersourcesizemapshash/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskFiltersClient: () => (/* binding */ TaskFiltersClient) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. const TaskFiltersClient = (0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)( function() { throw new Error("Attempted to call TaskFiltersClient() from the server but TaskFiltersClient is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/TaskFiltersClient.tsx", "TaskFiltersClient", ); {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskFiltersClient: () => (/* binding */ TaskFiltersClient) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); ReplaceSourceRawSource(// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const TaskFiltersClient = registerClientReference( function() { throw new Error("Attempted to call TaskFiltersClient() from the server but TaskFiltersClient is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/TaskFiltersClient.tsx", "TaskFiltersClient", );61134undefined136142undefined169191(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined /***/ }) u ||/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskFiltersClient: () => (/* binding */ TaskFiltersClient) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); (// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const TaskFiltersClient = registerClientReference( function() { throw new Error("Attempted to call TaskFiltersClient() from the server but TaskFiltersClient is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/TaskFiltersClient.tsx", "TaskFiltersClient", );61134undefined136142undefined169191(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined{}, /***/ 34631:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("tls");  /***/ }) lN/***/ ((module) => { "use strict"; module.exports = require("tls"); /***/ }) mp qrs module.exports = require("tls");rt, /***/ 40993:  *webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource ~4webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskListClient: () => (/* binding */ TaskListClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _lib_translations__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(12998); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8293); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(48178); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource|)/* __next_internal_client_entry_do_not_use__ TaskListClient auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState } from 'react'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import { getTranslations } from '@/lib/translations'; import { taskTitle, taskDescription, formatPrice } from '@/lib/taskLocale'; import { shortName } from '@/lib/formatName'; const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function TaskListClient({ initialTasks, initialTotal, filterParams, locale: localeProp, catMap, locMap, mode = 'all' }) { const { locale } = useLocale(); const t = getTranslations(locale); const [tasks, setTasks] = useState(initialTasks); const [total] = useState(initialTotal); const [page, setPage] = useState(1); const [loading, setLoading] = useState(false); const hasMore = tasks.length < total; async function loadMore() { setLoading(true); try { const nextPage = page + 1; const params = new URLSearchParams({ ...filterParams, page: String(nextPage), limit: '10' }); const endpoint = mode === 'for_me' ? '/tasks/for-me' : '/tasks'; const res = await fetch(`${BASE}/api${endpoint}?${params}`, { credentials: 'include' }); const json = await res.json(); setTasks((prev)=>[ ...prev, ...json.data || [] ]); setPage(nextPage); } finally{ setLoading(false); } } if (tasks.length === 0) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/70", children: /*#__PURE__*/ _jsx("p", { className: "text-lg", children: t('tasks.empty') }) }); } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: tasks.map((row)=>{ const task = row.task || row; const customer = row.customer; return /*#__PURE__*/ _jsx(Link, { href: `/tasks/${task.id}`, className: "block bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-green-300 transition", children: /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-start gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-2", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-green-600 bg-green-50 px-2 py-0.5 rounded-full", children: task.category ? catMap[task.category] ?? task.category : t('tasks.category.general') }), task.location && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCCD ", locMap[task.location] ?? task.location ] }) ] }), /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-900 text-lg mb-1 truncate", children: taskTitle(task, locale) }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 line-clamp-2", children: taskDescription(task, locale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "text-right shrink-0", children: [ task.budget ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("p", { className: "text-lg font-bold text-green-600", children: [ formatPrice(task.budget), "€" ] }), task.budgetNegotiable && /*#__PURE__*/ _jsx("p", { className: "text-xs text-green-600", children: t('task.budget_negotiable') }) ] }) : task.budgetNegotiable ? /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-green-600", children: t('task.budget_negotiable') }) : null, /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-600 mt-1", children: [ /*#__PURE__*/ _jsxs("span", { className: "text-gray-500", children: [ task.deadline ? t('task.deadline') : t('task.created_at'), ": " ] }), new Date(task.deadline ?? task.createdAt).toLocaleDateString(locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR') ] }), customer && /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-end gap-1.5 mt-2", children: [ /*#__PURE__*/ _jsxs("div", { className: "text-right", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 leading-none", children: shortName(customer.name) }), customer.rating && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-yellow-500 leading-none mt-0.5", children: [ "★ ", Number(customer.rating).toFixed(1) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "w-7 h-7 rounded-full overflow-hidden bg-green-100 shrink-0 flex items-center justify-center", children: customer.image ? /*#__PURE__*/ _jsx("img", { src: customer.image, alt: shortName(customer.name), className: "w-full h-full object-cover" }) : /*#__PURE__*/ _jsx("span", { className: "text-green-600 font-semibold text-xs", children: shortName(customer.name).charAt(0).toUpperCase() }) }) ] }) ] }) ] }) }, task.id); }) }), hasMore && /*#__PURE__*/ _jsx("div", { className: "flex justify-center mt-8", children: /*#__PURE__*/ _jsx("button", { onClick: loadMore, disabled: loading, className: "px-6 py-2.5 bg-white border border-gray-300 rounded-lg text-sm font-medium text-gray-700 hover:border-green-400 hover:text-green-600 disabled:opacity-50 transition", children: loading ? t('common.loading') : t('tasks.load_more') }) }) ] }); } a4D_ =?LS{_CF   q u M P EHnq _ $"|^a%`"c"i#l#$ $$F$~%%]'`'''"https://api.canhelp.gr"0(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(0,_lib_translations__WEBPACK_IMPORTED_MODULE_4__/* .getTranslations */ .$)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(next_link__WEBPACK_IMPORTED_MODULE_2___default())(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_5__/* .taskTitle */ .Oj)(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_5__/* .taskDescription */ .GZ)react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_5__/* .formatPrice */ .$g)(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_6__/* .shortName */ .E)buffersourcesizemapshashO5/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskListClient: () => (/* binding */ TaskListClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _lib_translations__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(12998); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8293); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(48178); /* __next_internal_client_entry_do_not_use__ TaskListClient auto */ const BASE = "https://api.canhelp.gr" || 0; function TaskListClient({ initialTasks, initialTotal, filterParams, locale: localeProp, catMap, locMap, mode = 'all' }) { const { locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(); const t = (0,_lib_translations__WEBPACK_IMPORTED_MODULE_4__/* .getTranslations */ .$)(locale); const [tasks, setTasks] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialTasks); const [total] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialTotal); const [page, setPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const hasMore = tasks.length < total; async function loadMore() { setLoading(true); try { const nextPage = page + 1; const params = new URLSearchParams({ ...filterParams, page: String(nextPage), limit: '10' }); const endpoint = mode === 'for_me' ? '/tasks/for-me' : '/tasks'; const res = await fetch(`${BASE}/api${endpoint}?${params}`, { credentials: 'include' }); const json = await res.json(); setTasks((prev)=>[ ...prev, ...json.data || [] ]); setPage(nextPage); } finally{ setLoading(false); } } if (tasks.length === 0) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white/70", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-lg", children: t('tasks.empty') }) }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-4", children: tasks.map((row)=>{ const task = row.task || row; const customer = row.customer; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: `/tasks/${task.id}`, className: "block bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-green-300 transition", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between items-start gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium text-green-600 bg-green-50 px-2 py-0.5 rounded-full", children: task.category ? catMap[task.category] ?? task.category : t('tasks.category.general') }), task.location && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCCD ", locMap[task.location] ?? task.location ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-900 text-lg mb-1 truncate", children: (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_5__/* .taskTitle */ .Oj)(task, locale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 line-clamp-2", children: (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_5__/* .taskDescription */ .GZ)(task, locale) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-right shrink-0", children: [ task.budget ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-lg font-bold text-green-600", children: [ (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_5__/* .formatPrice */ .$g)(task.budget), "€" ] }), task.budgetNegotiable && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-green-600", children: t('task.budget_negotiable') }) ] }) : task.budgetNegotiable ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-green-600", children: t('task.budget_negotiable') }) : null, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-600 mt-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-gray-500", children: [ task.deadline ? t('task.deadline') : t('task.created_at'), ": " ] }), new Date(task.deadline ?? task.createdAt).toLocaleDateString(locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR') ] }), customer && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-end gap-1.5 mt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-right", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500 leading-none", children: (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_6__/* .shortName */ .E)(customer.name) }), customer.rating && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-yellow-500 leading-none mt-0.5", children: [ "★ ", Number(customer.rating).toFixed(1) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-7 h-7 rounded-full overflow-hidden bg-green-100 shrink-0 flex items-center justify-center", children: customer.image ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: customer.image, alt: (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_6__/* .shortName */ .E)(customer.name), className: "w-full h-full object-cover" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-600 font-semibold text-xs", children: (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_6__/* .shortName */ .E)(customer.name).charAt(0).toUpperCase() }) }) ] }) ] }) ] }) }, task.id); }) }), hasMore && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex justify-center mt-8", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: loadMore, disabled: loading, className: "px-6 py-2.5 bg-white border border-gray-300 rounded-lg text-sm font-medium text-gray-700 hover:border-green-400 hover:text-green-600 disabled:opacity-50 transition", children: loading ? t('common.loading') : t('tasks.load_more') }) }) ] }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskListClient: () => (/* binding */ TaskListClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _lib_translations__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(12998); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8293); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(48178); ReplaceSourceRawSource|)/* __next_internal_client_entry_do_not_use__ TaskListClient auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState } from 'react'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import { getTranslations } from '@/lib/translations'; import { taskTitle, taskDescription, formatPrice } from '@/lib/taskLocale'; import { shortName } from '@/lib/formatName'; const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function TaskListClient({ initialTasks, initialTotal, filterParams, locale: localeProp, catMap, locMap, mode = 'all' }) { const { locale } = useLocale(); const t = getTranslations(locale); const [tasks, setTasks] = useState(initialTasks); const [total] = useState(initialTotal); const [page, setPage] = useState(1); const [loading, setLoading] = useState(false); const hasMore = tasks.length < total; async function loadMore() { setLoading(true); try { const nextPage = page + 1; const params = new URLSearchParams({ ...filterParams, page: String(nextPage), limit: '10' }); const endpoint = mode === 'for_me' ? '/tasks/for-me' : '/tasks'; const res = await fetch(`${BASE}/api${endpoint}?${params}`, { credentials: 'include' }); const json = await res.json(); setTasks((prev)=>[ ...prev, ...json.data || [] ]); setPage(nextPage); } finally{ setLoading(false); } } if (tasks.length === 0) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/70", children: /*#__PURE__*/ _jsx("p", { className: "text-lg", children: t('tasks.empty') }) }); } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: tasks.map((row)=>{ const task = row.task || row; const customer = row.customer; return /*#__PURE__*/ _jsx(Link, { href: `/tasks/${task.id}`, className: "block bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-green-300 transition", children: /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-start gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-2", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-green-600 bg-green-50 px-2 py-0.5 rounded-full", children: task.category ? catMap[task.category] ?? task.category : t('tasks.category.general') }), task.location && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCCD ", locMap[task.location] ?? task.location ] }) ] }), /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-900 text-lg mb-1 truncate", children: taskTitle(task, locale) }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 line-clamp-2", children: taskDescription(task, locale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "text-right shrink-0", children: [ task.budget ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("p", { className: "text-lg font-bold text-green-600", children: [ formatPrice(task.budget), "€" ] }), task.budgetNegotiable && /*#__PURE__*/ _jsx("p", { className: "text-xs text-green-600", children: t('task.budget_negotiable') }) ] }) : task.budgetNegotiable ? /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-green-600", children: t('task.budget_negotiable') }) : null, /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-600 mt-1", children: [ /*#__PURE__*/ _jsxs("span", { className: "text-gray-500", children: [ task.deadline ? t('task.deadline') : t('task.created_at'), ": " ] }), new Date(task.deadline ?? task.createdAt).toLocaleDateString(locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR') ] }), customer && /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-end gap-1.5 mt-2", children: [ /*#__PURE__*/ _jsxs("div", { className: "text-right", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 leading-none", children: shortName(customer.name) }), customer.rating && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-yellow-500 leading-none mt-0.5", children: [ "★ ", Number(customer.rating).toFixed(1) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "w-7 h-7 rounded-full overflow-hidden bg-green-100 shrink-0 flex items-center justify-center", children: customer.image ? /*#__PURE__*/ _jsx("img", { src: customer.image, alt: shortName(customer.name), className: "w-full h-full object-cover" }) : /*#__PURE__*/ _jsx("span", { className: "text-green-600 font-semibold text-xs", children: shortName(customer.name).charAt(0).toUpperCase() }) }) ] }) ] }) ] }) }, task.id); }) }), hasMore && /*#__PURE__*/ _jsx("div", { className: "flex justify-center mt-8", children: /*#__PURE__*/ _jsx("button", { onClick: loadMore, disabled: loading, className: "px-6 py-2.5 bg-white border border-gray-300 rounded-lg text-sm font-medium text-gray-700 hover:border-green-400 hover:text-green-600 disabled:opacity-50 transition", children: loading ? t('common.loading') : t('tasks.load_more') }) }) ] }); }  68153undefined155187undefined189217undefined219263undefined265317undefined319393undefined395439undefined454484"https://api.canhelp.gr"undefined4895110undefined514520undefined666674(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined693707(0,_lib_translations__WEBPACK_IMPORTED_MODULE_4__/* .getTranslations */ .$)undefined748755(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined792799(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined844851(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined891898(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined17511754(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined18591862(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined20102014(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined20712074(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23122315(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23172320(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined25652569(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined27472751(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined29292933(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined31493152(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined35803584(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined41654168(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43404348(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_5__/* .taskTitle */ .Oj)undefined44624465(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined46214635(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_5__/* .taskDescription */ .GZ)undefined48144818(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined50155019(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined50215029react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined51525156(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined53845394(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_5__/* .formatPrice */ .$g)undefined56635666(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined60346037(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined63266330(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined65426546(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined73147318(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined75487552(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined77747777(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined79657973(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_6__/* .shortName */ .E)undefined81398143(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined88008803(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined90659068(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined92179225(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_6__/* .shortName */ .E)undefined94109413(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined95989606(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_6__/* .shortName */ .E)undefined1007710080(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1018610189(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) c j~j /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskListClient: () => (/* binding */ TaskListClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _lib_translations__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(12998); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8293); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(48178); |)/* __next_internal_client_entry_do_not_use__ TaskListClient auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState } from 'react'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import { getTranslations } from '@/lib/translations'; import { taskTitle, taskDescription, formatPrice } from '@/lib/taskLocale'; import { shortName } from '@/lib/formatName'; const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function TaskListClient({ initialTasks, initialTotal, filterParams, locale: localeProp, catMap, locMap, mode = 'all' }) { const { locale } = useLocale(); const t = getTranslations(locale); const [tasks, setTasks] = useState(initialTasks); const [total] = useState(initialTotal); const [page, setPage] = useState(1); const [loading, setLoading] = useState(false); const hasMore = tasks.length < total; async function loadMore() { setLoading(true); try { const nextPage = page + 1; const params = new URLSearchParams({ ...filterParams, page: String(nextPage), limit: '10' }); const endpoint = mode === 'for_me' ? '/tasks/for-me' : '/tasks'; const res = await fetch(`${BASE}/api${endpoint}?${params}`, { credentials: 'include' }); const json = await res.json(); setTasks((prev)=>[ ...prev, ...json.data || [] ]); setPage(nextPage); } finally{ setLoading(false); } } if (tasks.length === 0) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/70", children: /*#__PURE__*/ _jsx("p", { className: "text-lg", children: t('tasks.empty') }) }); } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: tasks.map((row)=>{ const task = row.task || row; const customer = row.customer; return /*#__PURE__*/ _jsx(Link, { href: `/tasks/${task.id}`, className: "block bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-green-300 transition", children: /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-start gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-2", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-green-600 bg-green-50 px-2 py-0.5 rounded-full", children: task.category ? catMap[task.category] ?? task.category : t('tasks.category.general') }), task.location && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCCD ", locMap[task.location] ?? task.location ] }) ] }), /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-900 text-lg mb-1 truncate", children: taskTitle(task, locale) }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 line-clamp-2", children: taskDescription(task, locale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "text-right shrink-0", children: [ task.budget ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("p", { className: "text-lg font-bold text-green-600", children: [ formatPrice(task.budget), "€" ] }), task.budgetNegotiable && /*#__PURE__*/ _jsx("p", { className: "text-xs text-green-600", children: t('task.budget_negotiable') }) ] }) : task.budgetNegotiable ? /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-green-600", children: t('task.budget_negotiable') }) : null, /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-600 mt-1", children: [ /*#__PURE__*/ _jsxs("span", { className: "text-gray-500", children: [ task.deadline ? t('task.deadline') : t('task.created_at'), ": " ] }), new Date(task.deadline ?? task.createdAt).toLocaleDateString(locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR') ] }), customer && /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-end gap-1.5 mt-2", children: [ /*#__PURE__*/ _jsxs("div", { className: "text-right", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 leading-none", children: shortName(customer.name) }), customer.rating && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-yellow-500 leading-none mt-0.5", children: [ "★ ", Number(customer.rating).toFixed(1) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "w-7 h-7 rounded-full overflow-hidden bg-green-100 shrink-0 flex items-center justify-center", children: customer.image ? /*#__PURE__*/ _jsx("img", { src: customer.image, alt: shortName(customer.name), className: "w-full h-full object-cover" }) : /*#__PURE__*/ _jsx("span", { className: "text-green-600 font-semibold text-xs", children: shortName(customer.name).charAt(0).toUpperCase() }) }) ] }) ] }) ] }) }, task.id); }) }), hasMore && /*#__PURE__*/ _jsx("div", { className: "flex justify-center mt-8", children: /*#__PURE__*/ _jsx("button", { onClick: loadMore, disabled: loading, className: "px-6 py-2.5 bg-white border border-gray-300 rounded-lg text-sm font-medium text-gray-700 hover:border-green-400 hover:text-green-600 disabled:opacity-50 transition", children: loading ? t('common.loading') : t('tasks.load_more') }) }) ] }); }  68153undefined155187undefined189217undefined219263undefined265317undefined319393undefined395439undefined454484"https://api.canhelp.gr"undefined4895110undefined514520undefined666674(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined693707(0,_lib_translations__WEBPACK_IMPORTED_MODULE_4__/* .getTranslations */ .$)undefined748755(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined792799(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined844851(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined891898(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined17511754(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined18591862(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined20102014(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined20712074(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23122315(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23172320(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined25652569(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined27472751(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined29292933(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined31493152(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined35803584(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined41654168(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43404348(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_5__/* .taskTitle */ .Oj)undefined44624465(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined46214635(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_5__/* .taskDescription */ .GZ)undefined48144818(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined50155019(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined50215029react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined51525156(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined53845394(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_5__/* .formatPrice */ .$g)undefined56635666(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined60346037(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined63266330(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined65426546(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined73147318(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined75487552(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined77747777(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined79657973(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_6__/* .shortName */ .E)undefined81398143(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined88008803(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined90659068(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined92179225(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_6__/* .shortName */ .E)undefined94109413(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined95989606(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_6__/* .shortName */ .E)undefined1007710080(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1018610189(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefinedik, /***/ 41025:  @webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; amodule.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js");  /***/ }) Z/***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js"); /***/ }) [^ _`aamodule.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js");`b, /***/ 52386:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource awebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TasksAuthGuard: () => (/* binding */ TasksAuthGuard) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const TasksAuthGuard = registerClientReference( function() { throw new Error("Attempted to call TasksAuthGuard() from the server but TasksAuthGuard is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/TasksAuthGuard.tsx", "TasksAuthGuard", ); `=D(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)buffersourcesizemapshash/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TasksAuthGuard: () => (/* binding */ TasksAuthGuard) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. const TasksAuthGuard = (0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)( function() { throw new Error("Attempted to call TasksAuthGuard() from the server but TasksAuthGuard is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/TasksAuthGuard.tsx", "TasksAuthGuard", ); {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TasksAuthGuard: () => (/* binding */ TasksAuthGuard) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); ReplaceSourceRawSource// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const TasksAuthGuard = registerClientReference( function() { throw new Error("Attempted to call TasksAuthGuard() from the server but TasksAuthGuard is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/TasksAuthGuard.tsx", "TasksAuthGuard", );61134undefined136142undefined166188(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined /***/ }) Q XlX/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TasksAuthGuard: () => (/* binding */ TasksAuthGuard) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); m// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const TasksAuthGuard = registerClientReference( function() { throw new Error("Attempted to call TasksAuthGuard() from the server but TasksAuthGuard is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/TasksAuthGuard.tsx", "TasksAuthGuard", );61134undefined136142undefined166188(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefinedWY, /***/ 54586:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource 3webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceO/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskFiltersClient: () => (/* binding */ TaskFiltersClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(88142); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53863); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource*/* __next_internal_client_entry_do_not_use__ TaskFiltersClient auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useRouter, usePathname } from 'next/navigation'; import { useLocale } from '@/context/locale'; import { TaskCategoryPicker } from '@/components/TaskCategoryPicker'; import { TaskLocationPicker } from '@/components/TaskLocationPicker'; export function TaskFiltersClient({ categories, locationTree, budgetRange, initialMode, initialQ, initialCategory, initialLocation, initialBudgetMin, initialBudgetMax }) { const router = useRouter(); const pathname = usePathname(); const { t, locale } = useLocale(); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const [mode, setMode] = useState(initialMode); const [q, setQ] = useState(initialQ ?? ''); const [selectedCategory, setSelectedCategory] = useState(initialCategory ?? ''); const [selectedLocation, setSelectedLocation] = useState(initialLocation ?? ''); const hasFilter = !!(initialQ || initialCategory || initialLocation || initialBudgetMin || initialBudgetMax); function buildUrl(overrides) { const base = { mode: mode === 'for_me' ? undefined : 'all', q: q || undefined, category: selectedCategory || undefined, location: selectedLocation || undefined, budgetMin: initialBudgetMin || undefined, budgetMax: initialBudgetMax || undefined, ...overrides }; const qs = new URLSearchParams(); for (const [k, v] of Object.entries(base)){ if (v) qs.set(k, v); } return `${pathname}${qs.toString() ? '?' + qs.toString() : ''}`; } function handleModeChange(newMode) { setMode(newMode); setSelectedCategory(''); router.push(buildUrl({ mode: newMode === 'for_me' ? undefined : 'all', category: undefined })); } function handleCategoryChange(slug) { setSelectedCategory(slug); router.push(buildUrl({ category: slug || undefined })); } function handleLocationChange(slug) { setSelectedLocation(slug); router.push(buildUrl({ location: slug || undefined })); } function handleSubmit(e) { e.preventDefault(); const fd = new FormData(e.currentTarget); const budgetMin = fd.get('budgetMin') || undefined; const budgetMax = fd.get('budgetMax') || undefined; router.push(buildUrl({ budgetMin, budgetMax })); } function handleReset() { setQ(''); setSelectedCategory(''); setSelectedLocation(''); router.push(mode === 'for_me' ? '/tasks' : '/tasks?mode=all'); } const forMeLabel = t('find_tasks.for_me'); const allLabel = t('find_tasks.all'); const locAnyLabel = t('create.field.location.any'); const locAllLabel = t('create.field.location.all'); const catPlaceholder = t('filter.category.all'); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 bg-gray-100 p-1 rounded-xl mb-5", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleModeChange('for_me'), className: `flex-1 px-3 py-2 rounded-lg text-sm font-medium transition ${mode === 'for_me' ? 'bg-white text-green-600 shadow-sm' : 'text-gray-600 hover:text-gray-900'}`, children: forMeLabel }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleModeChange('all'), className: `flex-1 px-3 py-2 rounded-lg text-sm font-medium transition ${mode === 'all' ? 'bg-white text-green-600 shadow-sm' : 'text-gray-600 hover:text-gray-900'}`, children: allLabel }) ] }), /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('tasks.search') }), /*#__PURE__*/ _jsx("input", { name: "q", value: q, onChange: (e)=>setQ(e.target.value), placeholder: t('tasks.search.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), mode === 'all' && categories.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.category') }), /*#__PURE__*/ _jsx(TaskCategoryPicker, { categories: categories, locale: catLocale, value: selectedCategory, onChange: handleCategoryChange, placeholder: catPlaceholder }) ] }), locationTree.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.location') }), /*#__PURE__*/ _jsx(TaskLocationPicker, { locations: locationTree, value: selectedLocation, onChange: handleLocationChange, anyLabel: locAnyLabel, allLabel: locAllLabel }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('tasks.field.budget') }), budgetRange.max > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mb-2", children: [ t('tasks.budget.range'), " ", budgetRange.min, "€ — ", budgetRange.max, "€" ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("input", { name: "budgetMin", type: "number", min: 0, defaultValue: initialBudgetMin, placeholder: budgetRange.min ? String(budgetRange.min) : t('tasks.budget.from'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-gray-400 shrink-0", children: "—" }), /*#__PURE__*/ _jsx("input", { name: "budgetMax", type: "number", min: 0, defaultValue: initialBudgetMax, placeholder: budgetRange.max ? String(budgetRange.max) : t('tasks.budget.to'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsx("button", { type: "submit", className: "w-full bg-green-600 text-white py-2 rounded-lg text-sm font-medium hover:bg-green-700", children: t('tasks.search.btn') }), hasFilter && /*#__PURE__*/ _jsxs("button", { type: "button", onClick: handleReset, className: "w-full flex items-center justify-center gap-1.5 py-2 rounded-lg text-sm font-medium text-gray-500 hover:text-gray-700 hover:bg-gray-50 border border-gray-200 transition-colors", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }), t('tasks.filter.reset') ] }) ] }) ] }); } a)G_UW\d~7>dkW [ * _- #|mp *!,P0>Bc!f!O"R"!%$%U&Y&''-)0)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.usePathname)(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__/* .TaskCategoryPicker */ .W_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__/* .TaskLocationPicker */ .Vbuffersourcesizemapshasht4/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskFiltersClient: () => (/* binding */ TaskFiltersClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(88142); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53863); /* __next_internal_client_entry_do_not_use__ TaskFiltersClient auto */ function TaskFiltersClient({ categories, locationTree, budgetRange, initialMode, initialQ, initialCategory, initialLocation, initialBudgetMin, initialBudgetMax }) { const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const pathname = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.usePathname)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const [mode, setMode] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialMode); const [q, setQ] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialQ ?? ''); const [selectedCategory, setSelectedCategory] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialCategory ?? ''); const [selectedLocation, setSelectedLocation] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialLocation ?? ''); const hasFilter = !!(initialQ || initialCategory || initialLocation || initialBudgetMin || initialBudgetMax); function buildUrl(overrides) { const base = { mode: mode === 'for_me' ? undefined : 'all', q: q || undefined, category: selectedCategory || undefined, location: selectedLocation || undefined, budgetMin: initialBudgetMin || undefined, budgetMax: initialBudgetMax || undefined, ...overrides }; const qs = new URLSearchParams(); for (const [k, v] of Object.entries(base)){ if (v) qs.set(k, v); } return `${pathname}${qs.toString() ? '?' + qs.toString() : ''}`; } function handleModeChange(newMode) { setMode(newMode); setSelectedCategory(''); router.push(buildUrl({ mode: newMode === 'for_me' ? undefined : 'all', category: undefined })); } function handleCategoryChange(slug) { setSelectedCategory(slug); router.push(buildUrl({ category: slug || undefined })); } function handleLocationChange(slug) { setSelectedLocation(slug); router.push(buildUrl({ location: slug || undefined })); } function handleSubmit(e) { e.preventDefault(); const fd = new FormData(e.currentTarget); const budgetMin = fd.get('budgetMin') || undefined; const budgetMax = fd.get('budgetMax') || undefined; router.push(buildUrl({ budgetMin, budgetMax })); } function handleReset() { setQ(''); setSelectedCategory(''); setSelectedLocation(''); router.push(mode === 'for_me' ? '/tasks' : '/tasks?mode=all'); } const forMeLabel = t('find_tasks.for_me'); const allLabel = t('find_tasks.all'); const locAnyLabel = t('create.field.location.any'); const locAllLabel = t('create.field.location.all'); const catPlaceholder = t('filter.category.all'); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1 bg-gray-100 p-1 rounded-xl mb-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>handleModeChange('for_me'), className: `flex-1 px-3 py-2 rounded-lg text-sm font-medium transition ${mode === 'for_me' ? 'bg-white text-green-600 shadow-sm' : 'text-gray-600 hover:text-gray-900'}`, children: forMeLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>handleModeChange('all'), className: `flex-1 px-3 py-2 rounded-lg text-sm font-medium transition ${mode === 'all' ? 'bg-white text-green-600 shadow-sm' : 'text-gray-600 hover:text-gray-900'}`, children: allLabel }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('tasks.search') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "q", value: q, onChange: (e)=>setQ(e.target.value), placeholder: t('tasks.search.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), mode === 'all' && categories.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.category') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__/* .TaskCategoryPicker */ .W, { categories: categories, locale: catLocale, value: selectedCategory, onChange: handleCategoryChange, placeholder: catPlaceholder }) ] }), locationTree.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.location') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__/* .TaskLocationPicker */ .V, { locations: locationTree, value: selectedLocation, onChange: handleLocationChange, anyLabel: locAnyLabel, allLabel: locAllLabel }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('tasks.field.budget') }), budgetRange.max > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 mb-2", children: [ t('tasks.budget.range'), " ", budgetRange.min, "€ — ", budgetRange.max, "€" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "budgetMin", type: "number", min: 0, defaultValue: initialBudgetMin, placeholder: budgetRange.min ? String(budgetRange.min) : t('tasks.budget.from'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-400 shrink-0", children: "—" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "budgetMax", type: "number", min: 0, defaultValue: initialBudgetMax, placeholder: budgetRange.max ? String(budgetRange.max) : t('tasks.budget.to'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", className: "w-full bg-green-600 text-white py-2 rounded-lg text-sm font-medium hover:bg-green-700", children: t('tasks.search.btn') }), hasFilter && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: handleReset, className: "w-full flex items-center justify-center gap-1.5 py-2 rounded-lg text-sm font-medium text-gray-500 hover:text-gray-700 hover:bg-gray-50 border border-gray-200 transition-colors", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }), t('tasks.filter.reset') ] }) ] }) ] }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSourceO/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskFiltersClient: () => (/* binding */ TaskFiltersClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(88142); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53863); ReplaceSourceRawSource*/* __next_internal_client_entry_do_not_use__ TaskFiltersClient auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useRouter, usePathname } from 'next/navigation'; import { useLocale } from '@/context/locale'; import { TaskCategoryPicker } from '@/components/TaskCategoryPicker'; import { TaskLocationPicker } from '@/components/TaskLocationPicker'; export function TaskFiltersClient({ categories, locationTree, budgetRange, initialMode, initialQ, initialCategory, initialLocation, initialBudgetMin, initialBudgetMax }) { const router = useRouter(); const pathname = usePathname(); const { t, locale } = useLocale(); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const [mode, setMode] = useState(initialMode); const [q, setQ] = useState(initialQ ?? ''); const [selectedCategory, setSelectedCategory] = useState(initialCategory ?? ''); const [selectedLocation, setSelectedLocation] = useState(initialLocation ?? ''); const hasFilter = !!(initialQ || initialCategory || initialLocation || initialBudgetMin || initialBudgetMax); function buildUrl(overrides) { const base = { mode: mode === 'for_me' ? undefined : 'all', q: q || undefined, category: selectedCategory || undefined, location: selectedLocation || undefined, budgetMin: initialBudgetMin || undefined, budgetMax: initialBudgetMax || undefined, ...overrides }; const qs = new URLSearchParams(); for (const [k, v] of Object.entries(base)){ if (v) qs.set(k, v); } return `${pathname}${qs.toString() ? '?' + qs.toString() : ''}`; } function handleModeChange(newMode) { setMode(newMode); setSelectedCategory(''); router.push(buildUrl({ mode: newMode === 'for_me' ? undefined : 'all', category: undefined })); } function handleCategoryChange(slug) { setSelectedCategory(slug); router.push(buildUrl({ category: slug || undefined })); } function handleLocationChange(slug) { setSelectedLocation(slug); router.push(buildUrl({ location: slug || undefined })); } function handleSubmit(e) { e.preventDefault(); const fd = new FormData(e.currentTarget); const budgetMin = fd.get('budgetMin') || undefined; const budgetMax = fd.get('budgetMax') || undefined; router.push(buildUrl({ budgetMin, budgetMax })); } function handleReset() { setQ(''); setSelectedCategory(''); setSelectedLocation(''); router.push(mode === 'for_me' ? '/tasks' : '/tasks?mode=all'); } const forMeLabel = t('find_tasks.for_me'); const allLabel = t('find_tasks.all'); const locAnyLabel = t('create.field.location.any'); const locAllLabel = t('create.field.location.all'); const catPlaceholder = t('filter.category.all'); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 bg-gray-100 p-1 rounded-xl mb-5", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleModeChange('for_me'), className: `flex-1 px-3 py-2 rounded-lg text-sm font-medium transition ${mode === 'for_me' ? 'bg-white text-green-600 shadow-sm' : 'text-gray-600 hover:text-gray-900'}`, children: forMeLabel }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleModeChange('all'), className: `flex-1 px-3 py-2 rounded-lg text-sm font-medium transition ${mode === 'all' ? 'bg-white text-green-600 shadow-sm' : 'text-gray-600 hover:text-gray-900'}`, children: allLabel }) ] }), /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('tasks.search') }), /*#__PURE__*/ _jsx("input", { name: "q", value: q, onChange: (e)=>setQ(e.target.value), placeholder: t('tasks.search.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), mode === 'all' && categories.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.category') }), /*#__PURE__*/ _jsx(TaskCategoryPicker, { categories: categories, locale: catLocale, value: selectedCategory, onChange: handleCategoryChange, placeholder: catPlaceholder }) ] }), locationTree.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.location') }), /*#__PURE__*/ _jsx(TaskLocationPicker, { locations: locationTree, value: selectedLocation, onChange: handleLocationChange, anyLabel: locAnyLabel, allLabel: locAllLabel }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('tasks.field.budget') }), budgetRange.max > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mb-2", children: [ t('tasks.budget.range'), " ", budgetRange.min, "€ — ", budgetRange.max, "€" ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("input", { name: "budgetMin", type: "number", min: 0, defaultValue: initialBudgetMin, placeholder: budgetRange.min ? String(budgetRange.min) : t('tasks.budget.from'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-gray-400 shrink-0", children: "—" }), /*#__PURE__*/ _jsx("input", { name: "budgetMax", type: "number", min: 0, defaultValue: initialBudgetMax, placeholder: budgetRange.max ? String(budgetRange.max) : t('tasks.budget.to'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsx("button", { type: "submit", className: "w-full bg-green-600 text-white py-2 rounded-lg text-sm font-medium hover:bg-green-700", children: t('tasks.search.btn') }), hasFilter && /*#__PURE__*/ _jsxs("button", { type: "button", onClick: handleReset, className: "w-full flex items-center justify-center gap-1.5 py-2 rounded-lg text-sm font-medium text-gray-500 hover:text-gray-700 hover:bg-gray-50 border border-gray-200 transition-colors", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }), t('tasks.filter.reset') ] }) ] }) ] }); }  71133undefined135167undefined169225undefined227271undefined273341undefined343411undefined413419undefined604612(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined638648(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.usePathname)undefined679687(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined823830(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined868875(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined946953(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10311038(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined31593163(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined32203224(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined33703373(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined37893792(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42254229(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined43834387(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined44764479(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined47174720(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined52775281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined53705373(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined56205623(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined56255642_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__/* .TaskCategoryPicker */ .Wundefined60776081(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined61706173(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined64206423(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined64256442_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__/* .TaskLocationPicker */ .Vundefined68496853(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined69426945(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined72127216(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined77427746(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined79217924(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined85478550(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined87838786(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined95059508(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined98139817(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1020910212(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1054110544(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) H OcOO/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskFiltersClient: () => (/* binding */ TaskFiltersClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(88142); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53863); d*/* __next_internal_client_entry_do_not_use__ TaskFiltersClient auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useRouter, usePathname } from 'next/navigation'; import { useLocale } from '@/context/locale'; import { TaskCategoryPicker } from '@/components/TaskCategoryPicker'; import { TaskLocationPicker } from '@/components/TaskLocationPicker'; export function TaskFiltersClient({ categories, locationTree, budgetRange, initialMode, initialQ, initialCategory, initialLocation, initialBudgetMin, initialBudgetMax }) { const router = useRouter(); const pathname = usePathname(); const { t, locale } = useLocale(); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const [mode, setMode] = useState(initialMode); const [q, setQ] = useState(initialQ ?? ''); const [selectedCategory, setSelectedCategory] = useState(initialCategory ?? ''); const [selectedLocation, setSelectedLocation] = useState(initialLocation ?? ''); const hasFilter = !!(initialQ || initialCategory || initialLocation || initialBudgetMin || initialBudgetMax); function buildUrl(overrides) { const base = { mode: mode === 'for_me' ? undefined : 'all', q: q || undefined, category: selectedCategory || undefined, location: selectedLocation || undefined, budgetMin: initialBudgetMin || undefined, budgetMax: initialBudgetMax || undefined, ...overrides }; const qs = new URLSearchParams(); for (const [k, v] of Object.entries(base)){ if (v) qs.set(k, v); } return `${pathname}${qs.toString() ? '?' + qs.toString() : ''}`; } function handleModeChange(newMode) { setMode(newMode); setSelectedCategory(''); router.push(buildUrl({ mode: newMode === 'for_me' ? undefined : 'all', category: undefined })); } function handleCategoryChange(slug) { setSelectedCategory(slug); router.push(buildUrl({ category: slug || undefined })); } function handleLocationChange(slug) { setSelectedLocation(slug); router.push(buildUrl({ location: slug || undefined })); } function handleSubmit(e) { e.preventDefault(); const fd = new FormData(e.currentTarget); const budgetMin = fd.get('budgetMin') || undefined; const budgetMax = fd.get('budgetMax') || undefined; router.push(buildUrl({ budgetMin, budgetMax })); } function handleReset() { setQ(''); setSelectedCategory(''); setSelectedLocation(''); router.push(mode === 'for_me' ? '/tasks' : '/tasks?mode=all'); } const forMeLabel = t('find_tasks.for_me'); const allLabel = t('find_tasks.all'); const locAnyLabel = t('create.field.location.any'); const locAllLabel = t('create.field.location.all'); const catPlaceholder = t('filter.category.all'); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 bg-gray-100 p-1 rounded-xl mb-5", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleModeChange('for_me'), className: `flex-1 px-3 py-2 rounded-lg text-sm font-medium transition ${mode === 'for_me' ? 'bg-white text-green-600 shadow-sm' : 'text-gray-600 hover:text-gray-900'}`, children: forMeLabel }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleModeChange('all'), className: `flex-1 px-3 py-2 rounded-lg text-sm font-medium transition ${mode === 'all' ? 'bg-white text-green-600 shadow-sm' : 'text-gray-600 hover:text-gray-900'}`, children: allLabel }) ] }), /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('tasks.search') }), /*#__PURE__*/ _jsx("input", { name: "q", value: q, onChange: (e)=>setQ(e.target.value), placeholder: t('tasks.search.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), mode === 'all' && categories.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.category') }), /*#__PURE__*/ _jsx(TaskCategoryPicker, { categories: categories, locale: catLocale, value: selectedCategory, onChange: handleCategoryChange, placeholder: catPlaceholder }) ] }), locationTree.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.location') }), /*#__PURE__*/ _jsx(TaskLocationPicker, { locations: locationTree, value: selectedLocation, onChange: handleLocationChange, anyLabel: locAnyLabel, allLabel: locAllLabel }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('tasks.field.budget') }), budgetRange.max > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mb-2", children: [ t('tasks.budget.range'), " ", budgetRange.min, "€ — ", budgetRange.max, "€" ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("input", { name: "budgetMin", type: "number", min: 0, defaultValue: initialBudgetMin, placeholder: budgetRange.min ? String(budgetRange.min) : t('tasks.budget.from'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-gray-400 shrink-0", children: "—" }), /*#__PURE__*/ _jsx("input", { name: "budgetMax", type: "number", min: 0, defaultValue: initialBudgetMax, placeholder: budgetRange.max ? String(budgetRange.max) : t('tasks.budget.to'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsx("button", { type: "submit", className: "w-full bg-green-600 text-white py-2 rounded-lg text-sm font-medium hover:bg-green-700", children: t('tasks.search.btn') }), hasFilter && /*#__PURE__*/ _jsxs("button", { type: "button", onClick: handleReset, className: "w-full flex items-center justify-center gap-1.5 py-2 rounded-lg text-sm font-medium text-gray-500 hover:text-gray-700 hover:bg-gray-50 border border-gray-200 transition-colors", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }), t('tasks.filter.reset') ] }) ] }) ] }); }  71133undefined135167undefined169225undefined227271undefined273341undefined343411undefined413419undefined604612(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined638648(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.usePathname)undefined679687(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined823830(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined868875(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined946953(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10311038(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined31593163(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined32203224(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined33703373(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined37893792(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42254229(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined43834387(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined44764479(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined47174720(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined52775281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined53705373(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined56205623(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined56255642_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__/* .TaskCategoryPicker */ .Wundefined60776081(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined61706173(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined64206423(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined64256442_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__/* .TaskLocationPicker */ .Vundefined68496853(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined69426945(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined72127216(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined77427746(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined79217924(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined85478550(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined87838786(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined95059508(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined98139817(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1020910212(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1054110544(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefinedNP, /***/ 55255:  8webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource <webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource import(/* webpackMode: "eager", webpackExports: ["TaskFiltersClient"] */ "/opt/canhelp/apps/web/src/app/tasks/TaskFiltersClient.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["TaskListClient"] */ "/opt/canhelp/apps/web/src/app/tasks/TaskListClient.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["TaskMapDynamic"] */ "/opt/canhelp/apps/web/src/app/tasks/TaskMapDynamic.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["TasksAuthGuard"] */ "/opt/canhelp/apps/web/src/app/tasks/TasksAuthGuard.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["TaskViewToggle"] */ "/opt/canhelp/apps/web/src/app/tasks/TaskViewToggle.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["__esModule","default"] */ "/opt/canhelp/node_modules/next/dist/client/app-dir/link.js"); J  Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 34052))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 70535))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 97107))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 52386))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 77241))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3498, 23))buffersourcesizemapshash[Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 34052)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 70535)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 97107)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 52386)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 77241)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3498, 23)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSource import(/* webpackMode: "eager", webpackExports: ["TaskFiltersClient"] */ "/opt/canhelp/apps/web/src/app/tasks/TaskFiltersClient.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["TaskListClient"] */ "/opt/canhelp/apps/web/src/app/tasks/TaskListClient.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["TaskMapDynamic"] */ "/opt/canhelp/apps/web/src/app/tasks/TaskMapDynamic.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["TasksAuthGuard"] */ "/opt/canhelp/apps/web/src/app/tasks/TasksAuthGuard.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["TaskViewToggle"] */ "/opt/canhelp/apps/web/src/app/tasks/TaskViewToggle.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["__esModule","default"] */ "/opt/canhelp/node_modules/next/dist/client/app-dir/link.js"); 0132Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 34052))undefined137263Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 70535))undefined268394Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 97107))undefined399525Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 52386))undefined530656Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 77241))undefined661797Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3498, 23))undefined /***/ }) ?FV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { [ import(/* webpackMode: "eager", webpackExports: ["TaskFiltersClient"] */ "/opt/canhelp/apps/web/src/app/tasks/TaskFiltersClient.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["TaskListClient"] */ "/opt/canhelp/apps/web/src/app/tasks/TaskListClient.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["TaskMapDynamic"] */ "/opt/canhelp/apps/web/src/app/tasks/TaskMapDynamic.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["TasksAuthGuard"] */ "/opt/canhelp/apps/web/src/app/tasks/TasksAuthGuard.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["TaskViewToggle"] */ "/opt/canhelp/apps/web/src/app/tasks/TaskViewToggle.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["__esModule","default"] */ "/opt/canhelp/node_modules/next/dist/client/app-dir/link.js"); 0132Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 34052))undefined137263Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 70535))undefined268394Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 97107))undefined399525Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 52386))undefined530656Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 77241))undefined661797Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3498, 23))undefinedEG, /***/ 55511:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("crypto");  /***/ }) 6Q/***/ ((module) => { "use strict"; module.exports = require("crypto"); /***/ }) 7: ;<=#module.exports = require("crypto");<>, /***/ 55591:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; "module.exports = require("https");  /***/ }) -P/***/ ((module) => { "use strict"; module.exports = require("https"); /***/ }) .1 234"module.exports = require("https");35, /***/ 59983:  8webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource <webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource import(/* webpackMode: "eager", webpackExports: ["TaskFiltersClient"] */ "/opt/canhelp/apps/web/src/app/tasks/TaskFiltersClient.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["TaskListClient"] */ "/opt/canhelp/apps/web/src/app/tasks/TaskListClient.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["TaskMapDynamic"] */ "/opt/canhelp/apps/web/src/app/tasks/TaskMapDynamic.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["TasksAuthGuard"] */ "/opt/canhelp/apps/web/src/app/tasks/TasksAuthGuard.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["TaskViewToggle"] */ "/opt/canhelp/apps/web/src/app/tasks/TaskViewToggle.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["__esModule","default"] */ "/opt/canhelp/node_modules/next/dist/client/app-dir/link.js"); J  Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 54586))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 40993))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 8225))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 77556))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 71259))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 94496, 23))buffersourcesizemapshash[Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 54586)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 40993)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 8225)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 77556)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 71259)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 94496, 23)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSource import(/* webpackMode: "eager", webpackExports: ["TaskFiltersClient"] */ "/opt/canhelp/apps/web/src/app/tasks/TaskFiltersClient.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["TaskListClient"] */ "/opt/canhelp/apps/web/src/app/tasks/TaskListClient.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["TaskMapDynamic"] */ "/opt/canhelp/apps/web/src/app/tasks/TaskMapDynamic.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["TasksAuthGuard"] */ "/opt/canhelp/apps/web/src/app/tasks/TasksAuthGuard.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["TaskViewToggle"] */ "/opt/canhelp/apps/web/src/app/tasks/TaskViewToggle.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["__esModule","default"] */ "/opt/canhelp/node_modules/next/dist/client/app-dir/link.js"); 0132Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 54586))undefined137263Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 40993))undefined268394Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 8225))undefined399525Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 77556))undefined530656Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 71259))undefined661797Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 94496, 23))undefined /***/ }) $+A0132Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 54586))undefined137263Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 40993))undefined268394Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 8225))undefined399525Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 77556))undefined530656Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 71259))undefined661797Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 94496, 23))undefined,., /***/ 63033:  ;webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; \module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js"); /***/ }) ! "#$\module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");#%, /***/ 70535:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource awebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskListClient: () => (/* binding */ TaskListClient) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const TaskListClient = registerClientReference( function() { throw new Error("Attempted to call TaskListClient() from the server but TaskListClient is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/TaskListClient.tsx", "TaskListClient", ); `=D(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)buffersourcesizemapshash/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskListClient: () => (/* binding */ TaskListClient) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. const TaskListClient = (0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)( function() { throw new Error("Attempted to call TaskListClient() from the server but TaskListClient is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/TaskListClient.tsx", "TaskListClient", ); {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskListClient: () => (/* binding */ TaskListClient) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); ReplaceSourceRawSource// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const TaskListClient = registerClientReference( function() { throw new Error("Attempted to call TaskListClient() from the server but TaskListClient is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/TaskListClient.tsx", "TaskListClient", );61134undefined136142undefined166188(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined /***/ })  //* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskListClient: () => (/* binding */ TaskListClient) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); 0// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const TaskListClient = registerClientReference( function() { throw new Error("Attempted to call TaskListClient() from the server but TaskListClient is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/TaskListClient.tsx", "TaskListClient", );, /***/ 71259:  5webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource{/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskViewToggle: () => (/* binding */ TaskViewToggle) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71159); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96484); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource= /* __next_internal_client_entry_do_not_use__ TaskViewToggle auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useRouter, usePathname, useSearchParams } from 'next/navigation'; import { useLocale } from '@/context/locale'; export function TaskViewToggle({ view }) { const router = useRouter(); const pathname = usePathname(); const searchParams = useSearchParams(); const { locale } = useLocale(); const switchTo = (newView)=>{ const params = new URLSearchParams(searchParams.toString()); if (newView === 'map') { params.set('view', 'map'); } else { params.delete('view'); } params.delete('page'); router.push(`${pathname}${params.toString() ? '?' + params.toString() : ''}`); }; const listLabel = locale === 'ru' ? 'Список' : locale === 'en' ? 'List' : 'Λίστα'; const mapLabel = locale === 'ru' ? 'Карта' : locale === 'en' ? 'Map' : 'Χάρτης'; return /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 bg-white/20 p-1 rounded-xl", children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>switchTo('list'), className: `flex items-center gap-1.5 px-4 py-1.5 rounded-lg text-sm font-medium transition ${view === 'list' ? 'bg-white text-gray-900 shadow-sm' : 'text-white/80 hover:text-white'}`, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 6h16M4 12h16M4 18h16" }) }), listLabel ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>switchTo('map'), className: `flex items-center gap-1.5 px-4 py-1.5 rounded-lg text-sm font-medium transition ${view === 'map' ? 'bg-white text-gray-900 shadow-sm' : 'text-white/80 hover:text-white'}`, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7" }) }), mapLabel ] }) ] }); } aD\;C]gdh L O < ? (0,next_navigation__WEBPACK_IMPORTED_MODULE_1__.useRouter)(0,next_navigation__WEBPACK_IMPORTED_MODULE_1__.usePathname)(0,next_navigation__WEBPACK_IMPORTED_MODULE_1__.useSearchParams)(0,_context_locale__WEBPACK_IMPORTED_MODULE_2__/* .useLocale */ .Y)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)buffersourcesizemapshash&/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskViewToggle: () => (/* binding */ TaskViewToggle) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71159); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96484); /* __next_internal_client_entry_do_not_use__ TaskViewToggle auto */ function TaskViewToggle({ view }) { const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_1__.useRouter)(); const pathname = (0,next_navigation__WEBPACK_IMPORTED_MODULE_1__.usePathname)(); const searchParams = (0,next_navigation__WEBPACK_IMPORTED_MODULE_1__.useSearchParams)(); const { locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_2__/* .useLocale */ .Y)(); const switchTo = (newView)=>{ const params = new URLSearchParams(searchParams.toString()); if (newView === 'map') { params.set('view', 'map'); } else { params.delete('view'); } params.delete('page'); router.push(`${pathname}${params.toString() ? '?' + params.toString() : ''}`); }; const listLabel = locale === 'ru' ? 'Список' : locale === 'en' ? 'List' : 'Λίστα'; const mapLabel = locale === 'ru' ? 'Карта' : locale === 'en' ? 'Map' : 'Χάρτης'; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1 bg-white/20 p-1 rounded-xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>switchTo('list'), className: `flex items-center gap-1.5 px-4 py-1.5 rounded-lg text-sm font-medium transition ${view === 'list' ? 'bg-white text-gray-900 shadow-sm' : 'text-white/80 hover:text-white'}`, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 6h16M4 12h16M4 18h16" }) }), listLabel ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>switchTo('map'), className: `flex items-center gap-1.5 px-4 py-1.5 rounded-lg text-sm font-medium transition ${view === 'map' ? 'bg-white text-gray-900 shadow-sm' : 'text-white/80 hover:text-white'}`, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7" }) }), mapLabel ] }) ] }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource{/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskViewToggle: () => (/* binding */ TaskViewToggle) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71159); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96484); ReplaceSourceRawSource= /* __next_internal_client_entry_do_not_use__ TaskViewToggle auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useRouter, usePathname, useSearchParams } from 'next/navigation'; import { useLocale } from '@/context/locale'; export function TaskViewToggle({ view }) { const router = useRouter(); const pathname = usePathname(); const searchParams = useSearchParams(); const { locale } = useLocale(); const switchTo = (newView)=>{ const params = new URLSearchParams(searchParams.toString()); if (newView === 'map') { params.set('view', 'map'); } else { params.delete('view'); } params.delete('page'); router.push(`${pathname}${params.toString() ? '?' + params.toString() : ''}`); }; const listLabel = locale === 'ru' ? 'Список' : locale === 'en' ? 'List' : 'Λίστα'; const mapLabel = locale === 'ru' ? 'Карта' : locale === 'en' ? 'Map' : 'Χάρτης'; return /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 bg-white/20 p-1 rounded-xl", children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>switchTo('list'), className: `flex items-center gap-1.5 px-4 py-1.5 rounded-lg text-sm font-medium transition ${view === 'list' ? 'bg-white text-gray-900 shadow-sm' : 'text-white/80 hover:text-white'}`, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 6h16M4 12h16M4 18h16" }) }), listLabel ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>switchTo('map'), className: `flex items-center gap-1.5 px-4 py-1.5 rounded-lg text-sm font-medium transition ${view === 'map' ? 'bg-white text-gray-900 shadow-sm' : 'text-white/80 hover:text-white'}`, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7" }) }), mapLabel ] }) ] }); } d68130undefined132205undefined207251undefined253259undefined315323(0,next_navigation__WEBPACK_IMPORTED_MODULE_1__.useRouter)undefined349359(0,next_navigation__WEBPACK_IMPORTED_MODULE_1__.usePathname)undefined389403(0,next_navigation__WEBPACK_IMPORTED_MODULE_1__.useSearchParams)undefined431439(0,_context_locale__WEBPACK_IMPORTED_MODULE_2__/* .useLocale */ .Y)undefined10031007(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined11241128(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined14521455(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined16921695(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined20542058(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined23802383(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined26202623(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ })   '{/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskViewToggle: () => (/* binding */ TaskViewToggle) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71159); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96484); (= /* __next_internal_client_entry_do_not_use__ TaskViewToggle auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useRouter, usePathname, useSearchParams } from 'next/navigation'; import { useLocale } from '@/context/locale'; export function TaskViewToggle({ view }) { const router = useRouter(); const pathname = usePathname(); const searchParams = useSearchParams(); const { locale } = useLocale(); const switchTo = (newView)=>{ const params = new URLSearchParams(searchParams.toString()); if (newView === 'map') { params.set('view', 'map'); } else { params.delete('view'); } params.delete('page'); router.push(`${pathname}${params.toString() ? '?' + params.toString() : ''}`); }; const listLabel = locale === 'ru' ? 'Список' : locale === 'en' ? 'List' : 'Λίστα'; const mapLabel = locale === 'ru' ? 'Карта' : locale === 'en' ? 'Map' : 'Χάρτης'; return /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 bg-white/20 p-1 rounded-xl", children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>switchTo('list'), className: `flex items-center gap-1.5 px-4 py-1.5 rounded-lg text-sm font-medium transition ${view === 'list' ? 'bg-white text-gray-900 shadow-sm' : 'text-white/80 hover:text-white'}`, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 6h16M4 12h16M4 18h16" }) }), listLabel ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>switchTo('map'), className: `flex items-center gap-1.5 px-4 py-1.5 rounded-lg text-sm font-medium transition ${view === 'map' ? 'bg-white text-gray-900 shadow-sm' : 'text-white/80 hover:text-white'}`, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7" }) }), mapLabel ] }) ] }); } d68130undefined132205undefined207251undefined253259undefined315323(0,next_navigation__WEBPACK_IMPORTED_MODULE_1__.useRouter)undefined349359(0,next_navigation__WEBPACK_IMPORTED_MODULE_1__.usePathname)undefined389403(0,next_navigation__WEBPACK_IMPORTED_MODULE_1__.useSearchParams)undefined431439(0,_context_locale__WEBPACK_IMPORTED_MODULE_2__/* .useLocale */ .Y)undefined10031007(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined11241128(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined14521455(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined16921695(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined20542058(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined23802383(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined26202623(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 74075:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("zlib");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("zlib"); /***/ })    !module.exports = require("zlib");  , /***/ 77241:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource awebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskViewToggle: () => (/* binding */ TaskViewToggle) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const TaskViewToggle = registerClientReference( function() { throw new Error("Attempted to call TaskViewToggle() from the server but TaskViewToggle is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/TaskViewToggle.tsx", "TaskViewToggle", ); `=D(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)buffersourcesizemapshash/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskViewToggle: () => (/* binding */ TaskViewToggle) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. const TaskViewToggle = (0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)( function() { throw new Error("Attempted to call TaskViewToggle() from the server but TaskViewToggle is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/TaskViewToggle.tsx", "TaskViewToggle", ); {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskViewToggle: () => (/* binding */ TaskViewToggle) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); ReplaceSourceRawSource// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const TaskViewToggle = registerClientReference( function() { throw new Error("Attempted to call TaskViewToggle() from the server but TaskViewToggle is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/TaskViewToggle.tsx", "TaskViewToggle", );61134undefined136142undefined166188(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined /***/ })  /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskViewToggle: () => (/* binding */ TaskViewToggle) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const TaskViewToggle = registerClientReference( function() { throw new Error("Attempted to call TaskViewToggle() from the server but TaskViewToggle is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/TaskViewToggle.tsx", "TaskViewToggle", );, /***/ 77556:  pwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TasksAuthGuard: () => (/* binding */ TasksAuthGuard) /* harmony export */ }); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcez/* __next_internal_client_entry_do_not_use__ TasksAuthGuard auto */ export function TasksAuthGuard() { return null; } aDJbuffersourcesizemapshash/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TasksAuthGuard: () => (/* binding */ TasksAuthGuard) /* harmony export */ }); /* __next_internal_client_entry_do_not_use__ TasksAuthGuard auto */ function TasksAuthGuard() { return null; } {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TasksAuthGuard: () => (/* binding */ TasksAuthGuard) /* harmony export */ }); ReplaceSourceRawSourcez/* __next_internal_client_entry_do_not_use__ TasksAuthGuard auto */ export function TasksAuthGuard() { return null; }  6874undefined /***/ })   /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TasksAuthGuard: () => (/* binding */ TasksAuthGuard) /* harmony export */ }); z/* __next_internal_client_entry_do_not_use__ TasksAuthGuard auto */ export function TasksAuthGuard() { return null; }  6874undefined, /***/ 79428:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("buffer");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("buffer"); /***/ })  #module.exports = require("buffer");, /***/ 79551:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("url");  /***/ }) N/***/ ((module) => { "use strict"; module.exports = require("url"); /***/ })   module.exports = require("url");, /***/ 79646:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; *module.exports = require("child_process");  /***/ }) X/***/ ((module) => { "use strict"; module.exports = require("child_process"); /***/ })  *module.exports = require("child_process");, /***/ 81630:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("http");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("http"); /***/ })  !module.exports = require("http");, /***/ 83997:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("tty");  /***/ }) N/***/ ((module) => { "use strict"; module.exports = require("tty"); /***/ })   module.exports = require("tty");, /***/ 86439:  +webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");  /***/ }) z/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/no-fallback-error.external"); /***/ })  Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");, /***/ 91645:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("net");  /***/ }) N/***/ ((module) => { "use strict"; module.exports = require("net"); /***/ })   module.exports = require("net");, /***/ 94735:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("events");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("events"); /***/ })  #module.exports = require("events");, /***/ 97107:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource awebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskMapDynamic: () => (/* binding */ TaskMapDynamic) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const TaskMapDynamic = registerClientReference( function() { throw new Error("Attempted to call TaskMapDynamic() from the server but TaskMapDynamic is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/TaskMapDynamic.tsx", "TaskMapDynamic", ); `=D(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)buffersourcesizemapshash/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskMapDynamic: () => (/* binding */ TaskMapDynamic) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. const TaskMapDynamic = (0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)( function() { throw new Error("Attempted to call TaskMapDynamic() from the server but TaskMapDynamic is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/TaskMapDynamic.tsx", "TaskMapDynamic", ); {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskMapDynamic: () => (/* binding */ TaskMapDynamic) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); ReplaceSourceRawSource// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const TaskMapDynamic = registerClientReference( function() { throw new Error("Attempted to call TaskMapDynamic() from the server but TaskMapDynamic is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/TaskMapDynamic.tsx", "TaskMapDynamic", );61134undefined136142undefined166188(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined /***/ })  /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskMapDynamic: () => (/* binding */ TaskMapDynamic) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const TaskMapDynamic = registerClientReference( function() { throw new Error("Attempted to call TaskMapDynamic() from the server but TaskMapDynamic is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/TaskMapDynamic.tsx", "TaskMapDynamic", );Pw }; ; // load runtime var __webpack_require__ = require("../../webpack-runtime.js"); __webpack_require__.C(exports); var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [901,652,809,902,331,22], () => (__webpack_exec__(12905))); ,module.exports = __webpack_exports__; })(); @gb(() => { var exports = {}; exports.id = 147; exports.ids = [147]; exports.modules = { /***/ 261: "#$%&'$, /***/ 8225: ?/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskMapDynamic: () => (/* binding */ TaskMapDynamic) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dynamic__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(47262); M/* __next_internal_client_entry_do_not_use__ TaskMapDynamic auto */ import { jsx as _jsx } from "react/jsx-runtime"; import dynamic from 'next/dynamic'; export const TaskMapDynamic = dynamic(async ()=>{ typeof require.resolveWeak !== "undefined" && require.resolveWeak("./TaskMapClient"); }, { loadableGenerated: { modules: [ "app/tasks/TaskMapDynamic.tsx -> " + "./TaskMapClient" ] }, ssr: false, loading: ()=>/*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-gray-200 bg-gray-50 flex items-center justify-center", style: { height: 580 }, children: /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 border-2 border-green-500 border-t-transparent rounded-full animate-spin" }) }) }); h68115undefined117151undefined153159undefined183189(0,next_dynamic__WEBPACK_IMPORTED_MODULE_1__["default"])undefined207248 trueundefined253271/*require.resolve*/undefined273289null /* weak dependency, without id */undefined473476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined691694(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined , /***/ 8293: ;/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); export function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ export function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } export function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } )06undefined324330undefined486492undefined  !, /***/ 12905:  7 8 const module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/tasks/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'tasks', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/tasks/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/tasks/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/tasks/page", pathname: "/tasks", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/tasks/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map %'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558638Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 21440))undefined641781undefined783897undefined899975undefined9771048undefined10501112undefined11141183undefined11851261undefined12631348undefined13501433undefined14351511undefined15131594undefined15961689undefined16911795undefined17971877undefined18791957undefined19592050undefined20522233undefined22352311undefined23132378undefined23802453undefined24552512undefined25142620undefined26222695undefined26972761undefined27632844undefined32513473Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined35313760Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined43204542Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined46004829Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined50125034undefined50365172undefined51745196undefined52275245__webpack_require__undefined53035309undefined54105536undefined55385623undefined56255738undefined58015807undefined58325849next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined58855893next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined61496184".next"undefined618961900undefined62176255 falseundefined62676273undefined65536573falseundefined65766640{}undefined67866825falseundefined68576870(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined69616974(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined77407755(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined81428151(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined81878202(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined83478360(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined84068432next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined86118624(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined86708679next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined87198743(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined89238942(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined91349241 falseundefined924692600undefined1155611569(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1195411981(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1376613783(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1384313851next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1390213901: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1427014299(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1443114451(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1458514593(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1489314907next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1494714962next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1519015227falseundefined1523015805{}undefined1638316396next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1748317496(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1777517788(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1850718543 trueundefined1854718566(__webpack_require__(33873).join)undefined18645186960undefined1965719670(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2151121524(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2194821969next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2340823422next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2466824685(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2497424985next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2500025004(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2511025121next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2555525566next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2563525646next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2573525746next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2627926290next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2633526349next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2700127009next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2775527776(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2930429318next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2935729368next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2987029883(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2994029961(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3053630544next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3202332037next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3338933412next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3587935892next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3618736201next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3708437107next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3737937400next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3751837539next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3776937784(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3801238023next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3805238074next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3873038745(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3895338964next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3922739240(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3968839701(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4057140592next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4147141492next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4160241623next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4217642193next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4239742420next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4331643331(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4435944374(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4458244593next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4462644648next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4536545477falseundefined4548045830{}undefined4585545870(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4681446825next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4696046975(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4758647613falseundefined4761647686{}undefined4899449008next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined4993249947(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5082250835next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5093450941next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5119751211next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5142351441(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefined# $, /***/ 21440: 4 )*+,-./01289, /***/ 34052: 3/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskFiltersClient: () => (/* binding */ TaskFiltersClient) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); (// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const TaskFiltersClient = registerClientReference( function() { throw new Error("Attempted to call TaskFiltersClient() from the server but TaskFiltersClient is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/TaskFiltersClient.tsx", "TaskFiltersClient", );61134undefined136142undefined169191(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined67, /***/ 40993: / /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskListClient: () => (/* binding */ TaskListClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _lib_translations__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(12998); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8293); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(48178); |)/* __next_internal_client_entry_do_not_use__ TaskListClient auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState } from 'react'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import { getTranslations } from '@/lib/translations'; import { taskTitle, taskDescription, formatPrice } from '@/lib/taskLocale'; import { shortName } from '@/lib/formatName'; const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function TaskListClient({ initialTasks, initialTotal, filterParams, locale: localeProp, catMap, locMap, mode = 'all' }) { const { locale } = useLocale(); const t = getTranslations(locale); const [tasks, setTasks] = useState(initialTasks); const [total] = useState(initialTotal); const [page, setPage] = useState(1); const [loading, setLoading] = useState(false); const hasMore = tasks.length < total; async function loadMore() { setLoading(true); try { const nextPage = page + 1; const params = new URLSearchParams({ ...filterParams, page: String(nextPage), limit: '10' }); const endpoint = mode === 'for_me' ? '/tasks/for-me' : '/tasks'; const res = await fetch(`${BASE}/api${endpoint}?${params}`, { credentials: 'include' }); const json = await res.json(); setTasks((prev)=>[ ...prev, ...json.data || [] ]); setPage(nextPage); } finally{ setLoading(false); } } if (tasks.length === 0) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/70", children: /*#__PURE__*/ _jsx("p", { className: "text-lg", children: t('tasks.empty') }) }); } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: tasks.map((row)=>{ const task = row.task || row; const customer = row.customer; return /*#__PURE__*/ _jsx(Link, { href: `/tasks/${task.id}`, className: "block bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-green-300 transition", children: /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-start gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-2", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-green-600 bg-green-50 px-2 py-0.5 rounded-full", children: task.category ? catMap[task.category] ?? task.category : t('tasks.category.general') }), task.location && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCCD ", locMap[task.location] ?? task.location ] }) ] }), /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-900 text-lg mb-1 truncate", children: taskTitle(task, locale) }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 line-clamp-2", children: taskDescription(task, locale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "text-right shrink-0", children: [ task.budget ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("p", { className: "text-lg font-bold text-green-600", children: [ formatPrice(task.budget), "€" ] }), task.budgetNegotiable && /*#__PURE__*/ _jsx("p", { className: "text-xs text-green-600", children: t('task.budget_negotiable') }) ] }) : task.budgetNegotiable ? /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-green-600", children: t('task.budget_negotiable') }) : null, /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-600 mt-1", children: [ /*#__PURE__*/ _jsxs("span", { className: "text-gray-500", children: [ task.deadline ? t('task.deadline') : t('task.created_at'), ": " ] }), new Date(task.deadline ?? task.createdAt).toLocaleDateString(locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR') ] }), customer && /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-end gap-1.5 mt-2", children: [ /*#__PURE__*/ _jsxs("div", { className: "text-right", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 leading-none", children: shortName(customer.name) }), customer.rating && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-yellow-500 leading-none mt-0.5", children: [ "★ ", Number(customer.rating).toFixed(1) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "w-7 h-7 rounded-full overflow-hidden bg-green-100 shrink-0 flex items-center justify-center", children: customer.image ? /*#__PURE__*/ _jsx("img", { src: customer.image, alt: shortName(customer.name), className: "w-full h-full object-cover" }) : /*#__PURE__*/ _jsx("span", { className: "text-green-600 font-semibold text-xs", children: shortName(customer.name).charAt(0).toUpperCase() }) }) ] }) ] }) ] }) }, task.id); }) }), hasMore && /*#__PURE__*/ _jsx("div", { className: "flex justify-center mt-8", children: /*#__PURE__*/ _jsx("button", { onClick: loadMore, disabled: loading, className: "px-6 py-2.5 bg-white border border-gray-300 rounded-lg text-sm font-medium text-gray-700 hover:border-green-400 hover:text-green-600 disabled:opacity-50 transition", children: loading ? t('common.loading') : t('tasks.load_more') }) }) ] }); }  68153undefined155187undefined189217undefined219263undefined265317undefined319393undefined395439undefined454484"https://api.canhelp.gr"undefined4895110undefined514520undefined666674(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined693707(0,_lib_translations__WEBPACK_IMPORTED_MODULE_4__/* .getTranslations */ .$)undefined748755(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined792799(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined844851(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined891898(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined17511754(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined18591862(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined20102014(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined20712074(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23122315(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23172320(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined25652569(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined27472751(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined29292933(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined31493152(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined35803584(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined41654168(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43404348(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_5__/* .taskTitle */ .Oj)undefined44624465(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined46214635(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_5__/* .taskDescription */ .GZ)undefined48144818(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined50155019(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined50215029react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined51525156(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined53845394(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_5__/* .formatPrice */ .$g)undefined56635666(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined60346037(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined63266330(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined65426546(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined73147318(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined75487552(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined77747777(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined79657973(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_6__/* .shortName */ .E)undefined81398143(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined88008803(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined90659068(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined92179225(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_6__/* .shortName */ .E)undefined94109413(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined95989606(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_6__/* .shortName */ .E)undefined1007710080(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1018610189(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined45, /***/ 52386: +/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TasksAuthGuard: () => (/* binding */ TasksAuthGuard) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const TasksAuthGuard = registerClientReference( function() { throw new Error("Attempted to call TasksAuthGuard() from the server but TasksAuthGuard is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/TasksAuthGuard.tsx", "TasksAuthGuard", );61134undefined136142undefined166188(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined , /***/ 54586: 'O/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskFiltersClient: () => (/* binding */ TaskFiltersClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(88142); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53863); */* __next_internal_client_entry_do_not_use__ TaskFiltersClient auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useRouter, usePathname } from 'next/navigation'; import { useLocale } from '@/context/locale'; import { TaskCategoryPicker } from '@/components/TaskCategoryPicker'; import { TaskLocationPicker } from '@/components/TaskLocationPicker'; export function TaskFiltersClient({ categories, locationTree, budgetRange, initialMode, initialQ, initialCategory, initialLocation, initialBudgetMin, initialBudgetMax }) { const router = useRouter(); const pathname = usePathname(); const { t, locale } = useLocale(); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const [mode, setMode] = useState(initialMode); const [q, setQ] = useState(initialQ ?? ''); const [selectedCategory, setSelectedCategory] = useState(initialCategory ?? ''); const [selectedLocation, setSelectedLocation] = useState(initialLocation ?? ''); const hasFilter = !!(initialQ || initialCategory || initialLocation || initialBudgetMin || initialBudgetMax); function buildUrl(overrides) { const base = { mode: mode === 'for_me' ? undefined : 'all', q: q || undefined, category: selectedCategory || undefined, location: selectedLocation || undefined, budgetMin: initialBudgetMin || undefined, budgetMax: initialBudgetMax || undefined, ...overrides }; const qs = new URLSearchParams(); for (const [k, v] of Object.entries(base)){ if (v) qs.set(k, v); } return `${pathname}${qs.toString() ? '?' + qs.toString() : ''}`; } function handleModeChange(newMode) { setMode(newMode); setSelectedCategory(''); router.push(buildUrl({ mode: newMode === 'for_me' ? undefined : 'all', category: undefined })); } function handleCategoryChange(slug) { setSelectedCategory(slug); router.push(buildUrl({ category: slug || undefined })); } function handleLocationChange(slug) { setSelectedLocation(slug); router.push(buildUrl({ location: slug || undefined })); } function handleSubmit(e) { e.preventDefault(); const fd = new FormData(e.currentTarget); const budgetMin = fd.get('budgetMin') || undefined; const budgetMax = fd.get('budgetMax') || undefined; router.push(buildUrl({ budgetMin, budgetMax })); } function handleReset() { setQ(''); setSelectedCategory(''); setSelectedLocation(''); router.push(mode === 'for_me' ? '/tasks' : '/tasks?mode=all'); } const forMeLabel = t('find_tasks.for_me'); const allLabel = t('find_tasks.all'); const locAnyLabel = t('create.field.location.any'); const locAllLabel = t('create.field.location.all'); const catPlaceholder = t('filter.category.all'); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 bg-gray-100 p-1 rounded-xl mb-5", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleModeChange('for_me'), className: `flex-1 px-3 py-2 rounded-lg text-sm font-medium transition ${mode === 'for_me' ? 'bg-white text-green-600 shadow-sm' : 'text-gray-600 hover:text-gray-900'}`, children: forMeLabel }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleModeChange('all'), className: `flex-1 px-3 py-2 rounded-lg text-sm font-medium transition ${mode === 'all' ? 'bg-white text-green-600 shadow-sm' : 'text-gray-600 hover:text-gray-900'}`, children: allLabel }) ] }), /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('tasks.search') }), /*#__PURE__*/ _jsx("input", { name: "q", value: q, onChange: (e)=>setQ(e.target.value), placeholder: t('tasks.search.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), mode === 'all' && categories.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.category') }), /*#__PURE__*/ _jsx(TaskCategoryPicker, { categories: categories, locale: catLocale, value: selectedCategory, onChange: handleCategoryChange, placeholder: catPlaceholder }) ] }), locationTree.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.location') }), /*#__PURE__*/ _jsx(TaskLocationPicker, { locations: locationTree, value: selectedLocation, onChange: handleLocationChange, anyLabel: locAnyLabel, allLabel: locAllLabel }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('tasks.field.budget') }), budgetRange.max > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mb-2", children: [ t('tasks.budget.range'), " ", budgetRange.min, "€ — ", budgetRange.max, "€" ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("input", { name: "budgetMin", type: "number", min: 0, defaultValue: initialBudgetMin, placeholder: budgetRange.min ? String(budgetRange.min) : t('tasks.budget.from'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-gray-400 shrink-0", children: "—" }), /*#__PURE__*/ _jsx("input", { name: "budgetMax", type: "number", min: 0, defaultValue: initialBudgetMax, placeholder: budgetRange.max ? String(budgetRange.max) : t('tasks.budget.to'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsx("button", { type: "submit", className: "w-full bg-green-600 text-white py-2 rounded-lg text-sm font-medium hover:bg-green-700", children: t('tasks.search.btn') }), hasFilter && /*#__PURE__*/ _jsxs("button", { type: "button", onClick: handleReset, className: "w-full flex items-center justify-center gap-1.5 py-2 rounded-lg text-sm font-medium text-gray-500 hover:text-gray-700 hover:bg-gray-50 border border-gray-200 transition-colors", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }), t('tasks.filter.reset') ] }) ] }) ] }); }  71133undefined135167undefined169225undefined227271undefined273341undefined343411undefined413419undefined604612(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined638648(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.usePathname)undefined679687(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined823830(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined868875(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined946953(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10311038(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined31593163(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined32203224(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined33703373(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined37893792(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42254229(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined43834387(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined44764479(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined47174720(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined52775281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined53705373(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined56205623(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined56255642_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__/* .TaskCategoryPicker */ .Wundefined60776081(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined61706173(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined64206423(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined64256442_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__/* .TaskLocationPicker */ .Vundefined68496853(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined69426945(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined72127216(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined77427746(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined79217924(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined85478550(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined87838786(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined95059508(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined98139817(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1020910212(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1054110544(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 55255:  import(/* webpackMode: "eager", webpackExports: ["TaskFiltersClient"] */ "/opt/canhelp/apps/web/src/app/tasks/TaskFiltersClient.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["TaskListClient"] */ "/opt/canhelp/apps/web/src/app/tasks/TaskListClient.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["TaskMapDynamic"] */ "/opt/canhelp/apps/web/src/app/tasks/TaskMapDynamic.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["TasksAuthGuard"] */ "/opt/canhelp/apps/web/src/app/tasks/TasksAuthGuard.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["TaskViewToggle"] */ "/opt/canhelp/apps/web/src/app/tasks/TaskViewToggle.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["__esModule","default"] */ "/opt/canhelp/node_modules/next/dist/client/app-dir/link.js"); 0132Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 34052))undefined137263Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 70535))undefined268394Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 97107))undefined399525Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 52386))undefined530656Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 77241))undefined661797Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3498, 23))undefined+,-., /***/ 59983:  0132Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 54586))undefined137263Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 40993))undefined268394Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 8225))undefined399525Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 77556))undefined530656Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 71259))undefined661797Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 94496, 23))undefined-., /***/ 70535: /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskListClient: () => (/* binding */ TaskListClient) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const TaskListClient = registerClientReference( function() { throw new Error("Attempted to call TaskListClient() from the server but TaskListClient is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/TaskListClient.tsx", "TaskListClient", );, /***/ 71259: {/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskViewToggle: () => (/* binding */ TaskViewToggle) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71159); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96484); = /* __next_internal_client_entry_do_not_use__ TaskViewToggle auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useRouter, usePathname, useSearchParams } from 'next/navigation'; import { useLocale } from '@/context/locale'; export function TaskViewToggle({ view }) { const router = useRouter(); const pathname = usePathname(); const searchParams = useSearchParams(); const { locale } = useLocale(); const switchTo = (newView)=>{ const params = new URLSearchParams(searchParams.toString()); if (newView === 'map') { params.set('view', 'map'); } else { params.delete('view'); } params.delete('page'); router.push(`${pathname}${params.toString() ? '?' + params.toString() : ''}`); }; const listLabel = locale === 'ru' ? 'Список' : locale === 'en' ? 'List' : 'Λίστα'; const mapLabel = locale === 'ru' ? 'Карта' : locale === 'en' ? 'Map' : 'Χάρτης'; return /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 bg-white/20 p-1 rounded-xl", children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>switchTo('list'), className: `flex items-center gap-1.5 px-4 py-1.5 rounded-lg text-sm font-medium transition ${view === 'list' ? 'bg-white text-gray-900 shadow-sm' : 'text-white/80 hover:text-white'}`, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 6h16M4 12h16M4 18h16" }) }), listLabel ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>switchTo('map'), className: `flex items-center gap-1.5 px-4 py-1.5 rounded-lg text-sm font-medium transition ${view === 'map' ? 'bg-white text-gray-900 shadow-sm' : 'text-white/80 hover:text-white'}`, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7" }) }), mapLabel ] }) ] }); } d68130undefined132205undefined207251undefined253259undefined315323(0,next_navigation__WEBPACK_IMPORTED_MODULE_1__.useRouter)undefined349359(0,next_navigation__WEBPACK_IMPORTED_MODULE_1__.usePathname)undefined389403(0,next_navigation__WEBPACK_IMPORTED_MODULE_1__.useSearchParams)undefined431439(0,_context_locale__WEBPACK_IMPORTED_MODULE_2__/* .useLocale */ .Y)undefined10031007(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined11241128(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined14521455(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined16921695(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined20542058(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined23802383(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined26202623(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined(), /***/ 77241: /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskViewToggle: () => (/* binding */ TaskViewToggle) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const TaskViewToggle = registerClientReference( function() { throw new Error("Attempted to call TaskViewToggle() from the server but TaskViewToggle is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/TaskViewToggle.tsx", "TaskViewToggle", );, /***/ 77556: /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TasksAuthGuard: () => (/* binding */ TasksAuthGuard) /* harmony export */ }); z/* __next_internal_client_entry_do_not_use__ TasksAuthGuard auto */ export function TasksAuthGuard() { return null; }  6874undefined#$%&'(*+,-./0123, /***/ 97107: /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TaskMapDynamic: () => (/* binding */ TaskMapDynamic) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const TaskMapDynamic = registerClientReference( function() { throw new Error("Attempted to call TaskMapDynamic() from the server but TaskMapDynamic is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/TaskMapDynamic.tsx", "TaskMapDynamic", );3var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [901,652,809,902,331,22], () => (__webpack_exec__(12905))); 4 webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSource`Cwebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceb(() => { var exports = {}; exports.id = 478; exports.ids = [478]; exports.modules = { /***/ 261: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource 'webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Hmodule.exports = require("next/dist/shared/lib/router/utils/app-paths");  /***/ }) buffersourcesizemapshashv/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }) {"finalSource":true}mapbufferedMap ConcatSourceRawSource$/***/ ((module) => { "use strict";  RawSourceHmodule.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }), /***/ 3295:  <webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; ]module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js"); /***/ })  ]module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");, /***/ 10846:  3webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js"); /***/ })  Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");, /***/ 19121:  8webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Ymodule.exports = require("next/dist/server/app-render/action-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/action-async-storage.external.js"); /***/ })  Ymodule.exports = require("next/dist/server/app-render/action-async-storage.external.js");, /***/ 26713:  $webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Emodule.exports = require("next/dist/shared/lib/router/utils/is-bot");  /***/ }) s/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/is-bot"); /***/ })  Emodule.exports = require("next/dist/shared/lib/router/utils/is-bot");, /***/ 27910:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("stream");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("stream"); /***/ })  #module.exports = require("stream");, /***/ 28354:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("util");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("util"); /***/ })  !module.exports = require("util");, /***/ 29021:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; module.exports = require("fs");  /***/ }) M/***/ ((module) => { "use strict"; module.exports = require("fs"); /***/ })  module.exports = require("fs");, /***/ 29294:  6webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-async-storage.external.js"); /***/ })  Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");, /***/ 32589:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Dwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource // EXPORTS __webpack_require__.d(__webpack_exports__, { l: () => (/* binding */ CAPTCHA_ENABLED), $: () => (/* binding */ TurnstileWidget) }); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(78157); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js var react = __webpack_require__(31768); ;// ../../node_modules/@marsidev/react-turnstile/dist/index.js webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource ,webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource'/* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ import { forwardRef as e, useCallback as t, useEffect as n, useImperativeHandle as r, useMemo as i, useRef as a, useState as o } from "react"; import { jsx as s } from "react/jsx-runtime"; var c = /*#__PURE__*/ e(({ as: e = `div`, ...t }, n)=>s(e, { ...t, ref: n })); const l = `https://challenges.cloudflare.com/turnstile/v0/api.js`, u = `cf-turnstile-script`, d = `cf-turnstile`, f = `onloadTurnstileCallback`, p = (e)=>!!document.getElementById(e), m = ({ render: e = `explicit`, onLoadCallbackName: t = f, scriptOptions: { nonce: n = ``, defer: r = !0, async: i = !0, id: a = ``, appendTo: o, onError: s, crossOrigin: c = `` } = {} })=>{ let u = a || `cf-turnstile-script`; if (p(u)) return; let d = document.createElement(`script`); d.id = u, d.src = `${l}?onload=${t}&render=${e}`, !document.querySelector(`script[src="${d.src}"]`) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === `body` ? document.body : document.getElementsByTagName(`head`)[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: `hidden` }, flexible: { minWidth: 300, width: `100%`, height: 65 }, interactionOnly: { width: `fit-content`, height: `auto`, display: `flex` } }; function g(e) { if (e !== `invisible` && e !== `interactionOnly`) return e; } function _(e = u) { let [t, r] = o(!1); return process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && n(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = `unloaded`, y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === `ready` && e(void 0); }), x = (e = f)=>(v === `unloaded` && (v = `loading`, window[e] = ()=>{ y.resolve(), v = `ready`, delete window[e]; }), b), S = /*#__PURE__*/ e((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = `div`, injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = t(()=>P === void 0 ? {} : d.execution === `execute` ? h.invisible : d.appearance === `interaction-only` ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = o(F()), R = a(null), [z, B] = o(!1), V = a(void 0), H = a(!1), U = O || `cf-turnstile`, W = a({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); n(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = u?.id || `cf-turnstile-script`, K = _(G), q = u?.onLoadCallbackName || `onloadTurnstileCallback`, J = d.appearance || `always`, Y = i(()=>({ sitekey: f, action: d.action, cData: d.cData, theme: d.theme || `auto`, language: d.language || `auto`, tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || `auto`, "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || `auto`, "refresh-timeout": d.refreshTimeout || `auto`, execution: d.execution || `render`, appearance: d.appearance || `always`, "feedback-enabled": d.feedbackEnabled ?? !0, callback: (e)=>{ H.current = !0, M ? y?.(e) : W.current.onSuccess?.(e); }, "error-callback": M ? S : (...e)=>W.current.onError?.(...e), "expired-callback": M ? b : (...e)=>W.current.onExpire?.(...e), "before-interactive-callback": M ? C : (...e)=>W.current.onBeforeInteractive?.(...e), "after-interactive-callback": M ? w : (...e)=>W.current.onAfterInteractive?.(...e), "unsupported-callback": M ? T : (...e)=>W.current.onUnsupported?.(...e), "timeout-callback": M ? E : (...e)=>W.current.onTimeout?.(...e) }), [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = t(()=>"undefined" < `u` && !!window.turnstile, []); return n(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), n(function() { v !== `ready` && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), n(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && p?.(V.current)); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), r(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!e?.getResponse || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } return e.getResponse(V.current); }, async getResponsePromise (e = 3e4, t = 100) { return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error(`No response received`)); } catch (e) { return i && clearTimeout(i), console.warn(`Failed to get response`, e), r(Error(`Failed to get response`)); } i ||= setTimeout(()=>{ i && clearTimeout(i), r(Error(`Timeout`)); }, e), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!e?.reset || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } d.execution === `execute` && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn(`Failed to reset Turnstile widget ${V.current}`, e); } }, remove () { if (!e?.remove || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!e?.render || !R.current || !X() || V.current) { console.warn(`Turnstile has not been loaded or container not found`); return; } let t = e.render(R.current, Y); return V.current = t, V.current && p?.(V.current), d.execution !== `execute` && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== `execute`) { console.warn(`Execution mode is not set to "execute"`); return; } if (!e?.execute || !R.current || !V.current || !X()) { console.warn(`Turnstile has not been loaded or container not found`); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !e?.isExpired || !V.current || !X() ? (console.warn(`Turnstile has not been loaded`), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), n(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), n(()=>{ L(F()); }, [ d.execution, P, J ]), n(()=>{ !K || typeof D != `function` || D(); }, [ K ]), s(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = `Turnstile`; export { d as DEFAULT_CONTAINER_ID, f as DEFAULT_ONLOAD_NAME, u as DEFAULT_SCRIPT_ID, l as SCRIPT_URL, S as Turnstile }; `_@XXxxZ Z w w [ !!QQWgl}vv$$0&0&&&&&}''__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(/* unused pure expression or super */ null && ())__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._ false0__WEBPACK_MODULE_REFERENCE__1_5b22757365496d706572617469766548616e646c65225d_call_directImport_asiSafe1__._buffersourcesizemapshashy./* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ var c = /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._(({ as: e = `div`, ...t }, n)=>__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(e, { ...t, ref: n })); const l = `https://challenges.cloudflare.com/turnstile/v0/api.js`, u = `cf-turnstile-script`, d = (/* unused pure expression or super */ null && (`cf-turnstile`)), f = `onloadTurnstileCallback`, p = (e)=>!!document.getElementById(e), m = ({ render: e = `explicit`, onLoadCallbackName: t = f, scriptOptions: { nonce: n = ``, defer: r = !0, async: i = !0, id: a = ``, appendTo: o, onError: s, crossOrigin: c = `` } = {} })=>{ let u = a || `cf-turnstile-script`; if (p(u)) return; let d = document.createElement(`script`); d.id = u, d.src = `${l}?onload=${t}&render=${e}`, !document.querySelector(`script[src="${d.src}"]`) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === `body` ? document.body : document.getElementsByTagName(`head`)[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: `hidden` }, flexible: { minWidth: 300, width: `100%`, height: 65 }, interactionOnly: { width: `fit-content`, height: `auto`, display: `flex` } }; function g(e) { if (e !== `invisible` && e !== `interactionOnly`) return e; } function _(e = u) { let [t, r] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(!1); return process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = `unloaded`, y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === `ready` && e(void 0); }), x = (e = f)=>(v === `unloaded` && (v = `loading`, window[e] = ()=>{ y.resolve(), v = `ready`, delete window[e]; }), b), S = /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = `div`, injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = __WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._(()=>P === void 0 ? {} : d.execution === `execute` ? h.invisible : d.appearance === `interaction-only` ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(F()), R = __WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._(null), [z, B] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(!1), V = __WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._(void 0), H = __WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._(!1), U = O || `cf-turnstile`, W = __WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = u?.id || `cf-turnstile-script`, K = _(G), q = u?.onLoadCallbackName || `onloadTurnstileCallback`, J = d.appearance || `always`, Y = __WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._(()=>({ sitekey: f, action: d.action, cData: d.cData, theme: d.theme || `auto`, language: d.language || `auto`, tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || `auto`, "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || `auto`, "refresh-timeout": d.refreshTimeout || `auto`, execution: d.execution || `render`, appearance: d.appearance || `always`, "feedback-enabled": d.feedbackEnabled ?? !0, callback: (e)=>{ H.current = !0, M ? y?.(e) : W.current.onSuccess?.(e); }, "error-callback": M ? S : (...e)=>W.current.onError?.(...e), "expired-callback": M ? b : (...e)=>W.current.onExpire?.(...e), "before-interactive-callback": M ? C : (...e)=>W.current.onBeforeInteractive?.(...e), "after-interactive-callback": M ? w : (...e)=>W.current.onAfterInteractive?.(...e), "unsupported-callback": M ? T : (...e)=>W.current.onUnsupported?.(...e), "timeout-callback": M ? E : (...e)=>W.current.onTimeout?.(...e) }), [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = __WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._(()=> false && 0, []); return __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(function() { v !== `ready` && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && p?.(V.current)); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), __WEBPACK_MODULE_REFERENCE__1_5b22757365496d706572617469766548616e646c65225d_call_directImport_asiSafe1__._(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!e?.getResponse || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } return e.getResponse(V.current); }, async getResponsePromise (e = 3e4, t = 100) { return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error(`No response received`)); } catch (e) { return i && clearTimeout(i), console.warn(`Failed to get response`, e), r(Error(`Failed to get response`)); } i ||= setTimeout(()=>{ i && clearTimeout(i), r(Error(`Timeout`)); }, e), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!e?.reset || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } d.execution === `execute` && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn(`Failed to reset Turnstile widget ${V.current}`, e); } }, remove () { if (!e?.remove || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!e?.render || !R.current || !X() || V.current) { console.warn(`Turnstile has not been loaded or container not found`); return; } let t = e.render(R.current, Y); return V.current = t, V.current && p?.(V.current), d.execution !== `execute` && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== `execute`) { console.warn(`Execution mode is not set to "execute"`); return; } if (!e?.execute || !R.current || !V.current || !X()) { console.warn(`Turnstile has not been loaded or container not found`); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !e?.isExpired || !V.current || !X() ? (console.warn(`Turnstile has not been loaded`), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ L(F()); }, [ d.execution, P, J ]), __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ !K || typeof D != `function` || D(); }, [ K ]), __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = `Turnstile`; {"finalSource":false}mapbufferedMap ReplaceSourceRawSource'/* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ import { forwardRef as e, useCallback as t, useEffect as n, useImperativeHandle as r, useMemo as i, useRef as a, useState as o } from "react"; import { jsx as s } from "react/jsx-runtime"; var c = /*#__PURE__*/ e(({ as: e = `div`, ...t }, n)=>s(e, { ...t, ref: n })); const l = `https://challenges.cloudflare.com/turnstile/v0/api.js`, u = `cf-turnstile-script`, d = `cf-turnstile`, f = `onloadTurnstileCallback`, p = (e)=>!!document.getElementById(e), m = ({ render: e = `explicit`, onLoadCallbackName: t = f, scriptOptions: { nonce: n = ``, defer: r = !0, async: i = !0, id: a = ``, appendTo: o, onError: s, crossOrigin: c = `` } = {} })=>{ let u = a || `cf-turnstile-script`; if (p(u)) return; let d = document.createElement(`script`); d.id = u, d.src = `${l}?onload=${t}&render=${e}`, !document.querySelector(`script[src="${d.src}"]`) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === `body` ? document.body : document.getElementsByTagName(`head`)[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: `hidden` }, flexible: { minWidth: 300, width: `100%`, height: 65 }, interactionOnly: { width: `fit-content`, height: `auto`, display: `flex` } }; function g(e) { if (e !== `invisible` && e !== `interactionOnly`) return e; } function _(e = u) { let [t, r] = o(!1); return process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && n(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = `unloaded`, y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === `ready` && e(void 0); }), x = (e = f)=>(v === `unloaded` && (v = `loading`, window[e] = ()=>{ y.resolve(), v = `ready`, delete window[e]; }), b), S = /*#__PURE__*/ e((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = `div`, injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = t(()=>P === void 0 ? {} : d.execution === `execute` ? h.invisible : d.appearance === `interaction-only` ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = o(F()), R = a(null), [z, B] = o(!1), V = a(void 0), H = a(!1), U = O || `cf-turnstile`, W = a({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); n(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = u?.id || `cf-turnstile-script`, K = _(G), q = u?.onLoadCallbackName || `onloadTurnstileCallback`, J = d.appearance || `always`, Y = i(()=>({ sitekey: f, action: d.action, cData: d.cData, theme: d.theme || `auto`, language: d.language || `auto`, tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || `auto`, "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || `auto`, "refresh-timeout": d.refreshTimeout || `auto`, execution: d.execution || `render`, appearance: d.appearance || `always`, "feedback-enabled": d.feedbackEnabled ?? !0, callback: (e)=>{ H.current = !0, M ? y?.(e) : W.current.onSuccess?.(e); }, "error-callback": M ? S : (...e)=>W.current.onError?.(...e), "expired-callback": M ? b : (...e)=>W.current.onExpire?.(...e), "before-interactive-callback": M ? C : (...e)=>W.current.onBeforeInteractive?.(...e), "after-interactive-callback": M ? w : (...e)=>W.current.onAfterInteractive?.(...e), "unsupported-callback": M ? T : (...e)=>W.current.onUnsupported?.(...e), "timeout-callback": M ? E : (...e)=>W.current.onTimeout?.(...e) }), [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = t(()=>"undefined" < `u` && !!window.turnstile, []); return n(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), n(function() { v !== `ready` && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), n(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && p?.(V.current)); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), r(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!e?.getResponse || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } return e.getResponse(V.current); }, async getResponsePromise (e = 3e4, t = 100) { return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error(`No response received`)); } catch (e) { return i && clearTimeout(i), console.warn(`Failed to get response`, e), r(Error(`Failed to get response`)); } i ||= setTimeout(()=>{ i && clearTimeout(i), r(Error(`Timeout`)); }, e), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!e?.reset || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } d.execution === `execute` && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn(`Failed to reset Turnstile widget ${V.current}`, e); } }, remove () { if (!e?.remove || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!e?.render || !R.current || !X() || V.current) { console.warn(`Turnstile has not been loaded or container not found`); return; } let t = e.render(R.current, Y); return V.current = t, V.current && p?.(V.current), d.execution !== `execute` && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== `execute`) { console.warn(`Execution mode is not set to "execute"`); return; } if (!e?.execute || !R.current || !V.current || !X()) { console.warn(`Turnstile has not been loaded or container not found`); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !e?.isExpired || !V.current || !X() ? (console.warn(`Turnstile has not been loaded`), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), n(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), n(()=>{ L(F()); }, [ d.execution, P, J ]), n(()=>{ !K || typeof D != `function` || D(); }, [ K ]), s(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = `Turnstile`; export { d as DEFAULT_CONTAINER_ID, f as DEFAULT_ONLOAD_NAME, u as DEFAULT_SCRIPT_ID, l as SCRIPT_URL, S as Turnstile };  133274undefined276320undefined344344__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._undefined376376__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined519518(/* unused pure expression or super */ null && (undefined533532))undefined17541754__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined18231823__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined23942394__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._undefined27312731__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined29352935__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined29472947__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined29652965__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined29762976__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined29912991__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined30273027__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined32163216__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined36173617__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined54575457__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined54635479 falseundefined548455010undefined55205520__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined57715771__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined58815881__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined62626262__WEBPACK_MODULE_REFERENCE__1_5b22757365496d706572617469766548616e646c65225d_call_directImport_asiSafe1__._undefined94499449__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined97769776__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined98599859__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined99399939__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1010910228undefined`__G u @ L  ]l0C&V)M$z>%**5,,,4---(0,react.forwardRef)(0,react_jsx_runtime.jsx)(0,react.useState)(0,react.useEffect)(0,react.useCallback)(0,react.useRef)(0,react.useMemo)(0,react.useImperativeHandle)$ ;// ./src/components/Turnstile.tsx  pwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { Turnstile } from '@marsidev/react-turnstile'; const SITE_KEY = process.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY ?? ''; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ export const CAPTCHA_ENABLED = !!SITE_KEY; export function TurnstileWidget({ onSuccess, onError, onExpire }) { if (!SITE_KEY) return null; return /*#__PURE__*/ _jsx(Turnstile, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); } `UNCInt"0x4AAAAAAC_FtTQJ0_6Cp9-9"0__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__2_5b225475726e7374696c65225d_directImport_asiSafe1__._/* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ const SITE_KEY = "0x4AAAAAAC_FtTQJ0_6Cp9-9" ?? 0; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ const CAPTCHA_ENABLED = !!SITE_KEY; function TurnstileWidget({ onSuccess, onError, onExpire }) { if (!SITE_KEY) return null; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__2_5b225475726e7374696c65225d_directImport_asiSafe1__._, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); }  /* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { Turnstile } from '@marsidev/react-turnstile'; const SITE_KEY = process.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY ?? ''; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ export const CAPTCHA_ENABLED = !!SITE_KEY; export function TurnstileWidget({ onSuccess, onError, onExpire }) { if (!SITE_KEY) return null; return /*#__PURE__*/ _jsx(Turnstile, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); } /85132undefined134187undefined206247"0x4AAAAAAC_FtTQJ0_6Cp9-9"undefined2522530undefined323329undefined366372undefined491494__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined496504__WEBPACK_MODULE_REFERENCE__2_5b225475726e7374696c65225d_directImport_asiSafe1__._undefinedCfSbuffersourcesizemapshash- // EXPORTS __webpack_require__.d(__webpack_exports__, { l: () => (/* binding */ CAPTCHA_ENABLED), $: () => (/* binding */ TurnstileWidget) }); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(78157); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js var react = __webpack_require__(31768); ;// ../../node_modules/@marsidev/react-turnstile/dist/index.js /* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ var c = /*#__PURE__*/ (0,react.forwardRef)(({ as: e = `div`, ...t }, n)=>(0,react_jsx_runtime.jsx)(e, { ...t, ref: n })); const l = `https://challenges.cloudflare.com/turnstile/v0/api.js`, u = `cf-turnstile-script`, d = (/* unused pure expression or super */ null && (`cf-turnstile`)), f = `onloadTurnstileCallback`, p = (e)=>!!document.getElementById(e), m = ({ render: e = `explicit`, onLoadCallbackName: t = f, scriptOptions: { nonce: n = ``, defer: r = !0, async: i = !0, id: a = ``, appendTo: o, onError: s, crossOrigin: c = `` } = {} })=>{ let u = a || `cf-turnstile-script`; if (p(u)) return; let d = document.createElement(`script`); d.id = u, d.src = `${l}?onload=${t}&render=${e}`, !document.querySelector(`script[src="${d.src}"]`) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === `body` ? document.body : document.getElementsByTagName(`head`)[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: `hidden` }, flexible: { minWidth: 300, width: `100%`, height: 65 }, interactionOnly: { width: `fit-content`, height: `auto`, display: `flex` } }; function g(e) { if (e !== `invisible` && e !== `interactionOnly`) return e; } function _(e = u) { let [t, r] = (0,react.useState)(!1); return process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react.useEffect)(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = `unloaded`, y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === `ready` && e(void 0); }), x = (e = f)=>(v === `unloaded` && (v = `loading`, window[e] = ()=>{ y.resolve(), v = `ready`, delete window[e]; }), b), S = /*#__PURE__*/ (0,react.forwardRef)((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = `div`, injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = (0,react.useCallback)(()=>P === void 0 ? {} : d.execution === `execute` ? h.invisible : d.appearance === `interaction-only` ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = (0,react.useState)(F()), R = (0,react.useRef)(null), [z, B] = (0,react.useState)(!1), V = (0,react.useRef)(void 0), H = (0,react.useRef)(!1), U = O || `cf-turnstile`, W = (0,react.useRef)({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); (0,react.useEffect)(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = u?.id || `cf-turnstile-script`, K = _(G), q = u?.onLoadCallbackName || `onloadTurnstileCallback`, J = d.appearance || `always`, Y = (0,react.useMemo)(()=>({ sitekey: f, action: d.action, cData: d.cData, theme: d.theme || `auto`, language: d.language || `auto`, tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || `auto`, "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || `auto`, "refresh-timeout": d.refreshTimeout || `auto`, execution: d.execution || `render`, appearance: d.appearance || `always`, "feedback-enabled": d.feedbackEnabled ?? !0, callback: (e)=>{ H.current = !0, M ? y?.(e) : W.current.onSuccess?.(e); }, "error-callback": M ? S : (...e)=>W.current.onError?.(...e), "expired-callback": M ? b : (...e)=>W.current.onExpire?.(...e), "before-interactive-callback": M ? C : (...e)=>W.current.onBeforeInteractive?.(...e), "after-interactive-callback": M ? w : (...e)=>W.current.onAfterInteractive?.(...e), "unsupported-callback": M ? T : (...e)=>W.current.onUnsupported?.(...e), "timeout-callback": M ? E : (...e)=>W.current.onTimeout?.(...e) }), [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = (0,react.useCallback)(()=> false && 0, []); return (0,react.useEffect)(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), (0,react.useEffect)(function() { v !== `ready` && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), (0,react.useEffect)(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && p?.(V.current)); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), (0,react.useImperativeHandle)(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!e?.getResponse || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } return e.getResponse(V.current); }, async getResponsePromise (e = 3e4, t = 100) { return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error(`No response received`)); } catch (e) { return i && clearTimeout(i), console.warn(`Failed to get response`, e), r(Error(`Failed to get response`)); } i ||= setTimeout(()=>{ i && clearTimeout(i), r(Error(`Timeout`)); }, e), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!e?.reset || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } d.execution === `execute` && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn(`Failed to reset Turnstile widget ${V.current}`, e); } }, remove () { if (!e?.remove || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!e?.render || !R.current || !X() || V.current) { console.warn(`Turnstile has not been loaded or container not found`); return; } let t = e.render(R.current, Y); return V.current = t, V.current && p?.(V.current), d.execution !== `execute` && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== `execute`) { console.warn(`Execution mode is not set to "execute"`); return; } if (!e?.execute || !R.current || !V.current || !X()) { console.warn(`Turnstile has not been loaded or container not found`); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !e?.isExpired || !V.current || !X() ? (console.warn(`Turnstile has not been loaded`), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), (0,react.useEffect)(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), (0,react.useEffect)(()=>{ L(F()); }, [ d.execution, P, J ]), (0,react.useEffect)(()=>{ !K || typeof D != `function` || D(); }, [ K ]), (0,react_jsx_runtime.jsx)(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = `Turnstile`; ;// ./src/components/Turnstile.tsx /* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ const SITE_KEY = "0x4AAAAAAC_FtTQJ0_6Cp9-9" ?? 0; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ const CAPTCHA_ENABLED = !!SITE_KEY; function TurnstileWidget({ onSuccess, onError, onExpire }) { if (!SITE_KEY) return null; return /*#__PURE__*/ (0,react_jsx_runtime.jsx)(S, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); } {"finalSource":true}mapbufferedMap ` ConcatSourceRawSource // EXPORTS __webpack_require__.d(__webpack_exports__, { l: () => (/* binding */ CAPTCHA_ENABLED), $: () => (/* binding */ TurnstileWidget) }); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(78157); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js var react = __webpack_require__(31768); ;// ../../node_modules/@marsidev/react-turnstile/dist/index.js  ReplaceSourceReplaceSourceRawSource'/* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ import { forwardRef as e, useCallback as t, useEffect as n, useImperativeHandle as r, useMemo as i, useRef as a, useState as o } from "react"; import { jsx as s } from "react/jsx-runtime"; var c = /*#__PURE__*/ e(({ as: e = `div`, ...t }, n)=>s(e, { ...t, ref: n })); const l = `https://challenges.cloudflare.com/turnstile/v0/api.js`, u = `cf-turnstile-script`, d = `cf-turnstile`, f = `onloadTurnstileCallback`, p = (e)=>!!document.getElementById(e), m = ({ render: e = `explicit`, onLoadCallbackName: t = f, scriptOptions: { nonce: n = ``, defer: r = !0, async: i = !0, id: a = ``, appendTo: o, onError: s, crossOrigin: c = `` } = {} })=>{ let u = a || `cf-turnstile-script`; if (p(u)) return; let d = document.createElement(`script`); d.id = u, d.src = `${l}?onload=${t}&render=${e}`, !document.querySelector(`script[src="${d.src}"]`) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === `body` ? document.body : document.getElementsByTagName(`head`)[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: `hidden` }, flexible: { minWidth: 300, width: `100%`, height: 65 }, interactionOnly: { width: `fit-content`, height: `auto`, display: `flex` } }; function g(e) { if (e !== `invisible` && e !== `interactionOnly`) return e; } function _(e = u) { let [t, r] = o(!1); return process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && n(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = `unloaded`, y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === `ready` && e(void 0); }), x = (e = f)=>(v === `unloaded` && (v = `loading`, window[e] = ()=>{ y.resolve(), v = `ready`, delete window[e]; }), b), S = /*#__PURE__*/ e((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = `div`, injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = t(()=>P === void 0 ? {} : d.execution === `execute` ? h.invisible : d.appearance === `interaction-only` ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = o(F()), R = a(null), [z, B] = o(!1), V = a(void 0), H = a(!1), U = O || `cf-turnstile`, W = a({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); n(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = u?.id || `cf-turnstile-script`, K = _(G), q = u?.onLoadCallbackName || `onloadTurnstileCallback`, J = d.appearance || `always`, Y = i(()=>({ sitekey: f, action: d.action, cData: d.cData, theme: d.theme || `auto`, language: d.language || `auto`, tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || `auto`, "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || `auto`, "refresh-timeout": d.refreshTimeout || `auto`, execution: d.execution || `render`, appearance: d.appearance || `always`, "feedback-enabled": d.feedbackEnabled ?? !0, callback: (e)=>{ H.current = !0, M ? y?.(e) : W.current.onSuccess?.(e); }, "error-callback": M ? S : (...e)=>W.current.onError?.(...e), "expired-callback": M ? b : (...e)=>W.current.onExpire?.(...e), "before-interactive-callback": M ? C : (...e)=>W.current.onBeforeInteractive?.(...e), "after-interactive-callback": M ? w : (...e)=>W.current.onAfterInteractive?.(...e), "unsupported-callback": M ? T : (...e)=>W.current.onUnsupported?.(...e), "timeout-callback": M ? E : (...e)=>W.current.onTimeout?.(...e) }), [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = t(()=>"undefined" < `u` && !!window.turnstile, []); return n(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), n(function() { v !== `ready` && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), n(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && p?.(V.current)); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), r(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!e?.getResponse || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } return e.getResponse(V.current); }, async getResponsePromise (e = 3e4, t = 100) { return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error(`No response received`)); } catch (e) { return i && clearTimeout(i), console.warn(`Failed to get response`, e), r(Error(`Failed to get response`)); } i ||= setTimeout(()=>{ i && clearTimeout(i), r(Error(`Timeout`)); }, e), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!e?.reset || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } d.execution === `execute` && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn(`Failed to reset Turnstile widget ${V.current}`, e); } }, remove () { if (!e?.remove || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!e?.render || !R.current || !X() || V.current) { console.warn(`Turnstile has not been loaded or container not found`); return; } let t = e.render(R.current, Y); return V.current = t, V.current && p?.(V.current), d.execution !== `execute` && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== `execute`) { console.warn(`Execution mode is not set to "execute"`); return; } if (!e?.execute || !R.current || !V.current || !X()) { console.warn(`Turnstile has not been loaded or container not found`); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !e?.isExpired || !V.current || !X() ? (console.warn(`Turnstile has not been loaded`), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), n(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), n(()=>{ L(F()); }, [ d.execution, P, J ]), n(()=>{ !K || typeof D != `function` || D(); }, [ K ]), s(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = `Turnstile`; export { d as DEFAULT_CONTAINER_ID, f as DEFAULT_ONLOAD_NAME, u as DEFAULT_SCRIPT_ID, l as SCRIPT_URL, S as Turnstile };  133274undefined276320undefined344344__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._undefined376376__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined519518(/* unused pure expression or super */ null && (undefined533532))undefined17541754__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined18231823__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined23942394__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._undefined27312731__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined29352935__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined29472947__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined29652965__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined29762976__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined29912991__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined30273027__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined32163216__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined36173617__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined54575457__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined54635479 falseundefined548455010undefined55205520__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined57715771__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined58815881__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined62626262__WEBPACK_MODULE_REFERENCE__1_5b22757365496d706572617469766548616e646c65225d_call_directImport_asiSafe1__._undefined94499449__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined97769776__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined98599859__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined99399939__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1010910228undefinedT157245(0,react.forwardRef)undefined277351(0,react_jsx_runtime.jsx)undefined17791863(0,react.useState)undefined19322018(0,react.useEffect)undefined25892677(0,react.forwardRef)undefined30143104(0,react.useCallback)undefined33083392(0,react.useState)undefined34043484(0,react.useRef)undefined35023586(0,react.useState)undefined35973677(0,react.useRef)undefined36923772(0,react.useRef)undefined38083888(0,react.useRef)undefined40774163(0,react.useEffect)undefined45644646(0,react.useMemo)undefined64866576(0,react.useCallback)undefined66116697(0,react.useEffect)undefined69487034(0,react.useEffect)undefined71447230(0,react.useEffect)undefined76117717(0,react.useImperativeHandle)undefined1090410990(0,react.useEffect)undefined1131711403(0,react.useEffect)undefined1148611572(0,react.useEffect)undefined1165211726(0,react_jsx_runtime.jsx)undefinedRawSource$ ;// ./src/components/Turnstile.tsx /* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { Turnstile } from '@marsidev/react-turnstile'; const SITE_KEY = process.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY ?? ''; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ export const CAPTCHA_ENABLED = !!SITE_KEY; export function TurnstileWidget({ onSuccess, onError, onExpire }) { if (!SITE_KEY) return null; return /*#__PURE__*/ _jsx(Turnstile, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); } /85132undefined134187undefined206247"0x4AAAAAAC_FtTQJ0_6Cp9-9"undefined2522530undefined323329undefined366372undefined491494__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined496504__WEBPACK_MODULE_REFERENCE__2_5b225475726e7374696c65225d_directImport_asiSafe1__._undefined8358432(0,react_jsx_runtime.jsx)undefined434515Sundefined /***/ }) `_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict";  // EXPORTS __webpack_require__.d(__webpack_exports__, { l: () => (/* binding */ CAPTCHA_ENABLED), $: () => (/* binding */ TurnstileWidget) }); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(78157); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js var react = __webpack_require__(31768); ;// ../../node_modules/@marsidev/react-turnstile/dist/index.js  ReplaceSourceReplaceSourceRawSource'/* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ import { forwardRef as e, useCallback as t, useEffect as n, useImperativeHandle as r, useMemo as i, useRef as a, useState as o } from "react"; import { jsx as s } from "react/jsx-runtime"; var c = /*#__PURE__*/ e(({ as: e = `div`, ...t }, n)=>s(e, { ...t, ref: n })); const l = `https://challenges.cloudflare.com/turnstile/v0/api.js`, u = `cf-turnstile-script`, d = `cf-turnstile`, f = `onloadTurnstileCallback`, p = (e)=>!!document.getElementById(e), m = ({ render: e = `explicit`, onLoadCallbackName: t = f, scriptOptions: { nonce: n = ``, defer: r = !0, async: i = !0, id: a = ``, appendTo: o, onError: s, crossOrigin: c = `` } = {} })=>{ let u = a || `cf-turnstile-script`; if (p(u)) return; let d = document.createElement(`script`); d.id = u, d.src = `${l}?onload=${t}&render=${e}`, !document.querySelector(`script[src="${d.src}"]`) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === `body` ? document.body : document.getElementsByTagName(`head`)[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: `hidden` }, flexible: { minWidth: 300, width: `100%`, height: 65 }, interactionOnly: { width: `fit-content`, height: `auto`, display: `flex` } }; function g(e) { if (e !== `invisible` && e !== `interactionOnly`) return e; } function _(e = u) { let [t, r] = o(!1); return process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && n(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = `unloaded`, y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === `ready` && e(void 0); }), x = (e = f)=>(v === `unloaded` && (v = `loading`, window[e] = ()=>{ y.resolve(), v = `ready`, delete window[e]; }), b), S = /*#__PURE__*/ e((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = `div`, injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = t(()=>P === void 0 ? {} : d.execution === `execute` ? h.invisible : d.appearance === `interaction-only` ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = o(F()), R = a(null), [z, B] = o(!1), V = a(void 0), H = a(!1), U = O || `cf-turnstile`, W = a({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); n(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = u?.id || `cf-turnstile-script`, K = _(G), q = u?.onLoadCallbackName || `onloadTurnstileCallback`, J = d.appearance || `always`, Y = i(()=>({ sitekey: f, action: d.action, cData: d.cData, theme: d.theme || `auto`, language: d.language || `auto`, tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || `auto`, "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || `auto`, "refresh-timeout": d.refreshTimeout || `auto`, execution: d.execution || `render`, appearance: d.appearance || `always`, "feedback-enabled": d.feedbackEnabled ?? !0, callback: (e)=>{ H.current = !0, M ? y?.(e) : W.current.onSuccess?.(e); }, "error-callback": M ? S : (...e)=>W.current.onError?.(...e), "expired-callback": M ? b : (...e)=>W.current.onExpire?.(...e), "before-interactive-callback": M ? C : (...e)=>W.current.onBeforeInteractive?.(...e), "after-interactive-callback": M ? w : (...e)=>W.current.onAfterInteractive?.(...e), "unsupported-callback": M ? T : (...e)=>W.current.onUnsupported?.(...e), "timeout-callback": M ? E : (...e)=>W.current.onTimeout?.(...e) }), [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = t(()=>"undefined" < `u` && !!window.turnstile, []); return n(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), n(function() { v !== `ready` && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), n(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && p?.(V.current)); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), r(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!e?.getResponse || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } return e.getResponse(V.current); }, async getResponsePromise (e = 3e4, t = 100) { return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error(`No response received`)); } catch (e) { return i && clearTimeout(i), console.warn(`Failed to get response`, e), r(Error(`Failed to get response`)); } i ||= setTimeout(()=>{ i && clearTimeout(i), r(Error(`Timeout`)); }, e), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!e?.reset || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } d.execution === `execute` && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn(`Failed to reset Turnstile widget ${V.current}`, e); } }, remove () { if (!e?.remove || !V.current || !X()) { console.warn(`Turnstile has not been loaded`); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!e?.render || !R.current || !X() || V.current) { console.warn(`Turnstile has not been loaded or container not found`); return; } let t = e.render(R.current, Y); return V.current = t, V.current && p?.(V.current), d.execution !== `execute` && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== `execute`) { console.warn(`Execution mode is not set to "execute"`); return; } if (!e?.execute || !R.current || !V.current || !X()) { console.warn(`Turnstile has not been loaded or container not found`); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !e?.isExpired || !V.current || !X() ? (console.warn(`Turnstile has not been loaded`), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), n(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), n(()=>{ L(F()); }, [ d.execution, P, J ]), n(()=>{ !K || typeof D != `function` || D(); }, [ K ]), s(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = `Turnstile`; export { d as DEFAULT_CONTAINER_ID, f as DEFAULT_ONLOAD_NAME, u as DEFAULT_SCRIPT_ID, l as SCRIPT_URL, S as Turnstile };  133274undefined276320undefined344344__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._undefined376376__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined519518(/* unused pure expression or super */ null && (undefined533532))undefined17541754__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined18231823__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined23942394__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._undefined27312731__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined29352935__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined29472947__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined29652965__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined29762976__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined29912991__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined30273027__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined32163216__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined36173617__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined54575457__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined54635479 falseundefined548455010undefined55205520__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined57715771__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined58815881__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined62626262__WEBPACK_MODULE_REFERENCE__1_5b22757365496d706572617469766548616e646c65225d_call_directImport_asiSafe1__._undefined94499449__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined97769776__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined98599859__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined99399939__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1010910228undefinedT157245(0,react.forwardRef)undefined277351(0,react_jsx_runtime.jsx)undefined17791863(0,react.useState)undefined19322018(0,react.useEffect)undefined25892677(0,react.forwardRef)undefined30143104(0,react.useCallback)undefined33083392(0,react.useState)undefined34043484(0,react.useRef)undefined35023586(0,react.useState)undefined35973677(0,react.useRef)undefined36923772(0,react.useRef)undefined38083888(0,react.useRef)undefined40774163(0,react.useEffect)undefined45644646(0,react.useMemo)undefined64866576(0,react.useCallback)undefined66116697(0,react.useEffect)undefined69487034(0,react.useEffect)undefined71447230(0,react.useEffect)undefined76117717(0,react.useImperativeHandle)undefined1090410990(0,react.useEffect)undefined1131711403(0,react.useEffect)undefined1148611572(0,react.useEffect)undefined1165211726(0,react_jsx_runtime.jsx)undefinedRawSource$ ;// ./src/components/Turnstile.tsx /* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { Turnstile } from '@marsidev/react-turnstile'; const SITE_KEY = process.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY ?? ''; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ export const CAPTCHA_ENABLED = !!SITE_KEY; export function TurnstileWidget({ onSuccess, onError, onExpire }) { if (!SITE_KEY) return null; return /*#__PURE__*/ _jsx(Turnstile, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); } /85132undefined134187undefined206247"0x4AAAAAAC_FtTQJ0_6Cp9-9"undefined2522530undefined323329undefined366372undefined491494__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined496504__WEBPACK_MODULE_REFERENCE__2_5b225475726e7374696c65225d_directImport_asiSafe1__._undefined8358432(0,react_jsx_runtime.jsx)undefined434515Sundefined, /***/ 33873:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("path");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("path"); /***/ })  !module.exports = require("path");, /***/ 34631:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("tls");  /***/ }) N/***/ ((module) => { "use strict"; module.exports = require("tls"); /***/ })   module.exports = require("tls");, /***/ 37493:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceRconst module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/tasks/new/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'tasks', { children: [ 'new', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/tasks/new/page.tsx"], }] }, { } ] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/tasks/new/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/tasks/new/page", pathname: "/tasks/new", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/tasks/new/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map @bb{_:S.\^HJ>@_ Y[ N P @ B  5J_(bG%+eg6Gks{_'*j#CPH Q u !"!P!j!"*"X"a"""U#h#($$$_$--,/G/@6Q6666688U888s9{9::::;;;7>y@@DDEEH_HHIOIICMPMTT6VKV[[``bb"b&bbbMdXddde e!g,gYgggi_illrs's2s(u5unuuww}}ՍVm}_4ėӗ™ y:K.Э̮"TXc\wzܿ pwwYkPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 99105))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))__webpack_require__next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModulenext_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind".next"0 falsefalse{}(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERnext_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADER(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)0(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestnext_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponsenext_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T) true(__webpack_require__(33873).join)0next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERnext_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERnext_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARnext_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERnext_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodenext_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSnext_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKind(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)buffersourcesizemapshash__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); const module0 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570)); const module1 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23)); const module2 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506)); const module3 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23)); const module4 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23)); const page5 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 99105)); // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'tasks', { children: [ 'new', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/tasks/new/page.tsx"], }] }, { } ] }, { metadata: { icon: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))).default(props))], apple: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))).default(props))], apple: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/tasks/new/page.tsx"]; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; // Create and export the route module that will be consumed. const routeModule = new next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModule({ definition: { kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, page: "/tasks/new/page", pathname: "/tasks/new", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: ".next" || 0, relativeProjectDir: false || '' }); async function handler(req, res, ctx) { var _this; let srcPage = "/tasks/new/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const initialPostponed = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)(userAgent); const isHtmlBot = (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isPrefetchRSCRequest') ?? req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isRSCRequest') ?? Boolean(req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADER]); const isPossibleServerAction = (0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = (0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = false && 0; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { (0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)(req.headers); } const ComponentMod = { ...next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__, tree, pages, GlobalError: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default()), handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { (0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: (0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequest(req); const nextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (false) {} return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: (0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: true ? (__webpack_require__(33873).join)(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : 0, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = (0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.PRERENDER && (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND) { throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.PAGES, html: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && ((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'renderFallbackShell') || isDebugFallbackShell) ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(matchedSegment, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(cachedData.rscData, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map {"finalSource":true}mapbufferedMap ConcatSourceRawSource#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); ReplaceSourceRawSourceRconst module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/tasks/new/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'tasks', { children: [ 'new', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/tasks/new/page.tsx"], }] }, { } ] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/tasks/new/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/tasks/new/page", pathname: "/tasks/new", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/tasks/new/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map %'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558642Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 99105))undefined645785undefined787901undefined903979undefined9811052undefined10541116undefined11181187undefined11891265undefined12671352undefined13541437undefined14391515undefined15171598undefined16001693undefined16951799undefined18011881undefined18831961undefined19632054undefined20562237undefined22392315undefined23172382undefined23842457undefined24592516undefined25182624undefined26262699undefined27012765undefined27672848undefined33573579Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined36373866Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined44264648Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined47064935Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined51225144undefined51465282undefined52845306undefined53375355__webpack_require__undefined54135419undefined55205646undefined56485733undefined57355848undefined59115917undefined59425959next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined59956003next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined62676302".next"undefined630763080undefined63356373 falseundefined63856391undefined66756695falseundefined66986762{}undefined69086947falseundefined69796992(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined70837096(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined78627877(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined82648273(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined83098324(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined84698482(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined85288554next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined87338746(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined87928801next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined88418865(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined90459064(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined92569363 falseundefined936893820undefined1167811691(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1207612103(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1388813905(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1396513973next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1402414023: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1439214421(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1455314573(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1470714715(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1501515029next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1506915084next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1531215349falseundefined1535215927{}undefined1650516518next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1760517618(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1789717910(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1862918665 trueundefined1866918688(__webpack_require__(33873).join)undefined18767188180undefined1977919792(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2163321646(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2207022091next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2353023544next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2479024807(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2509625107next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2512225126(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2523225243next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2567725688next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2575725768next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2585725868next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2640126412next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2645726471next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2712327131next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2787727898(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2942629440next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2947929490next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2999230005(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3006230083(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3065830666next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3214532159next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3351133534next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3600136014next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3630936323next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3720637229next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3750137522next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3764037661next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3789137906(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3813438145next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3817438196next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3885238867(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3907539086next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3934939362(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3981039823(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4069340714next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4159341614next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4172441745next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4229842315next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4251942542next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4343843453(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4448144496(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4470444715next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4474844770next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4548745599falseundefined4560245952{}undefined4597745992(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4693646947next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4708247097(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4770847735falseundefined4773847808{}undefined4911649130next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined5005450069(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5094450957next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5105651063next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5131951333next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5154551563(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefined /***/ })  #__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); Rconst module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/tasks/new/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'tasks', { children: [ 'new', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/tasks/new/page.tsx"], }] }, { } ] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/tasks/new/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/tasks/new/page", pathname: "/tasks/new", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/tasks/new/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map %'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558642Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 99105))undefined645785undefined787901undefined903979undefined9811052undefined10541116undefined11181187undefined11891265undefined12671352undefined13541437undefined14391515undefined15171598undefined16001693undefined16951799undefined18011881undefined18831961undefined19632054undefined20562237undefined22392315undefined23172382undefined23842457undefined24592516undefined25182624undefined26262699undefined27012765undefined27672848undefined33573579Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined36373866Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined44264648Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined47064935Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined51225144undefined51465282undefined52845306undefined53375355__webpack_require__undefined54135419undefined55205646undefined56485733undefined57355848undefined59115917undefined59425959next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined59956003next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined62676302".next"undefined630763080undefined63356373 falseundefined63856391undefined66756695falseundefined66986762{}undefined69086947falseundefined69796992(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined70837096(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined78627877(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined82648273(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined83098324(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined84698482(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined85288554next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined87338746(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined87928801next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined88418865(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined90459064(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined92569363 falseundefined936893820undefined1167811691(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1207612103(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1388813905(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1396513973next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1402414023: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1439214421(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1455314573(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1470714715(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1501515029next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1506915084next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1531215349falseundefined1535215927{}undefined1650516518next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1760517618(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1789717910(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1862918665 trueundefined1866918688(__webpack_require__(33873).join)undefined18767188180undefined1977919792(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2163321646(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2207022091next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2353023544next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2479024807(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2509625107next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2512225126(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2523225243next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2567725688next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2575725768next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2585725868next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2640126412next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2645726471next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2712327131next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2787727898(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2942629440next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2947929490next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2999230005(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3006230083(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3065830666next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3214532159next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3351133534next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3600136014next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3630936323next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3720637229next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3750137522next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3764037661next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3789137906(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3813438145next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3817438196next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3885238867(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3907539086next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3934939362(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3981039823(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4069340714next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4159341614next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4172441745next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4229842315next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4251942542next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4343843453(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4448144496(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4470444715next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4474844770next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4548745599falseundefined4560245952{}undefined4597745992(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4693646947next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4708247097(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4770847735falseundefined4773847808{}undefined4911649130next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined5005450069(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5094450957next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5105651063next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5131951333next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5154551563(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefined, /***/ 41025:  @webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; amodule.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js");  /***/ }) z/***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js"); /***/ }) {~ amodule.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js");, /***/ 44972:  &webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource7import { jsx as _jsx } from "react/jsx-runtime"; import React, { useEffect, useMemo, useState } from 'react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } export function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return `${API_URL}${icon}`; return icon; } export function CategoryIcon({ icon, alt = '', className, fallback = '📦' }) { const value = (icon || '').trim(); const [hasError, setHasError] = useState(false); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ setHasError(false); }, [ value ]); const url = useMemo(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ _jsx("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ _jsx("span", { className: className, children: fallback }); } return /*#__PURE__*/ _jsx("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ _jsx("span", { className: className, children: value || fallback }); } e/1l~V @FPS| "https://api.canhelp.gr"0(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)buffersourcesizemapshash /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); const API_URL = "https://api.canhelp.gr" || 0; function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return `${API_URL}${icon}`; return icon; } function CategoryIcon({ icon, alt = '', className, fallback = '📦' }) { const value = (icon || '').trim(); const [hasError, setHasError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setHasError(false); }, [ value ]); const url = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: fallback }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: value || fallback }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); ReplaceSourceRawSource7import { jsx as _jsx } from "react/jsx-runtime"; import React, { useEffect, useMemo, useState } from 'react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } export function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return `${API_URL}${icon}`; return icon; } export function CategoryIcon({ icon, alt = '', className, fallback = '📦' }) { const value = (icon || '').trim(); const [hasError, setHasError] = useState(false); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ setHasError(false); }, [ value ]); const url = useMemo(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ _jsx("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ _jsx("span", { className: className, children: fallback }); } return /*#__PURE__*/ _jsx("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ _jsx("span", { className: className, children: value || fallback }); } T047undefined49108undefined126156"https://api.canhelp.gr"undefined1611830undefined186192undefined387393undefined515521undefined669676(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined741749(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined832838(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)undefined11041107(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined14041407(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined15471550(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined17541757(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) qB /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); const API_URL = "https://api.canhelp.gr" || 0; function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return `${API_URL}${icon}`; return icon; } function CategoryIcon({ icon, alt = '', className, fallback = '📦' }) { const value = (icon || '').trim(); const [hasError, setHasError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setHasError(false); }, [ value ]); const url = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: fallback }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: value || fallback }); } /***/ }) ru  vv/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); 7import { jsx as _jsx } from "react/jsx-runtime"; import React, { useEffect, useMemo, useState } from 'react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } export function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return `${API_URL}${icon}`; return icon; } export function CategoryIcon({ icon, alt = '', className, fallback = '📦' }) { const value = (icon || '').trim(); const [hasError, setHasError] = useState(false); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ setHasError(false); }, [ value ]); const url = useMemo(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ _jsx("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ _jsx("span", { className: className, children: fallback }); } return /*#__PURE__*/ _jsx("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ _jsx("span", { className: className, children: value || fallback }); } T047undefined49108undefined126156"https://api.canhelp.gr"undefined1611830undefined186192undefined387393undefined515521undefined669676(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined741749(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined832838(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)undefined11041107(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined14041407(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined15471550(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined17541757(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefineduw, /***/ 49598:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ V: () => (/* binding */ formatLastSeen) /* harmony export */ }); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceWexport function formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); } buffersourcesizemapshash/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ V: () => (/* binding */ formatLastSeen) /* harmony export */ }); function formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ V: () => (/* binding */ formatLastSeen) /* harmony export */ }); ReplaceSourceRawSourceWexport function formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); }  06undefined /***/ }) f mm/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ V: () => (/* binding */ formatLastSeen) /* harmony export */ }); Wexport function formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); }  06undefinedln, /***/ 55511:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("crypto");  /***/ }) ]Q/***/ ((module) => { "use strict"; module.exports = require("crypto"); /***/ }) ^a bcd#module.exports = require("crypto");ce, /***/ 55591:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; "module.exports = require("https");  /***/ }) TP/***/ ((module) => { "use strict"; module.exports = require("https"); /***/ }) UX YZ["module.exports = require("https");Z\, /***/ 63033:  ;webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; \module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");  /***/ }) K/***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js"); /***/ }) LO PQR\module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");QS, /***/ 63807:  Cwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ CreateTaskPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13260); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(96484); /* harmony import */ var _context_location__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(56003); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(91864); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(48178); /* harmony import */ var _lib_formatLastSeen__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(49598); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(53863); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(88142); /* harmony import */ var _components_Turnstile__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(32589); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect, useRef } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { useLocation } from '@/context/location'; import { createTask, getCategories, getLocations, getSpecialists } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { TaskLocationPicker } from '@/components/TaskLocationPicker'; import { TaskCategoryPicker } from '@/components/TaskCategoryPicker'; import { TurnstileWidget } from '@/components/Turnstile'; import { CAPTCHA_ENABLED } from '@/components/Turnstile'; const API = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const localISO = (d)=>{ const y = d.getFullYear(); const m = String(d.getMonth() + 1).padStart(2, '0'); const day = String(d.getDate()).padStart(2, '0'); return `${y}-${m}-${day}`; }; export default function CreateTaskPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const searchParams = useSearchParams(); const preselectedCategory = searchParams.get('category') ?? ''; const { t, locale } = useLocale(); const [categories, setCategories] = useState([]); const [locations, setLocations] = useState([]); const [loading, setLoading] = useState(false); const [error, setError] = useState(''); const [topSpecialists, setTopSpecialists] = useState([]); const [deadline, setDeadline] = useState(()=>{ const d = new Date(); d.setDate(d.getDate() + 1); return localISO(d); }); const [expiresAtDays, setExpiresAtDays] = useState(30); const [calendarMonth, setCalendarMonth] = useState(()=>{ const d = new Date(); d.setDate(d.getDate() + 1); return localISO(d).slice(0, 7); }); const calendarInputRef = useRef(null); const [specialistAvailMap, setSpecialistAvailMap] = useState({}); const [invitedIds, setInvitedIds] = useState(new Set()); const [captchaToken, setCaptchaToken] = useState(CAPTCHA_ENABLED ? '' : 'dev'); const { locationSlug: ctxLocation } = useLocation(); const [selectedLocation, setSelectedLocation] = useState(''); const [selectedCategory, setSelectedCategory] = useState(preselectedCategory); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (ctxLocation) setSelectedLocation(ctxLocation); }, [ ctxLocation ]); const [images, setImages] = useState([]); const [photoUploading, setPhotoUploading] = useState(false); const fileInputRef = useRef(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isPending && !session) router.push('/login'); getCategories().then(setCategories).catch(()=>{}); getLocations().then(setLocations).catch(()=>{}); }, [ session, isPending ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!selectedCategory) { setTopSpecialists([]); return; } getSpecialists({ limit: '5', category: selectedCategory, locale }).then((r)=>setTopSpecialists(r.data)).catch(()=>{}); }, [ selectedCategory, locale ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!deadline || topSpecialists.length === 0) return; const month = deadline.slice(0, 7); const ids = topSpecialists.map((u)=>u.id); Promise.all(ids.map((id)=>fetch(`${API}/api/availability/user/${id}?month=${month}`, { credentials: 'include' }).then((r)=>r.ok ? r.json() : []).then((rows)=>{ const row = rows.find((r)=>r.date === deadline); return { id, status: row?.status ?? null }; }).catch(()=>({ id, status: null })))).then((results)=>{ const map = {}; results.forEach(({ id, status })=>{ map[id] = status; }); setSpecialistAvailMap(map); }); }, [ deadline, topSpecialists ]); async function handlePhotoChange(e) { const file = e.target.files?.[0]; if (!file) return; setPhotoUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch(`${API}/api/uploads`, { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); setImages((prev)=>[ ...prev, `${API}${url}` ]); } catch { setError(t('profile.upload.error')); } finally{ setPhotoUploading(false); if (fileInputRef.current) fileInputRef.current.value = ''; } } async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); const form = new FormData(e.currentTarget); const data = { title: form.get('title'), description: form.get('description'), category: form.get('category') || undefined, location: form.get('location') || undefined, budget: form.get('budget') ? Number(form.get('budget')) : undefined, budgetNegotiable: form.get('budgetNegotiable') === 'on', deadline: form.get('deadline') ? new Date(form.get('deadline')).toISOString() : undefined, expiresAt: (()=>{ const d = new Date(); d.setDate(d.getDate() + Number(form.get('expiresAtDays') || 30)); return d.toISOString(); })(), timeSlot: form.get('timeSlot') || undefined, district: form.get('district') || undefined, street: form.get('street') || undefined, houseNumber: form.get('houseNumber') || undefined, confidentialNote: form.get('confidentialNote') || undefined, images: images.length > 0 ? images : undefined, status: 'open', locale: locale, inviteSpecialistIds: invitedIds.size > 0 ? [ ...invitedIds ] : undefined }; try { const task = await createTask({ ...data, captchaToken }); router.push(`/tasks/${task.id}`); } catch (err) { setError(err.message || t('create.error')); } finally{ setLoading(false); } } if (isPending) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const todayMidnight = new Date(); todayMidnight.setHours(0, 0, 0, 0); const [cmYear, cmMonth] = calendarMonth.split('-').map(Number); const daysInMonth = new Date(cmYear, cmMonth, 0).getDate(); const calendarDates = []; for(let day = 1; day <= daysInMonth; day++){ const d = new Date(cmYear, cmMonth - 1, day); if (d >= todayMidnight) calendarDates.push(d); } const monthOptions = Array.from({ length: 12 }, (_, i)=>{ const d = new Date(); d.setDate(1); d.setMonth(d.getMonth() + i); return { value: localISO(d).slice(0, 7), label: d.toLocaleDateString(dateLocale, { month: 'long', year: 'numeric' }) }; }); const sidebarTitle = t('tasks.new.top_specialists'); return /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-3 sm:px-4 py-6 sm:py-8", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-xl sm:text-2xl font-bold text-white mb-4 sm:mb-6", children: t('create.title') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col lg:flex-row gap-6 lg:gap-8 items-start", children: [ /*#__PURE__*/ _jsx("div", { className: "flex-1 min-w-0 w-full", children: /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "bg-white rounded-xl border border-gray-200 p-4 sm:p-6 space-y-4 sm:space-y-5", children: [ error && /*#__PURE__*/ _jsx("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 sm:gap-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.category') }), /*#__PURE__*/ _jsx(TaskCategoryPicker, { categories: categories, locale: catLocale, value: selectedCategory, onChange: setSelectedCategory, placeholder: t('create.field.category.select') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.location') }), /*#__PURE__*/ _jsx(TaskLocationPicker, { locations: locations, value: selectedLocation, onChange: setSelectedLocation, anyLabel: t('create.field.location.any'), allLabel: t('create.field.location.all') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.title'), " ", /*#__PURE__*/ _jsx("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ _jsx("input", { name: "title", required: true, minLength: 5, maxLength: 200, placeholder: t('create.field.title.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.description'), " ", /*#__PURE__*/ _jsx("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ _jsx("textarea", { name: "description", required: true, minLength: 20, rows: 4, placeholder: t('create.field.description.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.budget') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3", children: [ /*#__PURE__*/ _jsx("input", { name: "budget", type: "number", min: 1, step: 1, placeholder: t('create.field.budget.placeholder'), className: "w-full sm:flex-1 border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-1.5 cursor-pointer select-none", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", name: "budgetNegotiable", className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('create.field.budget_negotiable') }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-2", children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm font-medium text-gray-700 shrink-0", children: t('create.field.deadline') }), /*#__PURE__*/ _jsx("select", { value: calendarMonth, onChange: (e)=>setCalendarMonth(e.target.value), className: "flex-1 border border-gray-300 rounded-lg px-2 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: monthOptions.map((mo)=>/*#__PURE__*/ _jsx("option", { value: mo.value, children: mo.label }, mo.value)) }), /*#__PURE__*/ _jsx("button", { type: "button", title: "Открыть календарь", onClick: ()=>{ try { calendarInputRef.current?.showPicker(); } catch { calendarInputRef.current?.click(); } }, className: "shrink-0 w-8 h-8 flex items-center justify-center rounded-lg border border-gray-300 text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: /*#__PURE__*/ _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }), /*#__PURE__*/ _jsx("line", { x1: "16", y1: "2", x2: "16", y2: "6" }), /*#__PURE__*/ _jsx("line", { x1: "8", y1: "2", x2: "8", y2: "6" }), /*#__PURE__*/ _jsx("line", { x1: "3", y1: "10", x2: "21", y2: "10" }) ] }) }), /*#__PURE__*/ _jsx("input", { ref: calendarInputRef, type: "date", min: localISO(todayMidnight), value: deadline, onChange: (e)=>{ if (!e.target.value) return; setDeadline(e.target.value); setCalendarMonth(e.target.value.slice(0, 7)); }, className: "absolute w-0 h-0 opacity-0 pointer-events-none" }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex gap-2 overflow-x-auto pb-1 snap-x snap-mandatory", children: calendarDates.map((d)=>{ const iso = localISO(d); const isSelected = deadline === iso; const dayName = d.toLocaleDateString(dateLocale, { weekday: 'short' }); const dayNum = d.getDate(); return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setDeadline(iso), className: `flex-shrink-0 snap-start flex flex-col items-center justify-center w-14 h-16 rounded-xl border-2 transition select-none ${isSelected ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-700 hover:border-green-300 hover:bg-gray-50'}`, children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium uppercase leading-none mb-0.5", children: dayName }), /*#__PURE__*/ _jsx("span", { className: "text-xl font-bold leading-none", children: dayNum }) ] }, iso); }) }), /*#__PURE__*/ _jsx("input", { type: "hidden", name: "deadline", value: deadline }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.expires_at') }), /*#__PURE__*/ _jsx("div", { className: "flex gap-2", children: [ 7, 14, 30, 60 ].map((days)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setExpiresAtDays(days), className: `flex-1 py-2 rounded-lg border-2 text-sm font-medium transition select-none ${expiresAtDays === days ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-700 hover:border-green-300'}`, children: [ days, " ", t('create.field.expires_at.days').replace('{n}', '') ] }, days)) }), /*#__PURE__*/ _jsx("input", { type: "hidden", name: "expiresAtDays", value: expiresAtDays }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.time_slot') }), /*#__PURE__*/ _jsxs("select", { name: "timeSlot", className: "w-full border border-gray-300 rounded-lg px-3 py-2", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('create.field.time_slot.any') }), /*#__PURE__*/ _jsx("option", { value: "morning", children: t('create.field.time_slot.morning') }), /*#__PURE__*/ _jsx("option", { value: "afternoon", children: t('create.field.time_slot.afternoon') }), /*#__PURE__*/ _jsx("option", { value: "evening", children: t('create.field.time_slot.evening') }), /*#__PURE__*/ _jsx("option", { value: "weekend", children: t('create.field.time_slot.weekend') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.photos') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-2 mb-2", children: [ images.map((url, i)=>/*#__PURE__*/ _jsxs("div", { className: "relative w-20 h-20 rounded-lg overflow-hidden border border-gray-200", children: [ /*#__PURE__*/ _jsx("img", { src: url, alt: "", className: "w-full h-full object-cover" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setImages((prev)=>prev.filter((_, j)=>j !== i)), className: "absolute top-0.5 right-0.5 bg-black/50 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs hover:bg-black/70", children: "\xd7" }) ] }, i)), images.length < 5 && /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>fileInputRef.current?.click(), disabled: photoUploading, className: "w-20 h-20 border-2 border-dashed border-gray-300 rounded-lg flex flex-col items-center justify-center text-gray-400 hover:border-green-400 hover:text-gray-400 text-xs disabled:opacity-50", children: photoUploading ? '...' : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl leading-none", children: "+" }), /*#__PURE__*/ _jsx("span", { children: t('create.field.photos.add') }) ] }) }) ] }), /*#__PURE__*/ _jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", className: "hidden", onChange: handlePhotoChange }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-3 p-3 bg-yellow-50 border border-yellow-200 rounded-xl", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-xs font-medium text-yellow-700 flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" }) }), "\uD83D\uDD12 ", t('create.field.confidential.hint') ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.address') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-2 sm:gap-3", children: [ /*#__PURE__*/ _jsx("input", { name: "district", placeholder: t('create.field.address.district'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }), /*#__PURE__*/ _jsx("input", { name: "street", placeholder: t('create.field.address.street'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }), /*#__PURE__*/ _jsx("input", { name: "houseNumber", placeholder: t('create.field.address.house'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.confidential') }), /*#__PURE__*/ _jsx("textarea", { name: "confidentialNote", rows: 2, placeholder: t('create.field.confidential.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none bg-white" }) ] }) ] }), /*#__PURE__*/ _jsx(TurnstileWidget, { onSuccess: setCaptchaToken, onError: ()=>setCaptchaToken(''), onExpire: ()=>setCaptchaToken('') }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: loading || !captchaToken, className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed", children: loading ? t('create.submitting') : t('create.submit') }) ] }) }), /*#__PURE__*/ _jsx("aside", { className: "hidden lg:block lg:w-64 shrink-0", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 mb-4 text-sm", children: sidebarTitle }), !selectedCategory ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 text-center py-4", children: t('tasks.new.select_category') }) : topSpecialists.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 text-center py-4", children: t('specialists.empty') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: topSpecialists.map((u)=>{ const name = formatShortName(u.firstName, u.lastName, u.name); const initials = `${u.firstName?.[0] ?? ''}${u.lastName?.[0] ?? ''}`.toUpperCase() || u.name?.[0]?.toUpperCase() || '?'; const seen = formatLastSeen(u.lastSeenAt, t); const avail = specialistAvailMap[u.id]; const isInvited = invitedIds.has(u.id); return /*#__PURE__*/ _jsxs("div", { className: "rounded-lg border border-gray-100 hover:bg-gray-50 transition", children: [ /*#__PURE__*/ _jsxs(Link, { href: `/users/${u.id}`, target: "_blank", rel: "noopener noreferrer", className: "flex items-center gap-3 p-2", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: u.image ? /*#__PURE__*/ _jsx("img", { src: u.image, alt: name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-900 truncate", children: name }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 flex-wrap", children: [ u.rating ? /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-500", children: [ "★ ", Number(u.rating).toFixed(1) ] }) : seen ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: seen }) : null, typeof u.reviewCount === 'number' && u.reviewCount > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400", children: [ u.reviewCount, " ", t('reviews.count') ] }), typeof u.positivePercent === 'number' && u.reviewCount > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-green-600", children: [ u.positivePercent, "% \uD83D\uDC4D" ] }), avail === 'available' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-0.5 text-xs font-medium text-green-700 bg-green-100 px-1.5 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), avail === 'busy' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-0.5 text-xs font-medium text-red-700 bg-red-100 px-1.5 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "px-2 pb-2", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setInvitedIds((prev)=>{ const next = new Set(prev); if (next.has(u.id)) next.delete(u.id); else next.add(u.id); return next; }), className: `w-full text-xs font-medium py-1 rounded-lg transition ${isInvited ? 'bg-green-600 text-white hover:bg-green-700' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'}`, children: isInvited ? t('tasks.new.invited') : t('tasks.new.invite') }) }) ] }, u.id); }) }) ] }) }) ] }) ] }); } @`=_#%LNz|57ln24lz~_'#*RYel?D_   N X ) 1 ! & f n  &_} !!S"V"""##$$%%6&9&''''))y*|*++++._../h0k011i4m444P6S677f:j:::<<<<??@@SBVBDDE_EEE:G=GIIuJxJ9N=NPPSSTT|VVXX\\__bbscvcsevef_fQgTg}hhj"jmmSoWooopp&r)rFsIsqtttuuvvxxxy%z)z{_{;|>|}}րـ;?AI܃߃'*Y]__bfiil"&ɝ̝Νܝ8;átw;IC_PAE>BDGcf>B<?'**-DVY"https://api.canhelp.gr"0(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)_components_Turnstile__WEBPACK_IMPORTED_MODULE_10__/* .CAPTCHA_ENABLED */ .l(0,_context_location__WEBPACK_IMPORTED_MODULE_6__/* .useLocation */ .z)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getCategories */ .bW)(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getLocations */ .Vs)(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getSpecialists */ .F7)(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .createTask */ .UT)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_9__/* .TaskCategoryPicker */ .W_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_8__/* .TaskLocationPicker */ .Vreact_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment_components_Turnstile__WEBPACK_IMPORTED_MODULE_10__/* .TurnstileWidget */ .$(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_11__/* .formatShortName */ .H)(0,_lib_formatLastSeen__WEBPACK_IMPORTED_MODULE_12__/* .formatLastSeen */ .V)(next_link__WEBPACK_IMPORTED_MODULE_3___default())buffersourcesizemapshashConcatSourceRawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ CreateTaskPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13260); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(96484); /* harmony import */ var _context_location__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(56003); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(91864); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(48178); /* harmony import */ var _lib_formatLastSeen__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(49598); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(53863); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(88142); /* harmony import */ var _components_Turnstile__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(32589); ReplaceSourceRawSource/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect, useRef } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { useLocation } from '@/context/location'; import { createTask, getCategories, getLocations, getSpecialists } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { TaskLocationPicker } from '@/components/TaskLocationPicker'; import { TaskCategoryPicker } from '@/components/TaskCategoryPicker'; import { TurnstileWidget } from '@/components/Turnstile'; import { CAPTCHA_ENABLED } from '@/components/Turnstile'; const API = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const localISO = (d)=>{ const y = d.getFullYear(); const m = String(d.getMonth() + 1).padStart(2, '0'); const day = String(d.getDate()).padStart(2, '0'); return `${y}-${m}-${day}`; }; export default function CreateTaskPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const searchParams = useSearchParams(); const preselectedCategory = searchParams.get('category') ?? ''; const { t, locale } = useLocale(); const [categories, setCategories] = useState([]); const [locations, setLocations] = useState([]); const [loading, setLoading] = useState(false); const [error, setError] = useState(''); const [topSpecialists, setTopSpecialists] = useState([]); const [deadline, setDeadline] = useState(()=>{ const d = new Date(); d.setDate(d.getDate() + 1); return localISO(d); }); const [expiresAtDays, setExpiresAtDays] = useState(30); const [calendarMonth, setCalendarMonth] = useState(()=>{ const d = new Date(); d.setDate(d.getDate() + 1); return localISO(d).slice(0, 7); }); const calendarInputRef = useRef(null); const [specialistAvailMap, setSpecialistAvailMap] = useState({}); const [invitedIds, setInvitedIds] = useState(new Set()); const [captchaToken, setCaptchaToken] = useState(CAPTCHA_ENABLED ? '' : 'dev'); const { locationSlug: ctxLocation } = useLocation(); const [selectedLocation, setSelectedLocation] = useState(''); const [selectedCategory, setSelectedCategory] = useState(preselectedCategory); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (ctxLocation) setSelectedLocation(ctxLocation); }, [ ctxLocation ]); const [images, setImages] = useState([]); const [photoUploading, setPhotoUploading] = useState(false); const fileInputRef = useRef(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isPending && !session) router.push('/login'); getCategories().then(setCategories).catch(()=>{}); getLocations().then(setLocations).catch(()=>{}); }, [ session, isPending ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!selectedCategory) { setTopSpecialists([]); return; } getSpecialists({ limit: '5', category: selectedCategory, locale }).then((r)=>setTopSpecialists(r.data)).catch(()=>{}); }, [ selectedCategory, locale ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!deadline || topSpecialists.length === 0) return; const month = deadline.slice(0, 7); const ids = topSpecialists.map((u)=>u.id); Promise.all(ids.map((id)=>fetch(`${API}/api/availability/user/${id}?month=${month}`, { credentials: 'include' }).then((r)=>r.ok ? r.json() : []).then((rows)=>{ const row = rows.find((r)=>r.date === deadline); return { id, status: row?.status ?? null }; }).catch(()=>({ id, status: null })))).then((results)=>{ const map = {}; results.forEach(({ id, status })=>{ map[id] = status; }); setSpecialistAvailMap(map); }); }, [ deadline, topSpecialists ]); async function handlePhotoChange(e) { const file = e.target.files?.[0]; if (!file) return; setPhotoUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch(`${API}/api/uploads`, { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); setImages((prev)=>[ ...prev, `${API}${url}` ]); } catch { setError(t('profile.upload.error')); } finally{ setPhotoUploading(false); if (fileInputRef.current) fileInputRef.current.value = ''; } } async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); const form = new FormData(e.currentTarget); const data = { title: form.get('title'), description: form.get('description'), category: form.get('category') || undefined, location: form.get('location') || undefined, budget: form.get('budget') ? Number(form.get('budget')) : undefined, budgetNegotiable: form.get('budgetNegotiable') === 'on', deadline: form.get('deadline') ? new Date(form.get('deadline')).toISOString() : undefined, expiresAt: (()=>{ const d = new Date(); d.setDate(d.getDate() + Number(form.get('expiresAtDays') || 30)); return d.toISOString(); })(), timeSlot: form.get('timeSlot') || undefined, district: form.get('district') || undefined, street: form.get('street') || undefined, houseNumber: form.get('houseNumber') || undefined, confidentialNote: form.get('confidentialNote') || undefined, images: images.length > 0 ? images : undefined, status: 'open', locale: locale, inviteSpecialistIds: invitedIds.size > 0 ? [ ...invitedIds ] : undefined }; try { const task = await createTask({ ...data, captchaToken }); router.push(`/tasks/${task.id}`); } catch (err) { setError(err.message || t('create.error')); } finally{ setLoading(false); } } if (isPending) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const todayMidnight = new Date(); todayMidnight.setHours(0, 0, 0, 0); const [cmYear, cmMonth] = calendarMonth.split('-').map(Number); const daysInMonth = new Date(cmYear, cmMonth, 0).getDate(); const calendarDates = []; for(let day = 1; day <= daysInMonth; day++){ const d = new Date(cmYear, cmMonth - 1, day); if (d >= todayMidnight) calendarDates.push(d); } const monthOptions = Array.from({ length: 12 }, (_, i)=>{ const d = new Date(); d.setDate(1); d.setMonth(d.getMonth() + i); return { value: localISO(d).slice(0, 7), label: d.toLocaleDateString(dateLocale, { month: 'long', year: 'numeric' }) }; }); const sidebarTitle = t('tasks.new.top_specialists'); return /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-3 sm:px-4 py-6 sm:py-8", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-xl sm:text-2xl font-bold text-white mb-4 sm:mb-6", children: t('create.title') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col lg:flex-row gap-6 lg:gap-8 items-start", children: [ /*#__PURE__*/ _jsx("div", { className: "flex-1 min-w-0 w-full", children: /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "bg-white rounded-xl border border-gray-200 p-4 sm:p-6 space-y-4 sm:space-y-5", children: [ error && /*#__PURE__*/ _jsx("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 sm:gap-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.category') }), /*#__PURE__*/ _jsx(TaskCategoryPicker, { categories: categories, locale: catLocale, value: selectedCategory, onChange: setSelectedCategory, placeholder: t('create.field.category.select') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.location') }), /*#__PURE__*/ _jsx(TaskLocationPicker, { locations: locations, value: selectedLocation, onChange: setSelectedLocation, anyLabel: t('create.field.location.any'), allLabel: t('create.field.location.all') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.title'), " ", /*#__PURE__*/ _jsx("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ _jsx("input", { name: "title", required: true, minLength: 5, maxLength: 200, placeholder: t('create.field.title.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.description'), " ", /*#__PURE__*/ _jsx("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ _jsx("textarea", { name: "description", required: true, minLength: 20, rows: 4, placeholder: t('create.field.description.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.budget') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3", children: [ /*#__PURE__*/ _jsx("input", { name: "budget", type: "number", min: 1, step: 1, placeholder: t('create.field.budget.placeholder'), className: "w-full sm:flex-1 border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-1.5 cursor-pointer select-none", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", name: "budgetNegotiable", className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('create.field.budget_negotiable') }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-2", children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm font-medium text-gray-700 shrink-0", children: t('create.field.deadline') }), /*#__PURE__*/ _jsx("select", { value: calendarMonth, onChange: (e)=>setCalendarMonth(e.target.value), className: "flex-1 border border-gray-300 rounded-lg px-2 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: monthOptions.map((mo)=>/*#__PURE__*/ _jsx("option", { value: mo.value, children: mo.label }, mo.value)) }), /*#__PURE__*/ _jsx("button", { type: "button", title: "Открыть календарь", onClick: ()=>{ try { calendarInputRef.current?.showPicker(); } catch { calendarInputRef.current?.click(); } }, className: "shrink-0 w-8 h-8 flex items-center justify-center rounded-lg border border-gray-300 text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: /*#__PURE__*/ _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }), /*#__PURE__*/ _jsx("line", { x1: "16", y1: "2", x2: "16", y2: "6" }), /*#__PURE__*/ _jsx("line", { x1: "8", y1: "2", x2: "8", y2: "6" }), /*#__PURE__*/ _jsx("line", { x1: "3", y1: "10", x2: "21", y2: "10" }) ] }) }), /*#__PURE__*/ _jsx("input", { ref: calendarInputRef, type: "date", min: localISO(todayMidnight), value: deadline, onChange: (e)=>{ if (!e.target.value) return; setDeadline(e.target.value); setCalendarMonth(e.target.value.slice(0, 7)); }, className: "absolute w-0 h-0 opacity-0 pointer-events-none" }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex gap-2 overflow-x-auto pb-1 snap-x snap-mandatory", children: calendarDates.map((d)=>{ const iso = localISO(d); const isSelected = deadline === iso; const dayName = d.toLocaleDateString(dateLocale, { weekday: 'short' }); const dayNum = d.getDate(); return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setDeadline(iso), className: `flex-shrink-0 snap-start flex flex-col items-center justify-center w-14 h-16 rounded-xl border-2 transition select-none ${isSelected ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-700 hover:border-green-300 hover:bg-gray-50'}`, children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium uppercase leading-none mb-0.5", children: dayName }), /*#__PURE__*/ _jsx("span", { className: "text-xl font-bold leading-none", children: dayNum }) ] }, iso); }) }), /*#__PURE__*/ _jsx("input", { type: "hidden", name: "deadline", value: deadline }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.expires_at') }), /*#__PURE__*/ _jsx("div", { className: "flex gap-2", children: [ 7, 14, 30, 60 ].map((days)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setExpiresAtDays(days), className: `flex-1 py-2 rounded-lg border-2 text-sm font-medium transition select-none ${expiresAtDays === days ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-700 hover:border-green-300'}`, children: [ days, " ", t('create.field.expires_at.days').replace('{n}', '') ] }, days)) }), /*#__PURE__*/ _jsx("input", { type: "hidden", name: "expiresAtDays", value: expiresAtDays }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.time_slot') }), /*#__PURE__*/ _jsxs("select", { name: "timeSlot", className: "w-full border border-gray-300 rounded-lg px-3 py-2", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('create.field.time_slot.any') }), /*#__PURE__*/ _jsx("option", { value: "morning", children: t('create.field.time_slot.morning') }), /*#__PURE__*/ _jsx("option", { value: "afternoon", children: t('create.field.time_slot.afternoon') }), /*#__PURE__*/ _jsx("option", { value: "evening", children: t('create.field.time_slot.evening') }), /*#__PURE__*/ _jsx("option", { value: "weekend", children: t('create.field.time_slot.weekend') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.photos') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-2 mb-2", children: [ images.map((url, i)=>/*#__PURE__*/ _jsxs("div", { className: "relative w-20 h-20 rounded-lg overflow-hidden border border-gray-200", children: [ /*#__PURE__*/ _jsx("img", { src: url, alt: "", className: "w-full h-full object-cover" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setImages((prev)=>prev.filter((_, j)=>j !== i)), className: "absolute top-0.5 right-0.5 bg-black/50 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs hover:bg-black/70", children: "\xd7" }) ] }, i)), images.length < 5 && /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>fileInputRef.current?.click(), disabled: photoUploading, className: "w-20 h-20 border-2 border-dashed border-gray-300 rounded-lg flex flex-col items-center justify-center text-gray-400 hover:border-green-400 hover:text-gray-400 text-xs disabled:opacity-50", children: photoUploading ? '...' : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl leading-none", children: "+" }), /*#__PURE__*/ _jsx("span", { children: t('create.field.photos.add') }) ] }) }) ] }), /*#__PURE__*/ _jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", className: "hidden", onChange: handlePhotoChange }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-3 p-3 bg-yellow-50 border border-yellow-200 rounded-xl", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-xs font-medium text-yellow-700 flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" }) }), "\uD83D\uDD12 ", t('create.field.confidential.hint') ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.address') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-2 sm:gap-3", children: [ /*#__PURE__*/ _jsx("input", { name: "district", placeholder: t('create.field.address.district'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }), /*#__PURE__*/ _jsx("input", { name: "street", placeholder: t('create.field.address.street'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }), /*#__PURE__*/ _jsx("input", { name: "houseNumber", placeholder: t('create.field.address.house'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.confidential') }), /*#__PURE__*/ _jsx("textarea", { name: "confidentialNote", rows: 2, placeholder: t('create.field.confidential.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none bg-white" }) ] }) ] }), /*#__PURE__*/ _jsx(TurnstileWidget, { onSuccess: setCaptchaToken, onError: ()=>setCaptchaToken(''), onExpire: ()=>setCaptchaToken('') }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: loading || !captchaToken, className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed", children: loading ? t('create.submitting') : t('create.submit') }) ] }) }), /*#__PURE__*/ _jsx("aside", { className: "hidden lg:block lg:w-64 shrink-0", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 mb-4 text-sm", children: sidebarTitle }), !selectedCategory ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 text-center py-4", children: t('tasks.new.select_category') }) : topSpecialists.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 text-center py-4", children: t('specialists.empty') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: topSpecialists.map((u)=>{ const name = formatShortName(u.firstName, u.lastName, u.name); const initials = `${u.firstName?.[0] ?? ''}${u.lastName?.[0] ?? ''}`.toUpperCase() || u.name?.[0]?.toUpperCase() || '?'; const seen = formatLastSeen(u.lastSeenAt, t); const avail = specialistAvailMap[u.id]; const isInvited = invitedIds.has(u.id); return /*#__PURE__*/ _jsxs("div", { className: "rounded-lg border border-gray-100 hover:bg-gray-50 transition", children: [ /*#__PURE__*/ _jsxs(Link, { href: `/users/${u.id}`, target: "_blank", rel: "noopener noreferrer", className: "flex items-center gap-3 p-2", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: u.image ? /*#__PURE__*/ _jsx("img", { src: u.image, alt: name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-900 truncate", children: name }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 flex-wrap", children: [ u.rating ? /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-500", children: [ "★ ", Number(u.rating).toFixed(1) ] }) : seen ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: seen }) : null, typeof u.reviewCount === 'number' && u.reviewCount > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400", children: [ u.reviewCount, " ", t('reviews.count') ] }), typeof u.positivePercent === 'number' && u.reviewCount > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-green-600", children: [ u.positivePercent, "% \uD83D\uDC4D" ] }), avail === 'available' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-0.5 text-xs font-medium text-green-700 bg-green-100 px-1.5 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), avail === 'busy' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-0.5 text-xs font-medium text-red-700 bg-red-100 px-1.5 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "px-2 pb-2", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setInvitedIds((prev)=>{ const next = new Set(prev); if (next.has(u.id)) next.delete(u.id); else next.add(u.id); return next; }), className: `w-full text-xs font-medium py-1 rounded-lg transition ${isInvited ? 'bg-green-600 text-white hover:bg-green-700' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'}`, children: isInvited ? t('tasks.new.invited') : t('tasks.new.invite') }) }) ] }, u.id); }) }) ] }) }) ] }) ] }); } *61146undefined148199undefined201261undefined263291undefined293332undefined334378undefined380428undefined430513undefined515565undefined567620undefined622690undefined692760undefined762818undefined820876undefined890920"https://api.canhelp.gr"undefined9259470undefined11501164undefined12341243(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined12671275(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined13051319(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)undefined14181426(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)undefined14711478(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15231530(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15711578(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined16181625(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined16801687(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined17301737(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined18931900(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined19531960(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined21112116(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined21812188(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined22352242(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined23002307(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined23092323_components_Turnstile__WEBPACK_IMPORTED_MODULE_10__/* .CAPTCHA_ENABLED */ .lundefined23822392(0,_context_location__WEBPACK_IMPORTED_MODULE_6__/* .useLocation */ .z)undefined24492456(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25152522(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26012609(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined27452752(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined28072814(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined28492854(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined29182926(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined30013013(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getCategories */ .bW)undefined30603071(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getLocations */ .Vs)undefined32163224(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined33383351(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getSpecialists */ .F7)undefined36143622(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined68106819(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .createTask */ .UT)undefined71257128(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined83178321(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined84448447(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined86278631(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined87878790(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined89098913(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined91919194(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined94359439(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined96499653(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined97829785(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1011210115(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1011710134_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_9__/* .TaskCategoryPicker */ .Wundefined1074010744(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1087310876(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1120311206(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1120811225_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_8__/* .TaskLocationPicker */ .Vundefined1191111915(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1202812032(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1239212395(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1274712750(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1341713421(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1353413538(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1390413907(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1425914262(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1495014954(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1506715070(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1536315367(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1561115614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1627916283(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1654916552(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1697916982(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1756917573(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1768617690(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1790617909(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1823418237(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1870418707(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1906119064(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2002520029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2065320656(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2125021253(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2169621699(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2214022143(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2273922742(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2375023753(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2447824482(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2511225115(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2545925462(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2597125974(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2633226336(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2644926452(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2674926752(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2716627170(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2812828131(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2849928503(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2861628619(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2891528919(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2922229225(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2951029513(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2980929812(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3011230115(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3041130414(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3085630860(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3097330976(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3126931273(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3150731511(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3180331806(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3220632209(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3298232985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3359533599(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3360133609react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined3375633759(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3408734090(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3457634579(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3507635080(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3530635310(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3555535558(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3600936012(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3674736751(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3688036883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3720937213(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3747137474(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3799037993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3850538508(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3920239206(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3933539338(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3966939672(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4039340396(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4039840412_components_Turnstile__WEBPACK_IMPORTED_MODULE_10__/* .TurnstileWidget */ .$undefined4070340706(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4127241275(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4140741411(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4161141614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4187641879(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4213542138(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4235642359(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4255542569(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_11__/* .formatShortName */ .H)undefined4281942832(0,_lib_formatLastSeen__WEBPACK_IMPORTED_MODULE_12__/* .formatLastSeen */ .V)undefined4307343077(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4332643330(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4333243335(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined4379443797(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4413144134(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4460644610(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4486044863(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4522645230(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4553645540(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4611946122(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4656146565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4735547359(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4803048034(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4842648429(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4903749041(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4942949432(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5035250355(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5051850521(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) B II__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ CreateTaskPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(94496); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13260); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(96484); /* harmony import */ var _context_location__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(56003); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(91864); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(48178); /* harmony import */ var _lib_formatLastSeen__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(49598); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(53863); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(88142); /* harmony import */ var _components_Turnstile__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(32589); /* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect, useRef } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { useLocation } from '@/context/location'; import { createTask, getCategories, getLocations, getSpecialists } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { TaskLocationPicker } from '@/components/TaskLocationPicker'; import { TaskCategoryPicker } from '@/components/TaskCategoryPicker'; import { TurnstileWidget } from '@/components/Turnstile'; import { CAPTCHA_ENABLED } from '@/components/Turnstile'; const API = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const localISO = (d)=>{ const y = d.getFullYear(); const m = String(d.getMonth() + 1).padStart(2, '0'); const day = String(d.getDate()).padStart(2, '0'); return `${y}-${m}-${day}`; }; export default function CreateTaskPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const searchParams = useSearchParams(); const preselectedCategory = searchParams.get('category') ?? ''; const { t, locale } = useLocale(); const [categories, setCategories] = useState([]); const [locations, setLocations] = useState([]); const [loading, setLoading] = useState(false); const [error, setError] = useState(''); const [topSpecialists, setTopSpecialists] = useState([]); const [deadline, setDeadline] = useState(()=>{ const d = new Date(); d.setDate(d.getDate() + 1); return localISO(d); }); const [expiresAtDays, setExpiresAtDays] = useState(30); const [calendarMonth, setCalendarMonth] = useState(()=>{ const d = new Date(); d.setDate(d.getDate() + 1); return localISO(d).slice(0, 7); }); const calendarInputRef = useRef(null); const [specialistAvailMap, setSpecialistAvailMap] = useState({}); const [invitedIds, setInvitedIds] = useState(new Set()); const [captchaToken, setCaptchaToken] = useState(CAPTCHA_ENABLED ? '' : 'dev'); const { locationSlug: ctxLocation } = useLocation(); const [selectedLocation, setSelectedLocation] = useState(''); const [selectedCategory, setSelectedCategory] = useState(preselectedCategory); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (ctxLocation) setSelectedLocation(ctxLocation); }, [ ctxLocation ]); const [images, setImages] = useState([]); const [photoUploading, setPhotoUploading] = useState(false); const fileInputRef = useRef(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isPending && !session) router.push('/login'); getCategories().then(setCategories).catch(()=>{}); getLocations().then(setLocations).catch(()=>{}); }, [ session, isPending ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!selectedCategory) { setTopSpecialists([]); return; } getSpecialists({ limit: '5', category: selectedCategory, locale }).then((r)=>setTopSpecialists(r.data)).catch(()=>{}); }, [ selectedCategory, locale ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!deadline || topSpecialists.length === 0) return; const month = deadline.slice(0, 7); const ids = topSpecialists.map((u)=>u.id); Promise.all(ids.map((id)=>fetch(`${API}/api/availability/user/${id}?month=${month}`, { credentials: 'include' }).then((r)=>r.ok ? r.json() : []).then((rows)=>{ const row = rows.find((r)=>r.date === deadline); return { id, status: row?.status ?? null }; }).catch(()=>({ id, status: null })))).then((results)=>{ const map = {}; results.forEach(({ id, status })=>{ map[id] = status; }); setSpecialistAvailMap(map); }); }, [ deadline, topSpecialists ]); async function handlePhotoChange(e) { const file = e.target.files?.[0]; if (!file) return; setPhotoUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch(`${API}/api/uploads`, { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); setImages((prev)=>[ ...prev, `${API}${url}` ]); } catch { setError(t('profile.upload.error')); } finally{ setPhotoUploading(false); if (fileInputRef.current) fileInputRef.current.value = ''; } } async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); const form = new FormData(e.currentTarget); const data = { title: form.get('title'), description: form.get('description'), category: form.get('category') || undefined, location: form.get('location') || undefined, budget: form.get('budget') ? Number(form.get('budget')) : undefined, budgetNegotiable: form.get('budgetNegotiable') === 'on', deadline: form.get('deadline') ? new Date(form.get('deadline')).toISOString() : undefined, expiresAt: (()=>{ const d = new Date(); d.setDate(d.getDate() + Number(form.get('expiresAtDays') || 30)); return d.toISOString(); })(), timeSlot: form.get('timeSlot') || undefined, district: form.get('district') || undefined, street: form.get('street') || undefined, houseNumber: form.get('houseNumber') || undefined, confidentialNote: form.get('confidentialNote') || undefined, images: images.length > 0 ? images : undefined, status: 'open', locale: locale, inviteSpecialistIds: invitedIds.size > 0 ? [ ...invitedIds ] : undefined }; try { const task = await createTask({ ...data, captchaToken }); router.push(`/tasks/${task.id}`); } catch (err) { setError(err.message || t('create.error')); } finally{ setLoading(false); } } if (isPending) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const todayMidnight = new Date(); todayMidnight.setHours(0, 0, 0, 0); const [cmYear, cmMonth] = calendarMonth.split('-').map(Number); const daysInMonth = new Date(cmYear, cmMonth, 0).getDate(); const calendarDates = []; for(let day = 1; day <= daysInMonth; day++){ const d = new Date(cmYear, cmMonth - 1, day); if (d >= todayMidnight) calendarDates.push(d); } const monthOptions = Array.from({ length: 12 }, (_, i)=>{ const d = new Date(); d.setDate(1); d.setMonth(d.getMonth() + i); return { value: localISO(d).slice(0, 7), label: d.toLocaleDateString(dateLocale, { month: 'long', year: 'numeric' }) }; }); const sidebarTitle = t('tasks.new.top_specialists'); return /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-3 sm:px-4 py-6 sm:py-8", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-xl sm:text-2xl font-bold text-white mb-4 sm:mb-6", children: t('create.title') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col lg:flex-row gap-6 lg:gap-8 items-start", children: [ /*#__PURE__*/ _jsx("div", { className: "flex-1 min-w-0 w-full", children: /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "bg-white rounded-xl border border-gray-200 p-4 sm:p-6 space-y-4 sm:space-y-5", children: [ error && /*#__PURE__*/ _jsx("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 sm:gap-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.category') }), /*#__PURE__*/ _jsx(TaskCategoryPicker, { categories: categories, locale: catLocale, value: selectedCategory, onChange: setSelectedCategory, placeholder: t('create.field.category.select') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.location') }), /*#__PURE__*/ _jsx(TaskLocationPicker, { locations: locations, value: selectedLocation, onChange: setSelectedLocation, anyLabel: t('create.field.location.any'), allLabel: t('create.field.location.all') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.title'), " ", /*#__PURE__*/ _jsx("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ _jsx("input", { name: "title", required: true, minLength: 5, maxLength: 200, placeholder: t('create.field.title.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.description'), " ", /*#__PURE__*/ _jsx("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ _jsx("textarea", { name: "description", required: true, minLength: 20, rows: 4, placeholder: t('create.field.description.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.budget') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3", children: [ /*#__PURE__*/ _jsx("input", { name: "budget", type: "number", min: 1, step: 1, placeholder: t('create.field.budget.placeholder'), className: "w-full sm:flex-1 border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-1.5 cursor-pointer select-none", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", name: "budgetNegotiable", className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('create.field.budget_negotiable') }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-2", children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm font-medium text-gray-700 shrink-0", children: t('create.field.deadline') }), /*#__PURE__*/ _jsx("select", { value: calendarMonth, onChange: (e)=>setCalendarMonth(e.target.value), className: "flex-1 border border-gray-300 rounded-lg px-2 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: monthOptions.map((mo)=>/*#__PURE__*/ _jsx("option", { value: mo.value, children: mo.label }, mo.value)) }), /*#__PURE__*/ _jsx("button", { type: "button", title: "Открыть календарь", onClick: ()=>{ try { calendarInputRef.current?.showPicker(); } catch { calendarInputRef.current?.click(); } }, className: "shrink-0 w-8 h-8 flex items-center justify-center rounded-lg border border-gray-300 text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: /*#__PURE__*/ _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }), /*#__PURE__*/ _jsx("line", { x1: "16", y1: "2", x2: "16", y2: "6" }), /*#__PURE__*/ _jsx("line", { x1: "8", y1: "2", x2: "8", y2: "6" }), /*#__PURE__*/ _jsx("line", { x1: "3", y1: "10", x2: "21", y2: "10" }) ] }) }), /*#__PURE__*/ _jsx("input", { ref: calendarInputRef, type: "date", min: localISO(todayMidnight), value: deadline, onChange: (e)=>{ if (!e.target.value) return; setDeadline(e.target.value); setCalendarMonth(e.target.value.slice(0, 7)); }, className: "absolute w-0 h-0 opacity-0 pointer-events-none" }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex gap-2 overflow-x-auto pb-1 snap-x snap-mandatory", children: calendarDates.map((d)=>{ const iso = localISO(d); const isSelected = deadline === iso; const dayName = d.toLocaleDateString(dateLocale, { weekday: 'short' }); const dayNum = d.getDate(); return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setDeadline(iso), className: `flex-shrink-0 snap-start flex flex-col items-center justify-center w-14 h-16 rounded-xl border-2 transition select-none ${isSelected ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-700 hover:border-green-300 hover:bg-gray-50'}`, children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium uppercase leading-none mb-0.5", children: dayName }), /*#__PURE__*/ _jsx("span", { className: "text-xl font-bold leading-none", children: dayNum }) ] }, iso); }) }), /*#__PURE__*/ _jsx("input", { type: "hidden", name: "deadline", value: deadline }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.expires_at') }), /*#__PURE__*/ _jsx("div", { className: "flex gap-2", children: [ 7, 14, 30, 60 ].map((days)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setExpiresAtDays(days), className: `flex-1 py-2 rounded-lg border-2 text-sm font-medium transition select-none ${expiresAtDays === days ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-700 hover:border-green-300'}`, children: [ days, " ", t('create.field.expires_at.days').replace('{n}', '') ] }, days)) }), /*#__PURE__*/ _jsx("input", { type: "hidden", name: "expiresAtDays", value: expiresAtDays }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.time_slot') }), /*#__PURE__*/ _jsxs("select", { name: "timeSlot", className: "w-full border border-gray-300 rounded-lg px-3 py-2", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('create.field.time_slot.any') }), /*#__PURE__*/ _jsx("option", { value: "morning", children: t('create.field.time_slot.morning') }), /*#__PURE__*/ _jsx("option", { value: "afternoon", children: t('create.field.time_slot.afternoon') }), /*#__PURE__*/ _jsx("option", { value: "evening", children: t('create.field.time_slot.evening') }), /*#__PURE__*/ _jsx("option", { value: "weekend", children: t('create.field.time_slot.weekend') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.photos') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-2 mb-2", children: [ images.map((url, i)=>/*#__PURE__*/ _jsxs("div", { className: "relative w-20 h-20 rounded-lg overflow-hidden border border-gray-200", children: [ /*#__PURE__*/ _jsx("img", { src: url, alt: "", className: "w-full h-full object-cover" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setImages((prev)=>prev.filter((_, j)=>j !== i)), className: "absolute top-0.5 right-0.5 bg-black/50 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs hover:bg-black/70", children: "\xd7" }) ] }, i)), images.length < 5 && /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>fileInputRef.current?.click(), disabled: photoUploading, className: "w-20 h-20 border-2 border-dashed border-gray-300 rounded-lg flex flex-col items-center justify-center text-gray-400 hover:border-green-400 hover:text-gray-400 text-xs disabled:opacity-50", children: photoUploading ? '...' : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl leading-none", children: "+" }), /*#__PURE__*/ _jsx("span", { children: t('create.field.photos.add') }) ] }) }) ] }), /*#__PURE__*/ _jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", className: "hidden", onChange: handlePhotoChange }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-3 p-3 bg-yellow-50 border border-yellow-200 rounded-xl", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-xs font-medium text-yellow-700 flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" }) }), "\uD83D\uDD12 ", t('create.field.confidential.hint') ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.address') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-2 sm:gap-3", children: [ /*#__PURE__*/ _jsx("input", { name: "district", placeholder: t('create.field.address.district'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }), /*#__PURE__*/ _jsx("input", { name: "street", placeholder: t('create.field.address.street'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }), /*#__PURE__*/ _jsx("input", { name: "houseNumber", placeholder: t('create.field.address.house'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.confidential') }), /*#__PURE__*/ _jsx("textarea", { name: "confidentialNote", rows: 2, placeholder: t('create.field.confidential.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none bg-white" }) ] }) ] }), /*#__PURE__*/ _jsx(TurnstileWidget, { onSuccess: setCaptchaToken, onError: ()=>setCaptchaToken(''), onExpire: ()=>setCaptchaToken('') }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: loading || !captchaToken, className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed", children: loading ? t('create.submitting') : t('create.submit') }) ] }) }), /*#__PURE__*/ _jsx("aside", { className: "hidden lg:block lg:w-64 shrink-0", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 mb-4 text-sm", children: sidebarTitle }), !selectedCategory ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 text-center py-4", children: t('tasks.new.select_category') }) : topSpecialists.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 text-center py-4", children: t('specialists.empty') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: topSpecialists.map((u)=>{ const name = formatShortName(u.firstName, u.lastName, u.name); const initials = `${u.firstName?.[0] ?? ''}${u.lastName?.[0] ?? ''}`.toUpperCase() || u.name?.[0]?.toUpperCase() || '?'; const seen = formatLastSeen(u.lastSeenAt, t); const avail = specialistAvailMap[u.id]; const isInvited = invitedIds.has(u.id); return /*#__PURE__*/ _jsxs("div", { className: "rounded-lg border border-gray-100 hover:bg-gray-50 transition", children: [ /*#__PURE__*/ _jsxs(Link, { href: `/users/${u.id}`, target: "_blank", rel: "noopener noreferrer", className: "flex items-center gap-3 p-2", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: u.image ? /*#__PURE__*/ _jsx("img", { src: u.image, alt: name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-900 truncate", children: name }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 flex-wrap", children: [ u.rating ? /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-500", children: [ "★ ", Number(u.rating).toFixed(1) ] }) : seen ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: seen }) : null, typeof u.reviewCount === 'number' && u.reviewCount > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400", children: [ u.reviewCount, " ", t('reviews.count') ] }), typeof u.positivePercent === 'number' && u.reviewCount > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-green-600", children: [ u.positivePercent, "% \uD83D\uDC4D" ] }), avail === 'available' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-0.5 text-xs font-medium text-green-700 bg-green-100 px-1.5 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), avail === 'busy' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-0.5 text-xs font-medium text-red-700 bg-red-100 px-1.5 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "px-2 pb-2", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setInvitedIds((prev)=>{ const next = new Set(prev); if (next.has(u.id)) next.delete(u.id); else next.add(u.id); return next; }), className: `w-full text-xs font-medium py-1 rounded-lg transition ${isInvited ? 'bg-green-600 text-white hover:bg-green-700' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'}`, children: isInvited ? t('tasks.new.invited') : t('tasks.new.invite') }) }) ] }, u.id); }) }) ] }) }) ] }) ] }); } *61146undefined148199undefined201261undefined263291undefined293332undefined334378undefined380428undefined430513undefined515565undefined567620undefined622690undefined692760undefined762818undefined820876undefined890920"https://api.canhelp.gr"undefined9259470undefined11501164undefined12341243(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined12671275(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined13051319(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)undefined14181426(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)undefined14711478(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15231530(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15711578(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined16181625(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined16801687(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined17301737(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined18931900(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined19531960(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined21112116(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined21812188(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined22352242(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined23002307(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined23092323_components_Turnstile__WEBPACK_IMPORTED_MODULE_10__/* .CAPTCHA_ENABLED */ .lundefined23822392(0,_context_location__WEBPACK_IMPORTED_MODULE_6__/* .useLocation */ .z)undefined24492456(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25152522(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26012609(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined27452752(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined28072814(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined28492854(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined29182926(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined30013013(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getCategories */ .bW)undefined30603071(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getLocations */ .Vs)undefined32163224(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined33383351(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getSpecialists */ .F7)undefined36143622(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined68106819(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .createTask */ .UT)undefined71257128(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined83178321(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined84448447(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined86278631(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined87878790(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined89098913(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined91919194(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined94359439(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined96499653(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined97829785(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1011210115(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1011710134_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_9__/* .TaskCategoryPicker */ .Wundefined1074010744(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1087310876(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1120311206(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1120811225_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_8__/* .TaskLocationPicker */ .Vundefined1191111915(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1202812032(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1239212395(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1274712750(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1341713421(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1353413538(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1390413907(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1425914262(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1495014954(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1506715070(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1536315367(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1561115614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1627916283(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1654916552(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1697916982(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1756917573(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1768617690(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1790617909(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1823418237(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1870418707(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1906119064(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2002520029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2065320656(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2125021253(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2169621699(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2214022143(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2273922742(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2375023753(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2447824482(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2511225115(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2545925462(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2597125974(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2633226336(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2644926452(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2674926752(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2716627170(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2812828131(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2849928503(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2861628619(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2891528919(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2922229225(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2951029513(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2980929812(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3011230115(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3041130414(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3085630860(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3097330976(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3126931273(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3150731511(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3180331806(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3220632209(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3298232985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3359533599(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3360133609react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined3375633759(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3408734090(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3457634579(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3507635080(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3530635310(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3555535558(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3600936012(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3674736751(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3688036883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3720937213(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3747137474(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3799037993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3850538508(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3920239206(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3933539338(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3966939672(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4039340396(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4039840412_components_Turnstile__WEBPACK_IMPORTED_MODULE_10__/* .TurnstileWidget */ .$undefined4070340706(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4127241275(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4140741411(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4161141614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4187641879(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4213542138(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4235642359(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4255542569(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_11__/* .formatShortName */ .H)undefined4281942832(0,_lib_formatLastSeen__WEBPACK_IMPORTED_MODULE_12__/* .formatLastSeen */ .V)undefined4307343077(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4332643330(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4333243335(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined4379443797(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4413144134(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4460644610(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4486044863(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4522645230(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4553645540(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4611946122(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4656146565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4735547359(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4803048034(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4842648429(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4903749041(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4942949432(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5035250355(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5051850521(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefinedHJ, /***/ 74075:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("zlib");  /***/ }) 9O/***/ ((module) => { "use strict"; module.exports = require("zlib"); /***/ }) := >?@!module.exports = require("zlib");?A, /***/ 79428:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("buffer");  /***/ }) 0Q/***/ ((module) => { "use strict"; module.exports = require("buffer"); /***/ }) 14 567#module.exports = require("buffer");68, /***/ 79551:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("url");  /***/ }) 'N/***/ ((module) => { "use strict"; module.exports = require("url"); /***/ }) (+ ,-. module.exports = require("url");-/, /***/ 79646:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; *module.exports = require("child_process");  /***/ }) X/***/ ((module) => { "use strict"; module.exports = require("child_process"); /***/ }) " #$%*module.exports = require("child_process");$&, /***/ 81630:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("http");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("http"); /***/ })  !module.exports = require("http");, /***/ 83997:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("tty");  /***/ })  N/***/ ((module) => { "use strict"; module.exports = require("tty"); /***/ })    module.exports = require("tty");, /***/ 86439:  +webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");  /***/ }) z/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/no-fallback-error.external"); /***/ })    Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");  , /***/ 90635:  bwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Ywebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceWimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/tasks/new/page.tsx"); `TPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 63807))buffersourcesizemapshashbPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 63807)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceWimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/tasks/new/page.tsx"); l084Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 63807))undefined /***/ }) V/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { VWimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/tasks/new/page.tsx"); l084Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 63807))undefined, /***/ 91645:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("net");  /***/ }) N/***/ ((module) => { "use strict"; module.exports = require("net"); /***/ })   module.exports = require("net");, /***/ 94735:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("events");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("events"); /***/ })  #module.exports = require("events");, /***/ 96211:  bwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Ywebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceWimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/tasks/new/page.tsx"); `TPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 99105))buffersourcesizemapshashbPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 99105)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceWimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/tasks/new/page.tsx"); l084Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 99105))undefined /***/ }) <l084Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 99105))undefined, /***/ 99105:  nwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource,// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/tasks/new/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/new/page.tsx", "default", ); `=G* T@/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference));buffersourcesizemapshashX__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/tasks/new/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/new/page.tsx", "default", )); {"finalSource":true}mapbufferedMap ConcatSourceRawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); ReplaceSourceRawSource,// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/tasks/new/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/new/page.tsx", "default", ); 61134undefined136150/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (undefined136150undefined151173(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined554554.5);undefined /***/ })  2__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); 4,// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/tasks/new/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/new/page.tsx", "default", ); 61134undefined136150/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (undefined136150undefined151173(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined554554.5);undefinedz }; ; // load runtime var __webpack_require__ = require("../../../webpack-runtime.js"); __webpack_require__.C(exports); var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [901,652,809,22], () => (__webpack_exec__(37493))); ,module.exports = __webpack_exports__; })(); @"b(() => { var exports = {}; exports.id = 478; exports.ids = [478]; exports.modules = { /***/ 261:   , /***/ 37493: Rconst module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/tasks/new/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'tasks', { children: [ 'new', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/tasks/new/page.tsx"], }] }, { } ] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.png?__next_metadata__")).default(props))], apple: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=apple&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/apple-icon.png?__next_metadata__")).default(props))], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/tasks/new/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/tasks/new/page", pathname: "/tasks/new", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/tasks/new/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map %'2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558642Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 99105))undefined645785undefined787901undefined903979undefined9811052undefined10541116undefined11181187undefined11891265undefined12671352undefined13541437undefined14391515undefined15171598undefined16001693undefined16951799undefined18011881undefined18831961undefined19632054undefined20562237undefined22392315undefined23172382undefined23842457undefined24592516undefined25182624undefined26262699undefined27012765undefined27672848undefined33573579Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined36373866Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined44264648Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2645))undefined47064935Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45639))undefined51225144undefined51465282undefined52845306undefined53375355__webpack_require__undefined54135419undefined55205646undefined56485733undefined57355848undefined59115917undefined59425959next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined59956003next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined62676302".next"undefined630763080undefined63356373 falseundefined63856391undefined66756695falseundefined66986762{}undefined69086947falseundefined69796992(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined70837096(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined78627877(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined82648273(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined83098324(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined84698482(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined85288554next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined87338746(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined87928801next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined88418865(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined90459064(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined92569363 falseundefined936893820undefined1167811691(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1207612103(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1388813905(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1396513973next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1402414023: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1439214421(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1455314573(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1470714715(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1501515029next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1506915084next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1531215349falseundefined1535215927{}undefined1650516518next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1760517618(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1789717910(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1862918665 trueundefined1866918688(__webpack_require__(33873).join)undefined18767188180undefined1977919792(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2163321646(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2207022091next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2353023544next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2479024807(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2509625107next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2512225126(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2523225243next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2567725688next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2575725768next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2585725868next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2640126412next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2645726471next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2712327131next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2787727898(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2942629440next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2947929490next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2999230005(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3006230083(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3065830666next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3214532159next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3351133534next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3600136014next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3630936323next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3720637229next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3750137522next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3764037661next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3789137906(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3813438145next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3817438196next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3885238867(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3907539086next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3934939362(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3981039823(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4069340714next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4159341614next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4172441745next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4229842315next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4251942542next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4343843453(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4448144496(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4470444715next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4474844770next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4548745599falseundefined4560245952{}undefined4597745992(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4693646947next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4708247097(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4770847735falseundefined4773847808{}undefined4911649130next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined5005450069(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5094450957next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5105651063next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5131951333next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5154551563(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefined ~, /***/ 49598: /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ V: () => (/* binding */ formatLastSeen) /* harmony export */ });  , /***/ 63807: Z[\ , /***/ 90635: Wimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/tasks/new/page.tsx"); l084Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 63807))undefined !, /***/ 96211: l084Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 99105))undefined, /***/ 99105: ,// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/tasks/new/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/tasks/new/page.tsx", "default", ); Az }; ; // load runtime var __webpack_require__ = require("../../../webpack-runtime.js"); __webpack_require__.C(exports); var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [901,652,809,22], () => (__webpack_exec__(37493)));   Dowebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceW"use strict"; exports.id = 902; exports.ids = [902]; exports.modules = { /***/ 59902: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource vwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceQ/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource ~webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CC: () => (/* binding */ getTaskBudgetRange), /* harmony export */ F7: () => (/* binding */ getSpecialists), /* harmony export */ Vs: () => (/* binding */ getLocations), /* harmony export */ bW: () => (/* binding */ getCategories), /* harmony export */ gg: () => (/* binding */ getTask) /* harmony export */ }); /* unused harmony exports request, getTasks, searchTasks, getMyTasks, getTasksForSpecialist, getTaskCountsByCategory, createTask, updateTask, completeTask, cancelTask, getOffers, getMyOffers, createOffer, acceptOffer, declineOffer, getUserProfile, createReview, getTaskReviews, getMyReviews, getChatRooms, getOrCreateDirectRoom, getCanMessage, getMessages, sendMessage, updateNotifSettings, getNotifications, getUnreadCount, markRead, markAllRead, getTaskInvite, dismissNotification, getMyReferralInfo, applyMyReferral, getUserReviews, getUserRating, getFavorites, addFavorite, removeFavorite, getSpecialistFavorites, addSpecialistFavorite, removeSpecialistFavorite, getAdminCategories, createCategory, updateCategory, deleteCategory, getAdminSkills, createSkill, updateSkill, deleteSkill, getSkillDedup, mergeSkillDuplicates, getAdminStats, getAdminUsers, deactivateUser, activateUser, changeUserRole, getAdminUser, getAdminUserSpecialistCards, adminUpdateSpecialistCard, getAdminSpecialistCards, updateAdminUser, verifyAdminUserEmail, getAdminTasks, cancelTaskAdmin, deleteTaskAdmin, getAdminReports, updateReportStatus, getAdminAiLogs, getAdminActivityLogs, getAdminMailLogs, getAdminNotifLogs, getAdminNotifStats, getAdminMailStats, getAdminReferrals, adminSendPushToUser, adminBroadcastPush, getAdminLocations, createLocation, updateLocation, deleteLocation, getAdminPlans, createPlan, updatePlan, deletePlan, getAdminSettings, updateAdminSettings, getAdminEmailTemplates, updateAdminEmailTemplate, translateAdminEmailTemplate, sendTestEmail, testTelegramConnection, verifyTelegramToken, getTranslationsStats, getTranslationsMissing, saveTranslations, autoTranslate, autoTranslateTasks, getTasksTranslationPreview, autoTranslateEmailTemplates, getMyAvailability, setAvailability, setAvailabilityRange, getSpecialistAvailability, getMyPortfolio, addPortfolioItem, updatePortfolioItem, deletePortfolioItem, getSpecialistPortfolio, getMySpecialistCards, createSpecialistCard, updateSpecialistCard, saveSiteSeo, deleteSpecialistCard, getSpecialistCards, getPriceList, createPriceListGroup, updatePriceListGroup, deletePriceListGroup, createPriceListItem, updatePriceListItem, deletePriceListItem, getSkillSuggestions, initiateTopUp, getPaymentHistory, getBalanceHistory, getPlanHistory, getAdminBalanceHistory, adminTopUpUserBalance, adminWithdrawUserBalance, previewPlanChange, getPlans, getMyDashboard, getDailyUsage, purchasePlan, getMyStatuses, toggleStatus, getAutoResponseSettings, updateAutoResponseSettings, getSpecialistFomoDashboard, getCustomerFomoDashboard, getFomoRecommendations, getAutoMatchResults, runAutoMatch, getGoogleCalendarStatus, disconnectGoogleCalendar, importFromGoogleCalendar, getGoogleCalendarConnectUrl, getPublicSiteProfile, getSiteStats, trackSiteMessage, getTaskStats, sendPublicSupportMessage, createSupportTicket, getMySupportTickets, getAdminSupportTickets, replyToSupportTicket, setSupportTicketStatus */ webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource[j// SSR: use INTERNAL_API_URL (http://localhost:4000) to avoid external DNS/SSL round-trip // Browser: use NEXT_PUBLIC_API_URL (https://api.canhelp.gr) const BASE = "undefined" === 'undefined' ? process.env.INTERNAL_API_URL || 'http://localhost:4000' : process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export async function request(path, init) { const url = `${BASE}/api${path}`; if ("undefined" === 'undefined') console.log('[api] SSR fetch', url); const res = await fetch(url, { ...init, credentials: 'include', headers: { 'Content-Type': 'application/json', ...init?.headers } }); if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); const msg = typeof err.error === 'string' ? err.error : typeof err.message === 'string' ? err.message : res.statusText || 'Request failed'; throw new Error(msg); } return res.json(); } // ─── Tasks ──────────────────────────────────────────────────────────────── export const getTasks = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks${qs}`); }; export const getTaskBudgetRange = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks/budget-range${qs}`); }; export const searchTasks = (params)=>request(`/tasks/search?${new URLSearchParams(params)}`); export const getMyTasks = ()=>request('/tasks/my'); export const getTasksForSpecialist = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks/for-me${qs}`); }; export const getTaskCountsByCategory = ()=>request('/tasks/counts-by-category'); export const getTask = (id)=>request(`/tasks/${id}`); export const createTask = (data)=>request('/tasks', { method: 'POST', body: JSON.stringify(data) }); export const updateTask = (id, data)=>request(`/tasks/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const completeTask = (id)=>request(`/tasks/${id}/complete`, { method: 'PATCH' }); export const cancelTask = (id)=>request(`/tasks/${id}/cancel`, { method: 'PATCH' }); // ─── Offers ──────────────────────────────────────────────────────────────── export const getOffers = (taskId)=>request(`/offers?taskId=${taskId}`); export const getMyOffers = ()=>request('/offers/my'); export const createOffer = (data)=>request('/offers', { method: 'POST', body: JSON.stringify(data) }); export const acceptOffer = (id)=>request(`/offers/${id}/accept`, { method: 'PATCH' }); export const declineOffer = (id)=>request(`/offers/${id}/decline`, { method: 'PATCH' }); export const getUserProfile = (id, locale)=>request(`/users/${id}/profile${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); export const getSpecialists = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/users/specialists${qs}`); }; export const createReview = (data)=>request('/reviews', { method: 'POST', body: JSON.stringify(data) }); export const getTaskReviews = (taskId)=>request(`/reviews/task/${taskId}`); export const getMyReviews = ()=>request('/reviews/my'); // ─── Chat ────────────────────────────────────────────────────────────────── export const getChatRooms = ()=>request('/chat/rooms'); export const getOrCreateDirectRoom = (userId)=>request(`/chat/direct/${userId}`); export const getCanMessage = (userId)=>request(`/chat/can-message/${userId}`); export const getMessages = (roomId)=>request(`/chat/rooms/${roomId}/messages`); export const sendMessage = (roomId, body)=>request('/chat/messages', { method: 'POST', body: JSON.stringify({ roomId, body }) }); // ─── Notifications ──────────────────────────────────────────────────────── export const updateNotifSettings = (data)=>request('/users/me', { method: 'PATCH', body: JSON.stringify(data) }); export const getNotifications = ()=>request('/notifications'); export const getUnreadCount = ()=>request('/notifications/count'); export const markRead = (id)=>request(`/notifications/${id}/read`, { method: 'PATCH' }); export const markAllRead = ()=>request('/notifications/read-all', { method: 'PATCH' }); export const getTaskInvite = (taskId)=>request(`/notifications?type=task_invite&referenceId=${taskId}`); export const dismissNotification = (id)=>request(`/notifications/${id}`, { method: 'DELETE' }); // ─── Referral ───────────────────────────────────────────────────────────── export const getMyReferralInfo = ()=>request('/users/me/referral'); export const applyMyReferral = (refCode)=>request('/users/me/referral/apply', { method: 'POST', body: JSON.stringify({ refCode }) }); // ─── Reviews ────────────────────────────────────────────────────────────── export const getUserReviews = (userId)=>request(`/reviews/user/${userId}`); export const getUserRating = (userId)=>request(`/reviews/user/${userId}/rating`); // ─── Categories ─────────────────────────────────────────────────────────── export const getCategories = ()=>request('/categories'); // ─── Locations ──────────────────────────────────────────────────────────── export const getLocations = ()=>request('/locations'); // ─── Favorites ──────────────────────────────────────────────────────────── export const getFavorites = ()=>request('/favorites'); export const addFavorite = (taskId)=>request(`/favorites/${taskId}`, { method: 'POST' }); export const removeFavorite = (taskId)=>request(`/favorites/${taskId}`, { method: 'DELETE' }); export const getSpecialistFavorites = ()=>request('/favorites/specialists'); export const addSpecialistFavorite = (specialistId)=>request(`/favorites/specialists/${specialistId}`, { method: 'POST' }); export const removeSpecialistFavorite = (specialistId)=>request(`/favorites/specialists/${specialistId}`, { method: 'DELETE' }); // ─── Admin ───────────────────────────────────────────────────────────────── // ─── Admin Categories ────────────────────────────────────────────────────── export const getAdminCategories = ()=>request('/admin/categories'); export const createCategory = (data)=>request('/admin/categories', { method: 'POST', body: JSON.stringify(data) }); export const updateCategory = (id, data)=>request(`/admin/categories/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deleteCategory = (id)=>request(`/admin/categories/${id}`, { method: 'DELETE' }); // ─── Admin Skills ────────────────────────────────────────────────────────── export const getAdminSkills = (categorySlug)=>request(`/admin/skills?categorySlug=${encodeURIComponent(categorySlug)}`); export const createSkill = (data)=>request('/admin/skills', { method: 'POST', body: JSON.stringify(data) }); export const updateSkill = (id, data)=>request(`/admin/skills/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deleteSkill = (id)=>request(`/admin/skills/${id}`, { method: 'DELETE' }); export const getSkillDedup = (categorySlug)=>request(`/admin/skills/dedup${categorySlug ? `?categorySlug=${encodeURIComponent(categorySlug)}` : ''}`); export const mergeSkillDuplicates = (keepId, deleteIds)=>request('/admin/skills/dedup/merge', { method: 'POST', body: JSON.stringify({ keepId, deleteIds }) }); // ─── Admin ───────────────────────────────────────────────────────────────── export const getAdminStats = ()=>request('/admin/stats'); export const getAdminUsers = (page = 1, q, role)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (role) p.set('role', role); return request(`/admin/users?${p}`); }; export const deactivateUser = (id)=>request(`/admin/users/${id}/deactivate`, { method: 'PATCH' }); export const activateUser = (id)=>request(`/admin/users/${id}/activate`, { method: 'PATCH' }); export const changeUserRole = (id, role)=>request(`/admin/users/${id}/role`, { method: 'PATCH', body: JSON.stringify({ role }) }); export const getAdminUser = (id)=>request(`/admin/users/${id}`); export const getAdminUserSpecialistCards = (userId)=>request(`/admin/users/${userId}/specialist-cards`); export const adminUpdateSpecialistCard = (id, data)=>request(`/admin/specialist-cards/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const getAdminSpecialistCards = (page = 1, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request(`/admin/specialist-cards?${p}`); }; export const updateAdminUser = (id, data)=>request(`/admin/users/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const verifyAdminUserEmail = (id)=>request(`/admin/users/${id}/verify-email`, { method: 'PATCH' }); export const getAdminTasks = (page = 1, q, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (status) p.set('status', status); return request(`/admin/tasks?${p}`); }; export const cancelTaskAdmin = (id)=>request(`/admin/tasks/${id}/cancel`, { method: 'PATCH' }); export const deleteTaskAdmin = (id)=>request(`/admin/tasks/${id}`, { method: 'DELETE' }); export const getAdminReports = (page = 1, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request(`/admin/reports?${p}`); }; export const updateReportStatus = (id, status)=>request(`/admin/reports/${id}/status`, { method: 'PATCH', body: JSON.stringify({ status }) }); export const getAdminAiLogs = (page = 1)=>request(`/admin/ai-logs?page=${page}&limit=50`); export const getAdminActivityLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.userId) p.set('userId', params.userId); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/activity-logs?${p}`); }; export const getAdminMailLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/mail-logs?${p}`); }; export const getAdminNotifLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.type) p.set('type', params.type); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/notification-logs?${p}`); }; export const getAdminNotifStats = ()=>request('/admin/notification-stats'); export const getAdminMailStats = ()=>request('/admin/mail-stats'); export const getAdminReferrals = ()=>request('/admin/referrals'); export const adminSendPushToUser = (userId, data)=>request(`/admin/push/user/${userId}`, { method: 'POST', body: JSON.stringify(data) }); export const adminBroadcastPush = (data)=>request('/admin/push/broadcast', { method: 'POST', body: JSON.stringify(data) }); // ─── Admin Locations ─────────────────────────────────────────────────────── export const getAdminLocations = ()=>request('/admin/locations'); export const createLocation = (data)=>request('/admin/locations', { method: 'POST', body: JSON.stringify(data) }); export const updateLocation = (id, data)=>request(`/admin/locations/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deleteLocation = (id)=>request(`/admin/locations/${id}`, { method: 'DELETE' }); // ─── Admin Plans ─────────────────────────────────────────────────────────── export const getAdminPlans = ()=>request('/admin/plans'); export const createPlan = (data)=>request('/admin/plans', { method: 'POST', body: JSON.stringify(data) }); export const updatePlan = (id, data)=>request(`/admin/plans/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deletePlan = (id)=>request(`/admin/plans/${id}`, { method: 'DELETE' }); // ─── Admin Settings ──────────────────────────────────────────────────────── export const getAdminSettings = ()=>request('/admin/settings'); export const updateAdminSettings = (data)=>request('/admin/settings', { method: 'PUT', body: JSON.stringify(data) }); export const getAdminEmailTemplates = ()=>request('/admin/settings/templates'); export const updateAdminEmailTemplate = (key, data)=>request(`/admin/settings/templates/${key}`, { method: 'PUT', body: JSON.stringify(data) }); export const translateAdminEmailTemplate = (data)=>request('/admin/settings/templates/translate', { method: 'POST', body: JSON.stringify(data) }); export const sendTestEmail = ()=>request('/admin/settings/test-email', { method: 'POST' }); export const testTelegramConnection = (botToken, chatId)=>fetch(`${BASE}/api/admin/settings/test-telegram`, { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken, chatId }) }).then((r)=>r.json()); export const verifyTelegramToken = (botToken)=>fetch(`${BASE}/api/admin/settings/verify-telegram-token`, { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken }) }).then((r)=>r.json()); export const getTranslationsStats = ()=>request('/admin/translations/stats'); export const getTranslationsMissing = (table, missingLang, page = 1, limit = 50)=>request(`/admin/translations/${table}?missingLang=${missingLang}&page=${page}&limit=${limit}`); export const saveTranslations = (table, items)=>request(`/admin/translations/${table}/save`, { method: 'POST', body: JSON.stringify({ items }) }); export const autoTranslate = (table, missingLang, fromLang, batchSize = 500)=>request('/admin/translations/auto-translate', { method: 'POST', body: JSON.stringify({ table, missingLang, fromLang, batchSize }) }); export const autoTranslateTasks = (batchSize = 500)=>request('/admin/translations/auto-translate-tasks', { method: 'POST', body: JSON.stringify({ batchSize }) }); export const getTasksTranslationPreview = (lang, limit = 50)=>request(`/admin/translations/tasks-preview?lang=${lang}&limit=${limit}`); export const autoTranslateEmailTemplates = (missingLang, fromLang = 'el')=>request('/admin/translations/auto-translate-templates', { method: 'POST', body: JSON.stringify({ missingLang, fromLang }) }); // ─── Availability ────────────────────────────────────────────────────────── export const getMyAvailability = (month)=>request(`/availability/my${month ? `?month=${month}` : ''}`); export const setAvailability = (date, status, note)=>request('/availability/set', { method: 'POST', body: JSON.stringify({ date, status, note }) }); export const setAvailabilityRange = (from, to, status)=>request('/availability/set-range', { method: 'POST', body: JSON.stringify({ from, to, status }) }); export const getSpecialistAvailability = (userId, month)=>request(`/availability/user/${userId}${month ? `?month=${month}` : ''}`); export const getMyPortfolio = ()=>request('/portfolio/my'); export const addPortfolioItem = (formData)=>fetch(`${BASE}/api/portfolio`, { method: 'POST', credentials: 'include', body: formData }).then(async (res)=>{ if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); throw new Error(err.error || 'Upload failed'); } return res.json(); }); export const updatePortfolioItem = (id, data)=>request(`/portfolio/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deletePortfolioItem = (id)=>request(`/portfolio/${id}`, { method: 'DELETE' }); export const getSpecialistPortfolio = (userId)=>request(`/portfolio/user/${userId}`); export const getMySpecialistCards = ()=>request('/specialist-cards/my'); export const createSpecialistCard = (data)=>request('/specialist-cards', { method: 'POST', body: JSON.stringify(data) }); export const updateSpecialistCard = (id, data)=>request(`/specialist-cards/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const saveSiteSeo = (data)=>request('/users/me/site-seo', { method: 'POST', body: JSON.stringify(data) }); export const deleteSpecialistCard = (id)=>request(`/specialist-cards/${id}`, { method: 'DELETE' }); export const getSpecialistCards = (userId, locale)=>request(`/specialist-cards/user/${userId}${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); export const getPriceList = (cardId, locale)=>request(`/price-list/${cardId}${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); export const createPriceListGroup = (cardId, data)=>request(`/price-list/${cardId}/groups`, { method: 'POST', body: JSON.stringify(data) }); export const updatePriceListGroup = (groupId, data)=>request(`/price-list/groups/${groupId}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deletePriceListGroup = (groupId)=>request(`/price-list/groups/${groupId}`, { method: 'DELETE' }); export const createPriceListItem = (groupId, data)=>request(`/price-list/groups/${groupId}/items`, { method: 'POST', body: JSON.stringify(data) }); export const updatePriceListItem = (itemId, data)=>request(`/price-list/items/${itemId}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deletePriceListItem = (itemId)=>request(`/price-list/items/${itemId}`, { method: 'DELETE' }); export const getSkillSuggestions = (categorySlugs)=>{ const params = categorySlugs?.length ? '?' + categorySlugs.map((s)=>`category=${encodeURIComponent(s)}`).join('&') : ''; return request(`/skill-suggestions${params}`); }; export const initiateTopUp = (amount)=>request('/payments/topup/init', { method: 'POST', body: JSON.stringify({ amount }) }); export const getPaymentHistory = ()=>request('/payments/history'); export const getBalanceHistory = (limit = 50)=>request(`/payments/balance-history?limit=${limit}`); export const getPlanHistory = (limit = 50)=>request(`/users/me/plan-history?limit=${limit}`); export const getAdminBalanceHistory = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.userId) p.set('userId', params.userId); if (params.kind) p.set('kind', params.kind); p.set('limit', '50'); return request(`/admin/balance-history?${p}`); }; export const adminTopUpUserBalance = (id, data)=>request(`/admin/users/${id}/balance/topup`, { method: 'POST', body: JSON.stringify(data) }); export const adminWithdrawUserBalance = (id, data)=>request(`/admin/users/${id}/balance/withdraw`, { method: 'POST', body: JSON.stringify(data) }); export const previewPlanChange = (planId)=>request('/payments/plan/preview', { method: 'POST', body: JSON.stringify({ planId }) }); export const getPlans = (role)=>{ const qs = role ? `?role=${role}` : ''; return request(`/plans${qs}`); }; export const getMyDashboard = ()=>request('/dashboard/me'); export const getDailyUsage = ()=>request('/plans/daily-usage'); export const purchasePlan = (planId, payFromBalance = true)=>request('/payments/plan/purchase', { method: 'POST', body: JSON.stringify({ planId, payFromBalance }) }); // ─── Statuses ────────────────────────────────────────────────────────────── export const getMyStatuses = ()=>request('/statuses/me'); export const toggleStatus = (statusType, active)=>request('/statuses/toggle', { method: 'POST', body: JSON.stringify({ statusType, active }) }); export const getAutoResponseSettings = ()=>request('/auto-response'); export const updateAutoResponseSettings = (data)=>request('/auto-response', { method: 'PUT', body: JSON.stringify(data) }); // ─── FOMO ────────────────────────────────────────────────────────────────── export const getSpecialistFomoDashboard = ()=>request('/fomo/specialist'); export const getCustomerFomoDashboard = ()=>request('/fomo/customer'); export const getFomoRecommendations = ()=>request('/fomo/recommendations'); // ─── Auto-match ──────────────────────────────────────────────────────────── export const getAutoMatchResults = (taskId)=>request(`/auto-match/${taskId}`); export const runAutoMatch = (taskId)=>request(`/auto-match/${taskId}`, { method: 'POST' }); // ─── Google Calendar ─────────────────────────────────────────────────────── export const getGoogleCalendarStatus = ()=>request('/google/calendar/status'); export const disconnectGoogleCalendar = ()=>request('/google/calendar/disconnect', { method: 'DELETE' }); export const importFromGoogleCalendar = ()=>request('/google/calendar/import', { method: 'POST' }); export const getGoogleCalendarConnectUrl = ()=>`${BASE}/api/google/calendar/connect`; // ─── Personal site ───────────────────────────────────────────────────────── export const getPublicSiteProfile = (slug)=>request(`/users/site/${slug}`); export const getSiteStats = ()=>request('/users/me/site-stats'); export const trackSiteMessage = (slug)=>request(`/users/site/${slug}/track-message`, { method: 'POST' }).catch(()=>{}); // ─── Task stats (FOMO) ───────────────────────────────────────────────────── export const getTaskStats = (taskId)=>request(`/tasks/${taskId}/stats`); // ─── Support tickets ─────────────────────────────────────────────────────── export const sendPublicSupportMessage = (data)=>request('/support/public', { method: 'POST', body: JSON.stringify(data) }); export const createSupportTicket = (data)=>request('/support', { method: 'POST', body: JSON.stringify(data) }); export const getMySupportTickets = (page = 1)=>request(`/support/my?page=${page}`); export const getAdminSupportTickets = (params)=>request(`/support${params ? '?' + new URLSearchParams(params) : ''}`); export const replyToSupportTicket = (id, data)=>request(`/support/${id}/reply`, { method: 'PATCH', body: JSON.stringify(data) }); export const setSupportTicketStatus = (id, status)=>request(`/support/${id}/status`, { method: 'PATCH', body: JSON.stringify({ status }) }); _58>5;`fy) _/ q w " ( o u  [ a 4:_MSY_|/5QW _!MSZ`TZw}  _ /!5!p!v!!!}""##$$$$%%%&c&i&_'e'((q(w(1*7*++9-_?----- ....////P0V0001111S2Y2223333W4]44_4L5R555[6a67799V9\9::::;;<<6=<=>>>>??@@A_%A[AaAC CCCCDUD[DDD,E2EEEKFQFFFTGZGGG}HH!I'IIIDJ_JJJJ[KaKDLJLLL-M3MMMMM (/* binding */ getTaskBudgetRange), /* harmony export */ F7: () => (/* binding */ getSpecialists), /* harmony export */ Vs: () => (/* binding */ getLocations), /* harmony export */ bW: () => (/* binding */ getCategories), /* harmony export */ gg: () => (/* binding */ getTask) /* harmony export */ }); /* unused harmony exports request, getTasks, searchTasks, getMyTasks, getTasksForSpecialist, getTaskCountsByCategory, createTask, updateTask, completeTask, cancelTask, getOffers, getMyOffers, createOffer, acceptOffer, declineOffer, getUserProfile, createReview, getTaskReviews, getMyReviews, getChatRooms, getOrCreateDirectRoom, getCanMessage, getMessages, sendMessage, updateNotifSettings, getNotifications, getUnreadCount, markRead, markAllRead, getTaskInvite, dismissNotification, getMyReferralInfo, applyMyReferral, getUserReviews, getUserRating, getFavorites, addFavorite, removeFavorite, getSpecialistFavorites, addSpecialistFavorite, removeSpecialistFavorite, getAdminCategories, createCategory, updateCategory, deleteCategory, getAdminSkills, createSkill, updateSkill, deleteSkill, getSkillDedup, mergeSkillDuplicates, getAdminStats, getAdminUsers, deactivateUser, activateUser, changeUserRole, getAdminUser, getAdminUserSpecialistCards, adminUpdateSpecialistCard, getAdminSpecialistCards, updateAdminUser, verifyAdminUserEmail, getAdminTasks, cancelTaskAdmin, deleteTaskAdmin, getAdminReports, updateReportStatus, getAdminAiLogs, getAdminActivityLogs, getAdminMailLogs, getAdminNotifLogs, getAdminNotifStats, getAdminMailStats, getAdminReferrals, adminSendPushToUser, adminBroadcastPush, getAdminLocations, createLocation, updateLocation, deleteLocation, getAdminPlans, createPlan, updatePlan, deletePlan, getAdminSettings, updateAdminSettings, getAdminEmailTemplates, updateAdminEmailTemplate, translateAdminEmailTemplate, sendTestEmail, testTelegramConnection, verifyTelegramToken, getTranslationsStats, getTranslationsMissing, saveTranslations, autoTranslate, autoTranslateTasks, getTasksTranslationPreview, autoTranslateEmailTemplates, getMyAvailability, setAvailability, setAvailabilityRange, getSpecialistAvailability, getMyPortfolio, addPortfolioItem, updatePortfolioItem, deletePortfolioItem, getSpecialistPortfolio, getMySpecialistCards, createSpecialistCard, updateSpecialistCard, saveSiteSeo, deleteSpecialistCard, getSpecialistCards, getPriceList, createPriceListGroup, updatePriceListGroup, deletePriceListGroup, createPriceListItem, updatePriceListItem, deletePriceListItem, getSkillSuggestions, initiateTopUp, getPaymentHistory, getBalanceHistory, getPlanHistory, getAdminBalanceHistory, adminTopUpUserBalance, adminWithdrawUserBalance, previewPlanChange, getPlans, getMyDashboard, getDailyUsage, purchasePlan, getMyStatuses, toggleStatus, getAutoResponseSettings, updateAutoResponseSettings, getSpecialistFomoDashboard, getCustomerFomoDashboard, getFomoRecommendations, getAutoMatchResults, runAutoMatch, getGoogleCalendarStatus, disconnectGoogleCalendar, importFromGoogleCalendar, getGoogleCalendarConnectUrl, getPublicSiteProfile, getSiteStats, trackSiteMessage, getTaskStats, sendPublicSupportMessage, createSupportTicket, getMySupportTickets, getAdminSupportTickets, replyToSupportTicket, setSupportTicketStatus */ // SSR: use INTERNAL_API_URL (http://localhost:4000) to avoid external DNS/SSL round-trip // Browser: use NEXT_PUBLIC_API_URL (https://api.canhelp.gr) const BASE = true ? process.env.INTERNAL_API_URL || 'http://localhost:4000' : 0; async function request(path, init) { const url = `${BASE}/api${path}`; if (true) console.log('[api] SSR fetch', url); const res = await fetch(url, { ...init, credentials: 'include', headers: { 'Content-Type': 'application/json', ...init?.headers } }); if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); const msg = typeof err.error === 'string' ? err.error : typeof err.message === 'string' ? err.message : res.statusText || 'Request failed'; throw new Error(msg); } return res.json(); } // ─── Tasks ──────────────────────────────────────────────────────────────── const getTasks = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks${qs}`); }; const getTaskBudgetRange = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks/budget-range${qs}`); }; const searchTasks = (params)=>request(`/tasks/search?${new URLSearchParams(params)}`); const getMyTasks = ()=>request('/tasks/my'); const getTasksForSpecialist = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks/for-me${qs}`); }; const getTaskCountsByCategory = ()=>request('/tasks/counts-by-category'); const getTask = (id)=>request(`/tasks/${id}`); const createTask = (data)=>request('/tasks', { method: 'POST', body: JSON.stringify(data) }); const updateTask = (id, data)=>request(`/tasks/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const completeTask = (id)=>request(`/tasks/${id}/complete`, { method: 'PATCH' }); const cancelTask = (id)=>request(`/tasks/${id}/cancel`, { method: 'PATCH' }); // ─── Offers ──────────────────────────────────────────────────────────────── const getOffers = (taskId)=>request(`/offers?taskId=${taskId}`); const getMyOffers = ()=>request('/offers/my'); const createOffer = (data)=>request('/offers', { method: 'POST', body: JSON.stringify(data) }); const acceptOffer = (id)=>request(`/offers/${id}/accept`, { method: 'PATCH' }); const declineOffer = (id)=>request(`/offers/${id}/decline`, { method: 'PATCH' }); const getUserProfile = (id, locale)=>request(`/users/${id}/profile${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); const getSpecialists = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/users/specialists${qs}`); }; const createReview = (data)=>request('/reviews', { method: 'POST', body: JSON.stringify(data) }); const getTaskReviews = (taskId)=>request(`/reviews/task/${taskId}`); const getMyReviews = ()=>request('/reviews/my'); // ─── Chat ────────────────────────────────────────────────────────────────── const getChatRooms = ()=>request('/chat/rooms'); const getOrCreateDirectRoom = (userId)=>request(`/chat/direct/${userId}`); const getCanMessage = (userId)=>request(`/chat/can-message/${userId}`); const getMessages = (roomId)=>request(`/chat/rooms/${roomId}/messages`); const sendMessage = (roomId, body)=>request('/chat/messages', { method: 'POST', body: JSON.stringify({ roomId, body }) }); // ─── Notifications ──────────────────────────────────────────────────────── const updateNotifSettings = (data)=>request('/users/me', { method: 'PATCH', body: JSON.stringify(data) }); const getNotifications = ()=>request('/notifications'); const getUnreadCount = ()=>request('/notifications/count'); const markRead = (id)=>request(`/notifications/${id}/read`, { method: 'PATCH' }); const markAllRead = ()=>request('/notifications/read-all', { method: 'PATCH' }); const getTaskInvite = (taskId)=>request(`/notifications?type=task_invite&referenceId=${taskId}`); const dismissNotification = (id)=>request(`/notifications/${id}`, { method: 'DELETE' }); // ─── Referral ───────────────────────────────────────────────────────────── const getMyReferralInfo = ()=>request('/users/me/referral'); const applyMyReferral = (refCode)=>request('/users/me/referral/apply', { method: 'POST', body: JSON.stringify({ refCode }) }); // ─── Reviews ────────────────────────────────────────────────────────────── const getUserReviews = (userId)=>request(`/reviews/user/${userId}`); const getUserRating = (userId)=>request(`/reviews/user/${userId}/rating`); // ─── Categories ─────────────────────────────────────────────────────────── const getCategories = ()=>request('/categories'); // ─── Locations ──────────────────────────────────────────────────────────── const getLocations = ()=>request('/locations'); // ─── Favorites ──────────────────────────────────────────────────────────── const getFavorites = ()=>request('/favorites'); const addFavorite = (taskId)=>request(`/favorites/${taskId}`, { method: 'POST' }); const removeFavorite = (taskId)=>request(`/favorites/${taskId}`, { method: 'DELETE' }); const getSpecialistFavorites = ()=>request('/favorites/specialists'); const addSpecialistFavorite = (specialistId)=>request(`/favorites/specialists/${specialistId}`, { method: 'POST' }); const removeSpecialistFavorite = (specialistId)=>request(`/favorites/specialists/${specialistId}`, { method: 'DELETE' }); // ─── Admin ───────────────────────────────────────────────────────────────── // ─── Admin Categories ────────────────────────────────────────────────────── const getAdminCategories = ()=>request('/admin/categories'); const createCategory = (data)=>request('/admin/categories', { method: 'POST', body: JSON.stringify(data) }); const updateCategory = (id, data)=>request(`/admin/categories/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const deleteCategory = (id)=>request(`/admin/categories/${id}`, { method: 'DELETE' }); // ─── Admin Skills ────────────────────────────────────────────────────────── const getAdminSkills = (categorySlug)=>request(`/admin/skills?categorySlug=${encodeURIComponent(categorySlug)}`); const createSkill = (data)=>request('/admin/skills', { method: 'POST', body: JSON.stringify(data) }); const updateSkill = (id, data)=>request(`/admin/skills/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const deleteSkill = (id)=>request(`/admin/skills/${id}`, { method: 'DELETE' }); const getSkillDedup = (categorySlug)=>request(`/admin/skills/dedup${categorySlug ? `?categorySlug=${encodeURIComponent(categorySlug)}` : ''}`); const mergeSkillDuplicates = (keepId, deleteIds)=>request('/admin/skills/dedup/merge', { method: 'POST', body: JSON.stringify({ keepId, deleteIds }) }); // ─── Admin ───────────────────────────────────────────────────────────────── const getAdminStats = ()=>request('/admin/stats'); const getAdminUsers = (page = 1, q, role)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (role) p.set('role', role); return request(`/admin/users?${p}`); }; const deactivateUser = (id)=>request(`/admin/users/${id}/deactivate`, { method: 'PATCH' }); const activateUser = (id)=>request(`/admin/users/${id}/activate`, { method: 'PATCH' }); const changeUserRole = (id, role)=>request(`/admin/users/${id}/role`, { method: 'PATCH', body: JSON.stringify({ role }) }); const getAdminUser = (id)=>request(`/admin/users/${id}`); const getAdminUserSpecialistCards = (userId)=>request(`/admin/users/${userId}/specialist-cards`); const adminUpdateSpecialistCard = (id, data)=>request(`/admin/specialist-cards/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const getAdminSpecialistCards = (page = 1, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request(`/admin/specialist-cards?${p}`); }; const updateAdminUser = (id, data)=>request(`/admin/users/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const verifyAdminUserEmail = (id)=>request(`/admin/users/${id}/verify-email`, { method: 'PATCH' }); const getAdminTasks = (page = 1, q, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (status) p.set('status', status); return request(`/admin/tasks?${p}`); }; const cancelTaskAdmin = (id)=>request(`/admin/tasks/${id}/cancel`, { method: 'PATCH' }); const deleteTaskAdmin = (id)=>request(`/admin/tasks/${id}`, { method: 'DELETE' }); const getAdminReports = (page = 1, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request(`/admin/reports?${p}`); }; const updateReportStatus = (id, status)=>request(`/admin/reports/${id}/status`, { method: 'PATCH', body: JSON.stringify({ status }) }); const getAdminAiLogs = (page = 1)=>request(`/admin/ai-logs?page=${page}&limit=50`); const getAdminActivityLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.userId) p.set('userId', params.userId); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/activity-logs?${p}`); }; const getAdminMailLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/mail-logs?${p}`); }; const getAdminNotifLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.type) p.set('type', params.type); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/notification-logs?${p}`); }; const getAdminNotifStats = ()=>request('/admin/notification-stats'); const getAdminMailStats = ()=>request('/admin/mail-stats'); const getAdminReferrals = ()=>request('/admin/referrals'); const adminSendPushToUser = (userId, data)=>request(`/admin/push/user/${userId}`, { method: 'POST', body: JSON.stringify(data) }); const adminBroadcastPush = (data)=>request('/admin/push/broadcast', { method: 'POST', body: JSON.stringify(data) }); // ─── Admin Locations ─────────────────────────────────────────────────────── const getAdminLocations = ()=>request('/admin/locations'); const createLocation = (data)=>request('/admin/locations', { method: 'POST', body: JSON.stringify(data) }); const updateLocation = (id, data)=>request(`/admin/locations/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const deleteLocation = (id)=>request(`/admin/locations/${id}`, { method: 'DELETE' }); // ─── Admin Plans ─────────────────────────────────────────────────────────── const getAdminPlans = ()=>request('/admin/plans'); const createPlan = (data)=>request('/admin/plans', { method: 'POST', body: JSON.stringify(data) }); const updatePlan = (id, data)=>request(`/admin/plans/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const deletePlan = (id)=>request(`/admin/plans/${id}`, { method: 'DELETE' }); // ─── Admin Settings ──────────────────────────────────────────────────────── const getAdminSettings = ()=>request('/admin/settings'); const updateAdminSettings = (data)=>request('/admin/settings', { method: 'PUT', body: JSON.stringify(data) }); const getAdminEmailTemplates = ()=>request('/admin/settings/templates'); const updateAdminEmailTemplate = (key, data)=>request(`/admin/settings/templates/${key}`, { method: 'PUT', body: JSON.stringify(data) }); const translateAdminEmailTemplate = (data)=>request('/admin/settings/templates/translate', { method: 'POST', body: JSON.stringify(data) }); const sendTestEmail = ()=>request('/admin/settings/test-email', { method: 'POST' }); const testTelegramConnection = (botToken, chatId)=>fetch(`${BASE}/api/admin/settings/test-telegram`, { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken, chatId }) }).then((r)=>r.json()); const verifyTelegramToken = (botToken)=>fetch(`${BASE}/api/admin/settings/verify-telegram-token`, { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken }) }).then((r)=>r.json()); const getTranslationsStats = ()=>request('/admin/translations/stats'); const getTranslationsMissing = (table, missingLang, page = 1, limit = 50)=>request(`/admin/translations/${table}?missingLang=${missingLang}&page=${page}&limit=${limit}`); const saveTranslations = (table, items)=>request(`/admin/translations/${table}/save`, { method: 'POST', body: JSON.stringify({ items }) }); const autoTranslate = (table, missingLang, fromLang, batchSize = 500)=>request('/admin/translations/auto-translate', { method: 'POST', body: JSON.stringify({ table, missingLang, fromLang, batchSize }) }); const autoTranslateTasks = (batchSize = 500)=>request('/admin/translations/auto-translate-tasks', { method: 'POST', body: JSON.stringify({ batchSize }) }); const getTasksTranslationPreview = (lang, limit = 50)=>request(`/admin/translations/tasks-preview?lang=${lang}&limit=${limit}`); const autoTranslateEmailTemplates = (missingLang, fromLang = 'el')=>request('/admin/translations/auto-translate-templates', { method: 'POST', body: JSON.stringify({ missingLang, fromLang }) }); // ─── Availability ────────────────────────────────────────────────────────── const getMyAvailability = (month)=>request(`/availability/my${month ? `?month=${month}` : ''}`); const setAvailability = (date, status, note)=>request('/availability/set', { method: 'POST', body: JSON.stringify({ date, status, note }) }); const setAvailabilityRange = (from, to, status)=>request('/availability/set-range', { method: 'POST', body: JSON.stringify({ from, to, status }) }); const getSpecialistAvailability = (userId, month)=>request(`/availability/user/${userId}${month ? `?month=${month}` : ''}`); const getMyPortfolio = ()=>request('/portfolio/my'); const addPortfolioItem = (formData)=>fetch(`${BASE}/api/portfolio`, { method: 'POST', credentials: 'include', body: formData }).then(async (res)=>{ if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); throw new Error(err.error || 'Upload failed'); } return res.json(); }); const updatePortfolioItem = (id, data)=>request(`/portfolio/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const deletePortfolioItem = (id)=>request(`/portfolio/${id}`, { method: 'DELETE' }); const getSpecialistPortfolio = (userId)=>request(`/portfolio/user/${userId}`); const getMySpecialistCards = ()=>request('/specialist-cards/my'); const createSpecialistCard = (data)=>request('/specialist-cards', { method: 'POST', body: JSON.stringify(data) }); const updateSpecialistCard = (id, data)=>request(`/specialist-cards/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const saveSiteSeo = (data)=>request('/users/me/site-seo', { method: 'POST', body: JSON.stringify(data) }); const deleteSpecialistCard = (id)=>request(`/specialist-cards/${id}`, { method: 'DELETE' }); const getSpecialistCards = (userId, locale)=>request(`/specialist-cards/user/${userId}${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); const getPriceList = (cardId, locale)=>request(`/price-list/${cardId}${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); const createPriceListGroup = (cardId, data)=>request(`/price-list/${cardId}/groups`, { method: 'POST', body: JSON.stringify(data) }); const updatePriceListGroup = (groupId, data)=>request(`/price-list/groups/${groupId}`, { method: 'PATCH', body: JSON.stringify(data) }); const deletePriceListGroup = (groupId)=>request(`/price-list/groups/${groupId}`, { method: 'DELETE' }); const createPriceListItem = (groupId, data)=>request(`/price-list/groups/${groupId}/items`, { method: 'POST', body: JSON.stringify(data) }); const updatePriceListItem = (itemId, data)=>request(`/price-list/items/${itemId}`, { method: 'PATCH', body: JSON.stringify(data) }); const deletePriceListItem = (itemId)=>request(`/price-list/items/${itemId}`, { method: 'DELETE' }); const getSkillSuggestions = (categorySlugs)=>{ const params = categorySlugs?.length ? '?' + categorySlugs.map((s)=>`category=${encodeURIComponent(s)}`).join('&') : ''; return request(`/skill-suggestions${params}`); }; const initiateTopUp = (amount)=>request('/payments/topup/init', { method: 'POST', body: JSON.stringify({ amount }) }); const getPaymentHistory = ()=>request('/payments/history'); const getBalanceHistory = (limit = 50)=>request(`/payments/balance-history?limit=${limit}`); const getPlanHistory = (limit = 50)=>request(`/users/me/plan-history?limit=${limit}`); const getAdminBalanceHistory = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.userId) p.set('userId', params.userId); if (params.kind) p.set('kind', params.kind); p.set('limit', '50'); return request(`/admin/balance-history?${p}`); }; const adminTopUpUserBalance = (id, data)=>request(`/admin/users/${id}/balance/topup`, { method: 'POST', body: JSON.stringify(data) }); const adminWithdrawUserBalance = (id, data)=>request(`/admin/users/${id}/balance/withdraw`, { method: 'POST', body: JSON.stringify(data) }); const previewPlanChange = (planId)=>request('/payments/plan/preview', { method: 'POST', body: JSON.stringify({ planId }) }); const getPlans = (role)=>{ const qs = role ? `?role=${role}` : ''; return request(`/plans${qs}`); }; const getMyDashboard = ()=>request('/dashboard/me'); const getDailyUsage = ()=>request('/plans/daily-usage'); const purchasePlan = (planId, payFromBalance = true)=>request('/payments/plan/purchase', { method: 'POST', body: JSON.stringify({ planId, payFromBalance }) }); // ─── Statuses ────────────────────────────────────────────────────────────── const getMyStatuses = ()=>request('/statuses/me'); const toggleStatus = (statusType, active)=>request('/statuses/toggle', { method: 'POST', body: JSON.stringify({ statusType, active }) }); const getAutoResponseSettings = ()=>request('/auto-response'); const updateAutoResponseSettings = (data)=>request('/auto-response', { method: 'PUT', body: JSON.stringify(data) }); // ─── FOMO ────────────────────────────────────────────────────────────────── const getSpecialistFomoDashboard = ()=>request('/fomo/specialist'); const getCustomerFomoDashboard = ()=>request('/fomo/customer'); const getFomoRecommendations = ()=>request('/fomo/recommendations'); // ─── Auto-match ──────────────────────────────────────────────────────────── const getAutoMatchResults = (taskId)=>request(`/auto-match/${taskId}`); const runAutoMatch = (taskId)=>request(`/auto-match/${taskId}`, { method: 'POST' }); // ─── Google Calendar ─────────────────────────────────────────────────────── const getGoogleCalendarStatus = ()=>request('/google/calendar/status'); const disconnectGoogleCalendar = ()=>request('/google/calendar/disconnect', { method: 'DELETE' }); const importFromGoogleCalendar = ()=>request('/google/calendar/import', { method: 'POST' }); const getGoogleCalendarConnectUrl = ()=>`${BASE}/api/google/calendar/connect`; // ─── Personal site ───────────────────────────────────────────────────────── const getPublicSiteProfile = (slug)=>request(`/users/site/${slug}`); const getSiteStats = ()=>request('/users/me/site-stats'); const trackSiteMessage = (slug)=>request(`/users/site/${slug}/track-message`, { method: 'POST' }).catch(()=>{}); // ─── Task stats (FOMO) ───────────────────────────────────────────────────── const getTaskStats = (taskId)=>request(`/tasks/${taskId}/stats`); // ─── Support tickets ─────────────────────────────────────────────────────── const sendPublicSupportMessage = (data)=>request('/support/public', { method: 'POST', body: JSON.stringify(data) }); const createSupportTicket = (data)=>request('/support', { method: 'POST', body: JSON.stringify(data) }); const getMySupportTickets = (page = 1)=>request(`/support/my?page=${page}`); const getAdminSupportTickets = (params)=>request(`/support${params ? '?' + new URLSearchParams(params) : ''}`); const replyToSupportTicket = (id, data)=>request(`/support/${id}/reply`, { method: 'PATCH', body: JSON.stringify(data) }); const setSupportTicketStatus = (id, status)=>request(`/support/${id}/status`, { method: 'PATCH', body: JSON.stringify({ status }) }); {"finalSource":true}mapbufferedMap ConcatSourceRawSource /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CC: () => (/* binding */ getTaskBudgetRange), /* harmony export */ F7: () => (/* binding */ getSpecialists), /* harmony export */ Vs: () => (/* binding */ getLocations), /* harmony export */ bW: () => (/* binding */ getCategories), /* harmony export */ gg: () => (/* binding */ getTask) /* harmony export */ }); /* unused harmony exports request, getTasks, searchTasks, getMyTasks, getTasksForSpecialist, getTaskCountsByCategory, createTask, updateTask, completeTask, cancelTask, getOffers, getMyOffers, createOffer, acceptOffer, declineOffer, getUserProfile, createReview, getTaskReviews, getMyReviews, getChatRooms, getOrCreateDirectRoom, getCanMessage, getMessages, sendMessage, updateNotifSettings, getNotifications, getUnreadCount, markRead, markAllRead, getTaskInvite, dismissNotification, getMyReferralInfo, applyMyReferral, getUserReviews, getUserRating, getFavorites, addFavorite, removeFavorite, getSpecialistFavorites, addSpecialistFavorite, removeSpecialistFavorite, getAdminCategories, createCategory, updateCategory, deleteCategory, getAdminSkills, createSkill, updateSkill, deleteSkill, getSkillDedup, mergeSkillDuplicates, getAdminStats, getAdminUsers, deactivateUser, activateUser, changeUserRole, getAdminUser, getAdminUserSpecialistCards, adminUpdateSpecialistCard, getAdminSpecialistCards, updateAdminUser, verifyAdminUserEmail, getAdminTasks, cancelTaskAdmin, deleteTaskAdmin, getAdminReports, updateReportStatus, getAdminAiLogs, getAdminActivityLogs, getAdminMailLogs, getAdminNotifLogs, getAdminNotifStats, getAdminMailStats, getAdminReferrals, adminSendPushToUser, adminBroadcastPush, getAdminLocations, createLocation, updateLocation, deleteLocation, getAdminPlans, createPlan, updatePlan, deletePlan, getAdminSettings, updateAdminSettings, getAdminEmailTemplates, updateAdminEmailTemplate, translateAdminEmailTemplate, sendTestEmail, testTelegramConnection, verifyTelegramToken, getTranslationsStats, getTranslationsMissing, saveTranslations, autoTranslate, autoTranslateTasks, getTasksTranslationPreview, autoTranslateEmailTemplates, getMyAvailability, setAvailability, setAvailabilityRange, getSpecialistAvailability, getMyPortfolio, addPortfolioItem, updatePortfolioItem, deletePortfolioItem, getSpecialistPortfolio, getMySpecialistCards, createSpecialistCard, updateSpecialistCard, saveSiteSeo, deleteSpecialistCard, getSpecialistCards, getPriceList, createPriceListGroup, updatePriceListGroup, deletePriceListGroup, createPriceListItem, updatePriceListItem, deletePriceListItem, getSkillSuggestions, initiateTopUp, getPaymentHistory, getBalanceHistory, getPlanHistory, getAdminBalanceHistory, adminTopUpUserBalance, adminWithdrawUserBalance, previewPlanChange, getPlans, getMyDashboard, getDailyUsage, purchasePlan, getMyStatuses, toggleStatus, getAutoResponseSettings, updateAutoResponseSettings, getSpecialistFomoDashboard, getCustomerFomoDashboard, getFomoRecommendations, getAutoMatchResults, runAutoMatch, getGoogleCalendarStatus, disconnectGoogleCalendar, importFromGoogleCalendar, getGoogleCalendarConnectUrl, getPublicSiteProfile, getSiteStats, trackSiteMessage, getTaskStats, sendPublicSupportMessage, createSupportTicket, getMySupportTickets, getAdminSupportTickets, replyToSupportTicket, setSupportTicketStatus */ ReplaceSourceRawSource[j// SSR: use INTERNAL_API_URL (http://localhost:4000) to avoid external DNS/SSL round-trip // Browser: use NEXT_PUBLIC_API_URL (https://api.canhelp.gr) const BASE = "undefined" === 'undefined' ? process.env.INTERNAL_API_URL || 'http://localhost:4000' : process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export async function request(path, init) { const url = `${BASE}/api${path}`; if ("undefined" === 'undefined') console.log('[api] SSR fetch', url); const res = await fetch(url, { ...init, credentials: 'include', headers: { 'Content-Type': 'application/json', ...init?.headers } }); if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); const msg = typeof err.error === 'string' ? err.error : typeof err.message === 'string' ? err.message : res.statusText || 'Request failed'; throw new Error(msg); } return res.json(); } // ─── Tasks ──────────────────────────────────────────────────────────────── export const getTasks = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks${qs}`); }; export const getTaskBudgetRange = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks/budget-range${qs}`); }; export const searchTasks = (params)=>request(`/tasks/search?${new URLSearchParams(params)}`); export const getMyTasks = ()=>request('/tasks/my'); export const getTasksForSpecialist = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks/for-me${qs}`); }; export const getTaskCountsByCategory = ()=>request('/tasks/counts-by-category'); export const getTask = (id)=>request(`/tasks/${id}`); export const createTask = (data)=>request('/tasks', { method: 'POST', body: JSON.stringify(data) }); export const updateTask = (id, data)=>request(`/tasks/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const completeTask = (id)=>request(`/tasks/${id}/complete`, { method: 'PATCH' }); export const cancelTask = (id)=>request(`/tasks/${id}/cancel`, { method: 'PATCH' }); // ─── Offers ──────────────────────────────────────────────────────────────── export const getOffers = (taskId)=>request(`/offers?taskId=${taskId}`); export const getMyOffers = ()=>request('/offers/my'); export const createOffer = (data)=>request('/offers', { method: 'POST', body: JSON.stringify(data) }); export const acceptOffer = (id)=>request(`/offers/${id}/accept`, { method: 'PATCH' }); export const declineOffer = (id)=>request(`/offers/${id}/decline`, { method: 'PATCH' }); export const getUserProfile = (id, locale)=>request(`/users/${id}/profile${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); export const getSpecialists = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/users/specialists${qs}`); }; export const createReview = (data)=>request('/reviews', { method: 'POST', body: JSON.stringify(data) }); export const getTaskReviews = (taskId)=>request(`/reviews/task/${taskId}`); export const getMyReviews = ()=>request('/reviews/my'); // ─── Chat ────────────────────────────────────────────────────────────────── export const getChatRooms = ()=>request('/chat/rooms'); export const getOrCreateDirectRoom = (userId)=>request(`/chat/direct/${userId}`); export const getCanMessage = (userId)=>request(`/chat/can-message/${userId}`); export const getMessages = (roomId)=>request(`/chat/rooms/${roomId}/messages`); export const sendMessage = (roomId, body)=>request('/chat/messages', { method: 'POST', body: JSON.stringify({ roomId, body }) }); // ─── Notifications ──────────────────────────────────────────────────────── export const updateNotifSettings = (data)=>request('/users/me', { method: 'PATCH', body: JSON.stringify(data) }); export const getNotifications = ()=>request('/notifications'); export const getUnreadCount = ()=>request('/notifications/count'); export const markRead = (id)=>request(`/notifications/${id}/read`, { method: 'PATCH' }); export const markAllRead = ()=>request('/notifications/read-all', { method: 'PATCH' }); export const getTaskInvite = (taskId)=>request(`/notifications?type=task_invite&referenceId=${taskId}`); export const dismissNotification = (id)=>request(`/notifications/${id}`, { method: 'DELETE' }); // ─── Referral ───────────────────────────────────────────────────────────── export const getMyReferralInfo = ()=>request('/users/me/referral'); export const applyMyReferral = (refCode)=>request('/users/me/referral/apply', { method: 'POST', body: JSON.stringify({ refCode }) }); // ─── Reviews ────────────────────────────────────────────────────────────── export const getUserReviews = (userId)=>request(`/reviews/user/${userId}`); export const getUserRating = (userId)=>request(`/reviews/user/${userId}/rating`); // ─── Categories ─────────────────────────────────────────────────────────── export const getCategories = ()=>request('/categories'); // ─── Locations ──────────────────────────────────────────────────────────── export const getLocations = ()=>request('/locations'); // ─── Favorites ──────────────────────────────────────────────────────────── export const getFavorites = ()=>request('/favorites'); export const addFavorite = (taskId)=>request(`/favorites/${taskId}`, { method: 'POST' }); export const removeFavorite = (taskId)=>request(`/favorites/${taskId}`, { method: 'DELETE' }); export const getSpecialistFavorites = ()=>request('/favorites/specialists'); export const addSpecialistFavorite = (specialistId)=>request(`/favorites/specialists/${specialistId}`, { method: 'POST' }); export const removeSpecialistFavorite = (specialistId)=>request(`/favorites/specialists/${specialistId}`, { method: 'DELETE' }); // ─── Admin ───────────────────────────────────────────────────────────────── // ─── Admin Categories ────────────────────────────────────────────────────── export const getAdminCategories = ()=>request('/admin/categories'); export const createCategory = (data)=>request('/admin/categories', { method: 'POST', body: JSON.stringify(data) }); export const updateCategory = (id, data)=>request(`/admin/categories/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deleteCategory = (id)=>request(`/admin/categories/${id}`, { method: 'DELETE' }); // ─── Admin Skills ────────────────────────────────────────────────────────── export const getAdminSkills = (categorySlug)=>request(`/admin/skills?categorySlug=${encodeURIComponent(categorySlug)}`); export const createSkill = (data)=>request('/admin/skills', { method: 'POST', body: JSON.stringify(data) }); export const updateSkill = (id, data)=>request(`/admin/skills/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deleteSkill = (id)=>request(`/admin/skills/${id}`, { method: 'DELETE' }); export const getSkillDedup = (categorySlug)=>request(`/admin/skills/dedup${categorySlug ? `?categorySlug=${encodeURIComponent(categorySlug)}` : ''}`); export const mergeSkillDuplicates = (keepId, deleteIds)=>request('/admin/skills/dedup/merge', { method: 'POST', body: JSON.stringify({ keepId, deleteIds }) }); // ─── Admin ───────────────────────────────────────────────────────────────── export const getAdminStats = ()=>request('/admin/stats'); export const getAdminUsers = (page = 1, q, role)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (role) p.set('role', role); return request(`/admin/users?${p}`); }; export const deactivateUser = (id)=>request(`/admin/users/${id}/deactivate`, { method: 'PATCH' }); export const activateUser = (id)=>request(`/admin/users/${id}/activate`, { method: 'PATCH' }); export const changeUserRole = (id, role)=>request(`/admin/users/${id}/role`, { method: 'PATCH', body: JSON.stringify({ role }) }); export const getAdminUser = (id)=>request(`/admin/users/${id}`); export const getAdminUserSpecialistCards = (userId)=>request(`/admin/users/${userId}/specialist-cards`); export const adminUpdateSpecialistCard = (id, data)=>request(`/admin/specialist-cards/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const getAdminSpecialistCards = (page = 1, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request(`/admin/specialist-cards?${p}`); }; export const updateAdminUser = (id, data)=>request(`/admin/users/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const verifyAdminUserEmail = (id)=>request(`/admin/users/${id}/verify-email`, { method: 'PATCH' }); export const getAdminTasks = (page = 1, q, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (status) p.set('status', status); return request(`/admin/tasks?${p}`); }; export const cancelTaskAdmin = (id)=>request(`/admin/tasks/${id}/cancel`, { method: 'PATCH' }); export const deleteTaskAdmin = (id)=>request(`/admin/tasks/${id}`, { method: 'DELETE' }); export const getAdminReports = (page = 1, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request(`/admin/reports?${p}`); }; export const updateReportStatus = (id, status)=>request(`/admin/reports/${id}/status`, { method: 'PATCH', body: JSON.stringify({ status }) }); export const getAdminAiLogs = (page = 1)=>request(`/admin/ai-logs?page=${page}&limit=50`); export const getAdminActivityLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.userId) p.set('userId', params.userId); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/activity-logs?${p}`); }; export const getAdminMailLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/mail-logs?${p}`); }; export const getAdminNotifLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.type) p.set('type', params.type); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/notification-logs?${p}`); }; export const getAdminNotifStats = ()=>request('/admin/notification-stats'); export const getAdminMailStats = ()=>request('/admin/mail-stats'); export const getAdminReferrals = ()=>request('/admin/referrals'); export const adminSendPushToUser = (userId, data)=>request(`/admin/push/user/${userId}`, { method: 'POST', body: JSON.stringify(data) }); export const adminBroadcastPush = (data)=>request('/admin/push/broadcast', { method: 'POST', body: JSON.stringify(data) }); // ─── Admin Locations ─────────────────────────────────────────────────────── export const getAdminLocations = ()=>request('/admin/locations'); export const createLocation = (data)=>request('/admin/locations', { method: 'POST', body: JSON.stringify(data) }); export const updateLocation = (id, data)=>request(`/admin/locations/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deleteLocation = (id)=>request(`/admin/locations/${id}`, { method: 'DELETE' }); // ─── Admin Plans ─────────────────────────────────────────────────────────── export const getAdminPlans = ()=>request('/admin/plans'); export const createPlan = (data)=>request('/admin/plans', { method: 'POST', body: JSON.stringify(data) }); export const updatePlan = (id, data)=>request(`/admin/plans/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deletePlan = (id)=>request(`/admin/plans/${id}`, { method: 'DELETE' }); // ─── Admin Settings ──────────────────────────────────────────────────────── export const getAdminSettings = ()=>request('/admin/settings'); export const updateAdminSettings = (data)=>request('/admin/settings', { method: 'PUT', body: JSON.stringify(data) }); export const getAdminEmailTemplates = ()=>request('/admin/settings/templates'); export const updateAdminEmailTemplate = (key, data)=>request(`/admin/settings/templates/${key}`, { method: 'PUT', body: JSON.stringify(data) }); export const translateAdminEmailTemplate = (data)=>request('/admin/settings/templates/translate', { method: 'POST', body: JSON.stringify(data) }); export const sendTestEmail = ()=>request('/admin/settings/test-email', { method: 'POST' }); export const testTelegramConnection = (botToken, chatId)=>fetch(`${BASE}/api/admin/settings/test-telegram`, { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken, chatId }) }).then((r)=>r.json()); export const verifyTelegramToken = (botToken)=>fetch(`${BASE}/api/admin/settings/verify-telegram-token`, { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken }) }).then((r)=>r.json()); export const getTranslationsStats = ()=>request('/admin/translations/stats'); export const getTranslationsMissing = (table, missingLang, page = 1, limit = 50)=>request(`/admin/translations/${table}?missingLang=${missingLang}&page=${page}&limit=${limit}`); export const saveTranslations = (table, items)=>request(`/admin/translations/${table}/save`, { method: 'POST', body: JSON.stringify({ items }) }); export const autoTranslate = (table, missingLang, fromLang, batchSize = 500)=>request('/admin/translations/auto-translate', { method: 'POST', body: JSON.stringify({ table, missingLang, fromLang, batchSize }) }); export const autoTranslateTasks = (batchSize = 500)=>request('/admin/translations/auto-translate-tasks', { method: 'POST', body: JSON.stringify({ batchSize }) }); export const getTasksTranslationPreview = (lang, limit = 50)=>request(`/admin/translations/tasks-preview?lang=${lang}&limit=${limit}`); export const autoTranslateEmailTemplates = (missingLang, fromLang = 'el')=>request('/admin/translations/auto-translate-templates', { method: 'POST', body: JSON.stringify({ missingLang, fromLang }) }); // ─── Availability ────────────────────────────────────────────────────────── export const getMyAvailability = (month)=>request(`/availability/my${month ? `?month=${month}` : ''}`); export const setAvailability = (date, status, note)=>request('/availability/set', { method: 'POST', body: JSON.stringify({ date, status, note }) }); export const setAvailabilityRange = (from, to, status)=>request('/availability/set-range', { method: 'POST', body: JSON.stringify({ from, to, status }) }); export const getSpecialistAvailability = (userId, month)=>request(`/availability/user/${userId}${month ? `?month=${month}` : ''}`); export const getMyPortfolio = ()=>request('/portfolio/my'); export const addPortfolioItem = (formData)=>fetch(`${BASE}/api/portfolio`, { method: 'POST', credentials: 'include', body: formData }).then(async (res)=>{ if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); throw new Error(err.error || 'Upload failed'); } return res.json(); }); export const updatePortfolioItem = (id, data)=>request(`/portfolio/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deletePortfolioItem = (id)=>request(`/portfolio/${id}`, { method: 'DELETE' }); export const getSpecialistPortfolio = (userId)=>request(`/portfolio/user/${userId}`); export const getMySpecialistCards = ()=>request('/specialist-cards/my'); export const createSpecialistCard = (data)=>request('/specialist-cards', { method: 'POST', body: JSON.stringify(data) }); export const updateSpecialistCard = (id, data)=>request(`/specialist-cards/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const saveSiteSeo = (data)=>request('/users/me/site-seo', { method: 'POST', body: JSON.stringify(data) }); export const deleteSpecialistCard = (id)=>request(`/specialist-cards/${id}`, { method: 'DELETE' }); export const getSpecialistCards = (userId, locale)=>request(`/specialist-cards/user/${userId}${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); export const getPriceList = (cardId, locale)=>request(`/price-list/${cardId}${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); export const createPriceListGroup = (cardId, data)=>request(`/price-list/${cardId}/groups`, { method: 'POST', body: JSON.stringify(data) }); export const updatePriceListGroup = (groupId, data)=>request(`/price-list/groups/${groupId}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deletePriceListGroup = (groupId)=>request(`/price-list/groups/${groupId}`, { method: 'DELETE' }); export const createPriceListItem = (groupId, data)=>request(`/price-list/groups/${groupId}/items`, { method: 'POST', body: JSON.stringify(data) }); export const updatePriceListItem = (itemId, data)=>request(`/price-list/items/${itemId}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deletePriceListItem = (itemId)=>request(`/price-list/items/${itemId}`, { method: 'DELETE' }); export const getSkillSuggestions = (categorySlugs)=>{ const params = categorySlugs?.length ? '?' + categorySlugs.map((s)=>`category=${encodeURIComponent(s)}`).join('&') : ''; return request(`/skill-suggestions${params}`); }; export const initiateTopUp = (amount)=>request('/payments/topup/init', { method: 'POST', body: JSON.stringify({ amount }) }); export const getPaymentHistory = ()=>request('/payments/history'); export const getBalanceHistory = (limit = 50)=>request(`/payments/balance-history?limit=${limit}`); export const getPlanHistory = (limit = 50)=>request(`/users/me/plan-history?limit=${limit}`); export const getAdminBalanceHistory = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.userId) p.set('userId', params.userId); if (params.kind) p.set('kind', params.kind); p.set('limit', '50'); return request(`/admin/balance-history?${p}`); }; export const adminTopUpUserBalance = (id, data)=>request(`/admin/users/${id}/balance/topup`, { method: 'POST', body: JSON.stringify(data) }); export const adminWithdrawUserBalance = (id, data)=>request(`/admin/users/${id}/balance/withdraw`, { method: 'POST', body: JSON.stringify(data) }); export const previewPlanChange = (planId)=>request('/payments/plan/preview', { method: 'POST', body: JSON.stringify({ planId }) }); export const getPlans = (role)=>{ const qs = role ? `?role=${role}` : ''; return request(`/plans${qs}`); }; export const getMyDashboard = ()=>request('/dashboard/me'); export const getDailyUsage = ()=>request('/plans/daily-usage'); export const purchasePlan = (planId, payFromBalance = true)=>request('/payments/plan/purchase', { method: 'POST', body: JSON.stringify({ planId, payFromBalance }) }); // ─── Statuses ────────────────────────────────────────────────────────────── export const getMyStatuses = ()=>request('/statuses/me'); export const toggleStatus = (statusType, active)=>request('/statuses/toggle', { method: 'POST', body: JSON.stringify({ statusType, active }) }); export const getAutoResponseSettings = ()=>request('/auto-response'); export const updateAutoResponseSettings = (data)=>request('/auto-response', { method: 'PUT', body: JSON.stringify(data) }); // ─── FOMO ────────────────────────────────────────────────────────────────── export const getSpecialistFomoDashboard = ()=>request('/fomo/specialist'); export const getCustomerFomoDashboard = ()=>request('/fomo/customer'); export const getFomoRecommendations = ()=>request('/fomo/recommendations'); // ─── Auto-match ──────────────────────────────────────────────────────────── export const getAutoMatchResults = (taskId)=>request(`/auto-match/${taskId}`); export const runAutoMatch = (taskId)=>request(`/auto-match/${taskId}`, { method: 'POST' }); // ─── Google Calendar ─────────────────────────────────────────────────────── export const getGoogleCalendarStatus = ()=>request('/google/calendar/status'); export const disconnectGoogleCalendar = ()=>request('/google/calendar/disconnect', { method: 'DELETE' }); export const importFromGoogleCalendar = ()=>request('/google/calendar/import', { method: 'POST' }); export const getGoogleCalendarConnectUrl = ()=>`${BASE}/api/google/calendar/connect`; // ─── Personal site ───────────────────────────────────────────────────────── export const getPublicSiteProfile = (slug)=>request(`/users/site/${slug}`); export const getSiteStats = ()=>request('/users/me/site-stats'); export const trackSiteMessage = (slug)=>request(`/users/site/${slug}/track-message`, { method: 'POST' }).catch(()=>{}); // ─── Task stats (FOMO) ───────────────────────────────────────────────────── export const getTaskStats = (taskId)=>request(`/tasks/${taskId}/stats`); // ─── Support tickets ─────────────────────────────────────────────────────── export const sendPublicSupportMessage = (data)=>request('/support/public', { method: 'POST', body: JSON.stringify(data) }); export const createSupportTicket = (data)=>request('/support', { method: 'POST', body: JSON.stringify(data) }); export const getMySupportTickets = (page = 1)=>request(`/support/my?page=${page}`); export const getAdminSupportTickets = (params)=>request(`/support${params ? '?' + new URLSearchParams(params) : ''}`); export const replyToSupportTicket = (id, data)=>request(`/support/${id}/reply`, { method: 'PATCH', body: JSON.stringify(data) }); export const setSupportTicketStatus = (id, status)=>request(`/support/${id}/status`, { method: 'PATCH', body: JSON.stringify({ status }) });  164190 trueundefined2523090undefined312318undefined402428trueundefined10771083undefined12151221undefined13761382undefined14701476undefined15221528undefined16801686undefined17611767undefined18151821undefined19361942undefined20682074undefined21692175undefined23452351undefined24172423undefined24712477undefined25942600undefined26932699undefined27942800undefined29272933undefined30833089undefined32083214undefined32843290undefined34193425undefined34753481undefined35573563undefined36363642undefined37163722undefined39763982undefined41104116undefined41734179undefined42404246undefined43414347undefined44414447undefined45464552undefined47324738undefined48004806undefined50525058undefined51285134undefined52885294undefined54235429undefined55565562undefined56115617undefined57135719undefined58205826undefined58975903undefined60336039undefined63326338undefined64006406undefined65366542undefined66836689undefined68686874undefined69896995undefined71187124undefined72587264undefined73577363undefined75087514undefined77997805undefined78577863undefined81068112undefined82178223undefined83248330undefined84958501undefined85608566undefined86658671undefined88298835undefined90989104undefined92419247undefined93609366undefined96179623undefined97259731undefined98279833undefined1007910085undefined1026210268undefined1035310359undefined1080110807undefined1118611192undefined1157711583undefined1165311659undefined1172011726undefined1178611792undefined1194411950undefined1216712173undefined1223312239undefined1236812374undefined1251412520undefined1269812704undefined1275612762undefined1288312889undefined1302113027undefined1319713203undefined1326113267undefined1339913405undefined1347913485undefined1364413650undefined1381113817undefined1391513921undefined1426914275undefined1460014606undefined1467814684undefined1485614862undefined1504315049undefined1533115337undefined1553415540undefined1567015676undefined1600216008undefined1610616112undefined1631916325undefined1653916545undefined1667116677undefined1673116737undefined1715817164undefined1730317309undefined1740717413undefined1749317499undefined1756617572undefined1770817714undefined1786117867undefined1799518001undefined1810718113undefined1826018266undefined1839618402undefined1855718563undefined1872118727undefined1884418850undefined1901219018undefined1917219178undefined1929119297undefined1952419530undefined1969019696undefined1975719763undefined1985719863undefined1995119957undefined2028420290undefined2044620452undefined2061420620undefined2078620792undefined2090220908undefined2096220968undefined2102621032undefined2132421330undefined2138221388undefined2157921585undefined2164921655undefined2187221878undefined2194721953undefined2201822024undefined2217322179undefined2225222258undefined2243522441undefined2251422520undefined2263222638undefined2274422750undefined2290922915undefined2298522991undefined2305023056undefined2326123267undefined2341323419undefined2355723563undefined2368923695undefined2377323779undefined2389223898undefined2404224048undefined /***/ }) buffersourcesizemapshashr/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CC: () => (/* binding */ getTaskBudgetRange), /* harmony export */ F7: () => (/* binding */ getSpecialists), /* harmony export */ Vs: () => (/* binding */ getLocations), /* harmony export */ bW: () => (/* binding */ getCategories), /* harmony export */ gg: () => (/* binding */ getTask) /* harmony export */ }); /* unused harmony exports request, getTasks, searchTasks, getMyTasks, getTasksForSpecialist, getTaskCountsByCategory, createTask, updateTask, completeTask, cancelTask, getOffers, getMyOffers, createOffer, acceptOffer, declineOffer, getUserProfile, createReview, getTaskReviews, getMyReviews, getChatRooms, getOrCreateDirectRoom, getCanMessage, getMessages, sendMessage, updateNotifSettings, getNotifications, getUnreadCount, markRead, markAllRead, getTaskInvite, dismissNotification, getMyReferralInfo, applyMyReferral, getUserReviews, getUserRating, getFavorites, addFavorite, removeFavorite, getSpecialistFavorites, addSpecialistFavorite, removeSpecialistFavorite, getAdminCategories, createCategory, updateCategory, deleteCategory, getAdminSkills, createSkill, updateSkill, deleteSkill, getSkillDedup, mergeSkillDuplicates, getAdminStats, getAdminUsers, deactivateUser, activateUser, changeUserRole, getAdminUser, getAdminUserSpecialistCards, adminUpdateSpecialistCard, getAdminSpecialistCards, updateAdminUser, verifyAdminUserEmail, getAdminTasks, cancelTaskAdmin, deleteTaskAdmin, getAdminReports, updateReportStatus, getAdminAiLogs, getAdminActivityLogs, getAdminMailLogs, getAdminNotifLogs, getAdminNotifStats, getAdminMailStats, getAdminReferrals, adminSendPushToUser, adminBroadcastPush, getAdminLocations, createLocation, updateLocation, deleteLocation, getAdminPlans, createPlan, updatePlan, deletePlan, getAdminSettings, updateAdminSettings, getAdminEmailTemplates, updateAdminEmailTemplate, translateAdminEmailTemplate, sendTestEmail, testTelegramConnection, verifyTelegramToken, getTranslationsStats, getTranslationsMissing, saveTranslations, autoTranslate, autoTranslateTasks, getTasksTranslationPreview, autoTranslateEmailTemplates, getMyAvailability, setAvailability, setAvailabilityRange, getSpecialistAvailability, getMyPortfolio, addPortfolioItem, updatePortfolioItem, deletePortfolioItem, getSpecialistPortfolio, getMySpecialistCards, createSpecialistCard, updateSpecialistCard, saveSiteSeo, deleteSpecialistCard, getSpecialistCards, getPriceList, createPriceListGroup, updatePriceListGroup, deletePriceListGroup, createPriceListItem, updatePriceListItem, deletePriceListItem, getSkillSuggestions, initiateTopUp, getPaymentHistory, getBalanceHistory, getPlanHistory, getAdminBalanceHistory, adminTopUpUserBalance, adminWithdrawUserBalance, previewPlanChange, getPlans, getMyDashboard, getDailyUsage, purchasePlan, getMyStatuses, toggleStatus, getAutoResponseSettings, updateAutoResponseSettings, getSpecialistFomoDashboard, getCustomerFomoDashboard, getFomoRecommendations, getAutoMatchResults, runAutoMatch, getGoogleCalendarStatus, disconnectGoogleCalendar, importFromGoogleCalendar, getGoogleCalendarConnectUrl, getPublicSiteProfile, getSiteStats, trackSiteMessage, getTaskStats, sendPublicSupportMessage, createSupportTicket, getMySupportTickets, getAdminSupportTickets, replyToSupportTicket, setSupportTicketStatus */ // SSR: use INTERNAL_API_URL (http://localhost:4000) to avoid external DNS/SSL round-trip // Browser: use NEXT_PUBLIC_API_URL (https://api.canhelp.gr) const BASE = true ? process.env.INTERNAL_API_URL || 'http://localhost:4000' : 0; async function request(path, init) { const url = `${BASE}/api${path}`; if (true) console.log('[api] SSR fetch', url); const res = await fetch(url, { ...init, credentials: 'include', headers: { 'Content-Type': 'application/json', ...init?.headers } }); if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); const msg = typeof err.error === 'string' ? err.error : typeof err.message === 'string' ? err.message : res.statusText || 'Request failed'; throw new Error(msg); } return res.json(); } // ─── Tasks ──────────────────────────────────────────────────────────────── const getTasks = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks${qs}`); }; const getTaskBudgetRange = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks/budget-range${qs}`); }; const searchTasks = (params)=>request(`/tasks/search?${new URLSearchParams(params)}`); const getMyTasks = ()=>request('/tasks/my'); const getTasksForSpecialist = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks/for-me${qs}`); }; const getTaskCountsByCategory = ()=>request('/tasks/counts-by-category'); const getTask = (id)=>request(`/tasks/${id}`); const createTask = (data)=>request('/tasks', { method: 'POST', body: JSON.stringify(data) }); const updateTask = (id, data)=>request(`/tasks/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const completeTask = (id)=>request(`/tasks/${id}/complete`, { method: 'PATCH' }); const cancelTask = (id)=>request(`/tasks/${id}/cancel`, { method: 'PATCH' }); // ─── Offers ──────────────────────────────────────────────────────────────── const getOffers = (taskId)=>request(`/offers?taskId=${taskId}`); const getMyOffers = ()=>request('/offers/my'); const createOffer = (data)=>request('/offers', { method: 'POST', body: JSON.stringify(data) }); const acceptOffer = (id)=>request(`/offers/${id}/accept`, { method: 'PATCH' }); const declineOffer = (id)=>request(`/offers/${id}/decline`, { method: 'PATCH' }); const getUserProfile = (id, locale)=>request(`/users/${id}/profile${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); const getSpecialists = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/users/specialists${qs}`); }; const createReview = (data)=>request('/reviews', { method: 'POST', body: JSON.stringify(data) }); const getTaskReviews = (taskId)=>request(`/reviews/task/${taskId}`); const getMyReviews = ()=>request('/reviews/my'); // ─── Chat ────────────────────────────────────────────────────────────────── const getChatRooms = ()=>request('/chat/rooms'); const getOrCreateDirectRoom = (userId)=>request(`/chat/direct/${userId}`); const getCanMessage = (userId)=>request(`/chat/can-message/${userId}`); const getMessages = (roomId)=>request(`/chat/rooms/${roomId}/messages`); const sendMessage = (roomId, body)=>request('/chat/messages', { method: 'POST', body: JSON.stringify({ roomId, body }) }); // ─── Notifications ──────────────────────────────────────────────────────── const updateNotifSettings = (data)=>request('/users/me', { method: 'PATCH', body: JSON.stringify(data) }); const getNotifications = ()=>request('/notifications'); const getUnreadCount = ()=>request('/notifications/count'); const markRead = (id)=>request(`/notifications/${id}/read`, { method: 'PATCH' }); const markAllRead = ()=>request('/notifications/read-all', { method: 'PATCH' }); const getTaskInvite = (taskId)=>request(`/notifications?type=task_invite&referenceId=${taskId}`); const dismissNotification = (id)=>request(`/notifications/${id}`, { method: 'DELETE' }); // ─── Referral ───────────────────────────────────────────────────────────── const getMyReferralInfo = ()=>request('/users/me/referral'); const applyMyReferral = (refCode)=>request('/users/me/referral/apply', { method: 'POST', body: JSON.stringify({ refCode }) }); // ─── Reviews ────────────────────────────────────────────────────────────── const getUserReviews = (userId)=>request(`/reviews/user/${userId}`); const getUserRating = (userId)=>request(`/reviews/user/${userId}/rating`); // ─── Categories ─────────────────────────────────────────────────────────── const getCategories = ()=>request('/categories'); // ─── Locations ──────────────────────────────────────────────────────────── const getLocations = ()=>request('/locations'); // ─── Favorites ──────────────────────────────────────────────────────────── const getFavorites = ()=>request('/favorites'); const addFavorite = (taskId)=>request(`/favorites/${taskId}`, { method: 'POST' }); const removeFavorite = (taskId)=>request(`/favorites/${taskId}`, { method: 'DELETE' }); const getSpecialistFavorites = ()=>request('/favorites/specialists'); const addSpecialistFavorite = (specialistId)=>request(`/favorites/specialists/${specialistId}`, { method: 'POST' }); const removeSpecialistFavorite = (specialistId)=>request(`/favorites/specialists/${specialistId}`, { method: 'DELETE' }); // ─── Admin ───────────────────────────────────────────────────────────────── // ─── Admin Categories ────────────────────────────────────────────────────── const getAdminCategories = ()=>request('/admin/categories'); const createCategory = (data)=>request('/admin/categories', { method: 'POST', body: JSON.stringify(data) }); const updateCategory = (id, data)=>request(`/admin/categories/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const deleteCategory = (id)=>request(`/admin/categories/${id}`, { method: 'DELETE' }); // ─── Admin Skills ────────────────────────────────────────────────────────── const getAdminSkills = (categorySlug)=>request(`/admin/skills?categorySlug=${encodeURIComponent(categorySlug)}`); const createSkill = (data)=>request('/admin/skills', { method: 'POST', body: JSON.stringify(data) }); const updateSkill = (id, data)=>request(`/admin/skills/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const deleteSkill = (id)=>request(`/admin/skills/${id}`, { method: 'DELETE' }); const getSkillDedup = (categorySlug)=>request(`/admin/skills/dedup${categorySlug ? `?categorySlug=${encodeURIComponent(categorySlug)}` : ''}`); const mergeSkillDuplicates = (keepId, deleteIds)=>request('/admin/skills/dedup/merge', { method: 'POST', body: JSON.stringify({ keepId, deleteIds }) }); // ─── Admin ───────────────────────────────────────────────────────────────── const getAdminStats = ()=>request('/admin/stats'); const getAdminUsers = (page = 1, q, role)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (role) p.set('role', role); return request(`/admin/users?${p}`); }; const deactivateUser = (id)=>request(`/admin/users/${id}/deactivate`, { method: 'PATCH' }); const activateUser = (id)=>request(`/admin/users/${id}/activate`, { method: 'PATCH' }); const changeUserRole = (id, role)=>request(`/admin/users/${id}/role`, { method: 'PATCH', body: JSON.stringify({ role }) }); const getAdminUser = (id)=>request(`/admin/users/${id}`); const getAdminUserSpecialistCards = (userId)=>request(`/admin/users/${userId}/specialist-cards`); const adminUpdateSpecialistCard = (id, data)=>request(`/admin/specialist-cards/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const getAdminSpecialistCards = (page = 1, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request(`/admin/specialist-cards?${p}`); }; const updateAdminUser = (id, data)=>request(`/admin/users/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const verifyAdminUserEmail = (id)=>request(`/admin/users/${id}/verify-email`, { method: 'PATCH' }); const getAdminTasks = (page = 1, q, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (status) p.set('status', status); return request(`/admin/tasks?${p}`); }; const cancelTaskAdmin = (id)=>request(`/admin/tasks/${id}/cancel`, { method: 'PATCH' }); const deleteTaskAdmin = (id)=>request(`/admin/tasks/${id}`, { method: 'DELETE' }); const getAdminReports = (page = 1, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request(`/admin/reports?${p}`); }; const updateReportStatus = (id, status)=>request(`/admin/reports/${id}/status`, { method: 'PATCH', body: JSON.stringify({ status }) }); const getAdminAiLogs = (page = 1)=>request(`/admin/ai-logs?page=${page}&limit=50`); const getAdminActivityLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.userId) p.set('userId', params.userId); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/activity-logs?${p}`); }; const getAdminMailLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/mail-logs?${p}`); }; const getAdminNotifLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.type) p.set('type', params.type); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/notification-logs?${p}`); }; const getAdminNotifStats = ()=>request('/admin/notification-stats'); const getAdminMailStats = ()=>request('/admin/mail-stats'); const getAdminReferrals = ()=>request('/admin/referrals'); const adminSendPushToUser = (userId, data)=>request(`/admin/push/user/${userId}`, { method: 'POST', body: JSON.stringify(data) }); const adminBroadcastPush = (data)=>request('/admin/push/broadcast', { method: 'POST', body: JSON.stringify(data) }); // ─── Admin Locations ─────────────────────────────────────────────────────── const getAdminLocations = ()=>request('/admin/locations'); const createLocation = (data)=>request('/admin/locations', { method: 'POST', body: JSON.stringify(data) }); const updateLocation = (id, data)=>request(`/admin/locations/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const deleteLocation = (id)=>request(`/admin/locations/${id}`, { method: 'DELETE' }); // ─── Admin Plans ─────────────────────────────────────────────────────────── const getAdminPlans = ()=>request('/admin/plans'); const createPlan = (data)=>request('/admin/plans', { method: 'POST', body: JSON.stringify(data) }); const updatePlan = (id, data)=>request(`/admin/plans/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const deletePlan = (id)=>request(`/admin/plans/${id}`, { method: 'DELETE' }); // ─── Admin Settings ──────────────────────────────────────────────────────── const getAdminSettings = ()=>request('/admin/settings'); const updateAdminSettings = (data)=>request('/admin/settings', { method: 'PUT', body: JSON.stringify(data) }); const getAdminEmailTemplates = ()=>request('/admin/settings/templates'); const updateAdminEmailTemplate = (key, data)=>request(`/admin/settings/templates/${key}`, { method: 'PUT', body: JSON.stringify(data) }); const translateAdminEmailTemplate = (data)=>request('/admin/settings/templates/translate', { method: 'POST', body: JSON.stringify(data) }); const sendTestEmail = ()=>request('/admin/settings/test-email', { method: 'POST' }); const testTelegramConnection = (botToken, chatId)=>fetch(`${BASE}/api/admin/settings/test-telegram`, { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken, chatId }) }).then((r)=>r.json()); const verifyTelegramToken = (botToken)=>fetch(`${BASE}/api/admin/settings/verify-telegram-token`, { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken }) }).then((r)=>r.json()); const getTranslationsStats = ()=>request('/admin/translations/stats'); const getTranslationsMissing = (table, missingLang, page = 1, limit = 50)=>request(`/admin/translations/${table}?missingLang=${missingLang}&page=${page}&limit=${limit}`); const saveTranslations = (table, items)=>request(`/admin/translations/${table}/save`, { method: 'POST', body: JSON.stringify({ items }) }); const autoTranslate = (table, missingLang, fromLang, batchSize = 500)=>request('/admin/translations/auto-translate', { method: 'POST', body: JSON.stringify({ table, missingLang, fromLang, batchSize }) }); const autoTranslateTasks = (batchSize = 500)=>request('/admin/translations/auto-translate-tasks', { method: 'POST', body: JSON.stringify({ batchSize }) }); const getTasksTranslationPreview = (lang, limit = 50)=>request(`/admin/translations/tasks-preview?lang=${lang}&limit=${limit}`); const autoTranslateEmailTemplates = (missingLang, fromLang = 'el')=>request('/admin/translations/auto-translate-templates', { method: 'POST', body: JSON.stringify({ missingLang, fromLang }) }); // ─── Availability ────────────────────────────────────────────────────────── const getMyAvailability = (month)=>request(`/availability/my${month ? `?month=${month}` : ''}`); const setAvailability = (date, status, note)=>request('/availability/set', { method: 'POST', body: JSON.stringify({ date, status, note }) }); const setAvailabilityRange = (from, to, status)=>request('/availability/set-range', { method: 'POST', body: JSON.stringify({ from, to, status }) }); const getSpecialistAvailability = (userId, month)=>request(`/availability/user/${userId}${month ? `?month=${month}` : ''}`); const getMyPortfolio = ()=>request('/portfolio/my'); const addPortfolioItem = (formData)=>fetch(`${BASE}/api/portfolio`, { method: 'POST', credentials: 'include', body: formData }).then(async (res)=>{ if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); throw new Error(err.error || 'Upload failed'); } return res.json(); }); const updatePortfolioItem = (id, data)=>request(`/portfolio/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const deletePortfolioItem = (id)=>request(`/portfolio/${id}`, { method: 'DELETE' }); const getSpecialistPortfolio = (userId)=>request(`/portfolio/user/${userId}`); const getMySpecialistCards = ()=>request('/specialist-cards/my'); const createSpecialistCard = (data)=>request('/specialist-cards', { method: 'POST', body: JSON.stringify(data) }); const updateSpecialistCard = (id, data)=>request(`/specialist-cards/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const saveSiteSeo = (data)=>request('/users/me/site-seo', { method: 'POST', body: JSON.stringify(data) }); const deleteSpecialistCard = (id)=>request(`/specialist-cards/${id}`, { method: 'DELETE' }); const getSpecialistCards = (userId, locale)=>request(`/specialist-cards/user/${userId}${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); const getPriceList = (cardId, locale)=>request(`/price-list/${cardId}${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); const createPriceListGroup = (cardId, data)=>request(`/price-list/${cardId}/groups`, { method: 'POST', body: JSON.stringify(data) }); const updatePriceListGroup = (groupId, data)=>request(`/price-list/groups/${groupId}`, { method: 'PATCH', body: JSON.stringify(data) }); const deletePriceListGroup = (groupId)=>request(`/price-list/groups/${groupId}`, { method: 'DELETE' }); const createPriceListItem = (groupId, data)=>request(`/price-list/groups/${groupId}/items`, { method: 'POST', body: JSON.stringify(data) }); const updatePriceListItem = (itemId, data)=>request(`/price-list/items/${itemId}`, { method: 'PATCH', body: JSON.stringify(data) }); const deletePriceListItem = (itemId)=>request(`/price-list/items/${itemId}`, { method: 'DELETE' }); const getSkillSuggestions = (categorySlugs)=>{ const params = categorySlugs?.length ? '?' + categorySlugs.map((s)=>`category=${encodeURIComponent(s)}`).join('&') : ''; return request(`/skill-suggestions${params}`); }; const initiateTopUp = (amount)=>request('/payments/topup/init', { method: 'POST', body: JSON.stringify({ amount }) }); const getPaymentHistory = ()=>request('/payments/history'); const getBalanceHistory = (limit = 50)=>request(`/payments/balance-history?limit=${limit}`); const getPlanHistory = (limit = 50)=>request(`/users/me/plan-history?limit=${limit}`); const getAdminBalanceHistory = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.userId) p.set('userId', params.userId); if (params.kind) p.set('kind', params.kind); p.set('limit', '50'); return request(`/admin/balance-history?${p}`); }; const adminTopUpUserBalance = (id, data)=>request(`/admin/users/${id}/balance/topup`, { method: 'POST', body: JSON.stringify(data) }); const adminWithdrawUserBalance = (id, data)=>request(`/admin/users/${id}/balance/withdraw`, { method: 'POST', body: JSON.stringify(data) }); const previewPlanChange = (planId)=>request('/payments/plan/preview', { method: 'POST', body: JSON.stringify({ planId }) }); const getPlans = (role)=>{ const qs = role ? `?role=${role}` : ''; return request(`/plans${qs}`); }; const getMyDashboard = ()=>request('/dashboard/me'); const getDailyUsage = ()=>request('/plans/daily-usage'); const purchasePlan = (planId, payFromBalance = true)=>request('/payments/plan/purchase', { method: 'POST', body: JSON.stringify({ planId, payFromBalance }) }); // ─── Statuses ────────────────────────────────────────────────────────────── const getMyStatuses = ()=>request('/statuses/me'); const toggleStatus = (statusType, active)=>request('/statuses/toggle', { method: 'POST', body: JSON.stringify({ statusType, active }) }); const getAutoResponseSettings = ()=>request('/auto-response'); const updateAutoResponseSettings = (data)=>request('/auto-response', { method: 'PUT', body: JSON.stringify(data) }); // ─── FOMO ────────────────────────────────────────────────────────────────── const getSpecialistFomoDashboard = ()=>request('/fomo/specialist'); const getCustomerFomoDashboard = ()=>request('/fomo/customer'); const getFomoRecommendations = ()=>request('/fomo/recommendations'); // ─── Auto-match ──────────────────────────────────────────────────────────── const getAutoMatchResults = (taskId)=>request(`/auto-match/${taskId}`); const runAutoMatch = (taskId)=>request(`/auto-match/${taskId}`, { method: 'POST' }); // ─── Google Calendar ─────────────────────────────────────────────────────── const getGoogleCalendarStatus = ()=>request('/google/calendar/status'); const disconnectGoogleCalendar = ()=>request('/google/calendar/disconnect', { method: 'DELETE' }); const importFromGoogleCalendar = ()=>request('/google/calendar/import', { method: 'POST' }); const getGoogleCalendarConnectUrl = ()=>`${BASE}/api/google/calendar/connect`; // ─── Personal site ───────────────────────────────────────────────────────── const getPublicSiteProfile = (slug)=>request(`/users/site/${slug}`); const getSiteStats = ()=>request('/users/me/site-stats'); const trackSiteMessage = (slug)=>request(`/users/site/${slug}/track-message`, { method: 'POST' }).catch(()=>{}); // ─── Task stats (FOMO) ───────────────────────────────────────────────────── const getTaskStats = (taskId)=>request(`/tasks/${taskId}/stats`); // ─── Support tickets ─────────────────────────────────────────────────────── const sendPublicSupportMessage = (data)=>request('/support/public', { method: 'POST', body: JSON.stringify(data) }); const createSupportTicket = (data)=>request('/support', { method: 'POST', body: JSON.stringify(data) }); const getMySupportTickets = (page = 1)=>request(`/support/my?page=${page}`); const getAdminSupportTickets = (params)=>request(`/support${params ? '?' + new URLSearchParams(params) : ''}`); const replyToSupportTicket = (id, data)=>request(`/support/${id}/reply`, { method: 'PATCH', body: JSON.stringify(data) }); const setSupportTicketStatus = (id, status)=>request(`/support/${id}/status`, { method: 'PATCH', body: JSON.stringify({ status }) }); /***/ }) {"finalSource":true}mapbufferedMap  ConcatSourceRawSourceQ/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {  /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CC: () => (/* binding */ getTaskBudgetRange), /* harmony export */ F7: () => (/* binding */ getSpecialists), /* harmony export */ Vs: () => (/* binding */ getLocations), /* harmony export */ bW: () => (/* binding */ getCategories), /* harmony export */ gg: () => (/* binding */ getTask) /* harmony export */ }); /* unused harmony exports request, getTasks, searchTasks, getMyTasks, getTasksForSpecialist, getTaskCountsByCategory, createTask, updateTask, completeTask, cancelTask, getOffers, getMyOffers, createOffer, acceptOffer, declineOffer, getUserProfile, createReview, getTaskReviews, getMyReviews, getChatRooms, getOrCreateDirectRoom, getCanMessage, getMessages, sendMessage, updateNotifSettings, getNotifications, getUnreadCount, markRead, markAllRead, getTaskInvite, dismissNotification, getMyReferralInfo, applyMyReferral, getUserReviews, getUserRating, getFavorites, addFavorite, removeFavorite, getSpecialistFavorites, addSpecialistFavorite, removeSpecialistFavorite, getAdminCategories, createCategory, updateCategory, deleteCategory, getAdminSkills, createSkill, updateSkill, deleteSkill, getSkillDedup, mergeSkillDuplicates, getAdminStats, getAdminUsers, deactivateUser, activateUser, changeUserRole, getAdminUser, getAdminUserSpecialistCards, adminUpdateSpecialistCard, getAdminSpecialistCards, updateAdminUser, verifyAdminUserEmail, getAdminTasks, cancelTaskAdmin, deleteTaskAdmin, getAdminReports, updateReportStatus, getAdminAiLogs, getAdminActivityLogs, getAdminMailLogs, getAdminNotifLogs, getAdminNotifStats, getAdminMailStats, getAdminReferrals, adminSendPushToUser, adminBroadcastPush, getAdminLocations, createLocation, updateLocation, deleteLocation, getAdminPlans, createPlan, updatePlan, deletePlan, getAdminSettings, updateAdminSettings, getAdminEmailTemplates, updateAdminEmailTemplate, translateAdminEmailTemplate, sendTestEmail, testTelegramConnection, verifyTelegramToken, getTranslationsStats, getTranslationsMissing, saveTranslations, autoTranslate, autoTranslateTasks, getTasksTranslationPreview, autoTranslateEmailTemplates, getMyAvailability, setAvailability, setAvailabilityRange, getSpecialistAvailability, getMyPortfolio, addPortfolioItem, updatePortfolioItem, deletePortfolioItem, getSpecialistPortfolio, getMySpecialistCards, createSpecialistCard, updateSpecialistCard, saveSiteSeo, deleteSpecialistCard, getSpecialistCards, getPriceList, createPriceListGroup, updatePriceListGroup, deletePriceListGroup, createPriceListItem, updatePriceListItem, deletePriceListItem, getSkillSuggestions, initiateTopUp, getPaymentHistory, getBalanceHistory, getPlanHistory, getAdminBalanceHistory, adminTopUpUserBalance, adminWithdrawUserBalance, previewPlanChange, getPlans, getMyDashboard, getDailyUsage, purchasePlan, getMyStatuses, toggleStatus, getAutoResponseSettings, updateAutoResponseSettings, getSpecialistFomoDashboard, getCustomerFomoDashboard, getFomoRecommendations, getAutoMatchResults, runAutoMatch, getGoogleCalendarStatus, disconnectGoogleCalendar, importFromGoogleCalendar, getGoogleCalendarConnectUrl, getPublicSiteProfile, getSiteStats, trackSiteMessage, getTaskStats, sendPublicSupportMessage, createSupportTicket, getMySupportTickets, getAdminSupportTickets, replyToSupportTicket, setSupportTicketStatus */ ReplaceSourceRawSource[j// SSR: use INTERNAL_API_URL (http://localhost:4000) to avoid external DNS/SSL round-trip // Browser: use NEXT_PUBLIC_API_URL (https://api.canhelp.gr) const BASE = "undefined" === 'undefined' ? process.env.INTERNAL_API_URL || 'http://localhost:4000' : process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export async function request(path, init) { const url = `${BASE}/api${path}`; if ("undefined" === 'undefined') console.log('[api] SSR fetch', url); const res = await fetch(url, { ...init, credentials: 'include', headers: { 'Content-Type': 'application/json', ...init?.headers } }); if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); const msg = typeof err.error === 'string' ? err.error : typeof err.message === 'string' ? err.message : res.statusText || 'Request failed'; throw new Error(msg); } return res.json(); } // ─── Tasks ──────────────────────────────────────────────────────────────── export const getTasks = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks${qs}`); }; export const getTaskBudgetRange = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks/budget-range${qs}`); }; export const searchTasks = (params)=>request(`/tasks/search?${new URLSearchParams(params)}`); export const getMyTasks = ()=>request('/tasks/my'); export const getTasksForSpecialist = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks/for-me${qs}`); }; export const getTaskCountsByCategory = ()=>request('/tasks/counts-by-category'); export const getTask = (id)=>request(`/tasks/${id}`); export const createTask = (data)=>request('/tasks', { method: 'POST', body: JSON.stringify(data) }); export const updateTask = (id, data)=>request(`/tasks/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const completeTask = (id)=>request(`/tasks/${id}/complete`, { method: 'PATCH' }); export const cancelTask = (id)=>request(`/tasks/${id}/cancel`, { method: 'PATCH' }); // ─── Offers ──────────────────────────────────────────────────────────────── export const getOffers = (taskId)=>request(`/offers?taskId=${taskId}`); export const getMyOffers = ()=>request('/offers/my'); export const createOffer = (data)=>request('/offers', { method: 'POST', body: JSON.stringify(data) }); export const acceptOffer = (id)=>request(`/offers/${id}/accept`, { method: 'PATCH' }); export const declineOffer = (id)=>request(`/offers/${id}/decline`, { method: 'PATCH' }); export const getUserProfile = (id, locale)=>request(`/users/${id}/profile${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); export const getSpecialists = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/users/specialists${qs}`); }; export const createReview = (data)=>request('/reviews', { method: 'POST', body: JSON.stringify(data) }); export const getTaskReviews = (taskId)=>request(`/reviews/task/${taskId}`); export const getMyReviews = ()=>request('/reviews/my'); // ─── Chat ────────────────────────────────────────────────────────────────── export const getChatRooms = ()=>request('/chat/rooms'); export const getOrCreateDirectRoom = (userId)=>request(`/chat/direct/${userId}`); export const getCanMessage = (userId)=>request(`/chat/can-message/${userId}`); export const getMessages = (roomId)=>request(`/chat/rooms/${roomId}/messages`); export const sendMessage = (roomId, body)=>request('/chat/messages', { method: 'POST', body: JSON.stringify({ roomId, body }) }); // ─── Notifications ──────────────────────────────────────────────────────── export const updateNotifSettings = (data)=>request('/users/me', { method: 'PATCH', body: JSON.stringify(data) }); export const getNotifications = ()=>request('/notifications'); export const getUnreadCount = ()=>request('/notifications/count'); export const markRead = (id)=>request(`/notifications/${id}/read`, { method: 'PATCH' }); export const markAllRead = ()=>request('/notifications/read-all', { method: 'PATCH' }); export const getTaskInvite = (taskId)=>request(`/notifications?type=task_invite&referenceId=${taskId}`); export const dismissNotification = (id)=>request(`/notifications/${id}`, { method: 'DELETE' }); // ─── Referral ───────────────────────────────────────────────────────────── export const getMyReferralInfo = ()=>request('/users/me/referral'); export const applyMyReferral = (refCode)=>request('/users/me/referral/apply', { method: 'POST', body: JSON.stringify({ refCode }) }); // ─── Reviews ────────────────────────────────────────────────────────────── export const getUserReviews = (userId)=>request(`/reviews/user/${userId}`); export const getUserRating = (userId)=>request(`/reviews/user/${userId}/rating`); // ─── Categories ─────────────────────────────────────────────────────────── export const getCategories = ()=>request('/categories'); // ─── Locations ──────────────────────────────────────────────────────────── export const getLocations = ()=>request('/locations'); // ─── Favorites ──────────────────────────────────────────────────────────── export const getFavorites = ()=>request('/favorites'); export const addFavorite = (taskId)=>request(`/favorites/${taskId}`, { method: 'POST' }); export const removeFavorite = (taskId)=>request(`/favorites/${taskId}`, { method: 'DELETE' }); export const getSpecialistFavorites = ()=>request('/favorites/specialists'); export const addSpecialistFavorite = (specialistId)=>request(`/favorites/specialists/${specialistId}`, { method: 'POST' }); export const removeSpecialistFavorite = (specialistId)=>request(`/favorites/specialists/${specialistId}`, { method: 'DELETE' }); // ─── Admin ───────────────────────────────────────────────────────────────── // ─── Admin Categories ────────────────────────────────────────────────────── export const getAdminCategories = ()=>request('/admin/categories'); export const createCategory = (data)=>request('/admin/categories', { method: 'POST', body: JSON.stringify(data) }); export const updateCategory = (id, data)=>request(`/admin/categories/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deleteCategory = (id)=>request(`/admin/categories/${id}`, { method: 'DELETE' }); // ─── Admin Skills ────────────────────────────────────────────────────────── export const getAdminSkills = (categorySlug)=>request(`/admin/skills?categorySlug=${encodeURIComponent(categorySlug)}`); export const createSkill = (data)=>request('/admin/skills', { method: 'POST', body: JSON.stringify(data) }); export const updateSkill = (id, data)=>request(`/admin/skills/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deleteSkill = (id)=>request(`/admin/skills/${id}`, { method: 'DELETE' }); export const getSkillDedup = (categorySlug)=>request(`/admin/skills/dedup${categorySlug ? `?categorySlug=${encodeURIComponent(categorySlug)}` : ''}`); export const mergeSkillDuplicates = (keepId, deleteIds)=>request('/admin/skills/dedup/merge', { method: 'POST', body: JSON.stringify({ keepId, deleteIds }) }); // ─── Admin ───────────────────────────────────────────────────────────────── export const getAdminStats = ()=>request('/admin/stats'); export const getAdminUsers = (page = 1, q, role)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (role) p.set('role', role); return request(`/admin/users?${p}`); }; export const deactivateUser = (id)=>request(`/admin/users/${id}/deactivate`, { method: 'PATCH' }); export const activateUser = (id)=>request(`/admin/users/${id}/activate`, { method: 'PATCH' }); export const changeUserRole = (id, role)=>request(`/admin/users/${id}/role`, { method: 'PATCH', body: JSON.stringify({ role }) }); export const getAdminUser = (id)=>request(`/admin/users/${id}`); export const getAdminUserSpecialistCards = (userId)=>request(`/admin/users/${userId}/specialist-cards`); export const adminUpdateSpecialistCard = (id, data)=>request(`/admin/specialist-cards/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const getAdminSpecialistCards = (page = 1, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request(`/admin/specialist-cards?${p}`); }; export const updateAdminUser = (id, data)=>request(`/admin/users/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const verifyAdminUserEmail = (id)=>request(`/admin/users/${id}/verify-email`, { method: 'PATCH' }); export const getAdminTasks = (page = 1, q, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (status) p.set('status', status); return request(`/admin/tasks?${p}`); }; export const cancelTaskAdmin = (id)=>request(`/admin/tasks/${id}/cancel`, { method: 'PATCH' }); export const deleteTaskAdmin = (id)=>request(`/admin/tasks/${id}`, { method: 'DELETE' }); export const getAdminReports = (page = 1, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request(`/admin/reports?${p}`); }; export const updateReportStatus = (id, status)=>request(`/admin/reports/${id}/status`, { method: 'PATCH', body: JSON.stringify({ status }) }); export const getAdminAiLogs = (page = 1)=>request(`/admin/ai-logs?page=${page}&limit=50`); export const getAdminActivityLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.userId) p.set('userId', params.userId); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/activity-logs?${p}`); }; export const getAdminMailLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/mail-logs?${p}`); }; export const getAdminNotifLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.type) p.set('type', params.type); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/notification-logs?${p}`); }; export const getAdminNotifStats = ()=>request('/admin/notification-stats'); export const getAdminMailStats = ()=>request('/admin/mail-stats'); export const getAdminReferrals = ()=>request('/admin/referrals'); export const adminSendPushToUser = (userId, data)=>request(`/admin/push/user/${userId}`, { method: 'POST', body: JSON.stringify(data) }); export const adminBroadcastPush = (data)=>request('/admin/push/broadcast', { method: 'POST', body: JSON.stringify(data) }); // ─── Admin Locations ─────────────────────────────────────────────────────── export const getAdminLocations = ()=>request('/admin/locations'); export const createLocation = (data)=>request('/admin/locations', { method: 'POST', body: JSON.stringify(data) }); export const updateLocation = (id, data)=>request(`/admin/locations/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deleteLocation = (id)=>request(`/admin/locations/${id}`, { method: 'DELETE' }); // ─── Admin Plans ─────────────────────────────────────────────────────────── export const getAdminPlans = ()=>request('/admin/plans'); export const createPlan = (data)=>request('/admin/plans', { method: 'POST', body: JSON.stringify(data) }); export const updatePlan = (id, data)=>request(`/admin/plans/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deletePlan = (id)=>request(`/admin/plans/${id}`, { method: 'DELETE' }); // ─── Admin Settings ──────────────────────────────────────────────────────── export const getAdminSettings = ()=>request('/admin/settings'); export const updateAdminSettings = (data)=>request('/admin/settings', { method: 'PUT', body: JSON.stringify(data) }); export const getAdminEmailTemplates = ()=>request('/admin/settings/templates'); export const updateAdminEmailTemplate = (key, data)=>request(`/admin/settings/templates/${key}`, { method: 'PUT', body: JSON.stringify(data) }); export const translateAdminEmailTemplate = (data)=>request('/admin/settings/templates/translate', { method: 'POST', body: JSON.stringify(data) }); export const sendTestEmail = ()=>request('/admin/settings/test-email', { method: 'POST' }); export const testTelegramConnection = (botToken, chatId)=>fetch(`${BASE}/api/admin/settings/test-telegram`, { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken, chatId }) }).then((r)=>r.json()); export const verifyTelegramToken = (botToken)=>fetch(`${BASE}/api/admin/settings/verify-telegram-token`, { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken }) }).then((r)=>r.json()); export const getTranslationsStats = ()=>request('/admin/translations/stats'); export const getTranslationsMissing = (table, missingLang, page = 1, limit = 50)=>request(`/admin/translations/${table}?missingLang=${missingLang}&page=${page}&limit=${limit}`); export const saveTranslations = (table, items)=>request(`/admin/translations/${table}/save`, { method: 'POST', body: JSON.stringify({ items }) }); export const autoTranslate = (table, missingLang, fromLang, batchSize = 500)=>request('/admin/translations/auto-translate', { method: 'POST', body: JSON.stringify({ table, missingLang, fromLang, batchSize }) }); export const autoTranslateTasks = (batchSize = 500)=>request('/admin/translations/auto-translate-tasks', { method: 'POST', body: JSON.stringify({ batchSize }) }); export const getTasksTranslationPreview = (lang, limit = 50)=>request(`/admin/translations/tasks-preview?lang=${lang}&limit=${limit}`); export const autoTranslateEmailTemplates = (missingLang, fromLang = 'el')=>request('/admin/translations/auto-translate-templates', { method: 'POST', body: JSON.stringify({ missingLang, fromLang }) }); // ─── Availability ────────────────────────────────────────────────────────── export const getMyAvailability = (month)=>request(`/availability/my${month ? `?month=${month}` : ''}`); export const setAvailability = (date, status, note)=>request('/availability/set', { method: 'POST', body: JSON.stringify({ date, status, note }) }); export const setAvailabilityRange = (from, to, status)=>request('/availability/set-range', { method: 'POST', body: JSON.stringify({ from, to, status }) }); export const getSpecialistAvailability = (userId, month)=>request(`/availability/user/${userId}${month ? `?month=${month}` : ''}`); export const getMyPortfolio = ()=>request('/portfolio/my'); export const addPortfolioItem = (formData)=>fetch(`${BASE}/api/portfolio`, { method: 'POST', credentials: 'include', body: formData }).then(async (res)=>{ if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); throw new Error(err.error || 'Upload failed'); } return res.json(); }); export const updatePortfolioItem = (id, data)=>request(`/portfolio/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deletePortfolioItem = (id)=>request(`/portfolio/${id}`, { method: 'DELETE' }); export const getSpecialistPortfolio = (userId)=>request(`/portfolio/user/${userId}`); export const getMySpecialistCards = ()=>request('/specialist-cards/my'); export const createSpecialistCard = (data)=>request('/specialist-cards', { method: 'POST', body: JSON.stringify(data) }); export const updateSpecialistCard = (id, data)=>request(`/specialist-cards/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); export const saveSiteSeo = (data)=>request('/users/me/site-seo', { method: 'POST', body: JSON.stringify(data) }); export const deleteSpecialistCard = (id)=>request(`/specialist-cards/${id}`, { method: 'DELETE' }); export const getSpecialistCards = (userId, locale)=>request(`/specialist-cards/user/${userId}${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); export const getPriceList = (cardId, locale)=>request(`/price-list/${cardId}${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); export const createPriceListGroup = (cardId, data)=>request(`/price-list/${cardId}/groups`, { method: 'POST', body: JSON.stringify(data) }); export const updatePriceListGroup = (groupId, data)=>request(`/price-list/groups/${groupId}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deletePriceListGroup = (groupId)=>request(`/price-list/groups/${groupId}`, { method: 'DELETE' }); export const createPriceListItem = (groupId, data)=>request(`/price-list/groups/${groupId}/items`, { method: 'POST', body: JSON.stringify(data) }); export const updatePriceListItem = (itemId, data)=>request(`/price-list/items/${itemId}`, { method: 'PATCH', body: JSON.stringify(data) }); export const deletePriceListItem = (itemId)=>request(`/price-list/items/${itemId}`, { method: 'DELETE' }); export const getSkillSuggestions = (categorySlugs)=>{ const params = categorySlugs?.length ? '?' + categorySlugs.map((s)=>`category=${encodeURIComponent(s)}`).join('&') : ''; return request(`/skill-suggestions${params}`); }; export const initiateTopUp = (amount)=>request('/payments/topup/init', { method: 'POST', body: JSON.stringify({ amount }) }); export const getPaymentHistory = ()=>request('/payments/history'); export const getBalanceHistory = (limit = 50)=>request(`/payments/balance-history?limit=${limit}`); export const getPlanHistory = (limit = 50)=>request(`/users/me/plan-history?limit=${limit}`); export const getAdminBalanceHistory = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.userId) p.set('userId', params.userId); if (params.kind) p.set('kind', params.kind); p.set('limit', '50'); return request(`/admin/balance-history?${p}`); }; export const adminTopUpUserBalance = (id, data)=>request(`/admin/users/${id}/balance/topup`, { method: 'POST', body: JSON.stringify(data) }); export const adminWithdrawUserBalance = (id, data)=>request(`/admin/users/${id}/balance/withdraw`, { method: 'POST', body: JSON.stringify(data) }); export const previewPlanChange = (planId)=>request('/payments/plan/preview', { method: 'POST', body: JSON.stringify({ planId }) }); export const getPlans = (role)=>{ const qs = role ? `?role=${role}` : ''; return request(`/plans${qs}`); }; export const getMyDashboard = ()=>request('/dashboard/me'); export const getDailyUsage = ()=>request('/plans/daily-usage'); export const purchasePlan = (planId, payFromBalance = true)=>request('/payments/plan/purchase', { method: 'POST', body: JSON.stringify({ planId, payFromBalance }) }); // ─── Statuses ────────────────────────────────────────────────────────────── export const getMyStatuses = ()=>request('/statuses/me'); export const toggleStatus = (statusType, active)=>request('/statuses/toggle', { method: 'POST', body: JSON.stringify({ statusType, active }) }); export const getAutoResponseSettings = ()=>request('/auto-response'); export const updateAutoResponseSettings = (data)=>request('/auto-response', { method: 'PUT', body: JSON.stringify(data) }); // ─── FOMO ────────────────────────────────────────────────────────────────── export const getSpecialistFomoDashboard = ()=>request('/fomo/specialist'); export const getCustomerFomoDashboard = ()=>request('/fomo/customer'); export const getFomoRecommendations = ()=>request('/fomo/recommendations'); // ─── Auto-match ──────────────────────────────────────────────────────────── export const getAutoMatchResults = (taskId)=>request(`/auto-match/${taskId}`); export const runAutoMatch = (taskId)=>request(`/auto-match/${taskId}`, { method: 'POST' }); // ─── Google Calendar ─────────────────────────────────────────────────────── export const getGoogleCalendarStatus = ()=>request('/google/calendar/status'); export const disconnectGoogleCalendar = ()=>request('/google/calendar/disconnect', { method: 'DELETE' }); export const importFromGoogleCalendar = ()=>request('/google/calendar/import', { method: 'POST' }); export const getGoogleCalendarConnectUrl = ()=>`${BASE}/api/google/calendar/connect`; // ─── Personal site ───────────────────────────────────────────────────────── export const getPublicSiteProfile = (slug)=>request(`/users/site/${slug}`); export const getSiteStats = ()=>request('/users/me/site-stats'); export const trackSiteMessage = (slug)=>request(`/users/site/${slug}/track-message`, { method: 'POST' }).catch(()=>{}); // ─── Task stats (FOMO) ───────────────────────────────────────────────────── export const getTaskStats = (taskId)=>request(`/tasks/${taskId}/stats`); // ─── Support tickets ─────────────────────────────────────────────────────── export const sendPublicSupportMessage = (data)=>request('/support/public', { method: 'POST', body: JSON.stringify(data) }); export const createSupportTicket = (data)=>request('/support', { method: 'POST', body: JSON.stringify(data) }); export const getMySupportTickets = (page = 1)=>request(`/support/my?page=${page}`); export const getAdminSupportTickets = (params)=>request(`/support${params ? '?' + new URLSearchParams(params) : ''}`); export const replyToSupportTicket = (id, data)=>request(`/support/${id}/reply`, { method: 'PATCH', body: JSON.stringify(data) }); export const setSupportTicketStatus = (id, status)=>request(`/support/${id}/status`, { method: 'PATCH', body: JSON.stringify({ status }) });  164190 trueundefined2523090undefined312318undefined402428trueundefined10771083undefined12151221undefined13761382undefined14701476undefined15221528undefined16801686undefined17611767undefined18151821undefined19361942undefined20682074undefined21692175undefined23452351undefined24172423undefined24712477undefined25942600undefined26932699undefined27942800undefined29272933undefined30833089undefined32083214undefined32843290undefined34193425undefined34753481undefined35573563undefined36363642undefined37163722undefined39763982undefined41104116undefined41734179undefined42404246undefined43414347undefined44414447undefined45464552undefined47324738undefined48004806undefined50525058undefined51285134undefined52885294undefined54235429undefined55565562undefined56115617undefined57135719undefined58205826undefined58975903undefined60336039undefined63326338undefined64006406undefined65366542undefined66836689undefined68686874undefined69896995undefined71187124undefined72587264undefined73577363undefined75087514undefined77997805undefined78577863undefined81068112undefined82178223undefined83248330undefined84958501undefined85608566undefined86658671undefined88298835undefined90989104undefined92419247undefined93609366undefined96179623undefined97259731undefined98279833undefined1007910085undefined1026210268undefined1035310359undefined1080110807undefined1118611192undefined1157711583undefined1165311659undefined1172011726undefined1178611792undefined1194411950undefined1216712173undefined1223312239undefined1236812374undefined1251412520undefined1269812704undefined1275612762undefined1288312889undefined1302113027undefined1319713203undefined1326113267undefined1339913405undefined1347913485undefined1364413650undefined1381113817undefined1391513921undefined1426914275undefined1460014606undefined1467814684undefined1485614862undefined1504315049undefined1533115337undefined1553415540undefined1567015676undefined1600216008undefined1610616112undefined1631916325undefined1653916545undefined1667116677undefined1673116737undefined1715817164undefined1730317309undefined1740717413undefined1749317499undefined1756617572undefined1770817714undefined1786117867undefined1799518001undefined1810718113undefined1826018266undefined1839618402undefined1855718563undefined1872118727undefined1884418850undefined1901219018undefined1917219178undefined1929119297undefined1952419530undefined1969019696undefined1975719763undefined1985719863undefined1995119957undefined2028420290undefined2044620452undefined2061420620undefined2078620792undefined2090220908undefined2096220968undefined2102621032undefined2132421330undefined2138221388undefined2157921585undefined2164921655undefined2187221878undefined2194721953undefined2201822024undefined2217322179undefined2225222258undefined2243522441undefined2251422520undefined2263222638undefined2274422750undefined2290922915undefined2298522991undefined2305023056undefined2326123267undefined2341323419undefined2355723563undefined2368923695undefined2377323779undefined2389223898undefined2404224048undefined RawSource /***/ }) }; ; Xs"use strict"; exports.id = 902; exports.ids = [902]; exports.modules = { /***/ 59902: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CC: () => (/* binding */ getTaskBudgetRange), /* harmony export */ F7: () => (/* binding */ getSpecialists), /* harmony export */ Vs: () => (/* binding */ getLocations), /* harmony export */ bW: () => (/* binding */ getCategories), /* harmony export */ gg: () => (/* binding */ getTask) /* harmony export */ }); /* unused harmony exports request, getTasks, searchTasks, getMyTasks, getTasksForSpecialist, getTaskCountsByCategory, createTask, updateTask, completeTask, cancelTask, getOffers, getMyOffers, createOffer, acceptOffer, declineOffer, getUserProfile, createReview, getTaskReviews, getMyReviews, getChatRooms, getOrCreateDirectRoom, getCanMessage, getMessages, sendMessage, updateNotifSettings, getNotifications, getUnreadCount, markRead, markAllRead, getTaskInvite, dismissNotification, getMyReferralInfo, applyMyReferral, getUserReviews, getUserRating, getFavorites, addFavorite, removeFavorite, getSpecialistFavorites, addSpecialistFavorite, removeSpecialistFavorite, getAdminCategories, createCategory, updateCategory, deleteCategory, getAdminSkills, createSkill, updateSkill, deleteSkill, getSkillDedup, mergeSkillDuplicates, getAdminStats, getAdminUsers, deactivateUser, activateUser, changeUserRole, getAdminUser, getAdminUserSpecialistCards, adminUpdateSpecialistCard, getAdminSpecialistCards, updateAdminUser, verifyAdminUserEmail, getAdminTasks, cancelTaskAdmin, deleteTaskAdmin, getAdminReports, updateReportStatus, getAdminAiLogs, getAdminActivityLogs, getAdminMailLogs, getAdminNotifLogs, getAdminNotifStats, getAdminMailStats, getAdminReferrals, adminSendPushToUser, adminBroadcastPush, getAdminLocations, createLocation, updateLocation, deleteLocation, getAdminPlans, createPlan, updatePlan, deletePlan, getAdminSettings, updateAdminSettings, getAdminEmailTemplates, updateAdminEmailTemplate, translateAdminEmailTemplate, sendTestEmail, testTelegramConnection, verifyTelegramToken, getTranslationsStats, getTranslationsMissing, saveTranslations, autoTranslate, autoTranslateTasks, getTasksTranslationPreview, autoTranslateEmailTemplates, getMyAvailability, setAvailability, setAvailabilityRange, getSpecialistAvailability, getMyPortfolio, addPortfolioItem, updatePortfolioItem, deletePortfolioItem, getSpecialistPortfolio, getMySpecialistCards, createSpecialistCard, updateSpecialistCard, saveSiteSeo, deleteSpecialistCard, getSpecialistCards, getPriceList, createPriceListGroup, updatePriceListGroup, deletePriceListGroup, createPriceListItem, updatePriceListItem, deletePriceListItem, getSkillSuggestions, initiateTopUp, getPaymentHistory, getBalanceHistory, getPlanHistory, getAdminBalanceHistory, adminTopUpUserBalance, adminWithdrawUserBalance, previewPlanChange, getPlans, getMyDashboard, getDailyUsage, purchasePlan, getMyStatuses, toggleStatus, getAutoResponseSettings, updateAutoResponseSettings, getSpecialistFomoDashboard, getCustomerFomoDashboard, getFomoRecommendations, getAutoMatchResults, runAutoMatch, getGoogleCalendarStatus, disconnectGoogleCalendar, importFromGoogleCalendar, getGoogleCalendarConnectUrl, getPublicSiteProfile, getSiteStats, trackSiteMessage, getTaskStats, sendPublicSupportMessage, createSupportTicket, getMySupportTickets, getAdminSupportTickets, replyToSupportTicket, setSupportTicketStatus */ // SSR: use INTERNAL_API_URL (http://localhost:4000) to avoid external DNS/SSL round-trip // Browser: use NEXT_PUBLIC_API_URL (https://api.canhelp.gr) const BASE = true ? process.env.INTERNAL_API_URL || 'http://localhost:4000' : 0; async function request(path, init) { const url = `${BASE}/api${path}`; if (true) console.log('[api] SSR fetch', url); const res = await fetch(url, { ...init, credentials: 'include', headers: { 'Content-Type': 'application/json', ...init?.headers } }); if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); const msg = typeof err.error === 'string' ? err.error : typeof err.message === 'string' ? err.message : res.statusText || 'Request failed'; throw new Error(msg); } return res.json(); } // ─── Tasks ──────────────────────────────────────────────────────────────── const getTasks = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks${qs}`); }; const getTaskBudgetRange = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks/budget-range${qs}`); }; const searchTasks = (params)=>request(`/tasks/search?${new URLSearchParams(params)}`); const getMyTasks = ()=>request('/tasks/my'); const getTasksForSpecialist = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/tasks/for-me${qs}`); }; const getTaskCountsByCategory = ()=>request('/tasks/counts-by-category'); const getTask = (id)=>request(`/tasks/${id}`); const createTask = (data)=>request('/tasks', { method: 'POST', body: JSON.stringify(data) }); const updateTask = (id, data)=>request(`/tasks/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const completeTask = (id)=>request(`/tasks/${id}/complete`, { method: 'PATCH' }); const cancelTask = (id)=>request(`/tasks/${id}/cancel`, { method: 'PATCH' }); // ─── Offers ──────────────────────────────────────────────────────────────── const getOffers = (taskId)=>request(`/offers?taskId=${taskId}`); const getMyOffers = ()=>request('/offers/my'); const createOffer = (data)=>request('/offers', { method: 'POST', body: JSON.stringify(data) }); const acceptOffer = (id)=>request(`/offers/${id}/accept`, { method: 'PATCH' }); const declineOffer = (id)=>request(`/offers/${id}/decline`, { method: 'PATCH' }); const getUserProfile = (id, locale)=>request(`/users/${id}/profile${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); const getSpecialists = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request(`/users/specialists${qs}`); }; const createReview = (data)=>request('/reviews', { method: 'POST', body: JSON.stringify(data) }); const getTaskReviews = (taskId)=>request(`/reviews/task/${taskId}`); const getMyReviews = ()=>request('/reviews/my'); // ─── Chat ────────────────────────────────────────────────────────────────── const getChatRooms = ()=>request('/chat/rooms'); const getOrCreateDirectRoom = (userId)=>request(`/chat/direct/${userId}`); const getCanMessage = (userId)=>request(`/chat/can-message/${userId}`); const getMessages = (roomId)=>request(`/chat/rooms/${roomId}/messages`); const sendMessage = (roomId, body)=>request('/chat/messages', { method: 'POST', body: JSON.stringify({ roomId, body }) }); // ─── Notifications ──────────────────────────────────────────────────────── const updateNotifSettings = (data)=>request('/users/me', { method: 'PATCH', body: JSON.stringify(data) }); const getNotifications = ()=>request('/notifications'); const getUnreadCount = ()=>request('/notifications/count'); const markRead = (id)=>request(`/notifications/${id}/read`, { method: 'PATCH' }); const markAllRead = ()=>request('/notifications/read-all', { method: 'PATCH' }); const getTaskInvite = (taskId)=>request(`/notifications?type=task_invite&referenceId=${taskId}`); const dismissNotification = (id)=>request(`/notifications/${id}`, { method: 'DELETE' }); // ─── Referral ───────────────────────────────────────────────────────────── const getMyReferralInfo = ()=>request('/users/me/referral'); const applyMyReferral = (refCode)=>request('/users/me/referral/apply', { method: 'POST', body: JSON.stringify({ refCode }) }); // ─── Reviews ────────────────────────────────────────────────────────────── const getUserReviews = (userId)=>request(`/reviews/user/${userId}`); const getUserRating = (userId)=>request(`/reviews/user/${userId}/rating`); // ─── Categories ─────────────────────────────────────────────────────────── const getCategories = ()=>request('/categories'); // ─── Locations ──────────────────────────────────────────────────────────── const getLocations = ()=>request('/locations'); // ─── Favorites ──────────────────────────────────────────────────────────── const getFavorites = ()=>request('/favorites'); const addFavorite = (taskId)=>request(`/favorites/${taskId}`, { method: 'POST' }); const removeFavorite = (taskId)=>request(`/favorites/${taskId}`, { method: 'DELETE' }); const getSpecialistFavorites = ()=>request('/favorites/specialists'); const addSpecialistFavorite = (specialistId)=>request(`/favorites/specialists/${specialistId}`, { method: 'POST' }); const removeSpecialistFavorite = (specialistId)=>request(`/favorites/specialists/${specialistId}`, { method: 'DELETE' }); // ─── Admin ───────────────────────────────────────────────────────────────── // ─── Admin Categories ────────────────────────────────────────────────────── const getAdminCategories = ()=>request('/admin/categories'); const createCategory = (data)=>request('/admin/categories', { method: 'POST', body: JSON.stringify(data) }); const updateCategory = (id, data)=>request(`/admin/categories/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const deleteCategory = (id)=>request(`/admin/categories/${id}`, { method: 'DELETE' }); // ─── Admin Skills ────────────────────────────────────────────────────────── const getAdminSkills = (categorySlug)=>request(`/admin/skills?categorySlug=${encodeURIComponent(categorySlug)}`); const createSkill = (data)=>request('/admin/skills', { method: 'POST', body: JSON.stringify(data) }); const updateSkill = (id, data)=>request(`/admin/skills/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const deleteSkill = (id)=>request(`/admin/skills/${id}`, { method: 'DELETE' }); const getSkillDedup = (categorySlug)=>request(`/admin/skills/dedup${categorySlug ? `?categorySlug=${encodeURIComponent(categorySlug)}` : ''}`); const mergeSkillDuplicates = (keepId, deleteIds)=>request('/admin/skills/dedup/merge', { method: 'POST', body: JSON.stringify({ keepId, deleteIds }) }); // ─── Admin ───────────────────────────────────────────────────────────────── const getAdminStats = ()=>request('/admin/stats'); const getAdminUsers = (page = 1, q, role)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (role) p.set('role', role); return request(`/admin/users?${p}`); }; const deactivateUser = (id)=>request(`/admin/users/${id}/deactivate`, { method: 'PATCH' }); const activateUser = (id)=>request(`/admin/users/${id}/activate`, { method: 'PATCH' }); const changeUserRole = (id, role)=>request(`/admin/users/${id}/role`, { method: 'PATCH', body: JSON.stringify({ role }) }); const getAdminUser = (id)=>request(`/admin/users/${id}`); const getAdminUserSpecialistCards = (userId)=>request(`/admin/users/${userId}/specialist-cards`); const adminUpdateSpecialistCard = (id, data)=>request(`/admin/specialist-cards/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const getAdminSpecialistCards = (page = 1, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request(`/admin/specialist-cards?${p}`); }; const updateAdminUser = (id, data)=>request(`/admin/users/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const verifyAdminUserEmail = (id)=>request(`/admin/users/${id}/verify-email`, { method: 'PATCH' }); const getAdminTasks = (page = 1, q, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (status) p.set('status', status); return request(`/admin/tasks?${p}`); }; const cancelTaskAdmin = (id)=>request(`/admin/tasks/${id}/cancel`, { method: 'PATCH' }); const deleteTaskAdmin = (id)=>request(`/admin/tasks/${id}`, { method: 'DELETE' }); const getAdminReports = (page = 1, status)=>{ const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request(`/admin/reports?${p}`); }; const updateReportStatus = (id, status)=>request(`/admin/reports/${id}/status`, { method: 'PATCH', body: JSON.stringify({ status }) }); const getAdminAiLogs = (page = 1)=>request(`/admin/ai-logs?page=${page}&limit=50`); const getAdminActivityLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.userId) p.set('userId', params.userId); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/activity-logs?${p}`); }; const getAdminMailLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/mail-logs?${p}`); }; const getAdminNotifLogs = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.type) p.set('type', params.type); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request(`/admin/notification-logs?${p}`); }; const getAdminNotifStats = ()=>request('/admin/notification-stats'); const getAdminMailStats = ()=>request('/admin/mail-stats'); const getAdminReferrals = ()=>request('/admin/referrals'); const adminSendPushToUser = (userId, data)=>request(`/admin/push/user/${userId}`, { method: 'POST', body: JSON.stringify(data) }); const adminBroadcastPush = (data)=>request('/admin/push/broadcast', { method: 'POST', body: JSON.stringify(data) }); // ─── Admin Locations ─────────────────────────────────────────────────────── const getAdminLocations = ()=>request('/admin/locations'); const createLocation = (data)=>request('/admin/locations', { method: 'POST', body: JSON.stringify(data) }); const updateLocation = (id, data)=>request(`/admin/locations/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const deleteLocation = (id)=>request(`/admin/locations/${id}`, { method: 'DELETE' }); // ─── Admin Plans ─────────────────────────────────────────────────────────── const getAdminPlans = ()=>request('/admin/plans'); const createPlan = (data)=>request('/admin/plans', { method: 'POST', body: JSON.stringify(data) }); const updatePlan = (id, data)=>request(`/admin/plans/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const deletePlan = (id)=>request(`/admin/plans/${id}`, { method: 'DELETE' }); // ─── Admin Settings ──────────────────────────────────────────────────────── const getAdminSettings = ()=>request('/admin/settings'); const updateAdminSettings = (data)=>request('/admin/settings', { method: 'PUT', body: JSON.stringify(data) }); const getAdminEmailTemplates = ()=>request('/admin/settings/templates'); const updateAdminEmailTemplate = (key, data)=>request(`/admin/settings/templates/${key}`, { method: 'PUT', body: JSON.stringify(data) }); const translateAdminEmailTemplate = (data)=>request('/admin/settings/templates/translate', { method: 'POST', body: JSON.stringify(data) }); const sendTestEmail = ()=>request('/admin/settings/test-email', { method: 'POST' }); const testTelegramConnection = (botToken, chatId)=>fetch(`${BASE}/api/admin/settings/test-telegram`, { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken, chatId }) }).then((r)=>r.json()); const verifyTelegramToken = (botToken)=>fetch(`${BASE}/api/admin/settings/verify-telegram-token`, { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken }) }).then((r)=>r.json()); const getTranslationsStats = ()=>request('/admin/translations/stats'); const getTranslationsMissing = (table, missingLang, page = 1, limit = 50)=>request(`/admin/translations/${table}?missingLang=${missingLang}&page=${page}&limit=${limit}`); const saveTranslations = (table, items)=>request(`/admin/translations/${table}/save`, { method: 'POST', body: JSON.stringify({ items }) }); const autoTranslate = (table, missingLang, fromLang, batchSize = 500)=>request('/admin/translations/auto-translate', { method: 'POST', body: JSON.stringify({ table, missingLang, fromLang, batchSize }) }); const autoTranslateTasks = (batchSize = 500)=>request('/admin/translations/auto-translate-tasks', { method: 'POST', body: JSON.stringify({ batchSize }) }); const getTasksTranslationPreview = (lang, limit = 50)=>request(`/admin/translations/tasks-preview?lang=${lang}&limit=${limit}`); const autoTranslateEmailTemplates = (missingLang, fromLang = 'el')=>request('/admin/translations/auto-translate-templates', { method: 'POST', body: JSON.stringify({ missingLang, fromLang }) }); // ─── Availability ────────────────────────────────────────────────────────── const getMyAvailability = (month)=>request(`/availability/my${month ? `?month=${month}` : ''}`); const setAvailability = (date, status, note)=>request('/availability/set', { method: 'POST', body: JSON.stringify({ date, status, note }) }); const setAvailabilityRange = (from, to, status)=>request('/availability/set-range', { method: 'POST', body: JSON.stringify({ from, to, status }) }); const getSpecialistAvailability = (userId, month)=>request(`/availability/user/${userId}${month ? `?month=${month}` : ''}`); const getMyPortfolio = ()=>request('/portfolio/my'); const addPortfolioItem = (formData)=>fetch(`${BASE}/api/portfolio`, { method: 'POST', credentials: 'include', body: formData }).then(async (res)=>{ if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); throw new Error(err.error || 'Upload failed'); } return res.json(); }); const updatePortfolioItem = (id, data)=>request(`/portfolio/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const deletePortfolioItem = (id)=>request(`/portfolio/${id}`, { method: 'DELETE' }); const getSpecialistPortfolio = (userId)=>request(`/portfolio/user/${userId}`); const getMySpecialistCards = ()=>request('/specialist-cards/my'); const createSpecialistCard = (data)=>request('/specialist-cards', { method: 'POST', body: JSON.stringify(data) }); const updateSpecialistCard = (id, data)=>request(`/specialist-cards/${id}`, { method: 'PATCH', body: JSON.stringify(data) }); const saveSiteSeo = (data)=>request('/users/me/site-seo', { method: 'POST', body: JSON.stringify(data) }); const deleteSpecialistCard = (id)=>request(`/specialist-cards/${id}`, { method: 'DELETE' }); const getSpecialistCards = (userId, locale)=>request(`/specialist-cards/user/${userId}${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); const getPriceList = (cardId, locale)=>request(`/price-list/${cardId}${locale ? `?locale=${encodeURIComponent(locale)}` : ''}`); const createPriceListGroup = (cardId, data)=>request(`/price-list/${cardId}/groups`, { method: 'POST', body: JSON.stringify(data) }); const updatePriceListGroup = (groupId, data)=>request(`/price-list/groups/${groupId}`, { method: 'PATCH', body: JSON.stringify(data) }); const deletePriceListGroup = (groupId)=>request(`/price-list/groups/${groupId}`, { method: 'DELETE' }); const createPriceListItem = (groupId, data)=>request(`/price-list/groups/${groupId}/items`, { method: 'POST', body: JSON.stringify(data) }); const updatePriceListItem = (itemId, data)=>request(`/price-list/items/${itemId}`, { method: 'PATCH', body: JSON.stringify(data) }); const deletePriceListItem = (itemId)=>request(`/price-list/items/${itemId}`, { method: 'DELETE' }); const getSkillSuggestions = (categorySlugs)=>{ const params = categorySlugs?.length ? '?' + categorySlugs.map((s)=>`category=${encodeURIComponent(s)}`).join('&') : ''; return request(`/skill-suggestions${params}`); }; const initiateTopUp = (amount)=>request('/payments/topup/init', { method: 'POST', body: JSON.stringify({ amount }) }); const getPaymentHistory = ()=>request('/payments/history'); const getBalanceHistory = (limit = 50)=>request(`/payments/balance-history?limit=${limit}`); const getPlanHistory = (limit = 50)=>request(`/users/me/plan-history?limit=${limit}`); const getAdminBalanceHistory = (params = {})=>{ const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.userId) p.set('userId', params.userId); if (params.kind) p.set('kind', params.kind); p.set('limit', '50'); return request(`/admin/balance-history?${p}`); }; const adminTopUpUserBalance = (id, data)=>request(`/admin/users/${id}/balance/topup`, { method: 'POST', body: JSON.stringify(data) }); const adminWithdrawUserBalance = (id, data)=>request(`/admin/users/${id}/balance/withdraw`, { method: 'POST', body: JSON.stringify(data) }); const previewPlanChange = (planId)=>request('/payments/plan/preview', { method: 'POST', body: JSON.stringify({ planId }) }); const getPlans = (role)=>{ const qs = role ? `?role=${role}` : ''; return request(`/plans${qs}`); }; const getMyDashboard = ()=>request('/dashboard/me'); const getDailyUsage = ()=>request('/plans/daily-usage'); const purchasePlan = (planId, payFromBalance = true)=>request('/payments/plan/purchase', { method: 'POST', body: JSON.stringify({ planId, payFromBalance }) }); // ─── Statuses ────────────────────────────────────────────────────────────── const getMyStatuses = ()=>request('/statuses/me'); const toggleStatus = (statusType, active)=>request('/statuses/toggle', { method: 'POST', body: JSON.stringify({ statusType, active }) }); const getAutoResponseSettings = ()=>request('/auto-response'); const updateAutoResponseSettings = (data)=>request('/auto-response', { method: 'PUT', body: JSON.stringify(data) }); // ─── FOMO ────────────────────────────────────────────────────────────────── const getSpecialistFomoDashboard = ()=>request('/fomo/specialist'); const getCustomerFomoDashboard = ()=>request('/fomo/customer'); const getFomoRecommendations = ()=>request('/fomo/recommendations'); // ─── Auto-match ──────────────────────────────────────────────────────────── const getAutoMatchResults = (taskId)=>request(`/auto-match/${taskId}`); const runAutoMatch = (taskId)=>request(`/auto-match/${taskId}`, { method: 'POST' }); // ─── Google Calendar ─────────────────────────────────────────────────────── const getGoogleCalendarStatus = ()=>request('/google/calendar/status'); const disconnectGoogleCalendar = ()=>request('/google/calendar/disconnect', { method: 'DELETE' }); const importFromGoogleCalendar = ()=>request('/google/calendar/import', { method: 'POST' }); const getGoogleCalendarConnectUrl = ()=>`${BASE}/api/google/calendar/connect`; // ─── Personal site ───────────────────────────────────────────────────────── const getPublicSiteProfile = (slug)=>request(`/users/site/${slug}`); const getSiteStats = ()=>request('/users/me/site-stats'); const trackSiteMessage = (slug)=>request(`/users/site/${slug}/track-message`, { method: 'POST' }).catch(()=>{}); // ─── Task stats (FOMO) ───────────────────────────────────────────────────── const getTaskStats = (taskId)=>request(`/tasks/${taskId}/stats`); // ─── Support tickets ─────────────────────────────────────────────────────── const sendPublicSupportMessage = (data)=>request('/support/public', { method: 'POST', body: JSON.stringify(data) }); const createSupportTicket = (data)=>request('/support', { method: 'POST', body: JSON.stringify(data) }); const getMySupportTickets = (page = 1)=>request(`/support/my?page=${page}`); const getAdminSupportTickets = (params)=>request(`/support${params ? '?' + new URLSearchParams(params) : ''}`); const replyToSupportTicket = (id, data)=>request(`/support/${id}/reply`, { method: 'PATCH', body: JSON.stringify(data) }); const setSupportTicketStatus = (id, status)=>request(`/support/${id}/status`, { method: 'PATCH', body: JSON.stringify({ status }) }); /***/ }) }; ; {} ` W"use strict"; exports.id = 902; exports.ids = [902]; exports.modules = { /***/ 59902: Q/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { {{ }; ;webpack/lib/util/registerExternalSerializerwebpack-sources/RawSource&"use strict";exports.id=902,exports.ids=[902],exports.modules={59902:(a,b,c)=>{c.d(b,{CC:()=>f,F7:()=>h,Vs:()=>j,bW:()=>i,gg:()=>g});let d=process.env.INTERNAL_API_URL||"http://localhost:4000";async function e(a,b){let c=`${d}/api${a}`;console.log("[api] SSR fetch",c);let e=await fetch(c,{...b,credentials:"include",headers:{"Content-Type":"application/json",...b?.headers}});if(!e.ok){let a=await e.json().catch(()=>({error:e.statusText}));throw Error("string"==typeof a.error?a.error:"string"==typeof a.message?a.message:e.statusText||"Request failed")}return e.json()}let f=a=>{let b=a?"?"+new URLSearchParams(a):"";return e(`/tasks/budget-range${b}`)},g=a=>e(`/tasks/${a}`),h=a=>{let b=a?"?"+new URLSearchParams(a):"";return e(`/users/specialists${b}`)},i=()=>e("/categories"),j=()=>e("/locations")}};