import{j as e}from"./tanstack-1.0.74-aU0azVkW.js";import{r as p}from"./redux-1.0.74-D8bIc6ki.js";import{a as x}from"./hooks-1.0.74-NYCTWeI9.js";import{l as f,q as u,b as y}from"./lib-1.0.74-B5IEqfHg.js";import{n as M}from"./index-1.0.74-DxwH6OqZ.js";import{B as d}from"./Box-1.0.74-DEbuVvGV.js";import{F as i,I as m,b as l,T as L}from"./TextField-1.0.74-BW9Byijb.js";import{S as c}from"./Select-1.0.74-DHOnlEEH.js";import{M as h}from"./MenuItem-1.0.74-D9LDbFUb.js";import{L as j}from"./Link-1.0.74-Cr-Ob-AP.js";const R=({app:o,setIsUpdated:a})=>{f.debug(o);const r=x(),n=p.useMemo(()=>o.appColumns.map(t=>t.columnName),[o.appColumns]),[s,g]=p.useState(!1);return e.jsxs(d,{style:{width:"100%",display:"grid",gap:"20px"},children:[e.jsxs(i,{fullWidth:!0,children:[e.jsx(m,{variant:"outlined",children:"Latitude Column *"}),e.jsx(c,{MenuProps:{id:"pp-select-menu"},label:"Latitude Column *",value:o.appMap.columnLatitude,variant:"outlined",onChange:t=>{r(u({property:{appMap:{apiKey:o.appMap.apiKey,columnLatitude:t.target.value,columnLongitude:o.appMap.columnLongitude}}})),a&&a(!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(m,{variant:"outlined",children:"Longitude Column *"}),e.jsx(c,{MenuProps:{id:"pp-select-menu"},label:"Longitude Column *",value:o.appMap.columnLongitude,variant:"outlined",onChange:t=>{r(u({property:{appMap:{apiKey:o.appMap.apiKey,columnLatitude:o.appMap.columnLatitude,columnLongitude:t.target.value}}})),a&&a(!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",style:{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(M,{}),"Using GEOMETRY and POINT Data Types"]}),s&&e.jsx(d,{style:{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."})]})})]})},q=({app:o,setIsUpdated:a})=>{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:y.requiresReload})]}),value:o.appMap.apiKey,autoComplete:"off",onChange:n=>{r(u({property:{appMap:{apiKey:n.target.value,columnLatitude:o.appMap.columnLatitude,columnLongitude:o.appMap.columnLongitude}}})),a&&a(!0),n.stopPropagation()}})};export{R as C,q as M};
