import{u}from"./settingsStore-8bwiLMEn.js";import{r as g}from"./vendor-vue-reactivity-CheHbvBM.js";const n=u(),h=()=>n.geolocation?n.geolocation.pickUpIconPath:"https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/geocode-71.png",f=()=>{var t;return(t=n.geolocation)!=null&&t.markerIconPath?n.geolocation.markerIconPath:""},c=(t,o)=>{const e=o.value.pricingType,a=parseFloat(t.toString());if(e==="each")return parseFloat(o.value.eachCost);if(e==="fixed"){let s=NaN;const i=o.value.distanceCostList,p=o.value.lastDistanceCost;return i.forEach(r=>{a>r.from&&a<r.to&&(s=parseFloat(r.cost))}),isNaN(s)&&(s=parseFloat(p.cost)),s}return 0},m=(t,o)=>{const e=parseFloat(t.toString()),a=c(e,o);return parseFloat(parseFloat(a.toString()).toFixed(2))*e},d=()=>n.geolocation?n.geolocation.measure:"",F=()=>n.geolocation?n.geolocation.publicKey:"",C=()=>({zoom:12,streetViewControl:!1,disableDefaultUI:!0,zoomControl:!0}),v=t=>{let o="";const e="0123456789abcdefghijklmnopqrstuvwxyz",a=e.length;for(let s=0;s<t;s++)o+=e.charAt(Math.floor(Math.random()*a));return o},l=g(!1),P=()=>{l.value=!0},b=()=>{l.value=!1},k=t=>"https://www.google.com/maps/place/"+t.lat+","+t.lng,S=t=>{const o=t,[e,a]=o.split(",").map(parseFloat);return{lat:e,lng:a}};function I(){return{getGoogleApiKey:F,mapOptions:C,generateId:v,showPopup:P,hidePopup:b,calculateValueByEachCost:m,parseLocationCoordinates:S,getMeasure:d,eachCost:c,generateGoogleLink:k,getMarkerIconPath:f,getPickUpIconPath:h}}export{I as u};
//# sourceMappingURL=useGeolocationFieldHelper-BXJOR4z7.js.map
