From e1707201117654532e2b405d28b660a455776990 Mon Sep 17 00:00:00 2001 From: Torben Lundsgaard Date: Mon, 12 Aug 2024 08:22:49 +0200 Subject: [PATCH] Prepare release 1.23.2 --- assets/admin/settings.asset.php | 2 +- assets/admin/settings.js | 8 ++--- assets/admin/wizard.asset.php | 2 +- assets/admin/wizard.js | 2 +- composer.lock | 53 ++++++++++++++++----------------- gtm-kit.php | 4 +-- languages/gtm-kit.pot | 14 +++++---- package-lock.json | 4 +-- package.json | 2 +- readme.txt | 12 ++------ vendor/composer/installed.php | 4 +-- 11 files changed, 52 insertions(+), 55 deletions(-) diff --git a/assets/admin/settings.asset.php b/assets/admin/settings.asset.php index 153bea0..b142be7 100644 --- a/assets/admin/settings.asset.php +++ b/assets/admin/settings.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => '1ca0dab2fa79f8b6fbd8'); + array('lodash', 'react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => 'a490d49add9e5706b561'); diff --git a/assets/admin/settings.js b/assets/admin/settings.js index d6b3501..8a4cb36 100644 --- a/assets/admin/settings.js +++ b/assets/admin/settings.js @@ -1,13 +1,13 @@ -(()=>{"use strict";var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var a in n)t.o(n,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const e=window.React;var n=t.n(e);const a=window.wp.i18n,i=window.wp.element,r=window.wp.components,l=window.lodash,o=window.wp.apiFetch;var s=t.n(o);s().use(s().createNonceMiddleware(window.gtmkitSettings.nonce)),s().use(s().createRootURLMiddleware(window.gtmkitSettings.root));const m=async(t,e,n=null,a=!1)=>{let i={};try{i=await s()({path:t,method:e,...n&&{data:n}})}catch(n){return console.log(`${e} ${t} Errors:`,n),{[`gtm_kit_api_${e}_${t}_errors`]:!0}}return!0===a?i:!0===i.success?i.data:options},c=(t,e)=>{const n={...t};switch(e.type){case"FETCH_SETTINGS":n.fetchedSettings={...e.payload.fetchedSettings,integrations:e.payload.fetchedSettings.integrations||{}},n.stateSettings=e.payload.stateSettings,n.siteData=e.payload.siteData,n.installData=e.payload.installData,n.isPending=!1,n.canSave=!1,e.payload.fetchedSettings.gtm_kit_api_fetch_settings_errors&&(n.notice=(0,a.__)("An error occurred.","gtm-kit"),n.hasError=!0);break;case"UPDATE_SETTINGS_BEFORE":n.isPending=e.payload.isPending;break;case"UPDATE_SETTINGS":n.fetchedSettings=e.payload.fetchedSettings,n.stateSettings=e.payload.stateSettings,n.isPending=!1,n.canSave=!!e.payload.fetchedSettings.gtm_kit_api_update_settings_errors,n.notice=e.payload.fetchedSettings.gtm_kit_api_update_settings_errors?(0,a.__)("An error occurred.","gtm-kit"):(0,a.__)("Saved Successfully.","gtm-kit"),n.hasError=!!e.payload.fetchedSettings.gtm_kit_api_update_settings_errors;break;case"UPDATE_STATE":n.fetchedSettings=e.payload.fetchedSettings||n.fetchedSettings,n.stateSettings=e.payload.stateSettings||n.stateSettings,n.isPending=e.payload.isPending||n.isPending,n.notice=e.payload.notice||n.notice,n.hasError=e.payload.hasError||n.hasError,n.canSave=e.payload.canSave||n.canSave,n.isSendingSystemData=e.payload.isSendingSystemData||n.isSendingSystemData,n.supportTicket=e.payload.supportTicket||n.supportTicket,n.isSendingLicenseKey=e.payload.isSendingLicenseKey||n.isSendingLicenseKey,n.licenseKey=e.payload.licenseKey||n.licenseKey;break;case"SEND_SUPPORT_DATA_BEFORE":n.isSendingSystemData=e.payload.isSendingSystemData||n.isSendingSystemData;break;case"SEND_SUPPORT_DATA":n.isSendingSystemData=!1,n.isSystemDataSent=e.payload.isSystemDataSent||n.isSystemDataSent,n.systemDataMessage=e.payload.systemDataMessage||n.systemDataMessage;break;case"SEND_LICENSE_KEY_BEFORE":n.isSendingLicenseKey=e.payload.isSendingLicenseKey||n.isSendingLicenseKey;break;case"SEND_LICENSE_KEY":n.isSendingLicenseKey=!1,n.isLicenseKeySent=e.payload.isLicenseKeySent||n.isLicenseKeySent,n.licenseKeyMessage=e.payload.licenseKeyMessage||n.licenseKeyMessage}return n},g=(0,i.createContext)(),u=t=>{const[n,a]=(0,i.useReducer)(c,{fetchedSettings:{},stateSettings:{},isPending:!0,notice:"",hasError:!1,canSave:!1,supportTicket:"",isSystemDataSent:!1,systemDataMessage:"",licenseKey:"",isLicensenKeySent:!1,licenseKeyMessage:""}),r=async()=>{const t=window.gtmkitSettings.settings?window.gtmkitSettings.settings:{},e=window.gtmkitSettings.site_data?window.gtmkitSettings.site_data:{},n="wizard"===window.gtmkitSettings.currentPage?window.gtmkitSettings.install_data:{};a({type:"FETCH_SETTINGS",payload:{fetchedSettings:t,stateSettings:t,siteData:e,installData:n}})},o=async t=>{a({type:"UPDATE_STATE",payload:t})};(0,i.useEffect)((()=>{r()}),[]);const s={useDispatch:t=>{a(t)},useUpdateSettings:async()=>{a({type:"UPDATE_SETTINGS_BEFORE",payload:{isPending:!0}});const t=await(e=n.stateSettings,m("gtmkit/v1/set-options","POST",e));var e;a({type:"UPDATE_SETTINGS",payload:{fetchedSettings:t,stateSettings:t}})},useFetchSettings:r,useUpdateState:o,useUpdateStateSettings:async(t,e,a)=>{const i=JSON.parse(JSON.stringify(n.stateSettings));let r;i[t][e]=a,r=!(0,l.isEqual)(i,n.fetchedSettings),o({stateSettings:i,canSave:r})},useImportSettings:async(t,e)=>{const a=JSON.parse(JSON.stringify(n.stateSettings));let i;const r={};r.general={...a.general,...e.general},"integrations"in e&&(r.integrations={...a.integrations,...e.integrations}),i=!(0,l.isEqual)(r,n.fetchedSettings),o({stateSettings:r,canSave:i})},useUpdateSupportTicket:async t=>{o({supportTicket:t})},useSendSystemData:async()=>{a({type:"SEND_SUPPORT_DATA_BEFORE",payload:{isSendingSystemData:!0}});const t=await(e=n.supportTicket,m("gtmkit/v1/send-support-data","POST",e,!0));var e;a({type:"SEND_SUPPORT_DATA",payload:{isSendingSystemData:!1,isSystemDataSent:t.success,systemDataMessage:t.data}})},useUpdateLicenseKey:async t=>{o({licenseKey:t})},useSendLicenseKey:async()=>{a({type:"SEND_LICENSE_KEY_BEFORE",payload:{isSendingLicenseKey:!0}});const t=await(e=n.licenseKey,m("gtmkit/v1/send-license-key","POST",e,!0));var e;a({type:"SEND_LICENSE_KEY",payload:{isSendingLicenseKey:!1,isLicenseKeySent:t.success,licenseKeyMessage:t.data}})},useSettings:n.stateSettings,useIsPending:n.isPending,useNotice:n.notice,useHasError:n.hasError,useCanSave:n.canSave,useSiteData:n.siteData,useInstallData:n.installData,useIsSending:n.isSendingSystemData,useSupportTicket:n.supportTicket,useIsSystemDataSent:n.isSystemDataSent,useSystemDataMessage:n.systemDataMessage,useIsSendingLicenseKey:n.isSendingLicenseKey,useLicenseKey:n.licenseKey,useIsLicenseKeySent:n.isLicenseKeySent,useLicenseKeyMessage:n.licenseKeyMessage,useUserRoles:window.gtmkitSettings.user_roles?window.gtmkitSettings.user_roles:[],isPremium:!!window.gtmkitSettings.isPremium&&window.gtmkitSettings.isPremium};return(0,e.createElement)(g.Provider,{value:s},t.children)};function d(){return d=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0&&(e.hash=t.substr(n),t=t.substr(0,n));let a=t.indexOf("?");a>=0&&(e.search=t.substr(a),t=t.substr(0,a)),t&&(e.pathname=t)}return e}var v;function y(t,e,n){return void 0===n&&(n="/"),function(t,e,n,a){let i=R(("string"==typeof e?b(e):e).pathname||"/",n);if(null==i)return null;let r=x(t);!function(t){t.sort(((t,e)=>t.score!==e.score?e.score-t.score:function(t,e){return t.length===e.length&&t.slice(0,-1).every(((t,n)=>t===e[n]))?t[t.length-1]-e[e.length-1]:0}(t.routesMeta.map((t=>t.childrenIndex)),e.routesMeta.map((t=>t.childrenIndex)))))}(r);let l=null;for(let t=0;null==l&&t{let l={relativePath:void 0===r?t.path||"":r,caseSensitive:!0===t.caseSensitive,childrenIndex:i,route:t};l.relativePath.startsWith("/")&&(_(l.relativePath.startsWith(a),'Absolute route path "'+l.relativePath+'" nested under path "'+a+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),l.relativePath=l.relativePath.slice(a.length));let o=j([a,l.relativePath]),s=n.concat(l);t.children&&t.children.length>0&&(_(!0!==t.index,'Index routes must not have child routes. Please remove all child routes from route path "'+o+'".'),x(t.children,e,s,o)),(null!=t.path||t.index)&&e.push({path:o,score:I(o,t.index),routesMeta:s})};return t.forEach(((t,e)=>{var n;if(""!==t.path&&null!=(n=t.path)&&n.includes("?"))for(let n of w(t.path))i(t,e,n);else i(t,e)})),e}function w(t){let e=t.split("/");if(0===e.length)return[];let[n,...a]=e,i=n.endsWith("?"),r=n.replace(/\?$/,"");if(0===a.length)return i?[r,""]:[r];let l=w(a.join("/")),o=[];return o.push(...l.map((t=>""===t?r:[r,t].join("/")))),i&&o.push(...l),o.map((e=>t.startsWith("/")&&""===e?"/":e))}!function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"}(v||(v={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const N=/^:[\w-]+$/,C=3,T=2,U=1,D=10,P=-2,G=t=>"*"===t;function I(t,e){let n=t.split("/"),a=n.length;return n.some(G)&&(a+=P),e&&(a+=T),n.filter((t=>!G(t))).reduce(((t,e)=>t+(N.test(e)?C:""===e?U:D)),a)}function M(t,e,n){void 0===n&&(n=!1);let{routesMeta:a}=t,i={},r="/",l=[];for(let t=0;t(a.push({paramName:e,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")));return t.endsWith("*")?(a.push({paramName:"*"}),i+="*"===t||"/*"===t?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":""!==t&&"/"!==t&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),a]}(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let r=i[0],l=r.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:a.reduce(((t,e,n)=>{let{paramName:a,isOptional:i}=e;if("*"===a){let t=o[n]||"";l=r.slice(0,r.length-t.length).replace(/(.)\/+$/,"$1")}const s=o[n];return t[a]=i&&!s?void 0:(s||"").replace(/%2F/g,"/"),t}),{}),pathname:r,pathnameBase:l,pattern:t}}function L(t){try{return t.split("/").map((t=>decodeURIComponent(t).replace(/\//g,"%2F"))).join("/")}catch(e){return k(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+e+")."),t}}function R(t,e){if("/"===e)return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,a=t.charAt(n);return a&&"/"!==a?null:t.slice(n)||"/"}function A(t,e,n,a){return"Cannot include a '"+t+"' character in a manually specified `to."+e+"` field ["+JSON.stringify(a)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in and the router will parse it for you.'}function K(t,e){let n=function(t){return t.filter(((t,e)=>0===e||t.route.path&&t.route.path.length>0))}(t);return e?n.map(((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)):n.map((t=>t.pathnameBase))}function F(t,e,n,a){let i;void 0===a&&(a=!1),"string"==typeof t?i=b(t):(i=d({},t),_(!i.pathname||!i.pathname.includes("?"),A("?","pathname","search",i)),_(!i.pathname||!i.pathname.includes("#"),A("#","pathname","hash",i)),_(!i.search||!i.search.includes("#"),A("#","search","hash",i)));let r,l=""===t||""===i.pathname,o=l?"/":i.pathname;if(null==o)r=n;else{let t=e.length-1;if(!a&&o.startsWith("..")){let e=o.split("/");for(;".."===e[0];)e.shift(),t-=1;i.pathname=e.join("/")}r=t>=0?e[t]:"/"}let s=function(t,e){void 0===e&&(e="/");let{pathname:n,search:a="",hash:i=""}="string"==typeof t?b(t):t,r=n?n.startsWith("/")?n:function(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach((t=>{".."===t?n.length>1&&n.pop():"."!==t&&n.push(t)})),n.length>1?n.join("/"):"/"}(n,e):e;return{pathname:r,search:B(a),hash:W(i)}}(i,r),m=o&&"/"!==o&&o.endsWith("/"),c=(l||"."===o)&&n.endsWith("/");return s.pathname.endsWith("/")||!m&&!c||(s.pathname+="/"),s}const j=t=>t.join("/").replace(/\/\/+/g,"/"),H=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),B=t=>t&&"?"!==t?t.startsWith("?")?t:"?"+t:"",W=t=>t&&"#"!==t?t.startsWith("#")?t:"#"+t:"";Error;const z=["post","put","patch","delete"],J=(new Set(z),["get",...z]);function $(){return $=Object.assign?Object.assign.bind():function(t){for(var e=1;e{a.current=!0})),e.useCallback((function(e,i){void 0===i&&(i={}),a.current&&("number"==typeof e?t.navigate(e):t.navigate(e,$({fromRouteId:n},i)))}),[t,n])}():function(){tt()||_(!1);let t=e.useContext(V),{basename:n,future:a,navigator:i}=e.useContext(Y),{matches:r}=e.useContext(Q),{pathname:l}=et(),o=JSON.stringify(K(r,a.v7_relativeSplatPath)),s=e.useRef(!1);return nt((()=>{s.current=!0})),e.useCallback((function(e,a){if(void 0===a&&(a={}),!s.current)return;if("number"==typeof e)return void i.go(e);let r=F(e,JSON.parse(o),l,"path"===a.relative);null==t&&"/"!==n&&(r.pathname="/"===r.pathname?n:j([n,r.pathname])),(a.replace?i.replace:i.push)(r,a.state,a)}),[n,i,o,l,t])}()}function it(t,n){let{relative:a}=void 0===n?{}:n,{future:i}=e.useContext(Y),{matches:r}=e.useContext(Q),{pathname:l}=et(),o=JSON.stringify(K(r,i.v7_relativeSplatPath));return e.useMemo((()=>F(t,JSON.parse(o),l,"path"===a)),[t,o,l,a])}function rt(t,n,a,i){tt()||_(!1);let{navigator:r}=e.useContext(Y),{matches:l}=e.useContext(Q),o=l[l.length-1],s=o?o.params:{},m=(o&&o.pathname,o?o.pathnameBase:"/");o&&o.route;let c,g=et();if(n){var u;let t="string"==typeof n?b(n):n;"/"===m||(null==(u=t.pathname)?void 0:u.startsWith(m))||_(!1),c=t}else c=g;let d=c.pathname||"/",h=d;if("/"!==m){let t=m.replace(/^\//,"").split("/");h="/"+d.replace(/^\//,"").split("/").slice(t.length).join("/")}let k=y(t,{pathname:h}),f=function(t,n,a,i){var r;if(void 0===n&&(n=[]),void 0===a&&(a=null),void 0===i&&(i=null),null==t){var l;if(null==(l=a)||!l.errors)return null;t=a.matches}let o=t,s=null==(r=a)?void 0:r.errors;if(null!=s){let t=o.findIndex((t=>t.route.id&&void 0!==(null==s?void 0:s[t.route.id])));t>=0||_(!1),o=o.slice(0,Math.min(o.length,t+1))}let m=!1,c=-1;if(a&&i&&i.v7_partialHydration)for(let t=0;t=0?o.slice(0,c+1):[o[0]];break}}}return o.reduceRight(((t,i,r)=>{let l,g=!1,u=null,d=null;var p;a&&(l=s&&i.route.id?s[i.route.id]:void 0,u=i.route.errorElement||ot,m&&(c<0&&0===r?(dt[p="route-fallback"]||(dt[p]=!0),g=!0,d=null):c===r&&(g=!0,d=i.route.hydrateFallbackElement||null)));let h=n.concat(o.slice(0,r+1)),_=()=>{let n;return n=l?u:g?d:i.route.Component?e.createElement(i.route.Component,null):i.route.element?i.route.element:t,e.createElement(mt,{match:i,routeContext:{outlet:t,matches:h,isDataRoute:null!=a},children:n})};return a&&(i.route.ErrorBoundary||i.route.errorElement||0===r)?e.createElement(st,{location:a.location,revalidation:a.revalidation,component:u,error:l,children:_(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):_()}),null)}(k&&k.map((t=>Object.assign({},t,{params:Object.assign({},s,t.params),pathname:j([m,r.encodeLocation?r.encodeLocation(t.pathname).pathname:t.pathname]),pathnameBase:"/"===t.pathnameBase?m:j([m,r.encodeLocation?r.encodeLocation(t.pathnameBase).pathname:t.pathnameBase])}))),l,a,i);return n&&f?e.createElement(X.Provider,{value:{location:$({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:p.Pop}},f):f}function lt(){let t=function(){var t;let n=e.useContext(Z),a=function(t){let n=e.useContext(q);return n||_(!1),n}(gt.UseRouteError),i=ut(gt.UseRouteError);return void 0!==n?n:null==(t=a.errors)?void 0:t[i]}(),n=function(t){return null!=t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"boolean"==typeof t.internal&&"data"in t}(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),a=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return e.createElement(e.Fragment,null,e.createElement("h2",null,"Unexpected Application Error!"),e.createElement("h3",{style:{fontStyle:"italic"}},n),a?e.createElement("pre",{style:i},a):null,null)}const ot=e.createElement(lt,null);class st extends e.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||"idle"!==e.revalidation&&"idle"===t.revalidation?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:void 0!==t.error?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){console.error("React Router caught the following error during render",t,e)}render(){return void 0!==this.state.error?e.createElement(Q.Provider,{value:this.props.routeContext},e.createElement(Z.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function mt(t){let{routeContext:n,match:a,children:i}=t,r=e.useContext(V);return r&&r.static&&r.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=a.route.id),e.createElement(Q.Provider,{value:n},i)}var ct=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(ct||{}),gt=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(gt||{});function ut(t){let n=function(t){let n=e.useContext(Q);return n||_(!1),n}(),a=n.matches[n.matches.length-1];return a.route.id||_(!1),a.route.id}const dt={};function pt(t){let{to:n,replace:a,state:i,relative:r}=t;tt()||_(!1);let{future:l,static:o}=e.useContext(Y),{matches:s}=e.useContext(Q),{pathname:m}=et(),c=at(),g=F(n,K(s,l.v7_relativeSplatPath),m,"path"===r),u=JSON.stringify(g);return e.useEffect((()=>c(JSON.parse(u),{replace:a,state:i,relative:r})),[c,u,r,a,i]),null}function ht(t){_(!1)}function _t(t){let{basename:n="/",children:a=null,location:i,navigationType:r=p.Pop,navigator:l,static:o=!1,future:s}=t;tt()&&_(!1);let m=n.replace(/^\/*/,"/"),c=e.useMemo((()=>({basename:m,navigator:l,static:o,future:$({v7_relativeSplatPath:!1},s)})),[m,s,l,o]);"string"==typeof i&&(i=b(i));let{pathname:g="/",search:u="",hash:d="",state:h=null,key:k="default"}=i,f=e.useMemo((()=>{let t=R(g,m);return null==t?null:{location:{pathname:t,search:u,hash:d,state:h,key:k},navigationType:r}}),[m,g,u,d,h,k,r]);return null==f?null:e.createElement(Y.Provider,{value:c},e.createElement(X.Provider,{children:a,value:f}))}function kt(t){let{children:e,location:n}=t;return rt(ft(e),n)}function ft(t,n){void 0===n&&(n=[]);let a=[];return e.Children.forEach(t,((t,i)=>{if(!e.isValidElement(t))return;let r=[...n,i];if(t.type===e.Fragment)return void a.push.apply(a,ft(t.props.children,r));t.type!==ht&&_(!1),t.props.index&&t.props.children&&_(!1);let l={id:t.props.id||r.join("-"),caseSensitive:t.props.caseSensitive,element:t.props.element,Component:t.props.Component,index:t.props.index,path:t.props.path,loader:t.props.loader,action:t.props.action,errorElement:t.props.errorElement,ErrorBoundary:t.props.ErrorBoundary,hasErrorBoundary:null!=t.props.ErrorBoundary||null!=t.props.errorElement,shouldRevalidate:t.props.shouldRevalidate,handle:t.props.handle,lazy:t.props.lazy};t.props.children&&(l.children=ft(t.props.children,r)),a.push(l)})),a}e.startTransition,new Promise((()=>{})),e.Component;const Et=window.ReactDOM;var St=t.n(Et);function bt(){return bt=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0||(i[n]=t[n]);return i}new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const yt=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],xt=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"];try{window.__reactRouterVersion="6"}catch(t){}const wt=e.createContext({isTransitioning:!1});new Map;const Nt=e.startTransition;function Ct(t){let{basename:n,children:a,future:i,window:r}=t,l=e.useRef();null==l.current&&(l.current=function(t){return void 0===t&&(t={}),function(t,e,n,a){void 0===a&&(a={});let{window:i=document.defaultView,v5Compat:r=!1}=a,l=i.history,o=p.Pop,s=null,m=c();function c(){return(l.state||{idx:null}).idx}function g(){o=p.Pop;let t=c(),e=null==t?null:t-m;m=t,s&&s({action:o,location:k.location,delta:e})}function u(t){let e="null"!==i.location.origin?i.location.origin:i.location.href,n="string"==typeof t?t:S(t);return n=n.replace(/ $/,"%20"),_(e,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,e)}null==m&&(m=0,l.replaceState(d({},l.state,{idx:m}),""));let k={get action(){return o},get location(){return t(i,l)},listen(t){if(s)throw new Error("A history only accepts one active listener");return i.addEventListener(h,g),s=t,()=>{i.removeEventListener(h,g),s=null}},createHref:t=>e(i,t),createURL:u,encodeLocation(t){let e=u(t);return{pathname:e.pathname,search:e.search,hash:e.hash}},push:function(t,e){o=p.Push;let a=E(k.location,t,e);n&&n(a,t),m=c()+1;let g=f(a,m),u=k.createHref(a);try{l.pushState(g,"",u)}catch(t){if(t instanceof DOMException&&"DataCloneError"===t.name)throw t;i.location.assign(u)}r&&s&&s({action:o,location:k.location,delta:1})},replace:function(t,e){o=p.Replace;let a=E(k.location,t,e);n&&n(a,t),m=c();let i=f(a,m),g=k.createHref(a);l.replaceState(i,"",g),r&&s&&s({action:o,location:k.location,delta:0})},go:t=>l.go(t)};return k}((function(t,e){let{pathname:n="/",search:a="",hash:i=""}=b(t.location.hash.substr(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),E("",{pathname:n,search:a,hash:i},e.state&&e.state.usr||null,e.state&&e.state.key||"default")}),(function(t,e){let n=t.document.querySelector("base"),a="";if(n&&n.getAttribute("href")){let e=t.location.href,n=e.indexOf("#");a=-1===n?e:e.slice(0,n)}return a+"#"+("string"==typeof e?e:S(e))}),(function(t,e){k("/"===t.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(e)+")")}),t)}({window:r,v5Compat:!0}));let o=l.current,[s,m]=e.useState({action:o.action,location:o.location}),{v7_startTransition:c}=i||{},g=e.useCallback((t=>{c&&Nt?Nt((()=>m(t))):m(t)}),[m,c]);return e.useLayoutEffect((()=>o.listen(g)),[o,g]),e.createElement(_t,{basename:n,children:a,location:s.location,navigationType:s.action,navigator:o,future:i})}Et.flushSync,e.useId;const Tt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Ut=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Dt=e.forwardRef((function(t,n){let a,{onClick:i,relative:r,reloadDocument:l,replace:o,state:s,target:m,to:c,preventScrollReset:g,unstable_viewTransition:u}=t,d=vt(t,yt),{basename:p}=e.useContext(Y),h=!1;if("string"==typeof c&&Ut.test(c)&&(a=c,Tt))try{let t=new URL(window.location.href),e=c.startsWith("//")?new URL(t.protocol+c):new URL(c),n=R(e.pathname,p);e.origin===t.origin&&null!=n?c=n+e.search+e.hash:h=!0}catch(t){}let k=function(t,n){let{relative:a}=void 0===n?{}:n;tt()||_(!1);let{basename:i,navigator:r}=e.useContext(Y),{hash:l,pathname:o,search:s}=it(t,{relative:a}),m=o;return"/"!==i&&(m="/"===o?i:j([i,o])),r.createHref({pathname:m,search:s,hash:l})}(c,{relative:r}),f=function(t,n){let{target:a,replace:i,state:r,preventScrollReset:l,relative:o,unstable_viewTransition:s}=void 0===n?{}:n,m=at(),c=et(),g=it(t,{relative:o});return e.useCallback((e=>{if(function(t,e){return!(0!==t.button||e&&"_self"!==e||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(t))}(e,a)){e.preventDefault();let n=void 0!==i?i:S(c)===S(g);m(t,{replace:n,state:r,preventScrollReset:l,relative:o,unstable_viewTransition:s})}}),[c,m,g,i,r,a,t,l,o,s])}(c,{replace:o,state:s,target:m,preventScrollReset:g,relative:r,unstable_viewTransition:u});return e.createElement("a",bt({},d,{href:a||k,onClick:h||l?i:function(t){i&&i(t),t.defaultPrevented||f(t)},ref:n,target:m}))})),Pt=e.forwardRef((function(t,n){let{"aria-current":a="page",caseSensitive:i=!1,className:r="",end:l=!1,style:o,to:s,unstable_viewTransition:m,children:c}=t,g=vt(t,xt),u=it(s,{relative:g.relative}),d=et(),p=e.useContext(q),{navigator:h,basename:k}=e.useContext(Y),f=null!=p&&function(t,n){void 0===n&&(n={});let a=e.useContext(wt);null==a&&_(!1);let{basename:i}=function(t){let n=e.useContext(V);return n||_(!1),n}(Gt.useViewTransitionState),r=it(t,{relative:n.relative});if(!a.isTransitioning)return!1;let l=R(a.currentLocation.pathname,i)||a.currentLocation.pathname,o=R(a.nextLocation.pathname,i)||a.nextLocation.pathname;return null!=O(r.pathname,o)||null!=O(r.pathname,l)}(u)&&!0===m,E=h.encodeLocation?h.encodeLocation(u).pathname:u.pathname,S=d.pathname,b=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;i||(S=S.toLowerCase(),b=b?b.toLowerCase():null,E=E.toLowerCase()),b&&k&&(b=R(b,k)||b);const v="/"!==E&&E.endsWith("/")?E.length-1:E.length;let y,x=S===E||!l&&S.startsWith(E)&&"/"===S.charAt(v),w=null!=b&&(b===E||!l&&b.startsWith(E)&&"/"===b.charAt(E.length)),N={isActive:x,isPending:w,isTransitioning:f},C=x?a:void 0;y="function"==typeof r?r(N):[r,x?"active":null,w?"pending":null,f?"transitioning":null].filter(Boolean).join(" ");let T="function"==typeof o?o(N):o;return e.createElement(Dt,bt({},g,{"aria-current":C,className:y,ref:n,style:T,to:s,unstable_viewTransition:m}),"function"==typeof c?c(N):c)}));var Gt,It;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(Gt||(Gt={})),function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"}(It||(It={}));const Mt=({title:t})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("header",{className:"gtmkit-px-8 gtmkit-py-6 gtmkit-sticky"},(0,e.createElement)("div",{className:"gtmkit-flex gtmkit-items-center gtmkit-justify-between"},(0,e.createElement)("h1",{className:"gtmkit-flex gtmkit-items-center gtmkit-font-medium gtmkit-text-3xl"},(0,e.createElement)("svg",{className:"gtmkit-mr-8",height:"44",viewBox:"0 0 160 54",width:"128",xmlns:"http://www.w3.org/2000/svg"},(0,e.createElement)("rect",{fill:"#888",height:"54",rx:"4.265",width:"160"}),(0,e.createElement)("path",{d:"m88.659 7.002h-49.266c-2.915 0-5.378-.184-9.23 2.596l-18.743 12.752c-4.549 3.292-4.571 6.001 0 9.302l18.743 12.751c3.652 2.646 6.299 2.597 9.23 2.597h15.686 33.58c2.931-.057 5.394-1.784 5.34-3.923v-32.21c-.012-2.134-2.409-3.865-5.34-3.865z",fill:"#3969bb",transform:"matrix(-1 0 0 -1 101.999867 53.999547)"}),(0,e.createElement)("g",{fill:"#fff",transform:"matrix(1.465202 0 0 1.465202 -4.582436 -7.553126)"},(0,e.createElement)("path",{d:"m18.316 23.086h4.632v6.052c-.75.245-1.459.415-2.121.514-.663.098-1.341.148-2.033.148-1.764 0-3.106-.517-4.035-1.554-.929-1.034-1.395-2.519-1.395-4.457 0-1.886.538-3.356 1.617-4.41 1.078-1.054 2.573-1.579 4.481-1.579 1.2 0 2.357.239 3.469.718l-.823 1.979c-.85-.425-1.737-.637-2.657-.637-1.071 0-1.932.358-2.572 1.077-.645.718-.968 1.685-.968 2.899 0 1.267.26 2.233.78 2.904.516.667 1.271.999 2.262.999.517 0 1.041-.052 1.572-.158v-2.435h-2.209zm11.912 6.555h-2.474v-9.614h-3.173v-2.06h8.816v2.06h-3.169zm9.908 0-2.811-9.158h-.072c.103 1.863.154 3.105.154 3.728v5.43h-2.213v-11.674h3.368l2.764 8.927h.048l2.934-8.927h3.369v11.674h-2.308v-5.525c0-.261 0-.561.009-.903.009-.341.048-1.246.112-2.716h-.074l-3.011 9.144z"}),(0,e.createElement)("path",{d:"m88.883 31.898h-3.811l-4.147-6.67-1.417 1.018v5.652h-3.357v-15.83h3.357v7.242l1.318-1.861 4.293-5.381h3.724l-5.523 7.006zm1.589-15.233c0-1.075.6-1.614 1.8-1.614 1.199 0 1.798.539 1.798 1.614 0 .512-.148.91-.45 1.196-.297.284-.749.429-1.348.429-1.2 0-1.8-.543-1.8-1.625zm3.449 15.233h-3.302v-12.104h3.302zm8.563-2.413c.578 0 1.271-.128 2.077-.38v2.456c-.82.37-1.831.552-3.031.552-1.324 0-2.28-.333-2.885-1.001-.602-.667-.902-1.668-.902-3.003v-5.835h-1.585v-1.399l1.823-1.103.949-2.557h2.115v2.579h3.388v2.48h-3.388v5.835c0 .467.129.815.393 1.041.264.222.614.335 1.046.335z"}))),t)))),Ot=({to:t,title:n})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Pt,{to:t,className:({isActive:t})=>"gtmkit-border-b-4 gtmkit-border-white gtmkit-text-color-grey gtmkit-font-semibold gtmkit-pt-5 gtmkit-pb-[18px] hover:gtmkit-border-color-grey "+(t?"gtmkit-text-color-heading gtmkit-border-b-color-primary ":"")},n)),Lt=({NavList:t})=>(0,e.createElement)("nav",{className:"gtmkit-flex gtmkit-flex-wrap gtmkit-items-center gtmkit-px-8 gtmkit-border-y gtmkit-bg-white gtmkit-border-color-border gtmkit-text-[15px] gtmkit-space-x-9"},t.map((function(t){return(0,e.createElement)(Ot,{key:t.to,to:t.to,title:t.title})})));function Rt(){return Rt=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0||(i[n]=t[n]);return i}function Kt(t,e){return Kt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Kt(t,e)}function Ft(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Kt(t,e)}function jt(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const Ht=n().createContext(null);var Bt=function(t){return t.scrollTop},Wt="unmounted",zt="exited",Jt="entering",$t="entered",Vt="exiting",qt=function(t){function e(e,n){var a;a=t.call(this,e,n)||this;var i,r=n&&!n.isMounting?e.enter:e.appear;return a.appearStatus=null,e.in?r?(i=zt,a.appearStatus=Jt):i=$t:i=e.unmountOnExit||e.mountOnEnter?Wt:zt,a.state={status:i},a.nextCallback=null,a}Ft(e,t),e.getDerivedStateFromProps=function(t,e){return t.in&&e.status===Wt?{status:zt}:null};var a=e.prototype;return a.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},a.componentDidUpdate=function(t){var e=null;if(t!==this.props){var n=this.state.status;this.props.in?n!==Jt&&n!==$t&&(e=Jt):n!==Jt&&n!==$t||(e=Vt)}this.updateStatus(!1,e)},a.componentWillUnmount=function(){this.cancelNextCallback()},a.getTimeouts=function(){var t,e,n,a=this.props.timeout;return t=e=n=a,null!=a&&"number"!=typeof a&&(t=a.exit,e=a.enter,n=void 0!==a.appear?a.appear:e),{exit:t,enter:e,appear:n}},a.updateStatus=function(t,e){if(void 0===t&&(t=!1),null!==e)if(this.cancelNextCallback(),e===Jt){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:St().findDOMNode(this);n&&Bt(n)}this.performEnter(t)}else this.performExit();else this.props.unmountOnExit&&this.state.status===zt&&this.setState({status:Wt})},a.performEnter=function(t){var e=this,n=this.props.enter,a=this.context?this.context.isMounting:t,i=this.props.nodeRef?[a]:[St().findDOMNode(this),a],r=i[0],l=i[1],o=this.getTimeouts(),s=a?o.appear:o.enter;t||n?(this.props.onEnter(r,l),this.safeSetState({status:Jt},(function(){e.props.onEntering(r,l),e.onTransitionEnd(s,(function(){e.safeSetState({status:$t},(function(){e.props.onEntered(r,l)}))}))}))):this.safeSetState({status:$t},(function(){e.props.onEntered(r)}))},a.performExit=function(){var t=this,e=this.props.exit,n=this.getTimeouts(),a=this.props.nodeRef?void 0:St().findDOMNode(this);e?(this.props.onExit(a),this.safeSetState({status:Vt},(function(){t.props.onExiting(a),t.onTransitionEnd(n.exit,(function(){t.safeSetState({status:zt},(function(){t.props.onExited(a)}))}))}))):this.safeSetState({status:zt},(function(){t.props.onExited(a)}))},a.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},a.safeSetState=function(t,e){e=this.setNextCallback(e),this.setState(t,e)},a.setNextCallback=function(t){var e=this,n=!0;return this.nextCallback=function(a){n&&(n=!1,e.nextCallback=null,t(a))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},a.onTransitionEnd=function(t,e){this.setNextCallback(e);var n=this.props.nodeRef?this.props.nodeRef.current:St().findDOMNode(this),a=null==t&&!this.props.addEndListener;if(n&&!a){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],r=i[0],l=i[1];this.props.addEndListener(r,l)}null!=t&&setTimeout(this.nextCallback,t)}else setTimeout(this.nextCallback,0)},a.render=function(){var t=this.state.status;if(t===Wt)return null;var e=this.props,a=e.children,i=(e.in,e.mountOnEnter,e.unmountOnExit,e.appear,e.enter,e.exit,e.timeout,e.addEndListener,e.onEnter,e.onEntering,e.onEntered,e.onExit,e.onExiting,e.onExited,e.nodeRef,At(e,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return n().createElement(Ht.Provider,{value:null},"function"==typeof a?a(t,i):n().cloneElement(n().Children.only(a),i))},e}(n().Component);function Yt(){}qt.contextType=Ht,qt.propTypes={},qt.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Yt,onEntering:Yt,onEntered:Yt,onExit:Yt,onExiting:Yt,onExited:Yt},qt.UNMOUNTED=Wt,qt.EXITED=zt,qt.ENTERING=Jt,qt.ENTERED=$t,qt.EXITING=Vt;const Xt=qt;var Qt=function(t,e){return t&&e&&e.split(" ").forEach((function(e){return a=e,void((n=t).classList?n.classList.remove(a):"string"==typeof n.className?n.className=jt(n.className,a):n.setAttribute("class",jt(n.className&&n.className.baseVal||"",a)));var n,a}))},Zt=function(t){function e(){for(var e,n=arguments.length,a=new Array(n),i=0;i{const{useUpdateSettings:l,useIsPending:o,useCanSave:s}=(0,i.useContext)(g);return(0,e.createElement)(r.Button,{className:n,onClick:()=>l(),variant:"primary",disabled:o||!s},s?(0,a.__)(t,"gtm-kit"):(0,a.__)("Saved","gtm-kit"),o?(0,e.createElement)(r.Spinner,null):"")},ne=()=>{const{useCanSave:t}=(0,i.useContext)(g);return(0,e.createElement)(te,{in:t,timeout:500,classNames:"slide",unmountOnExit:!0},(0,e.createElement)("footer",{className:"gtmkit-fixed gtmkit-bottom-0 gtmkit-w-full gtmkit-z-10 gtmkit-bg-color-grey gtmkit-text-white gtmkit-p-8"},(0,e.createElement)(ee,null)))},ae=({subject:t})=>{const n=!0===t||"on"===t,i=!0===n?"gtmkit-bg-color-success":"gtmkit-bg-color-button-disabled";return(0,e.createElement)("div",{className:"gtmkit-text-xs gtmkit-text-white gtmkit-font-bold gtmkit-rounded-full gtmkit-py gtmkit-px-2 gtmkit-h-5 gtmkit-leading-5 gtmkit-uppercase "+i},n?(0,a.__)("Active","gtm-kit"):(0,a.__)("Inactive","gtm-kit"))},ie=(0,i.forwardRef)((({children:t,className:n="",...a},i)=>(0,e.createElement)("div",{...a,className:"gtmkit-flex gtmkit-flex-col gtmkit-min-h-[128px] gtmkit-bg-white gtmkit-border gtmkit-border-color-border gtmkit-mb-6 gtmkit-py-4 gtmkit-px-5 gtmkit-rounded gtmkit-group gtmkit-w-full "+n,ref:i},t)));ie.Header=({as:t="h3",title:n="",children:a,className:i="",...r})=>(0,e.createElement)("div",{...r,className:"gtmkit-flex gtmkit-justify-between gtmkit-items-center gtmkit-mb-5 "+i},(0,e.createElement)(t,{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading"},n),a),ie.Content=({as:t="div",children:n,className:a="gtmkit-flex-auto",...i})=>(0,e.createElement)(t,{...i,className:a},n),ie.Button=({url:t,destination:n,newTab:a=!1,text:i,group:l="",...o})=>{const s=at();return(0,e.createElement)("div",{...o,className:"gtmkit-mt-4 gtmkit-mb-0.5"},(0,e.createElement)(r.Button,{variant:"primary",className:"gtmkit-rounded !gtmkit-py-4 !gtmkit-px-8 gtmkit-w-full sm:gtmkit-w-auto gtmkit-min-w-[225px]",onClick:()=>{n&&t&&!1===a?window.gtmkitSettings.current_poage===l?s(n,{replace:!0}):window.location.href=t+"#"+n:t?a?window.open(t):window.location.href=t:s(n,{replace:!0})}},(0,e.createElement)("span",{className:"gtmkit-mx-auto gtmkit-text-sm gtmkit-font-bold"},i)))};const re=ie,le=({title:t,data:n,className:r=""})=>{const{useSettings:l}=(0,i.useContext)(g);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8 gtmkit-mt-6"},t),(0,e.createElement)("div",{className:"lg:gtmkit-grid lg:gtmkit-grid-cols-2 xl:gtmkit-grid-cols-3 gtmkit-justify-between gtmkit-gap-6 gtmkit-border-b gtmkit-border-color-border gtmkit-pb-6 gtmkit-min-h-[175px] "+r},n.map(((t,n)=>!1===t.featured?null:(0,e.createElement)(re,{key:n},(0,e.createElement)(re.Header,{title:t.title},t.pill?(0,e.createElement)(ae,{subject:l[t.group][t.option]}):null),(0,e.createElement)(re.Content,null,t.text.map(((t,n)=>(0,e.createElement)("p",{key:n},t)))),(0,e.createElement)(re.Button,{url:t.link.url,destination:t.link.destination,text:t.link.text?t.link.text:(0,a.__)("Read article","gtm-kit"),newTab:t.link.external,group:t.group}))))))},oe=t=>((t,e,n)=>{const a=(t,n)=>({...n,title:t.title,to:t.path,group:t.group||n.group,option:t.option||n.option,text:[t.description],link:{...n.link,url:window.gtmkitSettings[e+"Url"],destination:"/"+t.path}});return"templates"===e?Object.keys(t).map((e=>a(t[e][0],n))):Object.keys(t).map((e=>a(t[e],n)))})(window.gtmkitSettings[t],t,function(t){switch(t){case"integrations":return{pill:!0,group:"integrations",option:null,link:{internal:!0,text:(0,a.__)("Setup Integration","gtm-kit")}};case"templates":return{pill:!1,group:null,option:null,link:{internal:!0,text:(0,a.__)("Get Template","gtm-kit")}};default:return{pill:!1,group:null,option:null,link:{internal:!0,text:(0,a.__)("Read More","gtm-kit")}}}}(t)),se=()=>{const{useSettings:t}=(0,i.useContext)(g),[n,r]=(0,i.useState)(window.gtmkitSettings.tutorials),l=Boolean(t.general.sgtm_domain&&t.general.sgtm_domain.trim());return(0,i.useEffect)((()=>{r((t=>[...t,{title:(0,a.__)("See all tutorials","gtm-kit"),text:[(0,a.__)("See all our tutorials and get the most out of GTM Kit","gtm-kit")],link:{external:!0,url:"https://gtmkit.com/documentation/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=documentation&utm_content=dashboard-tutorials",text:(0,a.__)("Read articles","gtm-kit")},featured:!0}]))}),[]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,a.__)("General","gtm-kit")),(0,e.createElement)("div",{className:"lg:gtmkit-grid lg:gtmkit-grid-cols-2 xl:gtmkit-grid-cols-3 lg:gtmkit-justify-between gtmkit-gap-6 gtmkit-border-b gtmkit-border-color-border gtmkit-pb-6 gtmkit-min-h-[175px]"},(0,e.createElement)(re,null,(0,e.createElement)(re.Header,{title:"Google Tag Manager Container"},(0,e.createElement)(ae,{subject:t.general.gtm_id&&t.general.container_active})),(0,e.createElement)(re.Content,null,t.general.gtm_id&&t.general.container_active?(0,e.createElement)("p",null,(0,a.__)("Container ID:","gtm-kit")," ",t&&t.general.gtm_id):(0,e.createElement)("p",null,(0,a.__)("The container is not active but the datalayer is generated.","gtm-kit"))),(0,e.createElement)(re.Button,{destination:"/container",text:(0,a.__)("Edit container","gtm-kit")})),(0,e.createElement)(re,null,(0,e.createElement)(re.Header,{title:(0,a.__)("Server-side GTM","gtm-kit")},(0,e.createElement)(ae,{subject:l})),(0,e.createElement)(re.Content,null,(0,e.createElement)("p",null,(0,a.__)("Server-side tagging is a silver bullet that gives you improved data accuracy, performance, privacy, and flexibility.","gtm-kit"))),(0,e.createElement)(re.Button,{destination:"/container",text:(0,a.__)("Edit container","gtm-kit")})),(0,e.createElement)(re,null,(0,e.createElement)(re.Header,{title:(0,a.__)("Help improve GTM Kit","gtm-kit")},(0,e.createElement)(ae,{subject:t.general.analytics_active})),(0,e.createElement)(re.Content,null,(0,e.createElement)("p",null,(0,a.__)("Share anonymous data with the development team to help improve GTM Kit.","gtm-kit"))),(0,e.createElement)(re.Button,{destination:"/misc",text:(0,a.__)("Share anonymous data","gtm-kit")}))),(0,e.createElement)(le,{title:(0,a.__)("Tutorials","gtm-kit"),data:n}),(0,e.createElement)(le,{title:(0,a.__)("Integrations","gtm-kit"),data:oe("integrations")}))},me=({title:t,placeholder:n,help:a,className:i="gtmkit-settings-field-wrap gtmkit-py-4 gtmkit-max-w-md",optionGroup:l="general",optionName:o,isDisabled:s,useSettings:m,useUpdateStateSettings:c})=>(0,e.createElement)(r.TextControl,{label:t,placeholder:n,help:a,className:i,value:m[l][o],onChange:t=>c(l,o,t),disabled:s}),ce=({title:t,label:n,optionGroup:a="general",optionName:i,disabled:l=!1,useSettings:o,useUpdateStateSettings:s})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-py-4"},(0,e.createElement)(r.BaseControl,{label:t},(0,e.createElement)(r.ToggleControl,{label:n,checked:!l&&o[a][i],onChange:()=>{s(a,i,!(o&&o[a][i]))},disabled:l})))),ge=({title:t,options:n,help:a,className:i="gtmkit-settings-field-wrap gtmkit-py-4",optionGroup:l="general",optionName:o,disabled:s,useSettings:m,useUpdateStateSettings:c})=>(0,e.createElement)(r.RadioControl,{label:t,options:n,help:a,className:i,selected:parseInt(m[l][o]),onChange:t=>c(l,o,t),disabled:s}),ue=({title:t,help:n,items:a=[],optionGroup:l="general",optionName:o,disabled:s=!1,useSettings:m,useUpdateStateSettings:c})=>{const g=Array.isArray(m[l][o])?m[l][o]:[],[u,d]=(0,i.useState)(g);return(0,i.useEffect)((()=>{const t=Array.isArray(m[l][o])?m[l][o]:[];d(t)}),[m]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-py-4"},(0,e.createElement)(r.BaseControl,{label:t,help:n},a.map((t=>(0,e.createElement)(r.CheckboxControl,{key:t.role,label:t.name,disabled:s,checked:u.includes(t.role),onChange:e=>((t,e)=>{d((n=>{let a;return a=t?[...n,e]:n.filter((t=>t!==e)),c(l,o,a),a}))})(e,t.role)}))))))},de=(0,i.forwardRef)((({children:t,className:n="",disabled:a=!1,...i},r)=>(0,e.createElement)("div",{...i,className:"gtmkit-mb-12 gtmkit-border gtmkit-bg-white gtmkit-w-3/4 gtmkit-border-color-grey "+n+(a?"gtmkit-opacity-60":""),ref:r},t)));de.Header=({as:t="h3",title:n="",children:a,className:i="",...r})=>(0,e.createElement)(t,{...r,className:"gtmkit-font-bold gtmkit-text-lg gtmkit-px-8 gtmkit-py-4 gtmkit-border-b gtmkit-border-color-grey "+i},n,a),de.Content=({as:t="div",children:n,className:a="",...i})=>(0,e.createElement)(t,{...i,className:"gtmkit-px-8 gtmkit-py-6 "+a},n);const pe=de,he=()=>{const{useSettings:t,useUpdateStateSettings:n,useUserRoles:r}=(0,i.useContext)(g),l=!(t.general.sgtm_domain&&t.general.sgtm_domain.trim()&&t.general.sgtm_container_identifier&&t.general.sgtm_container_identifier.trim()),o=et();return(0,e.useEffect)((()=>{const t=new URLSearchParams(o.search).get("focus");if(t){const e=document.getElementById(t);e&&e.scrollIntoView()}}),[o]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,a.__)("Google Tag Manager container","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("General Container Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,a.__)("To start collecting data with Google Tag manager you must register the Container ID of your Google Tag Manager container.","gtm-kit")),(0,e.createElement)(me,{title:(0,a.__)("GTM Container ID:","gtm-kit"),optionName:"gtm_id",placeholder:(0,a.__)("Enter GTM Container ID","gtm-kit"),useSettings:t,useUpdateStateSettings:n}),(0,e.createElement)(ce,{title:(0,a.__)("Inject Container Code","gtm-kit"),label:(0,a.__)("Setting this to Off will remove the Google Tag Manager container code but the data layer will remain.","gtm-kit"),optionName:"container_active",useSettings:t,useUpdateStateSettings:n}),(0,e.createElement)(ce,{title:(0,a.__)("Just the container","gtm-kit"),label:(0,a.__)("Setting this to On will reduce the functionality to just the GTM container code. No additional data will be pushed to the datalayer regardless of any other settings.","gtm-kit"),optionName:"just_the_container",useSettings:t,useUpdateStateSettings:n}),(0,e.createElement)(me,{title:(0,a.__)("dataLayer variable name:","gtm-kit"),optionName:"datalayer_name",placeholder:"dataLayer",help:(0,a.__)("The default name of the data layer object is dataLayer. If you prefer to use a different name for your data layer, you may do so.","gtm-kit"),useSettings:t,useUpdateStateSettings:n}))),(0,e.createElement)("div",{id:"sgtm"}),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("Server-side Tagging (sGTM)","gtm-kit")}),(0,e.createElement)("div",{className:"gtmkit-grid gtmkit-grid-cols-2 gtmkit-gap-4"},(0,e.createElement)(pe.Content,null,(0,e.createElement)(me,{title:(0,a.__)("sGTM Container Domain:","gtm-kit"),optionName:"sgtm_domain",placeholder:(0,a.__)("Enter domain","gtm-kit"),help:(0,a.__)("Enter your custom domain name if you are using a custom server side GTM container for tracking.","gtm-kit"),useSettings:t,useUpdateStateSettings:n}),(0,e.createElement)(me,{title:(0,a.__)("sGTM container identifier:","gtm-kit"),optionName:"sgtm_container_identifier",placeholder:(0,a.__)("Enter loader name","gtm-kit"),help:(0,a.__)("Only use if you are using a custom loader.","gtm-kit"),useSettings:t,useUpdateStateSettings:n}),(0,e.createElement)(ce,{title:(0,a.__)("Cookie Keeper (for Stape users only)","gtm-kit"),label:(0,a.__)("Prolong cookie lifetime in Safari and other browsers with ITP. This only works if you use Stape sGTM hosting and have set up the Cookie Keeper power up.","gtm-kit"),optionName:"sgtm_cookie_keeper",disabled:l,useSettings:t,useUpdateStateSettings:n})),(0,e.createElement)("div",{className:"gtmkit-px-8 gtmkit-py-6"},(0,e.createElement)("div",{className:"gtmkit-border-2 gtmkit-px-4 gtmkit-mt-3"},(0,e.createElement)("h4",{className:"gtmkit-pt-3 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold"},(0,a.__)("Google Tag Manager Server-side Tagging","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,a.__)("Server-side tagging is a silver bullet that gives you improved data accuracy, performance, privacy, and flexibility.","gtm-kit")," ",(0,e.createElement)("a",{href:"https://gtmkit.com/guides/google-tag-manager-server-side-tagging/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=sgtm&utm_content=dashboard-container",className:"gtmkit-text-color-primary gtmkit-font-semibold hover:gtmkit-underline",target:"_blank",rel:"noreferrer"},(0,a.__)("Learn more","gtm-kit"))),(0,e.createElement)("h4",{className:"gtmkit-pt-4 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold"},(0,a.__)("Hosting server-side GTM containers","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,a.__)("Setting up server-side tracking can be challenging and costly but there is an easy and cheap solution.","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,a.__)("Stape.io is a solution for hosting server-side Google Tag Manager containers, offering a simplified approach that demands less technical expertise than solutions like Google Cloud Platform.","gtm-kit")," ",(0,a.__)("Additionally, it provides valuable add-ons for enhanced functionality.","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,e.createElement)("a",{href:"https://stape.io/?pt=tlam&rs=plugin",className:"gtmkit-text-color-primary gtmkit-font-semibold hover:gtmkit-underline",target:"_blank",rel:"noreferrer"},(0,a.__)("Learn more about Stape.io","gtm-kit"))))))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("Page Speed Optimization","gtm-kit")}),(0,e.createElement)("div",{className:"gtmkit-grid gtmkit-grid-cols-2 gtmkit-gap-4"},(0,e.createElement)(pe.Content,null,(0,e.createElement)(ce,{title:(0,a.__)("load_delayed_js event","gtm-kit"),label:(0,a.__)("Setting this to On will push the event 'load_js' on page load.","gtm-kit"),optionName:"load_js_event",useSettings:t,useUpdateStateSettings:n})),(0,e.createElement)("div",{className:"gtmkit-px-8 gtmkit-py-6"},(0,e.createElement)("div",{className:"gtmkit-border-2 gtmkit-px-4 gtmkit-mt-3"},(0,e.createElement)("h4",{className:"gtmkit-pt-3 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold"},(0,a.__)("Delay JavaScript execution","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,a.__)("Page optimization plugins can delay the 'load_delayed_js' event and this can be used to delay the triggering og tags in Google Tag Manager.","gtm-kit")," ",(0,e.createElement)("a",{href:"https://gtmkit.com/guides/delay-javascript-execution-in-gtm/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=delay-js&utm_content=dashboard-container",className:"gtmkit-text-color-primary gtmkit-font-semibold hover:gtmkit-underline",target:"_blank",rel:"noreferrer"},(0,a.__)("Learn more","gtm-kit"))))))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("Google Tag Manager Environment","gtm-kit")}),(0,e.createElement)("div",{className:"gtmkit-grid gtmkit-grid-cols-2 gtmkit-gap-4"},(0,e.createElement)(pe.Content,null,(0,e.createElement)(me,{title:(0,a.__)("gtm_auth:","gtm-kit"),optionName:"gtm_auth",placeholder:(0,a.__)("Enter gtm_auth code","gtm-kit"),help:(0,a.__)("Enter the gtm_auth code for your GTM environment.","gtm-kit"),useSettings:t,useUpdateStateSettings:n}),(0,e.createElement)(me,{title:(0,a.__)("gtm_preview:","gtm-kit"),optionName:"gtm_preview",placeholder:(0,a.__)("Enter gtm_preview code","gtm-kit"),help:(0,a.__)("Enter the gtm_preview code for your GTM environment.","gtm-kit"),useSettings:t,useUpdateStateSettings:n})),(0,e.createElement)("div",{className:"gtmkit-px-8 gtmkit-py-6"},(0,e.createElement)("div",{className:"gtmkit-border-2 gtmkit-px-4 gtmkit-mt-3"},(0,e.createElement)("h4",{className:"gtmkit-pt-3 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold"},(0,a.__)("Environments","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,a.__)("In Google Tag Manager you can define different environments like Live, Dev and QA.","gtm-kit")," ",(0,a.__)('To use a specific environment in GTM Kit you must enter the "gtm_auth" and "gtm_preview" codes for that environment.',"gtm-kit")," ",(0,a.__)("If left empty the default environment will be used.","gtm-kit")),(0,e.createElement)("h4",{className:"gtmkit-pt-4 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold"},(0,a.__)("Override settings in wp-config.php","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,a.__)("You can override the values by using constants in wp-config.php, which is a very useful for setting the value in your development and staging environments.","gtm-kit")," ",(0,e.createElement)("a",{href:"https://gtmkit.com/documentation/settings-actions-and-filters-for-developers/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=container-settings&utm_content=dashboard-container",className:"gtmkit-text-color-primary gtmkit-font-semibold hover:gtmkit-underline",target:"_blank",rel:"noreferrer"},(0,a.__)("Learn more","gtm-kit"))))))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("Exclude User Roles","gtm-kit")}),(0,e.createElement)("div",{className:"gtmkit-grid gtmkit-grid-cols-2 gtmkit-gap-4"},(0,e.createElement)(pe.Content,null,(0,e.createElement)(ue,{title:(0,a.__)("Exclude user roles","gtm-kit"),help:(0,a.__)("Select the roles that you want to exclude from tracking.","gtm-kit"),items:r,optionName:"exclude_user_roles",useSettings:t,useUpdateStateSettings:n})),(0,e.createElement)("div",{className:"gtmkit-px-8 gtmkit-py-6"},(0,e.createElement)("div",{className:"gtmkit-border-2 gtmkit-px-4 gtmkit-mt-3"},(0,e.createElement)("h4",{className:"gtmkit-pt-3 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold gtmkit-text-red-600"},(0,a.__)("Warning!","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,a.__)("Excluding user roles is not compatible with all full-page cache solutions. Some full-page cache solutions may cache the page identically for all users, regardless of their user role. This could result in users being excluded who should not be.","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,a.__)("Please ensure thorough and proper testing of this.","gtm-kit")))))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("Container Code Implementation","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ge,{title:(0,a.__)("Container code implementation:","gtm-kit"),options:[{label:(0,a.__)("Standard implementation as recommended by Google (no delay)","gtm-kit"),value:0},{label:(0,a.__)("Load container when the browser is idle (requestIdleCallback)","gtm-kit"),value:1}],help:(0,a.__)("Depending on how you use Google Tag Manager you can delay the loading of the container script until the browser is idle.","gtm-kit"),optionName:"script_implementation",useSettings:t,useUpdateStateSettings:n}),(0,e.createElement)(ge,{title:(0,a.__)("Container code noscript implementation:","gtm-kit"),options:[{label:(0,a.__)("Just after the opening tag","gtm-kit"),value:0},{label:(0,a.__)("Footer of the page (not recommended by Google)","gtm-kit"),value:1},{label:(0,a.__)("Custom (insert function in your template)","gtm-kit"),value:2},{label:(0,a.__)("Disable