// basePath (/docedit/note) — ค่าจาก next.config.mjs (inline ตอน build ผ่าน env) // ใช้กับ URL ฝั่ง browser ที่ Next ไม่เติม basePath ให้เอง: fetch/EventSource/ // plain /workerSrc/img src — ต่างจาก /router/redirect ของ next // ที่เติมให้อัตโนมัติ (pdfUrl ใน DB เก็บ path ไม่รวม basePath เติมตอนใช้เท่านั้น) export function withBasePath(path: string): string { return `${process.env.NEXT_PUBLIC_BASE_PATH ?? ""}${path}`; }