module.exports = [
"[project]/app/inter_f6b4a64c.module.css [app-rsc] (css module)", ((__turbopack_context__) => {

__turbopack_context__.v({
  "className": "inter_f6b4a64c-module__jWsb6a__className",
  "variable": "inter_f6b4a64c-module__jWsb6a__variable",
});
}),
"[project]/app/inter_f6b4a64c.js [app-rsc] (ecmascript)", ((__turbopack_context__) => {
"use strict";

__turbopack_context__.s([
    "default",
    ()=>__TURBOPACK__default__export__
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$app$2f$inter_f6b4a64c$2e$module$2e$css__$5b$app$2d$rsc$5d$__$28$css__module$29$__ = __turbopack_context__.i("[project]/app/inter_f6b4a64c.module.css [app-rsc] (css module)");
;
const fontData = {
    className: __TURBOPACK__imported__module__$5b$project$5d2f$app$2f$inter_f6b4a64c$2e$module$2e$css__$5b$app$2d$rsc$5d$__$28$css__module$29$__["default"].className,
    style: {
        fontFamily: "'inter', 'inter Fallback'"
    }
};
if (__TURBOPACK__imported__module__$5b$project$5d2f$app$2f$inter_f6b4a64c$2e$module$2e$css__$5b$app$2d$rsc$5d$__$28$css__module$29$__["default"].variable != null) {
    fontData.variable = __TURBOPACK__imported__module__$5b$project$5d2f$app$2f$inter_f6b4a64c$2e$module$2e$css__$5b$app$2d$rsc$5d$__$28$css__module$29$__["default"].variable;
}
const __TURBOPACK__default__export__ = fontData;
}),
"[project]/lib/content.ts [app-rsc] (ecmascript)", ((__turbopack_context__) => {
"use strict";

__turbopack_context__.s([
    "getBlogPosts",
    ()=>getBlogPosts,
    "getCaseStudies",
    ()=>getCaseStudies,
    "getIndustries",
    ()=>getIndustries,
    "getPartnerBrands",
    ()=>getPartnerBrands,
    "getProducts",
    ()=>getProducts,
    "getSiteSettings",
    ()=>getSiteSettings,
    "getSolutions",
    ()=>getSolutions
]);
const API_BASE_URL = (("TURBOPACK compile-time value", "https://cms.akarya.id") ?? "http://127.0.0.1:8000").replace(/\/+$/, "");
const configuredRevalidateSeconds = Number(("TURBOPACK compile-time value", "60") ?? 10);
const contentRevalidateSeconds = Number.isFinite(configuredRevalidateSeconds) ? configuredRevalidateSeconds : 10;
/**
 * Prefix relative media paths (e.g. "/storage/foo.jpg") returned by the API with
 * the API origin so <Image>/<video> can load them. Absolute URLs are left as-is.
 */ function resolveMediaUrls(value) {
    if (Array.isArray(value)) {
        return value.map(resolveMediaUrls);
    }
    if (value && typeof value === "object") {
        return Object.fromEntries(Object.entries(value).map(([key, entry])=>[
                key,
                key === "url" && typeof entry === "string" && entry.startsWith("/") && !entry.startsWith("//") ? `${API_BASE_URL}${entry}` : resolveMediaUrls(entry)
            ]));
    }
    return value;
}
const sleep = (ms)=>new Promise((resolve)=>setTimeout(resolve, ms));
// Cap concurrent requests so a single-threaded backend (e.g. `php artisan serve`)
// is not overwhelmed while many static pages are generated in parallel.
const maxConcurrentRequests = 3;
let inFlight = 0;
const waiters = [];
async function acquireSlot() {
    if (inFlight < maxConcurrentRequests) {
        inFlight += 1;
        return;
    }
    await new Promise((resolve)=>waiters.push(resolve));
    inFlight += 1;
}
function releaseSlot() {
    inFlight -= 1;
    waiters.shift()?.();
}
async function fetchJsonOnce(path) {
    await acquireSlot();
    try {
        const response = await fetch(`${API_BASE_URL}/api/v1${path}`, {
            headers: {
                Accept: "application/json"
            },
            next: {
                revalidate: contentRevalidateSeconds
            }
        });
        if (!response.ok) {
            throw new Error(`Content API request failed (${response.status}) for ${path}`);
        }
        const payload = await response.json();
        const data = payload && typeof payload === "object" && "data" in payload ? payload.data : payload;
        return resolveMediaUrls(data);
    } finally{
        releaseSlot();
    }
}
async function requestJson(path) {
    const maxAttempts = 6;
    for(let attempt = 1;; attempt += 1){
        try {
            return await fetchJsonOnce(path);
        } catch (error) {
            if (attempt >= maxAttempts) {
                throw error instanceof Error ? error : new Error(`Content API request failed for ${path}`);
            }
            // Retry transient connection failures with exponential backoff.
            await sleep(Math.min(300 * 2 ** (attempt - 1), 5000));
        }
    }
}
// During `next build` the content is a static snapshot, so each endpoint only
// needs to be fetched once per worker process. At runtime (`next start`) we skip
// this in-memory cache so content edits show up on refresh — Next's own fetch
// cache still applies the `revalidate` window (ISR).
const isBuild = process.env.NEXT_PHASE === "phase-production-build";
const requestCache = new Map();
function apiFetch(path) {
    if (!isBuild) return requestJson(path);
    let cached = requestCache.get(path);
    if (!cached) {
        cached = requestJson(path);
        requestCache.set(path, cached);
    }
    return cached;
}
async function getSiteSettings() {
    const [settings, homepage] = await Promise.all([
        apiFetch("/site-settings"),
        apiFetch("/homepage")
    ]);
    return {
        ...settings,
        homepageHeroSlides: homepage.heroSlides ?? [],
        homepageOverview: homepage.overview,
        homepageShowcase: homepage.showcase,
        homepageProducts: homepage.products,
        roomDesignerPage: homepage.roomDesigner
    };
}
async function getSolutions() {
    return apiFetch("/solutions");
}
async function getProducts() {
    return apiFetch("/products");
}
async function getIndustries() {
    return apiFetch("/industries");
}
async function getCaseStudies() {
    const items = await apiFetch("/case-studies");
    return items.map((item)=>({
            ...item,
            productsOrTechnologiesUsed: Array.isArray(item.productsOrTechnologiesUsed) ? item.productsOrTechnologiesUsed : item.productsOrTechnologiesUsed?.en ?? item.productsOrTechnologiesUsed?.id ?? []
        }));
}
async function getPartnerBrands() {
    return apiFetch("/partner-brands");
}
async function getBlogPosts() {
    const items = await apiFetch("/blog-posts");
    return [
        ...items
    ].sort((a, b)=>new Date(b.publishedAt).getTime() - new Date(a.publishedAt).getTime());
}
}),
"[project]/app/layout.tsx [app-rsc] (ecmascript)", ((__turbopack_context__) => {
"use strict";

__turbopack_context__.s([
    "default",
    ()=>RootLayout,
    "generateMetadata",
    ()=>generateMetadata
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$2$2e$10_$40$babel$2b$core$40$7$2e$_2be7c1b3eb9e15abcc65ceb4a74f9adb$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$rsc$2f$react$2d$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$rsc$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/.pnpm/next@16.2.10_@babel+core@7._2be7c1b3eb9e15abcc65ceb4a74f9adb/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-dev-runtime.js [app-rsc] (ecmascript)");
var __TURBOPACK__imported__module__$5b$project$5d2f$app$2f$inter_f6b4a64c$2e$js__$5b$app$2d$rsc$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/app/inter_f6b4a64c.js [app-rsc] (ecmascript)");
var __TURBOPACK__imported__module__$5b$project$5d2f$lib$2f$content$2e$ts__$5b$app$2d$rsc$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/lib/content.ts [app-rsc] (ecmascript)");
;
;
;
;
async function generateMetadata() {
    const settings = await (0, __TURBOPACK__imported__module__$5b$project$5d2f$lib$2f$content$2e$ts__$5b$app$2d$rsc$5d$__$28$ecmascript$29$__["getSiteSettings"])();
    return {
        metadataBase: new URL(("TURBOPACK compile-time value", "https://test.akarya.id") ?? "https://www.akarya.id"),
        title: {
            default: settings.defaultSeoTitle.en,
            template: "%s"
        },
        description: settings.defaultSeoDescription.en,
        icons: {
            icon: "/logos/akarya/akarya-logo-simple-blue.png",
            apple: "/logos/akarya/akarya-logo-simple-blue.png"
        }
    };
}
function RootLayout({ children }) {
    return /*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$2$2e$10_$40$babel$2b$core$40$7$2e$_2be7c1b3eb9e15abcc65ceb4a74f9adb$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$rsc$2f$react$2d$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$rsc$5d$__$28$ecmascript$29$__["jsxDEV"])("html", {
        lang: "en",
        children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$2$2e$10_$40$babel$2b$core$40$7$2e$_2be7c1b3eb9e15abcc65ceb4a74f9adb$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$rsc$2f$react$2d$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$rsc$5d$__$28$ecmascript$29$__["jsxDEV"])("body", {
            className: __TURBOPACK__imported__module__$5b$project$5d2f$app$2f$inter_f6b4a64c$2e$js__$5b$app$2d$rsc$5d$__$28$ecmascript$29$__["default"].variable,
            children: children
        }, void 0, false, {
            fileName: "[project]/app/layout.tsx",
            lineNumber: 32,
            columnNumber: 7
        }, this)
    }, void 0, false, {
        fileName: "[project]/app/layout.tsx",
        lineNumber: 31,
        columnNumber: 5
    }, this);
}
}),
"[project]/app/layout.tsx [app-rsc] (ecmascript, Next.js Server Component)", ((__turbopack_context__) => {

__turbopack_context__.n(__turbopack_context__.i("[project]/app/layout.tsx [app-rsc] (ecmascript)"));
}),
"[project]/node_modules/.pnpm/next@16.2.10_@babel+core@7._2be7c1b3eb9e15abcc65ceb4a74f9adb/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-dev-runtime.js [app-rsc] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";

module.exports = __turbopack_context__.r("[project]/node_modules/.pnpm/next@16.2.10_@babel+core@7._2be7c1b3eb9e15abcc65ceb4a74f9adb/node_modules/next/dist/server/route-modules/app-page/module.compiled.js [app-rsc] (ecmascript)").vendored['react-rsc'].ReactJsxDevRuntime;
}),
];

//# sourceMappingURL=_18ro1mb._.js.map