✨ 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
70 lines
3.0 KiB
JavaScript
70 lines
3.0 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
decryptWithSecret: null,
|
|
encryptWithSecret: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
decryptWithSecret: function() {
|
|
return decryptWithSecret;
|
|
},
|
|
encryptWithSecret: function() {
|
|
return encryptWithSecret;
|
|
}
|
|
});
|
|
const _crypto = /*#__PURE__*/ _interop_require_default(require("crypto"));
|
|
function _interop_require_default(obj) {
|
|
return obj && obj.__esModule ? obj : {
|
|
default: obj
|
|
};
|
|
}
|
|
// Background:
|
|
// https://security.stackexchange.com/questions/184305/why-would-i-ever-use-aes-256-cbc-if-aes-256-gcm-is-more-secure
|
|
const CIPHER_ALGORITHM = `aes-256-gcm`, CIPHER_KEY_LENGTH = 32, CIPHER_IV_LENGTH = 16, CIPHER_TAG_LENGTH = 16, CIPHER_SALT_LENGTH = 64;
|
|
const PBKDF2_ITERATIONS = 100000 // https://support.1password.com/pbkdf2/
|
|
;
|
|
function encryptWithSecret(secret, data) {
|
|
const iv = _crypto.default.randomBytes(CIPHER_IV_LENGTH);
|
|
const salt = _crypto.default.randomBytes(CIPHER_SALT_LENGTH);
|
|
// https://nodejs.org/api/crypto.html#crypto_crypto_pbkdf2sync_password_salt_iterations_keylen_digest
|
|
const key = _crypto.default.pbkdf2Sync(secret, salt, PBKDF2_ITERATIONS, CIPHER_KEY_LENGTH, `sha512`);
|
|
const cipher = _crypto.default.createCipheriv(CIPHER_ALGORITHM, key, iv);
|
|
const encrypted = Buffer.concat([
|
|
cipher.update(data, `utf8`),
|
|
cipher.final()
|
|
]);
|
|
// https://nodejs.org/api/crypto.html#crypto_cipher_getauthtag
|
|
const tag = cipher.getAuthTag();
|
|
return Buffer.concat([
|
|
// Data as required by:
|
|
// Salt for Key: https://nodejs.org/api/crypto.html#crypto_crypto_pbkdf2sync_password_salt_iterations_keylen_digest
|
|
// IV: https://nodejs.org/api/crypto.html#crypto_class_decipher
|
|
// Tag: https://nodejs.org/api/crypto.html#crypto_decipher_setauthtag_buffer
|
|
salt,
|
|
iv,
|
|
tag,
|
|
encrypted
|
|
]).toString(`hex`);
|
|
}
|
|
function decryptWithSecret(secret, encryptedData) {
|
|
const buffer = Buffer.from(encryptedData, `hex`);
|
|
const salt = buffer.slice(0, CIPHER_SALT_LENGTH);
|
|
const iv = buffer.slice(CIPHER_SALT_LENGTH, CIPHER_SALT_LENGTH + CIPHER_IV_LENGTH);
|
|
const tag = buffer.slice(CIPHER_SALT_LENGTH + CIPHER_IV_LENGTH, CIPHER_SALT_LENGTH + CIPHER_IV_LENGTH + CIPHER_TAG_LENGTH);
|
|
const encrypted = buffer.slice(CIPHER_SALT_LENGTH + CIPHER_IV_LENGTH + CIPHER_TAG_LENGTH);
|
|
// https://nodejs.org/api/crypto.html#crypto_crypto_pbkdf2sync_password_salt_iterations_keylen_digest
|
|
const key = _crypto.default.pbkdf2Sync(secret, salt, PBKDF2_ITERATIONS, CIPHER_KEY_LENGTH, `sha512`);
|
|
const decipher = _crypto.default.createDecipheriv(CIPHER_ALGORITHM, key, iv);
|
|
decipher.setAuthTag(tag);
|
|
return decipher.update(encrypted) + decipher.final(`utf8`);
|
|
}
|
|
|
|
//# sourceMappingURL=crypto-utils.js.map
|