import{b6 as x,R as f,j as e,ao as j,b7 as b,bf as h,b9 as _,bg as F,d as k,M as C,T as a,P as v,r as A,V as m}from"./main-D6SjkSWq.js";import{a as g}from"./admin-config-CcVyOMQ2.js";import{S as G}from"./settings-error-group-CkH25xxG.js";import{A as S}from"./settings-layout-ekgO4tDD.js";import{D as N}from"./settings-links-CxX7ep34.js";import{S as P}from"./settings-panel-CIXKNiUM.js";import{u as D}from"./use-admin-settings-C7-qGsrJ.js";import"./globe-Bnh5BiEZ.js";import"./sticky-note-8BXAdCdJ.js";import"./tags-HILWsbVi.js";import"./middleware-BLXTWOs6.js";import"./use-admin-settings-page-nav-config-Dh1PETIB.js";import"./datatable-page-with-header-layout-BuTOEIJh.js";import"./dashboard-layout-context-C1ErlVWg.js";import"./file-upload-provider-C966C2x1.js";import"./uploaded-file-Dt7HVOVK.js";import"./extension-from-filename-O0XMuZye.js";import"./pretty-bytes-bO14ePu9.js";import"./traditional-GTMgz7Xu.js";import"./confirmation-dialog-E4zsogCz.js";import"./dialog-footer-es-AfbvV.js";import"./external-link-BB1wMD8k.js";import"./useSuspenseQuery-Xmh5uCOE.js";const R=f.forwardRef((s,t)=>{const i=b(t),{fieldProps:o,inputProps:n}=h({...s,focusRef:i}),r=_(s);return e.jsx(F,{ref:t,fieldClassNames:r,...o,children:e.jsx("input",{type:"file",ref:i,...n,className:k(r.input,"py-8","file:bg-primary file:text-on-primary file:border-none file:rounded file:text-sm file:font-semibold file:px-10 file:h-24 file:mr-10")})})});function $({name:s,...t}){const{field:{onChange:i,onBlur:o,ref:n},fieldState:{invalid:r,error:l}}=x({name:s}),[d,u]=f.useState(""),y={onChange:c=>{var p;i((p=c.target.files)==null?void 0:p[0]),u(c.target.value)},onBlur:o,value:d,invalid:r,errorMessage:l==null?void 0:l.message};return e.jsx(R,{ref:n,...j(y,t)})}function ie(){var i,o;const{data:s}=D(),t=C({defaultValues:{files:{certificate:""},server:{analytics_property_id:s.server.analytics_property_id??""},client:{analytics:{tracking_code:((i=s.client.analytics)==null?void 0:i.tracking_code)??"",gchart_api_key:((o=s.client.analytics)==null?void 0:o.gchart_api_key)??""}}}});return e.jsx(S,{title:e.jsx(a,{message:"Analytics"}),form:t,children:e.jsx(w,{})})}function w(){const{clearErrors:s}=v();return e.jsx(P,{layout:"vertical",title:e.jsx(a,{message:"Google Analytics"}),description:e.jsx(a,{message:"Configure Google Analytics integration for tracking site usage and displaying statistics."}),link:g.settings.googleAnalytics?e.jsx(N,{link:g.settings.googleAnalytics}):null,children:e.jsx(G,{separatorTop:!1,separatorBottom:!1,name:"analytics_group",children:t=>e.jsxs(A.Fragment,{children:[e.jsx($,{size:"md",className:"mb-20",onChange:()=>s(),invalid:t,name:"files.certificate",accept:".json",label:e.jsx(a,{message:"Google service account key file (.json)"})}),e.jsx(m,{size:"sm",className:"mb-20",onChange:()=>s(),invalid:t,name:"server.analytics_property_id",type:"number",label:e.jsx(a,{message:"Google analytics property ID"})}),e.jsx(m,{size:"sm",className:"mb-20",onChange:()=>s(),invalid:t,name:"client.analytics.tracking_code",placeholder:"G-******",min:"1",max:"20",description:e.jsx(a,{message:"Google analytics measurement ID only, not the whole javascript snippet."}),label:e.jsx(a,{message:"Google tag manager measurement ID"})}),e.jsx(m,{size:"sm",name:"client.analytics.gchart_api_key",label:e.jsx(a,{message:"Google maps javascript API key"}),description:e.jsx(a,{message:"Only required in order to show world geochart on integrated analytics pages."})})]})})})}export{ie as Component};
