955 lines
53 KiB
JavaScript
955 lines
53 KiB
JavaScript
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push([typeof document === "object" ? document.currentScript : undefined,
|
||
"[project]/app/search/page.tsx [app-client] (ecmascript)", ((__turbopack_context__) => {
|
||
"use strict";
|
||
|
||
__turbopack_context__.s([
|
||
"default",
|
||
()=>SearchPage
|
||
]);
|
||
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/compiled/react/jsx-dev-runtime.js [app-client] (ecmascript)");
|
||
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$navigation$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/navigation.js [app-client] (ecmascript)");
|
||
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/compiled/react/index.js [app-client] (ecmascript)");
|
||
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$client$2f$app$2d$dir$2f$link$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/client/app-dir/link.js [app-client] (ecmascript)");
|
||
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$search$2e$mjs__$5b$app$2d$client$5d$__$28$ecmascript$29$__$3c$export__default__as__Search$3e$__ = __turbopack_context__.i("[project]/node_modules/lucide-react/dist/esm/icons/search.mjs [app-client] (ecmascript) <export default as Search>");
|
||
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$ticket$2e$mjs__$5b$app$2d$client$5d$__$28$ecmascript$29$__$3c$export__default__as__Ticket$3e$__ = __turbopack_context__.i("[project]/node_modules/lucide-react/dist/esm/icons/ticket.mjs [app-client] (ecmascript) <export default as Ticket>");
|
||
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$users$2e$mjs__$5b$app$2d$client$5d$__$28$ecmascript$29$__$3c$export__default__as__Users$3e$__ = __turbopack_context__.i("[project]/node_modules/lucide-react/dist/esm/icons/users.mjs [app-client] (ecmascript) <export default as Users>");
|
||
var __TURBOPACK__imported__module__$5b$project$5d2f$app$2f$components$2f$AppShell$2e$tsx__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/app/components/AppShell.tsx [app-client] (ecmascript)");
|
||
;
|
||
var _s = __turbopack_context__.k.signature();
|
||
// /opt/erp-system/app/search/page.tsx
|
||
'use client';
|
||
;
|
||
;
|
||
;
|
||
;
|
||
;
|
||
function SearchResults() {
|
||
_s();
|
||
const searchParams = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$navigation$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["useSearchParams"])();
|
||
const q = searchParams.get('q');
|
||
const [results, setResults] = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["useState"])({
|
||
tickets: [],
|
||
customers: []
|
||
});
|
||
const [loading, setLoading] = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["useState"])(false);
|
||
(0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["useEffect"])({
|
||
"SearchResults.useEffect": ()=>{
|
||
if (q) {
|
||
setLoading(true);
|
||
fetch(`/api/search?q=${encodeURIComponent(q)}`).then({
|
||
"SearchResults.useEffect": (res)=>res.json()
|
||
}["SearchResults.useEffect"]).then({
|
||
"SearchResults.useEffect": (data)=>{
|
||
setResults(data);
|
||
setLoading(false);
|
||
}
|
||
}["SearchResults.useEffect"]);
|
||
}
|
||
}
|
||
}["SearchResults.useEffect"], [
|
||
q
|
||
]);
|
||
if (!q) return /*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("div", {
|
||
className: "text-slate-500 font-medium",
|
||
children: "Bitte gib einen Suchbegriff ein."
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/search/page.tsx",
|
||
lineNumber: 29,
|
||
columnNumber: 18
|
||
}, this);
|
||
return /*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("div", {
|
||
className: "max-w-5xl mx-auto space-y-6",
|
||
children: [
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("h1", {
|
||
className: "text-2xl font-bold text-slate-900 flex items-center gap-2",
|
||
children: [
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$search$2e$mjs__$5b$app$2d$client$5d$__$28$ecmascript$29$__$3c$export__default__as__Search$3e$__["Search"], {
|
||
className: "w-6 h-6 text-indigo-600"
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/search/page.tsx",
|
||
lineNumber: 34,
|
||
columnNumber: 9
|
||
}, this),
|
||
' Suchergebnisse für "',
|
||
q,
|
||
'"'
|
||
]
|
||
}, void 0, true, {
|
||
fileName: "[project]/app/search/page.tsx",
|
||
lineNumber: 33,
|
||
columnNumber: 7
|
||
}, this),
|
||
loading ? /*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("div", {
|
||
className: "text-slate-500 font-medium animate-pulse",
|
||
children: "Suche läuft..."
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/search/page.tsx",
|
||
lineNumber: 38,
|
||
columnNumber: 9
|
||
}, this) : /*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("div", {
|
||
className: "space-y-8",
|
||
children: [
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("div", {
|
||
className: "bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden",
|
||
children: [
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("div", {
|
||
className: "p-4 border-b border-slate-200 bg-slate-50 flex items-center gap-2 font-semibold text-slate-800",
|
||
children: [
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$users$2e$mjs__$5b$app$2d$client$5d$__$28$ecmascript$29$__$3c$export__default__as__Users$3e$__["Users"], {
|
||
className: "w-5 h-5 text-slate-500"
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/search/page.tsx",
|
||
lineNumber: 44,
|
||
columnNumber: 15
|
||
}, this),
|
||
" Kunden (",
|
||
results.customers?.length || 0,
|
||
")"
|
||
]
|
||
}, void 0, true, {
|
||
fileName: "[project]/app/search/page.tsx",
|
||
lineNumber: 43,
|
||
columnNumber: 13
|
||
}, this),
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("div", {
|
||
className: "divide-y divide-slate-100",
|
||
children: results.customers?.length > 0 ? results.customers.map((c)=>/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$client$2f$app$2d$dir$2f$link$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["default"], {
|
||
href: `/customers/${c.id}`,
|
||
className: "block p-4 hover:bg-slate-50 transition",
|
||
children: [
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("p", {
|
||
className: "font-semibold text-indigo-600",
|
||
children: c.companyName || `${c.firstName} ${c.lastName}`
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/search/page.tsx",
|
||
lineNumber: 49,
|
||
columnNumber: 19
|
||
}, this),
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("p", {
|
||
className: "text-sm text-slate-500",
|
||
children: c.email
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/search/page.tsx",
|
||
lineNumber: 50,
|
||
columnNumber: 19
|
||
}, this)
|
||
]
|
||
}, c.id, true, {
|
||
fileName: "[project]/app/search/page.tsx",
|
||
lineNumber: 48,
|
||
columnNumber: 17
|
||
}, this)) : /*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("div", {
|
||
className: "p-4 text-sm text-slate-500",
|
||
children: "Keine Kunden gefunden."
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/search/page.tsx",
|
||
lineNumber: 53,
|
||
columnNumber: 17
|
||
}, this)
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/search/page.tsx",
|
||
lineNumber: 46,
|
||
columnNumber: 13
|
||
}, this)
|
||
]
|
||
}, void 0, true, {
|
||
fileName: "[project]/app/search/page.tsx",
|
||
lineNumber: 42,
|
||
columnNumber: 11
|
||
}, this),
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("div", {
|
||
className: "bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden",
|
||
children: [
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("div", {
|
||
className: "p-4 border-b border-slate-200 bg-slate-50 flex items-center gap-2 font-semibold text-slate-800",
|
||
children: [
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$ticket$2e$mjs__$5b$app$2d$client$5d$__$28$ecmascript$29$__$3c$export__default__as__Ticket$3e$__["Ticket"], {
|
||
className: "w-5 h-5 text-slate-500"
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/search/page.tsx",
|
||
lineNumber: 60,
|
||
columnNumber: 15
|
||
}, this),
|
||
" Tickets (",
|
||
results.tickets?.length || 0,
|
||
")"
|
||
]
|
||
}, void 0, true, {
|
||
fileName: "[project]/app/search/page.tsx",
|
||
lineNumber: 59,
|
||
columnNumber: 13
|
||
}, this),
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("div", {
|
||
className: "divide-y divide-slate-100",
|
||
children: results.tickets?.length > 0 ? results.tickets.map((t)=>/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$client$2f$app$2d$dir$2f$link$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["default"], {
|
||
href: `/tickets/${t.id}`,
|
||
className: "block p-4 hover:bg-slate-50 transition flex justify-between items-start",
|
||
children: [
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("div", {
|
||
children: [
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("p", {
|
||
className: "font-semibold text-indigo-600",
|
||
children: [
|
||
"#",
|
||
t.id,
|
||
" - ",
|
||
t.title
|
||
]
|
||
}, void 0, true, {
|
||
fileName: "[project]/app/search/page.tsx",
|
||
lineNumber: 66,
|
||
columnNumber: 21
|
||
}, this),
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("p", {
|
||
className: "text-sm text-slate-500 mt-1 line-clamp-1",
|
||
children: t.description
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/search/page.tsx",
|
||
lineNumber: 67,
|
||
columnNumber: 21
|
||
}, this),
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("p", {
|
||
className: "text-xs text-slate-400 mt-1",
|
||
children: [
|
||
"Kunde: ",
|
||
t.customer.companyName || `${t.customer.firstName} ${t.customer.lastName}`
|
||
]
|
||
}, void 0, true, {
|
||
fileName: "[project]/app/search/page.tsx",
|
||
lineNumber: 68,
|
||
columnNumber: 21
|
||
}, this)
|
||
]
|
||
}, void 0, true, {
|
||
fileName: "[project]/app/search/page.tsx",
|
||
lineNumber: 65,
|
||
columnNumber: 19
|
||
}, this),
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("div", {
|
||
className: "ml-4 shrink-0",
|
||
children: (0, __TURBOPACK__imported__module__$5b$project$5d2f$app$2f$components$2f$AppShell$2e$tsx__$5b$app$2d$client$5d$__$28$ecmascript$29$__["getStatusBadge"])(t.status)
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/search/page.tsx",
|
||
lineNumber: 72,
|
||
columnNumber: 19
|
||
}, this)
|
||
]
|
||
}, t.id, true, {
|
||
fileName: "[project]/app/search/page.tsx",
|
||
lineNumber: 64,
|
||
columnNumber: 17
|
||
}, this)) : /*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("div", {
|
||
className: "p-4 text-sm text-slate-500",
|
||
children: "Keine Tickets gefunden."
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/search/page.tsx",
|
||
lineNumber: 77,
|
||
columnNumber: 17
|
||
}, this)
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/search/page.tsx",
|
||
lineNumber: 62,
|
||
columnNumber: 13
|
||
}, this)
|
||
]
|
||
}, void 0, true, {
|
||
fileName: "[project]/app/search/page.tsx",
|
||
lineNumber: 58,
|
||
columnNumber: 11
|
||
}, this)
|
||
]
|
||
}, void 0, true, {
|
||
fileName: "[project]/app/search/page.tsx",
|
||
lineNumber: 40,
|
||
columnNumber: 9
|
||
}, this)
|
||
]
|
||
}, void 0, true, {
|
||
fileName: "[project]/app/search/page.tsx",
|
||
lineNumber: 32,
|
||
columnNumber: 5
|
||
}, this);
|
||
}
|
||
_s(SearchResults, "vUeY/rGg5egL710t8+ro2v63ceE=", false, function() {
|
||
return [
|
||
__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$navigation$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["useSearchParams"]
|
||
];
|
||
});
|
||
_c = SearchResults;
|
||
function SearchPage() {
|
||
return /*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["Suspense"], {
|
||
fallback: /*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("div", {
|
||
className: "text-slate-500",
|
||
children: "Lade Suche..."
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/search/page.tsx",
|
||
lineNumber: 90,
|
||
columnNumber: 25
|
||
}, this),
|
||
children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])(SearchResults, {}, void 0, false, {
|
||
fileName: "[project]/app/search/page.tsx",
|
||
lineNumber: 91,
|
||
columnNumber: 7
|
||
}, this)
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/search/page.tsx",
|
||
lineNumber: 90,
|
||
columnNumber: 5
|
||
}, this);
|
||
}
|
||
_c1 = SearchPage;
|
||
var _c, _c1;
|
||
__turbopack_context__.k.register(_c, "SearchResults");
|
||
__turbopack_context__.k.register(_c1, "SearchPage");
|
||
if (typeof globalThis.$RefreshHelpers$ === 'object' && globalThis.$RefreshHelpers !== null) {
|
||
__turbopack_context__.k.registerExports(__turbopack_context__.m, globalThis.$RefreshHelpers$);
|
||
}
|
||
}),
|
||
"[project]/node_modules/next/dist/shared/lib/router/utils/format-url.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
||
"use strict";
|
||
|
||
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$build$2f$polyfills$2f$process$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = /*#__PURE__*/ __turbopack_context__.i("[project]/node_modules/next/dist/build/polyfills/process.js [app-client] (ecmascript)");
|
||
// Format function modified from nodejs
|
||
// Copyright Joyent, Inc. and other Node contributors.
|
||
//
|
||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||
// copy of this software and associated documentation files (the
|
||
// "Software"), to deal in the Software without restriction, including
|
||
// without limitation the rights to use, copy, modify, merge, publish,
|
||
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
||
// persons to whom the Software is furnished to do so, subject to the
|
||
// following conditions:
|
||
//
|
||
// The above copyright notice and this permission notice shall be included
|
||
// in all copies or substantial portions of the Software.
|
||
//
|
||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
||
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||
"use strict";
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
0 && (module.exports = {
|
||
formatUrl: null,
|
||
formatWithValidation: null,
|
||
urlObjectKeys: null
|
||
});
|
||
function _export(target, all) {
|
||
for(var name in all)Object.defineProperty(target, name, {
|
||
enumerable: true,
|
||
get: all[name]
|
||
});
|
||
}
|
||
_export(exports, {
|
||
formatUrl: function() {
|
||
return formatUrl;
|
||
},
|
||
formatWithValidation: function() {
|
||
return formatWithValidation;
|
||
},
|
||
urlObjectKeys: function() {
|
||
return urlObjectKeys;
|
||
}
|
||
});
|
||
const _interop_require_wildcard = __turbopack_context__.r("[project]/node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs [app-client] (ecmascript)");
|
||
const _querystring = /*#__PURE__*/ _interop_require_wildcard._(__turbopack_context__.r("[project]/node_modules/next/dist/shared/lib/router/utils/querystring.js [app-client] (ecmascript)"));
|
||
const slashedProtocols = /https?|ftp|gopher|file/;
|
||
function formatUrl(urlObj) {
|
||
let { auth, hostname } = urlObj;
|
||
let protocol = urlObj.protocol || '';
|
||
let pathname = urlObj.pathname || '';
|
||
let hash = urlObj.hash || '';
|
||
let query = urlObj.query || '';
|
||
let host = false;
|
||
auth = auth ? encodeURIComponent(auth).replace(/%3A/i, ':') + '@' : '';
|
||
if (urlObj.host) {
|
||
host = auth + urlObj.host;
|
||
} else if (hostname) {
|
||
host = auth + (~hostname.indexOf(':') ? `[${hostname}]` : hostname);
|
||
if (urlObj.port) {
|
||
host += ':' + urlObj.port;
|
||
}
|
||
}
|
||
if (query && typeof query === 'object') {
|
||
query = String(_querystring.urlQueryToSearchParams(query));
|
||
}
|
||
let search = urlObj.search || query && `?${query}` || '';
|
||
if (protocol && !protocol.endsWith(':')) protocol += ':';
|
||
if (urlObj.slashes || (!protocol || slashedProtocols.test(protocol)) && host !== false) {
|
||
host = '//' + (host || '');
|
||
if (pathname && pathname[0] !== '/') pathname = '/' + pathname;
|
||
} else if (!host) {
|
||
host = '';
|
||
}
|
||
if (hash && hash[0] !== '#') hash = '#' + hash;
|
||
if (search && search[0] !== '?') search = '?' + search;
|
||
pathname = pathname.replace(/[?#]/g, encodeURIComponent);
|
||
search = search.replace('#', '%23');
|
||
return `${protocol}${host}${pathname}${search}${hash}`;
|
||
}
|
||
const urlObjectKeys = [
|
||
'auth',
|
||
'hash',
|
||
'host',
|
||
'hostname',
|
||
'href',
|
||
'path',
|
||
'pathname',
|
||
'port',
|
||
'protocol',
|
||
'query',
|
||
'search',
|
||
'slashes'
|
||
];
|
||
function formatWithValidation(url) {
|
||
if ("TURBOPACK compile-time truthy", 1) {
|
||
if (url !== null && typeof url === 'object') {
|
||
Object.keys(url).forEach((key)=>{
|
||
if (!urlObjectKeys.includes(key)) {
|
||
console.warn(`Unknown key passed via urlObject into url.format: ${key}`);
|
||
}
|
||
});
|
||
}
|
||
}
|
||
return formatUrl(url);
|
||
}
|
||
}),
|
||
"[project]/node_modules/next/dist/client/use-merged-ref.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
||
"use strict";
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
Object.defineProperty(exports, "useMergedRef", {
|
||
enumerable: true,
|
||
get: function() {
|
||
return useMergedRef;
|
||
}
|
||
});
|
||
const _react = __turbopack_context__.r("[project]/node_modules/next/dist/compiled/react/index.js [app-client] (ecmascript)");
|
||
function useMergedRef(refA, refB) {
|
||
const cleanupA = (0, _react.useRef)(null);
|
||
const cleanupB = (0, _react.useRef)(null);
|
||
// NOTE: In theory, we could skip the wrapping if only one of the refs is non-null.
|
||
// (this happens often if the user doesn't pass a ref to Link/Form/Image)
|
||
// But this can cause us to leak a cleanup-ref into user code (previously via `<Link legacyBehavior>`),
|
||
// and the user might pass that ref into ref-merging library that doesn't support cleanup refs
|
||
// (because it hasn't been updated for React 19)
|
||
// which can then cause things to blow up, because a cleanup-returning ref gets called with `null`.
|
||
// So in practice, it's safer to be defensive and always wrap the ref, even on React 19.
|
||
return (0, _react.useCallback)((current)=>{
|
||
if (current === null) {
|
||
const cleanupFnA = cleanupA.current;
|
||
if (cleanupFnA) {
|
||
cleanupA.current = null;
|
||
cleanupFnA();
|
||
}
|
||
const cleanupFnB = cleanupB.current;
|
||
if (cleanupFnB) {
|
||
cleanupB.current = null;
|
||
cleanupFnB();
|
||
}
|
||
} else {
|
||
if (refA) {
|
||
cleanupA.current = applyRef(refA, current);
|
||
}
|
||
if (refB) {
|
||
cleanupB.current = applyRef(refB, current);
|
||
}
|
||
}
|
||
}, [
|
||
refA,
|
||
refB
|
||
]);
|
||
}
|
||
function applyRef(refA, current) {
|
||
if (typeof refA === 'function') {
|
||
const cleanup = refA(current);
|
||
if (typeof cleanup === 'function') {
|
||
return cleanup;
|
||
} else {
|
||
return ()=>refA(null);
|
||
}
|
||
} else {
|
||
refA.current = current;
|
||
return ()=>{
|
||
refA.current = null;
|
||
};
|
||
}
|
||
}
|
||
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
||
Object.defineProperty(exports.default, '__esModule', {
|
||
value: true
|
||
});
|
||
Object.assign(exports.default, exports);
|
||
module.exports = exports.default;
|
||
}
|
||
}),
|
||
"[project]/node_modules/next/dist/shared/lib/router/utils/is-local-url.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
||
"use strict";
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
Object.defineProperty(exports, "isLocalURL", {
|
||
enumerable: true,
|
||
get: function() {
|
||
return isLocalURL;
|
||
}
|
||
});
|
||
const _utils = __turbopack_context__.r("[project]/node_modules/next/dist/shared/lib/utils.js [app-client] (ecmascript)");
|
||
const _hasbasepath = __turbopack_context__.r("[project]/node_modules/next/dist/client/has-base-path.js [app-client] (ecmascript)");
|
||
function isLocalURL(url) {
|
||
// prevent a hydration mismatch on href for url with anchor refs
|
||
if (!(0, _utils.isAbsoluteUrl)(url)) return true;
|
||
try {
|
||
// absolute urls can be local if they are on the same origin
|
||
const locationOrigin = (0, _utils.getLocationOrigin)();
|
||
const resolved = new URL(url, locationOrigin);
|
||
return resolved.origin === locationOrigin && (0, _hasbasepath.hasBasePath)(resolved.pathname);
|
||
} catch (_) {
|
||
return false;
|
||
}
|
||
}
|
||
}),
|
||
"[project]/node_modules/next/dist/shared/lib/utils/error-once.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
||
"use strict";
|
||
|
||
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$build$2f$polyfills$2f$process$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = /*#__PURE__*/ __turbopack_context__.i("[project]/node_modules/next/dist/build/polyfills/process.js [app-client] (ecmascript)");
|
||
"use strict";
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
Object.defineProperty(exports, "errorOnce", {
|
||
enumerable: true,
|
||
get: function() {
|
||
return errorOnce;
|
||
}
|
||
});
|
||
let errorOnce = (_)=>{};
|
||
if ("TURBOPACK compile-time truthy", 1) {
|
||
const errors = new Set();
|
||
errorOnce = (msg)=>{
|
||
if (!errors.has(msg)) {
|
||
console.error(msg);
|
||
}
|
||
errors.add(msg);
|
||
};
|
||
}
|
||
}),
|
||
"[project]/node_modules/next/dist/client/app-dir/link.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
||
"use strict";
|
||
|
||
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$build$2f$polyfills$2f$process$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = /*#__PURE__*/ __turbopack_context__.i("[project]/node_modules/next/dist/build/polyfills/process.js [app-client] (ecmascript)");
|
||
'use client';
|
||
"use strict";
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
0 && (module.exports = {
|
||
default: null,
|
||
useLinkStatus: null
|
||
});
|
||
function _export(target, all) {
|
||
for(var name in all)Object.defineProperty(target, name, {
|
||
enumerable: true,
|
||
get: all[name]
|
||
});
|
||
}
|
||
_export(exports, {
|
||
/**
|
||
* A React component that extends the HTML `<a>` element to provide
|
||
* [prefetching](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#2-prefetching)
|
||
* and client-side navigation. This is the primary way to navigate between routes in Next.js.
|
||
*
|
||
* @remarks
|
||
* - Prefetching is only enabled in production.
|
||
*
|
||
* @see https://nextjs.org/docs/app/api-reference/components/link
|
||
*/ default: function() {
|
||
return LinkComponent;
|
||
},
|
||
useLinkStatus: function() {
|
||
return useLinkStatus;
|
||
}
|
||
});
|
||
const _interop_require_wildcard = __turbopack_context__.r("[project]/node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs [app-client] (ecmascript)");
|
||
const _jsxruntime = __turbopack_context__.r("[project]/node_modules/next/dist/compiled/react/jsx-runtime.js [app-client] (ecmascript)");
|
||
const _react = /*#__PURE__*/ _interop_require_wildcard._(__turbopack_context__.r("[project]/node_modules/next/dist/compiled/react/index.js [app-client] (ecmascript)"));
|
||
const _formaturl = __turbopack_context__.r("[project]/node_modules/next/dist/shared/lib/router/utils/format-url.js [app-client] (ecmascript)");
|
||
const _approutercontextsharedruntime = __turbopack_context__.r("[project]/node_modules/next/dist/shared/lib/app-router-context.shared-runtime.js [app-client] (ecmascript)");
|
||
const _usemergedref = __turbopack_context__.r("[project]/node_modules/next/dist/client/use-merged-ref.js [app-client] (ecmascript)");
|
||
const _utils = __turbopack_context__.r("[project]/node_modules/next/dist/shared/lib/utils.js [app-client] (ecmascript)");
|
||
const _addbasepath = __turbopack_context__.r("[project]/node_modules/next/dist/client/add-base-path.js [app-client] (ecmascript)");
|
||
const _warnonce = __turbopack_context__.r("[project]/node_modules/next/dist/shared/lib/utils/warn-once.js [app-client] (ecmascript)");
|
||
const _routerreducertypes = __turbopack_context__.r("[project]/node_modules/next/dist/client/components/router-reducer/router-reducer-types.js [app-client] (ecmascript)");
|
||
const _links = __turbopack_context__.r("[project]/node_modules/next/dist/client/components/links.js [app-client] (ecmascript)");
|
||
const _islocalurl = __turbopack_context__.r("[project]/node_modules/next/dist/shared/lib/router/utils/is-local-url.js [app-client] (ecmascript)");
|
||
const _types = __turbopack_context__.r("[project]/node_modules/next/dist/client/components/segment-cache/types.js [app-client] (ecmascript)");
|
||
const _erroronce = __turbopack_context__.r("[project]/node_modules/next/dist/shared/lib/utils/error-once.js [app-client] (ecmascript)");
|
||
function isModifiedEvent(event) {
|
||
const eventTarget = event.currentTarget;
|
||
const target = eventTarget.getAttribute('target');
|
||
return target && target !== '_self' || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || // triggers resource download
|
||
event.nativeEvent && event.nativeEvent.which === 2;
|
||
}
|
||
function linkClicked(e, href, linkInstanceRef, replace, scroll, onNavigate, transitionTypes) {
|
||
if (typeof window !== 'undefined') {
|
||
const { nodeName } = e.currentTarget;
|
||
// anchors inside an svg have a lowercase nodeName
|
||
const isAnchorNodeName = nodeName.toUpperCase() === 'A';
|
||
if (isAnchorNodeName && isModifiedEvent(e) || e.currentTarget.hasAttribute('download')) {
|
||
// ignore click for browser’s default behavior
|
||
return;
|
||
}
|
||
if (!(0, _islocalurl.isLocalURL)(href)) {
|
||
if (replace) {
|
||
// browser default behavior does not replace the history state
|
||
// so we need to do it manually
|
||
e.preventDefault();
|
||
location.replace(href);
|
||
}
|
||
// ignore click for browser’s default behavior
|
||
return;
|
||
}
|
||
e.preventDefault();
|
||
if (onNavigate) {
|
||
let isDefaultPrevented = false;
|
||
onNavigate({
|
||
preventDefault: ()=>{
|
||
isDefaultPrevented = true;
|
||
}
|
||
});
|
||
if (isDefaultPrevented) {
|
||
return;
|
||
}
|
||
}
|
||
const { dispatchNavigateAction } = __turbopack_context__.r("[project]/node_modules/next/dist/client/components/app-router-instance.js [app-client] (ecmascript)");
|
||
_react.default.startTransition(()=>{
|
||
dispatchNavigateAction(href, replace ? 'replace' : 'push', scroll === false ? _routerreducertypes.ScrollBehavior.NoScroll : _routerreducertypes.ScrollBehavior.Default, linkInstanceRef.current, transitionTypes);
|
||
});
|
||
}
|
||
}
|
||
function formatStringOrUrl(urlObjOrString) {
|
||
if (typeof urlObjOrString === 'string') {
|
||
return urlObjOrString;
|
||
}
|
||
return (0, _formaturl.formatUrl)(urlObjOrString);
|
||
}
|
||
function LinkComponent(props) {
|
||
const [linkStatus, setOptimisticLinkStatus] = (0, _react.useOptimistic)(_links.IDLE_LINK_STATUS);
|
||
let children;
|
||
const linkInstanceRef = (0, _react.useRef)(null);
|
||
const { href: hrefProp, as: asProp, children: childrenProp, prefetch: prefetchProp = null, passHref, replace, shallow, scroll, onClick, onMouseEnter: onMouseEnterProp, onTouchStart: onTouchStartProp, legacyBehavior = false, onNavigate, transitionTypes, ref: forwardedRef, unstable_dynamicOnHover, ...restProps } = props;
|
||
children = childrenProp;
|
||
if (legacyBehavior && (typeof children === 'string' || typeof children === 'number')) {
|
||
children = /*#__PURE__*/ (0, _jsxruntime.jsx)("a", {
|
||
children: children
|
||
});
|
||
}
|
||
const router = _react.default.useContext(_approutercontextsharedruntime.AppRouterContext);
|
||
const prefetchEnabled = prefetchProp !== false;
|
||
const fetchStrategy = prefetchProp !== false ? getFetchStrategyFromPrefetchProp(prefetchProp) : _types.FetchStrategy.PPR;
|
||
if ("TURBOPACK compile-time truthy", 1) {
|
||
function createPropError(args) {
|
||
return Object.defineProperty(new Error(`Failed prop type: The prop \`${args.key}\` expects a ${args.expected} in \`<Link>\`, but got \`${args.actual}\` instead.` + (typeof window !== 'undefined' ? "\nOpen your browser's console to view the Component stack trace." : '')), "__NEXT_ERROR_CODE", {
|
||
value: "E319",
|
||
enumerable: false,
|
||
configurable: true
|
||
});
|
||
}
|
||
// TypeScript trick for type-guarding:
|
||
const requiredPropsGuard = {
|
||
href: true
|
||
};
|
||
const requiredProps = Object.keys(requiredPropsGuard);
|
||
requiredProps.forEach((key)=>{
|
||
if (key === 'href') {
|
||
if (props[key] == null || typeof props[key] !== 'string' && typeof props[key] !== 'object') {
|
||
throw createPropError({
|
||
key,
|
||
expected: '`string` or `object`',
|
||
actual: props[key] === null ? 'null' : typeof props[key]
|
||
});
|
||
}
|
||
} else {
|
||
// TypeScript trick for type-guarding:
|
||
const _ = key;
|
||
}
|
||
});
|
||
// TypeScript trick for type-guarding:
|
||
const optionalPropsGuard = {
|
||
as: true,
|
||
replace: true,
|
||
scroll: true,
|
||
shallow: true,
|
||
passHref: true,
|
||
prefetch: true,
|
||
unstable_dynamicOnHover: true,
|
||
onClick: true,
|
||
onMouseEnter: true,
|
||
onTouchStart: true,
|
||
legacyBehavior: true,
|
||
onNavigate: true,
|
||
transitionTypes: true
|
||
};
|
||
const optionalProps = Object.keys(optionalPropsGuard);
|
||
optionalProps.forEach((key)=>{
|
||
const valType = typeof props[key];
|
||
if (key === 'as') {
|
||
if (props[key] && valType !== 'string' && valType !== 'object') {
|
||
throw createPropError({
|
||
key,
|
||
expected: '`string` or `object`',
|
||
actual: valType
|
||
});
|
||
}
|
||
} else if (key === 'onClick' || key === 'onMouseEnter' || key === 'onTouchStart' || key === 'onNavigate') {
|
||
if (props[key] && valType !== 'function') {
|
||
throw createPropError({
|
||
key,
|
||
expected: '`function`',
|
||
actual: valType
|
||
});
|
||
}
|
||
} else if (key === 'replace' || key === 'scroll' || key === 'shallow' || key === 'passHref' || key === 'legacyBehavior' || key === 'unstable_dynamicOnHover') {
|
||
if (props[key] != null && valType !== 'boolean') {
|
||
throw createPropError({
|
||
key,
|
||
expected: '`boolean`',
|
||
actual: valType
|
||
});
|
||
}
|
||
} else if (key === 'prefetch') {
|
||
if (props[key] != null && valType !== 'boolean' && props[key] !== 'auto') {
|
||
throw createPropError({
|
||
key,
|
||
expected: '`boolean | "auto"`',
|
||
actual: valType
|
||
});
|
||
}
|
||
} else if (key === 'transitionTypes') {
|
||
if (props[key] != null && !Array.isArray(props[key])) {
|
||
throw createPropError({
|
||
key,
|
||
expected: '`string[]`',
|
||
actual: valType
|
||
});
|
||
}
|
||
} else {
|
||
// TypeScript trick for type-guarding:
|
||
const _ = key;
|
||
}
|
||
});
|
||
}
|
||
const resolvedHref = asProp || hrefProp;
|
||
const formattedHref = formatStringOrUrl(resolvedHref);
|
||
if ("TURBOPACK compile-time truthy", 1) {
|
||
if (props.locale) {
|
||
(0, _warnonce.warnOnce)('The `locale` prop is not supported in `next/link` while using the `app` router. Read more about app router internalization: https://nextjs.org/docs/app/building-your-application/routing/internationalization');
|
||
}
|
||
if (!asProp) {
|
||
let href;
|
||
if (typeof resolvedHref === 'string') {
|
||
href = resolvedHref;
|
||
} else if (typeof resolvedHref === 'object' && typeof resolvedHref.pathname === 'string') {
|
||
href = resolvedHref.pathname;
|
||
}
|
||
if (href) {
|
||
const hasDynamicSegment = href.split('/').some((segment)=>segment.startsWith('[') && segment.endsWith(']'));
|
||
if (hasDynamicSegment) {
|
||
throw Object.defineProperty(new Error(`Dynamic href \`${href}\` found in <Link> while using the \`/app\` router, this is not supported. Read more: https://nextjs.org/docs/messages/app-dir-dynamic-href`), "__NEXT_ERROR_CODE", {
|
||
value: "E267",
|
||
enumerable: false,
|
||
configurable: true
|
||
});
|
||
}
|
||
}
|
||
}
|
||
}
|
||
// This will return the first child, if multiple are provided it will throw an error
|
||
let child;
|
||
if (legacyBehavior) {
|
||
if (children?.$$typeof === Symbol.for('react.lazy')) {
|
||
throw Object.defineProperty(new Error(`\`<Link legacyBehavior>\` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's \`<a>\` tag.`), "__NEXT_ERROR_CODE", {
|
||
value: "E863",
|
||
enumerable: false,
|
||
configurable: true
|
||
});
|
||
}
|
||
if ("TURBOPACK compile-time truthy", 1) {
|
||
if (onClick) {
|
||
console.warn(`"onClick" was passed to <Link> with \`href\` of \`${formattedHref}\` but "legacyBehavior" was set. The legacy behavior requires onClick be set on the child of next/link`);
|
||
}
|
||
if (onMouseEnterProp) {
|
||
console.warn(`"onMouseEnter" was passed to <Link> with \`href\` of \`${formattedHref}\` but "legacyBehavior" was set. The legacy behavior requires onMouseEnter be set on the child of next/link`);
|
||
}
|
||
try {
|
||
child = _react.default.Children.only(children);
|
||
} catch (err) {
|
||
if (!children) {
|
||
throw Object.defineProperty(new Error(`No children were passed to <Link> with \`href\` of \`${formattedHref}\` but one child is required https://nextjs.org/docs/messages/link-no-children`), "__NEXT_ERROR_CODE", {
|
||
value: "E320",
|
||
enumerable: false,
|
||
configurable: true
|
||
});
|
||
}
|
||
throw Object.defineProperty(new Error(`Multiple children were passed to <Link> with \`href\` of \`${formattedHref}\` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children` + (typeof window !== 'undefined' ? " \nOpen your browser's console to view the Component stack trace." : '')), "__NEXT_ERROR_CODE", {
|
||
value: "E266",
|
||
enumerable: false,
|
||
configurable: true
|
||
});
|
||
}
|
||
} else //TURBOPACK unreachable
|
||
;
|
||
} else {
|
||
if ("TURBOPACK compile-time truthy", 1) {
|
||
if (children?.type === 'a') {
|
||
throw Object.defineProperty(new Error('Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>.\nLearn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor'), "__NEXT_ERROR_CODE", {
|
||
value: "E209",
|
||
enumerable: false,
|
||
configurable: true
|
||
});
|
||
}
|
||
}
|
||
}
|
||
const childRef = legacyBehavior ? child && typeof child === 'object' && child.ref : forwardedRef;
|
||
// Use a callback ref to attach an IntersectionObserver to the anchor tag on
|
||
// mount. In the future we will also use this to keep track of all the
|
||
// currently mounted <Link> instances, e.g. so we can re-prefetch them after
|
||
// a revalidation or refresh.
|
||
const observeLinkVisibilityOnMount = _react.default.useCallback({
|
||
"LinkComponent.useCallback[observeLinkVisibilityOnMount]": (element)=>{
|
||
if (router !== null) {
|
||
linkInstanceRef.current = (0, _links.mountLinkInstance)(element, formattedHref, router, fetchStrategy, prefetchEnabled, setOptimisticLinkStatus);
|
||
}
|
||
return ({
|
||
"LinkComponent.useCallback[observeLinkVisibilityOnMount]": ()=>{
|
||
if (linkInstanceRef.current) {
|
||
(0, _links.unmountLinkForCurrentNavigation)(linkInstanceRef.current);
|
||
linkInstanceRef.current = null;
|
||
}
|
||
(0, _links.unmountPrefetchableInstance)(element);
|
||
}
|
||
})["LinkComponent.useCallback[observeLinkVisibilityOnMount]"];
|
||
}
|
||
}["LinkComponent.useCallback[observeLinkVisibilityOnMount]"], [
|
||
prefetchEnabled,
|
||
formattedHref,
|
||
router,
|
||
fetchStrategy,
|
||
setOptimisticLinkStatus
|
||
]);
|
||
const mergedRef = (0, _usemergedref.useMergedRef)(observeLinkVisibilityOnMount, childRef);
|
||
const childProps = {
|
||
ref: mergedRef,
|
||
onClick (e) {
|
||
if ("TURBOPACK compile-time truthy", 1) {
|
||
if (!e) {
|
||
throw Object.defineProperty(new Error(`Component rendered inside next/link has to pass click event to "onClick" prop.`), "__NEXT_ERROR_CODE", {
|
||
value: "E312",
|
||
enumerable: false,
|
||
configurable: true
|
||
});
|
||
}
|
||
}
|
||
if (!legacyBehavior && typeof onClick === 'function') {
|
||
onClick(e);
|
||
}
|
||
if (legacyBehavior && child.props && typeof child.props.onClick === 'function') {
|
||
child.props.onClick(e);
|
||
}
|
||
if (!router) {
|
||
return;
|
||
}
|
||
if (e.defaultPrevented) {
|
||
return;
|
||
}
|
||
linkClicked(e, formattedHref, linkInstanceRef, replace, scroll, onNavigate, transitionTypes);
|
||
},
|
||
onMouseEnter (e) {
|
||
if (!legacyBehavior && typeof onMouseEnterProp === 'function') {
|
||
onMouseEnterProp(e);
|
||
}
|
||
if (legacyBehavior && child.props && typeof child.props.onMouseEnter === 'function') {
|
||
child.props.onMouseEnter(e);
|
||
}
|
||
if (!router) {
|
||
return;
|
||
}
|
||
if ("TURBOPACK compile-time truthy", 1) {
|
||
return;
|
||
}
|
||
//TURBOPACK unreachable
|
||
;
|
||
const upgradeToDynamicPrefetch = undefined;
|
||
},
|
||
onTouchStart: ("TURBOPACK compile-time falsy", 0) ? "TURBOPACK unreachable" : function onTouchStart(e) {
|
||
if (!legacyBehavior && typeof onTouchStartProp === 'function') {
|
||
onTouchStartProp(e);
|
||
}
|
||
if (legacyBehavior && child.props && typeof child.props.onTouchStart === 'function') {
|
||
child.props.onTouchStart(e);
|
||
}
|
||
if (!router) {
|
||
return;
|
||
}
|
||
if (!prefetchEnabled) {
|
||
return;
|
||
}
|
||
const upgradeToDynamicPrefetch = unstable_dynamicOnHover === true;
|
||
(0, _links.onNavigationIntent)(e.currentTarget, upgradeToDynamicPrefetch);
|
||
}
|
||
};
|
||
// If the url is absolute, we can bypass the logic to prepend the basePath.
|
||
if ((0, _utils.isAbsoluteUrl)(formattedHref)) {
|
||
childProps.href = formattedHref;
|
||
} else if (!legacyBehavior || passHref || child.type === 'a' && !('href' in child.props)) {
|
||
childProps.href = (0, _addbasepath.addBasePath)(formattedHref);
|
||
}
|
||
let link;
|
||
if (legacyBehavior) {
|
||
if ("TURBOPACK compile-time truthy", 1) {
|
||
(0, _erroronce.errorOnce)('`legacyBehavior` is deprecated and will be removed in a future ' + 'release. A codemod is available to upgrade your components:\n\n' + 'npx @next/codemod@latest new-link .\n\n' + 'Learn more: https://nextjs.org/docs/app/building-your-application/upgrading/codemods#remove-a-tags-from-link-components');
|
||
}
|
||
link = /*#__PURE__*/ _react.default.cloneElement(child, childProps);
|
||
} else {
|
||
link = /*#__PURE__*/ (0, _jsxruntime.jsx)("a", {
|
||
...restProps,
|
||
...childProps,
|
||
children: children
|
||
});
|
||
}
|
||
return /*#__PURE__*/ (0, _jsxruntime.jsx)(LinkStatusContext.Provider, {
|
||
value: linkStatus,
|
||
children: link
|
||
});
|
||
}
|
||
const LinkStatusContext = /*#__PURE__*/ (0, _react.createContext)(_links.IDLE_LINK_STATUS);
|
||
const useLinkStatus = ()=>{
|
||
return (0, _react.useContext)(LinkStatusContext);
|
||
};
|
||
function getFetchStrategyFromPrefetchProp(prefetchProp) {
|
||
if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable
|
||
;
|
||
else {
|
||
return prefetchProp === null || prefetchProp === 'auto' ? _types.FetchStrategy.PPR : // (although invalid values should've been filtered out by prop validation in dev)
|
||
_types.FetchStrategy.Full;
|
||
}
|
||
}
|
||
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
||
Object.defineProperty(exports.default, '__esModule', {
|
||
value: true
|
||
});
|
||
Object.assign(exports.default, exports);
|
||
module.exports = exports.default;
|
||
}
|
||
}),
|
||
]);
|
||
|
||
//# sourceMappingURL=_060w1qh._.js.map
|