diff --git a/assets/admin/settings.asset.php b/assets/admin/settings.asset.php index 920eb49..d7670f3 100644 --- a/assets/admin/settings.asset.php +++ b/assets/admin/settings.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-primitives'), 'version' => 'e9e4e88a99fd728885a0'); + array('lodash', 'react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-primitives'), 'version' => 'a518367e05cc33818189'); diff --git a/assets/admin/settings.js b/assets/admin/settings.js index 094275a..2da48ca 100644 --- a/assets/admin/settings.js +++ b/assets/admin/settings.js @@ -1,22 +1,22 @@ -(()=>{var t={838:function(t){t.exports=function(){"use strict";const{entries:t,setPrototypeOf:e,isFrozen:n,getPrototypeOf:i,getOwnPropertyDescriptor:a}=Object;let{freeze:o,seal:s,create:r}=Object,{apply:l,construct:m}="undefined"!=typeof Reflect&&Reflect;o||(o=function(t){return t}),s||(s=function(t){return t}),l||(l=function(t,e,n){return t.apply(e,n)}),m||(m=function(t,e){return new t(...e)});const c=v(Array.prototype.forEach),g=v(Array.prototype.pop),u=v(Array.prototype.push),d=v(String.prototype.toLowerCase),p=v(String.prototype.toString),h=v(String.prototype.match),k=v(String.prototype.replace),f=v(String.prototype.indexOf),_=v(String.prototype.trim),x=v(Object.prototype.hasOwnProperty),b=v(RegExp.prototype.test),S=(y=TypeError,function(){for(var t=arguments.length,e=new Array(t),n=0;n1?n-1:0),a=1;a2&&void 0!==arguments[2]?arguments[2]:d;e&&e(t,null);let o=i.length;for(;o--;){let e=i[o];if("string"==typeof e){const t=a(e);t!==e&&(n(i)||(i[o]=t),e=t)}t[e]=!0}return t}function N(t){for(let e=0;e/gm),H=s(/\${[\w\W]*}/gm),B=s(/^data-[\-\w.\u00B7-\uFFFF]/),W=s(/^aria-[\-\w]+$/),K=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),z=s(/^(?:\w+script|data):/i),Y=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),$=s(/^html$/i),J=s(/^[a-z][.\w]*(-[.\w]+)+$/i);var q=Object.freeze({__proto__:null,MUSTACHE_EXPR:G,ERB_EXPR:F,TMPLIT_EXPR:H,DATA_ATTR:B,ARIA_ATTR:W,IS_ALLOWED_URI:K,IS_SCRIPT_OR_DATA:z,ATTR_WHITESPACE:Y,DOCTYPE_NAME:$,CUSTOM_ELEMENT:J});const V=1,X=3,Z=7,Q=8,tt=9,et=function(){return"undefined"==typeof window?null:window};return function e(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:et();const i=t=>e(t);if(i.version="3.1.6",i.removed=[],!n||!n.document||n.document.nodeType!==tt)return i.isSupported=!1,i;let{document:a}=n;const s=a,l=s.currentScript,{DocumentFragment:m,HTMLTemplateElement:y,Node:v,Element:N,NodeFilter:G,NamedNodeMap:F=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:H,DOMParser:B,trustedTypes:W}=n,z=N.prototype,Y=j(z,"cloneNode"),J=j(z,"remove"),nt=j(z,"nextSibling"),it=j(z,"childNodes"),at=j(z,"parentNode");if("function"==typeof y){const t=a.createElement("template");t.content&&t.content.ownerDocument&&(a=t.content.ownerDocument)}let ot,st="";const{implementation:rt,createNodeIterator:lt,createDocumentFragment:mt,getElementsByTagName:ct}=a,{importNode:gt}=s;let ut={};i.isSupported="function"==typeof t&&"function"==typeof at&&rt&&void 0!==rt.createHTMLDocument;const{MUSTACHE_EXPR:dt,ERB_EXPR:pt,TMPLIT_EXPR:ht,DATA_ATTR:kt,ARIA_ATTR:ft,IS_SCRIPT_OR_DATA:_t,ATTR_WHITESPACE:xt,CUSTOM_ELEMENT:bt}=q;let{IS_ALLOWED_URI:St}=q,yt=null;const vt=E({},[...T,...C,...D,...A,...O]);let Et=null;const Nt=E({},[...R,...L,...M,...P]);let wt=Object.seal(r(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),jt=null,Tt=null,Ct=!0,Dt=!0,Ut=!1,At=!0,It=!1,Ot=!0,Rt=!1,Lt=!1,Mt=!1,Pt=!1,Gt=!1,Ft=!1,Ht=!0,Bt=!1,Wt=!0,Kt=!1,zt={},Yt=null;const $t=E({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Jt=null;const qt=E({},["audio","video","img","source","image","track"]);let Vt=null;const Xt=E({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Zt="http://www.w3.org/1998/Math/MathML",Qt="http://www.w3.org/2000/svg",te="http://www.w3.org/1999/xhtml";let ee=te,ne=!1,ie=null;const ae=E({},[Zt,Qt,te],p);let oe=null;const se=["application/xhtml+xml","text/html"];let re=null,le=null;const me=a.createElement("form"),ce=function(t){return t instanceof RegExp||t instanceof Function},ge=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!le||le!==t){if(t&&"object"==typeof t||(t={}),t=w(t),oe=-1===se.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,re="application/xhtml+xml"===oe?p:d,yt=x(t,"ALLOWED_TAGS")?E({},t.ALLOWED_TAGS,re):vt,Et=x(t,"ALLOWED_ATTR")?E({},t.ALLOWED_ATTR,re):Nt,ie=x(t,"ALLOWED_NAMESPACES")?E({},t.ALLOWED_NAMESPACES,p):ae,Vt=x(t,"ADD_URI_SAFE_ATTR")?E(w(Xt),t.ADD_URI_SAFE_ATTR,re):Xt,Jt=x(t,"ADD_DATA_URI_TAGS")?E(w(qt),t.ADD_DATA_URI_TAGS,re):qt,Yt=x(t,"FORBID_CONTENTS")?E({},t.FORBID_CONTENTS,re):$t,jt=x(t,"FORBID_TAGS")?E({},t.FORBID_TAGS,re):{},Tt=x(t,"FORBID_ATTR")?E({},t.FORBID_ATTR,re):{},zt=!!x(t,"USE_PROFILES")&&t.USE_PROFILES,Ct=!1!==t.ALLOW_ARIA_ATTR,Dt=!1!==t.ALLOW_DATA_ATTR,Ut=t.ALLOW_UNKNOWN_PROTOCOLS||!1,At=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,It=t.SAFE_FOR_TEMPLATES||!1,Ot=!1!==t.SAFE_FOR_XML,Rt=t.WHOLE_DOCUMENT||!1,Pt=t.RETURN_DOM||!1,Gt=t.RETURN_DOM_FRAGMENT||!1,Ft=t.RETURN_TRUSTED_TYPE||!1,Mt=t.FORCE_BODY||!1,Ht=!1!==t.SANITIZE_DOM,Bt=t.SANITIZE_NAMED_PROPS||!1,Wt=!1!==t.KEEP_CONTENT,Kt=t.IN_PLACE||!1,St=t.ALLOWED_URI_REGEXP||K,ee=t.NAMESPACE||te,wt=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&ce(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(wt.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&ce(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(wt.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(wt.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),It&&(Dt=!1),Gt&&(Pt=!0),zt&&(yt=E({},O),Et=[],!0===zt.html&&(E(yt,T),E(Et,R)),!0===zt.svg&&(E(yt,C),E(Et,L),E(Et,P)),!0===zt.svgFilters&&(E(yt,D),E(Et,L),E(Et,P)),!0===zt.mathMl&&(E(yt,A),E(Et,M),E(Et,P))),t.ADD_TAGS&&(yt===vt&&(yt=w(yt)),E(yt,t.ADD_TAGS,re)),t.ADD_ATTR&&(Et===Nt&&(Et=w(Et)),E(Et,t.ADD_ATTR,re)),t.ADD_URI_SAFE_ATTR&&E(Vt,t.ADD_URI_SAFE_ATTR,re),t.FORBID_CONTENTS&&(Yt===$t&&(Yt=w(Yt)),E(Yt,t.FORBID_CONTENTS,re)),Wt&&(yt["#text"]=!0),Rt&&E(yt,["html","head","body"]),yt.table&&(E(yt,["tbody"]),delete jt.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');ot=t.TRUSTED_TYPES_POLICY,st=ot.createHTML("")}else void 0===ot&&(ot=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let n=null;const i="data-tt-policy-suffix";e&&e.hasAttribute(i)&&(n=e.getAttribute(i));const a="dompurify"+(n?"#"+n:"");try{return t.createPolicy(a,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn("TrustedTypes policy "+a+" could not be created."),null}}(W,l)),null!==ot&&"string"==typeof st&&(st=ot.createHTML(""));o&&o(t),le=t}},ue=E({},["mi","mo","mn","ms","mtext"]),de=E({},["foreignobject","annotation-xml"]),pe=E({},["title","style","font","a","script"]),he=E({},[...C,...D,...U]),ke=E({},[...A,...I]),fe=function(t){u(i.removed,{element:t});try{at(t).removeChild(t)}catch(e){J(t)}},_e=function(t,e){try{u(i.removed,{attribute:e.getAttributeNode(t),from:e})}catch(t){u(i.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t&&!Et[t])if(Pt||Gt)try{fe(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},xe=function(t){let e=null,n=null;if(Mt)t=""+t;else{const e=h(t,/^[\r\n\t ]+/);n=e&&e[0]}"application/xhtml+xml"===oe&&ee===te&&(t=''+t+"");const i=ot?ot.createHTML(t):t;if(ee===te)try{e=(new B).parseFromString(i,oe)}catch(t){}if(!e||!e.documentElement){e=rt.createDocument(ee,"template",null);try{e.documentElement.innerHTML=ne?st:i}catch(t){}}const o=e.body||e.documentElement;return t&&n&&o.insertBefore(a.createTextNode(n),o.childNodes[0]||null),ee===te?ct.call(e,Rt?"html":"body")[0]:Rt?e.documentElement:o},be=function(t){return lt.call(t.ownerDocument||t,t,G.SHOW_ELEMENT|G.SHOW_COMMENT|G.SHOW_TEXT|G.SHOW_PROCESSING_INSTRUCTION|G.SHOW_CDATA_SECTION,null)},Se=function(t){return t instanceof H&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||!(t.attributes instanceof F)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes)},ye=function(t){return"function"==typeof v&&t instanceof v},ve=function(t,e,n){ut[t]&&c(ut[t],(t=>{t.call(i,e,n,le)}))},Ee=function(t){let e=null;if(ve("beforeSanitizeElements",t,null),Se(t))return fe(t),!0;const n=re(t.nodeName);if(ve("uponSanitizeElement",t,{tagName:n,allowedTags:yt}),t.hasChildNodes()&&!ye(t.firstElementChild)&&b(/<[/\w]/g,t.innerHTML)&&b(/<[/\w]/g,t.textContent))return fe(t),!0;if(t.nodeType===Z)return fe(t),!0;if(Ot&&t.nodeType===Q&&b(/<[/\w]/g,t.data))return fe(t),!0;if(!yt[n]||jt[n]){if(!jt[n]&&we(n)){if(wt.tagNameCheck instanceof RegExp&&b(wt.tagNameCheck,n))return!1;if(wt.tagNameCheck instanceof Function&&wt.tagNameCheck(n))return!1}if(Wt&&!Yt[n]){const e=at(t)||t.parentNode,n=it(t)||t.childNodes;if(n&&e)for(let i=n.length-1;i>=0;--i){const a=Y(n[i],!0);a.__removalCount=(t.__removalCount||0)+1,e.insertBefore(a,nt(t))}}return fe(t),!0}return t instanceof N&&!function(t){let e=at(t);e&&e.tagName||(e={namespaceURI:ee,tagName:"template"});const n=d(t.tagName),i=d(e.tagName);return!!ie[t.namespaceURI]&&(t.namespaceURI===Qt?e.namespaceURI===te?"svg"===n:e.namespaceURI===Zt?"svg"===n&&("annotation-xml"===i||ue[i]):Boolean(he[n]):t.namespaceURI===Zt?e.namespaceURI===te?"math"===n:e.namespaceURI===Qt?"math"===n&&de[i]:Boolean(ke[n]):t.namespaceURI===te?!(e.namespaceURI===Qt&&!de[i])&&!(e.namespaceURI===Zt&&!ue[i])&&!ke[n]&&(pe[n]||!he[n]):!("application/xhtml+xml"!==oe||!ie[t.namespaceURI]))}(t)?(fe(t),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!b(/<\/no(script|embed|frames)/i,t.innerHTML)?(It&&t.nodeType===X&&(e=t.textContent,c([dt,pt,ht],(t=>{e=k(e,t," ")})),t.textContent!==e&&(u(i.removed,{element:t.cloneNode()}),t.textContent=e)),ve("afterSanitizeElements",t,null),!1):(fe(t),!0)},Ne=function(t,e,n){if(Ht&&("id"===e||"name"===e)&&(n in a||n in me))return!1;if(Dt&&!Tt[e]&&b(kt,e));else if(Ct&&b(ft,e));else if(!Et[e]||Tt[e]){if(!(we(t)&&(wt.tagNameCheck instanceof RegExp&&b(wt.tagNameCheck,t)||wt.tagNameCheck instanceof Function&&wt.tagNameCheck(t))&&(wt.attributeNameCheck instanceof RegExp&&b(wt.attributeNameCheck,e)||wt.attributeNameCheck instanceof Function&&wt.attributeNameCheck(e))||"is"===e&&wt.allowCustomizedBuiltInElements&&(wt.tagNameCheck instanceof RegExp&&b(wt.tagNameCheck,n)||wt.tagNameCheck instanceof Function&&wt.tagNameCheck(n))))return!1}else if(Vt[e]);else if(b(St,k(n,xt,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==f(n,"data:")||!Jt[t])if(Ut&&!b(_t,k(n,xt,"")));else if(n)return!1;return!0},we=function(t){return"annotation-xml"!==t&&h(t,bt)},je=function(t){ve("beforeSanitizeAttributes",t,null);const{attributes:e}=t;if(!e)return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Et};let a=e.length;for(;a--;){const o=e[a],{name:s,namespaceURI:r,value:l}=o,m=re(s);let u="value"===s?l:_(l);if(n.attrName=m,n.attrValue=u,n.keepAttr=!0,n.forceKeepAttr=void 0,ve("uponSanitizeAttribute",t,n),u=n.attrValue,Ot&&b(/((--!?|])>)|<\/(style|title)/i,u)){_e(s,t);continue}if(n.forceKeepAttr)continue;if(_e(s,t),!n.keepAttr)continue;if(!At&&b(/\/>/i,u)){_e(s,t);continue}It&&c([dt,pt,ht],(t=>{u=k(u,t," ")}));const d=re(t.nodeName);if(Ne(d,m,u)){if(!Bt||"id"!==m&&"name"!==m||(_e(s,t),u="user-content-"+u),ot&&"object"==typeof W&&"function"==typeof W.getAttributeType)if(r);else switch(W.getAttributeType(d,m)){case"TrustedHTML":u=ot.createHTML(u);break;case"TrustedScriptURL":u=ot.createScriptURL(u)}try{r?t.setAttributeNS(r,s,u):t.setAttribute(s,u),Se(t)?fe(t):g(i.removed)}catch(t){}}}ve("afterSanitizeAttributes",t,null)},Te=function t(e){let n=null;const i=be(e);for(ve("beforeSanitizeShadowDOM",e,null);n=i.nextNode();)ve("uponSanitizeShadowNode",n,null),Ee(n)||(n.content instanceof m&&t(n.content),je(n));ve("afterSanitizeShadowDOM",e,null)};return i.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,a=null,o=null,r=null;if(ne=!t,ne&&(t="\x3c!--\x3e"),"string"!=typeof t&&!ye(t)){if("function"!=typeof t.toString)throw S("toString is not a function");if("string"!=typeof(t=t.toString()))throw S("dirty is not a string, aborting")}if(!i.isSupported)return t;if(Lt||ge(e),i.removed=[],"string"==typeof t&&(Kt=!1),Kt){if(t.nodeName){const e=re(t.nodeName);if(!yt[e]||jt[e])throw S("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof v)n=xe("\x3c!----\x3e"),a=n.ownerDocument.importNode(t,!0),a.nodeType===V&&"BODY"===a.nodeName||"HTML"===a.nodeName?n=a:n.appendChild(a);else{if(!Pt&&!It&&!Rt&&-1===t.indexOf("<"))return ot&&Ft?ot.createHTML(t):t;if(n=xe(t),!n)return Pt?null:Ft?st:""}n&&Mt&&fe(n.firstChild);const l=be(Kt?t:n);for(;o=l.nextNode();)Ee(o)||(o.content instanceof m&&Te(o.content),je(o));if(Kt)return t;if(Pt){if(Gt)for(r=mt.call(n.ownerDocument);n.firstChild;)r.appendChild(n.firstChild);else r=n;return(Et.shadowroot||Et.shadowrootmode)&&(r=gt.call(s,r,!0)),r}let g=Rt?n.outerHTML:n.innerHTML;return Rt&&yt["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&b($,n.ownerDocument.doctype.name)&&(g="\n"+g),It&&c([dt,pt,ht],(t=>{g=k(g,t," ")})),ot&&Ft?ot.createHTML(g):g},i.setConfig=function(){ge(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Lt=!0},i.clearConfig=function(){le=null,Lt=!1},i.isValidAttribute=function(t,e,n){le||ge({});const i=re(t),a=re(e);return Ne(i,a,n)},i.addHook=function(t,e){"function"==typeof e&&(ut[t]=ut[t]||[],u(ut[t],e))},i.removeHook=function(t){if(ut[t])return g(ut[t])},i.removeHooks=function(t){ut[t]&&(ut[t]=[])},i.removeAllHooks=function(){ut={}},i}()}()},942:(t,e)=>{var n;!function(){"use strict";var i={}.hasOwnProperty;function a(){for(var t="",e=0;e{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";const t=window.wp.i18n,e=window.wp.element,i=window.wp.components,a=window.lodash,o=window.wp.apiFetch;var s=n.n(o);s().use(s().createNonceMiddleware(window.gtmkitSettings.nonce)),s().use(s().createRootURLMiddleware(window.gtmkitSettings.root));const r=async(t,e,n=null,i=!1)=>{let a={};try{a=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===i?a:!0===a.success?a.data:options},l=(e,n)=>{const i={...e};switch(n.type){case"FETCH_SETTINGS":i.fetchedSettings={...n.payload.fetchedSettings,integrations:n.payload.fetchedSettings.integrations||{}},i.stateSettings=n.payload.stateSettings,i.siteData=n.payload.siteData,i.notifications=n.payload.notifications,i.installData=n.payload.installData,i.isPending=!1,i.canSave=!1,n.payload.fetchedSettings.gtm_kit_api_fetch_settings_errors&&(i.notice=(0,t.__)("An error occurred.","gtm-kit"),i.hasError=!0);break;case"UPDATE_SETTINGS_BEFORE":i.isPending=n.payload.isPending;break;case"UPDATE_SETTINGS":i.fetchedSettings=n.payload.fetchedSettings,i.stateSettings=n.payload.stateSettings,i.isPending=!1,i.canSave=!!n.payload.fetchedSettings.gtm_kit_api_update_settings_errors,i.notice=n.payload.fetchedSettings.gtm_kit_api_update_settings_errors?(0,t.__)("An error occurred.","gtm-kit"):(0,t.__)("Saved Successfully.","gtm-kit"),i.hasError=!!n.payload.fetchedSettings.gtm_kit_api_update_settings_errors;break;case"UPDATE_STATE":i.fetchedSettings=n.payload.fetchedSettings||i.fetchedSettings,i.stateSettings=n.payload.stateSettings||i.stateSettings,i.isPending=n.payload.isPending||i.isPending,i.notice=n.payload.notice||i.notice,i.hasError=n.payload.hasError||i.hasError,i.canSave=n.payload.canSave||i.canSave,i.isSendingSystemData=n.payload.isSendingSystemData||i.isSendingSystemData,i.supportTicket=n.payload.supportTicket||i.supportTicket,i.isSendingLicenseKey=n.payload.isSendingLicenseKey||i.isSendingLicenseKey,i.licenseKey=n.payload.licenseKey||i.licenseKey;break;case"SEND_SUPPORT_DATA_BEFORE":i.isSendingSystemData=n.payload.isSendingSystemData||i.isSendingSystemData;break;case"SEND_SUPPORT_DATA":i.isSendingSystemData=!1,i.isSystemDataSent=n.payload.isSystemDataSent||i.isSystemDataSent,i.systemDataMessage=n.payload.systemDataMessage||i.systemDataMessage;break;case"SEND_LICENSE_KEY_BEFORE":i.isSendingLicenseKey=n.payload.isSendingLicenseKey||i.isSendingLicenseKey;break;case"SEND_LICENSE_KEY":i.isSendingLicenseKey=!1,i.isLicenseKeySent=n.payload.isLicenseKeySent||i.isLicenseKeySent,i.licenseKeyMessage=n.payload.licenseKeyMessage||i.licenseKeyMessage;break;case"SEND_NOTIFICATION_STATUS_BEFORE":i.isUpdatingNotifications=n.payload.isUpdatingNotifications||i.isUpdatingNotifications;break;case"SEND_NOTIFICATION_STATUS":i.isUpdatingNotifications=!1,i.isNotificationStatusSent=n.payload.isNotificationStatusSent||i.isNotificationStatusSent,i.notifications=n.payload.notifications||i.Notifications}return i},m=window.ReactJSXRuntime,c=(0,e.createContext)(),g=t=>{const[n,i]=(0,e.useReducer)(l,{fetchedSettings:{},stateSettings:{},isPending:!0,notice:"",hasError:!1,canSave:!1,supportTicket:"",isSystemDataSent:!1,systemDataMessage:"",licenseKey:"",isLicensenKeySent:!1,licenseKeyMessage:"",notifications:{}}),o=async()=>{const t=window.gtmkitSettings.settings?window.gtmkitSettings.settings:{},e=window.gtmkitSettings.site_data?window.gtmkitSettings.site_data:{},n=window.gtmkitSettings.notifications?window.gtmkitSettings.notifications:{metrics:{total:1}},a="wizard"===window.gtmkitSettings.currentPage?window.gtmkitSettings.install_data:{};i({type:"FETCH_SETTINGS",payload:{fetchedSettings:t,stateSettings:t,siteData:e,notifications:n,installData:a}})},s=async t=>{i({type:"UPDATE_STATE",payload:t})};(0,e.useEffect)((()=>{o()}),[]);const g={useDispatch:t=>{i(t)},useUpdateSettings:async()=>{i({type:"UPDATE_SETTINGS_BEFORE",payload:{isPending:!0}});const t=await(e=n.stateSettings,r("gtmkit/v1/set-options","POST",e));var e;i({type:"UPDATE_SETTINGS",payload:{fetchedSettings:t,stateSettings:t}})},useFetchSettings:o,useUpdateState:s,useUpdateStateSettings:async(t,e,i)=>{const o=JSON.parse(JSON.stringify(n.stateSettings));let r;o[t][e]=i,r=!(0,a.isEqual)(o,n.fetchedSettings),s({stateSettings:o,canSave:r})},useImportSettings:async(t,e)=>{const i=JSON.parse(JSON.stringify(n.stateSettings));let o;const r={};r.general={...i.general,...e.general},"integrations"in e&&(r.integrations={...i.integrations,...e.integrations}),o=!(0,a.isEqual)(r,n.fetchedSettings),s({stateSettings:r,canSave:o})},useUpdateSupportTicket:async t=>{s({supportTicket:t})},useSendSystemData:async()=>{i({type:"SEND_SUPPORT_DATA_BEFORE",payload:{isSendingSystemData:!0}});const t=await(e=n.supportTicket,r("gtmkit/v1/send-support-data","POST",e,!0));var e;i({type:"SEND_SUPPORT_DATA",payload:{isSendingSystemData:!1,isSystemDataSent:t.success,systemDataMessage:t.data}})},useUpdateLicenseKey:async t=>{s({licenseKey:t})},useSendLicenseKey:async()=>{i({type:"SEND_LICENSE_KEY_BEFORE",payload:{isSendingLicenseKey:!0}});const t=await(e=n.licenseKey,r("gtmkit/v1/send-license-key","POST",e,!0));var e;i({type:"SEND_LICENSE_KEY",payload:{isSendingLicenseKey:!1,isLicenseKeySent:t.success,licenseKeyMessage:t.data}})},useSetNotificationStatus:async(t,e)=>{i({type:"SEND_NOTIFICATION_STATUS_BEFORE",payload:{isUpdatingNotifications:!0}});const n={"notification-id":t,action:e},a=await(t=>r("gtmkit/v1/set-notification-status","POST",t,!0))(n);i({type:"SEND_NOTIFICATION_STATUS",payload:{isUpdatingNotifications:!1,isNotificationStatusSent:a.success,notifications:a.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,useNotifications:n.notifications,useIsUpdatingNotifications:n.isUpdatingNotifications,useUserRoles:window.gtmkitSettings.user_roles?window.gtmkitSettings.user_roles:[],isPremium:!!window.gtmkitSettings.isPremium&&window.gtmkitSettings.isPremium};return(0,m.jsx)(c.Provider,{value:g,children:t.children})},u=window.React;var d,p=n.n(u);function h(){return h=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0&&(e.hash=t.substr(n),t=t.substr(0,n));let i=t.indexOf("?");i>=0&&(e.search=t.substr(i),t=t.substr(0,i)),t&&(e.pathname=t)}return e}var v;function E(t,e,n){return void 0===n&&(n="/"),function(t,e,n,i){let a=P(("string"==typeof e?y(e):e).pathname||"/",n);if(null==a)return null;let o=N(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)))))}(o);let s=null;for(let t=0;null==s&&t{let s={relativePath:void 0===o?t.path||"":o,caseSensitive:!0===t.caseSensitive,childrenIndex:a,route:t};s.relativePath.startsWith("/")&&(f(s.relativePath.startsWith(i),'Absolute route path "'+s.relativePath+'" nested under path "'+i+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),s.relativePath=s.relativePath.slice(i.length));let r=B([i,s.relativePath]),l=n.concat(s);t.children&&t.children.length>0&&(f(!0!==t.index,'Index routes must not have child routes. Please remove all child routes from route path "'+r+'".'),N(t.children,e,l,r)),(null!=t.path||t.index)&&e.push({path:r,score:O(r,t.index),routesMeta:l})};return t.forEach(((t,e)=>{var n;if(""!==t.path&&null!=(n=t.path)&&n.includes("?"))for(let n of w(t.path))a(t,e,n);else a(t,e)})),e}function w(t){let e=t.split("/");if(0===e.length)return[];let[n,...i]=e,a=n.endsWith("?"),o=n.replace(/\?$/,"");if(0===i.length)return a?[o,""]:[o];let s=w(i.join("/")),r=[];return r.push(...s.map((t=>""===t?o:[o,t].join("/")))),a&&r.push(...s),r.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 j=/^:[\w-]+$/,T=3,C=2,D=1,U=10,A=-2,I=t=>"*"===t;function O(t,e){let n=t.split("/"),i=n.length;return n.some(I)&&(i+=A),e&&(i+=C),n.filter((t=>!I(t))).reduce(((t,e)=>t+(j.test(e)?T:""===e?D:U)),i)}function R(t,e,n){void 0===n&&(n=!1);let{routesMeta:i}=t,a={},o="/",s=[];for(let t=0;t(i.push({paramName:e,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")));return t.endsWith("*")?(i.push({paramName:"*"}),a+="*"===t||"/*"===t?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":""!==t&&"/"!==t&&(a+="(?:(?=\\/|$))"),[new RegExp(a,e?void 0:"i"),i]}(t.path,t.caseSensitive,t.end),a=e.match(n);if(!a)return null;let o=a[0],s=o.replace(/(.)\/+$/,"$1"),r=a.slice(1);return{params:i.reduce(((t,e,n)=>{let{paramName:i,isOptional:a}=e;if("*"===i){let t=r[n]||"";s=o.slice(0,o.length-t.length).replace(/(.)\/+$/,"$1")}const l=r[n];return t[i]=a&&!l?void 0:(l||"").replace(/%2F/g,"/"),t}),{}),pathname:o,pathnameBase:s,pattern:t}}function M(t){try{return t.split("/").map((t=>decodeURIComponent(t).replace(/\//g,"%2F"))).join("/")}catch(e){return _(!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 P(t,e){if("/"===e)return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,i=t.charAt(n);return i&&"/"!==i?null:t.slice(n)||"/"}function G(t,e,n,i){return"Cannot include a '"+t+"' character in a manually specified `to."+e+"` field ["+JSON.stringify(i)+"]. 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 F(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(((t,e)=>e===n.length-1?t.pathname:t.pathnameBase)):n.map((t=>t.pathnameBase))}function H(t,e,n,i){let a;void 0===i&&(i=!1),"string"==typeof t?a=y(t):(a=h({},t),f(!a.pathname||!a.pathname.includes("?"),G("?","pathname","search",a)),f(!a.pathname||!a.pathname.includes("#"),G("#","pathname","hash",a)),f(!a.search||!a.search.includes("#"),G("#","search","hash",a)));let o,s=""===t||""===a.pathname,r=s?"/":a.pathname;if(null==r)o=n;else{let t=e.length-1;if(!i&&r.startsWith("..")){let e=r.split("/");for(;".."===e[0];)e.shift(),t-=1;a.pathname=e.join("/")}o=t>=0?e[t]:"/"}let l=function(t,e){void 0===e&&(e="/");let{pathname:n,search:i="",hash:a=""}="string"==typeof t?y(t):t,o=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:o,search:K(i),hash:z(a)}}(a,o),m=r&&"/"!==r&&r.endsWith("/"),c=(s||"."===r)&&n.endsWith("/");return l.pathname.endsWith("/")||!m&&!c||(l.pathname+="/"),l}const B=t=>t.join("/").replace(/\/\/+/g,"/"),W=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),K=t=>t&&"?"!==t?t.startsWith("?")?t:"?"+t:"",z=t=>t&&"#"!==t?t.startsWith("#")?t:"#"+t:"";Error;const Y=["post","put","patch","delete"],$=(new Set(Y),["get",...Y]);function J(){return J=Object.assign?Object.assign.bind():function(t){for(var e=1;e{n.current=!0})),u.useCallback((function(i,a){void 0===a&&(a={}),n.current&&("number"==typeof i?t.navigate(i):t.navigate(i,J({fromRouteId:e},a)))}),[t,e])}():function(){et()||f(!1);let t=u.useContext(q),{basename:e,future:n,navigator:i}=u.useContext(X),{matches:a}=u.useContext(Q),{pathname:o}=nt(),s=JSON.stringify(F(a,n.v7_relativeSplatPath)),r=u.useRef(!1);return it((()=>{r.current=!0})),u.useCallback((function(n,a){if(void 0===a&&(a={}),!r.current)return;if("number"==typeof n)return void i.go(n);let l=H(n,JSON.parse(s),o,"path"===a.relative);null==t&&"/"!==e&&(l.pathname="/"===l.pathname?e:B([e,l.pathname])),(a.replace?i.replace:i.push)(l,a.state,a)}),[e,i,s,o,t])}()}function ot(t,e){let{relative:n}=void 0===e?{}:e,{future:i}=u.useContext(X),{matches:a}=u.useContext(Q),{pathname:o}=nt(),s=JSON.stringify(F(a,i.v7_relativeSplatPath));return u.useMemo((()=>H(t,JSON.parse(s),o,"path"===n)),[t,s,o,n])}function st(t,e,n,i){et()||f(!1);let{navigator:a}=u.useContext(X),{matches:o}=u.useContext(Q),s=o[o.length-1],r=s?s.params:{},l=(s&&s.pathname,s?s.pathnameBase:"/");s&&s.route;let m,c=nt();if(e){var g;let t="string"==typeof e?y(e):e;"/"===l||(null==(g=t.pathname)?void 0:g.startsWith(l))||f(!1),m=t}else m=c;let p=m.pathname||"/",h=p;if("/"!==l){let t=l.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(t.length).join("/")}let k=E(t,{pathname:h}),_=function(t,e,n,i){var a;if(void 0===e&&(e=[]),void 0===n&&(n=null),void 0===i&&(i=null),null==t){var o;if(!n)return null;if(n.errors)t=n.matches;else{if(!(null!=(o=i)&&o.v7_partialHydration&&0===e.length&&!n.initialized&&n.matches.length>0))return null;t=n.matches}}let s=t,r=null==(a=n)?void 0:a.errors;if(null!=r){let t=s.findIndex((t=>t.route.id&&void 0!==(null==r?void 0:r[t.route.id])));t>=0||f(!1),s=s.slice(0,Math.min(s.length,t+1))}let l=!1,m=-1;if(n&&i&&i.v7_partialHydration)for(let t=0;t=0?s.slice(0,m+1):[s[0]];break}}}return s.reduceRight(((t,i,a)=>{let o,c=!1,g=null,d=null;var p;n&&(o=r&&i.route.id?r[i.route.id]:void 0,g=i.route.errorElement||lt,l&&(m<0&&0===a?(pt[p="route-fallback"]||(pt[p]=!0),c=!0,d=null):m===a&&(c=!0,d=i.route.hydrateFallbackElement||null)));let h=e.concat(s.slice(0,a+1)),k=()=>{let e;return e=o?g:c?d:i.route.Component?u.createElement(i.route.Component,null):i.route.element?i.route.element:t,u.createElement(ct,{match:i,routeContext:{outlet:t,matches:h,isDataRoute:null!=n},children:e})};return n&&(i.route.ErrorBoundary||i.route.errorElement||0===a)?u.createElement(mt,{location:n.location,revalidation:n.revalidation,component:g,error:o,children:k(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):k()}),null)}(k&&k.map((t=>Object.assign({},t,{params:Object.assign({},r,t.params),pathname:B([l,a.encodeLocation?a.encodeLocation(t.pathname).pathname:t.pathname]),pathnameBase:"/"===t.pathnameBase?l:B([l,a.encodeLocation?a.encodeLocation(t.pathnameBase).pathname:t.pathnameBase])}))),o,n,i);return e&&_?u.createElement(Z.Provider,{value:{location:J({pathname:"/",search:"",hash:"",state:null,key:"default"},m),navigationType:d.Pop}},_):_}function rt(){let t=function(){var t;let e=u.useContext(tt),n=function(){let t=u.useContext(V);return t||f(!1),t}(ut.UseRouteError),i=dt(ut.UseRouteError);return void 0!==e?e:null==(t=n.errors)?void 0:t[i]}(),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),n=t instanceof Error?t.stack:null,i={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),n?u.createElement("pre",{style:i},n):null,null)}const lt=u.createElement(rt,null);class mt 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:n,children:i}=t,a=u.useContext(q);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),u.createElement(Q.Provider,{value:e},i)}var gt=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(gt||{}),ut=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}(ut||{});function dt(t){let e=function(){let t=u.useContext(Q);return t||f(!1),t}(),n=e.matches[e.matches.length-1];return n.route.id||f(!1),n.route.id}const pt={};function ht(t){let{to:e,replace:n,state:i,relative:a}=t;et()||f(!1);let{future:o,static:s}=u.useContext(X),{matches:r}=u.useContext(Q),{pathname:l}=nt(),m=at(),c=H(e,F(r,o.v7_relativeSplatPath),l,"path"===a),g=JSON.stringify(c);return u.useEffect((()=>m(JSON.parse(g),{replace:n,state:i,relative:a})),[m,g,a,n,i]),null}function kt(t){f(!1)}function ft(t){let{basename:e="/",children:n=null,location:i,navigationType:a=d.Pop,navigator:o,static:s=!1,future:r}=t;et()&&f(!1);let l=e.replace(/^\/*/,"/"),m=u.useMemo((()=>({basename:l,navigator:o,static:s,future:J({v7_relativeSplatPath:!1},r)})),[l,r,o,s]);"string"==typeof i&&(i=y(i));let{pathname:c="/",search:g="",hash:p="",state:h=null,key:k="default"}=i,_=u.useMemo((()=>{let t=P(c,l);return null==t?null:{location:{pathname:t,search:g,hash:p,state:h,key:k},navigationType:a}}),[l,c,g,p,h,k,a]);return null==_?null:u.createElement(X.Provider,{value:m},u.createElement(Z.Provider,{children:n,value:_}))}function _t(t){let{children:e,location:n}=t;return st(xt(e),n)}function xt(t,e){void 0===e&&(e=[]);let n=[];return u.Children.forEach(t,((t,i)=>{if(!u.isValidElement(t))return;let a=[...e,i];if(t.type===u.Fragment)return void n.push.apply(n,xt(t.props.children,a));t.type!==kt&&f(!1),t.props.index&&t.props.children&&f(!1);let o={id:t.props.id||a.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&&(o.children=xt(t.props.children,a)),n.push(o)})),n}u.startTransition,new Promise((()=>{})),u.Component;const bt=window.ReactDOM;var St=n.n(bt);function yt(){return yt=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0||(a[n]=t[n]);return a}new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const Et=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],Nt=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"];try{window.__reactRouterVersion="6"}catch(t){}const wt=u.createContext({isTransitioning:!1});new Map;const jt=u.startTransition;function Tt(t){let{basename:e,children:n,future:i,window:a}=t,o=u.useRef();null==o.current&&(o.current=function(t){return void 0===t&&(t={}),function(t,e,n,i){void 0===i&&(i={});let{window:a=document.defaultView,v5Compat:o=!1}=i,s=a.history,r=d.Pop,l=null,m=c();function c(){return(s.state||{idx:null}).idx}function g(){r=d.Pop;let t=c(),e=null==t?null:t-m;m=t,l&&l({action:r,location:p.location,delta:e})}function u(t){let e="null"!==a.location.origin?a.location.origin:a.location.href,n="string"==typeof t?t:S(t);return n=n.replace(/ $/,"%20"),f(e,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,e)}null==m&&(m=0,s.replaceState(h({},s.state,{idx:m}),""));let p={get action(){return r},get location(){return t(a,s)},listen(t){if(l)throw new Error("A history only accepts one active listener");return a.addEventListener(k,g),l=t,()=>{a.removeEventListener(k,g),l=null}},createHref:t=>e(a,t),createURL:u,encodeLocation(t){let e=u(t);return{pathname:e.pathname,search:e.search,hash:e.hash}},push:function(t,e){r=d.Push;let i=b(p.location,t,e);n&&n(i,t),m=c()+1;let g=x(i,m),u=p.createHref(i);try{s.pushState(g,"",u)}catch(t){if(t instanceof DOMException&&"DataCloneError"===t.name)throw t;a.location.assign(u)}o&&l&&l({action:r,location:p.location,delta:1})},replace:function(t,e){r=d.Replace;let i=b(p.location,t,e);n&&n(i,t),m=c();let a=x(i,m),g=p.createHref(i);s.replaceState(a,"",g),o&&l&&l({action:r,location:p.location,delta:0})},go:t=>s.go(t)};return p}((function(t,e){let{pathname:n="/",search:i="",hash:a=""}=y(t.location.hash.substr(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),b("",{pathname:n,search:i,hash:a},e.state&&e.state.usr||null,e.state&&e.state.key||"default")}),(function(t,e){let n=t.document.querySelector("base"),i="";if(n&&n.getAttribute("href")){let e=t.location.href,n=e.indexOf("#");i=-1===n?e:e.slice(0,n)}return i+"#"+("string"==typeof e?e:S(e))}),(function(t,e){_("/"===t.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(e)+")")}),t)}({window:a,v5Compat:!0}));let s=o.current,[r,l]=u.useState({action:s.action,location:s.location}),{v7_startTransition:m}=i||{},c=u.useCallback((t=>{m&&jt?jt((()=>l(t))):l(t)}),[l,m]);return u.useLayoutEffect((()=>s.listen(c)),[s,c]),u.createElement(ft,{basename:e,children:n,location:r.location,navigationType:r.action,navigator:s,future:i})}bt.flushSync,u.useId;const Ct="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Dt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ut=u.forwardRef((function(t,e){let n,{onClick:i,relative:a,reloadDocument:o,replace:s,state:r,target:l,to:m,preventScrollReset:c,unstable_viewTransition:g}=t,d=vt(t,Et),{basename:p}=u.useContext(X),h=!1;if("string"==typeof m&&Dt.test(m)&&(n=m,Ct))try{let t=new URL(window.location.href),e=m.startsWith("//")?new URL(t.protocol+m):new URL(m),n=P(e.pathname,p);e.origin===t.origin&&null!=n?m=n+e.search+e.hash:h=!0}catch(t){}let k=function(t,e){let{relative:n}=void 0===e?{}:e;et()||f(!1);let{basename:i,navigator:a}=u.useContext(X),{hash:o,pathname:s,search:r}=ot(t,{relative:n}),l=s;return"/"!==i&&(l="/"===s?i:B([i,s])),a.createHref({pathname:l,search:r,hash:o})}(m,{relative:a}),_=function(t,e){let{target:n,replace:i,state:a,preventScrollReset:o,relative:s,unstable_viewTransition:r}=void 0===e?{}:e,l=at(),m=nt(),c=ot(t,{relative:s});return u.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,n)){e.preventDefault();let n=void 0!==i?i:S(m)===S(c);l(t,{replace:n,state:a,preventScrollReset:o,relative:s,unstable_viewTransition:r})}}),[m,l,c,i,a,n,t,o,s,r])}(m,{replace:s,state:r,target:l,preventScrollReset:c,relative:a,unstable_viewTransition:g});return u.createElement("a",yt({},d,{href:n||k,onClick:h||o?i:function(t){i&&i(t),t.defaultPrevented||_(t)},ref:e,target:l}))})),At=u.forwardRef((function(t,e){let{"aria-current":n="page",caseSensitive:i=!1,className:a="",end:o=!1,style:s,to:r,unstable_viewTransition:l,children:m}=t,c=vt(t,Nt),g=ot(r,{relative:c.relative}),d=nt(),p=u.useContext(V),{navigator:h,basename:k}=u.useContext(X),_=null!=p&&function(t,e){void 0===e&&(e={});let n=u.useContext(wt);null==n&&f(!1);let{basename:i}=function(){let t=u.useContext(q);return t||f(!1),t}(It.useViewTransitionState),a=ot(t,{relative:e.relative});if(!n.isTransitioning)return!1;let o=P(n.currentLocation.pathname,i)||n.currentLocation.pathname,s=P(n.nextLocation.pathname,i)||n.nextLocation.pathname;return null!=L(a.pathname,s)||null!=L(a.pathname,o)}(g)&&!0===l,x=h.encodeLocation?h.encodeLocation(g).pathname:g.pathname,b=d.pathname,S=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;i||(b=b.toLowerCase(),S=S?S.toLowerCase():null,x=x.toLowerCase()),S&&k&&(S=P(S,k)||S);const y="/"!==x&&x.endsWith("/")?x.length-1:x.length;let v,E=b===x||!o&&b.startsWith(x)&&"/"===b.charAt(y),N=null!=S&&(S===x||!o&&S.startsWith(x)&&"/"===S.charAt(x.length)),w={isActive:E,isPending:N,isTransitioning:_},j=E?n:void 0;v="function"==typeof a?a(w):[a,E?"active":null,N?"pending":null,_?"transitioning":null].filter(Boolean).join(" ");let T="function"==typeof s?s(w):s;return u.createElement(Ut,yt({},c,{"aria-current":j,className:v,ref:e,style:T,to:r,unstable_viewTransition:l}),"function"==typeof m?m(w):m)}));var It,Ot;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(It||(It={})),function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"}(Ot||(Ot={}));const Rt=({title:t})=>(0,u.createElement)(u.Fragment,null,(0,u.createElement)("header",{className:"gtmkit-px-8 gtmkit-py-6 gtmkit-sticky"},(0,u.createElement)("div",{className:"gtmkit-flex gtmkit-items-center gtmkit-justify-between"},(0,u.createElement)("h1",{className:"gtmkit-flex gtmkit-items-center gtmkit-font-medium gtmkit-text-3xl"},(0,u.createElement)("svg",{className:"gtmkit-mr-8",height:"44",viewBox:"0 0 160 54",width:"128",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)("rect",{fill:"#888",height:"54",rx:"4.265",width:"160"}),(0,u.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,u.createElement)("g",{fill:"#fff",transform:"matrix(1.465202 0 0 1.465202 -4.582436 -7.553126)"},(0,u.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,u.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))));var Lt=n(942),Mt=n.n(Lt);const Pt=({count:t,important:e,nav:n=!1})=>(0,m.jsx)(m.Fragment,{children:t>0&&(0,m.jsx)("span",{className:Mt()("gtmkit-ml-2 gtmkit-text-xs gtmkit-text-white gtmkit-font-bold gtmkit-rounded-full gtmkit-py-px gtmkit-leading-[1.125rem] gtmkit-uppercase",{"gtmkit-bg-color-error":e},{"gtmkit-bg-color-success":!e},{"gtmkit-px-1.5":n},{"gtmkit-px-2":!n}),children:t})}),Gt=({metrics:t})=>(0,m.jsx)(Pt,{count:t.total,important:t.problem>0,nav:!0}),Ft=Pt,Ht=({to:t,title:n})=>{const{useNotifications:i}=(0,e.useContext)(c);return i.metrics.total,(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)(At,{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 ":""),children:[n,"notifications"===t&&(0,m.jsx)(Gt,{metrics:i.metrics})]})})},Bt=({NavList:t})=>(0,u.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,u.createElement)(Ht,{key:t.to,to:t.to,title:t.title})})));function Wt(){return Wt=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0||(a[n]=t[n]);return a}function zt(t,e){return zt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},zt(t,e)}function Yt(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,zt(t,e)}function $t(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const Jt=p().createContext(null);var qt=function(t){return t.scrollTop},Vt="unmounted",Xt="exited",Zt="entering",Qt="entered",te="exiting",ee=function(t){function e(e,n){var i;i=t.call(this,e,n)||this;var a,o=n&&!n.isMounting?e.enter:e.appear;return i.appearStatus=null,e.in?o?(a=Xt,i.appearStatus=Zt):a=Qt:a=e.unmountOnExit||e.mountOnEnter?Vt:Xt,i.state={status:a},i.nextCallback=null,i}Yt(e,t),e.getDerivedStateFromProps=function(t,e){return t.in&&e.status===Vt?{status:Xt}:null};var n=e.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(t){var e=null;if(t!==this.props){var n=this.state.status;this.props.in?n!==Zt&&n!==Qt&&(e=Zt):n!==Zt&&n!==Qt||(e=te)}this.updateStatus(!1,e)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var t,e,n,i=this.props.timeout;return t=e=n=i,null!=i&&"number"!=typeof i&&(t=i.exit,e=i.enter,n=void 0!==i.appear?i.appear:e),{exit:t,enter:e,appear:n}},n.updateStatus=function(t,e){if(void 0===t&&(t=!1),null!==e)if(this.cancelNextCallback(),e===Zt){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:St().findDOMNode(this);n&&qt(n)}this.performEnter(t)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Xt&&this.setState({status:Vt})},n.performEnter=function(t){var e=this,n=this.props.enter,i=this.context?this.context.isMounting:t,a=this.props.nodeRef?[i]:[St().findDOMNode(this),i],o=a[0],s=a[1],r=this.getTimeouts(),l=i?r.appear:r.enter;t||n?(this.props.onEnter(o,s),this.safeSetState({status:Zt},(function(){e.props.onEntering(o,s),e.onTransitionEnd(l,(function(){e.safeSetState({status:Qt},(function(){e.props.onEntered(o,s)}))}))}))):this.safeSetState({status:Qt},(function(){e.props.onEntered(o)}))},n.performExit=function(){var t=this,e=this.props.exit,n=this.getTimeouts(),i=this.props.nodeRef?void 0:St().findDOMNode(this);e?(this.props.onExit(i),this.safeSetState({status:te},(function(){t.props.onExiting(i),t.onTransitionEnd(n.exit,(function(){t.safeSetState({status:Xt},(function(){t.props.onExited(i)}))}))}))):this.safeSetState({status:Xt},(function(){t.props.onExited(i)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(t,e){e=this.setNextCallback(e),this.setState(t,e)},n.setNextCallback=function(t){var e=this,n=!0;return this.nextCallback=function(i){n&&(n=!1,e.nextCallback=null,t(i))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(t,e){this.setNextCallback(e);var n=this.props.nodeRef?this.props.nodeRef.current:St().findDOMNode(this),i=null==t&&!this.props.addEndListener;if(n&&!i){if(this.props.addEndListener){var a=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],o=a[0],s=a[1];this.props.addEndListener(o,s)}null!=t&&setTimeout(this.nextCallback,t)}else setTimeout(this.nextCallback,0)},n.render=function(){var t=this.state.status;if(t===Vt)return null;var e=this.props,n=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,Kt(e,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return p().createElement(Jt.Provider,{value:null},"function"==typeof n?n(t,i):p().cloneElement(p().Children.only(n),i))},e}(p().Component);function ne(){}ee.contextType=Jt,ee.propTypes={},ee.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:ne,onEntering:ne,onEntered:ne,onExit:ne,onExiting:ne,onExited:ne},ee.UNMOUNTED=Vt,ee.EXITED=Xt,ee.ENTERING=Zt,ee.ENTERED=Qt,ee.EXITING=te;const ie=ee;var ae=function(t,e){return t&&e&&e.split(" ").forEach((function(e){return i=e,void((n=t).classList?n.classList.remove(i):"string"==typeof n.className?n.className=$t(n.className,i):n.setAttribute("class",$t(n.className&&n.className.baseVal||"",i)));var n,i}))},oe=function(t){function e(){for(var e,n=arguments.length,i=new Array(n),a=0;a{const{useUpdateSettings:o,useIsPending:s,useCanSave:r}=(0,e.useContext)(c);return(0,u.createElement)(i.Button,{className:a,onClick:()=>o(),variant:"primary",disabled:s||!r},r?(0,t.__)(n,"gtm-kit"):(0,t.__)("Saved","gtm-kit"),s?(0,u.createElement)(i.Spinner,null):"")},le=()=>{const{useCanSave:t}=(0,e.useContext)(c);return(0,u.createElement)(se,{in:t,timeout:500,classNames:"slide",unmountOnExit:!0},(0,u.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,u.createElement)(re,null)))},me=({subject:e})=>{const n=!0===e||"on"===e,i=!0===n?"gtmkit-bg-color-success":"gtmkit-bg-color-button-disabled";return(0,u.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,t.__)("Active","gtm-kit"):(0,t.__)("Inactive","gtm-kit"))},ce=(0,e.forwardRef)((({children:t,className:e="",...n},i)=>(0,u.createElement)("div",{...n,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 "+e,ref:i},t)));ce.Header=({as:t="h3",title:e="",children:n,className:i="",...a})=>(0,u.createElement)("div",{...a,className:"gtmkit-flex gtmkit-justify-between gtmkit-items-center gtmkit-mb-5 "+i},(0,u.createElement)(t,{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading"},e),n),ce.Content=({as:t="div",children:e,className:n="gtmkit-flex-auto",...i})=>(0,u.createElement)(t,{...i,className:n},e),ce.Button=({url:t,destination:e,newTab:n=!1,text:a,group:o="",...s})=>{const r=at();return(0,u.createElement)("div",{...s,className:"gtmkit-mt-4 gtmkit-mb-0.5"},(0,u.createElement)(i.Button,{variant:"primary",className:"gtmkit-rounded !gtmkit-py-4 !gtmkit-px-8 gtmkit-w-full sm:gtmkit-w-auto gtmkit-min-w-[225px]",onClick:()=>{e&&t&&!1===n?window.gtmkitSettings.current_poage===o?r(e,{replace:!0}):window.location.href=t+"#"+e:t?n?window.open(t):window.location.href=t:r(e,{replace:!0})}},(0,u.createElement)("span",{className:"gtmkit-mx-auto gtmkit-text-sm gtmkit-font-bold"},a)))};const ge=ce,ue=({title:n,data:i,className:a=""})=>{const{useSettings:o}=(0,e.useContext)(c);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8 gtmkit-mt-6"},n),(0,u.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] "+a},i.map(((e,n)=>!1===e.featured?null:(0,u.createElement)(ge,{key:n},(0,u.createElement)(ge.Header,{title:e.title},e.pill?(0,u.createElement)(me,{subject:o[e.group][e.option]}):null),(0,u.createElement)(ge.Content,null,e.text.map(((t,e)=>(0,u.createElement)("p",{key:e},t)))),(0,u.createElement)(ge.Button,{url:e.link.url,destination:e.link.destination,text:e.link.text?e.link.text:(0,t.__)("Read article","gtm-kit"),newTab:e.link.external,group:e.group}))))))},de=e=>((t,e,n)=>{const i=(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=>i(t[e][0],n))):Object.keys(t).map((e=>i(t[e],n)))})(window.gtmkitSettings[e],e,function(e){switch(e){case"integrations":return{pill:!0,group:"integrations",option:null,link:{internal:!0,text:(0,t.__)("Setup Integration","gtm-kit")}};case"templates":return{pill:!1,group:null,option:null,link:{internal:!0,text:(0,t.__)("Get Template","gtm-kit")}};default:return{pill:!1,group:null,option:null,link:{internal:!0,text:(0,t.__)("Read More","gtm-kit")}}}}(e)),pe=()=>{const{useSettings:n,useNotifications:i}=(0,e.useContext)(c),[a,o]=(0,e.useState)(window.gtmkitSettings.tutorials),s=(Boolean(n.general.sgtm_domain&&n.general.sgtm_domain.trim()),i.metrics);return(0,e.useEffect)((()=>{o((e=>[...e,{title:(0,t.__)("See all tutorials","gtm-kit"),text:[(0,t.__)("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,t.__)("Read articles","gtm-kit")},featured:!0}]))}),[]),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8",children:(0,t.__)("General","gtm-kit")}),(0,m.jsxs)("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]",children:[(0,m.jsxs)(ge,{children:[(0,m.jsx)(ge.Header,{title:"Google Tag Manager Container",children:(0,m.jsx)(me,{subject:n.general.gtm_id&&n.general.container_active})}),(0,m.jsx)(ge.Content,{children:n.general.gtm_id&&n.general.container_active?(0,m.jsxs)("p",{children:[(0,t.__)("Container ID:","gtm-kit")," ",n&&n.general.gtm_id]}):(0,m.jsx)("p",{children:(0,t.__)("The container is not active but the datalayer is generated.","gtm-kit")})}),(0,m.jsx)(ge.Button,{destination:"/container",text:(0,t.__)("Edit container","gtm-kit")})]}),(0,m.jsxs)(ge,{children:[(0,m.jsx)(ge.Header,{title:(0,t.__)("Notifications","gtm-kit"),className:"!gtmkit-justify-start",children:(0,m.jsx)(Ft,{count:s.total,important:s.problem>0})}),(0,m.jsx)(ge.Content,{children:s.total?(0,m.jsx)(m.Fragment,{children:s.problem?(0,m.jsx)("p",{children:(0,t.__)("There are some problems that require your attention.","gtm-kit")}):(0,m.jsx)("p",{children:(0,t.__)("There are some notifications that may require your attention.","gtm-kit")})}):(0,m.jsx)("p",{children:(0,t.__)("No notifications at the moment.","gtm-kit")})}),(0,m.jsx)(ge.Button,{destination:"/notifications",text:(0,t.__)("See all notifications","gtm-kit")})]}),(0,m.jsxs)(ge,{children:[(0,m.jsx)(ge.Header,{title:(0,t.__)("Help improve GTM Kit","gtm-kit"),children:(0,m.jsx)(me,{subject:n.general.analytics_active})}),(0,m.jsx)(ge.Content,{children:(0,m.jsx)("p",{children:(0,t.__)("Share anonymous data with the development team to help improve GTM Kit.","gtm-kit")})}),(0,m.jsx)(ge.Button,{destination:"/misc",text:(0,t.__)("Share anonymous data","gtm-kit")})]})]}),(0,m.jsx)(ue,{title:(0,t.__)("Tutorials","gtm-kit"),data:a}),(0,m.jsx)(ue,{title:(0,t.__)("Integrations","gtm-kit"),data:de("integrations")})]})},he=({title:t,placeholder:e,help:n,className:a="gtmkit-settings-field-wrap gtmkit-py-4 gtmkit-max-w-md",optionGroup:o="general",optionName:s,isDisabled:r,useSettings:l,useUpdateStateSettings:m})=>(0,u.createElement)(i.TextControl,{label:t,placeholder:e,help:n,className:a,value:l[o][s],onChange:t=>m(o,s,t),disabled:r}),ke=({title:t,label:e,optionGroup:n="general",optionName:a,disabled:o=!1,useSettings:s,useUpdateStateSettings:r})=>(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-py-4"},(0,u.createElement)(i.BaseControl,{label:t},(0,u.createElement)(i.ToggleControl,{label:e,checked:!o&&s[n][a],onChange:()=>{r(n,a,!(s&&s[n][a]))},disabled:o})))),fe=({title:t,options:e,help:n,className:a="gtmkit-settings-field-wrap gtmkit-py-4",optionGroup:o="general",optionName:s,disabled:r,useSettings:l,useUpdateStateSettings:m})=>(0,u.createElement)(i.RadioControl,{label:t,options:e,help:n,className:a,selected:parseInt(l[o][s]),onChange:t=>m(o,s,t),disabled:r}),_e=({title:t,help:n,items:a=[],optionGroup:o="general",optionName:s,disabled:r=!1,useSettings:l,useUpdateStateSettings:m})=>{const c=Array.isArray(l[o][s])?l[o][s]:[],[g,d]=(0,e.useState)(c);return(0,e.useEffect)((()=>{const t=Array.isArray(l[o][s])?l[o][s]:[];d(t)}),[l]),(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-py-4"},(0,u.createElement)(i.BaseControl,{label:t,help:n},a.map((t=>(0,u.createElement)(i.CheckboxControl,{key:t.role,label:t.name,disabled:r,checked:g.includes(t.role),onChange:e=>((t,e)=>{d((n=>{let i;return i=t?[...n,e]:n.filter((t=>t!==e)),m(o,s,i),i}))})(e,t.role)}))))))},xe=(0,e.forwardRef)((({children:t,className:e="",disabled:n=!1,...i},a)=>(0,m.jsx)("div",{...i,className:"gtmkit-mb-12 gtmkit-border gtmkit-bg-white gtmkit-max-w-screen-lg gtmkit-border-color-grey gtmkit-rounded "+e+(n?"gtmkit-opacity-60":""),ref:a,children:t})));xe.Header=({as:t="h3",title:e="",children:n,className:i="",...a})=>(0,m.jsxs)(t,{...a,className:"gtmkit-font-bold gtmkit-text-lg gtmkit-px-8 gtmkit-py-4 gtmkit-border-b gtmkit-border-color-grey gtmkit-flex gtmkit-items-center "+i,children:[e,n]}),xe.Content=({as:t="div",children:e,className:n="",...i})=>(0,m.jsx)(t,{...i,className:"gtmkit-px-8 gtmkit-py-6 "+n,children:e});const be=xe,Se=()=>{const{useSettings:n,useUpdateStateSettings:i,useUserRoles:a}=(0,e.useContext)(c),o=!(n.general.sgtm_domain&&n.general.sgtm_domain.trim()&&n.general.sgtm_container_identifier&&n.general.sgtm_container_identifier.trim()),s=nt();return(0,u.useEffect)((()=>{const t=new URLSearchParams(s.search).get("focus");if(t){const e=document.getElementById(t);e&&e.scrollIntoView()}}),[s]),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8",children:(0,t.__)("Google Tag Manager container","gtm-kit")}),(0,m.jsxs)(be,{children:[(0,m.jsx)(be.Header,{title:(0,t.__)("General Container Settings","gtm-kit")}),(0,m.jsxs)(be.Content,{children:[(0,m.jsx)("p",{className:"gtmkit-mb-4",children:(0,t.__)("To start collecting data with Google Tag manager you must register the Container ID of your Google Tag Manager container.","gtm-kit")}),(0,m.jsx)(he,{title:(0,t.__)("GTM Container ID:","gtm-kit"),optionName:"gtm_id",placeholder:(0,t.__)("Enter GTM Container ID","gtm-kit"),useSettings:n,useUpdateStateSettings:i}),(0,m.jsx)(ke,{title:(0,t.__)("Inject Container Code","gtm-kit"),label:(0,t.__)("Setting this to Off will remove the Google Tag Manager container code but the data layer will remain.","gtm-kit"),optionName:"container_active",useSettings:n,useUpdateStateSettings:i}),(0,m.jsx)(ke,{title:(0,t.__)("Just the container","gtm-kit"),label:(0,t.__)("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:n,useUpdateStateSettings:i}),(0,m.jsx)(he,{title:(0,t.__)("dataLayer variable name:","gtm-kit"),optionName:"datalayer_name",placeholder:"dataLayer",help:(0,t.__)("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:n,useUpdateStateSettings:i})]})]}),(0,m.jsx)("div",{id:"sgtm"}),(0,m.jsxs)(be,{children:[(0,m.jsx)(be.Header,{title:(0,t.__)("Server-side Tagging (sGTM)","gtm-kit")}),(0,m.jsxs)("div",{className:"gtmkit-grid gtmkit-grid-cols-2 gtmkit-gap-4",children:[(0,m.jsxs)(be.Content,{children:[(0,m.jsx)(he,{title:(0,t.__)("sGTM Container Domain:","gtm-kit"),optionName:"sgtm_domain",placeholder:(0,t.__)("Enter domain","gtm-kit"),help:(0,t.__)("Enter your custom domain name if you are using a custom server side GTM container for tracking.","gtm-kit"),useSettings:n,useUpdateStateSettings:i}),(0,m.jsx)(he,{title:(0,t.__)("sGTM container identifier:","gtm-kit"),optionName:"sgtm_container_identifier",placeholder:(0,t.__)("Enter loader name","gtm-kit"),help:(0,t.__)("Only use if you are using a custom loader.","gtm-kit"),useSettings:n,useUpdateStateSettings:i}),(0,m.jsx)(ke,{title:(0,t.__)("Cookie Keeper (for Stape users only)","gtm-kit"),label:(0,t.__)("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:o,useSettings:n,useUpdateStateSettings:i})]}),(0,m.jsx)("div",{className:"gtmkit-px-8 gtmkit-py-6",children:(0,m.jsxs)("div",{className:"gtmkit-border-2 gtmkit-px-4 gtmkit-mt-3",children:[(0,m.jsx)("h4",{className:"gtmkit-pt-3 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold",children:(0,t.__)("Google Tag Manager Server-side Tagging","gtm-kit")}),(0,m.jsxs)("p",{className:"gtmkit-mb-4",children:[(0,t.__)("Server-side tagging is a silver bullet that gives you improved data accuracy, performance, privacy, and flexibility.","gtm-kit")," ",(0,m.jsx)("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",children:(0,t.__)("Learn more","gtm-kit")})]}),(0,m.jsx)("h4",{className:"gtmkit-pt-4 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold",children:(0,t.__)("Hosting server-side GTM containers","gtm-kit")}),(0,m.jsx)("p",{className:"gtmkit-mb-4",children:(0,t.__)("Setting up server-side tracking can be challenging and costly but there is an easy and cheap solution.","gtm-kit")}),(0,m.jsxs)("p",{className:"gtmkit-mb-4",children:[(0,t.__)("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,t.__)("Additionally, it provides valuable add-ons for enhanced functionality.","gtm-kit")]}),(0,m.jsx)("p",{className:"gtmkit-mb-4",children:(0,m.jsx)("a",{href:"https://jump.gtmkit.com/link/1-AC1E5",className:"gtmkit-text-color-primary gtmkit-font-semibold hover:gtmkit-underline",target:"_blank",rel:"noreferrer",children:(0,t.__)("Learn more about Stape.io","gtm-kit")})})]})})]})]}),(0,m.jsxs)(be,{children:[(0,m.jsx)(be.Header,{title:(0,t.__)("Page Speed Optimization","gtm-kit")}),(0,m.jsxs)("div",{className:"gtmkit-grid gtmkit-grid-cols-2 gtmkit-gap-4",children:[(0,m.jsx)(be.Content,{children:(0,m.jsx)(ke,{title:(0,t.__)("load_delayed_js event","gtm-kit"),label:(0,t.__)("Setting this to On will push the event 'load_delayed_js' on page load.","gtm-kit"),optionName:"load_js_event",useSettings:n,useUpdateStateSettings:i})}),(0,m.jsx)("div",{className:"gtmkit-px-8 gtmkit-py-6",children:(0,m.jsxs)("div",{className:"gtmkit-border-2 gtmkit-px-4 gtmkit-mt-3",children:[(0,m.jsx)("h4",{className:"gtmkit-pt-3 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold",children:(0,t.__)("Delay JavaScript execution","gtm-kit")}),(0,m.jsxs)("p",{className:"gtmkit-mb-4",children:[(0,t.__)("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,m.jsx)("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",children:(0,t.__)("Learn more","gtm-kit")})]})]})})]})]}),(0,m.jsxs)(be,{children:[(0,m.jsx)(be.Header,{title:(0,t.__)("Google Tag Manager Environment","gtm-kit")}),(0,m.jsxs)("div",{className:"gtmkit-grid gtmkit-grid-cols-2 gtmkit-gap-4",children:[(0,m.jsxs)(be.Content,{children:[(0,m.jsx)(he,{title:(0,t.__)("gtm_auth:","gtm-kit"),optionName:"gtm_auth",placeholder:(0,t.__)("Enter gtm_auth code","gtm-kit"),help:(0,t.__)("Enter the gtm_auth code for your GTM environment.","gtm-kit"),useSettings:n,useUpdateStateSettings:i}),(0,m.jsx)(he,{title:(0,t.__)("gtm_preview:","gtm-kit"),optionName:"gtm_preview",placeholder:(0,t.__)("Enter gtm_preview code","gtm-kit"),help:(0,t.__)("Enter the gtm_preview code for your GTM environment.","gtm-kit"),useSettings:n,useUpdateStateSettings:i})]}),(0,m.jsx)("div",{className:"gtmkit-px-8 gtmkit-py-6",children:(0,m.jsxs)("div",{className:"gtmkit-border-2 gtmkit-px-4 gtmkit-mt-3",children:[(0,m.jsx)("h4",{className:"gtmkit-pt-3 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold",children:(0,t.__)("Environments","gtm-kit")}),(0,m.jsxs)("p",{className:"gtmkit-mb-4",children:[(0,t.__)("In Google Tag Manager you can define different environments like Live, Dev and QA.","gtm-kit")," ",(0,t.__)('To use a specific environment in GTM Kit you must enter the "gtm_auth" and "gtm_preview" codes for that environment.',"gtm-kit")," ",(0,t.__)("If left empty the default environment will be used.","gtm-kit")]}),(0,m.jsx)("h4",{className:"gtmkit-pt-4 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold",children:(0,t.__)("Override settings in wp-config.php","gtm-kit")}),(0,m.jsxs)("p",{className:"gtmkit-mb-4",children:[(0,t.__)("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,m.jsx)("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",children:(0,t.__)("Learn more","gtm-kit")})]})]})})]})]}),(0,m.jsxs)(be,{children:[(0,m.jsx)(be.Header,{title:(0,t.__)("Exclude User Roles","gtm-kit")}),(0,m.jsxs)("div",{className:"gtmkit-grid gtmkit-grid-cols-2 gtmkit-gap-4",children:[(0,m.jsx)(be.Content,{children:(0,m.jsx)(_e,{title:(0,t.__)("Exclude user roles","gtm-kit"),help:(0,t.__)("Select the roles that you want to exclude from tracking.","gtm-kit"),items:a,optionName:"exclude_user_roles",useSettings:n,useUpdateStateSettings:i})}),(0,m.jsx)("div",{className:"gtmkit-px-8 gtmkit-py-6",children:(0,m.jsxs)("div",{className:"gtmkit-border-2 gtmkit-px-4 gtmkit-mt-3",children:[(0,m.jsx)("h4",{className:"gtmkit-pt-3 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold gtmkit-text-red-600",children:(0,t.__)("Warning!","gtm-kit")}),(0,m.jsx)("p",{className:"gtmkit-mb-4",children:(0,t.__)("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,m.jsx)("p",{className:"gtmkit-mb-4",children:(0,t.__)("Please ensure thorough and proper testing of this.","gtm-kit")})]})})]})]}),(0,m.jsxs)(be,{children:[(0,m.jsx)(be.Header,{title:(0,t.__)("Container Code Implementation","gtm-kit")}),(0,m.jsxs)(be.Content,{children:[(0,m.jsx)(fe,{title:(0,t.__)("Container code implementation:","gtm-kit"),options:[{label:(0,t.__)("Standard implementation as recommended by Google (no delay)","gtm-kit"),value:0},{label:(0,t.__)("Load container when the browser is idle (requestIdleCallback)","gtm-kit"),value:1}],help:(0,t.__)("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:n,useUpdateStateSettings:i}),(0,m.jsx)(fe,{title:(0,t.__)("Container code noscript implementation:","gtm-kit"),options:[{label:(0,t.__)("Just after the opening tag","gtm-kit"),value:0},{label:(0,t.__)("Footer of the page (not recommended by Google)","gtm-kit"),value:1},{label:(0,t.__)("Custom (insert function in your template)","gtm-kit"),value:2},{label:(0,t.__)("Disable