import{j as e}from"./cm-1.0.63-CSIRHMXC.js";import{r as p}from"./redux-1.0.63-Df-eBzJn.js";import{a as x}from"./hooks-1.0.63-CWs3kTdT.js";import{l as f,n as u,a as M}from"./lib-1.0.63-DJZPtMem.js";import{m as y}from"./index-1.0.63-oIDff4nA.js";import{B as m}from"./Spinner-1.0.63-zcgIyS7Z.js";import{F as i,I as d,b as l,T as L}from"./TextField-1.0.63-C35Mfi1Q.js";import{S as c}from"./Select-1.0.63-BMejr8a7.js";import{M as h}from"./MenuItem-1.0.63-Bvb3IjMP.js";import{L as j}from"./Link-1.0.63-wURABoab.js";const R=({app:a,setIsUpdated:o})=>{f.debug(a);const r=x(),n=p.useMemo(()=>a.appColumns.map(t=>t.columnName),[a.appColumns]),[s,g]=p.useState(!1);return e.jsxs(m,{sx:{width:"100%",display:"grid",gap:"20px"},children:[e.jsxs(i,{fullWidth:!0,children:[e.jsx(d,{variant:"outlined",children:"Latitude Column *"}),e.jsx(c,{MenuProps:{id:"pp-select-menu"},label:"Latitude Column *",value:a.appMap.columnLatitude,variant:"outlined",onChange:t=>{r(u({property:{appMap:{apiKey:a.appMap.apiKey,columnLatitude:t.target.value,columnLongitude:a.appMap.columnLongitude}}})),o&&o(!0)},children:n.map(t=>e.jsx(h,{"data-id":t,value:t,children:t},t))}),e.jsx(l,{children:"Select the column that contains the latitude values for your locations."})]}),e.jsxs(i,{fullWidth:!0,children:[e.jsx(d,{variant:"outlined",children:"Longitude Column *"}),e.jsx(c,{MenuProps:{id:"pp-select-menu"},label:"Longitude Column *",value:a.appMap.columnLongitude,variant:"outlined",onChange:t=>{r(u({property:{appMap:{apiKey:a.appMap.apiKey,columnLatitude:a.appMap.columnLatitude,columnLongitude:t.target.value}}})),o&&o(!0)},children:n.map(t=>e.jsx(h,{"data-id":t,value:t,children:t},t))}),e.jsx(l,{children:"Select the column that contains the longitude values for your locations."})]}),e.jsx(i,{fullWidth:!0,children:e.jsxs(l,{component:"div",sx:{marginLeft:0},children:[e.jsxs(j,{sx:{textDecoration:"none",cursor:"pointer",display:"inline-flex",marginBottom:0,"& svg":{fontSize:"1rem",marginRight:"2px"}},onClick:()=>g(!s),children:[e.jsx(y,{}),"Using GEOMETRY and POINT Data Types"]}),s&&e.jsx(m,{sx:{marginTop:"20px",marginBottom:"25px",marginLeft:"4px"},children:"If your locations are stored in a GEOMETRY or POINT column, simply select the same column for both latitude and longitude. The plugin will automatically extract the required values."})]})})]})},w=({app:a,setIsUpdated:o})=>{const r=x();return e.jsx(L,{type:"text",label:"API Key",fullWidth:!0,required:!0,helperText:e.jsxs(e.Fragment,{children:["Enter a valid Google Maps API Key. ",e.jsx("strong",{children:M.requiresReload})]}),value:a.appMap.apiKey,autoComplete:"off",onChange:n=>{r(u({property:{appMap:{apiKey:n.target.value,columnLatitude:a.appMap.columnLatitude,columnLongitude:a.appMap.columnLongitude}}})),o&&o(!0),n.stopPropagation()}})};export{R as C,w as M};
