| 5 | | */const Tt=typeof document<"u";function ba(t){return typeof t=="object"||"displayName"in t||"props"in t||"__vccOpts"in t}function hl(t){return t.__esModule||t[Symbol.toStringTag]==="Module"||t.default&&ba(t.default)}const ae=Object.assign;function vn(t,e){const s={};for(const n in e){const i=e[n];s[n]=We(i)?i.map(t):t(i)}return s}const is=()=>{},We=Array.isArray,ya=/#/g,fl=/&/g,pl=/\//g,gl=/=/g,ml=/\?/g,xa=/\+/g,_l=/%5B/g,vl=/%5D/g,wa=/%5E/g,bl=/%60/g,Sa=/%7B/g,yl=/%7C/g,ka=/%7D/g,xl=/%20/g;function ri(t){return encodeURI(""+t).replace(yl,"|").replace(_l,"[").replace(vl,"]")}function wl(t){return ri(t).replace(Sa,"{").replace(ka,"}").replace(wa,"^")}function zn(t){return ri(t).replace(xa,"%2B").replace(xl,"+").replace(ya,"%23").replace(fl,"%26").replace(bl,"`").replace(Sa,"{").replace(ka,"}").replace(wa,"^")}function Sl(t){return zn(t).replace(gl,"%3D")}function kl(t){return ri(t).replace(ya,"%23").replace(ml,"%3F")}function Cl(t){return t==null?"":kl(t).replace(pl,"%2F")}function fs(t){try{return decodeURIComponent(""+t)}catch{}return""+t}const Pl=/\/$/,Dl=t=>t.replace(Pl,"");function bn(t,e,s="/"){let n,i={},o="",a="";const r=e.indexOf("#");let l=e.indexOf("?");return r<l&&r>=0&&(l=-1),l>-1&&(n=e.slice(0,l),o=e.slice(l+1,r>-1?r:e.length),i=t(o)),r>-1&&(n=n||e.slice(0,r),a=e.slice(r,e.length)),n=Tl(n??e,s),{fullPath:n+(o&&"?")+o+a,path:n,query:i,hash:fs(a)}}function Rl(t,e){const s=e.query?t(e.query):"";return e.path+(s&&"?")+s+(e.hash||"")}function Ai(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function Ml(t,e,s){const n=e.matched.length-1,i=s.matched.length-1;return n>-1&&n===i&&$t(e.matched[n],s.matched[i])&&Ca(e.params,s.params)&&t(e.query)===t(s.query)&&e.hash===s.hash}function $t(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function Ca(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const s in t)if(!Al(t[s],e[s]))return!1;return!0}function Al(t,e){return We(t)?Ti(t,e):We(e)?Ti(e,t):t===e}function Ti(t,e){return We(e)?t.length===e.length&&t.every((s,n)=>s===e[n]):t.length===1&&t[0]===e}function Tl(t,e){if(t.startsWith("/"))return t;if(!t)return e;const s=e.split("/"),n=t.split("/"),i=n[n.length-1];(i===".."||i===".")&&n.push("");let o=s.length-1,a,r;for(a=0;a<n.length;a++)if(r=n[a],r!==".")if(r==="..")o>1&&o--;else break;return s.slice(0,o).join("/")+"/"+n.slice(a).join("/")}const rt={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var ps;(function(t){t.pop="pop",t.push="push"})(ps||(ps={}));var os;(function(t){t.back="back",t.forward="forward",t.unknown=""})(os||(os={}));function El(t){if(!t)if(Tt){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),Dl(t)}const Ll=/^[^#]+#/;function Ol(t,e){return t.replace(Ll,"#")+e}function Il(t,e){const s=document.documentElement.getBoundingClientRect(),n=t.getBoundingClientRect();return{behavior:e.behavior,left:n.left-s.left-(e.left||0),top:n.top-s.top-(e.top||0)}}const on=()=>({left:window.scrollX,top:window.scrollY});function Fl(t){let e;if("el"in t){const s=t.el,n=typeof s=="string"&&s.startsWith("#"),i=typeof s=="string"?n?document.getElementById(s.slice(1)):document.querySelector(s):s;if(!i)return;e=Il(i,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function Ei(t,e){return(history.state?history.state.position-e:-1)+t}const Bn=new Map;function Vl(t,e){Bn.set(t,e)}function $l(t){const e=Bn.get(t);return Bn.delete(t),e}let zl=()=>location.protocol+"//"+location.host;function Pa(t,e){const{pathname:s,search:n,hash:i}=e,o=t.indexOf("#");if(o>-1){let r=i.includes(t.slice(o))?t.slice(o).length:1,l=i.slice(r);return l[0]!=="/"&&(l="/"+l),Ai(l,"")}return Ai(s,t)+n+i}function Bl(t,e,s,n){let i=[],o=[],a=null;const r=({state:h})=>{const f=Pa(t,location),p=s.value,g=e.value;let m=0;if(h){if(s.value=f,e.value=h,a&&a===p){a=null;return}m=g?h.position-g.position:0}else n(f);i.forEach(y=>{y(s.value,p,{delta:m,type:ps.pop,direction:m?m>0?os.forward:os.back:os.unknown})})};function l(){a=s.value}function c(h){i.push(h);const f=()=>{const p=i.indexOf(h);p>-1&&i.splice(p,1)};return o.push(f),f}function u(){const{history:h}=window;h.state&&h.replaceState(ae({},h.state,{scroll:on()}),"")}function d(){for(const h of o)h();o=[],window.removeEventListener("popstate",r),window.removeEventListener("beforeunload",u)}return window.addEventListener("popstate",r),window.addEventListener("beforeunload",u,{passive:!0}),{pauseListeners:l,listen:c,destroy:d}}function Li(t,e,s,n=!1,i=!1){return{back:t,current:e,forward:s,replaced:n,position:window.history.length,scroll:i?on():null}}function Nl(t){const{history:e,location:s}=window,n={value:Pa(t,s)},i={value:e.state};i.value||o(n.value,{back:null,current:n.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function o(l,c,u){const d=t.indexOf("#"),h=d>-1?(s.host&&document.querySelector("base")?t:t.slice(d))+l:zl()+t+l;try{e[u?"replaceState":"pushState"](c,"",h),i.value=c}catch(f){console.error(f),s[u?"replace":"assign"](h)}}function a(l,c){const u=ae({},e.state,Li(i.value.back,l,i.value.forward,!0),c,{position:i.value.position});o(l,u,!0),n.value=l}function r(l,c){const u=ae({},i.value,e.state,{forward:l,scroll:on()});o(u.current,u,!0);const d=ae({},Li(n.value,l,null),{position:u.position+1},c);o(l,d,!1),n.value=l}return{location:n,state:i,push:r,replace:a}}function Ul(t){t=El(t);const e=Nl(t),s=Bl(t,e.state,e.location,e.replace);function n(o,a=!0){a||s.pauseListeners(),history.go(o)}const i=ae({location:"",base:t,go:n,createHref:Ol.bind(null,t)},e,s);return Object.defineProperty(i,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(i,"state",{enumerable:!0,get:()=>e.state.value}),i}function Hl(t){return t=location.host?t||location.pathname+location.search:"",t.includes("#")||(t+="#"),Ul(t)}function jl(t){return typeof t=="string"||t&&typeof t=="object"}function Da(t){return typeof t=="string"||typeof t=="symbol"}const Ra=Symbol("");var Oi;(function(t){t[t.aborted=4]="aborted",t[t.cancelled=8]="cancelled",t[t.duplicated=16]="duplicated"})(Oi||(Oi={}));function zt(t,e){return ae(new Error,{type:t,[Ra]:!0},e)}function Je(t,e){return t instanceof Error&&Ra in t&&(e==null||!!(t.type&e))}const Ii="[^/]+?",Wl={sensitive:!1,strict:!1,start:!0,end:!0},Gl=/[.+*?^${}()[\]/\\]/g;function ql(t,e){const s=ae({},Wl,e),n=[];let i=s.start?"^":"";const o=[];for(const c of t){const u=c.length?[]:[90];s.strict&&!c.length&&(i+="/");for(let d=0;d<c.length;d++){const h=c[d];let f=40+(s.sensitive?.25:0);if(h.type===0)d||(i+="/"),i+=h.value.replace(Gl,"\\$&"),f+=40;else if(h.type===1){const{value:p,repeatable:g,optional:m,regexp:y}=h;o.push({name:p,repeatable:g,optional:m});const b=y||Ii;if(b!==Ii){f+=10;try{new RegExp(`(${b})`)}catch(D){throw new Error(`Invalid custom RegExp for param "${p}" (${b}): `+D.message)}}let k=g?`((?:${b})(?:/(?:${b}))*)`:`(${b})`;d||(k=m&&c.length<2?`(?:/${k})`:"/"+k),m&&(k+="?"),i+=k,f+=20,m&&(f+=-8),g&&(f+=-20),b===".*"&&(f+=-50)}u.push(f)}n.push(u)}if(s.strict&&s.end){const c=n.length-1;n[c][n[c].length-1]+=.7000000000000001}s.strict||(i+="/?"),s.end?i+="$":s.strict&&!i.endsWith("/")&&(i+="(?:/|$)");const a=new RegExp(i,s.sensitive?"":"i");function r(c){const u=c.match(a),d={};if(!u)return null;for(let h=1;h<u.length;h++){const f=u[h]||"",p=o[h-1];d[p.name]=f&&p.repeatable?f.split("/"):f}return d}function l(c){let u="",d=!1;for(const h of t){(!d||!u.endsWith("/"))&&(u+="/"),d=!1;for(const f of h)if(f.type===0)u+=f.value;else if(f.type===1){const{value:p,repeatable:g,optional:m}=f,y=p in c?c[p]:"";if(We(y)&&!g)throw new Error(`Provided param "${p}" is an array but it is not repeatable (* or + modifiers)`);const b=We(y)?y.join("/"):y;if(!b)if(m)h.length<2&&(u.endsWith("/")?u=u.slice(0,-1):d=!0);else throw new Error(`Missing required param "${p}"`);u+=b}}return u||"/"}return{re:a,score:n,keys:o,parse:r,stringify:l}}function Yl(t,e){let s=0;for(;s<t.length&&s<e.length;){const n=e[s]-t[s];if(n)return n;s++}return t.length<e.length?t.length===1&&t[0]===80?-1:1:t.length>e.length?e.length===1&&e[0]===80?1:-1:0}function Ma(t,e){let s=0;const n=t.score,i=e.score;for(;s<n.length&&s<i.length;){const o=Yl(n[s],i[s]);if(o)return o;s++}if(Math.abs(i.length-n.length)===1){if(Fi(n))return 1;if(Fi(i))return-1}return i.length-n.length}function Fi(t){const e=t[t.length-1];return t.length>0&&e[e.length-1]<0}const Xl={type:0,value:""},Kl=/[a-zA-Z0-9_]/;function Ql(t){if(!t)return[[]];if(t==="/")return[[Xl]];if(!t.startsWith("/"))throw new Error(`Invalid path "${t}"`);function e(f){throw new Error(`ERR (${s})/"${c}": ${f}`)}let s=0,n=s;const i=[];let o;function a(){o&&i.push(o),o=[]}let r=0,l,c="",u="";function d(){c&&(s===0?o.push({type:0,value:c}):s===1||s===2||s===3?(o.length>1&&(l==="*"||l==="+")&&e(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),o.push({type:1,value:c,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):e("Invalid state to consume buffer"),c="")}function h(){c+=l}for(;r<t.length;){if(l=t[r++],l==="\\"&&s!==2){n=s,s=4;continue}switch(s){case 0:l==="/"?(c&&d(),a()):l===":"?(d(),s=1):h();break;case 4:h(),s=n;break;case 1:l==="("?s=2:Kl.test(l)?h():(d(),s=0,l!=="*"&&l!=="?"&&l!=="+"&&r--);break;case 2:l===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+l:s=3:u+=l;break;case 3:d(),s=0,l!=="*"&&l!=="?"&&l!=="+"&&r--,u="";break;default:e("Unknown state");break}}return s===2&&e(`Unfinished custom RegExp for param "${c}"`),d(),a(),i}function Zl(t,e,s){const n=ql(Ql(t.path),s),i=ae(n,{record:t,parent:e,children:[],alias:[]});return e&&!i.record.aliasOf==!e.record.aliasOf&&e.children.push(i),i}function Jl(t,e){const s=[],n=new Map;e=Bi({strict:!1,end:!0,sensitive:!1},e);function i(d){return n.get(d)}function o(d,h,f){const p=!f,g=$i(d);g.aliasOf=f&&f.record;const m=Bi(e,d),y=[g];if("alias"in d){const D=typeof d.alias=="string"?[d.alias]:d.alias;for(const C of D)y.push($i(ae({},g,{components:f?f.record.components:g.components,path:C,aliasOf:f?f.record:g})))}let b,k;for(const D of y){const{path:C}=D;if(h&&C[0]!=="/"){const O=h.record.path,A=O[O.length-1]==="/"?"":"/";D.path=h.record.path+(C&&A+C)}if(b=Zl(D,h,m),f?f.alias.push(b):(k=k||b,k!==b&&k.alias.push(b),p&&d.name&&!zi(b)&&a(d.name)),Aa(b)&&l(b),g.children){const O=g.children;for(let A=0;A<O.length;A++)o(O[A],b,f&&f.children[A])}f=f||b}return k?()=>{a(k)}:is}function a(d){if(Da(d)){const h=n.get(d);h&&(n.delete(d),s.splice(s.indexOf(h),1),h.children.forEach(a),h.alias.forEach(a))}else{const h=s.indexOf(d);h>-1&&(s.splice(h,1),d.record.name&&n.delete(d.record.name),d.children.forEach(a),d.alias.forEach(a))}}function r(){return s}function l(d){const h=sc(d,s);s.splice(h,0,d),d.record.name&&!zi(d)&&n.set(d.record.name,d)}function c(d,h){let f,p={},g,m;if("name"in d&&d.name){if(f=n.get(d.name),!f)throw zt(1,{location:d});m=f.record.name,p=ae(Vi(h.params,f.keys.filter(k=>!k.optional).concat(f.parent?f.parent.keys.filter(k=>k.optional):[]).map(k=>k.name)),d.params&&Vi(d.params,f.keys.map(k=>k.name))),g=f.stringify(p)}else if(d.path!=null)g=d.path,f=s.find(k=>k.re.test(g)),f&&(p=f.parse(g),m=f.record.name);else{if(f=h.name?n.get(h.name):s.find(k=>k.re.test(h.path)),!f)throw zt(1,{location:d,currentLocation:h});m=f.record.name,p=ae({},h.params,d.params),g=f.stringify(p)}const y=[];let b=f;for(;b;)y.unshift(b.record),b=b.parent;return{name:m,path:g,params:p,matched:y,meta:tc(y)}}t.forEach(d=>o(d));function u(){s.length=0,n.clear()}return{addRoute:o,resolve:c,removeRoute:a,clearRoutes:u,getRoutes:r,getRecordMatcher:i}}function Vi(t,e){const s={};for(const n of e)n in t&&(s[n]=t[n]);return s}function $i(t){const e={path:t.path,redirect:t.redirect,name:t.name,meta:t.meta||{},aliasOf:t.aliasOf,beforeEnter:t.beforeEnter,props:ec(t),children:t.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in t?t.components||null:t.component&&{default:t.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function ec(t){const e={},s=t.props||!1;if("component"in t)e.default=s;else for(const n in t.components)e[n]=typeof s=="object"?s[n]:s;return e}function zi(t){for(;t;){if(t.record.aliasOf)return!0;t=t.parent}return!1}function tc(t){return t.reduce((e,s)=>ae(e,s.meta),{})}function Bi(t,e){const s={};for(const n in t)s[n]=n in e?e[n]:t[n];return s}function sc(t,e){let s=0,n=e.length;for(;s!==n;){const o=s+n>>1;Ma(t,e[o])<0?n=o:s=o+1}const i=nc(t);return i&&(n=e.lastIndexOf(i,n-1)),n}function nc(t){let e=t;for(;e=e.parent;)if(Aa(e)&&Ma(t,e)===0)return e}function Aa({record:t}){return!!(t.name||t.components&&Object.keys(t.components).length||t.redirect)}function ic(t){const e={};if(t===""||t==="?")return e;const n=(t[0]==="?"?t.slice(1):t).split("&");for(let i=0;i<n.length;++i){const o=n[i].replace(xa," "),a=o.indexOf("="),r=fs(a<0?o:o.slice(0,a)),l=a<0?null:fs(o.slice(a+1));if(r in e){let c=e[r];We(c)||(c=e[r]=[c]),c.push(l)}else e[r]=l}return e}function Ni(t){let e="";for(let s in t){const n=t[s];if(s=Sl(s),n==null){n!==void 0&&(e+=(e.length?"&":"")+s);continue}(We(n)?n.map(o=>o&&zn(o)):[n&&zn(n)]).forEach(o=>{o!==void 0&&(e+=(e.length?"&":"")+s,o!=null&&(e+="="+o))})}return e}function oc(t){const e={};for(const s in t){const n=t[s];n!==void 0&&(e[s]=We(n)?n.map(i=>i==null?null:""+i):n==null?n:""+n)}return e}const ac=Symbol(""),Ui=Symbol(""),an=Symbol(""),li=Symbol(""),Nn=Symbol("");function Gt(){let t=[];function e(n){return t.push(n),()=>{const i=t.indexOf(n);i>-1&&t.splice(i,1)}}function s(){t=[]}return{add:e,list:()=>t.slice(),reset:s}}function ut(t,e,s,n,i,o=a=>a()){const a=n&&(n.enterCallbacks[i]=n.enterCallbacks[i]||[]);return()=>new Promise((r,l)=>{const c=h=>{h===!1?l(zt(4,{from:s,to:e})):h instanceof Error?l(h):jl(h)?l(zt(2,{from:e,to:h})):(a&&n.enterCallbacks[i]===a&&typeof h=="function"&&a.push(h),r())},u=o(()=>t.call(n&&n.instances[i],e,s,c));let d=Promise.resolve(u);t.length<3&&(d=d.then(c)),d.catch(h=>l(h))})}function yn(t,e,s,n,i=o=>o()){const o=[];for(const a of t)for(const r in a.components){let l=a.components[r];if(!(e!=="beforeRouteEnter"&&!a.instances[r]))if(ba(l)){const u=(l.__vccOpts||l)[e];u&&o.push(ut(u,s,n,a,r,i))}else{let c=l();o.push(()=>c.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${r}" at "${a.path}"`);const d=hl(u)?u.default:u;a.mods[r]=u,a.components[r]=d;const f=(d.__vccOpts||d)[e];return f&&ut(f,s,n,a,r,i)()}))}}return o}function Hi(t){const e=ft(an),s=ft(li),n=S(()=>{const l=L(t.to);return e.resolve(l)}),i=S(()=>{const{matched:l}=n.value,{length:c}=l,u=l[c-1],d=s.matched;if(!u||!d.length)return-1;const h=d.findIndex($t.bind(null,u));if(h>-1)return h;const f=ji(l[c-2]);return c>1&&ji(u)===f&&d[d.length-1].path!==f?d.findIndex($t.bind(null,l[c-2])):h}),o=S(()=>i.value>-1&&dc(s.params,n.value.params)),a=S(()=>i.value>-1&&i.value===s.matched.length-1&&Ca(s.params,n.value.params));function r(l={}){if(uc(l)){const c=e[L(t.replace)?"replace":"push"](L(t.to)).catch(is);return t.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:n,href:S(()=>n.value.href),isActive:o,isExactActive:a,navigate:r}}function rc(t){return t.length===1?t[0]:t}const lc=sn({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Hi,setup(t,{slots:e}){const s=ua(Hi(t)),{options:n}=ft(an),i=S(()=>({[Wi(t.activeClass,n.linkActiveClass,"router-link-active")]:s.isActive,[Wi(t.exactActiveClass,n.linkExactActiveClass,"router-link-exact-active")]:s.isExactActive}));return()=>{const o=e.default&&rc(e.default(s));return t.custom?o:hs("a",{"aria-current":s.isExactActive?t.ariaCurrentValue:null,href:s.href,onClick:s.navigate,class:i.value},o)}}}),cc=lc;function uc(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&!(t.button!==void 0&&t.button!==0)){if(t.currentTarget&&t.currentTarget.getAttribute){const e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function dc(t,e){for(const s in e){const n=e[s],i=t[s];if(typeof n=="string"){if(n!==i)return!1}else if(!We(i)||i.length!==n.length||n.some((o,a)=>o!==i[a]))return!1}return!0}function ji(t){return t?t.aliasOf?t.aliasOf.path:t.path:""}const Wi=(t,e,s)=>t??e??s,hc=sn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(t,{attrs:e,slots:s}){const n=ft(Nn),i=S(()=>t.route||n.value),o=ft(Ui,0),a=S(()=>{let c=L(o);const{matched:u}=i.value;let d;for(;(d=u[c])&&!d.components;)c++;return c}),r=S(()=>i.value.matched[a.value]);gn(Ui,S(()=>a.value+1)),gn(ac,r),gn(Nn,i);const l=ne();return Me(()=>[l.value,r.value,t.name],([c,u,d],[h,f,p])=>{u&&(u.instances[d]=c,f&&f!==u&&c&&c===h&&(u.leaveGuards.size||(u.leaveGuards=f.leaveGuards),u.updateGuards.size||(u.updateGuards=f.updateGuards))),c&&u&&(!f||!$t(u,f)||!h)&&(u.enterCallbacks[d]||[]).forEach(g=>g(c))},{flush:"post"}),()=>{const c=i.value,u=t.name,d=r.value,h=d&&d.components[u];if(!h)return Gi(s.default,{Component:h,route:c});const f=d.props[u],p=f?f===!0?c.params:typeof f=="function"?f(c):f:null,m=hs(h,ae({},p,e,{onVnodeUnmounted:y=>{y.component.isUnmounted&&(d.instances[u]=null)},ref:l}));return Gi(s.default,{Component:m,route:c})||m}}});function Gi(t,e){if(!t)return null;const s=t(e);return s.length===1?s[0]:s}const fc=hc;function pc(t){const e=Jl(t.routes,t),s=t.parseQuery||ic,n=t.stringifyQuery||Ni,i=t.history,o=Gt(),a=Gt(),r=Gt(),l=ti(rt);let c=rt;Tt&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=vn.bind(null,R=>""+R),d=vn.bind(null,Cl),h=vn.bind(null,fs);function f(R,V){let $,q;return Da(R)?($=e.getRecordMatcher(R),q=V):q=R,e.addRoute(q,$)}function p(R){const V=e.getRecordMatcher(R);V&&e.removeRoute(V)}function g(){return e.getRoutes().map(R=>R.record)}function m(R){return!!e.getRecordMatcher(R)}function y(R,V){if(V=ae({},V||l.value),typeof R=="string"){const K=bn(s,R,V.path),ve=e.resolve({path:K.path},V),Wt=i.createHref(K.fullPath);return ae(K,ve,{params:h(ve.params),hash:fs(K.hash),redirectedFrom:void 0,href:Wt})}let $;if(R.path!=null)$=ae({},R,{path:bn(s,R.path,V.path).path});else{const K=ae({},R.params);for(const ve in K)K[ve]==null&&delete K[ve];$=ae({},R,{params:d(K)}),V.params=d(V.params)}const q=e.resolve($,V),ue=R.hash||"";q.params=u(h(q.params));const _e=Rl(n,ae({},R,{hash:wl(ue),path:q.path})),te=i.createHref(_e);return ae({fullPath:_e,hash:ue,query:n===Ni?oc(R.query):R.query||{}},q,{redirectedFrom:void 0,href:te})}function b(R){return typeof R=="string"?bn(s,R,l.value.path):ae({},R)}function k(R,V){if(c!==R)return zt(8,{from:V,to:R})}function D(R){return A(R)}function C(R){return D(ae(b(R),{replace:!0}))}function O(R){const V=R.matched[R.matched.length-1];if(V&&V.redirect){const{redirect:$}=V;let q=typeof $=="function"?$(R):$;return typeof q=="string"&&(q=q.includes("?")||q.includes("#")?q=b(q):{path:q},q.params={}),ae({query:R.query,hash:R.hash,params:q.path!=null?{}:R.params},q)}}function A(R,V){const $=c=y(R),q=l.value,ue=R.state,_e=R.force,te=R.replace===!0,K=O($);if(K)return A(ae(b(K),{state:typeof K=="object"?ae({},ue,K.state):ue,force:_e,replace:te}),V||$);const ve=$;ve.redirectedFrom=V;let Wt;return!_e&&Ml(n,q,$)&&(Wt=zt(16,{to:ve,from:q}),Ze(q,q,!0,!1)),(Wt?Promise.resolve(Wt):W(ve,q)).catch(Te=>Je(Te)?Je(Te,2)?Te:Fe(Te):ye(Te,ve,q)).then(Te=>{if(Te){if(Je(Te,2))return A(ae({replace:te},b(Te.to),{state:typeof Te.to=="object"?ae({},ue,Te.to.state):ue,force:_e}),V||ve)}else Te=E(ve,q,!0,te,ue);return G(ve,q,Te),Te})}function I(R,V){const $=k(R,V);return $?Promise.reject($):Promise.resolve()}function z(R){const V=Ae.values().next().value;return V&&typeof V.runWithContext=="function"?V.runWithContext(R):R()}function W(R,V){let $;const[q,ue,_e]=gc(R,V);$=yn(q.reverse(),"beforeRouteLeave",R,V);for(const K of q)K.leaveGuards.forEach(ve=>{$.push(ut(ve,R,V))});const te=I.bind(null,R,V);return $.push(te),j($).then(()=>{$=[];for(const K of o.list())$.push(ut(K,R,V));return $.push(te),j($)}).then(()=>{$=yn(ue,"beforeRouteUpdate",R,V);for(const K of ue)K.updateGuards.forEach(ve=>{$.push(ut(ve,R,V))});return $.push(te),j($)}).then(()=>{$=[];for(const K of _e)if(K.beforeEnter)if(We(K.beforeEnter))for(const ve of K.beforeEnter)$.push(ut(ve,R,V));else $.push(ut(K.beforeEnter,R,V));return $.push(te),j($)}).then(()=>(R.matched.forEach(K=>K.enterCallbacks={}),$=yn(_e,"beforeRouteEnter",R,V,z),$.push(te),j($))).then(()=>{$=[];for(const K of a.list())$.push(ut(K,R,V));return $.push(te),j($)}).catch(K=>Je(K,8)?K:Promise.reject(K))}function G(R,V,$){r.list().forEach(q=>z(()=>q(R,V,$)))}function E(R,V,$,q,ue){const _e=k(R,V);if(_e)return _e;const te=V===rt,K=Tt?history.state:{};$&&(q||te?i.replace(R.fullPath,ae({scroll:te&&K&&K.scroll},ue)):i.push(R.fullPath,ue)),l.value=R,Ze(R,V,$,te),Fe()}let F;function he(){F||(F=i.listen((R,V,$)=>{if(!qe.listening)return;const q=y(R),ue=O(q);if(ue){A(ae(ue,{replace:!0,force:!0}),q).catch(is);return}c=q;const _e=l.value;Tt&&Vl(Ei(_e.fullPath,$.delta),on()),W(q,_e).catch(te=>Je(te,12)?te:Je(te,2)?(A(ae(b(te.to),{force:!0}),q).then(K=>{Je(K,20)&&!$.delta&&$.type===ps.pop&&i.go(-1,!1)}).catch(is),Promise.reject()):($.delta&&i.go(-$.delta,!1),ye(te,q,_e))).then(te=>{te=te||E(q,_e,!1),te&&($.delta&&!Je(te,8)?i.go(-$.delta,!1):$.type===ps.pop&&Je(te,20)&&i.go(-1,!1)),G(q,_e,te)}).catch(is)}))}let Y=Gt(),Q=Gt(),Z;function ye(R,V,$){Fe(R);const q=Q.list();return q.length?q.forEach(ue=>ue(R,V,$)):console.error(R),Promise.reject(R)}function ce(){return Z&&l.value!==rt?Promise.resolve():new Promise((R,V)=>{Y.add([R,V])})}function Fe(R){return Z||(Z=!R,he(),Y.list().forEach(([V,$])=>R?$(R):V()),Y.reset()),R}function Ze(R,V,$,q){const{scrollBehavior:ue}=t;if(!Tt||!ue)return Promise.resolve();const _e=!$&&$l(Ei(R.fullPath,0))||(q||!$)&&history.state&&history.state.scroll||null;return ca().then(()=>ue(R,V,_e)).then(te=>te&&Fl(te)).catch(te=>ye(te,R,V))}const $e=R=>i.go(R);let He;const Ae=new Set,qe={currentRoute:l,listening:!0,addRoute:f,removeRoute:p,clearRoutes:e.clearRoutes,hasRoute:m,getRoutes:g,resolve:y,options:t,push:D,replace:C,go:$e,back:()=>$e(-1),forward:()=>$e(1),beforeEach:o.add,beforeResolve:a.add,afterEach:r.add,onError:Q.add,isReady:ce,install(R){const V=this;R.component("RouterLink",cc),R.component("RouterView",fc),R.config.globalProperties.$router=V,Object.defineProperty(R.config.globalProperties,"$route",{enumerable:!0,get:()=>L(l)}),Tt&&!He&&l.value===rt&&(He=!0,D(i.location).catch(ue=>{}));const $={};for(const ue in rt)Object.defineProperty($,ue,{get:()=>l.value[ue],enumerable:!0});R.provide(an,V),R.provide(li,Vr($)),R.provide(Nn,l);const q=R.unmount;Ae.add(R),R.unmount=function(){Ae.delete(R),Ae.size<1&&(c=rt,F&&F(),F=null,l.value=rt,He=!1,Z=!1),q()}}};function j(R){return R.reduce((V,$)=>V.then(()=>z($)),Promise.resolve())}return qe}function gc(t,e){const s=[],n=[],i=[],o=Math.max(e.matched.length,t.matched.length);for(let a=0;a<o;a++){const r=e.matched[a];r&&(t.matched.find(c=>$t(c,r))?n.push(r):s.push(r));const l=t.matched[a];l&&(e.matched.find(c=>$t(c,l))||i.push(l))}return[s,n,i]}function rn(){return ft(an)}function Ve(t){return ft(li)}/*! |
| | 5 | */const Et=typeof document<"u";function ba(t){return typeof t=="object"||"displayName"in t||"props"in t||"__vccOpts"in t}function hl(t){return t.__esModule||t[Symbol.toStringTag]==="Module"||t.default&&ba(t.default)}const ae=Object.assign;function vn(t,e){const s={};for(const n in e){const i=e[n];s[n]=We(i)?i.map(t):t(i)}return s}const is=()=>{},We=Array.isArray,ya=/#/g,fl=/&/g,pl=/\//g,gl=/=/g,ml=/\?/g,xa=/\+/g,_l=/%5B/g,vl=/%5D/g,wa=/%5E/g,bl=/%60/g,Sa=/%7B/g,yl=/%7C/g,ka=/%7D/g,xl=/%20/g;function ri(t){return encodeURI(""+t).replace(yl,"|").replace(_l,"[").replace(vl,"]")}function wl(t){return ri(t).replace(Sa,"{").replace(ka,"}").replace(wa,"^")}function zn(t){return ri(t).replace(xa,"%2B").replace(xl,"+").replace(ya,"%23").replace(fl,"%26").replace(bl,"`").replace(Sa,"{").replace(ka,"}").replace(wa,"^")}function Sl(t){return zn(t).replace(gl,"%3D")}function kl(t){return ri(t).replace(ya,"%23").replace(ml,"%3F")}function Cl(t){return t==null?"":kl(t).replace(pl,"%2F")}function fs(t){try{return decodeURIComponent(""+t)}catch{}return""+t}const Pl=/\/$/,Dl=t=>t.replace(Pl,"");function bn(t,e,s="/"){let n,i={},o="",a="";const r=e.indexOf("#");let l=e.indexOf("?");return r<l&&r>=0&&(l=-1),l>-1&&(n=e.slice(0,l),o=e.slice(l+1,r>-1?r:e.length),i=t(o)),r>-1&&(n=n||e.slice(0,r),a=e.slice(r,e.length)),n=Tl(n??e,s),{fullPath:n+(o&&"?")+o+a,path:n,query:i,hash:fs(a)}}function Rl(t,e){const s=e.query?t(e.query):"";return e.path+(s&&"?")+s+(e.hash||"")}function Ai(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function Ml(t,e,s){const n=e.matched.length-1,i=s.matched.length-1;return n>-1&&n===i&&$t(e.matched[n],s.matched[i])&&Ca(e.params,s.params)&&t(e.query)===t(s.query)&&e.hash===s.hash}function $t(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function Ca(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const s in t)if(!Al(t[s],e[s]))return!1;return!0}function Al(t,e){return We(t)?Ti(t,e):We(e)?Ti(e,t):t===e}function Ti(t,e){return We(e)?t.length===e.length&&t.every((s,n)=>s===e[n]):t.length===1&&t[0]===e}function Tl(t,e){if(t.startsWith("/"))return t;if(!t)return e;const s=e.split("/"),n=t.split("/"),i=n[n.length-1];(i===".."||i===".")&&n.push("");let o=s.length-1,a,r;for(a=0;a<n.length;a++)if(r=n[a],r!==".")if(r==="..")o>1&&o--;else break;return s.slice(0,o).join("/")+"/"+n.slice(a).join("/")}const rt={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var ps;(function(t){t.pop="pop",t.push="push"})(ps||(ps={}));var os;(function(t){t.back="back",t.forward="forward",t.unknown=""})(os||(os={}));function El(t){if(!t)if(Et){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),Dl(t)}const Ll=/^[^#]+#/;function Ol(t,e){return t.replace(Ll,"#")+e}function Il(t,e){const s=document.documentElement.getBoundingClientRect(),n=t.getBoundingClientRect();return{behavior:e.behavior,left:n.left-s.left-(e.left||0),top:n.top-s.top-(e.top||0)}}const on=()=>({left:window.scrollX,top:window.scrollY});function Fl(t){let e;if("el"in t){const s=t.el,n=typeof s=="string"&&s.startsWith("#"),i=typeof s=="string"?n?document.getElementById(s.slice(1)):document.querySelector(s):s;if(!i)return;e=Il(i,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function Ei(t,e){return(history.state?history.state.position-e:-1)+t}const Bn=new Map;function Vl(t,e){Bn.set(t,e)}function $l(t){const e=Bn.get(t);return Bn.delete(t),e}let zl=()=>location.protocol+"//"+location.host;function Pa(t,e){const{pathname:s,search:n,hash:i}=e,o=t.indexOf("#");if(o>-1){let r=i.includes(t.slice(o))?t.slice(o).length:1,l=i.slice(r);return l[0]!=="/"&&(l="/"+l),Ai(l,"")}return Ai(s,t)+n+i}function Bl(t,e,s,n){let i=[],o=[],a=null;const r=({state:h})=>{const f=Pa(t,location),p=s.value,g=e.value;let m=0;if(h){if(s.value=f,e.value=h,a&&a===p){a=null;return}m=g?h.position-g.position:0}else n(f);i.forEach(y=>{y(s.value,p,{delta:m,type:ps.pop,direction:m?m>0?os.forward:os.back:os.unknown})})};function l(){a=s.value}function c(h){i.push(h);const f=()=>{const p=i.indexOf(h);p>-1&&i.splice(p,1)};return o.push(f),f}function u(){const{history:h}=window;h.state&&h.replaceState(ae({},h.state,{scroll:on()}),"")}function d(){for(const h of o)h();o=[],window.removeEventListener("popstate",r),window.removeEventListener("beforeunload",u)}return window.addEventListener("popstate",r),window.addEventListener("beforeunload",u,{passive:!0}),{pauseListeners:l,listen:c,destroy:d}}function Li(t,e,s,n=!1,i=!1){return{back:t,current:e,forward:s,replaced:n,position:window.history.length,scroll:i?on():null}}function Nl(t){const{history:e,location:s}=window,n={value:Pa(t,s)},i={value:e.state};i.value||o(n.value,{back:null,current:n.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function o(l,c,u){const d=t.indexOf("#"),h=d>-1?(s.host&&document.querySelector("base")?t:t.slice(d))+l:zl()+t+l;try{e[u?"replaceState":"pushState"](c,"",h),i.value=c}catch(f){console.error(f),s[u?"replace":"assign"](h)}}function a(l,c){const u=ae({},e.state,Li(i.value.back,l,i.value.forward,!0),c,{position:i.value.position});o(l,u,!0),n.value=l}function r(l,c){const u=ae({},i.value,e.state,{forward:l,scroll:on()});o(u.current,u,!0);const d=ae({},Li(n.value,l,null),{position:u.position+1},c);o(l,d,!1),n.value=l}return{location:n,state:i,push:r,replace:a}}function Ul(t){t=El(t);const e=Nl(t),s=Bl(t,e.state,e.location,e.replace);function n(o,a=!0){a||s.pauseListeners(),history.go(o)}const i=ae({location:"",base:t,go:n,createHref:Ol.bind(null,t)},e,s);return Object.defineProperty(i,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(i,"state",{enumerable:!0,get:()=>e.state.value}),i}function Hl(t){return t=location.host?t||location.pathname+location.search:"",t.includes("#")||(t+="#"),Ul(t)}function jl(t){return typeof t=="string"||t&&typeof t=="object"}function Da(t){return typeof t=="string"||typeof t=="symbol"}const Ra=Symbol("");var Oi;(function(t){t[t.aborted=4]="aborted",t[t.cancelled=8]="cancelled",t[t.duplicated=16]="duplicated"})(Oi||(Oi={}));function zt(t,e){return ae(new Error,{type:t,[Ra]:!0},e)}function Je(t,e){return t instanceof Error&&Ra in t&&(e==null||!!(t.type&e))}const Ii="[^/]+?",Wl={sensitive:!1,strict:!1,start:!0,end:!0},Gl=/[.+*?^${}()[\]/\\]/g;function ql(t,e){const s=ae({},Wl,e),n=[];let i=s.start?"^":"";const o=[];for(const c of t){const u=c.length?[]:[90];s.strict&&!c.length&&(i+="/");for(let d=0;d<c.length;d++){const h=c[d];let f=40+(s.sensitive?.25:0);if(h.type===0)d||(i+="/"),i+=h.value.replace(Gl,"\\$&"),f+=40;else if(h.type===1){const{value:p,repeatable:g,optional:m,regexp:y}=h;o.push({name:p,repeatable:g,optional:m});const v=y||Ii;if(v!==Ii){f+=10;try{new RegExp(`(${v})`)}catch(P){throw new Error(`Invalid custom RegExp for param "${p}" (${v}): `+P.message)}}let k=g?`((?:${v})(?:/(?:${v}))*)`:`(${v})`;d||(k=m&&c.length<2?`(?:/${k})`:"/"+k),m&&(k+="?"),i+=k,f+=20,m&&(f+=-8),g&&(f+=-20),v===".*"&&(f+=-50)}u.push(f)}n.push(u)}if(s.strict&&s.end){const c=n.length-1;n[c][n[c].length-1]+=.7000000000000001}s.strict||(i+="/?"),s.end?i+="$":s.strict&&!i.endsWith("/")&&(i+="(?:/|$)");const a=new RegExp(i,s.sensitive?"":"i");function r(c){const u=c.match(a),d={};if(!u)return null;for(let h=1;h<u.length;h++){const f=u[h]||"",p=o[h-1];d[p.name]=f&&p.repeatable?f.split("/"):f}return d}function l(c){let u="",d=!1;for(const h of t){(!d||!u.endsWith("/"))&&(u+="/"),d=!1;for(const f of h)if(f.type===0)u+=f.value;else if(f.type===1){const{value:p,repeatable:g,optional:m}=f,y=p in c?c[p]:"";if(We(y)&&!g)throw new Error(`Provided param "${p}" is an array but it is not repeatable (* or + modifiers)`);const v=We(y)?y.join("/"):y;if(!v)if(m)h.length<2&&(u.endsWith("/")?u=u.slice(0,-1):d=!0);else throw new Error(`Missing required param "${p}"`);u+=v}}return u||"/"}return{re:a,score:n,keys:o,parse:r,stringify:l}}function Yl(t,e){let s=0;for(;s<t.length&&s<e.length;){const n=e[s]-t[s];if(n)return n;s++}return t.length<e.length?t.length===1&&t[0]===80?-1:1:t.length>e.length?e.length===1&&e[0]===80?1:-1:0}function Ma(t,e){let s=0;const n=t.score,i=e.score;for(;s<n.length&&s<i.length;){const o=Yl(n[s],i[s]);if(o)return o;s++}if(Math.abs(i.length-n.length)===1){if(Fi(n))return 1;if(Fi(i))return-1}return i.length-n.length}function Fi(t){const e=t[t.length-1];return t.length>0&&e[e.length-1]<0}const Xl={type:0,value:""},Kl=/[a-zA-Z0-9_]/;function Ql(t){if(!t)return[[]];if(t==="/")return[[Xl]];if(!t.startsWith("/"))throw new Error(`Invalid path "${t}"`);function e(f){throw new Error(`ERR (${s})/"${c}": ${f}`)}let s=0,n=s;const i=[];let o;function a(){o&&i.push(o),o=[]}let r=0,l,c="",u="";function d(){c&&(s===0?o.push({type:0,value:c}):s===1||s===2||s===3?(o.length>1&&(l==="*"||l==="+")&&e(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),o.push({type:1,value:c,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):e("Invalid state to consume buffer"),c="")}function h(){c+=l}for(;r<t.length;){if(l=t[r++],l==="\\"&&s!==2){n=s,s=4;continue}switch(s){case 0:l==="/"?(c&&d(),a()):l===":"?(d(),s=1):h();break;case 4:h(),s=n;break;case 1:l==="("?s=2:Kl.test(l)?h():(d(),s=0,l!=="*"&&l!=="?"&&l!=="+"&&r--);break;case 2:l===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+l:s=3:u+=l;break;case 3:d(),s=0,l!=="*"&&l!=="?"&&l!=="+"&&r--,u="";break;default:e("Unknown state");break}}return s===2&&e(`Unfinished custom RegExp for param "${c}"`),d(),a(),i}function Zl(t,e,s){const n=ql(Ql(t.path),s),i=ae(n,{record:t,parent:e,children:[],alias:[]});return e&&!i.record.aliasOf==!e.record.aliasOf&&e.children.push(i),i}function Jl(t,e){const s=[],n=new Map;e=Bi({strict:!1,end:!0,sensitive:!1},e);function i(d){return n.get(d)}function o(d,h,f){const p=!f,g=$i(d);g.aliasOf=f&&f.record;const m=Bi(e,d),y=[g];if("alias"in d){const P=typeof d.alias=="string"?[d.alias]:d.alias;for(const C of P)y.push($i(ae({},g,{components:f?f.record.components:g.components,path:C,aliasOf:f?f.record:g})))}let v,k;for(const P of y){const{path:C}=P;if(h&&C[0]!=="/"){const O=h.record.path,R=O[O.length-1]==="/"?"":"/";P.path=h.record.path+(C&&R+C)}if(v=Zl(P,h,m),f?f.alias.push(v):(k=k||v,k!==v&&k.alias.push(v),p&&d.name&&!zi(v)&&a(d.name)),Aa(v)&&l(v),g.children){const O=g.children;for(let R=0;R<O.length;R++)o(O[R],v,f&&f.children[R])}f=f||v}return k?()=>{a(k)}:is}function a(d){if(Da(d)){const h=n.get(d);h&&(n.delete(d),s.splice(s.indexOf(h),1),h.children.forEach(a),h.alias.forEach(a))}else{const h=s.indexOf(d);h>-1&&(s.splice(h,1),d.record.name&&n.delete(d.record.name),d.children.forEach(a),d.alias.forEach(a))}}function r(){return s}function l(d){const h=sc(d,s);s.splice(h,0,d),d.record.name&&!zi(d)&&n.set(d.record.name,d)}function c(d,h){let f,p={},g,m;if("name"in d&&d.name){if(f=n.get(d.name),!f)throw zt(1,{location:d});m=f.record.name,p=ae(Vi(h.params,f.keys.filter(k=>!k.optional).concat(f.parent?f.parent.keys.filter(k=>k.optional):[]).map(k=>k.name)),d.params&&Vi(d.params,f.keys.map(k=>k.name))),g=f.stringify(p)}else if(d.path!=null)g=d.path,f=s.find(k=>k.re.test(g)),f&&(p=f.parse(g),m=f.record.name);else{if(f=h.name?n.get(h.name):s.find(k=>k.re.test(h.path)),!f)throw zt(1,{location:d,currentLocation:h});m=f.record.name,p=ae({},h.params,d.params),g=f.stringify(p)}const y=[];let v=f;for(;v;)y.unshift(v.record),v=v.parent;return{name:m,path:g,params:p,matched:y,meta:tc(y)}}t.forEach(d=>o(d));function u(){s.length=0,n.clear()}return{addRoute:o,resolve:c,removeRoute:a,clearRoutes:u,getRoutes:r,getRecordMatcher:i}}function Vi(t,e){const s={};for(const n of e)n in t&&(s[n]=t[n]);return s}function $i(t){const e={path:t.path,redirect:t.redirect,name:t.name,meta:t.meta||{},aliasOf:t.aliasOf,beforeEnter:t.beforeEnter,props:ec(t),children:t.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in t?t.components||null:t.component&&{default:t.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function ec(t){const e={},s=t.props||!1;if("component"in t)e.default=s;else for(const n in t.components)e[n]=typeof s=="object"?s[n]:s;return e}function zi(t){for(;t;){if(t.record.aliasOf)return!0;t=t.parent}return!1}function tc(t){return t.reduce((e,s)=>ae(e,s.meta),{})}function Bi(t,e){const s={};for(const n in t)s[n]=n in e?e[n]:t[n];return s}function sc(t,e){let s=0,n=e.length;for(;s!==n;){const o=s+n>>1;Ma(t,e[o])<0?n=o:s=o+1}const i=nc(t);return i&&(n=e.lastIndexOf(i,n-1)),n}function nc(t){let e=t;for(;e=e.parent;)if(Aa(e)&&Ma(t,e)===0)return e}function Aa({record:t}){return!!(t.name||t.components&&Object.keys(t.components).length||t.redirect)}function ic(t){const e={};if(t===""||t==="?")return e;const n=(t[0]==="?"?t.slice(1):t).split("&");for(let i=0;i<n.length;++i){const o=n[i].replace(xa," "),a=o.indexOf("="),r=fs(a<0?o:o.slice(0,a)),l=a<0?null:fs(o.slice(a+1));if(r in e){let c=e[r];We(c)||(c=e[r]=[c]),c.push(l)}else e[r]=l}return e}function Ni(t){let e="";for(let s in t){const n=t[s];if(s=Sl(s),n==null){n!==void 0&&(e+=(e.length?"&":"")+s);continue}(We(n)?n.map(o=>o&&zn(o)):[n&&zn(n)]).forEach(o=>{o!==void 0&&(e+=(e.length?"&":"")+s,o!=null&&(e+="="+o))})}return e}function oc(t){const e={};for(const s in t){const n=t[s];n!==void 0&&(e[s]=We(n)?n.map(i=>i==null?null:""+i):n==null?n:""+n)}return e}const ac=Symbol(""),Ui=Symbol(""),an=Symbol(""),li=Symbol(""),Nn=Symbol("");function Gt(){let t=[];function e(n){return t.push(n),()=>{const i=t.indexOf(n);i>-1&&t.splice(i,1)}}function s(){t=[]}return{add:e,list:()=>t.slice(),reset:s}}function ut(t,e,s,n,i,o=a=>a()){const a=n&&(n.enterCallbacks[i]=n.enterCallbacks[i]||[]);return()=>new Promise((r,l)=>{const c=h=>{h===!1?l(zt(4,{from:s,to:e})):h instanceof Error?l(h):jl(h)?l(zt(2,{from:e,to:h})):(a&&n.enterCallbacks[i]===a&&typeof h=="function"&&a.push(h),r())},u=o(()=>t.call(n&&n.instances[i],e,s,c));let d=Promise.resolve(u);t.length<3&&(d=d.then(c)),d.catch(h=>l(h))})}function yn(t,e,s,n,i=o=>o()){const o=[];for(const a of t)for(const r in a.components){let l=a.components[r];if(!(e!=="beforeRouteEnter"&&!a.instances[r]))if(ba(l)){const u=(l.__vccOpts||l)[e];u&&o.push(ut(u,s,n,a,r,i))}else{let c=l();o.push(()=>c.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${r}" at "${a.path}"`);const d=hl(u)?u.default:u;a.mods[r]=u,a.components[r]=d;const f=(d.__vccOpts||d)[e];return f&&ut(f,s,n,a,r,i)()}))}}return o}function Hi(t){const e=pt(an),s=pt(li),n=S(()=>{const l=I(t.to);return e.resolve(l)}),i=S(()=>{const{matched:l}=n.value,{length:c}=l,u=l[c-1],d=s.matched;if(!u||!d.length)return-1;const h=d.findIndex($t.bind(null,u));if(h>-1)return h;const f=ji(l[c-2]);return c>1&&ji(u)===f&&d[d.length-1].path!==f?d.findIndex($t.bind(null,l[c-2])):h}),o=S(()=>i.value>-1&&dc(s.params,n.value.params)),a=S(()=>i.value>-1&&i.value===s.matched.length-1&&Ca(s.params,n.value.params));function r(l={}){if(uc(l)){const c=e[I(t.replace)?"replace":"push"](I(t.to)).catch(is);return t.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:n,href:S(()=>n.value.href),isActive:o,isExactActive:a,navigate:r}}function rc(t){return t.length===1?t[0]:t}const lc=nn({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Hi,setup(t,{slots:e}){const s=ua(Hi(t)),{options:n}=pt(an),i=S(()=>({[Wi(t.activeClass,n.linkActiveClass,"router-link-active")]:s.isActive,[Wi(t.exactActiveClass,n.linkExactActiveClass,"router-link-exact-active")]:s.isExactActive}));return()=>{const o=e.default&&rc(e.default(s));return t.custom?o:hs("a",{"aria-current":s.isExactActive?t.ariaCurrentValue:null,href:s.href,onClick:s.navigate,class:i.value},o)}}}),cc=lc;function uc(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&!(t.button!==void 0&&t.button!==0)){if(t.currentTarget&&t.currentTarget.getAttribute){const e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function dc(t,e){for(const s in e){const n=e[s],i=t[s];if(typeof n=="string"){if(n!==i)return!1}else if(!We(i)||i.length!==n.length||n.some((o,a)=>o!==i[a]))return!1}return!0}function ji(t){return t?t.aliasOf?t.aliasOf.path:t.path:""}const Wi=(t,e,s)=>t??e??s,hc=nn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(t,{attrs:e,slots:s}){const n=pt(Nn),i=S(()=>t.route||n.value),o=pt(Ui,0),a=S(()=>{let c=I(o);const{matched:u}=i.value;let d;for(;(d=u[c])&&!d.components;)c++;return c}),r=S(()=>i.value.matched[a.value]);gn(Ui,S(()=>a.value+1)),gn(ac,r),gn(Nn,i);const l=se();return Me(()=>[l.value,r.value,t.name],([c,u,d],[h,f,p])=>{u&&(u.instances[d]=c,f&&f!==u&&c&&c===h&&(u.leaveGuards.size||(u.leaveGuards=f.leaveGuards),u.updateGuards.size||(u.updateGuards=f.updateGuards))),c&&u&&(!f||!$t(u,f)||!h)&&(u.enterCallbacks[d]||[]).forEach(g=>g(c))},{flush:"post"}),()=>{const c=i.value,u=t.name,d=r.value,h=d&&d.components[u];if(!h)return Gi(s.default,{Component:h,route:c});const f=d.props[u],p=f?f===!0?c.params:typeof f=="function"?f(c):f:null,m=hs(h,ae({},p,e,{onVnodeUnmounted:y=>{y.component.isUnmounted&&(d.instances[u]=null)},ref:l}));return Gi(s.default,{Component:m,route:c})||m}}});function Gi(t,e){if(!t)return null;const s=t(e);return s.length===1?s[0]:s}const fc=hc;function pc(t){const e=Jl(t.routes,t),s=t.parseQuery||ic,n=t.stringifyQuery||Ni,i=t.history,o=Gt(),a=Gt(),r=Gt(),l=ti(rt);let c=rt;Et&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=vn.bind(null,M=>""+M),d=vn.bind(null,Cl),h=vn.bind(null,fs);function f(M,V){let $,q;return Da(M)?($=e.getRecordMatcher(M),q=V):q=M,e.addRoute(q,$)}function p(M){const V=e.getRecordMatcher(M);V&&e.removeRoute(V)}function g(){return e.getRoutes().map(M=>M.record)}function m(M){return!!e.getRecordMatcher(M)}function y(M,V){if(V=ae({},V||l.value),typeof M=="string"){const K=bn(s,M,V.path),ve=e.resolve({path:K.path},V),Wt=i.createHref(K.fullPath);return ae(K,ve,{params:h(ve.params),hash:fs(K.hash),redirectedFrom:void 0,href:Wt})}let $;if(M.path!=null)$=ae({},M,{path:bn(s,M.path,V.path).path});else{const K=ae({},M.params);for(const ve in K)K[ve]==null&&delete K[ve];$=ae({},M,{params:d(K)}),V.params=d(V.params)}const q=e.resolve($,V),ue=M.hash||"";q.params=u(h(q.params));const _e=Rl(n,ae({},M,{hash:wl(ue),path:q.path})),te=i.createHref(_e);return ae({fullPath:_e,hash:ue,query:n===Ni?oc(M.query):M.query||{}},q,{redirectedFrom:void 0,href:te})}function v(M){return typeof M=="string"?bn(s,M,l.value.path):ae({},M)}function k(M,V){if(c!==M)return zt(8,{from:V,to:M})}function P(M){return R(M)}function C(M){return P(ae(v(M),{replace:!0}))}function O(M){const V=M.matched[M.matched.length-1];if(V&&V.redirect){const{redirect:$}=V;let q=typeof $=="function"?$(M):$;return typeof q=="string"&&(q=q.includes("?")||q.includes("#")?q=v(q):{path:q},q.params={}),ae({query:M.query,hash:M.hash,params:q.path!=null?{}:M.params},q)}}function R(M,V){const $=c=y(M),q=l.value,ue=M.state,_e=M.force,te=M.replace===!0,K=O($);if(K)return R(ae(v(K),{state:typeof K=="object"?ae({},ue,K.state):ue,force:_e,replace:te}),V||$);const ve=$;ve.redirectedFrom=V;let Wt;return!_e&&Ml(n,q,$)&&(Wt=zt(16,{to:ve,from:q}),Ze(q,q,!0,!1)),(Wt?Promise.resolve(Wt):j(ve,q)).catch(Te=>Je(Te)?Je(Te,2)?Te:Fe(Te):ye(Te,ve,q)).then(Te=>{if(Te){if(Je(Te,2))return R(ae({replace:te},v(Te.to),{state:typeof Te.to=="object"?ae({},ue,Te.to.state):ue,force:_e}),V||ve)}else Te=L(ve,q,!0,te,ue);return G(ve,q,Te),Te})}function E(M,V){const $=k(M,V);return $?Promise.reject($):Promise.resolve()}function z(M){const V=Ae.values().next().value;return V&&typeof V.runWithContext=="function"?V.runWithContext(M):M()}function j(M,V){let $;const[q,ue,_e]=gc(M,V);$=yn(q.reverse(),"beforeRouteLeave",M,V);for(const K of q)K.leaveGuards.forEach(ve=>{$.push(ut(ve,M,V))});const te=E.bind(null,M,V);return $.push(te),W($).then(()=>{$=[];for(const K of o.list())$.push(ut(K,M,V));return $.push(te),W($)}).then(()=>{$=yn(ue,"beforeRouteUpdate",M,V);for(const K of ue)K.updateGuards.forEach(ve=>{$.push(ut(ve,M,V))});return $.push(te),W($)}).then(()=>{$=[];for(const K of _e)if(K.beforeEnter)if(We(K.beforeEnter))for(const ve of K.beforeEnter)$.push(ut(ve,M,V));else $.push(ut(K.beforeEnter,M,V));return $.push(te),W($)}).then(()=>(M.matched.forEach(K=>K.enterCallbacks={}),$=yn(_e,"beforeRouteEnter",M,V,z),$.push(te),W($))).then(()=>{$=[];for(const K of a.list())$.push(ut(K,M,V));return $.push(te),W($)}).catch(K=>Je(K,8)?K:Promise.reject(K))}function G(M,V,$){r.list().forEach(q=>z(()=>q(M,V,$)))}function L(M,V,$,q,ue){const _e=k(M,V);if(_e)return _e;const te=V===rt,K=Et?history.state:{};$&&(q||te?i.replace(M.fullPath,ae({scroll:te&&K&&K.scroll},ue)):i.push(M.fullPath,ue)),l.value=M,Ze(M,V,$,te),Fe()}let F;function he(){F||(F=i.listen((M,V,$)=>{if(!qe.listening)return;const q=y(M),ue=O(q);if(ue){R(ae(ue,{replace:!0,force:!0}),q).catch(is);return}c=q;const _e=l.value;Et&&Vl(Ei(_e.fullPath,$.delta),on()),j(q,_e).catch(te=>Je(te,12)?te:Je(te,2)?(R(ae(v(te.to),{force:!0}),q).then(K=>{Je(K,20)&&!$.delta&&$.type===ps.pop&&i.go(-1,!1)}).catch(is),Promise.reject()):($.delta&&i.go(-$.delta,!1),ye(te,q,_e))).then(te=>{te=te||L(q,_e,!1),te&&($.delta&&!Je(te,8)?i.go(-$.delta,!1):$.type===ps.pop&&Je(te,20)&&i.go(-1,!1)),G(q,_e,te)}).catch(is)}))}let Y=Gt(),Q=Gt(),Z;function ye(M,V,$){Fe(M);const q=Q.list();return q.length?q.forEach(ue=>ue(M,V,$)):console.error(M),Promise.reject(M)}function ce(){return Z&&l.value!==rt?Promise.resolve():new Promise((M,V)=>{Y.add([M,V])})}function Fe(M){return Z||(Z=!M,he(),Y.list().forEach(([V,$])=>M?$(M):V()),Y.reset()),M}function Ze(M,V,$,q){const{scrollBehavior:ue}=t;if(!Et||!ue)return Promise.resolve();const _e=!$&&$l(Ei(M.fullPath,0))||(q||!$)&&history.state&&history.state.scroll||null;return ca().then(()=>ue(M,V,_e)).then(te=>te&&Fl(te)).catch(te=>ye(te,M,V))}const $e=M=>i.go(M);let He;const Ae=new Set,qe={currentRoute:l,listening:!0,addRoute:f,removeRoute:p,clearRoutes:e.clearRoutes,hasRoute:m,getRoutes:g,resolve:y,options:t,push:P,replace:C,go:$e,back:()=>$e(-1),forward:()=>$e(1),beforeEach:o.add,beforeResolve:a.add,afterEach:r.add,onError:Q.add,isReady:ce,install(M){const V=this;M.component("RouterLink",cc),M.component("RouterView",fc),M.config.globalProperties.$router=V,Object.defineProperty(M.config.globalProperties,"$route",{enumerable:!0,get:()=>I(l)}),Et&&!He&&l.value===rt&&(He=!0,P(i.location).catch(ue=>{}));const $={};for(const ue in rt)Object.defineProperty($,ue,{get:()=>l.value[ue],enumerable:!0});M.provide(an,V),M.provide(li,Vr($)),M.provide(Nn,l);const q=M.unmount;Ae.add(M),M.unmount=function(){Ae.delete(M),Ae.size<1&&(c=rt,F&&F(),F=null,l.value=rt,He=!1,Z=!1),q()}}};function W(M){return M.reduce((V,$)=>V.then(()=>z($)),Promise.resolve())}return qe}function gc(t,e){const s=[],n=[],i=[],o=Math.max(e.matched.length,t.matched.length);for(let a=0;a<o;a++){const r=e.matched[a];r&&(t.matched.find(c=>$t(c,r))?n.push(r):s.push(r));const l=t.matched[a];l&&(e.matched.find(c=>$t(c,l))||i.push(l))}return[s,n,i]}function rn(){return pt(an)}function Ve(t){return pt(li)}/*! |
| 9 | | */var Ta="store";function X(t){return t===void 0&&(t=null),ft(t!==null?t:Ta)}function Ht(t,e){Object.keys(t).forEach(function(s){return e(t[s],s)})}function mc(t){return t!==null&&typeof t=="object"}function _c(t){return t&&typeof t.then=="function"}function vc(t,e){return function(){return t(e)}}function Ea(t,e,s){return e.indexOf(t)<0&&(s&&s.prepend?e.unshift(t):e.push(t)),function(){var n=e.indexOf(t);n>-1&&e.splice(n,1)}}function La(t,e){t._actions=Object.create(null),t._mutations=Object.create(null),t._wrappedGetters=Object.create(null),t._modulesNamespaceMap=Object.create(null);var s=t.state;ln(t,s,[],t._modules.root,!0),ci(t,s,e)}function ci(t,e,s){var n=t._state,i=t._scope;t.getters={},t._makeLocalGettersCache=Object.create(null);var o=t._wrappedGetters,a={},r={},l=$r(!0);l.run(function(){Ht(o,function(c,u){a[u]=vc(c,t),r[u]=S(function(){return a[u]()}),Object.defineProperty(t.getters,u,{get:function(){return r[u].value},enumerable:!0})})}),t._state=ua({data:e}),t._scope=l,t.strict&&Sc(t),n&&s&&t._withCommit(function(){n.data=null}),i&&i.stop()}function ln(t,e,s,n,i){var o=!s.length,a=t._modules.getNamespace(s);if(n.namespaced&&(t._modulesNamespaceMap[a],t._modulesNamespaceMap[a]=n),!o&&!i){var r=ui(e,s.slice(0,-1)),l=s[s.length-1];t._withCommit(function(){r[l]=n.state})}var c=n.context=bc(t,a,s);n.forEachMutation(function(u,d){var h=a+d;yc(t,h,u,c)}),n.forEachAction(function(u,d){var h=u.root?d:a+d,f=u.handler||u;xc(t,h,f,c)}),n.forEachGetter(function(u,d){var h=a+d;wc(t,h,u,c)}),n.forEachChild(function(u,d){ln(t,e,s.concat(d),u,i)})}function bc(t,e,s){var n=e==="",i={dispatch:n?t.dispatch:function(o,a,r){var l=Ws(o,a,r),c=l.payload,u=l.options,d=l.type;return(!u||!u.root)&&(d=e+d),t.dispatch(d,c)},commit:n?t.commit:function(o,a,r){var l=Ws(o,a,r),c=l.payload,u=l.options,d=l.type;(!u||!u.root)&&(d=e+d),t.commit(d,c,u)}};return Object.defineProperties(i,{getters:{get:n?function(){return t.getters}:function(){return Oa(t,e)}},state:{get:function(){return ui(t.state,s)}}}),i}function Oa(t,e){if(!t._makeLocalGettersCache[e]){var s={},n=e.length;Object.keys(t.getters).forEach(function(i){if(i.slice(0,n)===e){var o=i.slice(n);Object.defineProperty(s,o,{get:function(){return t.getters[i]},enumerable:!0})}}),t._makeLocalGettersCache[e]=s}return t._makeLocalGettersCache[e]}function yc(t,e,s,n){var i=t._mutations[e]||(t._mutations[e]=[]);i.push(function(a){s.call(t,n.state,a)})}function xc(t,e,s,n){var i=t._actions[e]||(t._actions[e]=[]);i.push(function(a){var r=s.call(t,{dispatch:n.dispatch,commit:n.commit,getters:n.getters,state:n.state,rootGetters:t.getters,rootState:t.state},a);return _c(r)||(r=Promise.resolve(r)),t._devtoolHook?r.catch(function(l){throw t._devtoolHook.emit("vuex:error",l),l}):r})}function wc(t,e,s,n){t._wrappedGetters[e]||(t._wrappedGetters[e]=function(o){return s(n.state,n.getters,o.state,o.getters)})}function Sc(t){Me(function(){return t._state.data},function(){},{deep:!0,flush:"sync"})}function ui(t,e){return e.reduce(function(s,n){return s[n]},t)}function Ws(t,e,s){return mc(t)&&t.type&&(s=e,e=t,t=t.type),{type:t,payload:e,options:s}}var kc="vuex bindings",qi="vuex:mutations",xn="vuex:actions",Pt="vuex",Cc=0;function Pc(t,e){dl({id:"org.vuejs.vuex",app:t,label:"Vuex",homepage:"https://next.vuex.vuejs.org/",logo:"https://vuejs.org/images/icons/favicon-96x96.png",packageName:"vuex",componentStateTypes:[kc]},function(s){s.addTimelineLayer({id:qi,label:"Vuex Mutations",color:Yi}),s.addTimelineLayer({id:xn,label:"Vuex Actions",color:Yi}),s.addInspector({id:Pt,label:"Vuex",icon:"storage",treeFilterPlaceholder:"Filter stores..."}),s.on.getInspectorTree(function(n){if(n.app===t&&n.inspectorId===Pt)if(n.filter){var i=[];$a(i,e._modules.root,n.filter,""),n.rootNodes=i}else n.rootNodes=[Va(e._modules.root,"")]}),s.on.getInspectorState(function(n){if(n.app===t&&n.inspectorId===Pt){var i=n.nodeId;Oa(e,i),n.state=Mc(Tc(e._modules,i),i==="root"?e.getters:e._makeLocalGettersCache,i)}}),s.on.editInspectorState(function(n){if(n.app===t&&n.inspectorId===Pt){var i=n.nodeId,o=n.path;i!=="root"&&(o=i.split("/").filter(Boolean).concat(o)),e._withCommit(function(){n.set(e._state.data,o,n.state.value)})}}),e.subscribe(function(n,i){var o={};n.payload&&(o.payload=n.payload),o.state=i,s.notifyComponentUpdate(),s.sendInspectorTree(Pt),s.sendInspectorState(Pt),s.addTimelineEvent({layerId:qi,event:{time:Date.now(),title:n.type,data:o}})}),e.subscribeAction({before:function(n,i){var o={};n.payload&&(o.payload=n.payload),n._id=Cc++,n._time=Date.now(),o.state=i,s.addTimelineEvent({layerId:xn,event:{time:n._time,title:n.type,groupId:n._id,subtitle:"start",data:o}})},after:function(n,i){var o={},a=Date.now()-n._time;o.duration={_custom:{type:"duration",display:a+"ms",tooltip:"Action duration",value:a}},n.payload&&(o.payload=n.payload),o.state=i,s.addTimelineEvent({layerId:xn,event:{time:Date.now(),title:n.type,groupId:n._id,subtitle:"end",data:o}})}})})}var Yi=8702998,Dc=6710886,Rc=16777215,Ia={label:"namespaced",textColor:Rc,backgroundColor:Dc};function Fa(t){return t&&t!=="root"?t.split("/").slice(-2,-1)[0]:"Root"}function Va(t,e){return{id:e||"root",label:Fa(e),tags:t.namespaced?[Ia]:[],children:Object.keys(t._children).map(function(s){return Va(t._children[s],e+s+"/")})}}function $a(t,e,s,n){n.includes(s)&&t.push({id:n||"root",label:n.endsWith("/")?n.slice(0,n.length-1):n||"Root",tags:e.namespaced?[Ia]:[]}),Object.keys(e._children).forEach(function(i){$a(t,e._children[i],s,n+i+"/")})}function Mc(t,e,s){e=s==="root"?e:e[s];var n=Object.keys(e),i={state:Object.keys(t.state).map(function(a){return{key:a,editable:!0,value:t.state[a]}})};if(n.length){var o=Ac(e);i.getters=Object.keys(o).map(function(a){return{key:a.endsWith("/")?Fa(a):a,editable:!1,value:Un(function(){return o[a]})}})}return i}function Ac(t){var e={};return Object.keys(t).forEach(function(s){var n=s.split("/");if(n.length>1){var i=e,o=n.pop();n.forEach(function(a){i[a]||(i[a]={_custom:{value:{},display:a,tooltip:"Module",abstract:!0}}),i=i[a]._custom.value}),i[o]=Un(function(){return t[s]})}else e[s]=Un(function(){return t[s]})}),e}function Tc(t,e){var s=e.split("/").filter(function(n){return n});return s.reduce(function(n,i,o){var a=n[i];if(!a)throw new Error('Missing module "'+i+'" for path "'+e+'".');return o===s.length-1?a:a._children},e==="root"?t:t.root._children)}function Un(t){try{return t()}catch(e){return e}}var Ge=function(e,s){this.runtime=s,this._children=Object.create(null),this._rawModule=e;var n=e.state;this.state=(typeof n=="function"?n():n)||{}},za={namespaced:{configurable:!0}};za.namespaced.get=function(){return!!this._rawModule.namespaced};Ge.prototype.addChild=function(e,s){this._children[e]=s};Ge.prototype.removeChild=function(e){delete this._children[e]};Ge.prototype.getChild=function(e){return this._children[e]};Ge.prototype.hasChild=function(e){return e in this._children};Ge.prototype.update=function(e){this._rawModule.namespaced=e.namespaced,e.actions&&(this._rawModule.actions=e.actions),e.mutations&&(this._rawModule.mutations=e.mutations),e.getters&&(this._rawModule.getters=e.getters)};Ge.prototype.forEachChild=function(e){Ht(this._children,e)};Ge.prototype.forEachGetter=function(e){this._rawModule.getters&&Ht(this._rawModule.getters,e)};Ge.prototype.forEachAction=function(e){this._rawModule.actions&&Ht(this._rawModule.actions,e)};Ge.prototype.forEachMutation=function(e){this._rawModule.mutations&&Ht(this._rawModule.mutations,e)};Object.defineProperties(Ge.prototype,za);var St=function(e){this.register([],e,!1)};St.prototype.get=function(e){return e.reduce(function(s,n){return s.getChild(n)},this.root)};St.prototype.getNamespace=function(e){var s=this.root;return e.reduce(function(n,i){return s=s.getChild(i),n+(s.namespaced?i+"/":"")},"")};St.prototype.update=function(e){Ba([],this.root,e)};St.prototype.register=function(e,s,n){var i=this;n===void 0&&(n=!0);var o=new Ge(s,n);if(e.length===0)this.root=o;else{var a=this.get(e.slice(0,-1));a.addChild(e[e.length-1],o)}s.modules&&Ht(s.modules,function(r,l){i.register(e.concat(l),r,n)})};St.prototype.unregister=function(e){var s=this.get(e.slice(0,-1)),n=e[e.length-1],i=s.getChild(n);i&&i.runtime&&s.removeChild(n)};St.prototype.isRegistered=function(e){var s=this.get(e.slice(0,-1)),n=e[e.length-1];return s?s.hasChild(n):!1};function Ba(t,e,s){if(e.update(s),s.modules)for(var n in s.modules){if(!e.getChild(n))return;Ba(t.concat(n),e.getChild(n),s.modules[n])}}function Ec(t){return new Ie(t)}var Ie=function(e){var s=this;e===void 0&&(e={});var n=e.plugins;n===void 0&&(n=[]);var i=e.strict;i===void 0&&(i=!1);var o=e.devtools;this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new St(e),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._makeLocalGettersCache=Object.create(null),this._scope=null,this._devtools=o;var a=this,r=this,l=r.dispatch,c=r.commit;this.dispatch=function(h,f){return l.call(a,h,f)},this.commit=function(h,f,p){return c.call(a,h,f,p)},this.strict=i;var u=this._modules.root.state;ln(this,u,[],this._modules.root),ci(this,u),n.forEach(function(d){return d(s)})},di={state:{configurable:!0}};Ie.prototype.install=function(e,s){e.provide(s||Ta,this),e.config.globalProperties.$store=this;var n=this._devtools!==void 0?this._devtools:!1;n&&Pc(e,this)};di.state.get=function(){return this._state.data};di.state.set=function(t){};Ie.prototype.commit=function(e,s,n){var i=this,o=Ws(e,s,n),a=o.type,r=o.payload,l={type:a,payload:r},c=this._mutations[a];c&&(this._withCommit(function(){c.forEach(function(d){d(r)})}),this._subscribers.slice().forEach(function(u){return u(l,i.state)}))};Ie.prototype.dispatch=function(e,s){var n=this,i=Ws(e,s),o=i.type,a=i.payload,r={type:o,payload:a},l=this._actions[o];if(l){try{this._actionSubscribers.slice().filter(function(u){return u.before}).forEach(function(u){return u.before(r,n.state)})}catch{}var c=l.length>1?Promise.all(l.map(function(u){return u(a)})):l[0](a);return new Promise(function(u,d){c.then(function(h){try{n._actionSubscribers.filter(function(f){return f.after}).forEach(function(f){return f.after(r,n.state)})}catch{}u(h)},function(h){try{n._actionSubscribers.filter(function(f){return f.error}).forEach(function(f){return f.error(r,n.state,h)})}catch{}d(h)})})}};Ie.prototype.subscribe=function(e,s){return Ea(e,this._subscribers,s)};Ie.prototype.subscribeAction=function(e,s){var n=typeof e=="function"?{before:e}:e;return Ea(n,this._actionSubscribers,s)};Ie.prototype.watch=function(e,s,n){var i=this;return Me(function(){return e(i.state,i.getters)},s,Object.assign({},n))};Ie.prototype.replaceState=function(e){var s=this;this._withCommit(function(){s._state.data=e})};Ie.prototype.registerModule=function(e,s,n){n===void 0&&(n={}),typeof e=="string"&&(e=[e]),this._modules.register(e,s),ln(this,this.state,e,this._modules.get(e),n.preserveState),ci(this,this.state)};Ie.prototype.unregisterModule=function(e){var s=this;typeof e=="string"&&(e=[e]),this._modules.unregister(e),this._withCommit(function(){var n=ui(s.state,e.slice(0,-1));delete n[e[e.length-1]]}),La(this)};Ie.prototype.hasModule=function(e){return typeof e=="string"&&(e=[e]),this._modules.isRegistered(e)};Ie.prototype.hotUpdate=function(e){this._modules.update(e),La(this,!0)};Ie.prototype._withCommit=function(e){var s=this._committing;this._committing=!0,e(),this._committing=s};Object.defineProperties(Ie.prototype,di);const Lc={__name:"TextField",props:{fieldSchema:{type:Object,required:!0},modelValue:{required:!0},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const s=t,n=e,i=S({get(){return s.modelValue},set(r){if(s.fieldSchema.type==="number"){let l=Number(r);if(l<0){const c=o.value??0,u=a.value??Number.MAX_SAFE_INTEGER;l=Math.min(Math.abs(l),u),l=Math.max(l,c),r=l.toString()}}n("update:modelValue",r)}}),o=S(()=>{var r;return((r=s.fieldSchema.attributes)==null?void 0:r.min)??void 0}),a=S(()=>{var r;return((r=s.fieldSchema.attributes)==null?void 0:r.max)??void 0});return(r,l)=>{const c=P("el-input");return x(),M(c,{modelValue:i.value,"onUpdate:modelValue":l[0]||(l[0]=u=>i.value=u),type:t.fieldSchema.type==="textarea"?"textarea":t.fieldSchema.type,min:o.value,max:a.value,placeholder:t.fieldSchema.placeholder,disabled:s.disabled},nn({_:2},[t.fieldSchema.suffix?{name:"suffix",fn:w(()=>[B(H(t.fieldSchema.suffix),1)]),key:"0"}:void 0]),1032,["modelValue","type","min","max","placeholder","disabled"])}}},se=(t,e)=>{const s=t.__vccOpts||t;for(const[n,i]of e)s[n]=i;return s},Oc={__name:"SelectField",props:{fieldSchema:{type:Object,required:!0},modelValue:{default:""}},emits:["update:modelValue"],setup(t,{emit:e}){var h;const s=X(),n=t,i=e;!n.fieldSchema.is_pro&&!((h=n.fieldSchema.class)!=null&&h.includes("htga4-pro-field-opacity"))&&(n.fieldSchema.options==="roles"?s.dispatch("fetchRoles"):n.fieldSchema.options==="accounts"&&s.dispatch("fetchAccounts"));const o=S(()=>s.getters.getRoles),a=S(()=>s.getters.getAccounts),r=S(()=>s.getters.getProperties),l=S(()=>s.getters.getDataStreams),c=S(()=>s.getters.getMeasurementProtocolSecrets),u=S(()=>s.state.isLoading);Me(()=>n.modelValue,(f,p)=>{n.fieldSchema.options==="accounts"&&f&&(p&&(s.commit("updateSetting",{key:"property",value:""}),s.commit("updateSetting",{key:"data_stream_id",value:""})),s.dispatch("fetchProperties",{forceRefresh:!0}))}),Me(()=>n.modelValue,(f,p)=>{n.fieldSchema.options==="properties"&&f&&(p&&(s.commit("updateSetting",{key:"data_stream_id",value:""}),s.commit("updateSetting",{key:"measurement_id",value:""})),s.dispatch("fetchDataStreams",{forceRefresh:!0}))}),Me(()=>n.modelValue,(f,p)=>{if(n.fieldSchema.options==="data_streams"&&f){const g=s.state.settings;g.auth_google&&g.auth_google!==""&&(s.dispatch("fetchAndPopulateMeasurementId"),p&&s.commit("updateSetting",{key:"measurement_protocol_api_secret",value:""}),s.dispatch("fetchMeasurementProtocolSecrets",{forceRefresh:!0}))}});const d=S({get(){return n.modelValue},set(f){i("update:modelValue",f)}});return Ce(()=>{if(n.fieldSchema.options==="data_streams"&&n.modelValue){const f=s.state.settings,p=f.auth_google&&f.auth_google!=="",g=f.measurement_id||"";p&&!g&&s.dispatch("fetchAndPopulateMeasurementId")}}),(f,p)=>{const g=P("el-option"),m=P("el-option-group"),y=P("el-select");return x(),M(y,{modelValue:d.value,"onUpdate:modelValue":p[0]||(p[0]=b=>d.value=b),placeholder:t.fieldSchema.placeholder||"Select an option",loading:u.value,filterable:t.fieldSchema.filterable||!1,multiple:t.fieldSchema.multiple||!1,"empty-values":[null,void 0]},{default:w(()=>[typeof t.fieldSchema.options=="object"?(x(!0),T(J,{key:0},le(t.fieldSchema.options,(b,k)=>(x(),T(J,{key:k},[typeof b=="string"?(x(),M(g,{key:0,label:b,value:k},null,8,["label","value"])):(x(),M(m,{key:1,label:k},{label:w(()=>[v("span",null,H(k),1)]),default:w(()=>[(x(!0),T(J,null,le(b,(D,C)=>(x(),M(g,{key:C,label:D,value:C},null,8,["label","value"]))),128))]),_:2},1032,["label"]))],64))),128)):U("",!0),t.fieldSchema.options==="roles"?(x(!0),T(J,{key:1},le(o.value,(b,k)=>(x(),M(g,{key:k,label:b,value:k},null,8,["label","value"]))),128)):U("",!0),t.fieldSchema.options==="accounts"?(x(!0),T(J,{key:2},le(a.value,(b,k)=>(x(),M(g,{key:k,label:b,value:k},null,8,["label","value"]))),128)):U("",!0),t.fieldSchema.options==="properties"?(x(!0),T(J,{key:3},le(r.value,(b,k)=>(x(),M(g,{key:k,label:b,value:k},null,8,["label","value"]))),128)):U("",!0),t.fieldSchema.options==="data_streams"?(x(!0),T(J,{key:4},le(l.value,(b,k)=>(x(),M(g,{key:k,label:b,value:k},null,8,["label","value"]))),128)):U("",!0),t.fieldSchema.options==="measurement_protocol_secrets"?(x(!0),T(J,{key:5},le(c.value,(b,k)=>(x(),M(g,{key:k,label:b,value:k},null,8,["label","value"]))),128)):U("",!0)]),_:1},8,["modelValue","placeholder","loading","filterable","multiple"])}}},Ic=se(Oc,[["__scopeId","data-v-0e76ffb8"]]),Fc={__name:"ColorField",props:{fieldSchema:{type:Object,required:!0},modelValue:{required:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const s=t,n=e,i=a=>{if(!a){n("update:modelValue","");return}n("update:modelValue",a)},o=S({get(){return s.modelValue},set(a){n("update:modelValue",a)}});return(a,r)=>{const l=P("el-color-picker");return x(),M(l,{modelValue:o.value,"onUpdate:modelValue":r[0]||(r[0]=c=>o.value=c),"show-alpha":"",onActiveChange:i},null,8,["modelValue"])}}},Vc={__name:"CheckboxField",props:{fieldSchema:{type:Object,required:!0},modelValue:{required:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const s=t,n=e,i=S({get(){return s.fieldSchema.options?Array.isArray(s.modelValue)?s.modelValue:s.modelValue?s.modelValue.split(","):[]:s.modelValue==="1"||s.modelValue===1},set(o){s.fieldSchema.options?n("update:modelValue",Array.isArray(o)?o.join(","):o):n("update:modelValue",o?"1":"0")}});return(o,a)=>{const r=P("el-checkbox"),l=P("el-checkbox-group");return t.fieldSchema.options?(x(),M(l,{key:0,modelValue:i.value,"onUpdate:modelValue":a[0]||(a[0]=c=>i.value=c)},{default:w(()=>[(x(!0),T(J,null,le(t.fieldSchema.options,(c,u)=>(x(),M(r,{key:u,label:u,size:"medium"},{default:w(()=>[B(H(c),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])):(x(),M(r,{key:1,size:"medium",modelValue:i.value,"onUpdate:modelValue":a[1]||(a[1]=c=>i.value=c),label:t.fieldSchema.label},null,8,["modelValue","label"]))}}},$c={__name:"SwitchField",props:{fieldSchema:{type:Object,required:!0},modelValue:{required:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const s=t,n=e,i=S({get(){return Number(s.modelValue)},set(o){n("update:modelValue",String(o))}});return(o,a)=>{const r=P("el-switch");return x(),M(r,{modelValue:i.value,"onUpdate:modelValue":a[0]||(a[0]=l=>i.value=l),"inline-prompt":"","active-text":t.fieldSchema.label||"Yes","inactive-text":t.fieldSchema.label||"No","active-value":1,"inactive-value":0,"active-icon":L(si),"inactive-icon":L(zr)},null,8,["modelValue","active-text","inactive-text","active-icon","inactive-icon"])}}},zc={__name:"RadioField",props:{fieldSchema:{type:Object,required:!0},modelValue:{required:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const s=t,n=e,i=S({get(){return s.modelValue},set(o){n("update:modelValue",o)}});return(o,a)=>{const r=P("el-radio"),l=P("el-radio-group");return x(),M(l,{modelValue:i.value,"onUpdate:modelValue":a[0]||(a[0]=c=>i.value=c)},{default:w(()=>[(x(!0),T(J,null,le(t.fieldSchema.options,(c,u)=>(x(),M(r,{key:u,value:u},{default:w(()=>[B(H(c),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])}}},Bc={class:"htga4-tabbed-field"},Nc={class:"tab-content"},Uc={__name:"TabbedField",props:{modelValue:{type:Object,default:()=>({})},fieldSchema:{type:Object,required:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const s=t,n=e,i=ne("0"),o=ne({});return Me(()=>s.modelValue,a=>{o.value={...a}},{immediate:!0,deep:!0}),Me(o,a=>{n("update:modelValue",a)},{deep:!0}),(a,r)=>{const l=P("el-tab-pane"),c=P("el-tabs");return x(),T("div",Bc,[_(c,{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=u=>i.value=u)},{default:w(()=>[(x(!0),T(J,null,le(t.fieldSchema.tabs,(u,d)=>(x(),M(l,{key:d,name:d.toString()},{label:w(()=>[u.icon?(x(),T("i",{key:0,class:ie(u.icon)},null,2)):U("",!0),v("span",null,H(u.title),1)]),default:w(()=>[v("div",Nc,[(x(!0),T(J,null,le(u.fields,h=>(x(),M(we,{key:h.id,modelValue:o.value[h.id],"onUpdate:modelValue":f=>o.value[h.id]=f,fieldSchema:h},null,8,["modelValue","onUpdate:modelValue","fieldSchema"]))),128))])]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue"])])}}},Hc={class:"htga4-editor-field"},jc={class:"htga4-editor-tabs"},Wc={class:"htga4-editor-container"},Gc=["value"],qc={__name:"EditorField",props:{fieldSchema:{type:Object,required:!0},modelValue:{required:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const s={height:200,skin:"lightgray",theme:"modern",menubar:!1,statusbar:!1,branding:!1,plugins:"charmap colorpicker hr lists paste tabfocus textcolor fullscreen wordpress wpautoresize wpeditimage wpemoji wpgallery wplink wptextpattern",toolbar1:"formatselect bold italic bullist numlist blockquote alignleft aligncenter alignright link unlink wp_more wp_adv dfw",toolbar2:"strikethrough hr forecolor pastetext removeformat charmap outdent indent undo redo wp_help",force_br_newlines:!0,force_p_newlines:!1,forced_root_block:""},n=t,i=e,o=ne(!1),a=ne(null);let r=null;const l=S(()=>n.modelValue||""),c=()=>{if(o.value){const f=a.value.value.replace(/\n/g,"<br>");i("update:modelValue",f),o.value=!1,h()}},u=()=>{if(!o.value){const f=((r==null?void 0:r.getContent())||"").replace(/<br\s*\/?>/g,` |
| 10 | | `);r==null||r.destroy(),r=null,a.value.value=f,i("update:modelValue",f),o.value=!0}},d=f=>{i("update:modelValue",f.target.value)},h=()=>{if(!window.tinymce||!a.value||o.value)return;const p={...window.wp.editor.getDefaultSettings().tinymce,...s,target:a.value,setup:g=>{r=g,g.on("change",m=>{i("update:modelValue",g.getContent())}),g.on("init",()=>{var y;const m=((y=n.modelValue)==null?void 0:y.replace(/\n/g,"<br>"))||"";g.setContent(m)})}};window.tinymce.init(p)};return Me(()=>n.modelValue,f=>{if(r&&r.getContent()!==f){const p=f==null?void 0:f.replace(/\n/g,"<br>");r.setContent(p||"")}}),Ce(()=>{h()}),ni(()=>{r&&r.destroy()}),(f,p)=>(x(),T("div",Hc,[v("div",jc,[v("button",{type:"button",class:ie(["htga4-editor-tab-btn",{active:!o.value}]),onClick:c}," Visual ",2),v("button",{type:"button",class:ie(["htga4-editor-tab-btn",{active:o.value}]),onClick:u}," Text ",2)]),v("div",Wc,[v("textarea",{ref_key:"editorRef",ref:a,value:l.value,class:"htga4-editor-height",style:ii({visibility:o.value?"visible":"hidden"}),onInput:d},null,44,Gc)])]))}},Yc=["innerHTML"],Xc={__name:"HelpTooltip",props:{content:{type:String,required:!0},useHtml:{type:Boolean,default:!0},placement:{type:String,default:"bottom-start"},effect:{type:String,default:"dark"},hideAfter:{type:Number,default:0},trigger:{type:String,default:"hover"},enterable:{type:Boolean,default:!1}},setup(t){return(e,s)=>{const n=P("el-icon"),i=P("el-tooltip");return x(),M(i,{placement:t.placement,content:t.useHtml?null:t.content,effect:t.effect,"hide-after":t.hideAfter,trigger:t.trigger,enterable:t.enterable},nn({default:w(()=>[Ft(e.$slots,"default",{},()=>[_(n,{class:"tooltip-icon"},{default:w(()=>[_(L(da))]),_:1})],!0)]),_:2},[t.useHtml?{name:"content",fn:w(()=>[v("div",{innerHTML:t.content},null,8,Yc)]),key:"0"}:void 0]),1032,["placement","content","effect","hide-after","trigger","enterable"])}}},as=se(Xc,[["__scopeId","data-v-3399916d"]]),Kc=["value"],Qc={key:0,class:"htga4-copy-to-clipboard__icon"},Zc={key:0,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24"},Jc={key:1,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24"},eu={class:"htga4-copy-to-clipboard__text"},tu={__name:"CopyToClipboard",props:{content:{type:String,required:!0},buttonText:{type:String,default:"Copy"},width:{type:String,default:"100%"},showIcon:{type:Boolean,default:!0}},setup(t){const e=t,s=ne(!1),n=ne(null),i=S(()=>({width:e.width})),{content:o}=e,a=()=>{navigator.clipboard.writeText(e.content).then(()=>{s.value=!0,setTimeout(()=>{s.value=!1},2e3)})},r=()=>{n.value&&n.value.select()};return(l,c)=>{const u=P("el-button");return x(),T("div",{class:"htga4-copy-to-clipboard",style:ii(i.value)},[v("input",{class:"htga4-copy-to-clipboard__content htga4-monospace",value:L(o),readonly:"",onClick:r,ref_key:"inputRef",ref:n},null,8,Kc),_(u,{class:"htga4-copy-to-clipboard__button",onClick:Et(a,["stop"]),type:s.value?"success":"primary",size:"medium"},{default:w(()=>[t.showIcon?(x(),T("span",Qc,[s.value?(x(),T("svg",Jc,c[1]||(c[1]=[v("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"},null,-1)]))):(x(),T("svg",Zc,c[0]||(c[0]=[v("path",{fill:"currentColor",d:"M20,2H10C8.9,2 8,2.9 8,4V8H4C2.9,8 2,8.9 2,10V20C2,21.1 2.9,22 4,22H14C15.1,22 16,21.1 16,20V16H20C21.1,16 22,15.1 22,14V4C22,2.9 21.1,2 20,2M14,20H4V10H14V20M20,14H16V10C16,8.9 15.1,8 14,8H10V4H20V14Z"},null,-1)])))])):U("",!0),v("span",eu,H(s.value?"Copied!":t.buttonText),1)]),_:1},8,["type"])],4)}}},su=se(tu,[["__scopeId","data-v-263acba2"]]),nu={__name:"ClipboardField",props:{fieldSchema:{type:Object,required:!0},modelValue:{required:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const s=t,n=e,i=S({get(){return s.modelValue},set(o){n("update:modelValue",o)}});return(o,a)=>(x(),M(su,{content:i.value,width:"320px"},null,8,["content"]))}},iu={class:"htga4-auth-button-field"},ou={class:"htga4-auth-button-wrapper"},au=["href"],ru=["href"],lu={__name:"AuthButton",props:{modelValue:{type:String,default:""},fieldSchema:{type:Object,required:!0}},setup(t){var a;const e=X(),s=S(()=>e.getters.isAuthenticated),n=S(()=>e.state.email),i=ne(((a=window.htga4Settings)==null?void 0:a.loginUrl)||""),o=S(()=>{const r=window.location.href.split("#")[0];return r+(r.includes("?")?"&htga4_logout=yes":"?htga4_logout=yes")});return(r,l)=>{const c=P("el-form-item");return x(),T("div",iu,[_(c,null,{default:w(()=>[v("div",ou,[s.value?(x(),T("a",{key:1,class:"el-button el-button--large",href:o.value},H((t.fieldSchema.logout_text||"Logout (%s)").replace("%s",n.value)),9,ru)):(x(),T("a",{key:0,class:"htga4-google-button",href:i.value,target:"_blank"},H(t.fieldSchema.button_text||"Sign in with Google"),9,au))])]),_:1})])}}},cu=se(lu,[["__scopeId","data-v-05b1270d"]]),uu=["value"],du={__name:"HiddenField",props:{modelValue:{required:!0},fieldSchema:{type:Object,required:!0}},emits:["update:modelValue"],setup(t){return(e,s)=>(x(),T("input",{type:"hidden",value:t.modelValue,onInput:s[0]||(s[0]=n=>e.$emit("update:modelValue",n.target.value))},null,40,uu))}},Ss={__name:"InfoAlert",props:{type:{type:String,default:"info"},centered:{type:Boolean,default:!1}},setup(t){return(e,s)=>{const n=P("el-alert");return x(),M(n,{class:ie(["htga4-alert",`htga4-alert-${t.type}`,{"htga4-text-center":t.centered}]),closable:!1},{default:w(()=>[Ft(e.$slots,"default")]),_:3},8,["class"])}}},hu=["innerHTML"],fu={__name:"InfoField",props:{modelValue:{required:!0},fieldSchema:{type:Object,required:!0}},setup(t){return(e,s)=>(x(),M(Ss,{type:t.fieldSchema.alert_type||"info",centered:t.fieldSchema.centered||!1},{default:w(()=>[v("div",{class:"htga4-info-field-content",innerHTML:t.fieldSchema.content},null,8,hu)]),_:1},8,["type","centered"]))}},pu=se(fu,[["__scopeId","data-v-a454f23f"]]),gu={key:0,class:"htga4-woocommerce-requirement"},mu={__name:"WooCommerceRequirementField",props:{modelValue:{required:!0},fieldSchema:{type:Object,required:!0}},setup(t){const e=S(()=>window.htga4Settings&&window.htga4Settings.isWoocommerceInstalled==="1"),s=S(()=>window.htga4Settings&&window.htga4Settings.isWoocommerceActive==="1"),n=S(()=>!e.value||!s.value);return(i,o)=>n.value?(x(),T("div",gu,[_(Ss,{type:"warning"},{default:w(()=>o[0]||(o[0]=[v("div",{class:"htga4-woocommerce-requirement__content"},[v("strong",null,"WooCommerce Required:"),B(" E-Commerce events tracking requires the WooCommerce plugin to be installed and activated. ")],-1)])),_:1})])):U("",!0)}},_u=se(mu,[["__scopeId","data-v-9a3d06fe"]]),vu=()=>{const t=(s,n)=>{var a;if(s.type==="hidden")return!1;if(!s.condition)return!0;let i=s.condition;i instanceof Array||(i=[i]);const o={"!=":(r,l)=>r!=l,"!==":(r,l)=>r!==l,"==":(r,l)=>r==l,"===":(r,l)=>r===l,">=":(r,l)=>r>=l,">":(r,l)=>r>l,"<":(r,l)=>r<l,"<=":(r,l)=>r<=l,any:(r,l)=>l.split(",").map(u=>u.trim()).includes(r),"not-any":(r,l)=>!l.split(",").map(u=>u.trim()).includes(r)};for(let r=0;r<i.length;r++){const l=i[r];let c=l.operator||"!=",u=!0;if((a=l==null?void 0:l.key)!=null&&a.includes("|")){const d=l.key.split("|"),h=c.split("|"),f=l.value.split("|");if(d.forEach((p,g)=>{const m=h[g]||h[0],y=f[g]||f[0];o[m](n[p],y)||(u=!1)}),u)return!0}else if(o[c](n[l.key],l.value))return!0}return!1};return{maybeShowField:t,evaluateComplexConditions:(s,n)=>!s||!s.length?!0:s.some(i=>i.type==="AND"?i.rules.every(o=>t({condition:[o]},n)):i.rules.some(o=>t({condition:[o]},n)))}},bu=["innerHTML"],yu={__name:"FormInput",props:{fieldSchema:{type:Object,required:!0},modelValue:{required:!0},context:{type:Object,required:!1},showLabel:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const s=X(),n=t,i=e,{maybeShowField:o}=vu(),a=f=>{f.target.closest(".htga4-pro-field-opacity")&&(s.commit("setDisplayProModal",!0),f.preventDefault(),f.stopPropagation())},r=f=>{let p=s.state.settings;return n.context&&(p={...n.context}),o(f,p)},l=S({get(){return n.modelValue},set(f){i("update:modelValue",f)}}),c=S(()=>{var f;if(n.fieldSchema.is_pro||(f=n.fieldSchema.class)!=null&&f.includes("htga4-pro-field-opacity"))return!0;if(n.fieldSchema.id==="measurement_id"){const p=s.state.settings;if(p.auth_google&&p.auth_google!=="")return!0}if(n.fieldSchema.id==="measurement_protocol_api_secret"&&n.fieldSchema.type==="text"){const p=s.state.settings,g=p.auth_google&&p.auth_google!=="",m=p.property&&p.property!=="",y=p.data_stream_id&&p.data_stream_id!=="";if(g&&m&&y)return!0}return!1}),u=S(()=>{let f=n.fieldSchema.class?n.fieldSchema.class.split(" "):[];return c.value&&n.fieldSchema.is_pro&&!f.includes("htga4-pro-field-opacity")&&f.push("htga4-pro-field-opacity"),f}),d=S(()=>n.fieldSchema.label_position||"left"),h=S(()=>n.showLabel&&!!n.fieldSchema.title);return Me(()=>n.modelValue,f=>{f!==l.value&&(l.value=f)},{deep:!0}),(f,p)=>{const g=P("el-tag"),m=P("el-text"),y=P("el-form-item");return x(),T(J,null,[t.fieldSchema.is_pro?(x(),M(g,{key:0,type:"danger",round:"",size:"small"},{default:w(()=>p[13]||(p[13]=[B("Pro")])),_:1})):U("",!0),oi(_(y,{class:ie(["htga4-form-item",u.value,"htga4-input-"+t.fieldSchema.type]),size:"large",onClick:a,"label-position":d.value},nn({default:w(()=>[["text","number","email","textarea"].includes(t.fieldSchema.type)?(x(),M(Lc,{key:0,modelValue:l.value,"onUpdate:modelValue":p[0]||(p[0]=b=>l.value=b),fieldSchema:t.fieldSchema,disabled:c.value},null,8,["modelValue","fieldSchema","disabled"])):U("",!0),t.fieldSchema.type==="select"?(x(),M(Ic,{key:1,modelValue:l.value,"onUpdate:modelValue":p[1]||(p[1]=b=>l.value=b),fieldSchema:t.fieldSchema,disabled:c.value},null,8,["modelValue","fieldSchema","disabled"])):U("",!0),t.fieldSchema.type==="color"?(x(),M(Fc,{key:2,modelValue:l.value,"onUpdate:modelValue":p[2]||(p[2]=b=>l.value=b),fieldSchema:t.fieldSchema,disabled:c.value},null,8,["modelValue","fieldSchema","disabled"])):U("",!0),t.fieldSchema.type==="checkbox"?(x(),M(Vc,{key:3,modelValue:l.value,"onUpdate:modelValue":p[3]||(p[3]=b=>l.value=b),fieldSchema:t.fieldSchema,disabled:c.value},null,8,["modelValue","fieldSchema","disabled"])):U("",!0),t.fieldSchema.type==="switch"?(x(),M($c,{key:4,modelValue:l.value,"onUpdate:modelValue":p[4]||(p[4]=b=>l.value=b),fieldSchema:t.fieldSchema,disabled:c.value},null,8,["modelValue","fieldSchema","disabled"])):U("",!0),t.fieldSchema.type==="auth_button"?(x(),M(cu,{key:5,modelValue:l.value,"onUpdate:modelValue":p[5]||(p[5]=b=>l.value=b),fieldSchema:t.fieldSchema},null,8,["modelValue","fieldSchema"])):U("",!0),t.fieldSchema.type==="radio"?(x(),M(zc,{key:6,modelValue:l.value,"onUpdate:modelValue":p[6]||(p[6]=b=>l.value=b),fieldSchema:t.fieldSchema,disabled:c.value},null,8,["modelValue","fieldSchema","disabled"])):U("",!0),t.fieldSchema.type==="tabbed"?(x(),M(Uc,{key:7,modelValue:l.value,"onUpdate:modelValue":p[7]||(p[7]=b=>l.value=b),fieldSchema:t.fieldSchema,disabled:c.value},null,8,["modelValue","fieldSchema","disabled"])):U("",!0),t.fieldSchema.type==="wp_editor"?(x(),M(qc,{key:8,modelValue:l.value,"onUpdate:modelValue":p[8]||(p[8]=b=>l.value=b),fieldSchema:t.fieldSchema,disabled:c.value},null,8,["modelValue","fieldSchema","disabled"])):U("",!0),t.fieldSchema.type==="clipboard"?(x(),M(nu,{key:9,modelValue:l.value,"onUpdate:modelValue":p[9]||(p[9]=b=>l.value=b),fieldSchema:t.fieldSchema,disabled:c.value},null,8,["modelValue","fieldSchema","disabled"])):U("",!0),t.fieldSchema.type==="hidden"?(x(),M(du,{key:10,modelValue:l.value,"onUpdate:modelValue":p[10]||(p[10]=b=>l.value=b),fieldSchema:t.fieldSchema},null,8,["modelValue","fieldSchema"])):U("",!0),t.fieldSchema.type==="info"?(x(),M(pu,{key:11,modelValue:l.value,"onUpdate:modelValue":p[11]||(p[11]=b=>l.value=b),fieldSchema:t.fieldSchema},null,8,["modelValue","fieldSchema"])):U("",!0),t.fieldSchema.type==="woocommerce_requirement"?(x(),M(_u,{key:12,modelValue:l.value,"onUpdate:modelValue":p[12]||(p[12]=b=>l.value=b),fieldSchema:t.fieldSchema},null,8,["modelValue","fieldSchema"])):U("",!0),t.fieldSchema.desc?(x(),T("span",{key:13,class:"htga4-input-desc",innerHTML:t.fieldSchema.desc},null,8,bu)):U("",!0)]),_:2},[h.value?{name:"label",fn:w(()=>[_(m,{class:"mx-1"},{default:w(()=>[B(H(t.fieldSchema.title),1)]),_:1}),t.fieldSchema.help?(x(),M(as,{key:0,content:t.fieldSchema.help,placement:"bottom-start","use-html":!0},null,8,["content"])):U("",!0)]),key:"0"}:void 0]),1032,["class","label-position"]),[[ai,r(n.fieldSchema)]])],64)}}},we=se(yu,[["__scopeId","data-v-7bbb36b7"]]),Se=(t,e)=>{const s=e.split(".");let n=window.htga4SettingsSchema[t].fields;for(let i=0;i<s.length;i++){const o=s[i];if(n.fields&&n.fields[o])n=n.fields[o];else if(n[o])n=n[o];else return null}return n},xu={class:"general-settings"},Cs="general_route",wu={__name:"General",setup(t){const e=window.htga4SettingsSchema[Cs],s=Object.keys(e.fields),n=X(),i=S(()=>n.state.settings);S(()=>n.state);const o=a=>{const r=Se(Cs,a);return(r==null?void 0:r.id)||a};return(a,r)=>{const l=P("el-text"),c=P("SettingsCard"),u=P("el-form");return x(),T("div",xu,[_(u,{model:i.value,"label-width":"auto"},{default:w(()=>[_(Ss,null,{default:w(()=>[_(l,null,{default:w(()=>[r[1]||(r[1]=B("To access analytical reports within your WordPress dashboard, you need to connect / authenticate with your Google Analytics account. ")),r[2]||(r[2]=v("br",null,null,-1)),_(l,{type:"warning"},{default:w(()=>r[0]||(r[0]=[B("If you don't need to access the reports within the dashboard, manually insert your GA4 tracking ID below.")])),_:1})]),_:1})]),_:1}),_(c,null,{default:w(()=>[(x(!0),T(J,null,le(a.ecommerceEvents,d=>(x(),M(we,{key:d,modelValue:i.value[d],"onUpdate:modelValue":h=>i.value[d]=h,fieldSchema:L(Se)(Cs,d)},null,8,["modelValue","onUpdate:modelValue","fieldSchema"]))),128))]),_:1}),(x(!0),T(J,null,le(L(s),d=>(x(),M(we,{key:d,modelValue:i.value[o(d)],"onUpdate:modelValue":h=>i.value[o(d)]=h,fieldSchema:L(Se)(Cs,d)},null,8,["modelValue","onUpdate:modelValue","fieldSchema"]))),128))]),_:1},8,["model"])])}}},Su={class:"htga4-card-header"},Gs={__name:"SettingsCard",props:{title:{type:String,required:!1}},setup(t){const e=t,s=S(()=>!!e.title);return(n,i)=>{const o=P("el-card");return x(),M(o,{class:"htga4-settings-card"},nn({default:w(()=>[Ft(n.$slots,"default")]),_:2},[s.value?{name:"header",fn:w(()=>[v("div",Su,[v("span",null,H(t.title),1)])]),key:"0"}:void 0]),1024)}}},ku={class:"general-settings"},Xi="events-tracking_route",Cu={__name:"EventsTracking",setup(t){const e=X(),s=S(()=>e.state.settings),n=window.htga4SettingsSchema[Xi],i=n.sections,o=S(()=>{const a=[];return Object.keys(i).forEach(r=>{let l={},c=[];l.title=n.sections[r].title,c=Object.values(n.fields).filter(u=>u.section==r),l.fields=c.map(u=>u.id),a.push(l)}),a});return(a,r)=>{const l=P("el-form");return x(),T("div",ku,[_(l,{model:s.value,"label-width":"auto"},{default:w(()=>[(x(!0),T(J,null,le(o.value,(c,u)=>(x(),M(Gs,{key:u,title:c.title},{default:w(()=>[(x(!0),T(J,null,le(c.fields,d=>(x(),M(we,{key:d,modelValue:s.value[d],"onUpdate:modelValue":h=>s.value[d]=h,fieldSchema:L(Se)(Xi,d)},null,8,["modelValue","onUpdate:modelValue","fieldSchema"]))),128))]),_:2},1032,["title"]))),128))]),_:1},8,["model"])])}}},Pu={class:"custom-events-manager"},Du={class:"custom-events-list"},Ru={class:"custom-event-card"},Mu={class:"custom-event-content"},Au={class:"custom-event-label"},Tu={class:"custom-event-actions"},Eu={key:0,class:"upgrade-prompt"},Lu={class:"upgrade-content"},Ou=["id"],Iu={key:0,class:"custom-events-drawer-content"},Fu={class:"drawer-card-title"},Vu={class:"drawer-card-title"},$u={class:"drawer-card-title"},zu={key:0},Bu={key:1,class:"advanced-parameters"},Nu={key:0,class:"empty-state"},Uu={key:1,class:"parameters-accordion"},Hu={class:"collapse-header"},ju={class:"parameter-title"},Wu={class:"parameter-number"},Gu={class:"parameter-key"},qu={class:"collapse-actions"},Yu={class:"parameter-content"},Xu={class:"parameter-field"},Ku={class:"parameter-field"},Qu={class:"parameter-field"},Zu={class:"add-parameter-section"},Ju={class:"custom-events-drawer-footer"},je="custom-events_route",ed={__name:"CustomEvents",setup(t){const e=X(),s=S({get(){return e.state.settings},set(E){e.commit("updateSettings",E)}}),n=window.htga4SettingsSchema[je],i=ne(!1),o=ne(null),a=ne(!1),r=ne(null),l=ne([]),c=ne(!1),u={pdf_download:"a[href$='.pdf']",zip_download:"a[href$='.zip']",doc_download:"a[href$='.docx']",all_file_downloads:"a[href$='.pdf'], a[href$='.zip'], a[href$='.docx']",external_link:"a[href^='http']:not([href*='yourdomain.com'])",affiliate_link:"a[href*='?ref=']",email_click:"a[href^='mailto:']",phone_click:"a[href^='tel:']",add_to_cart:".add_to_cart_button",checkout_button:".checkout-button, #checkout",signup_button:".subscribe-btn, .newsletter-submit",video_play:".video-play, .ytp-play-button",reveal_coupon:".reveal-coupon",faq_toggle:".faq-question, .accordion-header"},d={name:[{required:!0,message:"Event name is required",trigger:"blur"}],event_name:[{required:!0,message:"GA4 event name is required",trigger:"blur"},{pattern:/^[a-z0-9_]+$/,message:"Event name must be in snake_case format",trigger:"blur"}],trigger_value:[{required:!0,message:"Trigger target is required",trigger:"blur"}]},h=S(()=>o.value!==null?s.value.custom_events[o.value]:null),f=S(()=>{var E;return((E=window.htga4Settings)==null?void 0:E.isProActive)==="1"}),p=S(()=>{var E;return((E=s.value.custom_events)==null?void 0:E.length)||0}),g=()=>{if(!f.value&&p.value>=2){c.value=!0;return}c.value=!1;const E={id:"custom_event_"+Date.now(),active:0,name:"",event_name:"",trigger_type:"click",trigger_value:"",trigger_preset:"",parameter_mode:"simple",event_category:"",event_label:"",event_value:1,parameters:[]};Array.isArray(s.value.custom_events)||(s.value.custom_events=[]),o.value=s.value.custom_events.length,s.value.custom_events.push(E),i.value=!0},m=E=>{o.value=E,i.value=!0;const F=s.value.custom_events[E];F&&!F.parameter_mode&&(F.parameter_mode="simple")},y=E=>{Array.isArray(s.value.custom_events)||(s.value.custom_events=[]),s.value.custom_events.splice(E,1)[0];const F=s.value.custom_events.filter((he,Y,Q)=>Q.findIndex(Z=>Z.id===he.id)===Y);s.value.custom_events=F,p.value<2&&(c.value=!1)},b=()=>{o.value=null,i.value=!1},k=E=>{E&&u[E]&&(h.value.trigger_value=u[E])},D=()=>{h.value.parameters||(h.value.parameters=[]),h.value.parameters.push({param_key:"",param_value_type:"static_text",param_value:""});const E=h.value.parameters.length-1;l.value=[E]},C=E=>{h.value.parameters.splice(E,1)},O=E=>{switch(E){case"static_text":return"e.g: engagement, conversion";case"dynamic_click_text":return"Will use clicked element text";case"dynamic_href_filename":return"Will extract filename from href";case"dynamic_page_url":return"Will use current page URL";case"dynamic_form_id":return"Will use form ID or name";case"dynamic_data_attribute":return"e.g: data-location, data-type";case"dynamic_closest_section":return"Will use closest section class";default:return"Enter value or attribute name"}},A=E=>{switch(E){case"static_text":return"Enter a fixed value that will be sent with every event";case"dynamic_click_text":return"Automatically captures the text content of the clicked element";case"dynamic_href_filename":return"Extracts the filename from the href attribute of clicked links";case"dynamic_page_url":return"Uses the current page URL when the event fires";case"dynamic_form_id":return"Captures the ID or name attribute of the submitted form";case"dynamic_data_attribute":return"Specify which data-* attribute to extract (e.g., data-location)";case"dynamic_closest_section":return"Finds the nearest section element and uses its class name";default:return"Select a value type to see description"}},I=E=>{switch(E){case"click":return"Enter a CSS selector to target specific elements that users can click (e.g., buttons, links, form elements). Use presets above for common scenarios.";case"form_submit":return"Enter a CSS selector to target specific forms that users can submit (e.g., contact forms, newsletter signups, checkout forms). Use presets above for common scenarios.";case"page_view":return"Enter a URL pattern to track when users visit specific pages or sections of your website (e.g., /contact, /checkout, /download/*). Use wildcards (*) for dynamic URLs.";default:return"Enter a CSS selector or URL pattern to define when this event should be triggered. Use presets above for common scenarios."}},z=E=>{switch(E){case"click":return'e.g., .cta-button, #newsletter-form, a[href*="download"]';case"form_submit":return'e.g., #contact-form, .newsletter-form, form[name="signup"]';case"page_view":return"e.g., /contact, /checkout, /download/*";default:return"e.g., .cta-button, #newsletter-form, /download"}};Me(()=>{var E;return(E=h.value)==null?void 0:E.trigger_type},(E,F)=>{var he,Y,Q;if(E&&h.value){const Z=window.htga4SettingsSchema["custom-events_route"];(Q=(Y=(he=Z==null?void 0:Z.fields)==null?void 0:he.custom_events)==null?void 0:Y.fields)!=null&&Q.trigger_value&&(Z.fields.custom_events.fields.trigger_value.desc=I(E),Z.fields.custom_events.fields.trigger_value.placeholder=z(E)),F&&E!==F&&(h.value.trigger_value="")}},{immediate:!0});const W=async()=>{try{await r.value.validate(),a.value=!0;try{await e.dispatch("saveSettings"),Vt.success({message:"Custom event saved successfully",offset:40})}catch{Vt.error({message:"Failed to save custom event",offset:40})}finally{a.value=!1}}catch(E){console.log("Validation failed:",E)}},G=()=>{var E;(E=window.htga4Settings)!=null&&E.proUrl&&window.open(window.htga4Settings.proUrl,"_blank")};return(E,F)=>{const he=P("el-tag"),Y=P("el-button"),Q=P("el-card"),Z=P("el-empty"),ye=P("el-input"),ce=P("el-option"),Fe=P("el-option-group"),Ze=P("el-select"),$e=P("el-collapse-item"),He=P("el-collapse"),Ae=P("el-form"),qe=P("el-drawer");return x(),T("div",Pu,[v("div",Du,[(x(!0),T(J,null,le(s.value.custom_events,(j,R)=>(x(),T("div",{key:j.id,class:"custom-event-item"},[v("div",Ru,[v("div",Mu,[v("span",Au,[B(H(j.name)+" ",1),_(he,{size:"small",type:Number(j.active)===1?"success":"info",class:"status-tag"},{default:w(()=>[B(H(Number(j.active)===1?"Enabled":"Disabled"),1)]),_:2},1032,["type"])])]),v("div",Tu,[_(Y,{type:"primary",icon:L(ha),circle:"",size:"small",onClick:V=>m(R)},null,8,["icon","onClick"]),_(Y,{type:"danger",icon:L(Ln),circle:"",size:"small",onClick:V=>y(R)},null,8,["icon","onClick"])])])]))),128))]),_(Y,{type:"primary",onClick:g,icon:L(mn)},{default:w(()=>[B(H(L(n).texts.add_new),1)]),_:1},8,["icon"]),c.value?(x(),T("div",Eu,[_(Ss,{type:"warning"},{default:w(()=>[v("div",Lu,[F[13]||(F[13]=v("h4",null,"Unlock Unlimited Custom Events",-1)),F[14]||(F[14]=v("p",null,"You've reached the 2-event limit in the free version. Upgrade to Pro for unlimited custom events, advanced analytics, and premium support. Start tracking everything that matters to your business.",-1)),_(Y,{type:"primary",size:"medium",onClick:G},{default:w(()=>F[12]||(F[12]=[B(" Upgrade to Pro ")])),_:1})])]),_:1})])):U("",!0),_(qe,{modelValue:i.value,"onUpdate:modelValue":F[11]||(F[11]=j=>i.value=j),title:h.value?"Edit Event":"New Event",size:"900","before-close":b},{header:w(({close:j,titleId:R,titleClass:V})=>[v("h2",{id:R,class:ie(V)},H(h.value?"Edit Event":"New Event"),11,Ou)]),default:w(()=>[h.value?(x(),T("div",Iu,[_(Ae,{ref_key:"eventForm",ref:r,model:h.value,rules:d,"label-width":"auto"},{default:w(()=>[_(Q,{shadow:"always",class:"settings-card"},{header:w(()=>[v("span",Fu,H(L(n).texts.basic_settings),1)]),default:w(()=>[_(we,{modelValue:h.value.active,"onUpdate:modelValue":F[0]||(F[0]=j=>h.value.active=j),fieldSchema:L(Se)(je,"custom_events.active"),context:h.value},null,8,["modelValue","fieldSchema","context"]),_(we,{modelValue:h.value.name,"onUpdate:modelValue":F[1]||(F[1]=j=>h.value.name=j),fieldSchema:L(Se)(je,"custom_events.name"),context:h.value},null,8,["modelValue","fieldSchema","context"]),_(we,{modelValue:h.value.event_name,"onUpdate:modelValue":F[2]||(F[2]=j=>h.value.event_name=j),fieldSchema:L(Se)(je,"custom_events.event_name"),context:h.value},null,8,["modelValue","fieldSchema","context"])]),_:1}),_(Q,{shadow:"always",class:"settings-card"},{header:w(()=>[v("span",Vu,H(L(n).texts.trigger_settings),1)]),default:w(()=>[_(we,{modelValue:h.value.trigger_type,"onUpdate:modelValue":F[3]||(F[3]=j=>h.value.trigger_type=j),fieldSchema:L(Se)(je,"custom_events.trigger_type"),context:h.value},null,8,["modelValue","fieldSchema","context"]),_(we,{modelValue:h.value.trigger_preset,"onUpdate:modelValue":[F[4]||(F[4]=j=>h.value.trigger_preset=j),k],fieldSchema:L(Se)(je,"custom_events.trigger_preset"),context:h.value},null,8,["modelValue","fieldSchema","context"]),(x(),M(we,{modelValue:h.value.trigger_value,"onUpdate:modelValue":F[5]||(F[5]=j=>h.value.trigger_value=j),fieldSchema:L(Se)(je,"custom_events.trigger_value"),context:h.value,key:`trigger-value-${h.value.trigger_type}`},null,8,["modelValue","fieldSchema","context"]))]),_:1}),_(Q,{shadow:"always",class:"settings-card"},{header:w(()=>[v("span",$u,H(L(n).texts.event_parameters),1)]),default:w(()=>[_(we,{modelValue:h.value.parameter_mode,"onUpdate:modelValue":F[6]||(F[6]=j=>h.value.parameter_mode=j),fieldSchema:L(Se)(je,"custom_events.parameter_mode"),context:h.value},null,8,["modelValue","fieldSchema","context"]),h.value&&(h.value.parameter_mode==="simple"||!h.value.parameter_mode)?(x(),T("div",zu,[_(we,{modelValue:h.value.event_category,"onUpdate:modelValue":F[7]||(F[7]=j=>h.value.event_category=j),fieldSchema:L(Se)(je,"custom_events.event_category"),context:h.value},null,8,["modelValue","fieldSchema","context"]),_(we,{modelValue:h.value.event_label,"onUpdate:modelValue":F[8]||(F[8]=j=>h.value.event_label=j),fieldSchema:L(Se)(je,"custom_events.event_label"),context:h.value},null,8,["modelValue","fieldSchema","context"]),_(we,{modelValue:h.value.event_value,"onUpdate:modelValue":F[9]||(F[9]=j=>h.value.event_value=j),fieldSchema:L(Se)(je,"custom_events.event_value"),context:h.value},null,8,["modelValue","fieldSchema","context"])])):h.value&&h.value.parameter_mode==="advanced"?(x(),T("div",Bu,[!h.value.parameters||h.value.parameters.length===0?(x(),T("div",Nu,[_(Z,{description:"No parameters added yet","image-size":80},{default:w(()=>[_(Y,{type:"primary",onClick:D,icon:L(mn)},{default:w(()=>F[15]||(F[15]=[B(" Add Your First Parameter ")])),_:1},8,["icon"])]),_:1})])):(x(),T("div",Uu,[_(He,{modelValue:l.value,"onUpdate:modelValue":F[10]||(F[10]=j=>l.value=j),accordion:""},{default:w(()=>[(x(!0),T(J,null,le(h.value.parameters,(j,R)=>(x(),M($e,{key:R,name:R,class:"parameter-collapse-item"},{title:w(()=>[v("div",Hu,[v("span",ju,[v("span",Wu,"#"+H(R+1),1),v("span",Gu,H(j.param_key||"Unnamed Parameter"),1)]),v("div",qu,[_(Y,{type:"danger",icon:L(Ln),circle:"",size:"small",onClick:Et(V=>C(R),["stop"]),class:"remove-btn"},null,8,["icon","onClick"])])])]),default:w(()=>[v("div",Yu,[v("div",Xu,[v("label",null,[F[16]||(F[16]=B(" Parameter Key ")),_(as,{content:"• The name of the parameter that will be sent to GA4 <br>• e.g., event_category, cta_text, page_title",placement:"top",effect:"dark"})]),_(ye,{modelValue:j.param_key,"onUpdate:modelValue":V=>j.param_key=V,placeholder:"e.g: event_category, cta_text",clearable:"",size:"small"},null,8,["modelValue","onUpdate:modelValue"])]),v("div",Ku,[v("label",null,[F[17]||(F[17]=B(" Value Type ")),_(as,{content:"• Choose how the parameter value will be determined <br>• static text or dynamically extracted from the page",placement:"top",effect:"dark"})]),_(Ze,{modelValue:j.param_value_type,"onUpdate:modelValue":V=>j.param_value_type=V,placeholder:"Select value type",style:{width:"100%"},size:"medium"},{default:w(()=>[_(Fe,{label:"Static Values"},{default:w(()=>[_(ce,{label:"Static Text",value:"static_text"})]),_:1}),_(Fe,{label:"Dynamic Values"},{default:w(()=>[_(ce,{label:"Clicked Element Text",value:"dynamic_click_text"}),_(ce,{label:"File Name from Href",value:"dynamic_href_filename"}),_(ce,{label:"Current Page URL",value:"dynamic_page_url"}),_(ce,{label:"Form ID",value:"dynamic_form_id"}),_(ce,{label:"Data Attribute",value:"dynamic_data_attribute"}),_(ce,{label:"Closest Section",value:"dynamic_closest_section"})]),_:1})]),_:2},1032,["modelValue","onUpdate:modelValue"])]),v("div",Qu,[v("label",null,[F[18]||(F[18]=B(" Parameter Value ")),_(as,{content:A(j.param_value_type),placement:"top",effect:"dark"},null,8,["content"])]),_(ye,{modelValue:j.param_value,"onUpdate:modelValue":V=>j.param_value=V,placeholder:O(j.param_value_type),clearable:"",size:"small"},null,8,["modelValue","onUpdate:modelValue","placeholder"])])])]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue"])])),v("div",Zu,[_(Y,{onClick:D,icon:L(mn),type:"primary",plain:"",size:"large"},{default:w(()=>F[19]||(F[19]=[B(" Add Parameter ")])),_:1},8,["icon"])])])):U("",!0)]),_:1})]),_:1},8,["model"])])):U("",!0)]),footer:w(()=>[v("div",Ju,[_(Y,{onClick:b,disabled:a.value},{default:w(()=>[B(H(L(n).texts.cancel),1)]),_:1},8,["disabled"]),_(Y,{type:"primary",onClick:W,loading:a.value},{default:w(()=>[B(H(L(n).texts.save),1)]),_:1},8,["loading"])])]),_:1},8,["modelValue","title"])])}}},td=se(ed,[["__scopeId","data-v-f9039c2d"]]),sd={class:"cookie-notice-settings"},wn="cookie_notice_route",nd={__name:"CookieNotice",setup(t){Br(r=>({89205138:s.value.cookie_notice_enabled==!0?"block":"none",ebf5ac80:s.value.cookie_notice_banner_bg_color||"#0099ff","7ebdb578":s.value.cookie_notice_banner_text_color||"#ffffff","0004b1d1":s.value.cookie_notice_privacy_link_color||"#ffffff","41861a3c":s.value.cookie_notice_accept_bg_color||"#ffffff","08ca9394":s.value.cookie_notice_accept_text_color||"#000000","1a4b3645":s.value.cookie_notice_decline_bg_color||"transparent","0186072c":s.value.cookie_notice_decline_text_color||"#ffffff"}));const e=X(),s=S(()=>e.state.settings),n=window.htga4SettingsSchema[wn],i=n.sections;S(()=>{var r;return((r=window==null?void 0:window.htga4_cookie_notice_params)==null?void 0:r.notice_html)??""});const o=S(()=>Object.values(n.fields).filter(r=>!r.section).map(r=>r.id));Me(()=>s.value,()=>{},{deep:!0});const a=S(()=>{const r=[];return Object.keys(i).forEach(l=>{let c={};c.title=n.sections[l].title,c.description=n.sections[l].description;const u=Object.values(n.fields).filter(d=>d.section===l);c.fields=u.map(d=>d.id),r.push(c)}),r});return S(()=>({banner:{backgroundColor:s.value.cookie_notice_banner_bg_color||"#0099ff",color:s.value.cookie_notice_banner_text_color||"#ffffff",padding:"15px",display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:"10px"},text:{color:s.value.cookie_notice_banner_text_color||"#ffffff"},privacyLink:{color:s.value.cookie_notice_privacy_link_color||"#ffffff",marginLeft:"5px",textDecoration:"underline"},acceptBtn:{backgroundColor:s.value.cookie_notice_accept_bg_color||"#ffffff",color:s.value.cookie_notice_accept_text_color||"#000000",border:"none",padding:"8px 16px",borderRadius:"4px",cursor:"pointer",marginLeft:"10px"},declineBtn:{backgroundColor:s.value.cookie_notice_decline_bg_color||"transparent",color:s.value.cookie_notice_decline_text_color||"#ffffff",border:"1px solid "+(s.value.cookie_notice_decline_text_color||"#ffffff"),padding:"8px 16px",borderRadius:"4px",cursor:"pointer"}})),(r,l)=>{const c=P("el-form");return x(),T("div",sd,[_(c,{model:s.value,"label-width":"auto"},{default:w(()=>[_(Gs,null,{default:w(()=>[(x(!0),T(J,null,le(o.value,u=>(x(),M(we,{key:u,modelValue:s.value[u],"onUpdate:modelValue":d=>s.value[u]=d,fieldSchema:L(Se)(wn,u)},null,8,["modelValue","onUpdate:modelValue","fieldSchema"]))),128))]),_:1}),(x(!0),T(J,null,le(a.value,(u,d)=>(x(),M(Gs,{key:d,title:u.title,description:u.description},{default:w(()=>[(x(!0),T(J,null,le(u.fields,h=>(x(),M(we,{key:h,modelValue:s.value[h],"onUpdate:modelValue":f=>s.value[h]=f,fieldSchema:L(Se)(wn,h)},null,8,["modelValue","onUpdate:modelValue","fieldSchema"]))),128))]),_:2},1032,["title","description"]))),128))]),_:1},8,["model"])])}}},id=se(nd,[["__scopeId","data-v-61fc8878"]]),od={class:"tools-settings"},Ki="tools_route",ad={__name:"Tools",setup(t){const e=window.htga4SettingsSchema[Ki],s=Object.keys(e.fields),n=X(),i=S(()=>n.state.settings);return(o,a)=>{const r=P("el-form");return x(),T("div",od,[_(r,{model:i.value,"label-width":"auto"},{default:w(()=>[(x(!0),T(J,null,le(L(s),l=>(x(),M(we,{key:l,modelValue:i.value[l],"onUpdate:modelValue":c=>i.value[l]=c,fieldSchema:L(Se)(Ki,l)},null,8,["modelValue","onUpdate:modelValue","fieldSchema"]))),128))]),_:1},8,["model"])])}}},rd={class:"htga4-settings-section"},ld={class:"htga4-cache-info"},cd={class:"htga4-cache-info__intro"},ud={class:"htga4-cache-info__details"},dd={class:"htga4-cache-info__column"},hd={class:"htga4-cache-info__list"},fd={class:"htga4-cache-info__column"},pd={class:"htga4-cache-info__list"},gd={class:"htga4-cache-management"},md={__name:"Cache",setup(t){const e=ne(!1),s=ne(!1),n=ne({text:"",type:"success"}),i=(a,r="success")=>{n.value={text:a,type:r}},o=async()=>{var a;e.value=!0;try{const r=`${window.htga4Settings.apiBaseURL}htga4/v1/tools/clear-cache`,l=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":(a=window.htga4Settings)==null?void 0:a.nonce}});if(!l.ok)throw new Error(`API request failed: ${l.statusText}`);const c=await l.json();if(c.success)i(c.message||"Cache cleared successfully!","success"),s.value=!0;else throw new Error(c.message||"Failed to clear cache.")}catch(r){console.error("Cache clearing error:",r),i(r.message||"An error occurred while clearing cache.","error")}finally{e.value=!1}};return(a,r)=>{const l=P("el-icon"),c=P("el-button");return x(),T("div",rd,[r[10]||(r[10]=v("h2",{style:{"margin-top":"0"}},"Cache Management",-1)),v("div",ld,[v("div",cd,[_(l,{class:"htga4-cache-info__icon"},{default:w(()=>[_(L(da))]),_:1}),r[0]||(r[0]=v("p",null,"Google Analytics data is cached to improve performance and reduce API requests. If you are experiencing data synchronization issues, you can clear the cache to fetch fresh data from Google Analytics.",-1))]),v("div",ud,[v("div",dd,[r[4]||(r[4]=v("h3",null,"Cached Data Types",-1)),v("ul",hd,[v("li",null,[_(l,null,{default:w(()=>[_(L(Nr))]),_:1}),r[1]||(r[1]=v("div",null,[v("strong",null,"Reports"),v("p",null,"Standard reports, ecommerce reports, and realtime reports")],-1))]),v("li",null,[_(l,null,{default:w(()=>[_(L(Ur))]),_:1}),r[2]||(r[2]=v("div",null,[v("strong",null,"Account Data"),v("p",null,"GA4 accounts, properties, and data streams information")],-1))]),v("li",null,[_(l,null,{default:w(()=>[_(L(Hr))]),_:1}),r[3]||(r[3]=v("div",null,[v("strong",null,"User Data"),v("p",null,"User informations")],-1))])])]),v("div",fd,[r[8]||(r[8]=v("h3",null,"When to Clear Cache",-1)),v("ul",pd,[v("li",null,[_(l,null,{default:w(()=>[_(L(jr))]),_:1}),r[5]||(r[5]=v("p",null,"When data shown in reports appears outdated",-1))]),v("li",null,[_(l,null,{default:w(()=>[_(L(On))]),_:1}),r[6]||(r[6]=v("p",null,"After making changes to your Google Analytics setup",-1))]),v("li",null,[_(l,null,{default:w(()=>[_(L(fa))]),_:1}),r[7]||(r[7]=v("p",null,"If the force refresh option in reports is not resolving issues",-1))])])])])]),v("div",gd,[_(c,{type:"primary",size:"large",loading:e.value,onClick:o,disabled:e.value||s.value,icon:L(Ln)},{default:w(()=>r[9]||(r[9]=[B(" Clear Cache ")])),_:1},8,["loading","disabled","icon"]),n.value.text?(x(),M(Ss,{key:0,type:n.value.type,class:"htga4-cache-message"},{default:w(()=>[B(H(n.value.text),1)]),_:1},8,["type"])):U("",!0)])])}}},Qi=`${htga4Settings.apiBaseURL}htga4/v1`,_d=()=>{var t;return{"Content-Type":"application/json","X-WP-Nonce":(t=window.htga4Settings)==null?void 0:t.nonce}},ke=async(t,e={})=>{try{let s=t;t&&!t.startsWith("http")&&(s=`${Qi}${t.startsWith("/")?t:"/"+t}`),t||(s=Qi);const n=await fetch(s,{...e,headers:{..._d(),...e.headers}});if(!n.ok)throw new Error(`API request failed: ${n.statusText}`);return await n.json()}catch(s){throw console.error("API request error:",s),s}},vd={getSettings:()=>ke("/settings"),updateSettings:t=>ke("/settings",{method:"POST",body:JSON.stringify(t)})},bd={getRoles:()=>ke("/roles")},yd={getAccounts:(t=!1)=>{const e=new URLSearchParams;t&&e.append("force_refresh","1");let s="/accounts";return e.toString()&&(s=`${s}?${e.toString()}`),ke(s)},getProperties:(t,e=!1)=>{if(!t)return Promise.resolve({});const s=new URLSearchParams;e&&s.append("force_refresh","1");let n=`/properties/${t}`;return s.toString()&&(n=`${n}?${s.toString()}`),ke(n)},getDataStreams:(t,e=!1)=>{if(!t)return Promise.resolve({});const s=new URLSearchParams;e&&s.append("force_refresh","1");let n=`/datastreams/${t}`;return s.toString()&&(n=`${n}?${s.toString()}`),ke(n)},getMeasurementProtocolSecrets:(t,e,s=!1)=>{if(!t||!e)return Promise.resolve({});const n=new URLSearchParams;s&&n.append("force_refresh","1");let i=`/measurement-protocol-secrets/${t}/${e}`;return n.toString()&&(i=`${i}?${n.toString()}`),ke(i)}},xd={fetchStandardReports:async({startDate:t=null,endDate:e=null,forceRefresh:s=!1}={})=>{try{const n=new URLSearchParams;t&&e&&(n.append("date_from",qs(t)),n.append("date_to",qs(e))),s&&n.append("force_refresh","1");let i="/reports/standard";return n.toString()&&(i=`${i}?${n.toString()}`),await ke(i)}catch(n){throw console.error("Error loading standard reports data:",n),n}}},wd={fetchEcommerceReports:async({startDate:t=null,endDate:e=null,forceRefresh:s=!1}={})=>{try{const n=new URLSearchParams;t&&e&&(n.append("date_from",qs(t)),n.append("date_to",qs(e))),s&&n.append("force_refresh","1");let i="/reports/ecommerce";return n.toString()&&(i=`${i}?${n.toString()}`),await ke(i)}catch(n){throw console.error("Error loading ecommerce reports data:",n),n}}},Sd={fetchRealtimeReports:async(t=!1)=>{try{const e=new URLSearchParams;t&&e.append("force_refresh","1");let s="/reports/realtime";return e.toString()&&(s=`${s}?${e.toString()}`),await ke(s)}catch(e){throw console.error("Error loading realtime reports data:",e),e}}},kd={getUserInfo:(t=!1)=>{let e="/userinfo";return t&&(e=`${e}?force_refresh=1`),ke(e)}},Cd={getDataStream:(t,e,s=!1)=>{const n=new URLSearchParams;n.append("property_id",t),n.append("stream_id",e),s&&n.append("force_refresh","1");let i="/datastream";return n.toString()&&(i=`${i}?${n.toString()}`),ke(i)}},qs=t=>t?(typeof t=="string"?new Date(t):t).toISOString().split("T")[0]:"",Pd={getSettings:()=>ke("/google-ads/settings"),updateSettings:t=>ke("/google-ads/settings",{method:"POST",body:JSON.stringify(t)}),testConversion:()=>ke("/google-ads/test",{method:"POST"})},Le={settings:vd,roles:bd,ga4:yd,standard:xd,ecommerce:wd,realtime:Sd,user:kd,dataStream:Cd,googleAds:Pd,get:t=>ke(t),post:(t,e)=>ke(t,{method:"POST",body:e?JSON.stringify(e):void 0})},Dd={name:"GoogleAdsSettings",components:{SettingsCard:Gs},setup(){const t=X(),e=ne(null),s=ne(!1),n=ne(!1),i=ne(["1"]),o=S({get(){var D,C,O,A,I,z,W,G,E,F,he;const b=((D=t.state.settings)==null?void 0:D.google_ads)||{},k=b.conversion_labels||{};return{enabled:b.enabled||!1,conversion_id:b.conversion_id||"",excluded_roles:"excluded_roles"in b?b.excluded_roles:["administrator"],conversion_labels:{purchase:{enabled:((C=k.purchase)==null?void 0:C.enabled)||!1,label:((O=k.purchase)==null?void 0:O.label)||""},add_to_cart:{enabled:((A=k.add_to_cart)==null?void 0:A.enabled)||!1,label:((I=k.add_to_cart)==null?void 0:I.label)||""},checkout:{enabled:((z=k.checkout)==null?void 0:z.enabled)||!1,label:((W=k.checkout)==null?void 0:W.label)||""},view_product:{enabled:((G=k.view_product)==null?void 0:G.enabled)||!1,label:((E=k.view_product)==null?void 0:E.label)||""},view_category:{enabled:((F=k.view_category)==null?void 0:F.enabled)||!1,label:((he=k.view_category)==null?void 0:he.label)||""}}}},set(b){t.commit("updateSettings",{google_ads:b})}}),a=S(()=>({conversion_id:o.value.enabled?[{required:!0,message:"Please enter your Conversion ID",trigger:"blur"},{pattern:/^[0-9]{9,10}$/,message:"Conversion ID must be 9-10 digits",trigger:"blur"}]:[]})),r=ne({show:!1,type:"",message:""}),l=S(()=>{var b;return((b=window.htga4Settings)==null?void 0:b.isProActive)==="1"}),c=[{key:"purchase",icon:"el-icon-shopping-cart-2",title:"Purchase Event",placeholder:"e.g., AbCdEfGhIjKl",description:"Track when customers complete a purchase",isPro:!1},{key:"add_to_cart",icon:"el-icon-shopping-bag-1",title:"Add to Cart Event",placeholder:"e.g., XyZ123456789",description:"Track when customers add products to their cart",isPro:!0},{key:"checkout",icon:"el-icon-tickets",title:"Checkout Event",placeholder:"e.g., DeF456789012",description:"Track when customers initiate checkout process",isPro:!0},{key:"view_product",icon:"el-icon-view",title:"View Product Event",placeholder:"e.g., GhI345678901",description:"Track when customers view product pages",isPro:!0},{key:"view_category",icon:"el-icon-folder-opened",title:"View Category Event",placeholder:"e.g., JkL567890123",description:"Track when customers view category pages",isPro:!0}],u=S(()=>{const b=o.value.conversion_labels&&Object.values(o.value.conversion_labels).some(k=>k.enabled&&k.label&&k.label.trim()!=="");return{hasConversionId:!!o.value.conversion_id,hasConversionLabel:b,isEnabled:o.value.enabled}}),d=S(()=>u.value.hasConversionId?u.value.hasConversionLabel?u.value.isEnabled?3:2:1:0),h=S(()=>u.value.hasConversionId&&u.value.hasConversionLabel&&u.value.isEnabled),f=(b,k)=>{const D={...o.value,[b]:k};t.commit("updateSettings",{google_ads:D}),console.log(`Updated ${b}:`,k)},p=(b,k,D)=>{const C={...o.value,conversion_labels:{...o.value.conversion_labels,[b]:{...o.value.conversion_labels[b],[k]:D}}};t.commit("updateSettings",{google_ads:C}),console.log(`Updated conversion_labels.${b}.${k}:`,D)};return Me(()=>t.state.isSaving,async b=>{if(b&&e.value){if(console.log("Google Ads - Saving form data:",o.value),!o.value.enabled){t.commit("updateSettings",{google_ads:o.value});return}try{await e.value.validate()&&t.commit("updateSettings",{google_ads:o.value})}catch(k){console.error("Validation failed:",k),t.commit("updateSettings",{google_ads:o.value})}}}),{settingsForm:e,formData:o,rules:a,saving:s,testing:n,testResult:r,setupStatus:u,currentStep:d,isSetupComplete:h,activeStep:i,conversionEvents:c,isProActive:l,testConversion:async()=>{try{n.value=!0,r.value.show=!1,console.log("Testing conversion with settings:",o.value);const b=await Le.post("/google-ads/test");if(console.log("Test response:",b),b.tracking_code)try{if(window.gtag){const k=b.tracking_code.match(/gtag\('event',\s*'conversion',\s*({[^}]+})\)/);if(k){const D=new Function("return "+k[1])();window.gtag("event","conversion",D),console.log("Test conversion sent to Google Ads:",D),r.value={show:!0,type:"success",message:"Test conversion sent successfully! Check your Google Ads account in a few minutes."}}else throw new Error("Invalid tracking code format")}else r.value={show:!0,type:"warning",message:"Google Ads tracking script not found on this page. Please ensure Google Ads tracking is enabled and visit your frontend site to test."}}catch(k){console.error("Failed to execute tracking code:",k),r.value={show:!0,type:"error",message:"Failed to send test conversion. Please check your settings and try again."}}else r.value={show:!0,type:"success",message:b.message||"Test conversion prepared."}}catch(b){console.error("Test conversion error:",b);let k="Test failed";b.message&&(k=b.message),r.value={show:!0,type:"error",message:k}}finally{n.value=!1}},updateFormField:f,updateConversionLabel:p,openProUpgrade:()=>{var b;(b=window.htga4Settings)!=null&&b.proUrl&&window.open(window.htga4Settings.proUrl,"_blank")},handleProFieldClick:(b,k)=>{k.isPro&&!l.value&&(t.commit("setDisplayProModal",!0),b.preventDefault(),b.stopPropagation())}}}},Rd={class:"htga4-google-ads-settings"},Md={class:"setup-status"},Ad={key:0},Td={key:1},Ed={key:0},Ld={key:1},Od={class:"step-details"},Id={style:{display:"flex","align-items":"center",gap:"10px"}},Fd={style:{display:"flex","align-items":"center","justify-content":"space-between",width:"100%",gap:"10px"}},Vd={class:"event-title-wrapper"},$d={key:0},zd={class:"form-help"},Bd={class:"test-conversion-section"};function Nd(t,e,s,n,i,o){const a=P("el-alert"),r=P("el-card"),l=P("el-step"),c=P("el-steps"),u=P("el-collapse-item"),d=P("el-collapse"),h=P("el-switch"),f=P("el-form-item"),p=P("el-col"),g=P("el-input"),m=P("el-checkbox"),y=P("el-checkbox-group"),b=P("el-row"),k=P("SettingsCard"),D=P("el-tag"),C=P("el-form"),O=P("el-button");return x(),T("div",Rd,[n.isSetupComplete?U("",!0):(x(),M(r,{key:0,class:"status-card",shadow:"never"},{default:w(()=>[v("div",Md,[_(a,{type:n.setupStatus.hasConversionId?"success":"warning",closable:!1},{title:w(()=>[n.setupStatus.hasConversionId?(x(),T("span",Td,e[5]||(e[5]=[v("i",{class:"el-icon-success"},null,-1),B(" Almost Done! ")]))):(x(),T("span",Ad,e[4]||(e[4]=[v("i",{class:"el-icon-warning"},null,-1),B(" Setup Required ")])))]),default:w(()=>[n.setupStatus.hasConversionId?(x(),T("div",Ld," Add your conversion label to start tracking conversions ")):(x(),T("div",Ed," Follow the steps below to configure Google Ads conversion tracking "))]),_:1},8,["type"])])]),_:1})),n.isSetupComplete?U("",!0):(x(),M(r,{key:1,class:"setup-steps-card",shadow:"never"},{header:w(()=>e[6]||(e[6]=[v("h3",null,"Setup Instructions",-1)])),default:w(()=>[_(c,{active:n.currentStep,"finish-status":"success","align-center":""},{default:w(()=>[_(l,{title:"Get Conversion ID",description:"From Google Ads account"}),_(l,{title:"Find Conversion Label",description:"From conversion tag"}),_(l,{title:"Configure Settings",description:"Enter details below"}),_(l,{title:"Test & Verify",description:"Confirm tracking works"})]),_:1},8,["active"]),v("div",Od,[_(d,{modelValue:n.activeStep,"onUpdate:modelValue":e[0]||(e[0]=A=>n.activeStep=A)},{default:w(()=>[_(u,{title:"Step 1: Get Your Conversion ID",name:"1"},{default:w(()=>e[7]||(e[7]=[v("ol",null,[v("li",null,[B("Log in to your "),v("a",{href:"https://ads.google.com",target:"_blank"},"Google Ads account")]),v("li",null,[B("Navigate to "),v("strong",null,"Tools & Settings > Conversions")]),v("li",null,"Click on your purchase conversion (or create one)"),v("li",null,[B("Find the "),v("strong",null,"Conversion ID"),B(" (9-10 digits)")]),v("li",null,"Copy and paste it in the field below")],-1)])),_:1}),_(u,{title:"Step 2: Find Your Conversion Label",name:"2"},{default:w(()=>e[8]||(e[8]=[v("ol",null,[v("li",null,"In the conversion details page"),v("li",null,[B("Click on "),v("strong",null,"Tag setup")]),v("li",null,[B("Choose "),v("strong",null,"Install the tag yourself")]),v("li",null,[B("In the Global site tag, find: "),v("code",null,"send_to: 'AW-123456789/AbCdEfGhIjKl'")]),v("li",null,[B("Copy the part after the slash (e.g., "),v("code",null,"AbCdEfGhIjKl"),B(")")])],-1)])),_:1})]),_:1},8,["modelValue"])])]),_:1})),_(C,{ref:"settingsForm",model:n.formData,rules:n.rules,"label-position":"top"},{default:w(()=>[_(k,{title:"Basic Configuration",icon:"el-icon-setting"},{default:w(()=>[_(b,{gutter:20},{default:w(()=>[_(p,{span:24},{default:w(()=>[_(f,{label:"Enable Google Ads Tracking",prop:"enabled"},{default:w(()=>[v("div",Id,[_(h,{"model-value":n.formData.enabled,"onUpdate:modelValue":e[1]||(e[1]=A=>n.updateFormField("enabled",A))},null,8,["model-value"]),e[9]||(e[9]=v("span",null,"Enable or disable Google Ads conversion tracking",-1))])]),_:1})]),_:1}),_(p,{span:24},{default:w(()=>[_(f,{label:"Conversion ID",prop:"conversion_id",required:""},{default:w(()=>[_(g,{"model-value":n.formData.conversion_id,"onUpdate:modelValue":e[2]||(e[2]=A=>n.updateFormField("conversion_id",A)),placeholder:"e.g., 123456789",maxlength:"10","show-word-limit":""},null,8,["model-value"]),e[10]||(e[10]=v("div",{class:"form-help"},[B(" Your Google Ads Conversion ID (9-10 digits, without AW- prefix) "),v("a",{href:"https://support.google.com/google-ads/answer/7548399",target:"_blank"},[v("i",{class:"el-icon-question"}),B(" Where to find this? ")])],-1))]),_:1})]),_:1}),_(p,{span:24},{default:w(()=>[_(f,{label:"Exclude User Roles"},{default:w(()=>[_(y,{"model-value":n.formData.excluded_roles,"onUpdate:modelValue":e[3]||(e[3]=A=>n.updateFormField("excluded_roles",A))},{default:w(()=>[_(m,{label:"administrator"},{default:w(()=>e[11]||(e[11]=[B("Administrator")])),_:1}),_(m,{label:"editor"},{default:w(()=>e[12]||(e[12]=[B("Editor")])),_:1}),_(m,{label:"author"},{default:w(()=>e[13]||(e[13]=[B("Author")])),_:1}),_(m,{label:"contributor"},{default:w(()=>e[14]||(e[14]=[B("Contributor")])),_:1})]),_:1},8,["model-value"]),e[15]||(e[15]=v("div",{class:"form-help"}," Exclude specific user roles from tracking ",-1))]),_:1})]),_:1})]),_:1})]),_:1}),_(k,{title:"Conversion Events",icon:"el-icon-data-line"},{default:w(()=>[e[17]||(e[17]=v("div",{class:"form-help",style:{"margin-bottom":"20px"}}," Enable specific conversion events and set their unique conversion labels from Google Ads. ",-1)),(x(!0),T(J,null,le(n.conversionEvents,A=>(x(),M(b,{key:A.key,class:ie(["conversion-event-row",{"htga4-pro-field-opacity":A.isPro&&!n.isProActive}]),onClick:I=>n.handleProFieldClick(I,A)},{default:w(()=>[_(p,{span:24},{default:w(()=>[_(f,{style:{"margin-bottom":"0"}},{label:w(()=>{var I,z;return[v("div",Fd,[v("div",Vd,[B(H(A.title)+" ",1),A.isPro&&!n.isProActive?(x(),M(D,{key:0,type:"danger",round:"",size:"small"},{default:w(()=>e[16]||(e[16]=[B("Pro")])),_:1})):U("",!0)]),_(h,{"model-value":(z=(I=n.formData.conversion_labels)==null?void 0:I[A.key])==null?void 0:z.enabled,"onUpdate:modelValue":W=>n.updateConversionLabel(A.key,"enabled",W),disabled:A.isPro&&!n.isProActive},null,8,["model-value","onUpdate:modelValue","disabled"])])]}),default:w(()=>{var I,z;return[(z=(I=n.formData.conversion_labels)==null?void 0:I[A.key])!=null&&z.enabled?(x(),T("div",$d,[_(f,{label:"Conversion Label",style:{"margin-bottom":"0"}},{default:w(()=>{var W,G;return[_(g,{"model-value":(G=(W=n.formData.conversion_labels)==null?void 0:W[A.key])==null?void 0:G.label,"onUpdate:modelValue":E=>n.updateConversionLabel(A.key,"label",E),placeholder:A.placeholder,disabled:A.isPro&&!n.isProActive,maxlength:"20"},null,8,["model-value","onUpdate:modelValue","placeholder","disabled"])]}),_:2},1024),v("div",zd,H(A.description),1)])):U("",!0)]}),_:2},1024)]),_:2},1024)]),_:2},1032,["class","onClick"]))),128))]),_:1})]),_:1},8,["model","rules"]),v("div",Bd,[_(O,{type:"success",loading:n.testing,disabled:!n.setupStatus.hasConversionId||!n.setupStatus.hasConversionLabel,onClick:n.testConversion},{default:w(()=>e[18]||(e[18]=[v("i",{class:"el-icon-video-play"},null,-1),B(" Test Conversion Tracking ")])),_:1},8,["loading","disabled","onClick"]),n.testResult.show?(x(),T("span",{key:0,class:ie(["test-result",n.testResult.type])},H(n.testResult.message),3)):U("",!0)])])}const Ud=se(Dd,[["render",Nd],["__scopeId","data-v-a581c237"]]),Hd={class:"htga4-content-footer"},jd={__name:"ContentFooter",setup(t){const e=X(),s=Ve(),n=S(()=>e.state.isSaving),i=S(()=>!(["/settings/cache"].includes(s.path)||s.meta&&s.meta.hideFooterSaveButton)),o=async()=>{try{await e.dispatch("saveSettings"),Vt.success({message:"Settings saved successfully",offset:40,duration:3e3,showClose:!0})}catch(a){console.log(a),Vt.error({message:"Failed to save settings",offset:40,duration:3e3,showClose:!0})}};return(a,r)=>{const l=P("el-button");return oi((x(),T("div",Hd,[_(l,{type:"primary",onClick:o,loading:n.value},{default:w(()=>r[0]||(r[0]=[B("Save Changes")])),_:1},8,["loading"])],512)),[[ai,i.value]])}}},Wd={class:"htga4-content-header"},Gd={class:"htga4-content-header-left"},qd={class:"htga4-page-title"},Yd={class:"htga4-header-actions"},Xd={__name:"ContentHeader",setup(t){const e=X(),s=Ve(),n=S(()=>e.state.isSaving),i=S(()=>!(["/settings/tools","/settings/cache"].includes(s.path)||s.meta&&s.meta.hideHeaderSaveButton)),o=S(()=>!![].includes(s.path)),a=S(()=>{let l="",c="Settings";return l=s.path.replace("/settings/",""),l!=""?l=l+"_route":l="root_route",window.htga4SettingsSchema[l]!==void 0&&(c=window.htga4SettingsSchema[l].title),c}),r=async()=>{try{await e.dispatch("saveSettings"),Vt.success({message:"Settings saved successfully",offset:40,duration:3e3,showClose:!0})}catch(l){console.log(l),Vt.error({message:"Failed to save settings",offset:40,duration:3e3,showClose:!0})}};return(l,c)=>{const u=P("el-button");return x(),T("div",Wd,[v("div",Gd,[v("h2",qd,H(a.value),1)]),v("div",Yd,[oi(_(u,{type:"primary",onClick:r,disabled:o.value,loading:n.value},{default:w(()=>c[0]||(c[0]=[B("Save Changes")])),_:1},8,["disabled","loading"]),[[ai,i.value]])])])}}},Kd={__name:"Menu",setup(t){const e=Ve(),s=window.htga4Settings.menu,n=S(()=>e.path==="/settings/general"||e.path==="/settings"?"/settings/general":e.path),i=o=>({"/":On,"events-tracking":Xr,"custom-events":ha,"google-ads":Yr,"cookie-notice":qr,tools:Gr,cache:Wr})[o]||On;return(o,a)=>{const r=P("el-icon"),l=P("el-text"),c=P("el-menu-item"),u=P("el-menu");return x(),M(u,{class:"htga4-menu","background-color":"#fff","default-active":n.value,router:""},{default:w(()=>[(x(!0),T(J,null,le(L(s),(d,h)=>(x(),T(J,{key:h},[d.items?U("",!0):(x(),M(c,{key:0,index:h==="/"?"/settings/general":"/settings/"+h},{default:w(()=>[_(r,{size:"large"},{default:w(()=>[(x(),M(pa(i(h))))]),_:2},1024),_(l,{size:"large"},{default:w(()=>[B(H(d.title),1)]),_:2},1024)]),_:2},1032,["index"]))],64))),128))]),_:1},8,["default-active"])}}},Qd=se(Kd,[["__scopeId","data-v-35d2711f"]]),Zd={class:"htga4-content-body"},Jd={__name:"Settings",setup(t){const e=X();return S(()=>e.state.isLoading),Ce(()=>{const s=new Event("hashchange",{bubbles:!0});window.dispatchEvent(s)}),(s,n)=>{const i=P("el-aside"),o=P("router-view"),a=P("el-main"),r=P("el-container");return x(),M(r,{class:"htga4-main-container"},{default:w(()=>[_(i,{width:"310px",class:"htga4-app-sidebar"},{default:w(()=>[_(Qd)]),_:1}),_(a,{class:"htga4-main-content"},{default:w(()=>[_(Xd),v("div",Zd,[_(o)]),_(jd)]),_:1})]),_:1})}}},eh={};function th(t,e){const s=P("router-view");return x(),T("div",null,[_(s)])}const sh=se(eh,[["render",th]]);function nh(){const t=X(),e=ne(!1),s=ne("last30days"),n=ne([]),i=ne([]),o=ne("last30days"),a=S(()=>{if(n.value&&n.value.length===2){const g=new Date(n.value[0]),m=new Date(n.value[1]);return`${g.toLocaleDateString()} - ${m.toLocaleDateString()}`}return"Select date range"}),r=S(()=>{switch(s.value){case"today":return"Today";case"yesterday":return"Yesterday";case"last7days":return"Last 7 days";case"last30days":return"Last 30 days";case"last90days":return"Last 90 days";case"last365days":return"Last 365 days";case"lastMonth":return"Last month";case"last12months":return"Last 12 months";case"lastYear":return"Last year";case"custom":return"Custom Range";default:return"Custom Range"}}),l=g=>{if(!g||!g.length||!g[0]||!g[1])return"All time";try{const m=new Date(g[0]),y=new Date(g[1]),b={month:"short",day:"numeric"};return`${m.toLocaleDateString("en-US",b)} - ${y.toLocaleDateString("en-US",b)}`}catch(m){return console.error("Error formatting date range:",m),"All time"}},c=g=>g>new Date,u=g=>{s.value=g;const m=new Date;let y=new Date(m),b;switch(g){case"today":b=new Date(m);break;case"yesterday":b=new Date(m),b.setDate(m.getDate()-1),y.setDate(m.getDate()-1);break;case"last7days":b=new Date(m),b.setDate(m.getDate()-6);break;case"last30days":b=new Date(m),b.setDate(m.getDate()-29);break;case"last90days":b=new Date(m),b.setDate(m.getDate()-89);break;case"last365days":b=new Date(m),b.setDate(m.getDate()-364);break;case"lastMonth":b=new Date(m.getFullYear(),m.getMonth()-1,1),y=new Date(m.getFullYear(),m.getMonth(),0);break;case"last12months":b=new Date(m),b.setMonth(m.getMonth()-11),b.setDate(1),y.setDate(m.getDate());break;case"lastYear":b=new Date(m.getFullYear()-1,0,1),y=new Date(m.getFullYear()-1,11,31);break;default:b=new Date(m),b.setDate(m.getDate()-29)}t.commit("setStartDate",b.toISOString().split("T")[0]),t.commit("setEndDate",y.toISOString().split("T")[0]),n.value=[b,y],t.commit("setDateRange",{0:b,1:y})},d=()=>{i.value=[...n.value],o.value=s.value,e.value=!0},h=()=>{n.value=[...i.value],s.value=o.value,e.value=!1},f=()=>{e.value=!1,i.value=[...n.value],o.value=s.value},p=(g,m)=>{g=new Date(g),m=new Date(m),g.setHours(0,0,0,0),m.setHours(0,0,0,0);const y=new Date;if(y.setHours(0,0,0,0),g.getTime()===y.getTime()&&m.getTime()===y.getTime())return s.value="today",!0;const b=new Date(y);if(b.setDate(y.getDate()-1),g.getTime()===b.getTime()&&m.getTime()===b.getTime())return s.value="yesterday",!0;const k=new Date(y);if(k.setDate(y.getDate()-6),g.getTime()===k.getTime()&&m.getTime()===y.getTime())return s.value="last7days",!0;const D=new Date(y);if(D.setDate(y.getDate()-29),g.getTime()===D.getTime()&&m.getTime()===y.getTime())return s.value="last30days",!0;const C=new Date(y);if(C.setDate(y.getDate()-89),g.getTime()===C.getTime()&&m.getTime()===y.getTime())return s.value="last90days",!0;const O=new Date(y);if(O.setDate(y.getDate()-364),g.getTime()===O.getTime()&&m.getTime()===y.getTime())return s.value="last365days",!0;const A=new Date(y.getFullYear(),y.getMonth()-1,1),I=new Date(y.getFullYear(),y.getMonth(),0);if(g.getTime()===A.getTime()&&m.getTime()===I.getTime())return s.value="lastMonth",!0;const z=new Date(y);if(z.setMonth(y.getMonth()-11),z.setDate(1),g.getTime()===z.getTime()&&m.getTime()===y.getTime())return s.value="last12months",!0;const W=new Date(y.getFullYear()-1,0,1),G=new Date(y.getFullYear()-1,11,31);return g.getTime()===W.getTime()&&m.getTime()===G.getTime()?(s.value="lastYear",!0):!1};return u("last30days"),{dateRange:n,datePreset:s,datePopoverVisible:e,selectedDateRangeText:a,datePresetName:r,selectPreset:u,openDatePopover:d,cancelDateSelection:h,applyDateFilter:f,checkIfDateRangeMatchesPreset:p,formatDateRangeLabel:l,disableFutureDates:c}}const ih={class:"htga4-date-picker"},oh={class:"htga4-date-picker__preset-name"},ah={class:"htga4-date-picker__range-text"},rh={class:"htga4-date-picker__content"},lh={class:"htga4-date-picker__calendar"},ch={class:"htga4-date-picker__presets"},uh={class:"htga4-date-picker__footer"},dh={__name:"DateRangePicker",props:{dateRange:{type:Array,default:()=>[]},datePreset:{type:String,default:"last30days"},datePopoverVisible:{type:Boolean,default:!1},selectedDateRangeText:{type:String,default:""},datePresetName:{type:String,default:"Last 30 days"}},emits:["update:dateRange","update:datePreset","update:datePopoverVisible","openDatePopover","cancelDateSelection","applyDateFilter","selectPreset"],setup(t,{emit:e}){const s=t,n=e,i=S({get:()=>s.dateRange,set:f=>n("update:dateRange",f)}),o=S({get:()=>s.datePreset,set:f=>n("update:datePreset",f)}),a=()=>{n("openDatePopover")},r=()=>{n("cancelDateSelection"),setTimeout(()=>{var f;(f=document.querySelector(".htga4-date-picker__button"))==null||f.focus()},50)},l=()=>{n("applyDateFilter"),setTimeout(()=>{var f;(f=document.querySelector(".htga4-date-picker__button"))==null||f.focus()},50)},c=f=>{o.value=f,n("selectPreset",f)},u=f=>f>new Date,d=()=>{setTimeout(()=>{var f;(f=document.querySelector(".htga4-date-picker__button"))==null||f.focus()},50)},h=f=>{if(s.datePopoverVisible){const p=document.querySelector(".htga4-date-picker__popover"),g=document.querySelector(".htga4-date-picker__button");p&&g&&!p.contains(f.target)&&!g.contains(f.target)&&!f.target.closest(".el-picker-panel")&&n("cancelDateSelection")}};return Ce(()=>{document.addEventListener("click",h)}),ga(()=>{document.removeEventListener("click",h)}),(f,p)=>{const g=P("el-icon"),m=P("el-date-picker"),y=P("el-col"),b=P("el-row"),k=P("el-button"),D=P("el-popover");return x(),T("div",ih,[_(D,{placement:"bottom",width:430,trigger:"manual","hide-after":0,teleported:!0,visible:t.datePopoverVisible,onClick:p[12]||(p[12]=Et(()=>{},["stop"])),onHide:d},{reference:w(()=>[v("div",{class:"htga4-date-picker__button",onClick:Et(a,["stop"]),tabindex:"0",role:"button","aria-haspopup":"true","aria-expanded":"datePopoverVisible"},[_(g,{class:"htga4-date-picker__calendar-icon"},{default:w(()=>[_(L(Kr))]),_:1}),p[13]||(p[13]=v("div",{class:"htga4-date-picker__separator"},null,-1)),v("div",oh,H(t.datePresetName),1),p[14]||(p[14]=v("div",{class:"htga4-date-picker__separator"},null,-1)),v("code",ah,H(t.selectedDateRangeText),1),_(g,{class:"htga4-date-picker__dropdown-icon"},{default:w(()=>[_(L(ma))]),_:1})])]),default:w(()=>[v("div",{class:"htga4-date-picker__popover",onClick:p[11]||(p[11]=Et(()=>{},["stop"]))},[v("div",rh,[v("div",lh,[_(m,{modelValue:i.value,"onUpdate:modelValue":p[0]||(p[0]=C=>i.value=C),type:"daterange","range-separator":"To","start-placeholder":"Start date","end-placeholder":"End date","disabled-date":u,onClick:p[1]||(p[1]=Et(()=>{},["stop"])),"popper-options":{modifiers:[{name:"preventOverflow",options:{boundary:"viewport"}}]}},null,8,["modelValue"])]),v("div",ch,[p[15]||(p[15]=v("h3",null,"Presets",-1)),_(b,{gutter:20},{default:w(()=>[_(y,{span:12},{default:w(()=>[v("div",{class:ie(["htga4-date-picker__preset-item",{"htga4-date-picker__preset-item--active":o.value==="today"}]),onClick:p[2]||(p[2]=C=>c("today"))}," Today ",2),v("div",{class:ie(["htga4-date-picker__preset-item",{"htga4-date-picker__preset-item--active":o.value==="yesterday"}]),onClick:p[3]||(p[3]=C=>c("yesterday"))}," Yesterday ",2),v("div",{class:ie(["htga4-date-picker__preset-item",{"htga4-date-picker__preset-item--active":o.value==="lastMonth"}]),onClick:p[4]||(p[4]=C=>c("lastMonth"))}," Last month ",2),v("div",{class:ie(["htga4-date-picker__preset-item",{"htga4-date-picker__preset-item--active":o.value==="last12months"}]),onClick:p[5]||(p[5]=C=>c("last12months"))}," Last 12 months ",2),v("div",{class:ie(["htga4-date-picker__preset-item",{"htga4-date-picker__preset-item--active":o.value==="lastYear"}]),onClick:p[6]||(p[6]=C=>c("lastYear"))}," Last year ",2)]),_:1}),_(y,{span:12},{default:w(()=>[v("div",{class:ie(["htga4-date-picker__preset-item",{"htga4-date-picker__preset-item--active":o.value==="last7days"}]),onClick:p[7]||(p[7]=C=>c("last7days"))}," Last 7 days ",2),v("div",{class:ie(["htga4-date-picker__preset-item",{"htga4-date-picker__preset-item--active":o.value==="last30days"}]),onClick:p[8]||(p[8]=C=>c("last30days"))}," Last 30 days ",2),v("div",{class:ie(["htga4-date-picker__preset-item",{"htga4-date-picker__preset-item--active":o.value==="last90days"}]),onClick:p[9]||(p[9]=C=>c("last90days"))}," Last 90 days ",2),v("div",{class:ie(["htga4-date-picker__preset-item",{"htga4-date-picker__preset-item--active":o.value==="last365days"}]),onClick:p[10]||(p[10]=C=>c("last365days"))}," Last 365 days ",2)]),_:1})]),_:1})]),v("div",uh,[_(k,{onClick:r},{default:w(()=>p[16]||(p[16]=[B("Cancel")])),_:1}),_(k,{type:"primary",onClick:l},{default:w(()=>p[17]||(p[17]=[B("Update")])),_:1})])])])]),_:1},8,["visible"])])}}},hh=se(dh,[["__scopeId","data-v-94e6146f"]]),fh={class:"htga4-date-controls"},ph={__name:"DateControls",emits:["data-loaded"],setup(t,{expose:e,emit:s}){const n=rn(),i=X(),{dateRange:o,datePreset:a,datePopoverVisible:r,selectedDateRangeText:l,datePresetName:c,selectPreset:u,openDatePopover:d,cancelDateSelection:h,applyDateFilter:f,checkIfDateRangeMatchesPreset:p}=nh();Me(o,b=>{b&&b.length===2?p(b[0],b[1])||(a.value="custom"):(!b||b.length===0)&&u("last30days")});const g=S(()=>n.currentRoute.value.name),m=()=>{f();const b=k=>k.toISOString().split("T")[0];i.commit("setStartDate",b(new Date(o.value[0]))),i.commit("setEndDate",b(new Date(o.value[1]))),i.commit("setDateRange",{0:o.value[0],1:o.value[1]}),g.value==="ecommerce"?i.dispatch("fetchEcommerceReports",{startDate:i.state.startDate,endDate:i.state.endDate}):g.value==="standard"&&i.dispatch("fetchStandardReports",{startDate:i.state.startDate,endDate:i.state.endDate})};return e({initialize:async()=>{u("last30days")}}),(b,k)=>(x(),T("div",fh,[_(hh,{"date-range":L(o),"onUpdate:dateRange":k[0]||(k[0]=D=>_n(o)?o.value=D:null),"date-preset":L(a),"onUpdate:datePreset":k[1]||(k[1]=D=>_n(a)?a.value=D:null),"date-popover-visible":L(r),"onUpdate:datePopoverVisible":k[2]||(k[2]=D=>_n(r)?r.value=D:null),"selected-date-range-text":L(l),"date-preset-name":L(c),onOpenDatePopover:L(d),onCancelDateSelection:L(h),onApplyDateFilter:m,onSelectPreset:L(u)},null,8,["date-range","date-preset","date-popover-visible","selected-date-range-text","date-preset-name","onOpenDatePopover","onCancelDateSelection","onSelectPreset"])]))}},gh=se(ph,[["__scopeId","data-v-dfed0296"]]),mh={class:"htga4-sync-button"},_h={__name:"SyncButton",props:{label:{type:String,default:"Sync"},size:{type:String,default:"medium"}},emits:["sync-complete"],setup(t,{emit:e}){const s=t,n=e,i=X(),o=rn(),a=ne(!1),r=S(()=>o.currentRoute.value.name),l=async()=>{try{a.value=!0;const c=!0;r.value==="ecommerce"?await i.dispatch("fetchEcommerceReports",{startDate:i.state.startDate,endDate:i.state.endDate,forceRefresh:c}):r.value==="realtime"?await i.dispatch("fetchRealtimeReports",c):await i.dispatch("fetchStandardReports",{startDate:i.state.startDate,endDate:i.state.endDate,forceRefresh:c}),In({message:"Data refreshed successfully",type:"success",offset:40}),n("sync-complete")}catch(c){In({message:"Failed to refresh data: "+(c.message||"Unknown error"),type:"error",offset:40}),i.state.environmentType==="development"&&console.error("Sync error:",c)}finally{a.value=!1}};return(c,u)=>{const d=P("el-button");return x(),T("div",mh,[_(as,{content:"* Force refresh data (clears cache) <br>* Data is cached for 1 hour",placement:"top"},{default:w(()=>[_(d,{class:"htga4-sync-button__button",icon:L(fa),type:"primary",size:s.size,loading:a.value,onClick:l},{default:w(()=>[B(H(t.label),1)]),_:1},8,["icon","size","loading"])]),_:1})])}}},Na=se(_h,[["__scopeId","data-v-d810285f"]]),vh={key:0,class:"htga4-user-card__skeleton"},bh={class:"htga4-user-card__content"},yh={class:"htga4-user-card__thumb"},xh={class:"htga4-user-card__info",style:{width:"140px"}},wh={key:1,class:"htga4-user-card__content"},Sh={class:"htga4-user-card__thumb"},kh=["src"],Ch={class:"htga4-user-card__info"},Ph={class:"htga4-user-card__name"},Dh={class:"htga4-user-card__email"},Rh={class:"htga4-user-card__property"},Mh={__name:"UserProfileCard",setup(t){const e=X(),s=S(()=>e.state.userProfile),n=S(()=>{var a;return((a=e.state.dataStream)==null?void 0:a.displayName)||""}),i=S(()=>{var a,r;return((r=(a=e.state.dataStream)==null?void 0:a.webStreamData)==null?void 0:r.measurementId)||""}),o=S(()=>e.state.loading);return(a,r)=>{const l=P("el-skeleton-item"),c=P("el-skeleton"),u=P("el-card");return x(),M(u,{class:"htga4-user-card","body-style":{padding:"0"},shadow:"never"},{default:w(()=>[o.value?(x(),T("div",vh,[_(c,{style:{width:"100%"},animated:""},{template:w(()=>[v("div",bh,[v("div",yh,[_(l,{variant:"circle",style:{width:"50px",height:"50px"}})]),v("div",xh,[_(l,{variant:"p",style:{width:"50%"}}),_(l,{variant:"p",style:{width:"60%"}}),_(l,{variant:"p",style:{width:"70%"}})])])]),_:1})])):(x(),T("div",wh,[v("div",Sh,[v("img",{src:s.value.profileImage,alt:"User profile"},null,8,kh)]),v("div",Ch,[v("h3",Ph,H(s.value.name),1),v("p",Dh,H(s.value.email),1),v("p",Rh,H(n.value)+" <"+H(i.value)+">",1)])]))]),_:1})}}},Ua=se(Mh,[["__scopeId","data-v-0ea4092e"]]),Ah={class:"htga4-report-header"},Th={class:"htga4-report-header__controls"},Eh={__name:"ReportHeader",emits:["analytics-data-updated"],setup(t,{expose:e,emit:s}){const n=rn(),i=S(()=>!n.currentRoute.value.path.includes("real-time")),o=ne(null),a=s,r=()=>{a("analytics-data-updated")};return e({initialize:async()=>{await o.value.initialize()}}),(l,c)=>(x(),T("div",Ah,[_(Ua),v("div",Th,[_(Na,{onSyncComplete:c[0]||(c[0]=u=>a("data-loaded"))}),i.value?(x(),M(gh,{key:0,ref_key:"dateControlsRef",ref:o,onDataUpdated:r},null,512)):U("",!0)])]))}},Ha=se(Eh,[["__scopeId","data-v-f6e590ae"]]);/*! |
| | 9 | */var Ta="store";function X(t){return t===void 0&&(t=null),pt(t!==null?t:Ta)}function Ht(t,e){Object.keys(t).forEach(function(s){return e(t[s],s)})}function mc(t){return t!==null&&typeof t=="object"}function _c(t){return t&&typeof t.then=="function"}function vc(t,e){return function(){return t(e)}}function Ea(t,e,s){return e.indexOf(t)<0&&(s&&s.prepend?e.unshift(t):e.push(t)),function(){var n=e.indexOf(t);n>-1&&e.splice(n,1)}}function La(t,e){t._actions=Object.create(null),t._mutations=Object.create(null),t._wrappedGetters=Object.create(null),t._modulesNamespaceMap=Object.create(null);var s=t.state;ln(t,s,[],t._modules.root,!0),ci(t,s,e)}function ci(t,e,s){var n=t._state,i=t._scope;t.getters={},t._makeLocalGettersCache=Object.create(null);var o=t._wrappedGetters,a={},r={},l=$r(!0);l.run(function(){Ht(o,function(c,u){a[u]=vc(c,t),r[u]=S(function(){return a[u]()}),Object.defineProperty(t.getters,u,{get:function(){return r[u].value},enumerable:!0})})}),t._state=ua({data:e}),t._scope=l,t.strict&&Sc(t),n&&s&&t._withCommit(function(){n.data=null}),i&&i.stop()}function ln(t,e,s,n,i){var o=!s.length,a=t._modules.getNamespace(s);if(n.namespaced&&(t._modulesNamespaceMap[a],t._modulesNamespaceMap[a]=n),!o&&!i){var r=ui(e,s.slice(0,-1)),l=s[s.length-1];t._withCommit(function(){r[l]=n.state})}var c=n.context=bc(t,a,s);n.forEachMutation(function(u,d){var h=a+d;yc(t,h,u,c)}),n.forEachAction(function(u,d){var h=u.root?d:a+d,f=u.handler||u;xc(t,h,f,c)}),n.forEachGetter(function(u,d){var h=a+d;wc(t,h,u,c)}),n.forEachChild(function(u,d){ln(t,e,s.concat(d),u,i)})}function bc(t,e,s){var n=e==="",i={dispatch:n?t.dispatch:function(o,a,r){var l=Gs(o,a,r),c=l.payload,u=l.options,d=l.type;return(!u||!u.root)&&(d=e+d),t.dispatch(d,c)},commit:n?t.commit:function(o,a,r){var l=Gs(o,a,r),c=l.payload,u=l.options,d=l.type;(!u||!u.root)&&(d=e+d),t.commit(d,c,u)}};return Object.defineProperties(i,{getters:{get:n?function(){return t.getters}:function(){return Oa(t,e)}},state:{get:function(){return ui(t.state,s)}}}),i}function Oa(t,e){if(!t._makeLocalGettersCache[e]){var s={},n=e.length;Object.keys(t.getters).forEach(function(i){if(i.slice(0,n)===e){var o=i.slice(n);Object.defineProperty(s,o,{get:function(){return t.getters[i]},enumerable:!0})}}),t._makeLocalGettersCache[e]=s}return t._makeLocalGettersCache[e]}function yc(t,e,s,n){var i=t._mutations[e]||(t._mutations[e]=[]);i.push(function(a){s.call(t,n.state,a)})}function xc(t,e,s,n){var i=t._actions[e]||(t._actions[e]=[]);i.push(function(a){var r=s.call(t,{dispatch:n.dispatch,commit:n.commit,getters:n.getters,state:n.state,rootGetters:t.getters,rootState:t.state},a);return _c(r)||(r=Promise.resolve(r)),t._devtoolHook?r.catch(function(l){throw t._devtoolHook.emit("vuex:error",l),l}):r})}function wc(t,e,s,n){t._wrappedGetters[e]||(t._wrappedGetters[e]=function(o){return s(n.state,n.getters,o.state,o.getters)})}function Sc(t){Me(function(){return t._state.data},function(){},{deep:!0,flush:"sync"})}function ui(t,e){return e.reduce(function(s,n){return s[n]},t)}function Gs(t,e,s){return mc(t)&&t.type&&(s=e,e=t,t=t.type),{type:t,payload:e,options:s}}var kc="vuex bindings",qi="vuex:mutations",xn="vuex:actions",Dt="vuex",Cc=0;function Pc(t,e){dl({id:"org.vuejs.vuex",app:t,label:"Vuex",homepage:"https://next.vuex.vuejs.org/",logo:"https://vuejs.org/images/icons/favicon-96x96.png",packageName:"vuex",componentStateTypes:[kc]},function(s){s.addTimelineLayer({id:qi,label:"Vuex Mutations",color:Yi}),s.addTimelineLayer({id:xn,label:"Vuex Actions",color:Yi}),s.addInspector({id:Dt,label:"Vuex",icon:"storage",treeFilterPlaceholder:"Filter stores..."}),s.on.getInspectorTree(function(n){if(n.app===t&&n.inspectorId===Dt)if(n.filter){var i=[];$a(i,e._modules.root,n.filter,""),n.rootNodes=i}else n.rootNodes=[Va(e._modules.root,"")]}),s.on.getInspectorState(function(n){if(n.app===t&&n.inspectorId===Dt){var i=n.nodeId;Oa(e,i),n.state=Mc(Tc(e._modules,i),i==="root"?e.getters:e._makeLocalGettersCache,i)}}),s.on.editInspectorState(function(n){if(n.app===t&&n.inspectorId===Dt){var i=n.nodeId,o=n.path;i!=="root"&&(o=i.split("/").filter(Boolean).concat(o)),e._withCommit(function(){n.set(e._state.data,o,n.state.value)})}}),e.subscribe(function(n,i){var o={};n.payload&&(o.payload=n.payload),o.state=i,s.notifyComponentUpdate(),s.sendInspectorTree(Dt),s.sendInspectorState(Dt),s.addTimelineEvent({layerId:qi,event:{time:Date.now(),title:n.type,data:o}})}),e.subscribeAction({before:function(n,i){var o={};n.payload&&(o.payload=n.payload),n._id=Cc++,n._time=Date.now(),o.state=i,s.addTimelineEvent({layerId:xn,event:{time:n._time,title:n.type,groupId:n._id,subtitle:"start",data:o}})},after:function(n,i){var o={},a=Date.now()-n._time;o.duration={_custom:{type:"duration",display:a+"ms",tooltip:"Action duration",value:a}},n.payload&&(o.payload=n.payload),o.state=i,s.addTimelineEvent({layerId:xn,event:{time:Date.now(),title:n.type,groupId:n._id,subtitle:"end",data:o}})}})})}var Yi=8702998,Dc=6710886,Rc=16777215,Ia={label:"namespaced",textColor:Rc,backgroundColor:Dc};function Fa(t){return t&&t!=="root"?t.split("/").slice(-2,-1)[0]:"Root"}function Va(t,e){return{id:e||"root",label:Fa(e),tags:t.namespaced?[Ia]:[],children:Object.keys(t._children).map(function(s){return Va(t._children[s],e+s+"/")})}}function $a(t,e,s,n){n.includes(s)&&t.push({id:n||"root",label:n.endsWith("/")?n.slice(0,n.length-1):n||"Root",tags:e.namespaced?[Ia]:[]}),Object.keys(e._children).forEach(function(i){$a(t,e._children[i],s,n+i+"/")})}function Mc(t,e,s){e=s==="root"?e:e[s];var n=Object.keys(e),i={state:Object.keys(t.state).map(function(a){return{key:a,editable:!0,value:t.state[a]}})};if(n.length){var o=Ac(e);i.getters=Object.keys(o).map(function(a){return{key:a.endsWith("/")?Fa(a):a,editable:!1,value:Un(function(){return o[a]})}})}return i}function Ac(t){var e={};return Object.keys(t).forEach(function(s){var n=s.split("/");if(n.length>1){var i=e,o=n.pop();n.forEach(function(a){i[a]||(i[a]={_custom:{value:{},display:a,tooltip:"Module",abstract:!0}}),i=i[a]._custom.value}),i[o]=Un(function(){return t[s]})}else e[s]=Un(function(){return t[s]})}),e}function Tc(t,e){var s=e.split("/").filter(function(n){return n});return s.reduce(function(n,i,o){var a=n[i];if(!a)throw new Error('Missing module "'+i+'" for path "'+e+'".');return o===s.length-1?a:a._children},e==="root"?t:t.root._children)}function Un(t){try{return t()}catch(e){return e}}var Ge=function(e,s){this.runtime=s,this._children=Object.create(null),this._rawModule=e;var n=e.state;this.state=(typeof n=="function"?n():n)||{}},za={namespaced:{configurable:!0}};za.namespaced.get=function(){return!!this._rawModule.namespaced};Ge.prototype.addChild=function(e,s){this._children[e]=s};Ge.prototype.removeChild=function(e){delete this._children[e]};Ge.prototype.getChild=function(e){return this._children[e]};Ge.prototype.hasChild=function(e){return e in this._children};Ge.prototype.update=function(e){this._rawModule.namespaced=e.namespaced,e.actions&&(this._rawModule.actions=e.actions),e.mutations&&(this._rawModule.mutations=e.mutations),e.getters&&(this._rawModule.getters=e.getters)};Ge.prototype.forEachChild=function(e){Ht(this._children,e)};Ge.prototype.forEachGetter=function(e){this._rawModule.getters&&Ht(this._rawModule.getters,e)};Ge.prototype.forEachAction=function(e){this._rawModule.actions&&Ht(this._rawModule.actions,e)};Ge.prototype.forEachMutation=function(e){this._rawModule.mutations&&Ht(this._rawModule.mutations,e)};Object.defineProperties(Ge.prototype,za);var kt=function(e){this.register([],e,!1)};kt.prototype.get=function(e){return e.reduce(function(s,n){return s.getChild(n)},this.root)};kt.prototype.getNamespace=function(e){var s=this.root;return e.reduce(function(n,i){return s=s.getChild(i),n+(s.namespaced?i+"/":"")},"")};kt.prototype.update=function(e){Ba([],this.root,e)};kt.prototype.register=function(e,s,n){var i=this;n===void 0&&(n=!0);var o=new Ge(s,n);if(e.length===0)this.root=o;else{var a=this.get(e.slice(0,-1));a.addChild(e[e.length-1],o)}s.modules&&Ht(s.modules,function(r,l){i.register(e.concat(l),r,n)})};kt.prototype.unregister=function(e){var s=this.get(e.slice(0,-1)),n=e[e.length-1],i=s.getChild(n);i&&i.runtime&&s.removeChild(n)};kt.prototype.isRegistered=function(e){var s=this.get(e.slice(0,-1)),n=e[e.length-1];return s?s.hasChild(n):!1};function Ba(t,e,s){if(e.update(s),s.modules)for(var n in s.modules){if(!e.getChild(n))return;Ba(t.concat(n),e.getChild(n),s.modules[n])}}function Ec(t){return new Ie(t)}var Ie=function(e){var s=this;e===void 0&&(e={});var n=e.plugins;n===void 0&&(n=[]);var i=e.strict;i===void 0&&(i=!1);var o=e.devtools;this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new kt(e),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._makeLocalGettersCache=Object.create(null),this._scope=null,this._devtools=o;var a=this,r=this,l=r.dispatch,c=r.commit;this.dispatch=function(h,f){return l.call(a,h,f)},this.commit=function(h,f,p){return c.call(a,h,f,p)},this.strict=i;var u=this._modules.root.state;ln(this,u,[],this._modules.root),ci(this,u),n.forEach(function(d){return d(s)})},di={state:{configurable:!0}};Ie.prototype.install=function(e,s){e.provide(s||Ta,this),e.config.globalProperties.$store=this;var n=this._devtools!==void 0?this._devtools:!1;n&&Pc(e,this)};di.state.get=function(){return this._state.data};di.state.set=function(t){};Ie.prototype.commit=function(e,s,n){var i=this,o=Gs(e,s,n),a=o.type,r=o.payload,l={type:a,payload:r},c=this._mutations[a];c&&(this._withCommit(function(){c.forEach(function(d){d(r)})}),this._subscribers.slice().forEach(function(u){return u(l,i.state)}))};Ie.prototype.dispatch=function(e,s){var n=this,i=Gs(e,s),o=i.type,a=i.payload,r={type:o,payload:a},l=this._actions[o];if(l){try{this._actionSubscribers.slice().filter(function(u){return u.before}).forEach(function(u){return u.before(r,n.state)})}catch{}var c=l.length>1?Promise.all(l.map(function(u){return u(a)})):l[0](a);return new Promise(function(u,d){c.then(function(h){try{n._actionSubscribers.filter(function(f){return f.after}).forEach(function(f){return f.after(r,n.state)})}catch{}u(h)},function(h){try{n._actionSubscribers.filter(function(f){return f.error}).forEach(function(f){return f.error(r,n.state,h)})}catch{}d(h)})})}};Ie.prototype.subscribe=function(e,s){return Ea(e,this._subscribers,s)};Ie.prototype.subscribeAction=function(e,s){var n=typeof e=="function"?{before:e}:e;return Ea(n,this._actionSubscribers,s)};Ie.prototype.watch=function(e,s,n){var i=this;return Me(function(){return e(i.state,i.getters)},s,Object.assign({},n))};Ie.prototype.replaceState=function(e){var s=this;this._withCommit(function(){s._state.data=e})};Ie.prototype.registerModule=function(e,s,n){n===void 0&&(n={}),typeof e=="string"&&(e=[e]),this._modules.register(e,s),ln(this,this.state,e,this._modules.get(e),n.preserveState),ci(this,this.state)};Ie.prototype.unregisterModule=function(e){var s=this;typeof e=="string"&&(e=[e]),this._modules.unregister(e),this._withCommit(function(){var n=ui(s.state,e.slice(0,-1));delete n[e[e.length-1]]}),La(this)};Ie.prototype.hasModule=function(e){return typeof e=="string"&&(e=[e]),this._modules.isRegistered(e)};Ie.prototype.hotUpdate=function(e){this._modules.update(e),La(this,!0)};Ie.prototype._withCommit=function(e){var s=this._committing;this._committing=!0,e(),this._committing=s};Object.defineProperties(Ie.prototype,di);const Lc={__name:"TextField",props:{fieldSchema:{type:Object,required:!0},modelValue:{required:!0},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const s=t,n=e,i=S({get(){return s.modelValue},set(r){if(s.fieldSchema.type==="number"){let l=Number(r);if(l<0){const c=o.value??0,u=a.value??Number.MAX_SAFE_INTEGER;l=Math.min(Math.abs(l),u),l=Math.max(l,c),r=l.toString()}}n("update:modelValue",r)}}),o=S(()=>{var r;return((r=s.fieldSchema.attributes)==null?void 0:r.min)??void 0}),a=S(()=>{var r;return((r=s.fieldSchema.attributes)==null?void 0:r.max)??void 0});return(r,l)=>{const c=D("el-input");return x(),A(c,{modelValue:i.value,"onUpdate:modelValue":l[0]||(l[0]=u=>i.value=u),type:t.fieldSchema.type==="textarea"?"textarea":t.fieldSchema.type,min:o.value,max:a.value,placeholder:t.fieldSchema.placeholder,disabled:s.disabled},Ss({_:2},[t.fieldSchema.suffix?{name:"suffix",fn:w(()=>[B(H(t.fieldSchema.suffix),1)]),key:"0"}:void 0]),1032,["modelValue","type","min","max","placeholder","disabled"])}}},ne=(t,e)=>{const s=t.__vccOpts||t;for(const[n,i]of e)s[n]=i;return s},Oc={__name:"SelectField",props:{fieldSchema:{type:Object,required:!0},modelValue:{default:""}},emits:["update:modelValue"],setup(t,{emit:e}){var m;const s=X(),n=se(""),i=y=>{y||(n.value="")},o=t,a=e;!o.fieldSchema.is_pro&&!((m=o.fieldSchema.class)!=null&&m.includes("htga4-pro-field-opacity"))&&(o.fieldSchema.options==="roles"?s.dispatch("fetchRoles"):o.fieldSchema.options==="accounts"&&s.dispatch("fetchAccounts"));const r=S(()=>s.getters.getRoles),l=S(()=>s.getters.getAccounts),c=S(()=>s.getters.getProperties),u=S(()=>s.getters.getDataStreams),d=S(()=>s.getters.getMeasurementProtocolSecrets),h=S(()=>s.state.isLoading),f=S(()=>{if(!h.value)return!1;const y=o.fieldSchema.options;return y==="accounts"?Object.keys(l.value).length===0:y==="properties"?Object.keys(c.value).length===0&&s.state.settings.account:y==="data_streams"?Object.keys(u.value).length===0&&s.state.settings.property:y==="measurement_protocol_secrets"?Object.keys(d.value).length===0&&s.state.settings.data_stream_id:y==="roles"?Object.keys(r.value).length===0:!1}),p=S(()=>{if(!n.value)return l.value;const y=n.value.toLowerCase(),v={};for(const[k,P]of Object.entries(l.value))P.toLowerCase().includes(y)&&(v[k]=P);return v});Me(()=>o.modelValue,(y,v)=>{if(o.fieldSchema.options==="accounts"&&y){if(y===v)return;v&&(s.commit("updateSetting",{key:"property",value:""}),s.commit("updateSetting",{key:"data_stream_id",value:""})),s.dispatch("fetchProperties",{forceRefresh:!0})}}),Me(()=>o.modelValue,(y,v)=>{if(o.fieldSchema.options==="properties"&&y){if(y===v)return;v&&(s.commit("updateSetting",{key:"data_stream_id",value:""}),s.commit("updateSetting",{key:"measurement_id",value:""})),s.dispatch("fetchDataStreams",{forceRefresh:!0})}}),Me(()=>o.modelValue,(y,v)=>{if(o.fieldSchema.options==="data_streams"&&y){if(y===v)return;const k=s.state.settings;k.auth_google&&k.auth_google!==""&&(s.dispatch("fetchAndPopulateMeasurementId"),v&&s.commit("updateSetting",{key:"measurement_protocol_api_secret",value:""}),s.dispatch("fetchMeasurementProtocolSecrets",{forceRefresh:!0}))}});const g=S({get(){return o.modelValue},set(y){a("update:modelValue",y)}});return Ce(()=>{if(o.fieldSchema.options==="data_streams"&&o.modelValue){const y=s.state.settings,v=y.auth_google&&y.auth_google!=="",k=y.measurement_id||"";v&&!k&&s.dispatch("fetchAndPopulateMeasurementId")}}),(y,v)=>{const k=D("el-input"),P=D("el-option"),C=D("el-option-group"),O=D("el-select");return x(),A(O,{modelValue:g.value,"onUpdate:modelValue":v[3]||(v[3]=R=>g.value=R),placeholder:t.fieldSchema.placeholder||"Select an option",loading:f.value,multiple:t.fieldSchema.multiple||!1,"empty-values":[null,void 0],onVisibleChange:i},Ss({default:w(()=>[typeof t.fieldSchema.options=="object"?(x(!0),T(J,{key:0},le(t.fieldSchema.options,(R,E)=>(x(),T(J,{key:E},[typeof R=="string"?(x(),A(P,{key:0,label:R,value:E},null,8,["label","value"])):(x(),A(C,{key:1,label:E},{label:w(()=>[b("span",null,H(E),1)]),default:w(()=>[(x(!0),T(J,null,le(R,(z,j)=>(x(),A(P,{key:j,label:z,value:j},null,8,["label","value"]))),128))]),_:2},1032,["label"]))],64))),128)):U("",!0),t.fieldSchema.options==="roles"?(x(!0),T(J,{key:1},le(r.value,(R,E)=>(x(),A(P,{key:E,label:R,value:E},null,8,["label","value"]))),128)):U("",!0),t.fieldSchema.options==="accounts"?(x(!0),T(J,{key:2},le(p.value,(R,E)=>(x(),A(P,{key:E,label:R,value:E},null,8,["label","value"]))),128)):U("",!0),t.fieldSchema.options==="properties"?(x(!0),T(J,{key:3},le(c.value,(R,E)=>(x(),A(P,{key:E,label:R,value:E},null,8,["label","value"]))),128)):U("",!0),t.fieldSchema.options==="data_streams"?(x(!0),T(J,{key:4},le(u.value,(R,E)=>(x(),A(P,{key:E,label:R,value:E},null,8,["label","value"]))),128)):U("",!0),t.fieldSchema.options==="measurement_protocol_secrets"?(x(!0),T(J,{key:5},le(d.value,(R,E)=>(x(),A(P,{key:E,label:R,value:E},null,8,["label","value"]))),128)):U("",!0)]),_:2},[t.fieldSchema.searchable?{name:"header",fn:w(()=>[_(k,{modelValue:n.value,"onUpdate:modelValue":v[0]||(v[0]=R=>n.value=R),placeholder:"Type to search...",clearable:"",size:"small",class:"select-search-input",onClick:v[1]||(v[1]=dt(()=>{},["stop"])),onKeydown:v[2]||(v[2]=dt(()=>{},["stop"]))},null,8,["modelValue"])]),key:"0"}:void 0]),1032,["modelValue","placeholder","loading","multiple"])}}},Ic=ne(Oc,[["__scopeId","data-v-157b8ac0"]]),Fc={__name:"ColorField",props:{fieldSchema:{type:Object,required:!0},modelValue:{required:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const s=t,n=e,i=a=>{if(!a){n("update:modelValue","");return}n("update:modelValue",a)},o=S({get(){return s.modelValue},set(a){n("update:modelValue",a)}});return(a,r)=>{const l=D("el-color-picker");return x(),A(l,{modelValue:o.value,"onUpdate:modelValue":r[0]||(r[0]=c=>o.value=c),"show-alpha":"",onActiveChange:i},null,8,["modelValue"])}}},Vc={__name:"CheckboxField",props:{fieldSchema:{type:Object,required:!0},modelValue:{required:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const s=t,n=e,i=S({get(){return s.fieldSchema.options?Array.isArray(s.modelValue)?s.modelValue:s.modelValue?s.modelValue.split(","):[]:s.modelValue==="1"||s.modelValue===1},set(o){s.fieldSchema.options?n("update:modelValue",Array.isArray(o)?o.join(","):o):n("update:modelValue",o?"1":"0")}});return(o,a)=>{const r=D("el-checkbox"),l=D("el-checkbox-group");return t.fieldSchema.options?(x(),A(l,{key:0,modelValue:i.value,"onUpdate:modelValue":a[0]||(a[0]=c=>i.value=c)},{default:w(()=>[(x(!0),T(J,null,le(t.fieldSchema.options,(c,u)=>(x(),A(r,{key:u,label:u,size:"medium"},{default:w(()=>[B(H(c),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])):(x(),A(r,{key:1,size:"medium",modelValue:i.value,"onUpdate:modelValue":a[1]||(a[1]=c=>i.value=c),label:t.fieldSchema.label},null,8,["modelValue","label"]))}}},$c={__name:"SwitchField",props:{fieldSchema:{type:Object,required:!0},modelValue:{required:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const s=t,n=e,i=S({get(){return Number(s.modelValue)},set(o){n("update:modelValue",String(o))}});return(o,a)=>{const r=D("el-switch");return x(),A(r,{modelValue:i.value,"onUpdate:modelValue":a[0]||(a[0]=l=>i.value=l),"inline-prompt":"","active-text":t.fieldSchema.label||"Yes","inactive-text":t.fieldSchema.label||"No","active-value":1,"inactive-value":0,"active-icon":I(si),"inactive-icon":I(zr)},null,8,["modelValue","active-text","inactive-text","active-icon","inactive-icon"])}}},zc={__name:"RadioField",props:{fieldSchema:{type:Object,required:!0},modelValue:{required:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const s=t,n=e,i=S({get(){return s.modelValue},set(o){n("update:modelValue",o)}});return(o,a)=>{const r=D("el-radio"),l=D("el-radio-group");return x(),A(l,{modelValue:i.value,"onUpdate:modelValue":a[0]||(a[0]=c=>i.value=c)},{default:w(()=>[(x(!0),T(J,null,le(t.fieldSchema.options,(c,u)=>(x(),A(r,{key:u,value:u},{default:w(()=>[B(H(c),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])}}},Bc={class:"htga4-tabbed-field"},Nc={class:"tab-content"},Uc={__name:"TabbedField",props:{modelValue:{type:Object,default:()=>({})},fieldSchema:{type:Object,required:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const s=t,n=e,i=se("0"),o=se({});return Me(()=>s.modelValue,a=>{o.value={...a}},{immediate:!0,deep:!0}),Me(o,a=>{n("update:modelValue",a)},{deep:!0}),(a,r)=>{const l=D("el-tab-pane"),c=D("el-tabs");return x(),T("div",Bc,[_(c,{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=u=>i.value=u)},{default:w(()=>[(x(!0),T(J,null,le(t.fieldSchema.tabs,(u,d)=>(x(),A(l,{key:d,name:d.toString()},{label:w(()=>[u.icon?(x(),T("i",{key:0,class:ie(u.icon)},null,2)):U("",!0),b("span",null,H(u.title),1)]),default:w(()=>[b("div",Nc,[(x(!0),T(J,null,le(u.fields,h=>(x(),A(we,{key:h.id,modelValue:o.value[h.id],"onUpdate:modelValue":f=>o.value[h.id]=f,fieldSchema:h},null,8,["modelValue","onUpdate:modelValue","fieldSchema"]))),128))])]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue"])])}}},Hc={class:"htga4-editor-field"},jc={class:"htga4-editor-tabs"},Wc={class:"htga4-editor-container"},Gc=["value"],qc={__name:"EditorField",props:{fieldSchema:{type:Object,required:!0},modelValue:{required:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const s={height:200,skin:"lightgray",theme:"modern",menubar:!1,statusbar:!1,branding:!1,plugins:"charmap colorpicker hr lists paste tabfocus textcolor fullscreen wordpress wpautoresize wpeditimage wpemoji wpgallery wplink wptextpattern",toolbar1:"formatselect bold italic bullist numlist blockquote alignleft aligncenter alignright link unlink wp_more wp_adv dfw",toolbar2:"strikethrough hr forecolor pastetext removeformat charmap outdent indent undo redo wp_help",force_br_newlines:!0,force_p_newlines:!1,forced_root_block:""},n=t,i=e,o=se(!1),a=se(null);let r=null;const l=S(()=>n.modelValue||""),c=()=>{if(o.value){const f=a.value.value.replace(/\n/g,"<br>");i("update:modelValue",f),o.value=!1,h()}},u=()=>{if(!o.value){const f=((r==null?void 0:r.getContent())||"").replace(/<br\s*\/?>/g,` |
| | 10 | `);r==null||r.destroy(),r=null,a.value.value=f,i("update:modelValue",f),o.value=!0}},d=f=>{i("update:modelValue",f.target.value)},h=()=>{if(!window.tinymce||!a.value||o.value)return;const p={...window.wp.editor.getDefaultSettings().tinymce,...s,target:a.value,setup:g=>{r=g,g.on("change",m=>{i("update:modelValue",g.getContent())}),g.on("init",()=>{var y;const m=((y=n.modelValue)==null?void 0:y.replace(/\n/g,"<br>"))||"";g.setContent(m)})}};window.tinymce.init(p)};return Me(()=>n.modelValue,f=>{if(r&&r.getContent()!==f){const p=f==null?void 0:f.replace(/\n/g,"<br>");r.setContent(p||"")}}),Ce(()=>{h()}),ni(()=>{r&&r.destroy()}),(f,p)=>(x(),T("div",Hc,[b("div",jc,[b("button",{type:"button",class:ie(["htga4-editor-tab-btn",{active:!o.value}]),onClick:c}," Visual ",2),b("button",{type:"button",class:ie(["htga4-editor-tab-btn",{active:o.value}]),onClick:u}," Text ",2)]),b("div",Wc,[b("textarea",{ref_key:"editorRef",ref:a,value:l.value,class:"htga4-editor-height",style:ii({visibility:o.value?"visible":"hidden"}),onInput:d},null,44,Gc)])]))}},Yc=["innerHTML"],Xc={__name:"HelpTooltip",props:{content:{type:String,required:!0},useHtml:{type:Boolean,default:!0},placement:{type:String,default:"bottom-start"},effect:{type:String,default:"dark"},hideAfter:{type:Number,default:0},trigger:{type:String,default:"hover"},enterable:{type:Boolean,default:!1}},setup(t){return(e,s)=>{const n=D("el-icon"),i=D("el-tooltip");return x(),A(i,{placement:t.placement,content:t.useHtml?null:t.content,effect:t.effect,"hide-after":t.hideAfter,trigger:t.trigger,enterable:t.enterable},Ss({default:w(()=>[Ft(e.$slots,"default",{},()=>[_(n,{class:"tooltip-icon"},{default:w(()=>[_(I(da))]),_:1})],!0)]),_:2},[t.useHtml?{name:"content",fn:w(()=>[b("div",{innerHTML:t.content},null,8,Yc)]),key:"0"}:void 0]),1032,["placement","content","effect","hide-after","trigger","enterable"])}}},as=ne(Xc,[["__scopeId","data-v-3399916d"]]),Kc=["value"],Qc={key:0,class:"htga4-copy-to-clipboard__icon"},Zc={key:0,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24"},Jc={key:1,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24"},eu={class:"htga4-copy-to-clipboard__text"},tu={__name:"CopyToClipboard",props:{content:{type:String,required:!0},buttonText:{type:String,default:"Copy"},width:{type:String,default:"100%"},showIcon:{type:Boolean,default:!0}},setup(t){const e=t,s=se(!1),n=se(null),i=S(()=>({width:e.width})),{content:o}=e,a=()=>{navigator.clipboard.writeText(e.content).then(()=>{s.value=!0,setTimeout(()=>{s.value=!1},2e3)})},r=()=>{n.value&&n.value.select()};return(l,c)=>{const u=D("el-button");return x(),T("div",{class:"htga4-copy-to-clipboard",style:ii(i.value)},[b("input",{class:"htga4-copy-to-clipboard__content htga4-monospace",value:I(o),readonly:"",onClick:r,ref_key:"inputRef",ref:n},null,8,Kc),_(u,{class:"htga4-copy-to-clipboard__button",onClick:dt(a,["stop"]),type:s.value?"success":"primary",size:"medium"},{default:w(()=>[t.showIcon?(x(),T("span",Qc,[s.value?(x(),T("svg",Jc,c[1]||(c[1]=[b("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"},null,-1)]))):(x(),T("svg",Zc,c[0]||(c[0]=[b("path",{fill:"currentColor",d:"M20,2H10C8.9,2 8,2.9 8,4V8H4C2.9,8 2,8.9 2,10V20C2,21.1 2.9,22 4,22H14C15.1,22 16,21.1 16,20V16H20C21.1,16 22,15.1 22,14V4C22,2.9 21.1,2 20,2M14,20H4V10H14V20M20,14H16V10C16,8.9 15.1,8 14,8H10V4H20V14Z"},null,-1)])))])):U("",!0),b("span",eu,H(s.value?"Copied!":t.buttonText),1)]),_:1},8,["type"])],4)}}},su=ne(tu,[["__scopeId","data-v-263acba2"]]),nu={__name:"ClipboardField",props:{fieldSchema:{type:Object,required:!0},modelValue:{required:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const s=t,n=e,i=S({get(){return s.modelValue},set(o){n("update:modelValue",o)}});return(o,a)=>(x(),A(su,{content:i.value,width:"320px"},null,8,["content"]))}},iu={class:"htga4-auth-button-field"},ou={class:"htga4-auth-button-wrapper"},au=["href"],ru=["href"],lu={__name:"AuthButton",props:{modelValue:{type:String,default:""},fieldSchema:{type:Object,required:!0}},setup(t){var a;const e=X(),s=S(()=>e.getters.isAuthenticated),n=S(()=>e.state.email),i=se(((a=window.htga4Settings)==null?void 0:a.loginUrl)||""),o=S(()=>{const r=window.location.href.split("#")[0];return r+(r.includes("?")?"&htga4_logout=yes":"?htga4_logout=yes")});return(r,l)=>{const c=D("el-form-item");return x(),T("div",iu,[_(c,null,{default:w(()=>[b("div",ou,[s.value?(x(),T("a",{key:1,class:"el-button el-button--large",href:o.value},H((t.fieldSchema.logout_text||"Logout (%s)").replace("%s",n.value)),9,ru)):(x(),T("a",{key:0,class:"htga4-google-button",href:i.value,target:"_blank"},H(t.fieldSchema.button_text||"Sign in with Google"),9,au))])]),_:1})])}}},cu=ne(lu,[["__scopeId","data-v-05b1270d"]]),uu=["value"],du={__name:"HiddenField",props:{modelValue:{required:!0},fieldSchema:{type:Object,required:!0}},emits:["update:modelValue"],setup(t){return(e,s)=>(x(),T("input",{type:"hidden",value:t.modelValue,onInput:s[0]||(s[0]=n=>e.$emit("update:modelValue",n.target.value))},null,40,uu))}},ks={__name:"InfoAlert",props:{type:{type:String,default:"info"},centered:{type:Boolean,default:!1}},setup(t){return(e,s)=>{const n=D("el-alert");return x(),A(n,{class:ie(["htga4-alert",`htga4-alert-${t.type}`,{"htga4-text-center":t.centered}]),closable:!1},{default:w(()=>[Ft(e.$slots,"default")]),_:3},8,["class"])}}},hu=["innerHTML"],fu={__name:"InfoField",props:{modelValue:{required:!0},fieldSchema:{type:Object,required:!0}},setup(t){return(e,s)=>(x(),A(ks,{type:t.fieldSchema.alert_type||"info",centered:t.fieldSchema.centered||!1},{default:w(()=>[b("div",{class:"htga4-info-field-content",innerHTML:t.fieldSchema.content},null,8,hu)]),_:1},8,["type","centered"]))}},pu=ne(fu,[["__scopeId","data-v-a454f23f"]]),gu={key:0,class:"htga4-woocommerce-requirement"},mu={__name:"WooCommerceRequirementField",props:{modelValue:{required:!0},fieldSchema:{type:Object,required:!0}},setup(t){const e=S(()=>window.htga4Settings&&window.htga4Settings.isWoocommerceInstalled==="1"),s=S(()=>window.htga4Settings&&window.htga4Settings.isWoocommerceActive==="1"),n=S(()=>!e.value||!s.value);return(i,o)=>n.value?(x(),T("div",gu,[_(ks,{type:"warning"},{default:w(()=>o[0]||(o[0]=[b("div",{class:"htga4-woocommerce-requirement__content"},[b("strong",null,"WooCommerce Required:"),B(" E-Commerce events tracking requires the WooCommerce plugin to be installed and activated. ")],-1)])),_:1})])):U("",!0)}},_u=ne(mu,[["__scopeId","data-v-9a3d06fe"]]),vu=()=>{const t=(s,n)=>{var a;if(s.type==="hidden")return!1;if(!s.condition)return!0;let i=s.condition;i instanceof Array||(i=[i]);const o={"!=":(r,l)=>r!=l,"!==":(r,l)=>r!==l,"==":(r,l)=>r==l,"===":(r,l)=>r===l,">=":(r,l)=>r>=l,">":(r,l)=>r>l,"<":(r,l)=>r<l,"<=":(r,l)=>r<=l,any:(r,l)=>l.split(",").map(u=>u.trim()).includes(r),"not-any":(r,l)=>!l.split(",").map(u=>u.trim()).includes(r)};for(let r=0;r<i.length;r++){const l=i[r];let c=l.operator||"!=",u=!0;if((a=l==null?void 0:l.key)!=null&&a.includes("|")){const d=l.key.split("|"),h=c.split("|"),f=l.value.split("|");if(d.forEach((p,g)=>{const m=h[g]||h[0],y=f[g]||f[0];o[m](n[p],y)||(u=!1)}),u)return!0}else if(o[c](n[l.key],l.value))return!0}return!1};return{maybeShowField:t,evaluateComplexConditions:(s,n)=>!s||!s.length?!0:s.some(i=>i.type==="AND"?i.rules.every(o=>t({condition:[o]},n)):i.rules.some(o=>t({condition:[o]},n)))}},bu=["innerHTML"],yu={__name:"FormInput",props:{fieldSchema:{type:Object,required:!0},modelValue:{required:!0},context:{type:Object,required:!1},showLabel:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const s=X(),n=t,i=e,{maybeShowField:o}=vu(),a=f=>{f.target.closest(".htga4-pro-field-opacity")&&(s.commit("setDisplayProModal",!0),f.preventDefault(),f.stopPropagation())},r=f=>{let p=s.state.settings;return n.context&&(p={...n.context}),o(f,p)},l=S({get(){return n.modelValue},set(f){i("update:modelValue",f)}}),c=S(()=>{var f;if(n.fieldSchema.is_pro||(f=n.fieldSchema.class)!=null&&f.includes("htga4-pro-field-opacity"))return!0;if(n.fieldSchema.id==="measurement_id"){const p=s.state.settings;if(p.auth_google&&p.auth_google!=="")return!0}if(n.fieldSchema.id==="measurement_protocol_api_secret"&&n.fieldSchema.type==="text"){const p=s.state.settings,g=p.auth_google&&p.auth_google!=="",m=p.property&&p.property!=="",y=p.data_stream_id&&p.data_stream_id!=="";if(g&&m&&y)return!0}return!1}),u=S(()=>{let f=n.fieldSchema.class?n.fieldSchema.class.split(" "):[];return c.value&&n.fieldSchema.is_pro&&!f.includes("htga4-pro-field-opacity")&&f.push("htga4-pro-field-opacity"),f}),d=S(()=>n.fieldSchema.label_position||"left"),h=S(()=>n.showLabel&&!!n.fieldSchema.title);return Me(()=>n.modelValue,f=>{f!==l.value&&(l.value=f)},{deep:!0}),(f,p)=>{const g=D("el-tag"),m=D("el-text"),y=D("el-form-item");return x(),T(J,null,[t.fieldSchema.is_pro?(x(),A(g,{key:0,type:"danger",round:"",size:"small"},{default:w(()=>p[13]||(p[13]=[B("Pro")])),_:1})):U("",!0),oi(_(y,{class:ie(["htga4-form-item",u.value,"htga4-input-"+t.fieldSchema.type]),size:"large",onClick:a,"label-position":d.value},Ss({default:w(()=>[["text","number","email","textarea"].includes(t.fieldSchema.type)?(x(),A(Lc,{key:0,modelValue:l.value,"onUpdate:modelValue":p[0]||(p[0]=v=>l.value=v),fieldSchema:t.fieldSchema,disabled:c.value},null,8,["modelValue","fieldSchema","disabled"])):U("",!0),t.fieldSchema.type==="select"?(x(),A(Ic,{key:1,modelValue:l.value,"onUpdate:modelValue":p[1]||(p[1]=v=>l.value=v),fieldSchema:t.fieldSchema,disabled:c.value},null,8,["modelValue","fieldSchema","disabled"])):U("",!0),t.fieldSchema.type==="color"?(x(),A(Fc,{key:2,modelValue:l.value,"onUpdate:modelValue":p[2]||(p[2]=v=>l.value=v),fieldSchema:t.fieldSchema,disabled:c.value},null,8,["modelValue","fieldSchema","disabled"])):U("",!0),t.fieldSchema.type==="checkbox"?(x(),A(Vc,{key:3,modelValue:l.value,"onUpdate:modelValue":p[3]||(p[3]=v=>l.value=v),fieldSchema:t.fieldSchema,disabled:c.value},null,8,["modelValue","fieldSchema","disabled"])):U("",!0),t.fieldSchema.type==="switch"?(x(),A($c,{key:4,modelValue:l.value,"onUpdate:modelValue":p[4]||(p[4]=v=>l.value=v),fieldSchema:t.fieldSchema,disabled:c.value},null,8,["modelValue","fieldSchema","disabled"])):U("",!0),t.fieldSchema.type==="auth_button"?(x(),A(cu,{key:5,modelValue:l.value,"onUpdate:modelValue":p[5]||(p[5]=v=>l.value=v),fieldSchema:t.fieldSchema},null,8,["modelValue","fieldSchema"])):U("",!0),t.fieldSchema.type==="radio"?(x(),A(zc,{key:6,modelValue:l.value,"onUpdate:modelValue":p[6]||(p[6]=v=>l.value=v),fieldSchema:t.fieldSchema,disabled:c.value},null,8,["modelValue","fieldSchema","disabled"])):U("",!0),t.fieldSchema.type==="tabbed"?(x(),A(Uc,{key:7,modelValue:l.value,"onUpdate:modelValue":p[7]||(p[7]=v=>l.value=v),fieldSchema:t.fieldSchema,disabled:c.value},null,8,["modelValue","fieldSchema","disabled"])):U("",!0),t.fieldSchema.type==="wp_editor"?(x(),A(qc,{key:8,modelValue:l.value,"onUpdate:modelValue":p[8]||(p[8]=v=>l.value=v),fieldSchema:t.fieldSchema,disabled:c.value},null,8,["modelValue","fieldSchema","disabled"])):U("",!0),t.fieldSchema.type==="clipboard"?(x(),A(nu,{key:9,modelValue:l.value,"onUpdate:modelValue":p[9]||(p[9]=v=>l.value=v),fieldSchema:t.fieldSchema,disabled:c.value},null,8,["modelValue","fieldSchema","disabled"])):U("",!0),t.fieldSchema.type==="hidden"?(x(),A(du,{key:10,modelValue:l.value,"onUpdate:modelValue":p[10]||(p[10]=v=>l.value=v),fieldSchema:t.fieldSchema},null,8,["modelValue","fieldSchema"])):U("",!0),t.fieldSchema.type==="info"?(x(),A(pu,{key:11,modelValue:l.value,"onUpdate:modelValue":p[11]||(p[11]=v=>l.value=v),fieldSchema:t.fieldSchema},null,8,["modelValue","fieldSchema"])):U("",!0),t.fieldSchema.type==="woocommerce_requirement"?(x(),A(_u,{key:12,modelValue:l.value,"onUpdate:modelValue":p[12]||(p[12]=v=>l.value=v),fieldSchema:t.fieldSchema},null,8,["modelValue","fieldSchema"])):U("",!0),t.fieldSchema.desc?(x(),T("span",{key:13,class:"htga4-input-desc",innerHTML:t.fieldSchema.desc},null,8,bu)):U("",!0)]),_:2},[h.value?{name:"label",fn:w(()=>[_(m,{class:"mx-1"},{default:w(()=>[B(H(t.fieldSchema.title),1)]),_:1}),t.fieldSchema.help?(x(),A(as,{key:0,content:t.fieldSchema.help,placement:"bottom-start","use-html":!0},null,8,["content"])):U("",!0)]),key:"0"}:void 0]),1032,["class","label-position"]),[[ai,r(n.fieldSchema)]])],64)}}},we=ne(yu,[["__scopeId","data-v-7bbb36b7"]]),Se=(t,e)=>{const s=e.split(".");let n=window.htga4SettingsSchema[t].fields;for(let i=0;i<s.length;i++){const o=s[i];if(n.fields&&n.fields[o])n=n.fields[o];else if(n[o])n=n[o];else return null}return n},xu={class:"general-settings"},Ps="general_route",wu={__name:"General",setup(t){const e=window.htga4SettingsSchema[Ps],s=Object.keys(e.fields),n=X(),i=S(()=>n.state.settings);S(()=>n.state);const o=a=>{const r=Se(Ps,a);return(r==null?void 0:r.id)||a};return(a,r)=>{const l=D("el-text"),c=D("SettingsCard"),u=D("el-form");return x(),T("div",xu,[_(u,{model:i.value,"label-width":"auto"},{default:w(()=>[_(ks,null,{default:w(()=>[_(l,null,{default:w(()=>[r[1]||(r[1]=B("To access analytical reports within your WordPress dashboard, you need to connect / authenticate with your Google Analytics account. ")),r[2]||(r[2]=b("br",null,null,-1)),_(l,{type:"warning"},{default:w(()=>r[0]||(r[0]=[B("If you don't need to access the reports within the dashboard, manually insert your GA4 tracking ID below.")])),_:1})]),_:1})]),_:1}),_(c,null,{default:w(()=>[(x(!0),T(J,null,le(a.ecommerceEvents,d=>(x(),A(we,{key:d,modelValue:i.value[d],"onUpdate:modelValue":h=>i.value[d]=h,fieldSchema:I(Se)(Ps,d)},null,8,["modelValue","onUpdate:modelValue","fieldSchema"]))),128))]),_:1}),(x(!0),T(J,null,le(I(s),d=>(x(),A(we,{key:d,modelValue:i.value[o(d)],"onUpdate:modelValue":h=>i.value[o(d)]=h,fieldSchema:I(Se)(Ps,d)},null,8,["modelValue","onUpdate:modelValue","fieldSchema"]))),128))]),_:1},8,["model"])])}}},Su={class:"htga4-card-header"},qs={__name:"SettingsCard",props:{title:{type:String,required:!1}},setup(t){const e=t,s=S(()=>!!e.title);return(n,i)=>{const o=D("el-card");return x(),A(o,{class:"htga4-settings-card"},Ss({default:w(()=>[Ft(n.$slots,"default")]),_:2},[s.value?{name:"header",fn:w(()=>[b("div",Su,[b("span",null,H(t.title),1)])]),key:"0"}:void 0]),1024)}}},ku={class:"general-settings"},Xi="events-tracking_route",Cu={__name:"EventsTracking",setup(t){const e=X(),s=S(()=>e.state.settings),n=window.htga4SettingsSchema[Xi],i=n.sections,o=S(()=>{const a=[];return Object.keys(i).forEach(r=>{let l={},c=[];l.title=n.sections[r].title,c=Object.values(n.fields).filter(u=>u.section==r),l.fields=c.map(u=>u.id),a.push(l)}),a});return(a,r)=>{const l=D("el-form");return x(),T("div",ku,[_(l,{model:s.value,"label-width":"auto"},{default:w(()=>[(x(!0),T(J,null,le(o.value,(c,u)=>(x(),A(qs,{key:u,title:c.title},{default:w(()=>[(x(!0),T(J,null,le(c.fields,d=>(x(),A(we,{key:d,modelValue:s.value[d],"onUpdate:modelValue":h=>s.value[d]=h,fieldSchema:I(Se)(Xi,d)},null,8,["modelValue","onUpdate:modelValue","fieldSchema"]))),128))]),_:2},1032,["title"]))),128))]),_:1},8,["model"])])}}},Pu={class:"custom-events-manager"},Du={class:"custom-events-list"},Ru={class:"custom-event-card"},Mu={class:"custom-event-content"},Au={class:"custom-event-label"},Tu={class:"custom-event-actions"},Eu={key:0,class:"upgrade-prompt"},Lu={class:"upgrade-content"},Ou=["id"],Iu={key:0,class:"custom-events-drawer-content"},Fu={class:"drawer-card-title"},Vu={class:"drawer-card-title"},$u={class:"drawer-card-title"},zu={key:0},Bu={key:1,class:"advanced-parameters"},Nu={key:0,class:"empty-state"},Uu={key:1,class:"parameters-accordion"},Hu={class:"collapse-header"},ju={class:"parameter-title"},Wu={class:"parameter-number"},Gu={class:"parameter-key"},qu={class:"collapse-actions"},Yu={class:"parameter-content"},Xu={class:"parameter-field"},Ku={class:"parameter-field"},Qu={class:"parameter-field"},Zu={class:"add-parameter-section"},Ju={class:"custom-events-drawer-footer"},je="custom-events_route",ed={__name:"CustomEvents",setup(t){const e=X(),s=S({get(){return e.state.settings},set(L){e.commit("updateSettings",L)}}),n=window.htga4SettingsSchema[je],i=se(!1),o=se(null),a=se(!1),r=se(null),l=se([]),c=se(!1),u={pdf_download:"a[href$='.pdf']",zip_download:"a[href$='.zip']",doc_download:"a[href$='.docx']",all_file_downloads:"a[href$='.pdf'], a[href$='.zip'], a[href$='.docx']",external_link:"a[href^='http']:not([href*='yourdomain.com'])",affiliate_link:"a[href*='?ref=']",email_click:"a[href^='mailto:']",phone_click:"a[href^='tel:']",add_to_cart:".add_to_cart_button",checkout_button:".checkout-button, #checkout",signup_button:".subscribe-btn, .newsletter-submit",video_play:".video-play, .ytp-play-button",reveal_coupon:".reveal-coupon",faq_toggle:".faq-question, .accordion-header"},d={name:[{required:!0,message:"Event name is required",trigger:"blur"}],event_name:[{required:!0,message:"GA4 event name is required",trigger:"blur"},{pattern:/^[a-z0-9_]+$/,message:"Event name must be in snake_case format",trigger:"blur"}],trigger_value:[{required:!0,message:"Trigger target is required",trigger:"blur"}]},h=S(()=>o.value!==null?s.value.custom_events[o.value]:null),f=S(()=>{var L;return((L=window.htga4Settings)==null?void 0:L.isProActive)==="1"}),p=S(()=>{var L;return((L=s.value.custom_events)==null?void 0:L.length)||0}),g=()=>{if(!f.value&&p.value>=2){c.value=!0;return}c.value=!1;const L={id:"custom_event_"+Date.now(),active:0,name:"",event_name:"",trigger_type:"click",trigger_value:"",trigger_preset:"",parameter_mode:"simple",event_category:"",event_label:"",event_value:1,parameters:[]};Array.isArray(s.value.custom_events)||(s.value.custom_events=[]),o.value=s.value.custom_events.length,s.value.custom_events.push(L),i.value=!0},m=L=>{o.value=L,i.value=!0;const F=s.value.custom_events[L];F&&!F.parameter_mode&&(F.parameter_mode="simple")},y=L=>{Array.isArray(s.value.custom_events)||(s.value.custom_events=[]),s.value.custom_events.splice(L,1)[0];const F=s.value.custom_events.filter((he,Y,Q)=>Q.findIndex(Z=>Z.id===he.id)===Y);s.value.custom_events=F,p.value<2&&(c.value=!1)},v=()=>{o.value=null,i.value=!1},k=L=>{L&&u[L]&&(h.value.trigger_value=u[L])},P=()=>{h.value.parameters||(h.value.parameters=[]),h.value.parameters.push({param_key:"",param_value_type:"static_text",param_value:""});const L=h.value.parameters.length-1;l.value=[L]},C=L=>{h.value.parameters.splice(L,1)},O=L=>{switch(L){case"static_text":return"e.g: engagement, conversion";case"dynamic_click_text":return"Will use clicked element text";case"dynamic_href_filename":return"Will extract filename from href";case"dynamic_page_url":return"Will use current page URL";case"dynamic_form_id":return"Will use form ID or name";case"dynamic_data_attribute":return"e.g: data-location, data-type";case"dynamic_closest_section":return"Will use closest section class";default:return"Enter value or attribute name"}},R=L=>{switch(L){case"static_text":return"Enter a fixed value that will be sent with every event";case"dynamic_click_text":return"Automatically captures the text content of the clicked element";case"dynamic_href_filename":return"Extracts the filename from the href attribute of clicked links";case"dynamic_page_url":return"Uses the current page URL when the event fires";case"dynamic_form_id":return"Captures the ID or name attribute of the submitted form";case"dynamic_data_attribute":return"Specify which data-* attribute to extract (e.g., data-location)";case"dynamic_closest_section":return"Finds the nearest section element and uses its class name";default:return"Select a value type to see description"}},E=L=>{switch(L){case"click":return"Enter a CSS selector to target specific elements that users can click (e.g., buttons, links, form elements). Use presets above for common scenarios.";case"form_submit":return"Enter a CSS selector to target specific forms that users can submit (e.g., contact forms, newsletter signups, checkout forms). Use presets above for common scenarios.";case"page_view":return"Enter a URL pattern to track when users visit specific pages or sections of your website (e.g., /contact, /checkout, /download/*). Use wildcards (*) for dynamic URLs.";default:return"Enter a CSS selector or URL pattern to define when this event should be triggered. Use presets above for common scenarios."}},z=L=>{switch(L){case"click":return'e.g., .cta-button, #newsletter-form, a[href*="download"]';case"form_submit":return'e.g., #contact-form, .newsletter-form, form[name="signup"]';case"page_view":return"e.g., /contact, /checkout, /download/*";default:return"e.g., .cta-button, #newsletter-form, /download"}};Me(()=>{var L;return(L=h.value)==null?void 0:L.trigger_type},(L,F)=>{var he,Y,Q;if(L&&h.value){const Z=window.htga4SettingsSchema["custom-events_route"];(Q=(Y=(he=Z==null?void 0:Z.fields)==null?void 0:he.custom_events)==null?void 0:Y.fields)!=null&&Q.trigger_value&&(Z.fields.custom_events.fields.trigger_value.desc=E(L),Z.fields.custom_events.fields.trigger_value.placeholder=z(L)),F&&L!==F&&(h.value.trigger_value="")}},{immediate:!0});const j=async()=>{try{await r.value.validate(),a.value=!0;try{await e.dispatch("saveSettings"),Vt.success({message:"Custom event saved successfully",offset:40})}catch{Vt.error({message:"Failed to save custom event",offset:40})}finally{a.value=!1}}catch(L){console.log("Validation failed:",L)}},G=()=>{var L;(L=window.htga4Settings)!=null&&L.proUrl&&window.open(window.htga4Settings.proUrl,"_blank")};return(L,F)=>{const he=D("el-tag"),Y=D("el-button"),Q=D("el-card"),Z=D("el-empty"),ye=D("el-input"),ce=D("el-option"),Fe=D("el-option-group"),Ze=D("el-select"),$e=D("el-collapse-item"),He=D("el-collapse"),Ae=D("el-form"),qe=D("el-drawer");return x(),T("div",Pu,[b("div",Du,[(x(!0),T(J,null,le(s.value.custom_events,(W,M)=>(x(),T("div",{key:W.id,class:"custom-event-item"},[b("div",Ru,[b("div",Mu,[b("span",Au,[B(H(W.name)+" ",1),_(he,{size:"small",type:Number(W.active)===1?"success":"info",class:"status-tag"},{default:w(()=>[B(H(Number(W.active)===1?"Enabled":"Disabled"),1)]),_:2},1032,["type"])])]),b("div",Tu,[_(Y,{type:"primary",icon:I(ha),circle:"",size:"small",onClick:V=>m(M)},null,8,["icon","onClick"]),_(Y,{type:"danger",icon:I(Ln),circle:"",size:"small",onClick:V=>y(M)},null,8,["icon","onClick"])])])]))),128))]),_(Y,{type:"primary",onClick:g,icon:I(mn)},{default:w(()=>[B(H(I(n).texts.add_new),1)]),_:1},8,["icon"]),c.value?(x(),T("div",Eu,[_(ks,{type:"warning"},{default:w(()=>[b("div",Lu,[F[13]||(F[13]=b("h4",null,"Unlock Unlimited Custom Events",-1)),F[14]||(F[14]=b("p",null,"You've reached the 2-event limit in the free version. Upgrade to Pro for unlimited custom events, advanced analytics, and premium support. Start tracking everything that matters to your business.",-1)),_(Y,{type:"primary",size:"medium",onClick:G},{default:w(()=>F[12]||(F[12]=[B(" Upgrade to Pro ")])),_:1})])]),_:1})])):U("",!0),_(qe,{modelValue:i.value,"onUpdate:modelValue":F[11]||(F[11]=W=>i.value=W),title:h.value?"Edit Event":"New Event",size:"900","before-close":v},{header:w(({close:W,titleId:M,titleClass:V})=>[b("h2",{id:M,class:ie(V)},H(h.value?"Edit Event":"New Event"),11,Ou)]),default:w(()=>[h.value?(x(),T("div",Iu,[_(Ae,{ref_key:"eventForm",ref:r,model:h.value,rules:d,"label-width":"auto"},{default:w(()=>[_(Q,{shadow:"always",class:"settings-card"},{header:w(()=>[b("span",Fu,H(I(n).texts.basic_settings),1)]),default:w(()=>[_(we,{modelValue:h.value.active,"onUpdate:modelValue":F[0]||(F[0]=W=>h.value.active=W),fieldSchema:I(Se)(je,"custom_events.active"),context:h.value},null,8,["modelValue","fieldSchema","context"]),_(we,{modelValue:h.value.name,"onUpdate:modelValue":F[1]||(F[1]=W=>h.value.name=W),fieldSchema:I(Se)(je,"custom_events.name"),context:h.value},null,8,["modelValue","fieldSchema","context"]),_(we,{modelValue:h.value.event_name,"onUpdate:modelValue":F[2]||(F[2]=W=>h.value.event_name=W),fieldSchema:I(Se)(je,"custom_events.event_name"),context:h.value},null,8,["modelValue","fieldSchema","context"])]),_:1}),_(Q,{shadow:"always",class:"settings-card"},{header:w(()=>[b("span",Vu,H(I(n).texts.trigger_settings),1)]),default:w(()=>[_(we,{modelValue:h.value.trigger_type,"onUpdate:modelValue":F[3]||(F[3]=W=>h.value.trigger_type=W),fieldSchema:I(Se)(je,"custom_events.trigger_type"),context:h.value},null,8,["modelValue","fieldSchema","context"]),_(we,{modelValue:h.value.trigger_preset,"onUpdate:modelValue":[F[4]||(F[4]=W=>h.value.trigger_preset=W),k],fieldSchema:I(Se)(je,"custom_events.trigger_preset"),context:h.value},null,8,["modelValue","fieldSchema","context"]),(x(),A(we,{modelValue:h.value.trigger_value,"onUpdate:modelValue":F[5]||(F[5]=W=>h.value.trigger_value=W),fieldSchema:I(Se)(je,"custom_events.trigger_value"),context:h.value,key:`trigger-value-${h.value.trigger_type}`},null,8,["modelValue","fieldSchema","context"]))]),_:1}),_(Q,{shadow:"always",class:"settings-card"},{header:w(()=>[b("span",$u,H(I(n).texts.event_parameters),1)]),default:w(()=>[_(we,{modelValue:h.value.parameter_mode,"onUpdate:modelValue":F[6]||(F[6]=W=>h.value.parameter_mode=W),fieldSchema:I(Se)(je,"custom_events.parameter_mode"),context:h.value},null,8,["modelValue","fieldSchema","context"]),h.value&&(h.value.parameter_mode==="simple"||!h.value.parameter_mode)?(x(),T("div",zu,[_(we,{modelValue:h.value.event_category,"onUpdate:modelValue":F[7]||(F[7]=W=>h.value.event_category=W),fieldSchema:I(Se)(je,"custom_events.event_category"),context:h.value},null,8,["modelValue","fieldSchema","context"]),_(we,{modelValue:h.value.event_label,"onUpdate:modelValue":F[8]||(F[8]=W=>h.value.event_label=W),fieldSchema:I(Se)(je,"custom_events.event_label"),context:h.value},null,8,["modelValue","fieldSchema","context"]),_(we,{modelValue:h.value.event_value,"onUpdate:modelValue":F[9]||(F[9]=W=>h.value.event_value=W),fieldSchema:I(Se)(je,"custom_events.event_value"),context:h.value},null,8,["modelValue","fieldSchema","context"])])):h.value&&h.value.parameter_mode==="advanced"?(x(),T("div",Bu,[!h.value.parameters||h.value.parameters.length===0?(x(),T("div",Nu,[_(Z,{description:"No parameters added yet","image-size":80},{default:w(()=>[_(Y,{type:"primary",onClick:P,icon:I(mn)},{default:w(()=>F[15]||(F[15]=[B(" Add Your First Parameter ")])),_:1},8,["icon"])]),_:1})])):(x(),T("div",Uu,[_(He,{modelValue:l.value,"onUpdate:modelValue":F[10]||(F[10]=W=>l.value=W),accordion:""},{default:w(()=>[(x(!0),T(J,null,le(h.value.parameters,(W,M)=>(x(),A($e,{key:M,name:M,class:"parameter-collapse-item"},{title:w(()=>[b("div",Hu,[b("span",ju,[b("span",Wu,"#"+H(M+1),1),b("span",Gu,H(W.param_key||"Unnamed Parameter"),1)]),b("div",qu,[_(Y,{type:"danger",icon:I(Ln),circle:"",size:"small",onClick:dt(V=>C(M),["stop"]),class:"remove-btn"},null,8,["icon","onClick"])])])]),default:w(()=>[b("div",Yu,[b("div",Xu,[b("label",null,[F[16]||(F[16]=B(" Parameter Key ")),_(as,{content:"• The name of the parameter that will be sent to GA4 <br>• e.g., event_category, cta_text, page_title",placement:"top",effect:"dark"})]),_(ye,{modelValue:W.param_key,"onUpdate:modelValue":V=>W.param_key=V,placeholder:"e.g: event_category, cta_text",clearable:"",size:"small"},null,8,["modelValue","onUpdate:modelValue"])]),b("div",Ku,[b("label",null,[F[17]||(F[17]=B(" Value Type ")),_(as,{content:"• Choose how the parameter value will be determined <br>• static text or dynamically extracted from the page",placement:"top",effect:"dark"})]),_(Ze,{modelValue:W.param_value_type,"onUpdate:modelValue":V=>W.param_value_type=V,placeholder:"Select value type",style:{width:"100%"},size:"medium"},{default:w(()=>[_(Fe,{label:"Static Values"},{default:w(()=>[_(ce,{label:"Static Text",value:"static_text"})]),_:1}),_(Fe,{label:"Dynamic Values"},{default:w(()=>[_(ce,{label:"Clicked Element Text",value:"dynamic_click_text"}),_(ce,{label:"File Name from Href",value:"dynamic_href_filename"}),_(ce,{label:"Current Page URL",value:"dynamic_page_url"}),_(ce,{label:"Form ID",value:"dynamic_form_id"}),_(ce,{label:"Data Attribute",value:"dynamic_data_attribute"}),_(ce,{label:"Closest Section",value:"dynamic_closest_section"})]),_:1})]),_:2},1032,["modelValue","onUpdate:modelValue"])]),b("div",Qu,[b("label",null,[F[18]||(F[18]=B(" Parameter Value ")),_(as,{content:R(W.param_value_type),placement:"top",effect:"dark"},null,8,["content"])]),_(ye,{modelValue:W.param_value,"onUpdate:modelValue":V=>W.param_value=V,placeholder:O(W.param_value_type),clearable:"",size:"small"},null,8,["modelValue","onUpdate:modelValue","placeholder"])])])]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue"])])),b("div",Zu,[_(Y,{onClick:P,icon:I(mn),type:"primary",plain:"",size:"large"},{default:w(()=>F[19]||(F[19]=[B(" Add Parameter ")])),_:1},8,["icon"])])])):U("",!0)]),_:1})]),_:1},8,["model"])])):U("",!0)]),footer:w(()=>[b("div",Ju,[_(Y,{onClick:v,disabled:a.value},{default:w(()=>[B(H(I(n).texts.cancel),1)]),_:1},8,["disabled"]),_(Y,{type:"primary",onClick:j,loading:a.value},{default:w(()=>[B(H(I(n).texts.save),1)]),_:1},8,["loading"])])]),_:1},8,["modelValue","title"])])}}},td=ne(ed,[["__scopeId","data-v-f9039c2d"]]),sd={class:"cookie-notice-settings"},wn="cookie_notice_route",nd={__name:"CookieNotice",setup(t){Br(r=>({89205138:s.value.cookie_notice_enabled==!0?"block":"none",ebf5ac80:s.value.cookie_notice_banner_bg_color||"#0099ff","7ebdb578":s.value.cookie_notice_banner_text_color||"#ffffff","0004b1d1":s.value.cookie_notice_privacy_link_color||"#ffffff","41861a3c":s.value.cookie_notice_accept_bg_color||"#ffffff","08ca9394":s.value.cookie_notice_accept_text_color||"#000000","1a4b3645":s.value.cookie_notice_decline_bg_color||"transparent","0186072c":s.value.cookie_notice_decline_text_color||"#ffffff"}));const e=X(),s=S(()=>e.state.settings),n=window.htga4SettingsSchema[wn],i=n.sections;S(()=>{var r;return((r=window==null?void 0:window.htga4_cookie_notice_params)==null?void 0:r.notice_html)??""});const o=S(()=>Object.values(n.fields).filter(r=>!r.section).map(r=>r.id));Me(()=>s.value,()=>{},{deep:!0});const a=S(()=>{const r=[];return Object.keys(i).forEach(l=>{let c={};c.title=n.sections[l].title,c.description=n.sections[l].description;const u=Object.values(n.fields).filter(d=>d.section===l);c.fields=u.map(d=>d.id),r.push(c)}),r});return S(()=>({banner:{backgroundColor:s.value.cookie_notice_banner_bg_color||"#0099ff",color:s.value.cookie_notice_banner_text_color||"#ffffff",padding:"15px",display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:"10px"},text:{color:s.value.cookie_notice_banner_text_color||"#ffffff"},privacyLink:{color:s.value.cookie_notice_privacy_link_color||"#ffffff",marginLeft:"5px",textDecoration:"underline"},acceptBtn:{backgroundColor:s.value.cookie_notice_accept_bg_color||"#ffffff",color:s.value.cookie_notice_accept_text_color||"#000000",border:"none",padding:"8px 16px",borderRadius:"4px",cursor:"pointer",marginLeft:"10px"},declineBtn:{backgroundColor:s.value.cookie_notice_decline_bg_color||"transparent",color:s.value.cookie_notice_decline_text_color||"#ffffff",border:"1px solid "+(s.value.cookie_notice_decline_text_color||"#ffffff"),padding:"8px 16px",borderRadius:"4px",cursor:"pointer"}})),(r,l)=>{const c=D("el-form");return x(),T("div",sd,[_(c,{model:s.value,"label-width":"auto"},{default:w(()=>[_(qs,null,{default:w(()=>[(x(!0),T(J,null,le(o.value,u=>(x(),A(we,{key:u,modelValue:s.value[u],"onUpdate:modelValue":d=>s.value[u]=d,fieldSchema:I(Se)(wn,u)},null,8,["modelValue","onUpdate:modelValue","fieldSchema"]))),128))]),_:1}),(x(!0),T(J,null,le(a.value,(u,d)=>(x(),A(qs,{key:d,title:u.title,description:u.description},{default:w(()=>[(x(!0),T(J,null,le(u.fields,h=>(x(),A(we,{key:h,modelValue:s.value[h],"onUpdate:modelValue":f=>s.value[h]=f,fieldSchema:I(Se)(wn,h)},null,8,["modelValue","onUpdate:modelValue","fieldSchema"]))),128))]),_:2},1032,["title","description"]))),128))]),_:1},8,["model"])])}}},id=ne(nd,[["__scopeId","data-v-61fc8878"]]),od={class:"tools-settings"},Ki="tools_route",ad={__name:"Tools",setup(t){const e=window.htga4SettingsSchema[Ki],s=Object.keys(e.fields),n=X(),i=S(()=>n.state.settings);return(o,a)=>{const r=D("el-form");return x(),T("div",od,[_(r,{model:i.value,"label-width":"auto"},{default:w(()=>[(x(!0),T(J,null,le(I(s),l=>(x(),A(we,{key:l,modelValue:i.value[l],"onUpdate:modelValue":c=>i.value[l]=c,fieldSchema:I(Se)(Ki,l)},null,8,["modelValue","onUpdate:modelValue","fieldSchema"]))),128))]),_:1},8,["model"])])}}},rd={class:"htga4-settings-section"},ld={class:"htga4-cache-info"},cd={class:"htga4-cache-info__intro"},ud={class:"htga4-cache-info__details"},dd={class:"htga4-cache-info__column"},hd={class:"htga4-cache-info__list"},fd={class:"htga4-cache-info__column"},pd={class:"htga4-cache-info__list"},gd={class:"htga4-cache-management"},md={__name:"Cache",setup(t){const e=se(!1),s=se(!1),n=se({text:"",type:"success"}),i=(a,r="success")=>{n.value={text:a,type:r}},o=async()=>{var a;e.value=!0;try{const r=`${window.htga4Settings.apiBaseURL}htga4/v1/tools/clear-cache`,l=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":(a=window.htga4Settings)==null?void 0:a.nonce}});if(!l.ok)throw new Error(`API request failed: ${l.statusText}`);const c=await l.json();if(c.success)i(c.message||"Cache cleared successfully!","success"),s.value=!0;else throw new Error(c.message||"Failed to clear cache.")}catch(r){console.error("Cache clearing error:",r),i(r.message||"An error occurred while clearing cache.","error")}finally{e.value=!1}};return(a,r)=>{const l=D("el-icon"),c=D("el-button");return x(),T("div",rd,[r[10]||(r[10]=b("h2",{style:{"margin-top":"0"}},"Cache Management",-1)),b("div",ld,[b("div",cd,[_(l,{class:"htga4-cache-info__icon"},{default:w(()=>[_(I(da))]),_:1}),r[0]||(r[0]=b("p",null,"Google Analytics data is cached to improve performance and reduce API requests. If you are experiencing data synchronization issues, you can clear the cache to fetch fresh data from Google Analytics.",-1))]),b("div",ud,[b("div",dd,[r[4]||(r[4]=b("h3",null,"Cached Data Types",-1)),b("ul",hd,[b("li",null,[_(l,null,{default:w(()=>[_(I(Nr))]),_:1}),r[1]||(r[1]=b("div",null,[b("strong",null,"Reports"),b("p",null,"Standard reports, ecommerce reports, and realtime reports")],-1))]),b("li",null,[_(l,null,{default:w(()=>[_(I(Ur))]),_:1}),r[2]||(r[2]=b("div",null,[b("strong",null,"Account Data"),b("p",null,"GA4 accounts, properties, and data streams information")],-1))]),b("li",null,[_(l,null,{default:w(()=>[_(I(Hr))]),_:1}),r[3]||(r[3]=b("div",null,[b("strong",null,"User Data"),b("p",null,"User informations")],-1))])])]),b("div",fd,[r[8]||(r[8]=b("h3",null,"When to Clear Cache",-1)),b("ul",pd,[b("li",null,[_(l,null,{default:w(()=>[_(I(jr))]),_:1}),r[5]||(r[5]=b("p",null,"When data shown in reports appears outdated",-1))]),b("li",null,[_(l,null,{default:w(()=>[_(I(On))]),_:1}),r[6]||(r[6]=b("p",null,"After making changes to your Google Analytics setup",-1))]),b("li",null,[_(l,null,{default:w(()=>[_(I(fa))]),_:1}),r[7]||(r[7]=b("p",null,"If the force refresh option in reports is not resolving issues",-1))])])])])]),b("div",gd,[_(c,{type:"primary",size:"large",loading:e.value,onClick:o,disabled:e.value||s.value,icon:I(Ln)},{default:w(()=>r[9]||(r[9]=[B(" Clear Cache ")])),_:1},8,["loading","disabled","icon"]),n.value.text?(x(),A(ks,{key:0,type:n.value.type,class:"htga4-cache-message"},{default:w(()=>[B(H(n.value.text),1)]),_:1},8,["type"])):U("",!0)])])}}},Qi=`${htga4Settings.apiBaseURL}htga4/v1`,_d=()=>{var t;return{"Content-Type":"application/json","X-WP-Nonce":(t=window.htga4Settings)==null?void 0:t.nonce}},ke=async(t,e={})=>{try{let s=t;t&&!t.startsWith("http")&&(s=`${Qi}${t.startsWith("/")?t:"/"+t}`),t||(s=Qi);const n=await fetch(s,{...e,headers:{..._d(),...e.headers}});if(!n.ok)throw new Error(`API request failed: ${n.statusText}`);return await n.json()}catch(s){throw console.error("API request error:",s),s}},vd={getSettings:()=>ke("/settings"),updateSettings:t=>ke("/settings",{method:"POST",body:JSON.stringify(t)})},bd={getRoles:()=>ke("/roles")},yd={getAccounts:(t=!1)=>{const e=new URLSearchParams;t&&e.append("force_refresh","1");let s="/accounts";return e.toString()&&(s=`${s}?${e.toString()}`),ke(s)},getProperties:(t,e=!1)=>{if(!t)return Promise.resolve({});const s=new URLSearchParams;e&&s.append("force_refresh","1");let n=`/properties/${t}`;return s.toString()&&(n=`${n}?${s.toString()}`),ke(n)},getDataStreams:(t,e=!1)=>{if(!t)return Promise.resolve({});const s=new URLSearchParams;e&&s.append("force_refresh","1");let n=`/datastreams/${t}`;return s.toString()&&(n=`${n}?${s.toString()}`),ke(n)},getMeasurementProtocolSecrets:(t,e,s=!1)=>{if(!t||!e)return Promise.resolve({});const n=new URLSearchParams;s&&n.append("force_refresh","1");let i=`/measurement-protocol-secrets/${t}/${e}`;return n.toString()&&(i=`${i}?${n.toString()}`),ke(i)}},xd={fetchStandardReports:async({startDate:t=null,endDate:e=null,forceRefresh:s=!1}={})=>{try{const n=new URLSearchParams;t&&e&&(n.append("date_from",Ys(t)),n.append("date_to",Ys(e))),s&&n.append("force_refresh","1");let i="/reports/standard";return n.toString()&&(i=`${i}?${n.toString()}`),await ke(i)}catch(n){throw console.error("Error loading standard reports data:",n),n}}},wd={fetchEcommerceReports:async({startDate:t=null,endDate:e=null,forceRefresh:s=!1}={})=>{try{const n=new URLSearchParams;t&&e&&(n.append("date_from",Ys(t)),n.append("date_to",Ys(e))),s&&n.append("force_refresh","1");let i="/reports/ecommerce";return n.toString()&&(i=`${i}?${n.toString()}`),await ke(i)}catch(n){throw console.error("Error loading ecommerce reports data:",n),n}}},Sd={fetchRealtimeReports:async(t=!1)=>{try{const e=new URLSearchParams;t&&e.append("force_refresh","1");let s="/reports/realtime";return e.toString()&&(s=`${s}?${e.toString()}`),await ke(s)}catch(e){throw console.error("Error loading realtime reports data:",e),e}}},kd={getUserInfo:(t=!1)=>{let e="/userinfo";return t&&(e=`${e}?force_refresh=1`),ke(e)}},Cd={getDataStream:(t,e,s=!1)=>{const n=new URLSearchParams;n.append("property_id",t),n.append("stream_id",e),s&&n.append("force_refresh","1");let i="/datastream";return n.toString()&&(i=`${i}?${n.toString()}`),ke(i)}},Ys=t=>t?(typeof t=="string"?new Date(t):t).toISOString().split("T")[0]:"",Pd={getSettings:()=>ke("/google-ads/settings"),updateSettings:t=>ke("/google-ads/settings",{method:"POST",body:JSON.stringify(t)}),testConversion:()=>ke("/google-ads/test",{method:"POST"})},Le={settings:vd,roles:bd,ga4:yd,standard:xd,ecommerce:wd,realtime:Sd,user:kd,dataStream:Cd,googleAds:Pd,get:t=>ke(t),post:(t,e)=>ke(t,{method:"POST",body:e?JSON.stringify(e):void 0})},Dd={name:"GoogleAdsSettings",components:{SettingsCard:qs},setup(){const t=X(),e=se(null),s=se(!1),n=se(!1),i=se(["1"]),o=S({get(){var P,C,O,R,E,z,j,G,L,F,he;const v=((P=t.state.settings)==null?void 0:P.google_ads)||{},k=v.conversion_labels||{};return{enabled:v.enabled||!1,conversion_id:v.conversion_id||"",excluded_roles:"excluded_roles"in v?v.excluded_roles:["administrator"],conversion_labels:{purchase:{enabled:((C=k.purchase)==null?void 0:C.enabled)||!1,label:((O=k.purchase)==null?void 0:O.label)||""},add_to_cart:{enabled:((R=k.add_to_cart)==null?void 0:R.enabled)||!1,label:((E=k.add_to_cart)==null?void 0:E.label)||""},checkout:{enabled:((z=k.checkout)==null?void 0:z.enabled)||!1,label:((j=k.checkout)==null?void 0:j.label)||""},view_product:{enabled:((G=k.view_product)==null?void 0:G.enabled)||!1,label:((L=k.view_product)==null?void 0:L.label)||""},view_category:{enabled:((F=k.view_category)==null?void 0:F.enabled)||!1,label:((he=k.view_category)==null?void 0:he.label)||""}}}},set(v){t.commit("updateSettings",{google_ads:v})}}),a=S(()=>({conversion_id:o.value.enabled?[{required:!0,message:"Please enter your Conversion ID",trigger:"blur"},{pattern:/^[0-9]{9,10}$/,message:"Conversion ID must be 9-10 digits",trigger:"blur"}]:[]})),r=se({show:!1,type:"",message:""}),l=S(()=>{var v;return((v=window.htga4Settings)==null?void 0:v.isProActive)==="1"}),c=[{key:"purchase",icon:"el-icon-shopping-cart-2",title:"Purchase Event",placeholder:"e.g., AbCdEfGhIjKl",description:"Track when customers complete a purchase",isPro:!1},{key:"add_to_cart",icon:"el-icon-shopping-bag-1",title:"Add to Cart Event",placeholder:"e.g., XyZ123456789",description:"Track when customers add products to their cart",isPro:!0},{key:"checkout",icon:"el-icon-tickets",title:"Checkout Event",placeholder:"e.g., DeF456789012",description:"Track when customers initiate checkout process",isPro:!0},{key:"view_product",icon:"el-icon-view",title:"View Product Event",placeholder:"e.g., GhI345678901",description:"Track when customers view product pages",isPro:!0},{key:"view_category",icon:"el-icon-folder-opened",title:"View Category Event",placeholder:"e.g., JkL567890123",description:"Track when customers view category pages",isPro:!0}],u=S(()=>{const v=o.value.conversion_labels&&Object.values(o.value.conversion_labels).some(k=>k.enabled&&k.label&&k.label.trim()!=="");return{hasConversionId:!!o.value.conversion_id,hasConversionLabel:v,isEnabled:o.value.enabled}}),d=S(()=>u.value.hasConversionId?u.value.hasConversionLabel?u.value.isEnabled?3:2:1:0),h=S(()=>u.value.hasConversionId&&u.value.hasConversionLabel&&u.value.isEnabled),f=(v,k)=>{const P={...o.value,[v]:k};t.commit("updateSettings",{google_ads:P}),console.log(`Updated ${v}:`,k)},p=(v,k,P)=>{const C={...o.value,conversion_labels:{...o.value.conversion_labels,[v]:{...o.value.conversion_labels[v],[k]:P}}};t.commit("updateSettings",{google_ads:C}),console.log(`Updated conversion_labels.${v}.${k}:`,P)};return Me(()=>t.state.isSaving,async v=>{if(v&&e.value){if(console.log("Google Ads - Saving form data:",o.value),!o.value.enabled){t.commit("updateSettings",{google_ads:o.value});return}try{await e.value.validate()&&t.commit("updateSettings",{google_ads:o.value})}catch(k){console.error("Validation failed:",k),t.commit("updateSettings",{google_ads:o.value})}}}),{settingsForm:e,formData:o,rules:a,saving:s,testing:n,testResult:r,setupStatus:u,currentStep:d,isSetupComplete:h,activeStep:i,conversionEvents:c,isProActive:l,testConversion:async()=>{try{n.value=!0,r.value.show=!1,console.log("Testing conversion with settings:",o.value);const v=await Le.post("/google-ads/test");if(console.log("Test response:",v),v.tracking_code)try{if(window.gtag){const k=v.tracking_code.match(/gtag\('event',\s*'conversion',\s*({[^}]+})\)/);if(k){const P=new Function("return "+k[1])();window.gtag("event","conversion",P),console.log("Test conversion sent to Google Ads:",P),r.value={show:!0,type:"success",message:"Test conversion sent successfully! Check your Google Ads account in a few minutes."}}else throw new Error("Invalid tracking code format")}else r.value={show:!0,type:"warning",message:"Google Ads tracking script not found on this page. Please ensure Google Ads tracking is enabled and visit your frontend site to test."}}catch(k){console.error("Failed to execute tracking code:",k),r.value={show:!0,type:"error",message:"Failed to send test conversion. Please check your settings and try again."}}else r.value={show:!0,type:"success",message:v.message||"Test conversion prepared."}}catch(v){console.error("Test conversion error:",v);let k="Test failed";v.message&&(k=v.message),r.value={show:!0,type:"error",message:k}}finally{n.value=!1}},updateFormField:f,updateConversionLabel:p,openProUpgrade:()=>{var v;(v=window.htga4Settings)!=null&&v.proUrl&&window.open(window.htga4Settings.pr |