/* empty css       *//* empty css           */import{E as k}from"./fp-el-switch.js?ver=1.3.1";import{j as w,z as _,o as s,c as n,l as f,b as x,n as U,m as E,F as G,G as a,D as g,a as i,a2 as c,t as X,d as u,H as C}from"./admin.js?ver=1.3.1";import{P as S}from"./fp-ProUpgrade.js?ver=1.3.1";import{u as P,F as D}from"./fp-useFeatures.js?ver=1.3.1";import{u as F}from"./fp-useSettings.js?ver=1.3.1";import"./fp-Model.js?ver=1.3.1";const h={class:"fplayer-settings-section fplayer-analytics-settings-page"},I={class:"fplayer-header-filters"},N={class:"fplayer-header-filters-tabs"},T={key:0,class:"fplayer-form-item-group"},z={class:"fplayer-form-item"},B={key:0,class:"fplayer-form-sub-items"},M={class:"fplayer-form-item"},j={key:0,class:"fplayer-form-group"},q={class:"fplayer-form-group-help-text"},R={key:1,class:"fplayer-form-item-group"},Y={class:"fplayer-form-item"},$={key:0,class:"fplayer-form-sub-items"},H={class:"fplayer-form-item"},L={key:0,class:"fplayer-form-group"},le={__name:"AnalyticsSettings",props:{settings:{type:Object,required:!0}},setup(t){const{Settings:b}=F(),o=w(()=>{var p;return((p=b.settings)==null?void 0:p.google_analytics)||{}}),r=_("fluent_player"),{isProActive:v,getFeatureConfig:A}=P(),V=A(D.ANALYTICS);return(p,e)=>{var y;const d=k,m=C;return s(),n("div",h,[f(v)?(s(),n(G,{key:1},[a("div",I,[a("div",N,[a("button",{class:g(["fplayer-header-filters-tab",{"fplayer-header-filters-tab-active":r.value==="fluent_player"}]),onClick:e[0]||(e[0]=l=>r.value="fluent_player")}," FluentPlayer Analytics ",2),a("button",{class:g(["fplayer-header-filters-tab",{"fplayer-header-filters-tab-active":r.value==="google_analytics"}]),onClick:e[1]||(e[1]=l=>r.value="google_analytics")}," Google Analytics ",2)])]),r.value==="fluent_player"?(s(),n("div",T,[a("div",z,[i(d,{class:"fplayer-switch",modelValue:t.settings.enabled,"onUpdate:modelValue":e[2]||(e[2]=l=>t.settings.enabled=l),"aria-label":"Enable Analytics"},null,8,["modelValue"]),e[8]||(e[8]=a("div",{class:"fplayer-form-label-wrapper"},[a("label",{class:"fplayer-form-label"},"Enable Analytics"),a("p",{class:"fplayer-form-help"},"Track media plays and engagement metrics natively")],-1))]),t.settings.enabled?(s(),n("div",B,[a("div",M,[i(d,{class:"fplayer-switch",modelValue:t.settings.auto_cleanup.enabled,"onUpdate:modelValue":e[3]||(e[3]=l=>t.settings.auto_cleanup.enabled=l),"aria-label":"Auto Cleanup Analytics Data"},null,8,["modelValue"]),e[9]||(e[9]=a("div",{class:"fplayer-form-label-wrapper"},[a("label",{class:"fplayer-form-label"},"Auto Cleanup Analytics Data"),a("p",{class:"fplayer-form-help"},"Automatically delete old analytics records to keep your database optimized")],-1))]),(y=t.settings.auto_cleanup)!=null&&y.enabled?(s(),n("div",j,[i(m,{modelValue:t.settings.auto_cleanup.days,"onUpdate:modelValue":e[4]||(e[4]=l=>t.settings.auto_cleanup.days=l),modelModifiers:{number:!0},type:"number",min:1,max:730,class:"setting-input-days","aria-label":"Auto cleanup — days to keep analytics data"},null,8,["modelValue"]),a("p",q,[e[10]||(e[10]=c(" Analytics data older than ")),a("strong",null,X(t.settings.auto_cleanup.days)+" days",1),e[11]||(e[11]=c(" will be deleted automatically. "))])])):u("",!0)])):u("",!0)])):u("",!0),r.value==="google_analytics"?(s(),n("div",R,[a("div",Y,[i(d,{class:"fplayer-switch",modelValue:o.value.enabled,"onUpdate:modelValue":e[5]||(e[5]=l=>o.value.enabled=l),"aria-label":"Enable Google Analytics"},null,8,["modelValue"]),e[12]||(e[12]=a("div",{class:"fplayer-form-label-wrapper"},[a("label",{class:"fplayer-form-label"},"Enable Google Analytics"),a("p",{class:"fplayer-form-help"},"Send media playback events to Google Analytics")],-1))]),o.value.enabled?(s(),n("div",$,[a("div",H,[i(d,{class:"fplayer-switch",modelValue:o.value.use_existing_tag,"onUpdate:modelValue":e[6]||(e[6]=l=>o.value.use_existing_tag=l),"aria-label":"Use existing on-page tag"},null,8,["modelValue"]),e[13]||(e[13]=a("div",{class:"fplayer-form-label-wrapper"},[a("label",{class:"fplayer-form-label"},"Use existing on-page tag"),a("p",{class:"fplayer-form-help"},"Use an existing Google Analytics tag on your page instead of loading a new one.")],-1))]),o.value.use_existing_tag?u("",!0):(s(),n("div",L,[e[14]||(e[14]=a("label",{class:"fplayer-form-group-label"},"Measurement ID",-1)),i(m,{modelValue:o.value.measurement_id,"onUpdate:modelValue":e[7]||(e[7]=l=>o.value.measurement_id=l),placeholder:"G-XXXXXXXXXX",class:"setting-input","aria-label":"Google Analytics Measurement ID"},null,8,["modelValue"]),e[15]||(e[15]=a("p",{class:"fplayer-form-group-help-text"},"Your Google Analytics 4 Measurement ID (starts with G-). Required when not using an existing tag.",-1))]))])):u("",!0)])):u("",!0)],64)):(s(),x(S,U(E({key:0},f(V))),null,16))])}}};export{le as default};
