const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CodeField-1.0.74-CaC6WTx4.js","./RestApiError-1.0.74-Bb1un17k.js","./vendor-1.0.74-CN03Eozo.js","./tanstack-1.0.74-aU0azVkW.js","./redux-1.0.74-D8bIc6ki.js","./index-1.0.74-DxwH6OqZ.js","./CircularProgress-1.0.74-QfwfRJ7i.js","./lib-1.0.74-B5IEqfHg.js","./utils-1.0.74-7xWhx9mc.js","./ButtonBase-1.0.74-W6tAH7AI.js","./Typography-1.0.74-B4mhsevh.js","./useEnhancedEffect-1.0.74-B56M26dS.js","./ThemeProvider-1.0.74-4uzbYYLM.js","./Portal-1.0.74-BrUPeMX9.js","./iconBase-1.0.74-Cs0vntJu.js","./ConfirmDialog-1.0.74-CXu4CqK2.js","./AdminTheme-1.0.74-BtTaJUu_.js","./Modal-1.0.74-BfLid1bk.js","./Box-1.0.74-DEbuVvGV.js"])))=>i.map(i=>d[i]);
import{j as r}from"./tanstack-1.0.74-aU0azVkW.js";import{u as j,S as g,a as b,b as S,c as M}from"./SettingsMapMarkers-1.0.74-D_v7_PcU.js";import{l as A}from"./lib-1.0.74-B5IEqfHg.js";import{_ as C}from"./RestApiError-1.0.74-Bb1un17k.js";import{r as p}from"./redux-1.0.74-D8bIc6ki.js";import{B as w,f as _,l as y}from"./index-1.0.74-DxwH6OqZ.js";import{P as W}from"./PremiumFeature-1.0.74-BfyB9mrd.js";import{a as F}from"./hooks-1.0.74-NYCTWeI9.js";import{u as k}from"./useMapUpdater-1.0.74-odwd3Te-.js";import{D as v}from"./DefaultWhere-1.0.74-CbWFZd-H.js";import{u as E}from"./useMetadata-1.0.74--jxfVI7W.js";import{S as L}from"./SanitizeComponent-1.0.74-DsOvasd7.js";import{H as N}from"./settings-1.0.74-BnRB9SOY.js";import{A as O,a as H}from"./AccordionSummary-1.0.74-BIcO1H0G.js";import{A as P}from"./AccordionDetails-1.0.74-UIik1H9G.js";import{F as R}from"./TextField-1.0.74-BW9Byijb.js";import{B as s}from"./Box-1.0.74-DEbuVvGV.js";import{L as z}from"./Link-1.0.74-Cr-Ob-AP.js";import"./vendor-1.0.74-CN03Eozo.js";import"./CssUnitTextField-1.0.74-Bxg7TA7Q.js";import"./ConfirmDialog-1.0.74-CXu4CqK2.js";import"./ButtonBase-1.0.74-W6tAH7AI.js";import"./CircularProgress-1.0.74-QfwfRJ7i.js";import"./Typography-1.0.74-B4mhsevh.js";import"./useEnhancedEffect-1.0.74-B56M26dS.js";import"./AdminTheme-1.0.74-BtTaJUu_.js";import"./Modal-1.0.74-BfLid1bk.js";import"./Portal-1.0.74-BrUPeMX9.js";import"./utils-1.0.74-7xWhx9mc.js";import"./RadioGroup-1.0.74-DWBtoS7u.js";import"./Radio-1.0.74-fPSETwpC.js";import"./SwitchBase-1.0.74-pUYMwK3f.js";import"./Select-1.0.74-DHOnlEEH.js";import"./Menu-1.0.74-CdjCBJ4R.js";import"./ThemeProvider-1.0.74-4uzbYYLM.js";import"./isHostComponent-1.0.74-DVu5iVWx.js";import"./createSvgIcon-1.0.74-Cw_ZFbxi.js";import"./Slider-1.0.74-BxpDcEEP.js";import"./visuallyHidden-1.0.74-Dan1xhjv.js";import"./FormControlLabel-1.0.74-CdAG1Jo8.js";import"./Switch-1.0.74-IHNqKL8Y.js";import"./react-number-format.es-1.0.74-V5uzMUOI.js";import"./iconBase-1.0.74-Cs0vntJu.js";import"./index-1.0.74-8lphm33F.js";import"./DynamicModeEnum-1.0.74-BXuL5kgA.js";import"./index-1.0.74-CCIRxPEn.js";import"./index-1.0.74-DtMr5-xA.js";import"./CardHeader-1.0.74-CHbhRPw-.js";import"./InputAdornment-1.0.74-DzikPcDx.js";import"./CardActions-1.0.74-DRn8SDKF.js";import"./MenuItem-1.0.74-D9LDbFUb.js";import"./Collapse-1.0.74-DA2Rx31o.js";const B=p.lazy(()=>C(()=>import("./CodeField-1.0.74-CaC6WTx4.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]),import.meta.url)),T=({appId:t,mapSettings:e})=>{F(),k(t);const o=E(t),f=p.useMemo(()=>{var c,u,d,x;let n=[];try{n=JSON.parse((u=(c=o==null?void 0:o.app)==null?void 0:c.container[0])==null?void 0:u.cnt_cls)}catch(i){console.error("Invalid JSON - app columns"),console.error(i)}const l=n.filter(i=>i.computedField===void 0).map(i=>i.columnName).join("<br/>, ");let a="";return(d=o==null?void 0:o.app)!=null&&d.container[0]&&(a=(x=o==null?void 0:o.app)==null?void 0:x.container[0].cnt_tbl),l===""||a===""?"":`select ${l}<br/>from ${a}<br/>`},[]),[m,h]=p.useState(!1);return r.jsxs(O,{defaultExpanded:!1,disableGutters:!0,children:[r.jsxs(H,{expandIcon:r.jsx(w,{}),className:"pp-context-help-summary",children:[r.jsx("span",{children:"Default Where"}),r.jsx(N,{path:"map-builder/menu/map/default-where.html",size:22})]}),r.jsxs(P,{children:[r.jsxs(R,{fullWidth:!0,children:[r.jsx(p.Suspense,{children:r.jsx(B,{code:e.setup.defaultWhere??"",setCode:n=>{},dialogTitle:"Custom Glyph",extension:"sql",isReadOnly:!0})}),r.jsxs(s,{sx:{position:"relative"},children:[r.jsxs(s,{sx:{position:"absolute",top:0,right:"15px",textAlign:"right",...m&&{width:"100%"}},children:[r.jsx(_,{title:"SQL Query",placement:"bottom-end",children:r.jsx(z,{href:"#",onClick:()=>{h(!m)},children:r.jsx(s,{sx:{lineHeight:"24px","& svg":{width:"15px",height:"15px",verticalAlign:"text-bottom"}},children:r.jsx(y,{})})})}),m&&r.jsx(s,{sx:{textAlign:"left",backgroundColor:"#fff",border:"1px solid rgba(0, 0, 0, 0.23)",borderRadius:"4px",padding:"20px",margin:"2px -15px 0 15px",maxHeight:"220px",overflow:"auto"},component:"pre",children:r.jsx(L,{html:f+(e.setup.defaultWhere.toLowerCase().trim().substring(0,5)==="where"||e.setup.defaultWhere.trim()===""?"":"where ")+e.setup.defaultWhere.replace(`
`,"<br/>")})})]}),r.jsx(v,{})]})]}),r.jsx(W,{})]})]})},Br=({appId:t})=>{A.debug(t);const e=j(t);return r.jsxs(r.Fragment,{children:[r.jsx(g,{appId:t,mapSettings:e}),r.jsx(b,{appId:t,mapSettings:e}),r.jsx(S,{appId:t,mapSettings:e}),r.jsx(M,{appId:t,mapSettings:e}),r.jsx(T,{appId:t,mapSettings:e})]})};export{Br as default};
