@mamrp/components 1.7.55 → 1.7.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -6167,6 +6167,10 @@ function MapLocationPicker({
6167
6167
  const [showGpsDialog, setShowGpsDialog] = (0, import_react33.useState)(false);
6168
6168
  const [gpsErrorType, setGpsErrorType] = (0, import_react33.useState)("other");
6169
6169
  const [zoom, setZoom] = (0, import_react33.useState)(defaultZoom);
6170
+ const hasExistingLocation = latitude !== null && longitude !== null;
6171
+ const initialLat = hasExistingLocation ? latitude : defaultLat;
6172
+ const initialLng = hasExistingLocation ? longitude : defaultLng;
6173
+ const initialZoom = hasExistingLocation ? 17 : defaultZoom;
6170
6174
  (0, import_react33.useEffect)(() => {
6171
6175
  if (!document.getElementById("leaflet-css")) {
6172
6176
  const link = document.createElement("link");
@@ -6186,39 +6190,10 @@ function MapLocationPicker({
6186
6190
  return () => {
6187
6191
  if (mapInstanceRef.current) {
6188
6192
  mapInstanceRef.current.remove();
6193
+ mapInstanceRef.current = null;
6189
6194
  }
6190
6195
  };
6191
6196
  }, []);
6192
- (0, import_react33.useEffect)(() => {
6193
- if (!mapInstanceRef.current) return;
6194
- if (latitude === null || longitude === null) {
6195
- if (markerRef.current) {
6196
- markerRef.current.remove();
6197
- markerRef.current = null;
6198
- }
6199
- return;
6200
- }
6201
- const currentLat = latitude ?? defaultLat;
6202
- const currentLng = longitude ?? defaultLng;
6203
- const L = window.L;
6204
- if (!markerRef.current) {
6205
- markerRef.current = L.marker([currentLat, currentLng], {
6206
- draggable: true
6207
- }).addTo(mapInstanceRef.current);
6208
- markerRef.current.on("dragend", async (e) => {
6209
- const { lat, lng } = e.target.getLatLng();
6210
- handleLocationChange(lat, lng);
6211
- if (handleAddressChange) {
6212
- setIsGeocoding(true);
6213
- const address = await reverseGeocode(lat, lng);
6214
- handleAddressChange(address);
6215
- setIsGeocoding(false);
6216
- }
6217
- });
6218
- } else {
6219
- markerRef.current.setLatLng([currentLat, currentLng]);
6220
- }
6221
- }, [latitude, longitude, handleAddressChange, defaultLat, defaultLng]);
6222
6197
  const reverseGeocode = async (lat, lng) => {
6223
6198
  try {
6224
6199
  const response = await fetch(
@@ -6236,12 +6211,10 @@ function MapLocationPicker({
6236
6211
  const initializeMap = () => {
6237
6212
  if (!window.L || !mapRef.current || mapInstanceRef.current) return;
6238
6213
  const L = window.L;
6239
- const initialLat = latitude ?? defaultLat;
6240
- const initialLng = longitude ?? defaultLng;
6241
6214
  const map = L.map(mapRef.current, {
6242
6215
  attributionControl: false,
6243
6216
  minZoom
6244
- }).setView([initialLat, initialLng], zoom);
6217
+ }).setView([initialLat, initialLng], initialZoom);
6245
6218
  L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
6246
6219
  attribution: "\xA9 OpenStreetMap contributors",
6247
6220
  maxZoom
@@ -6249,11 +6222,11 @@ function MapLocationPicker({
6249
6222
  map.on("zoomend", () => {
6250
6223
  setZoom(map.getZoom());
6251
6224
  });
6252
- if (latitude !== null && longitude !== null) {
6253
- const marker = L.marker([initialLat, initialLng], {
6225
+ if (hasExistingLocation) {
6226
+ markerRef.current = L.marker([initialLat, initialLng], {
6254
6227
  draggable: true
6255
6228
  }).addTo(map);
6256
- marker.on("dragend", async (e) => {
6229
+ markerRef.current.on("dragend", async (e) => {
6257
6230
  const { lat, lng } = e.target.getLatLng();
6258
6231
  handleLocationChange(lat, lng);
6259
6232
  if (handleAddressChange) {
@@ -6263,15 +6236,13 @@ function MapLocationPicker({
6263
6236
  setIsGeocoding(false);
6264
6237
  }
6265
6238
  });
6266
- markerRef.current = marker;
6267
6239
  }
6268
6240
  map.on("click", async (e) => {
6269
6241
  const { lat, lng } = e.latlng;
6270
6242
  if (!markerRef.current) {
6271
- const L2 = window.L;
6272
- markerRef.current = L2.marker([lat, lng], {
6273
- draggable: true
6274
- }).addTo(map);
6243
+ markerRef.current = L.marker([lat, lng], { draggable: true }).addTo(
6244
+ map
6245
+ );
6275
6246
  markerRef.current.on("dragend", async (dragEvent) => {
6276
6247
  const { lat: dragLat, lng: dragLng } = dragEvent.target.getLatLng();
6277
6248
  handleLocationChange(dragLat, dragLng);
@@ -6295,6 +6266,37 @@ function MapLocationPicker({
6295
6266
  });
6296
6267
  mapInstanceRef.current = map;
6297
6268
  };
6269
+ (0, import_react33.useEffect)(() => {
6270
+ if (!mapInstanceRef.current || !mapRef.current) return;
6271
+ const L = window.L;
6272
+ if (latitude === null || longitude === null) {
6273
+ if (markerRef.current) {
6274
+ markerRef.current.remove();
6275
+ markerRef.current = null;
6276
+ }
6277
+ return;
6278
+ }
6279
+ if (!markerRef.current) {
6280
+ markerRef.current = L.marker([latitude, longitude], {
6281
+ draggable: true
6282
+ }).addTo(mapInstanceRef.current);
6283
+ markerRef.current.on("dragend", async (e) => {
6284
+ const { lat, lng } = e.target.getLatLng();
6285
+ handleLocationChange(lat, lng);
6286
+ if (handleAddressChange) {
6287
+ setIsGeocoding(true);
6288
+ const address = await reverseGeocode(lat, lng);
6289
+ handleAddressChange(address);
6290
+ setIsGeocoding(false);
6291
+ }
6292
+ });
6293
+ } else {
6294
+ markerRef.current.setLatLng([latitude, longitude]);
6295
+ }
6296
+ mapInstanceRef.current.setView([latitude, longitude], zoom, {
6297
+ animate: true
6298
+ });
6299
+ }, [latitude, longitude]);
6298
6300
  const checkGeolocationSupport = () => {
6299
6301
  if (!navigator.geolocation) {
6300
6302
  import_react_hot_toast2.default.error("\u0645\u0631\u0648\u0631\u06AF\u0631 \u0634\u0645\u0627 \u0627\u0632 \u0645\u0648\u0642\u0639\u06CC\u062A \u0645\u06A9\u0627\u0646\u06CC \u067E\u0634\u062A\u06CC\u0628\u0627\u0646\u06CC \u0646\u0645\u06CC\u200C\u06A9\u0646\u062F.");
@@ -6303,9 +6305,7 @@ function MapLocationPicker({
6303
6305
  return true;
6304
6306
  };
6305
6307
  const handleCurrentLocation = async () => {
6306
- if (!checkGeolocationSupport() || !mapInstanceRef.current) {
6307
- return;
6308
- }
6308
+ if (!checkGeolocationSupport() || !mapInstanceRef.current) return;
6309
6309
  if (navigator.permissions) {
6310
6310
  try {
6311
6311
  const permissionStatus = await navigator.permissions.query({
@@ -6316,8 +6316,7 @@ function MapLocationPicker({
6316
6316
  setShowGpsDialog(true);
6317
6317
  return;
6318
6318
  }
6319
- } catch (error2) {
6320
- console.log("Permissions API not available");
6319
+ } catch {
6321
6320
  }
6322
6321
  }
6323
6322
  setIsGeolocating(true);
@@ -6337,9 +6336,9 @@ function MapLocationPicker({
6337
6336
  const L = window.L;
6338
6337
  handleLocationChange(lat, lng);
6339
6338
  if (!markerRef.current) {
6340
- markerRef.current = L.marker([lat, lng], {
6341
- draggable: true
6342
- }).addTo(map);
6339
+ markerRef.current = L.marker([lat, lng], { draggable: true }).addTo(
6340
+ map
6341
+ );
6343
6342
  markerRef.current.on("dragend", async (e) => {
6344
6343
  const { lat: dragLat, lng: dragLng } = e.target.getLatLng();
6345
6344
  handleLocationChange(dragLat, dragLng);
@@ -6353,7 +6352,7 @@ function MapLocationPicker({
6353
6352
  } else {
6354
6353
  markerRef.current.setLatLng([lat, lng]);
6355
6354
  }
6356
- map.setView([lat, lng], map.getZoom(), { animate: true });
6355
+ map.setView([lat, lng], 17, { animate: true });
6357
6356
  if (handleAddressChange) {
6358
6357
  setIsGeocoding(true);
6359
6358
  const address = await reverseGeocode(lat, lng);
@@ -6365,25 +6364,19 @@ function MapLocationPicker({
6365
6364
  (error2) => {
6366
6365
  clearTimeout(timeoutId);
6367
6366
  setIsGeolocating(false);
6368
- let errorMessage = "\u062E\u0637\u0627 \u062F\u0631 \u062F\u0631\u06CC\u0627\u0641\u062A \u0645\u0648\u0642\u0639\u06CC\u062A \u0645\u06A9\u0627\u0646\u06CC";
6369
6367
  switch (error2.code) {
6370
6368
  case error2.PERMISSION_DENIED:
6371
6369
  setGpsErrorType("permission");
6372
- setShowGpsDialog(true);
6373
- return;
6370
+ break;
6374
6371
  case error2.POSITION_UNAVAILABLE:
6375
- setGpsErrorType("gps_off");
6376
- setShowGpsDialog(true);
6377
- return;
6378
6372
  case error2.TIMEOUT:
6379
6373
  setGpsErrorType("gps_off");
6380
- setShowGpsDialog(true);
6381
- return;
6374
+ break;
6382
6375
  default:
6383
- errorMessage = "\u062E\u0637\u0627\u06CC \u0646\u0627\u0645\u0634\u062E\u0635 \u062F\u0631 \u062F\u0631\u06CC\u0627\u0641\u062A \u0645\u0648\u0642\u0639\u06CC\u062A \u0645\u06A9\u0627\u0646\u06CC \u0631\u062E \u062F\u0627\u062F.";
6376
+ setGpsErrorType("other");
6384
6377
  break;
6385
6378
  }
6386
- import_react_hot_toast2.default.error(errorMessage);
6379
+ setShowGpsDialog(true);
6387
6380
  },
6388
6381
  {
6389
6382
  enableHighAccuracy: true,
@@ -6392,79 +6385,43 @@ function MapLocationPicker({
6392
6385
  }
6393
6386
  );
6394
6387
  };
6395
- const handleGpsDialogClose = () => {
6396
- setShowGpsDialog(false);
6397
- };
6398
- const handleOpenSettings = () => {
6399
- setShowGpsDialog(false);
6400
- const isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
6401
- if (isMobile) {
6402
- import_react_hot_toast2.default.loading(
6403
- /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(import_material34.Typography, { variant: "body2", sx: { mb: 1 } }, "\u0644\u0637\u0641\u0627\u064B \u0645\u0631\u0627\u062D\u0644 \u0632\u06CC\u0631 \u0631\u0627 \u0627\u0646\u062C\u0627\u0645 \u062F\u0647\u06CC\u062F:"), /* @__PURE__ */ React.createElement(import_material34.Typography, { variant: "caption", component: "div" }, "\u06F1. \u0648\u0627\u0631\u062F \u062A\u0646\u0638\u06CC\u0645\u0627\u062A \u062F\u0633\u062A\u06AF\u0627\u0647 \u0634\u0648\u06CC\u062F"), /* @__PURE__ */ React.createElement(import_material34.Typography, { variant: "caption", component: "div" }, '\u06F2. \u0628\u0647 \u0628\u062E\u0634 "\u0645\u0648\u0642\u0639\u06CC\u062A \u0645\u06A9\u0627\u0646\u06CC" \u0628\u0631\u0648\u06CC\u062F'), /* @__PURE__ */ React.createElement(import_material34.Typography, { variant: "caption", component: "div" }, "\u06F3. GPS \u0631\u0627 \u0641\u0639\u0627\u0644 \u06A9\u0646\u06CC\u062F"), /* @__PURE__ */ React.createElement(import_material34.Typography, { variant: "caption", component: "div" }, "\u06F4. \u062F\u0648\u0628\u0627\u0631\u0647 \u0627\u0645\u062A\u062D\u0627\u0646 \u06A9\u0646\u06CC\u062F")),
6404
- {
6405
- duration: 8e3,
6406
- position: "top-center"
6407
- }
6408
- );
6409
- } else {
6410
- import_react_hot_toast2.default.error("\u0644\u0637\u0641\u0627\u064B GPS \u062F\u0633\u062A\u06AF\u0627\u0647 \u062E\u0648\u062F \u0631\u0627 \u0631\u0648\u0634\u0646 \u06A9\u0646\u06CC\u062F");
6411
- }
6412
- };
6413
- const handleRetryLocation = () => {
6414
- setShowGpsDialog(false);
6415
- setTimeout(() => {
6416
- handleCurrentLocation();
6417
- }, 1e3);
6418
- };
6419
6388
  const handleClearLocation = () => {
6420
6389
  if (markerRef.current) {
6421
6390
  markerRef.current.remove();
6422
6391
  markerRef.current = null;
6423
6392
  }
6424
6393
  handleLocationChange(null, null);
6425
- if (handleAddressChange) {
6426
- handleAddressChange("");
6427
- }
6394
+ if (handleAddressChange) handleAddressChange("");
6395
+ };
6396
+ const handleGpsDialogClose = () => setShowGpsDialog(false);
6397
+ const handleRetryLocation = () => {
6398
+ setShowGpsDialog(false);
6399
+ setTimeout(handleCurrentLocation, 500);
6400
+ };
6401
+ const handleOpenSettings = () => {
6402
+ setShowGpsDialog(false);
6403
+ (0, import_react_hot_toast2.default)(
6404
+ /* @__PURE__ */ React.createElement("div", { dir: "rtl", style: { textAlign: "right" } }, /* @__PURE__ */ React.createElement(import_material34.Typography, { variant: "body2", sx: { mb: 1 } }, "\u0644\u0637\u0641\u0627\u064B \u0645\u0631\u0627\u062D\u0644 \u0632\u06CC\u0631 \u0631\u0627 \u0627\u0646\u062C\u0627\u0645 \u062F\u0647\u06CC\u062F:"), /* @__PURE__ */ React.createElement(import_material34.Typography, { variant: "caption", component: "div" }, "\u06F1. \u062A\u0646\u0638\u06CC\u0645\u0627\u062A \u062F\u0633\u062A\u06AF\u0627\u0647"), /* @__PURE__ */ React.createElement(import_material34.Typography, { variant: "caption", component: "div" }, "\u06F2. \u0645\u0648\u0642\u0639\u06CC\u062A \u0645\u06A9\u0627\u0646\u06CC"), /* @__PURE__ */ React.createElement(import_material34.Typography, { variant: "caption", component: "div" }, "\u06F3. \u0641\u0639\u0627\u0644 \u06A9\u0631\u062F\u0646 GPS")),
6405
+ { duration: 8e3 }
6406
+ );
6428
6407
  };
6429
- return /* @__PURE__ */ React.createElement(import_material34.Box, { sx: { width: "100%" } }, /* @__PURE__ */ React.createElement(
6430
- import_react_hot_toast2.Toaster,
6408
+ return /* @__PURE__ */ React.createElement(import_material34.Box, { sx: { width: "100%" } }, /* @__PURE__ */ React.createElement(import_react_hot_toast2.Toaster, { position: "top-center" }), /* @__PURE__ */ React.createElement(import_material34.Dialog, { open: showGpsDialog, onClose: handleGpsDialogClose }, /* @__PURE__ */ React.createElement(import_material34.DialogTitle, null, "\u0645\u0634\u06A9\u0644 \u062F\u0631 \u062F\u0631\u06CC\u0627\u0641\u062A \u0645\u0648\u0642\u0639\u06CC\u062A \u0645\u06A9\u0627\u0646\u06CC"), /* @__PURE__ */ React.createElement(import_material34.DialogContent, null, gpsErrorType === "permission" ? /* @__PURE__ */ React.createElement(import_material34.Typography, null, "\u062F\u0633\u062A\u0631\u0633\u06CC \u0628\u0647 \u0645\u0648\u0642\u0639\u06CC\u062A \u0645\u06A9\u0627\u0646\u06CC \u0631\u062F \u0634\u062F\u0647 \u0627\u0633\u062A.", /* @__PURE__ */ React.createElement("br", null), "\u06F1. \u0631\u0648\u06CC \u0622\u06CC\u06A9\u0648\u0646 \u0642\u0641\u0644 \u062F\u0631 \u0646\u0648\u0627\u0631 \u0622\u062F\u0631\u0633 \u06A9\u0644\u06CC\u06A9 \u06A9\u0646\u06CC\u062F", /* @__PURE__ */ React.createElement("br", null), "\u06F2. \u0645\u0648\u0642\u0639\u06CC\u062A \u0645\u06A9\u0627\u0646\u06CC \u2192 \u0627\u062C\u0627\u0632\u0647 \u062F\u0647\u06CC\u062F") : gpsErrorType === "gps_off" ? /* @__PURE__ */ React.createElement(import_material34.Typography, null, "GPS \u062E\u0627\u0645\u0648\u0634 \u0627\u0633\u062A. \u0644\u0637\u0641\u0627\u064B \u0641\u0639\u0627\u0644 \u06A9\u0646\u06CC\u062F.") : /* @__PURE__ */ React.createElement(import_material34.Typography, null, "\u062E\u0637\u0627\u06CC\u06CC \u0631\u062E \u062F\u0627\u062F\u0647 \u0627\u0633\u062A. \u062F\u0648\u0628\u0627\u0631\u0647 \u062A\u0644\u0627\u0634 \u06A9\u0646\u06CC\u062F.")), /* @__PURE__ */ React.createElement(import_material34.DialogActions, { sx: { pb: 2, pr: 2 } }, /* @__PURE__ */ React.createElement(import_material34.Button, { onClick: handleGpsDialogClose }, "\u0627\u0646\u0635\u0631\u0627\u0641"), gpsErrorType === "permission" ? /* @__PURE__ */ React.createElement(
6409
+ import_material34.Button,
6431
6410
  {
6432
- position: "top-center",
6433
- toastOptions: {
6434
- duration: 4e3,
6435
- style: {
6436
- background: isDarkMode ? "#333" : "#fff",
6437
- color: isDarkMode ? "#fff" : "#333"
6438
- }
6439
- }
6440
- }
6441
- ), /* @__PURE__ */ React.createElement(
6442
- import_material34.Dialog,
6411
+ onClick: handleRetryLocation,
6412
+ variant: "contained",
6413
+ color: "primary"
6414
+ },
6415
+ "\u062A\u0644\u0627\u0634 \u0645\u062C\u062F\u062F"
6416
+ ) : /* @__PURE__ */ React.createElement(
6417
+ import_material34.Button,
6443
6418
  {
6444
- open: showGpsDialog,
6445
- onClose: handleGpsDialogClose,
6446
- "aria-labelledby": "gps-dialog-title"
6419
+ onClick: handleOpenSettings,
6420
+ variant: "contained",
6421
+ color: "primary"
6447
6422
  },
6448
- /* @__PURE__ */ React.createElement(import_material34.DialogTitle, { id: "gps-dialog-title" }, "\u0645\u0634\u06A9\u0644 \u062F\u0631 \u062F\u0631\u06CC\u0627\u0641\u062A \u0645\u0648\u0642\u0639\u06CC\u062A \u0645\u06A9\u0627\u0646\u06CC"),
6449
- /* @__PURE__ */ React.createElement(import_material34.DialogContent, null, gpsErrorType === "permission" ? /* @__PURE__ */ React.createElement(import_material34.Typography, null, "\u062F\u0633\u062A\u0631\u0633\u06CC \u0628\u0647 \u0645\u0648\u0642\u0639\u06CC\u062A \u0645\u06A9\u0627\u0646\u06CC \u062A\u0648\u0633\u0637 \u0634\u0645\u0627 \u0631\u062F \u0634\u062F\u0647 \u0627\u0633\u062A. \u0628\u0631\u0627\u06CC \u0627\u0633\u062A\u0641\u0627\u062F\u0647 \u0627\u0632 \u0627\u06CC\u0646 \u0642\u0627\u0628\u0644\u06CC\u062A:", /* @__PURE__ */ React.createElement("br", null), "\u06F1. \u0631\u0648\u06CC \u0622\u06CC\u06A9\u0648\u0646 \u0642\u0641\u0644 \u062F\u0631 \u0646\u0648\u0627\u0631 \u0622\u062F\u0631\u0633 \u06A9\u0644\u06CC\u06A9 \u06A9\u0646\u06CC\u062F", /* @__PURE__ */ React.createElement("br", null), '\u06F2. \u06AF\u0632\u06CC\u0646\u0647 "\u0645\u0648\u0642\u0639\u06CC\u062A \u0645\u06A9\u0627\u0646\u06CC" \u0631\u0627 \u067E\u06CC\u062F\u0627 \u06A9\u0646\u06CC\u062F', /* @__PURE__ */ React.createElement("br", null), '\u06F3. \u062F\u0633\u062A\u0631\u0633\u06CC \u0631\u0627 "\u0627\u062C\u0627\u0632\u0647" \u06A9\u0646\u06CC\u062F') : gpsErrorType === "gps_off" ? /* @__PURE__ */ React.createElement(import_material34.Typography, null, "GPS \u062F\u0633\u062A\u06AF\u0627\u0647 \u0634\u0645\u0627 \u062E\u0627\u0645\u0648\u0634 \u0627\u0633\u062A. \u0644\u0637\u0641\u0627\u064B:", /* @__PURE__ */ React.createElement("br", null), "\u06F1. \u0648\u0627\u0631\u062F \u062A\u0646\u0638\u06CC\u0645\u0627\u062A \u062F\u0633\u062A\u06AF\u0627\u0647 \u0634\u0648\u06CC\u062F", /* @__PURE__ */ React.createElement("br", null), '\u06F2. \u0628\u062E\u0634 "\u0645\u0648\u0642\u0639\u06CC\u062A \u0645\u06A9\u0627\u0646\u06CC" \u06CC\u0627 "Location" \u0631\u0627 \u067E\u06CC\u062F\u0627 \u06A9\u0646\u06CC\u062F', /* @__PURE__ */ React.createElement("br", null), "\u06F3. GPS \u0631\u0627 \u0641\u0639\u0627\u0644 \u06A9\u0646\u06CC\u062F") : /* @__PURE__ */ React.createElement(import_material34.Typography, null, "\u062E\u0637\u0627\u06CC\u06CC \u062F\u0631 \u062F\u0631\u06CC\u0627\u0641\u062A \u0645\u0648\u0642\u0639\u06CC\u062A \u0645\u06A9\u0627\u0646\u06CC \u0631\u062E \u062F\u0627\u062F\u0647 \u0627\u0633\u062A. \u0644\u0637\u0641\u0627\u064B \u0645\u0637\u0645\u0626\u0646 \u0634\u0648\u06CC\u062F:", /* @__PURE__ */ React.createElement("br", null), "\u06F1. GPS \u062F\u0633\u062A\u06AF\u0627\u0647 \u0631\u0648\u0634\u0646 \u0627\u0633\u062A", /* @__PURE__ */ React.createElement("br", null), "\u06F2. \u0628\u0647 \u0627\u06CC\u0646\u062A\u0631\u0646\u062A \u0645\u062A\u0635\u0644 \u0647\u0633\u062A\u06CC\u062F", /* @__PURE__ */ React.createElement("br", null), "\u06F3. \u0645\u0631\u0648\u0631\u06AF\u0631 \u0627\u062C\u0627\u0632\u0647 \u062F\u0633\u062A\u0631\u0633\u06CC \u062F\u0627\u0631\u062F")),
6450
- /* @__PURE__ */ React.createElement(import_material34.DialogActions, { sx: { pb: 2, pr: 2 } }, /* @__PURE__ */ React.createElement(import_material34.Button, { onClick: handleGpsDialogClose }, "\u0627\u0646\u0635\u0631\u0627\u0641"), gpsErrorType === "permission" ? /* @__PURE__ */ React.createElement(
6451
- import_material34.Button,
6452
- {
6453
- onClick: handleRetryLocation,
6454
- variant: "contained",
6455
- color: "primary"
6456
- },
6457
- "\u062A\u0644\u0627\u0634 \u0645\u062C\u062F\u062F"
6458
- ) : /* @__PURE__ */ React.createElement(
6459
- import_material34.Button,
6460
- {
6461
- onClick: handleOpenSettings,
6462
- variant: "contained",
6463
- color: "primary"
6464
- },
6465
- "\u0631\u0627\u0647\u0646\u0645\u0627\u06CC \u0641\u0639\u0627\u0644\u200C\u0633\u0627\u0632\u06CC"
6466
- ))
6467
- ), /* @__PURE__ */ React.createElement(import_material34.Box, { sx: { position: "relative", height: "370px", width: "100%" } }, /* @__PURE__ */ React.createElement(
6423
+ "\u0631\u0627\u0647\u0646\u0645\u0627"
6424
+ ))), /* @__PURE__ */ React.createElement(import_material34.Box, { sx: { position: "relative", height: "370px", width: "100%" } }, /* @__PURE__ */ React.createElement(
6468
6425
  import_material34.Paper,
6469
6426
  {
6470
6427
  sx: {
@@ -6485,7 +6442,7 @@ function MapLocationPicker({
6485
6442
  display: "flex",
6486
6443
  alignItems: "center",
6487
6444
  justifyContent: "center",
6488
- backgroundColor: isDarkMode ? "rgba(18, 18, 18, 0.9)" : "rgba(255, 255, 255, 0.8)",
6445
+ backgroundColor: isDarkMode ? "rgba(18,18,18,0.9)" : "rgba(255,255,255,0.8)",
6489
6446
  zIndex: 1e3,
6490
6447
  flexDirection: "column",
6491
6448
  gap: 1
@@ -6515,7 +6472,7 @@ function MapLocationPicker({
6515
6472
  disabled: isGeolocating,
6516
6473
  sx: {
6517
6474
  backgroundColor: isDarkMode ? "#1e1e1e" : "white",
6518
- color: isDarkMode ? "white" : "inherit",
6475
+ color: isDarkMode ? "white" : "#1e1e1e",
6519
6476
  boxShadow: 2,
6520
6477
  "&:hover": {
6521
6478
  backgroundColor: isDarkMode ? "#2a2a2a" : "#f5f5f5"
@@ -6525,7 +6482,7 @@ function MapLocationPicker({
6525
6482
  },
6526
6483
  /* @__PURE__ */ React.createElement(import_md13.MdMyLocation, null)
6527
6484
  ),
6528
- (latitude !== null || longitude !== null) && /* @__PURE__ */ React.createElement(
6485
+ hasExistingLocation && /* @__PURE__ */ React.createElement(
6529
6486
  import_material34.IconButton,
6530
6487
  {
6531
6488
  onClick: handleClearLocation,