PageSourceSearch

https://app.qeen.ai/_nuxt/CNuzLY2A.js

js qeen.ai collected 2026-09-24 09:49:08 UTC 9,892 bytes, 1 lines download raw bytes

1import{_ as Re}from"./DlyqTE4o.js";import{l as $e,g as Fe,n as Ie,h as Ae,G as Le,A as u,r as m,p as We,H as ae,o as f,c as _,b as a,a as r,k as e,v as Ve,t as h,d as se,C as Y,E as re,q as ne,j as Be,F as le,O as Ue,s as Ne,w as x,x as qe}from"./D8JAWOXc.js";import{s as je}from"./6QIjfQ3v.js";import{u as Ge,M as E,P as He,b as O,G as Ye,S as ze,a as Je,f as R,m as Ke}from"./DBgo9rB8.js";import{u as Ze,_ as Qe,a as Xe,b as et,i as ie,f as $}from"./DoSbbNnJ.js";import{_ as tt}from"./BlHKpaAg.js";import{s as F,a as ot}from"./ZuX6oLEP.js";import{s as I}from"./QD5zkh2c.js";import{u as at}from"./BBOnd2Dq.js";import{K as st}from"./D13DZRJm.js";import{u as rt,a as nt,D as ce}from"./BRV9kY1l.js";import{n as lt}from"./COwO9dI3.js";import{u as it}from"./DRSK0AOR.js";import"./CEh4BZEc.js";import"./CEmu4y3R.js";import"./Ch2svcrh.js";import"./DoyIXTCl.js";import"./DlAUqK2U.js";import"./XZ1Xr026.js";import"./Bwmmk3-k.js";import"./TtdM2BIz.js";import"./CAV3F9o6.js";import"./BcuaDaoQ.js";import"./DpeEZVWq.js";import"./CPH9xMxY.js";import"./Bf6Sc8ju.js";import"./gvqPCG7P.js";import"./fxBjJcZr.js";import"./BxzlEGuZ.js";import"./lbhY9UtT.js";import"./DKokxms_.js";import"./DNmIlrBV.js";import"./DU5l-jYu.js";import"./C4iS2aBk.js";import"./BlRZheSs.js";import"./BShuEJrN.js";import"./BaPcgRPf.js";import"./CpepP_ky.js";import"./k-JCkjHK.js";import"./CiC-M5WA.js";import"./BX3AYuz9.js";import"./Cq2mDni-.js";import"./CYj_FSKN.js";import"./CAtiYsWG.js";import"./XXI8HlUT.js";import"./B9AmSqC5.js";import"./BbtyLaks.js";const ct={class:"flex flex-col h-full bg-gray-50"},dt={class:"px-8 pt-8 pb-0 w-full shrink-0"},ut={class:"mb-6 flex items-center justify-between flex-wrap gap-4"},pt={class:"flex items-center gap-3"},mt={class:"text-3xl font-bold text-gray-900"},vt={class:"text-sm text-gray-500 mt-0.5"},ft={class:"font-medium text-gray-700"},yt={class:"flex items-center gap-3 flex-wrap"},gt=["disabled"],bt={key:0,class:"inline-flex h-[1.1rem] min-w-[1.1rem] items-center justify-center rounded-full bg-indigo-600 px-1 text-[10px] font-semibold text-white"},wt={class:"flex-1 overflow-y-auto px-8 pb-8"},_t={key:0,class:"flex flex-col gap-4"},yo=$e({__name:"wow-movement",setup(ht){const{t:n,locale:y}=Fe(),{dispatchReportReady:de}=it(),{setTitle:ue}=at(),z=Ie(),pe=Ae(),J=Le(),S=u(()=>{var t;return((t=J.selectedWebsite)==null?void 0:t.website)??""}),K=u(()=>lt(J.selectedWebsiteMetricDefinitions).ad_spend.include_acquisition_spend),{currencyOptionsLoading:Z,currencyDropdownOptions:me,loadCurrencyOptions:ve}=rt(),l=nt(),fe=u(()=>me.value),{isExporting:Q,exportToExcel:ye}=Ge(),k=m(0);let g=null;const A=m(new Date),C=m(!0),D=m(0),L=m(null),W=m(null),V=m(null),B=m(null),ge=()=>y.value==="ar"?"ar":"en-US",X=t=>t.toLocaleDateString(ge(),{month:"short",day:"numeric",year:"numeric"}),be=t=>{const o=t.getDay(),c=o===0?-6:1-o,d=new Date(t);d.setDate(t.getDate()+c);const s=new Date(d);s.setDate(d.getDate()-7);const i=new Date(s);return i.setDate(s.getDate()+6),{start:s,end:i}},v=u(()=>be(A.value)),we=u(()=>`${X(v.value.start)} - ${X(v.value.end)}`),U=t=>{const o=t.getFullYear(),c=String(t.getMonth()+1).padStart(2,"0"),d=String(t.getDate()).padStart(2,"0");return`${o}-${c}-${d}`},{drawerVisible:M,reportFilterState:N,filterOptions:q,isFilterMetadataLoading:ee,clearField:_e,countActiveFilters:he,buildPayload:P,replaceScopeState:xe,getScope:Se,loadFilterScopes:ke,loadFilterOptions:Ce}=Ze("wow-movement"),De=["paidMedia","ga4Site","shopifyOrders","postPurchase"],te=u(()=>De[D.value]??"paidMedia"),j=u(()=>Se(te.value)),G=u(()=>j.value&&j.value.fields.length?[j.value]:[]),Me=u(()=>{var o;const t=(o=N.value.paidMedia)==null?void 0:o.adPlatform;return Array.isArray(t)?t:[]}),H=u(()=>he([te.value])),Pe=u(()=>et(He,Me.value)),p=u(()=>({paid_media:O("weekly",Pe.value,L.value),ga4_site:O("weekly",Ye,W.value),shopify_orders:O("weekly",ze,V.value),post_purchase:O("weekly",Je,B.value)})),T=t=>t&&typeof t=="object"&&"current"in t&&"prior"in t,b=async()=>{if(!S.value){L.value=null,W.value=null,V.value=null,B.value=null,C.value=!1;return}A.value=new Date;const t=++k.value;let o=!1;g==null||g.abort(),g=new AbortController;const c=g.signal,d={domain:S.value,date:U(A.value),currency:l.value||ce};C.value=!0,Ce({domain:S.value,mode:"daily",start:v.value.start,end:v.value.end,currency:l.value||ce,signal:c}).catch(s=>{ie(s)||t!==k.value||(q.value={},console.error("Failed to load dynamic filter options:",s))});try{const s=await Promise.allSettled([$($fetch,"/api/reports/movement/wow/paid-media",{method:"POST",body:{...d,filters:P("paidMedia")},signal:c},T),$($fetch,"/api/reports/movement/wow/ga4-site",{method:"POST",body:{...d,filters:P("ga4Site")},signal:c},T),$($fetch,"/api/reports/movement/wow/shopify-orders",{method:"POST",body:{...d,filters:P("shopifyOrders")},signal:c},T),$($fetch,"/api/reports/movement/wow/post-purchase",{method:"POST",body:{...d,filters:P("postPurchase")},signal:c},T)]);if(t!==k.value)return;const i=[[s[0],L],[s[1],W],[s[2],V],[s[3],B]];for(const[w,oe]of i)if(w.status==="fulfilled")oe.value=w.value;else{if(ie(w.reason))continue;oe.value=null,z.add({severity:"warn",summary:n("warning"),detail:n("failed_to_fetch_data"),life:4e3})}o=s.every(w=>w.status==="fulfilled")}finally{t===k.value&&(C.value=!1,await de("wow_movement",o))}},Te=async t=>{xe(t),await b()},Ee=async(t,o)=>{_e(t,o),await b()},Oe=async()=>{const t=Ke("weekly"),o=U(v.value.start),c=U(v.value.end);try{await ye([{name:"Paid Media",columns:t,rows:R(p.value.paid_media,{locale:y.value,currencyCode:l.value})},{name:"GA4 Site",columns:t,rows:R(p.value.ga4_site,{locale:y.value,currencyCode:l.value})},{name:"Shopify Orders",columns:t,rows:R(p.value.shopify_orders,{locale:y.value,currencyCode:l.value})},{name:"Post Purchase",columns:t,rows:R(p.value.post_purchase,{locale:y.value,currencyCode:l.value})}],`weekly-movement-${o}-to-${c}.csv`)}catch{z.add({severity:"warn",summary:n("export_excel_error"),life:4e3})}};return We(async()=>{st({report_name:"wow_movement"}),ke(),ve(),await b()}),ae(S,async()=>{await b()}),ae(l,async()=>{await b()}),ue(n("weekly_movement")),(t,o)=>{const c=qe,d=je,s=Re;return f(),_(le,null,[a(c),r("div",ct,[r("div",dt,[r("div",ut,[r("div",pt,[a(d,{icon:"pi pi-arrow-left",text:"",rounded:"",severity:"success",class:"!text-lime-green hover:!bg-lime-green hover:!text-dark-forest","aria-label":e(n)("back"),onClick:o[0]||(o[0]=i=>("navigateTo"in t?t.navigateTo:e(Ve))(e(pe)("/reports/pulse")))},null,8,["aria-label"]),r("div",null,[r("h1",mt,h(e(n)("weekly_movement")),1),r("p",vt,[o[5]||(o[5]=se(" Current Week: ")),r("span",ft,h(e(we)),1)])])]),r("div",yt,[a(tt,{modelValue:e(l),"onUpdate:modelValue":o[1]||(o[1]=i=>Y(l)?l.value=i:null),options:e(fe),loading:e(Z),disabled:e(Z),"width-class":"w-36"},null,8,["modelValue","options","loading","disabled"]),a(d,{icon:"pi pi-file-excel",label:e(n)("export_excel"),loading:e(Q),disabled:e(Q),onClick:Oe},null,8,["label","loading","disabled"]),e(G).length||e(ee)?(f(),_("button",{key:0,class:re(["inline-flex items-center gap-1.5 rounded-lg border px-3 py-2 text-sm font-medium transition-colors",e(H)>0?"border-indigo-200 bg-indigo-50 text-indigo-700 hover:bg-indigo-100":"border-gray-200 bg-white text-gray-600 hover:bg-gray-50 hover:text-gray-800"]),disabled:e(ee),onClick:o[2]||(o[2]=i=>M.value=!0)},[o[6]||(o[6]=r("i",{class:"pi pi-sliders-h text-xs"},null,-1)),se(" "+h(e(n)("filters"))+" ",1),e(H)>0?(f(),_("span",bt,h(e(H)),1)):ne("",!0)],10,gt)):ne("",!0),a(s)])]),a(Qe,{"model-value":e(N),scopes:e(G),"options-by-scope":e(q),onClearField:Ee},null,8,["model-value","scopes","options-by-scope"]),o[7]||(o[7]=Be('<div class="flex items-center gap-4 text-xs mb-4"><span class="inline-flex items-center gap-1.5"><span class="w-3 h-3 rounded bg-green-100 border border-green-300 inline-block"></span> Improving </span><span class="inline-flex items-center gap-1.5"><span class="w-3 h-3 rounded bg-yellow-100 border border-yellow-300 inline-block"></span> Flat (+/-5%) </span><span class="inline-flex items-center gap-1.5"><span class="w-3 h-3 rounded bg-red-100 border border-red-300 inline-block"></span> Declining </span></div>',1))]),r("div",wt,[e(C)?(f(),_("div",_t,[(f(),_(le,null,Ue(4,i=>r("div",{key:i,class:"bg-white rounded-xl border border-gray-200 p-6"},[a(e(I),{height:"2rem",width:"30%",class:"mb-4"}),a(e(I),{height:"1.5rem",class:"mb-2"}),a(e(I),{height:"1.5rem",class:"mb-2"}),a(e(I),{height:"1.5rem"})])),64))])):(f(),Ne(e(ot),{key:1,activeIndex:e(D),"onUpdate:activeIndex":o[3]||(o[3]=i=>
1Y(D)?D.value=i:null)},{default:x(()=>[a(e(F),{header:e(n)("paid_media"),value:0},{default:x(()=>[r("div",{class:re(["mb-3 flex items-center gap-2 rounded-lg border px-4 py-2 text-sm",e(K)?"border-node-cyan/30 bg-node-cyan/[8%] text-info-dark":"border-border-soft bg-surface-subtle text-grays-30"])},[o[8]||(o[8]=r("i",{class:"pi pi-info-circle text-base flex-shrink-0"},null,-1)),r("span",null,h(e(K)?e(n)("paid_media_ad_spend_included"):e(n)("paid_media_ad_spend_excluded")),1)],2),a(E,{type:"weekly",rows:e(p).paid_media,"currency-code":e(l)},null,8,["rows","currency-code"])]),_:1},8,["header"]),a(e(F),{header:e(n)("ga4_site"),value:1},{default:x(()=>[a(E,{type:"weekly",rows:e(p).ga4_site,"currency-code":e(l)},null,8,["rows","currency-code"])]),_:1},8,["header"]),a(e(F),{header:e(n)("shopify_orders"),value:2},{default:x(()=>[a(E,{type:"weekly",rows:e(p).shopify_orders,"currency-code":e(l)},null,8,["rows","currency-code"])]),_:1},8,["header"]),a(e(F),{header:e(n)("post_purchase"),value:3},{default:x(()=>[a(E,{type:"weekly",rows:e(p).post_purchase,"currency-code":e(l)},null,8,["rows","currency-code"])]),_:1},8,["header"])]),_:1},8,["activeIndex"]))]),a(Xe,{visible:e(M),"onUpdate:visible":o[4]||(o[4]=i=>Y(M)?M.value=i:null),"model-value":e(N),scopes:e(G),"options-by-scope":e(q),onApply:Te},null,8,["visible","model-value","scopes","options-by-scope"])])],64)}}});export{yo as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.