Files
Laca-City/frontend/node_modules/next/dist/lib/metadata/resolvers/resolve-url.js
PhongPham c65cc97a33 🎯 MapView v2.0 - Global Deployment Ready
 MAJOR FEATURES:
• Auto-zoom intelligence với smart bounds fitting
• Enhanced 3D GPS markers với pulsing effects
• Professional route display với 6-layer rendering
• Status-based parking icons với availability indicators
• Production-ready build optimizations

🗺️ AUTO-ZOOM FEATURES:
• Smart bounds fitting cho GPS + selected parking
• Adaptive padding (50px) cho visual balance
• Max zoom control (level 16) để tránh quá gần
• Dynamic centering khi không có selection

🎨 ENHANCED VISUALS:
• 3D GPS marker với multi-layer pulse effects
• Advanced parking icons với status colors
• Selection highlighting với animation
• Dimming system cho non-selected items

🛣️ ROUTE SYSTEM:
• OpenRouteService API integration
• Multi-layer route rendering (glow, shadow, main, animated)
• Real-time distance & duration calculation
• Visual route info trong popup

📱 PRODUCTION READY:
• SSR safe với dynamic imports
• Build errors resolved
• Global deployment via Vercel
• Optimized performance

🌍 DEPLOYMENT:
• Vercel: https://whatever-ctk2auuxr-phong12hexdockworks-projects.vercel.app
• Bundle size: 22.8 kB optimized
• Global CDN distribution
• HTTPS enabled

💾 VERSION CONTROL:
• MapView-v2.0.tsx backup created
• MAPVIEW_VERSIONS.md documentation
• Full version history tracking
2025-07-20 19:52:16 +07:00

136 lines
5.0 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
getSocialImageFallbackMetadataBase: null,
isStringOrURL: null,
resolveAbsoluteUrlWithPathname: null,
resolveRelativeUrl: null,
resolveUrl: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
getSocialImageFallbackMetadataBase: function() {
return getSocialImageFallbackMetadataBase;
},
isStringOrURL: function() {
return isStringOrURL;
},
resolveAbsoluteUrlWithPathname: function() {
return resolveAbsoluteUrlWithPathname;
},
resolveRelativeUrl: function() {
return resolveRelativeUrl;
},
resolveUrl: function() {
return resolveUrl;
}
});
const _path = /*#__PURE__*/ _interop_require_default(require("../../../shared/lib/isomorphic/path"));
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function isStringOrURL(icon) {
return typeof icon === "string" || icon instanceof URL;
}
function createLocalMetadataBase() {
return new URL(`http://localhost:${process.env.PORT || 3000}`);
}
function getPreviewDeploymentUrl() {
const origin = process.env.VERCEL_BRANCH_URL || process.env.VERCEL_URL;
return origin ? new URL(`https://${origin}`) : undefined;
}
function getProductionDeploymentUrl() {
const origin = process.env.VERCEL_PROJECT_PRODUCTION_URL;
return origin ? new URL(`https://${origin}`) : undefined;
}
function getSocialImageFallbackMetadataBase(metadataBase) {
const isMetadataBaseMissing = !metadataBase;
const defaultMetadataBase = createLocalMetadataBase();
const previewDeploymentUrl = getPreviewDeploymentUrl();
const productionDeploymentUrl = getProductionDeploymentUrl();
let fallbackMetadataBase;
if (process.env.NODE_ENV === "development") {
fallbackMetadataBase = defaultMetadataBase;
} else {
fallbackMetadataBase = process.env.NODE_ENV === "production" && previewDeploymentUrl && process.env.VERCEL_ENV === "preview" ? previewDeploymentUrl : metadataBase || productionDeploymentUrl || defaultMetadataBase;
}
return {
fallbackMetadataBase,
isMetadataBaseMissing
};
}
function resolveUrl(url, metadataBase) {
if (url instanceof URL) return url;
if (!url) return null;
try {
// If we can construct a URL instance from url, ignore metadataBase
const parsedUrl = new URL(url);
return parsedUrl;
} catch {}
if (!metadataBase) {
metadataBase = createLocalMetadataBase();
}
// Handle relative or absolute paths
const basePath = metadataBase.pathname || "";
const joinedPath = _path.default.posix.join(basePath, url);
return new URL(joinedPath, metadataBase);
}
// Resolve with `pathname` if `url` is a relative path.
function resolveRelativeUrl(url, pathname) {
if (typeof url === "string" && url.startsWith("./")) {
return _path.default.posix.resolve(pathname, url);
}
return url;
}
// The regex is matching logic from packages/next/src/lib/load-custom-routes.ts
const FILE_REGEX = /^(?:\/((?!\.well-known(?:\/.*)?)(?:[^/]+\/)*[^/]+\.\w+))(\/?|$)/i;
function isFilePattern(pathname) {
return FILE_REGEX.test(pathname);
}
// Resolve `pathname` if `url` is a relative path the compose with `metadataBase`.
function resolveAbsoluteUrlWithPathname(url, metadataBase, { trailingSlash, pathname }) {
// Resolve url with pathname that always starts with `/`
url = resolveRelativeUrl(url, pathname);
// Convert string url or URL instance to absolute url string,
// if there's case needs to be resolved with metadataBase
let resolvedUrl = "";
const result = metadataBase ? resolveUrl(url, metadataBase) : url;
if (typeof result === "string") {
resolvedUrl = result;
} else {
resolvedUrl = result.pathname === "/" ? result.origin : result.href;
}
// Add trailing slash if it's enabled for urls matches the condition
// - Not external, same origin with metadataBase
// - Doesn't have query
if (trailingSlash && !resolvedUrl.endsWith("/")) {
let isRelative = resolvedUrl.startsWith("/");
let hasQuery = resolvedUrl.includes("?");
let isExternal = false;
let isFileUrl = false;
if (!isRelative) {
try {
const parsedUrl = new URL(resolvedUrl);
isExternal = metadataBase != null && parsedUrl.origin !== metadataBase.origin;
isFileUrl = isFilePattern(parsedUrl.pathname);
} catch {
// If it's not a valid URL, treat it as external
isExternal = true;
}
if (// Do not apply trailing slash for file like urls, aligning with the behavior with `trailingSlash`
!isFileUrl && !isExternal && !hasQuery) return `${resolvedUrl}/`;
}
}
return resolvedUrl;
}
//# sourceMappingURL=resolve-url.js.map