File: /home/creaqbdc/public_html/wp-content/plugins/gtm-kit/assets/admin/wizard.js
(()=>{"use strict";var t={n:e=>{var i=e&&e.__esModule?()=>e.default:()=>e;return t.d(i,{a:i}),i},d:(e,i)=>{for(var a in i)t.o(i,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:i[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const e=window.ReactDOM,i=window.wp.element,a=window.wp.components,n=window.lodash,s=window.wp.apiFetch;var r=t.n(s);r().use(r().createNonceMiddleware(window.gtmkitSettings.nonce)),r().use(r().createRootURLMiddleware(window.gtmkitSettings.root));const o=async(t,e,i=null,a=!1)=>{let n={};try{n=await r()({path:t,method:e,...i&&{data:i}})}catch(i){return{[`gtm_kit_api_${e}_${t}_errors`]:!0}}return!0===a?n:!0===n.success?n.data:{}},l=window.wp.i18n,c=(t,e)=>{const i={...t};switch(e.type){case"FETCH_SETTINGS":i.fetchedSettings={...e.payload.fetchedSettings,integrations:e.payload.fetchedSettings.integrations||{}},i.stateSettings=e.payload.stateSettings,i.siteData=e.payload.siteData,i.notifications=e.payload.notifications,i.installData=e.payload.installData,i.isPending=!1,i.canSave=!1,e.payload.fetchedSettings.gtm_kit_api_fetch_settings_errors&&(i.notice=(0,l.__)("An error occurred.","gtm-kit"),i.hasError=!0);break;case"UPDATE_SETTINGS_BEFORE":i.isPending=e.payload.isPending;break;case"UPDATE_SETTINGS":i.fetchedSettings=e.payload.fetchedSettings,i.stateSettings=e.payload.stateSettings,i.isPending=!1,i.canSave=!!e.payload.fetchedSettings.gtm_kit_api_update_settings_errors,i.notice=e.payload.fetchedSettings.gtm_kit_api_update_settings_errors?(0,l.__)("An error occurred.","gtm-kit"):(0,l.__)("Saved Successfully.","gtm-kit"),i.hasError=!!e.payload.fetchedSettings.gtm_kit_api_update_settings_errors;break;case"UPDATE_STATE":i.fetchedSettings=e.payload.fetchedSettings||i.fetchedSettings,i.stateSettings=e.payload.stateSettings||i.stateSettings,i.isPending=e.payload.isPending||i.isPending,i.notice=e.payload.notice||i.notice,i.hasError=e.payload.hasError||i.hasError,i.canSave=e.payload.canSave||i.canSave,i.isSendingSystemData=e.payload.isSendingSystemData||i.isSendingSystemData,i.supportTicket=e.payload.supportTicket||i.supportTicket,i.isSendingLicenseKey=e.payload.isSendingLicenseKey||i.isSendingLicenseKey,i.licenseKey=e.payload.licenseKey||i.licenseKey;break;case"SEND_SUPPORT_DATA_BEFORE":i.isSendingSystemData=e.payload.isSendingSystemData||i.isSendingSystemData;break;case"SEND_SUPPORT_DATA":i.isSendingSystemData=!1,i.isSystemDataSent=e.payload.isSystemDataSent||i.isSystemDataSent,i.systemDataMessage=e.payload.systemDataMessage||i.systemDataMessage;break;case"SEND_LICENSE_KEY_BEFORE":i.isSendingLicenseKey=e.payload.isSendingLicenseKey||i.isSendingLicenseKey;break;case"SEND_LICENSE_KEY":i.isSendingLicenseKey=!1,i.isLicenseKeySent=e.payload.isLicenseKeySent||i.isLicenseKeySent,i.licenseKeyMessage=e.payload.licenseKeyMessage||i.licenseKeyMessage;break;case"SEND_NOTIFICATION_STATUS_BEFORE":i.isUpdatingNotifications=e.payload.isUpdatingNotifications||i.isUpdatingNotifications;break;case"SEND_NOTIFICATION_STATUS":i.isUpdatingNotifications=!1,i.notifications=e.payload.notifications||i.Notifications}return i},m=window.ReactJSXRuntime,g=(0,i.createContext)(),d=t=>{const[e,a]=(0,i.useReducer)(c,{fetchedSettings:{},stateSettings:{},isPending:!0,notice:"",hasError:!1,canSave:!1,supportTicket:"",isSystemDataSent:!1,systemDataMessage:"",licenseKey:"",isLicensenKeySent:!1,licenseKeyMessage:"",notifications:{}}),s=async()=>{const t=window.gtmkitSettings.settings?window.gtmkitSettings.settings:{},e=window.gtmkitSettings.site_data?window.gtmkitSettings.site_data:{},i=window.gtmkitSettings.notifications?window.gtmkitSettings.notifications:{metrics:{total:1}},n="wizard"===window.gtmkitSettings.currentPage?window.gtmkitSettings.install_data:{};a({type:"FETCH_SETTINGS",payload:{fetchedSettings:t,stateSettings:t,siteData:e,notifications:i,installData:n}})},r=async t=>{a({type:"UPDATE_STATE",payload:t})};(0,i.useEffect)((()=>{s()}),[]);const l={useDispatch:t=>{a(t)},useUpdateSettings:async()=>{a({type:"UPDATE_SETTINGS_BEFORE",payload:{isPending:!0}});const t=await(i=e.stateSettings,o("gtmkit/v1/set-options","POST",i));var i;a({type:"UPDATE_SETTINGS",payload:{fetchedSettings:t,stateSettings:t}})},useFetchSettings:s,useUpdateState:r,useUpdateStateSettings:async(t,i,a)=>{const s=JSON.parse(JSON.stringify(e.stateSettings));let o;s[t][i]=a,o=!(0,n.isEqual)(s,e.fetchedSettings),r({stateSettings:s,canSave:o})},useImportSettings:async(t,i)=>{const a=JSON.parse(JSON.stringify(e.stateSettings));let s;const o={};o.general={...a.general,...i.general},"integrations"in i&&(o.integrations={...a.integrations,...i.integrations}),s=!(0,n.isEqual)(o,e.fetchedSettings),r({stateSettings:o,canSave:s})},useUpdateSupportTicket:async t=>{r({supportTicket:t})},useSendSystemData:async()=>{a({type:"SEND_SUPPORT_DATA_BEFORE",payload:{isSendingSystemData:!0}});const t=await(i=e.supportTicket,o("gtmkit/v1/send-support-data","POST",i,!0));var i;a({type:"SEND_SUPPORT_DATA",payload:{isSendingSystemData:!1,isSystemDataSent:t.success,systemDataMessage:t.data}})},useUpdateLicenseKey:async t=>{r({licenseKey:t})},useSendLicenseKey:async()=>{a({type:"SEND_LICENSE_KEY_BEFORE",payload:{isSendingLicenseKey:!0}});const t=await(i=e.licenseKey,o("gtmkit/v1/send-license-key","POST",i,!0));var i;a({type:"SEND_LICENSE_KEY",payload:{isSendingLicenseKey:!1,isLicenseKeySent:t.success,licenseKeyMessage:t.data}})},useSetNotificationStatus:async(t,e)=>{a({type:"SEND_NOTIFICATION_STATUS_BEFORE",payload:{isUpdatingNotifications:"remove"!==e}});const i={"notification-id":t,action:e},n=await(t=>o("gtmkit/v1/set-notification-status","POST",t,!0))(i),s=n.data.metrics.total,r=document.querySelectorAll("li.toplevel_page_gtmkit_general span.menu-counter");r&&r.forEach((t=>{const e=t.querySelector("span.count");e&&(e.textContent=s),t.className=t.className.replace(/count-\d+/,`count-${s}`)})),a({type:"SEND_NOTIFICATION_STATUS",payload:{isUpdatingNotifications:!1,notifications:n.data}})},useSettings:e.stateSettings,useIsPending:e.isPending,useNotice:e.notice,useHasError:e.hasError,useCanSave:e.canSave,useSiteData:e.siteData,useInstallData:e.installData,useIsSending:e.isSendingSystemData,useSupportTicket:e.supportTicket,useIsSystemDataSent:e.isSystemDataSent,useSystemDataMessage:e.systemDataMessage,useIsSendingLicenseKey:e.isSendingLicenseKey,useLicenseKey:e.licenseKey,useIsLicenseKeySent:e.isLicenseKeySent,useLicenseKeyMessage:e.licenseKeyMessage,useNotifications:e.notifications,useIsUpdatingNotifications:e.isUpdatingNotifications,useUserRoles:window.gtmkitSettings.user_roles?window.gtmkitSettings.user_roles:[],isPremium:!!window.gtmkitSettings.isPremium&&window.gtmkitSettings.isPremium};return(0,m.jsx)(g.Provider,{value:l,children:t.children})},u=window.React;function p(){return p=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(t[a]=i[a])}return t},p.apply(this,arguments)}var h;!function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"}(h||(h={}));const k="popstate";function x(t,e){if(!1===t||null==t)throw new Error(e)}function y(t,e){if(!t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch(t){}}}function S(t,e){return{usr:t.state,key:t.key,idx:e}}function f(t,e,i,a){return void 0===i&&(i=null),p({pathname:"string"==typeof t?t:t.pathname,search:"",hash:""},"string"==typeof e?N(e):e,{state:i,key:e&&e.key||a||Math.random().toString(36).substr(2,8)})}function j(t){let{pathname:e="/",search:i="",hash:a=""}=t;return i&&"?"!==i&&(e+="?"===i.charAt(0)?i:"?"+i),a&&"#"!==a&&(e+="#"===a.charAt(0)?a:"#"+a),e}function N(t){let e={};if(t){let i=t.indexOf("#");i>=0&&(e.hash=t.substr(i),t=t.substr(0,i));let a=t.indexOf("?");a>=0&&(e.search=t.substr(a),t=t.substr(0,a)),t&&(e.pathname=t)}return e}var M;function v(t,e,i){return void 0===i&&(i="/"),function(t,e,i,a){let n=z(("string"==typeof e?N(e):e).pathname||"/",i);if(null==n)return null;let s=_(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,i)=>t===e[i]))?t[t.length-1]-e[e.length-1]:0}(t.routesMeta.map((t=>t.childrenIndex)),e.routesMeta.map((t=>t.childrenIndex)))))}(s);let r=null;for(let t=0;null==r&&t<s.length;++t){let e=P(n);r=U(s[t],e,a)}return r}(t,e,i,!1)}function _(t,e,i,a){void 0===e&&(e=[]),void 0===i&&(i=[]),void 0===a&&(a="");let n=(t,n,s)=>{let r={relativePath:void 0===s?t.path||"":s,caseSensitive:!0===t.caseSensitive,childrenIndex:n,route:t};r.relativePath.startsWith("/")&&(x(r.relativePath.startsWith(a),'Absolute route path "'+r.relativePath+'" nested under path "'+a+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),r.relativePath=r.relativePath.slice(a.length));let o=K([a,r.relativePath]),l=i.concat(r);t.children&&t.children.length>0&&(x(!0!==t.index,'Index routes must not have child routes. Please remove all child routes from route path "'+o+'".'),_(t.children,e,l,o)),(null!=t.path||t.index)&&e.push({path:o,score:O(o,t.index),routesMeta:l})};return t.forEach(((t,e)=>{var i;if(""!==t.path&&null!=(i=t.path)&&i.includes("?"))for(let i of w(t.path))n(t,e,i);else n(t,e)})),e}function w(t){let e=t.split("/");if(0===e.length)return[];let[i,...a]=e,n=i.endsWith("?"),s=i.replace(/\?$/,"");if(0===a.length)return n?[s,""]:[s];let r=w(a.join("/")),o=[];return o.push(...r.map((t=>""===t?s:[s,t].join("/")))),n&&o.push(...r),o.map((e=>t.startsWith("/")&&""===e?"/":e))}!function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"}(M||(M={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const b=/^:[\w-]+$/,T=3,L=2,E=1,D=10,I=-2,C=t=>"*"===t;function O(t,e){let i=t.split("/"),a=i.length;return i.some(C)&&(a+=I),e&&(a+=L),i.filter((t=>!C(t))).reduce(((t,e)=>t+(b.test(e)?T:""===e?E:D)),a)}function U(t,e,i){void 0===i&&(i=!1);let{routesMeta:a}=t,n={},s="/",r=[];for(let t=0;t<a.length;++t){let o=a[t],l=t===a.length-1,c="/"===s?e:e.slice(s.length)||"/",m=A({path:o.relativePath,caseSensitive:o.caseSensitive,end:l},c),g=o.route;if(!m&&l&&i&&!a[a.length-1].route.index&&(m=A({path:o.relativePath,caseSensitive:o.caseSensitive,end:!1},c)),!m)return null;Object.assign(n,m.params),r.push({params:n,pathname:K([s,m.pathname]),pathnameBase:F(K([s,m.pathnameBase])),route:g}),"/"!==m.pathnameBase&&(s=K([s,m.pathnameBase]))}return r}function A(t,e){"string"==typeof t&&(t={path:t,caseSensitive:!1,end:!0});let[i,a]=function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!0),y("*"===t||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were "'+t.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+t.replace(/\*$/,"/*")+'".');let a=[],n="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((t,e,i)=>(a.push({paramName:e,isOptional:null!=i}),i?"/?([^\\/]+)?":"/([^\\/]+)")));return t.endsWith("*")?(a.push({paramName:"*"}),n+="*"===t||"/*"===t?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?n+="\\/*$":""!==t&&"/"!==t&&(n+="(?:(?=\\/|$))"),[new RegExp(n,e?void 0:"i"),a]}(t.path,t.caseSensitive,t.end),n=e.match(i);if(!n)return null;let s=n[0],r=s.replace(/(.)\/+$/,"$1"),o=n.slice(1);return{params:a.reduce(((t,e,i)=>{let{paramName:a,isOptional:n}=e;if("*"===a){let t=o[i]||"";r=s.slice(0,s.length-t.length).replace(/(.)\/+$/,"$1")}const l=o[i];return t[a]=n&&!l?void 0:(l||"").replace(/%2F/g,"/"),t}),{}),pathname:s,pathnameBase:r,pattern:t}}function P(t){try{return t.split("/").map((t=>decodeURIComponent(t).replace(/\//g,"%2F"))).join("/")}catch(e){return y(!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 z(t,e){if("/"===e)return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let i=e.endsWith("/")?e.length-1:e.length,a=t.charAt(i);return a&&"/"!==a?null:t.slice(i)||"/"}function R(t,e,i,a){return"Cannot include a '"+t+"' character in a manually specified `to."+e+"` field ["+JSON.stringify(a)+"]. Please separate it out to the `to."+i+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function G(t,e){let i=function(t){return t.filter(((t,e)=>0===e||t.route.path&&t.route.path.length>0))}(t);return e?i.map(((t,e)=>e===i.length-1?t.pathname:t.pathnameBase)):i.map((t=>t.pathnameBase))}function B(t,e,i,a){let n;void 0===a&&(a=!1),"string"==typeof t?n=N(t):(n=p({},t),x(!n.pathname||!n.pathname.includes("?"),R("?","pathname","search",n)),x(!n.pathname||!n.pathname.includes("#"),R("#","pathname","hash",n)),x(!n.search||!n.search.includes("#"),R("#","search","hash",n)));let s,r=""===t||""===n.pathname,o=r?"/":n.pathname;if(null==o)s=i;else{let t=e.length-1;if(!a&&o.startsWith("..")){let e=o.split("/");for(;".."===e[0];)e.shift(),t-=1;n.pathname=e.join("/")}s=t>=0?e[t]:"/"}let l=function(t,e){void 0===e&&(e="/");let{pathname:i,search:a="",hash:n=""}="string"==typeof t?N(t):t,s=i?i.startsWith("/")?i:function(t,e){let i=e.replace(/\/+$/,"").split("/");return t.split("/").forEach((t=>{".."===t?i.length>1&&i.pop():"."!==t&&i.push(t)})),i.length>1?i.join("/"):"/"}(i,e):e;return{pathname:s,search:Y(a),hash:W(n)}}(n,s),c=o&&"/"!==o&&o.endsWith("/"),m=(r||"."===o)&&i.endsWith("/");return l.pathname.endsWith("/")||!c&&!m||(l.pathname+="/"),l}const K=t=>t.join("/").replace(/\/\/+/g,"/"),F=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),Y=t=>t&&"?"!==t?t.startsWith("?")?t:"?"+t:"",W=t=>t&&"#"!==t?t.startsWith("#")?t:"#"+t:"";Error;const Q=["post","put","patch","delete"],$=(new Set(Q),["get",...Q]);function H(){return H=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(t[a]=i[a])}return t},H.apply(this,arguments)}new Set($),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred");const J=u.createContext(null),Z=u.createContext(null),V=u.createContext(null),X=u.createContext(null),q=u.createContext({outlet:null,matches:[],isDataRoute:!1}),tt=u.createContext(null);function et(){return null!=u.useContext(X)}function it(){return et()||x(!1),u.useContext(X).location}function at(t){u.useContext(V).static||u.useLayoutEffect(t)}function nt(){let{isDataRoute:t}=u.useContext(q);return t?function(){let{router:t}=function(){let t=u.useContext(J);return t||x(!1),t}(mt.UseNavigateStable),e=dt(gt.UseNavigateStable),i=u.useRef(!1);return at((()=>{i.current=!0})),u.useCallback((function(a,n){void 0===n&&(n={}),i.current&&("number"==typeof a?t.navigate(a):t.navigate(a,H({fromRouteId:e},n)))}),[t,e])}():function(){et()||x(!1);let t=u.useContext(J),{basename:e,future:i,navigator:a}=u.useContext(V),{matches:n}=u.useContext(q),{pathname:s}=it(),r=JSON.stringify(G(n,i.v7_relativeSplatPath)),o=u.useRef(!1);return at((()=>{o.current=!0})),u.useCallback((function(i,n){if(void 0===n&&(n={}),!o.current)return;if("number"==typeof i)return void a.go(i);let l=B(i,JSON.parse(r),s,"path"===n.relative);null==t&&"/"!==e&&(l.pathname="/"===l.pathname?e:K([e,l.pathname])),(n.replace?a.replace:a.push)(l,n.state,n)}),[e,a,r,s,t])}()}function st(t,e,i,a){et()||x(!1);let{navigator:n}=u.useContext(V),{matches:s}=u.useContext(q),r=s[s.length-1],o=r?r.params:{},l=(r&&r.pathname,r?r.pathnameBase:"/");r&&r.route;let c,m=it();if(e){var g;let t="string"==typeof e?N(e):e;"/"===l||(null==(g=t.pathname)?void 0:g.startsWith(l))||x(!1),c=t}else c=m;let d=c.pathname||"/",p=d;if("/"!==l){let t=l.replace(/^\//,"").split("/");p="/"+d.replace(/^\//,"").split("/").slice(t.length).join("/")}let k=v(t,{pathname:p}),y=function(t,e,i,a){var n;if(void 0===e&&(e=[]),void 0===i&&(i=null),void 0===a&&(a=null),null==t){var s;if(!i)return null;if(i.errors)t=i.matches;else{if(!(null!=(s=a)&&s.v7_partialHydration&&0===e.length&&!i.initialized&&i.matches.length>0))return null;t=i.matches}}let r=t,o=null==(n=i)?void 0:n.errors;if(null!=o){let t=r.findIndex((t=>t.route.id&&void 0!==(null==o?void 0:o[t.route.id])));t>=0||x(!1),r=r.slice(0,Math.min(r.length,t+1))}let l=!1,c=-1;if(i&&a&&a.v7_partialHydration)for(let t=0;t<r.length;t++){let e=r[t];if((e.route.HydrateFallback||e.route.hydrateFallbackElement)&&(c=t),e.route.id){let{loaderData:t,errors:a}=i,n=e.route.loader&&void 0===t[e.route.id]&&(!a||void 0===a[e.route.id]);if(e.route.lazy||n){l=!0,r=c>=0?r.slice(0,c+1):[r[0]];break}}}return r.reduceRight(((t,a,n)=>{let s,m=!1,g=null,d=null;var p;i&&(s=o&&a.route.id?o[a.route.id]:void 0,g=a.route.errorElement||ot,l&&(c<0&&0===n?(ut[p="route-fallback"]||(ut[p]=!0),m=!0,d=null):c===n&&(m=!0,d=a.route.hydrateFallbackElement||null)));let h=e.concat(r.slice(0,n+1)),k=()=>{let e;return e=s?g:m?d:a.route.Component?u.createElement(a.route.Component,null):a.route.element?a.route.element:t,u.createElement(ct,{match:a,routeContext:{outlet:t,matches:h,isDataRoute:null!=i},children:e})};return i&&(a.route.ErrorBoundary||a.route.errorElement||0===n)?u.createElement(lt,{location:i.location,revalidation:i.revalidation,component:g,error:s,children:k(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):k()}),null)}(k&&k.map((t=>Object.assign({},t,{params:Object.assign({},o,t.params),pathname:K([l,n.encodeLocation?n.encodeLocation(t.pathname).pathname:t.pathname]),pathnameBase:"/"===t.pathnameBase?l:K([l,n.encodeLocation?n.encodeLocation(t.pathnameBase).pathname:t.pathnameBase])}))),s,i,a);return e&&y?u.createElement(X.Provider,{value:{location:H({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:h.Pop}},y):y}function rt(){let t=function(){var t;let e=u.useContext(tt),i=function(){let t=u.useContext(Z);return t||x(!1),t}(gt.UseRouteError),a=dt(gt.UseRouteError);return void 0!==e?e:null==(t=i.errors)?void 0:t[a]}(),e=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),i=t instanceof Error?t.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return u.createElement(u.Fragment,null,u.createElement("h2",null,"Unexpected Application Error!"),u.createElement("h3",{style:{fontStyle:"italic"}},e),i?u.createElement("pre",{style:a},i):null,null)}const ot=u.createElement(rt,null);class lt extends u.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?u.createElement(q.Provider,{value:this.props.routeContext},u.createElement(tt.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ct(t){let{routeContext:e,match:i,children:a}=t,n=u.useContext(J);return n&&n.static&&n.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=i.route.id),u.createElement(q.Provider,{value:e},a)}var mt=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(mt||{}),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 dt(t){let e=function(){let t=u.useContext(q);return t||x(!1),t}(),i=e.matches[e.matches.length-1];return i.route.id||x(!1),i.route.id}const ut={};function pt(t){let{to:e,replace:i,state:a,relative:n}=t;et()||x(!1);let{future:s,static:r}=u.useContext(V),{matches:o}=u.useContext(q),{pathname:l}=it(),c=nt(),m=B(e,G(o,s.v7_relativeSplatPath),l,"path"===n),g=JSON.stringify(m);return u.useEffect((()=>c(JSON.parse(g),{replace:i,state:a,relative:n})),[c,g,n,i,a]),null}function ht(t){x(!1)}function kt(t){let{basename:e="/",children:i=null,location:a,navigationType:n=h.Pop,navigator:s,static:r=!1,future:o}=t;et()&&x(!1);let l=e.replace(/^\/*/,"/"),c=u.useMemo((()=>({basename:l,navigator:s,static:r,future:H({v7_relativeSplatPath:!1},o)})),[l,o,s,r]);"string"==typeof a&&(a=N(a));let{pathname:m="/",search:g="",hash:d="",state:p=null,key:k="default"}=a,y=u.useMemo((()=>{let t=z(m,l);return null==t?null:{location:{pathname:t,search:g,hash:d,state:p,key:k},navigationType:n}}),[l,m,g,d,p,k,n]);return null==y?null:u.createElement(V.Provider,{value:c},u.createElement(X.Provider,{children:i,value:y}))}function xt(t){let{children:e,location:i}=t;return st(yt(e),i)}function yt(t,e){void 0===e&&(e=[]);let i=[];return u.Children.forEach(t,((t,a)=>{if(!u.isValidElement(t))return;let n=[...e,a];if(t.type===u.Fragment)return void i.push.apply(i,yt(t.props.children,n));t.type!==ht&&x(!1),t.props.index&&t.props.children&&x(!1);let s={id:t.props.id||n.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&&(s.children=yt(t.props.children,n)),i.push(s)})),i}u.startTransition,new Promise((()=>{})),u.Component,new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);try{window.__reactRouterVersion="6"}catch(t){}new Map;const St=u.startTransition;function ft(t){let{basename:e,children:i,future:a,window:n}=t,s=u.useRef();var r;null==s.current&&(s.current=(void 0===(r={window:n,v5Compat:!0})&&(r={}),function(t,e,i,a){void 0===a&&(a={});let{window:n=document.defaultView,v5Compat:s=!1}=a,r=n.history,o=h.Pop,l=null,c=m();function m(){return(r.state||{idx:null}).idx}function g(){o=h.Pop;let t=m(),e=null==t?null:t-c;c=t,l&&l({action:o,location:u.location,delta:e})}function d(t){let e="null"!==n.location.origin?n.location.origin:n.location.href,i="string"==typeof t?t:j(t);return i=i.replace(/ $/,"%20"),x(e,"No window.location.(origin|href) available to create URL for href: "+i),new URL(i,e)}null==c&&(c=0,r.replaceState(p({},r.state,{idx:c}),""));let u={get action(){return o},get location(){return t(n,r)},listen(t){if(l)throw new Error("A history only accepts one active listener");return n.addEventListener(k,g),l=t,()=>{n.removeEventListener(k,g),l=null}},createHref:t=>e(n,t),createURL:d,encodeLocation(t){let e=d(t);return{pathname:e.pathname,search:e.search,hash:e.hash}},push:function(t,e){o=h.Push;let a=f(u.location,t,e);i&&i(a,t),c=m()+1;let g=S(a,c),d=u.createHref(a);try{r.pushState(g,"",d)}catch(t){if(t instanceof DOMException&&"DataCloneError"===t.name)throw t;n.location.assign(d)}s&&l&&l({action:o,location:u.location,delta:1})},replace:function(t,e){o=h.Replace;let a=f(u.location,t,e);i&&i(a,t),c=m();let n=S(a,c),g=u.createHref(a);r.replaceState(n,"",g),s&&l&&l({action:o,location:u.location,delta:0})},go:t=>r.go(t)};return u}((function(t,e){let{pathname:i="/",search:a="",hash:n=""}=N(t.location.hash.substr(1));return i.startsWith("/")||i.startsWith(".")||(i="/"+i),f("",{pathname:i,search:a,hash:n},e.state&&e.state.usr||null,e.state&&e.state.key||"default")}),(function(t,e){let i=t.document.querySelector("base"),a="";if(i&&i.getAttribute("href")){let e=t.location.href,i=e.indexOf("#");a=-1===i?e:e.slice(0,i)}return a+"#"+("string"==typeof e?e:j(e))}),(function(t,e){y("/"===t.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(e)+")")}),r)));let o=s.current,[l,c]=u.useState({action:o.action,location:o.location}),{v7_startTransition:m}=a||{},g=u.useCallback((t=>{m&&St?St((()=>c(t))):c(t)}),[c,m]);return u.useLayoutEffect((()=>o.listen(g)),[o,g]),u.useEffect((()=>{return null==(t=a)||t.v7_startTransition,void 0===(null==t?void 0:t.v7_relativeSplatPath)&&(!e||e.v7_relativeSplatPath),void(e&&(e.v7_fetcherPersist,e.v7_normalizeFormMethod,e.v7_partialHydration,e.v7_skipActionErrorRevalidation));var t,e}),[a]),u.createElement(kt,{basename:e,children:i,location:l.location,navigationType:l.action,navigator:o,future:a})}var jt,Nt;e.flushSync,u.useId,"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement,function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"}(jt||(jt={})),function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"}(Nt||(Nt={}));const Mt=()=>{const{useSettings:t,useUpdateStateSettings:e,useUpdateSettings:n,useIsPending:s}=(0,i.useContext)(g),r=nt();return(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)("div",{className:"md:gtmkit-grid gtmkit-grid-cols-2 gtmkit-gap-16 gtmkit-mb-8",children:[(0,m.jsxs)("div",{className:"",children:[(0,m.jsx)("div",{className:"gtmkit-settings-field-wrap gtmkit-w-full !gtmkit-px-8 ",children:(0,m.jsx)(a.TextControl,{label:(0,l.__)("Container ID","gtm-kit"),placeholder:(0,l.__)("Enter Container ID","gtm-kit"),value:t&&t.general.gtm_id,className:"gtmkit-text-center",onChange:t=>e("general","gtm_id",t)})}),(0,m.jsx)("div",{className:"gtmkit-flex gtmkit-mt-12",children:(0,m.jsxs)(a.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{n(),r("/essential-settings",{replace:!0})},disabled:s||!t.general.gtm_id.includes("-"),children:[(0,l.__)("Save and continue","gtm-kit"),s?(0,m.jsx)(a.Spinner,{}):""]})})]}),(0,m.jsxs)("div",{className:"gtmkit-mt-8 gtmkit-border gtmkit-p-6 gtmkit-text-color-grey gtmkit-text-center",children:[(0,m.jsx)("h2",{className:"gtmkit-font-bold gtmkit-text-base gtmkit-mb-4",children:"Need help?"}),(0,m.jsxs)("p",{className:"gtmkit-mb-6",children:[(0,l.__)("Find your GTM container ID on","gtm-kit"),(0,m.jsx)("a",{className:"gtmkit-ml-2 gtmkit-text-color-primary gtmkit-underline",href:"https://tagmanager.google.com/",target:"_blank",rel:"noreferrer",children:"Google Tag Manager"})]}),(0,m.jsxs)("p",{children:[(0,l.__)("It should look something like this:","gtm-kit")," ","GTM-12ZM7SF4"]})]})]})})},vt=()=>{const{useImportSettings:t,useIsPending:e,useInstallData:n}=(0,i.useContext)(g),[s,r]=(0,i.useState)(!0),o=Object.keys(n.import_data)[0],[c,d]=(0,i.useState)(o),u=[];return Object.keys(n.import_data).forEach((t=>{u.push({value:t,label:n.import_data[t].name})})),s?(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)("div",{className:"gtmkit-max-w-lg gtmkit-mx-auto gtmkit-border gtmkit-p-8 gtmkit-my-8 gtmkit-text-left",children:[(0,m.jsx)("h2",{className:"gtmkit-text-lg gtmkit-text-color-heading gtmkit-font-bold",children:(0,l.__)("Would you like to import plugin settings?","gtm-kit")}),(0,m.jsxs)("p",{className:"gtmkit-text-base gtmkit-my-4 gtmkit-text-color-grey",children:[(0,l.__)("We have found the configuration of other plugins in the database.","gtm-kit")," ",(0,l.__)("Would you like to import your settings to GTM Kit?","gtm-kit")]}),(0,m.jsx)(a.RadioControl,{help:(0,l.__)("Select the plugin you want to import settings from.","gtm-kit"),selected:c,options:u,onChange:t=>d(t)}),(0,m.jsxs)("div",{className:"gtmkit-flex gtmkit-mt-12",children:[(0,m.jsxs)(a.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base",onClick:()=>{t(c,n.import_data[c]),r(!1)},children:[(0,m.jsx)("span",{className:"gtmkit-text-lg gtmkit-font-bold",children:(0,l.__)("Yes","gtm-kit")}),e?(0,m.jsx)(a.Spinner,{}):""]}),(0,m.jsxs)(a.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base",onClick:()=>{r(!1)},children:[(0,m.jsx)("span",{className:"gtmkit-text-lg gtmkit-font-bold",children:(0,l.__)("No","gtm-kit")}),e?(0,m.jsx)(a.Spinner,{}):""]})]})]})}):(0,m.jsx)(Mt,{})},_t=()=>{const{useInstallData:t}=(0,i.useContext)(g),{firstInstall:e}=t,{importAvailable:a}=t;return(0,m.jsxs)("div",{className:"gtmkit-text-center",children:[(0,m.jsx)("h1",{className:"gtmkit-text-4xl gtmkit-font-medium gtmkit-mb-8 gtmkit-text-color-heading",children:(0,l.__)("You've successfully installed GTM Kit!","gtm-kit")}),(0,m.jsx)("div",{className:"gtmkit-max-w-lg gtmkit-mx-auto",children:(0,m.jsx)("p",{className:"gtmkit-text-base gtmkit-mb-4 gtmkit-text-color-grey",children:(0,l.__)("To start collecting data with Google Tag manager you must register the Container ID of your Google Tag Manager container.","gtm-kit")})}),e&&a?(0,m.jsx)(vt,{}):(0,m.jsx)(Mt,{})]})},wt=()=>{const{useSettings:t,useUpdateStateSettings:e,useUpdateSettings:n,useIsPending:s,useInstallData:r}=(0,i.useContext)(g),o=nt();return(0,m.jsxs)("div",{className:"gtmkit-text-center",children:[(0,m.jsx)("h1",{className:"gtmkit-text-4xl gtmkit-font-medium gtmkit-mb-8 gtmkit-text-color-heading",children:(0,l.__)("Essential Settings","gtm-kit")}),(0,m.jsx)("div",{className:"gtmkit-max-w-lg gtmkit-mx-auto",children:(0,m.jsx)("p",{className:"gtmkit-text-base gtmkit-mb-4 gtmkit-text-color-grey",children:(0,l.__)("There are a lot of settings in GTM Kit and we recommend that you uses our recommended settings but you can also choose to use the default settings and go through the settings at your convenience.","gtm-kit")})}),(0,m.jsx)("div",{className:"gtmkit-settings-field-wrap gtmkit-max-w-lg gtmkit-mx-auto",children:(0,m.jsx)(a.BaseControl,{label:(0,l.__)("Page type","gtm-kit"),id:"page-type",children:(0,m.jsx)(a.ToggleControl,{label:(0,l.__)("Include the page type i.e. page, product, category, cart, checkout etc in the datalayer?","gtm-kit"),checked:t&&t.general.datalayer_page_type,onChange:()=>{e("general","datalayer_page_type",!(t&&t.general.datalayer_page_type))}})})}),r.woocommerce_integration?(0,m.jsx)("div",{className:"gtmkit-settings-field-wrap gtmkit-max-w-lg gtmkit-mx-auto",children:(0,m.jsx)(a.BaseControl,{label:(0,l.__)("Track WooCommerce","gtm-kit"),id:"track-wooCommerce",children:(0,m.jsx)(a.ToggleControl,{label:(0,l.__)("Would you like to track e-commerce data from WooCommerce?","gtm-kit"),checked:t&&t.integrations.woocommerce_integration,onChange:()=>{e("integrations","woocommerce_integration",!(t&&t.integrations.woocommerce_integration))}})})}):null,r.cf7_integration?(0,m.jsx)("div",{className:"gtmkit-settings-field-wrap gtmkit-max-w-lg gtmkit-mx-auto",children:(0,m.jsx)(a.BaseControl,{label:(0,l.__)("Track Contact Form 7","gtm-kit"),id:"track-cf7",children:(0,m.jsx)(a.ToggleControl,{label:(0,l.__)("Would you like to track form submissions from Contact Form 7?","gtm-kit"),checked:t&&t.integrations.cf7_integration,onChange:()=>{e("integrations","cf7_integration",!(t&&t.integrations.cf7_integration))}})})}):null,r.edd_integration?(0,m.jsx)("div",{className:"gtmkit-settings-field-wrap",children:(0,m.jsx)(a.BaseControl,{label:(0,l.__)("Track Easy Digital Downloads","gtm-kit"),id:"track-edd",children:(0,m.jsx)(a.ToggleControl,{label:(0,l.__)("Would you like to track e-commerce data from Easy Digital Downloads?","gtm-kit"),checked:t&&t.integrations.edd_integration,onChange:()=>{e("integrations","edd_integration",!(t&&t.integrations.edd_integration))}})})}):null,(0,m.jsx)("div",{className:"gtmkit-flex gtmkit-mt-12",children:(0,m.jsxs)(a.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{n(),o("/share-anonymous-data",{replace:!0})},disabled:s,children:[(0,l.__)("Save and continue","gtm-kit"),s?(0,m.jsx)(a.Spinner,{}):""]})})]})},bt=()=>{const{useSettings:t,useUpdateStateSettings:e,useUpdateSettings:n,useIsPending:s,useSiteData:r}=(0,i.useContext)(g),o=nt();return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("h1",{className:"gtmkit-text-4xl gtmkit-font-medium gtmkit-mb-8 gtmkit-text-color-heading gtmkit-text-center",children:(0,l.__)("Help improve GTM Kit","gtm-kit")}),(0,m.jsx)("p",{className:"gtmkit-text-sm gtmkit-mb-4 gtmkit-text-color-grey",children:(0,l.__)("GTM Kit is used together with a wide variety of server configurations and plugins. It is very helpful for us to know what some of these configurations are so we can test the most common configurations.","gtm-kit")}),(0,m.jsx)("p",{className:"gtmkit-text-sm gtmkit-mb-8 gtmkit-text-color-grey",children:(0,l.__)("You can help by sharing anonymous data with us. Below is a detailed view of all data GTM Kit will collect if granted permission:","gtm-kit")}),(0,m.jsx)("table",{className:"gtmkit-border-2 gtmkit-table-fixed gtmkit-w-full gtmkit-text-sm",children:(0,m.jsxs)("tbody",{children:[(0,m.jsxs)("tr",{className:"",children:[(0,m.jsx)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1",children:(0,m.jsx)("strong",{children:"Server type:"})}),(0,m.jsx)("td",{className:"gtmkit-px-2 gtmkit-py-1",children:(0,m.jsx)("code",{className:"gtmkit-text-sm",children:r.web_server})})]}),(0,m.jsxs)("tr",{children:[(0,m.jsx)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1",children:(0,m.jsx)("strong",{children:"PHP version number:"})}),(0,m.jsx)("td",{className:"gtmkit-px-2 gtmkit-py-1",children:(0,m.jsx)("code",{className:"gtmkit-text-sm",children:r.php_version})})]}),(0,m.jsxs)("tr",{children:[(0,m.jsx)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1",children:(0,m.jsx)("strong",{children:"WordPress version number:"})}),(0,m.jsx)("td",{className:"gtmkit-px-2 gtmkit-py-1",children:(0,m.jsx)("code",{className:"gtmkit-text-sm",children:r.wordpress_version})})]}),(0,m.jsxs)("tr",{children:[(0,m.jsx)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1",children:(0,m.jsx)("strong",{children:"WordPress multisite:"})}),(0,m.jsx)("td",{className:"gtmkit-px-2 gtmkit-py-1",children:(0,m.jsx)("code",{className:"gtmkit-text-sm",children:r.multisite?(0,l.__)("Yes","gtm-kit"):(0,l.__)("No","gtm-kit")})})]}),(0,m.jsxs)("tr",{children:[(0,m.jsx)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1",children:(0,m.jsx)("strong",{children:"Current theme:"})}),(0,m.jsx)("td",{className:"gtmkit-px-2 gtmkit-py-1",children:(0,m.jsx)("code",{className:"gtmkit-text-sm",children:r.current_theme})})]}),(0,m.jsxs)("tr",{children:[(0,m.jsx)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1",children:(0,m.jsx)("strong",{children:"Current site language:"})}),(0,m.jsx)("td",{className:"gtmkit-px-2 gtmkit-py-1",children:(0,m.jsx)("code",{className:"gtmkit-text-sm",children:r.locale})})]}),(0,m.jsxs)("tr",{children:[(0,m.jsx)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1",children:(0,m.jsx)("strong",{children:"Active plugins:"})}),(0,m.jsx)("td",{className:"gtmkit-px-2 gtmkit-py-1",children:(0,m.jsx)("em",{children:"Plugin names of all active plugins"})})]}),(0,m.jsxs)("tr",{children:[(0,m.jsx)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1",children:(0,m.jsx)("strong",{children:"Anonymized GTM Kit settings:"})}),(0,m.jsx)("td",{className:"gtmkit-px-2 gtmkit-py-1",children:(0,m.jsx)("em",{children:"Which GTM Kit settings are active"})})]})]})}),(0,m.jsx)("div",{className:"gtmkit-settings-field-wrap gtmkit-max-w-max !gtmkit-px-8 gtmkit-mx-auto ",children:(0,m.jsx)(a.BaseControl,{label:(0,l.__)("Share anonymous data","gtm-kit"),id:"share-anonymous-data",children:(0,m.jsx)(a.ToggleControl,{label:(0,l.__)("I agree to share anonymous data with the development team to help improve GTM Kit. ","gtm-kit"),checked:t&&t.general.analytics_active,onChange:()=>{e("general","analytics_active",!(t&&t.general.analytics_active))}})})}),(0,m.jsx)("div",{className:"gtmkit-flex gtmkit-mt-12",children:(0,m.jsxs)(a.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{n(),o("/automatic-updates",{replace:!0})},disabled:s,children:[(0,l.__)("Save and continue","gtm-kit"),s?(0,m.jsx)(a.Spinner,{}):""]})})]})},Tt=(t="general",e="")=>{const i=window.gtmkitSettings.adminPageUrl;return e?`${i}${t}#/${e}`:`${i}${t}`},Lt=()=>(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("h1",{className:"gtmkit-text-4xl gtmkit-font-medium gtmkit-mb-8 gtmkit-text-color-heading gtmkit-text-center",children:(0,l.__)("You are ready to use GTM Kit!","gtm-kit")}),(0,m.jsx)("p",{className:"gtmkit-text-base gtmkit-mb-4 gtmkit-text-color-grey gtmkit-text-center",children:(0,l.__)("Your Google Tag Manager Container is now sending data to Google Tag Manager.","gtm-kit")}),(0,m.jsxs)("p",{className:"gtmkit-text-base gtmkit-mb-12 gtmkit-text-color-grey gtmkit-text-center",children:[(0,l.__)("Below you will find GTM container import files, with all the necessary tags, trigger, and variables to use Google Analytics 4.","gtm-kit")," "]}),(0,m.jsxs)("div",{className:"gtmkit-border-2 gtmkit-max-w-lg gtmkit-mx-auto gtmkit-mb-8",children:[(0,m.jsx)("h3",{className:"gtmkit-p-3 gtmkit-font-bold gtmkit-text-xl gtmkit-border-b-2",children:(0,l.__)("Getting Started","gtm-kit")}),(0,m.jsxs)("p",{className:"gtmkit-text-base gtmkit-text-color-grey gtmkit-m-4",children:[(0,l.__)("The next step is to configure your Google Tag Manager container. You will find templates for this in the GTM Templates section.","gtm-kit")," ",(0,m.jsx)("a",{className:"gtmkit-text-color-primary gtmkit-whitespace-nowrap",href:Tt("templates"),rel:"noreferrer",children:(0,l.__)("Go to GTM Templates","gtm-kit")})]}),(0,m.jsxs)("p",{className:"gtmkit-text-base gtmkit-text-color-grey gtmkit-m-4",children:[(0,l.__)("To get the most out of Google Tag Manager with GTM Kit, you should also review the tutorials.","gtm-kit")," ",(0,m.jsx)("a",{className:"gtmkit-text-color-primary gtmkit-whitespace-nowrap",href:Tt("help","help"),rel:"noreferrer",children:(0,l.__)("Go to Tutorials","gtm-kit")})]})]}),(0,m.jsx)("div",{className:"gtmkit-flex gtmkit-mt-12",children:(0,m.jsx)(a.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{window.location.href=Tt("general")},children:(0,l.__)("Go to the dashboard","gtm-kit")})})]}),Et=[{step:1,path:"/welcome",element:"Welcome",title:(0,l.__)("Welcome","gtm-kit")},{step:2,path:"/essential-settings",element:"EssentialSettings",title:(0,l.__)("Essential Settings","gtm-kit")},{step:3,path:"/share-anonymous-data",element:"ShareAnonymousData",title:(0,l.__)("Help improve GTM Kit","gtm-kit")},{step:4,path:"/automatic-updates",element:"Automatic Updates",title:(0,l.__)("Automatic Updates","gtm-kit")},{step:5,path:"/getting-started",element:"GettingStarted",title:(0,l.__)("Getting Started","gtm-kit")}],Dt=({step:t,currentStep:e,totalSteps:i})=>{if(t===i)return;let a="gtmkit-h-0.5 gtmkit-w-full";return a+=t<e?" gtmkit-bg-color-primary":" gtmkit-bg-color-border",(0,m.jsx)("div",{className:a})},It=({step:t,currentStep:e,totalSteps:i})=>t<e||t===i?(0,m.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",className:"gtmkit-w-5 gtmkit-h-5 gtmkit-text-white",children:(0,m.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}):t===e?(0,m.jsx)("span",{className:"gtmkit-h-2.5 gtmkit-w-2.5 gtmkit-rounded-full gtmkit-bg-color-primary"}):void 0,Ct=({step:t,currentStep:e,totalSteps:i})=>{if(0===t)return;let a="gtmkit-transition-opacity gtmkit-duration-500 gtmkit-absolute gtmkit-inset-0 gtmkit-border-2 gtmkit-flex gtmkit-items-center gtmkit-justify-center gtmkit-rounded-full gtmkit-opacity-100";return a+=t<e||e===i?" gtmkit-bg-color-primary":" gtmkit-bg-white",a+=t>e?" gtmkit-border-color-border":" gtmkit-border-color-primary",(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("span",{className:"gtmkit-relative gtmkit-shrink-0 gtmkit-z-10 gtmkit-w-8 gtmkit-h-8 gtmkit-rounded-full",children:(0,m.jsx)("span",{className:a,children:(0,m.jsx)(It,{step:t,currentStep:e,totalSteps:i})})}),(0,m.jsx)(Dt,{step:t,currentStep:e,totalSteps:i})]})},Ot=()=>{const t=Et.length-1+Et[0].step;let e=((t,e)=>{const i=Object.keys(e);return t.filter((function(t){for(let a=0;a<i.length;a++)if(!t.hasOwnProperty(i[a])||t[i[a]]!==e[i[a]])return!1;return!0}))})(Et,{path:it().pathname});return e=e.length?e[0].step:0,0===e?(0,m.jsx)("div",{className:"gtmkit-my-16"}):(0,m.jsx)("div",{className:"gtmkit-mt-6 gtmkit-inset-0 gtmkit-mx-auto gtmkit-my-6 gtmkit-flex gtmkit-items-center gtmkit-max-w-xl","aria-hidden":"true",children:Et.map((function(i){return(0,m.jsx)(Ct,{step:i.step,currentStep:e,totalSteps:t},i.step)}))})},Ut=()=>(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("header",{className:"gtmkit-text-center gtmkit-px-3",children:(0,m.jsx)("h1",{className:"gtmkit-mt-3 md:gtmkit-mt-8 gtmkit-mb-4 gtmkit-w-[200px] gtmkit-inline-block",children:(0,m.jsx)("img",{src:"data:image/svg+xml;base64,PHN2ZyBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAyNDY3LjEgMTU4Ni40IiBoZWlnaHQ9IjU0IiB2aWV3Qm94PSIwIDAgMTYwIDU0IiB3aWR0aD0iMTYwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IGZpbGw9IiM4ODgiIGhlaWdodD0iNTQiIHJ4PSI0LjI2NSIgd2lkdGg9IjE2MCIvPjxwYXRoIGQ9Im04OC42NTkgNy4wMDJoLTQ5LjI2NmMtMi45MTUgMC01LjM3OC0uMTg0LTkuMjMgMi41OTZsLTE4Ljc0MyAxMi43NTJjLTQuNTQ5IDMuMjkyLTQuNTcxIDYuMDAxIDAgOS4zMDJsMTguNzQzIDEyLjc1MWMzLjY1MiAyLjY0NiA2LjI5OSAyLjU5NyA5LjIzIDIuNTk3aDE1LjY4NiAzMy41OGMyLjkzMS0uMDU3IDUuMzk0LTEuNzg0IDUuMzQtMy45MjN2LTMyLjIxYy0uMDEyLTIuMTM0LTIuNDA5LTMuODY1LTUuMzQtMy44NjV6IiBmaWxsPSIjMzk2OWJiIiB0cmFuc2Zvcm09Im1hdHJpeCgtMSAwIDAgLTEgMTAxLjk5OTg2NyA1My45OTk1NDcpIi8+PGcgZmlsbD0iI2ZmZiIgdHJhbnNmb3JtPSJtYXRyaXgoMS40NjUyMDIgMCAwIDEuNDY1MjAyIC00LjU4MjQzNiAtNy41NTMxMjYpIj48cGF0aCBkPSJtMTguMzE2IDIzLjA4Nmg0LjYzMnY2LjA1MmMtLjc1LjI0NS0xLjQ1OS40MTUtMi4xMjEuNTE0LS42NjMuMDk4LTEuMzQxLjE0OC0yLjAzMy4xNDgtMS43NjQgMC0zLjEwNi0uNTE3LTQuMDM1LTEuNTU0LS45MjktMS4wMzQtMS4zOTUtMi41MTktMS4zOTUtNC40NTcgMC0xLjg4Ni41MzgtMy4zNTYgMS42MTctNC40MSAxLjA3OC0xLjA1NCAyLjU3My0xLjU3OSA0LjQ4MS0xLjU3OSAxLjIgMCAyLjM1Ny4yMzkgMy40NjkuNzE4bC0uODIzIDEuOTc5Yy0uODUtLjQyNS0xLjczNy0uNjM3LTIuNjU3LS42MzctMS4wNzEgMC0xLjkzMi4zNTgtMi41NzIgMS4wNzctLjY0NS43MTgtLjk2OCAxLjY4NS0uOTY4IDIuODk5IDAgMS4yNjcuMjYgMi4yMzMuNzggMi45MDQuNTE2LjY2NyAxLjI3MS45OTkgMi4yNjIuOTk5LjUxNyAwIDEuMDQxLS4wNTIgMS41NzItLjE1OHYtMi40MzVoLTIuMjA5em0xMS45MTIgNi41NTVoLTIuNDc0di05LjYxNGgtMy4xNzN2LTIuMDZoOC44MTZ2Mi4wNmgtMy4xNjl6bTkuOTA4IDAtMi44MTEtOS4xNThoLS4wNzJjLjEwMyAxLjg2My4xNTQgMy4xMDUuMTU0IDMuNzI4djUuNDNoLTIuMjEzdi0xMS42NzRoMy4zNjhsMi43NjQgOC45MjdoLjA0OGwyLjkzNC04LjkyN2gzLjM2OXYxMS42NzRoLTIuMzA4di01LjUyNWMwLS4yNjEgMC0uNTYxLjAwOS0uOTAzLjAwOS0uMzQxLjA0OC0xLjI0Ni4xMTItMi43MTZoLS4wNzRsLTMuMDExIDkuMTQ0eiIvPjxwYXRoIGQ9Im04OC44ODMgMzEuODk4aC0zLjgxMWwtNC4xNDctNi42Ny0xLjQxNyAxLjAxOHY1LjY1MmgtMy4zNTd2LTE1LjgzaDMuMzU3djcuMjQybDEuMzE4LTEuODYxIDQuMjkzLTUuMzgxaDMuNzI0bC01LjUyMyA3LjAwNnptMS41ODktMTUuMjMzYzAtMS4wNzUuNi0xLjYxNCAxLjgtMS42MTQgMS4xOTkgMCAxLjc5OC41MzkgMS43OTggMS42MTQgMCAuNTEyLS4xNDguOTEtLjQ1IDEuMTk2LS4yOTcuMjg0LS43NDkuNDI5LTEuMzQ4LjQyOS0xLjIgMC0xLjgtLjU0My0xLjgtMS42MjV6bTMuNDQ5IDE1LjIzM2gtMy4zMDJ2LTEyLjEwNGgzLjMwMnptOC41NjMtMi40MTNjLjU3OCAwIDEuMjcxLS4xMjggMi4wNzctLjM4djIuNDU2Yy0uODIuMzctMS44MzEuNTUyLTMuMDMxLjU1Mi0xLjMyNCAwLTIuMjgtLjMzMy0yLjg4NS0xLjAwMS0uNjAyLS42NjctLjkwMi0xLjY2OC0uOTAyLTMuMDAzdi01LjgzNWgtMS41ODV2LTEuMzk5bDEuODIzLTEuMTAzLjk0OS0yLjU1N2gyLjExNXYyLjU3OWgzLjM4OHYyLjQ4aC0zLjM4OHY1LjgzNWMwIC40NjcuMTI5LjgxNS4zOTMgMS4wNDEuMjY0LjIyMi42MTQuMzM1IDEuMDQ2LjMzNXoiLz48L2c+PC9zdmc+",alt:(0,l.__)("GTM Kit","gtm-kit"),className:"gtmkit-w-full"})})}),(0,m.jsx)(Ot,{})]}),At=()=>(0,m.jsx)(m.Fragment,{children:(0,m.jsx)("footer",{className:"gtm-kit-settings-footer gtmkit-my-8 gtmkit-text-color-grey",children:(0,m.jsx)("p",{className:"gtmkit-mx-auto gtmkit-max-w-max",children:(0,m.jsx)("a",{className:"gtmkit-underline",href:Tt(),children:(0,l.__)("Go to the dashboard.","gtm-kit")})})})}),Pt=({title:t,label:e,optionGroup:n="general",optionName:s,disabled:r=!1,useSettings:o,useUpdateStateSettings:l,narrow:c=!1,premium:g=!1,useSetNotificationStatus:d,notificationId:u=""})=>{const p=(0,i.useId)(),h="gtmkit-settings-field-wrap "+(c?"gtmkit-py-2":"gtmkit-py-4");return(0,m.jsx)(m.Fragment,{children:(0,m.jsx)("div",{className:h,children:(0,m.jsx)(a.BaseControl,{label:g?(0,m.jsxs)(m.Fragment,{children:[t,(0,m.jsx)("span",{className:"gtmkit-text-xs gtmkit-text-white gtmkit-font-normal gtmkit-rounded-full gtmkit-py-0.5 gtmkit-px-2 gtmkit-h-5 gtmkit-leading-5 gtmkit-bg-color-success gtmkit-ml-6",children:"Premium"})]}):t,id:p,children:(0,m.jsx)(a.ToggleControl,{label:e,checked:!r&&o[n][s],onChange:()=>{l(n,s,!(o&&o[n][s])),u&&d(u,"remove")},disabled:r})})})})},zt=()=>{const{useSettings:t,useUpdateStateSettings:e,useUpdateSettings:n,useIsPending:s,useSiteData:r}=(0,i.useContext)(g),o=nt();return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("h1",{className:"gtmkit-text-4xl gtmkit-font-medium gtmkit-mb-8 gtmkit-text-color-heading gtmkit-text-center",children:(0,l.__)("Automatic Updates","gtm-kit")}),(0,m.jsx)("p",{className:"gtmkit-text-sm gtmkit-mb-4 gtmkit-text-color-grey",children:(0,l.__)("New releases of GTM Kit may contain important updates to comply with changes in Google Tag Manager or analytics in general. We recommend enabling automatic plugin updates for GTM Kit to ensure it is always up to date.","gtm-kit")}),(0,m.jsx)("p",{className:"gtmkit-text-sm gtmkit-mb-8 gtmkit-text-color-grey",children:(0,l.__)("You can, of course, manually update GTM Kit whenever it suits you, but we highly recommend that you regularly update your plugins and themes to the latest versions to keep your site secure.","gtm-kit")}),(0,m.jsx)("div",{className:"gtmkit-max-w-max gtmkit-mx-auto gtmkit-mt-12",children:(0,m.jsx)(Pt,{title:(0,l.__)("Enable Automatic Updates","gtm-kit"),label:(0,l.__)("Automatically update the GTM Kit plugin when new releases are available.","gtm-kit"),optionGroup:"misc",optionName:"auto_update",useSettings:t,useUpdateStateSettings:e})}),(0,m.jsx)("div",{className:"gtmkit-flex gtmkit-mt-12",children:(0,m.jsxs)(a.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{n(),o("/getting-started",{replace:!0})},disabled:s,children:[(0,l.__)("Save and continue","gtm-kit"),s?(0,m.jsx)(a.Spinner,{}):""]})})]})},Rt=()=>{const{useSettings:t}=(0,i.useContext)(g);return Object.keys(t).length?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(Ut,{}),(0,m.jsx)("main",{className:"gtmkit-max-w-3xl gtmkit-bg-white gtmkit-border-1 gtmkit-border-color-border gtmkit-rounded-md gtmkit-mx-auto gtmkit-py-12 gtmkit-px-16 gtmkit-text-base",children:(0,m.jsxs)(xt,{children:[(0,m.jsx)(ht,{exact:!0,path:"/welcome",element:(0,m.jsx)(_t,{})}),(0,m.jsx)(ht,{exact:!0,path:"/essential-settings",element:(0,m.jsx)(wt,{})}),(0,m.jsx)(ht,{exact:!0,path:"/share-anonymous-data",element:(0,m.jsx)(bt,{})}),(0,m.jsx)(ht,{exact:!0,path:"/automatic-updates",element:(0,m.jsx)(zt,{})}),(0,m.jsx)(ht,{exact:!0,path:"/getting-started",element:(0,m.jsx)(Lt,{})}),(0,m.jsx)(ht,{path:"/",element:(0,m.jsx)(pt,{replace:!0,to:"/welcome"})})]})}),(0,m.jsx)(At,{})]}):(0,m.jsx)(a.Spinner,{className:"gtm-kit-settings-page-loader"})},Gt=()=>(0,m.jsx)(ft,{basename:"/",children:(0,m.jsx)(d,{children:(0,m.jsx)(Rt,{})})});document.addEventListener("DOMContentLoaded",(()=>{const t=document.getElementById(window.gtmkitSettings.rootId);null!=t&&(0,e.createRoot)(t).render((0,m.jsx)(Gt,{}))}))})();