1import{_ as ae}from"./CQlHaPNc.js";import{u as re,a as le,k as de,_ as ce,h as ue,p as pe,q as me,at as xe}from"#entry";import{u as he,a as ge,_ as fe,b as _e}from"./XBGjVe5U.js";import{d as be,e as a,z as l,u as e,j as m,Q as t,B as o,D as x,A as h,Z as ye,f as v,F as f,G as P,H as V,i as S,v as ve,c as _,r as we}from"./-DLWNC6n.js";import{d as ke}from"./Dh5mzWV7.js";import{t as R}from"./B7nunhTo.js";import{a as Ce,X as Fe,d as Pe,C as Se,i as B,E,m as Ae,a$ as De,u as $e,M as je}from"./EBY1djgu.js";import"./0CxX9Cht.js";import"./DCeJgA9s.js";import"./DlAUqK2U.js";import"./BRIfBqhl.js";import"./sTLL6Cn6.js";import"./BELBDYYh.js";import"./2QPFSqsv.js";import"./h_Vinhmi.js";import"./D6VXUkt4.js";import"./wTUN7Kzk.js";import"./DfyMrpC0.js";import"./6olSodPa.js";import"./yFFVnsya.js";import"./Xq-tkkbV.js";import"./Cy3kuDHi.js";import"./BipZOFvy.js";import"./BTEMIbNT.js";import"./KXDfhFVj.js";import"./C90W3vFq.js";import"./BXXGAmBr.js";import"./BEVIJeYp.js";import"./bx2l_yX-.js";import"./D7agGoI6.js";import"./AOcWTlQG.js";import"./8OCP1k-F.js";import"./Dw8tTD9R.js";const Be={class:"bg-white",dir:"rtl"},Te={key:0,class:"mx-3 mt-2 flex gap-2 rounded-xl border border-amber-200/80 bg-amber-50 px-3 py-2.5 text-start text-sm text-amber-950"},Me={class:"min-w-0 flex-1 leading-relaxed"},Le=["aria-label"],Ne={class:"px-3 pt-4"},Ve={class:"mb-3 flex items-start gap-3"},Re={class:"min-w-0 flex-1"},Ee={class:"text-lg font-bold text-gray-900"},He={class:"mt-0.5 text-sm text-gray-500"},Ie={key:0,class:"mb-3 rounded-xl border border-red-100 bg-red-50 px-3 py-2 text-sm text-red-800"},Ge={class:"mb-3 grid grid-cols-2 gap-3",dir:"ltr"},ze={class:"flex flex-col items-center justify-center rounded-2xl border border-gray-100 bg-[#F8FAFC] px-2 py-4 shadow-sm"},qe={class:"w-full text-start text-sm font-semibold text-gray-800"},Ue={class:"absolute inset-3 flex flex-col items-center justify-center rounded-full bg-white text-center shadow-inner"},Xe={class:"text-lg font-bold text-gray-900"},Ke={class:"text-[10px] text-gray-500"},Oe={class:"mt-3 w-full space-y-1.5 px-1 text-[11px]"},Qe={class:"flex items-center justify-between gap-1"},We={class:"flex items-center gap-1 text-gray-600"},Ze={class:"font-medium text-gray-800"},Je={class:"flex items-center justify-between gap-1"},Ye={class:"flex items-center gap-1 text-gray-600"},et={class:"font-medium text-gray-800"},tt={class:"flex items-center justify-between gap-1"},st={class:"flex items-center gap-1 text-gray-600"},nt={class:"font-medium text-gray-800"},ot={class:"flex flex-col gap-2"},it={class:"flex items-center gap-2 rounded-xl bg-[#EFF6FF] px-2.5 py-2"},at={class:"shrink-0 text-[12.5px] font-extrabold text-gray-900"},rt={class:"min-w-0 flex-1 text-end text-[11.5px] font-semibold text-gray-600"},lt={class:"flex items-center gap-2 rounded-xl bg-[#F0FDF4] px-2.5 py-2"},dt={class:"shrink-0 text-[12.5px] font-extrabold text-gray-900"},ct={class:"min-w-0 flex-1 text-end text-[11.5px] font-semibold text-gray-600"},ut={class:"flex items-center gap-2 rounded-xl bg-[#FFF7ED] px-2.5 py-2"},pt={class:"shrink-0 text-[12.5px] font-extrabold text-gray-900"},mt={class:"min-w-0 flex-1 text-end text-[11.5px] font-semibold text-gray-600"},xt={class:"mb-4 overflow-hidden rounded-xl"},ht={class:"mx-3 rounded-2xl border border-gray-100 bg-white px-3 py-3 shadow-sm"},gt={class:"text-start"},ft={class:"text-sm font-bold text-gray-900"},_t={class:"mt-0.5 text-xs text-gray-500"},bt={class:"relative mt-3"},yt=["viewBox","aria-label"],vt=["points"],wt=["points"],kt=["points"],Ct=["cx","cy","onMouseenter","onClick"],Ft={key:1,class:"absolute start-3 top-1 rounded-lg bg-gray-900 px-2 py-1.5 text-xs text-white shadow-md"},Pt={class:"font-semibold"},St={class:"text-[10px] text-white/80"},At={key:2,class:"flex h-28 items-center justify-center text-sm text-gray-400"},Dt={key:0,class:"mt-1 flex flex-row-reverse justify-between px-1 text-[10px] text-gray-500"},$t={class:"mt-3 space-y-1 border-t border-gray-100 pt-3 text-xs text-gray-600"},jt={key:0},Bt={class:"mx-3 mt-4 grid grid-cols-3 gap-2"},Tt=["onClick"],Mt={class:"text-[10px] font-medium leading-tight text-gray-800"},Lt={class:"text-[10px] font-medium leading-tight text-gray-800"},Nt={class:"mt-5"},Vt={class:"mx-3 flex items-center justify-between gap-2 px-1 py-0.5"},Rt={key:0,class:"mx-3 me-7 flex h-[170px] items-center justify-center rounded-2xl border border-gray-200 bg-white"},Et={class:"px-4 text-center text-sm font-medium leading-relaxed text-[#718096]"},Ht={key:1,class:"h-[194px] overflow-x-auto overscroll-x-contain pt-1 pb-2 [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"},It={class:"flex h-[182px] flex-nowrap gap-3 ps-3 pe-4"},Gt={class:"h-20 w-full shrink-0 overflow-hidden bg-gray-100"},zt=["src"],qt={class:"flex min-h-0 flex-1 flex-col px-2.5 pb-2 pt-2.5 text-start"},Ut={class:"line-clamp-2 text-xs font-bold leading-snug text-[#1A202C]"},Xt={key:0,class:"mt-1 flex min-h-0 items-center gap-1 text-[10px] leading-tight text-[#718096]"},Kt={class:"line-clamp-1"},Ot={class:"mt-auto flex items-center justify-between gap-1 pt-1"},Qt={class:"max-w-[55%] truncate rounded-full bg-[#F3F4F6] px-2 py-0.5 text-[9.5px] font-normal text-[#4B5563]"},Wt={class:"inline-flex shrink-0 items-center gap-0.5 text-[10px] text-[#718096]"},Bs=be({__name:"HomeBusinessMobileDashboard",setup(Zt){const{t:r,locale:w}=re(),A=le(),H=de(),I=ue().public.apiBase,{range:D,data:G,pending:k,error:z,refresh:q}=he(),{actionGrid:U,featuredDialogOpen:$,onActionClick:T}=ge(),M=ke("gooya:business-pending-banner-dismissed",!1),X=_(()=>M.value?!1:xe(H.user));function K(){M.value=!0}const u=_(()=>G.value),O=_(()=>{const s=u.value;
1if(!s||s.donutViewsPct+s.donutEngagementPct+s.donutConversionPct<=0)return"conic-gradient(#e5e7eb 0deg 360deg)";let d=0;const c=[],b=(i,y)=>{if(i<=0)return;const g=i/100*360,N=d+g;c.push(`${y} ${d}deg ${N}deg`),d=N};return b(s.donutViewsPct,"#60a5fa"),b(s.donutEngagementPct,"#facc15"),b(s.donutConversionPct,"#86efac"),d<360&&c.push(`#e5e7eb ${d}deg 360deg`),`conic-gradient(${c.join(", ")})`});function C(s){if(!s)return"â";const n=new Date(s.includes("T")?s:`${s}T12:00:00`);if(Number.isNaN(n.getTime()))return s;if(w.value==="fa"||w.value==="ar"){const d=n.toLocaleDateString("en-CA");return R(d.replace(/-/g,"/"))}return n.toLocaleDateString("en-CA")}const Q=_(()=>{const s=u.value;return!s?.chartFromIso||!s.chartToIso?"":r("home.business.chartRange",{from:C(s.chartFromIso),to:C(s.chartToIso)})}),p=_(()=>_e(u.value?.viewsSeries??[],280,120)),F=we(null),j=_(()=>{const s=F.value;return s==null?null:p.value.tooltip[s]??null});function W(s){const n=new Date(s.includes("T")?s:`${s}T12:00:00`);if(Number.isNaN(n.getTime()))return s;const d=["ÛÚ©Ø´ÙØ¨Ù","Ø´ÙØ¨Ù","جÙ
عÙ","Ù¾ÙØ¬Ø´ÙبÙ","ÚÙØ§Ø±Ø´ÙبÙ","سÙâØ´ÙØ¨Ù","Ø¯ÙØ´ÙبÙ"];return w.value==="fa"||w.value==="ar"?d[n.getDay()]??"":n.toLocaleDateString("en",{weekday:"short"})}const Z=_(()=>p.value.labels.map((n,d)=>({i:d,text:W(n)})));function J(s){const n=s.raw,d=typeof n.backend_ad_type=="string"&&n.backend_ad_type.trim()?n.backend_ad_type.trim():"",c=String(n.ad_type??"").trim();return{id:Number(s.id)||0,slug:typeof n.slug=="string"?n.slug:void 0,title:s.title,ad_type:c||"general",category:n.category,profileSourceAdType:d||c||String(n.type??""),jobAdRole:c==="employer"?"employer":c==="job_seeker"?"seeker":void 0}}function Y(s){return A(pe(J(s)))}function L(s){return me(s,I)}function ee(){D.value=D.value==="7d"?"30d":"7d"}const te=_(()=>D.value==="30d"?r("home.business.rangeMonthly"):r("home.business.rangeWeekly"));function se(s){const n=Math.floor(Math.max(0,s));let d;if(n>=1e6){const c=n/1e6;d=`${c>=10?String(Math.round(c)):c.toFixed(1)}M`}else if(n>=1e3){const c=n/1e3;d=`${c>=10?String(Math.round(c)):c.toFixed(1)}K`}else d=String(n);return w.value==="fa"||w.value==="ar"?R(d):d}function ne(s){switch(String(s??"").toLowerCase().trim()){case"active":return"ÙØ¹Ø§Ù";case"pending":return"در Ø§ÙØªØ¸Ø§Ø±";case"rejected":return"رد شدÙ";case"draft":return"در Ø§ÙØªØ¸Ø§Ø± تاÛÛØ¯";case"expired":return"Ù
ÙÙØ¶Û";default:return s?.trim()?s:"â"}}function oe(s){return String(s??"").replace(/<[^>]*>/g," ").replace(/ /gi," ").replace(/\s+/g," ").trim()}function ie(s){return oe(s.title||"")||"Ø¢Ú¯ÙÛ"}return(s,n)=>{const d=ae,c=ce,b=fe;return a(),l("div",Be,[e(X)?(a(),l("div",Te,[m(e(Ce),{class:"mt-0.5 h-5 w-5 shrink-0 text-amber-700","aria-hidden":"true"}),t("p",Me,o(e(r)("home.business.pendingBanner")),1),t("button",{type:"button",class:"shrink-0 rounded-lg p-1 text-amber-800 hover:bg-amber-100","aria-label":e(r)("common.close"),onClick:K},[m(e(Fe),{class:"h-5 w-5"})],8,Le)])):x("",!0),t("div",Ne,[t("div",Ve,[t("div",Re,[t("h2",Ee,o(e(r)("home.business.title")),1),t("p",He,o(e(r)("home.business.subtitle")),1)]),t("button",{type:"button",class:"flex shrink-0 items-center gap-1 rounded-full border border-gray-200 bg-white px-3 py-1.5 text-xs font-medium text-gray-700 shadow-sm",onClick:ee},[m(e(Pe),{class:"h-3.5 w-3.5 text-gray-500","aria-hidden":"true"}),h(" "+o(e(te))+" ",1),m(e(Se),{class:"h-3.5 w-3.5 text-gray-400","aria-hidden":"true"})])]),e(z)?(a(),l("div",Ie,[h(o(e(r)("common.error"))+" ",1),t("button",{type:"button",class:"ms-2 font-medium underline",onClick:n[0]||(n[0]=()=>e(q)())},o(e(r)("common.retry")),1)])):x("",!0),t("div",Ge,[t("div",ze,[t("div",qe,o(e(r)("home.business.statusReport")),1),t("div",{class:"relative mx-auto mt-3 h-28 w-28 rounded-full p-2",style:ye({background:e(O)})},[t("div",Ue,[t("span",Xe,o(e(k)?"â¦":`${e(u)?.donutCenterVisitsPct??0}%`),1),t("span",Ke,o(e(r)("home.business.visitsLegendCenter")),1)])],4),t("div",Oe,[t("div",Qe,[t("span",We,[n[3]||(n[3]=t("span",{class:"h-2 w-2 rounded-full bg-sky-400"},null,-1)),h(" "+o(e(r)("home.business.legend.views")),1)]),t("span",Ze,o(e(u)?.donutViewsPct??0)+"%",1)]),t("div",Je,[t("span",Ye,[n[4]||(n[4]=t("span",{class:"h-2 w-2 rounded-full bg-yellow-400"},null,-1)),h(" "+o(e(r)("home.business.legend.engagement")),1)]),t("span",et,o(e(u)?.donutEngagementPct??0)+"%",1)]),t("div",tt,[t("span",st,[n[5]||(n[5]=t("span",{class:"h-2 w-2 rounded-full bg-green-300"},null,-1)),h(" "+o(e(r)("home.business.legend.conversion")),1)]),t("span",nt,o(e(u)?.donutConversionPct??0)+"%",1)])])]),t("div",ot,[t("div",it,[t("span",at,[e(k)?(a(),v(e(B),{key:0,class:"inline h-4 w-4 animate-spin text-sky-600"})):(a(),l(f,{key:1},[h(o(e(u)?.totalViews??0),1)],64))]),t("span",rt,o(e(r)("home.business.kpi.totalViews")),1),m(e(E),{class:"h-4 w-4 shrink-0 text-gray-700"})]),t("div",lt,[t("span",dt,[e(k)?(a(),v(e(B),{key:0,class:"inline h-4 w-4 animate-spin text-sky-600"})):(a(),l(f,{key:1},[h(o(e(u)?.activeAdsCount??0),1)],64))]),t("span",ct,o(e(r)("home.business.kpi.activeAds")),1),m(e(Ae),{class:"h-4 w-4 shrink-0 text-gray-700"})]),t("div",ut,[t("span",pt,[e(k)?(a(),v(e(B),{key:0,class:"inline h-4 w-4 animate-spin text-sky-600"})):(a(),l(f,{key:1},[h(o(e(u)?.openTickets??0),1)],64))]),t("span",mt,o(e(r)("home.business.kpi.openTickets")),1),m(e(De),{class:"h-4 w-4 shrink-0 text-gray-700"})])])]),t("div",xt,[m(d,{audience:"business",variant:"compact"})])]),t("div",ht,[t("div",gt,[t("h3",ft,o(e(r)("home.business.trendTitle")),1),t("p",_t,o(e(Q)),1)]),t("div",bt,[e(p).pts.length?(a(),l("svg",{key:0,viewBox:`0 0 ${e(p).w} ${e(p).h}`,class:"h-32 w-full touch-none",role:"img","aria-label":e(r)("home.business.trendTitle")},[n[6]||(n[6]=t("defs",null,[t("linearGradient",{id:"bizChartFillMobile",x1:"0",x2:"0",y1:"0",y2:"1"},[t("stop",{offset:"0%","stop-color":"#60a5fa","stop-opacity":"0.35"}),t("stop",{offset:"100%","stop-color":"#60a5fa","stop-opacity":"0.02"})])],-1)),t("polyline",{fill:"none",stroke:"#e5e7eb","stroke-width":"1",points:`8,${e(p).h-10} ${e(p).w-8},${e(p).h-10}`},null,8,vt),e(p).fillPolygon?(a(),l("polygon",{key:0,fill:"url(#bizChartFillMobile)",points:e(p).fillPolygon},null,8,wt)):x("",!0),t("polyline",{fill:"none",stroke:"#3b82f6","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round",points:e(p).pts.join(" ")},null,8,kt),t("g",null,[(a(!0),l(f,null,P(e(p).pts,(i,y)=>(a(),l("circle",{key:y,cx:i.split(",")[0],cy:i.split(",")[1],r:"4",fill:"white",stroke:"#3b82f6","stroke-width":"2",class:"cursor-pointer",onMouseenter:g=>F.value=y,onMouseleave:n[1]||(n[1]=g=>F.value=null),onClick:g=>F.value=y},null,40,Ct))),128))])],8,yt)):x("",!0),e(j)?(a(),l("div",Ft,[t("div",Pt,o(e(j).v),
11),t("div",St,o(C(e(j).d)),1)])):x("",!0),!e(p).pts.length&&!e(k)?(a(),l("div",At,o(e(r)("home.business.noChartData")),1)):x("",!0)]),e(p).labels.length?(a(),l("div",Dt,[(a(!0),l(f,null,P(e(Z),i=>(a(),l("span",{key:i.i},o(i.text),1))),128))])):x("",!0),t("div",$t,[e(p).labels.length?(a(),l("div",jt,o(C(e(p).labels[e(p).labels.length-1]))+" : "+o(e(u)?.viewsSeries?.[e(u).viewsSeries.length-1]?.value??0),1)):x("",!0),t("div",null,o(e(r)("home.business.maxValue"))+": "+o(e(u)?.viewsSeries?.length?Math.max(0,...e(u).viewsSeries.map(i=>i.value)):0),1),t("div",null,o(e(r)("home.business.leadsConversion",{leads:e(u)?.leadsTotal??0,rate:e(u)?.conversionRatePct??0})),1)])]),t("div",Bt,[(a(!0),l(f,null,P(e(U),(i,y)=>(a(),l(f,{key:y},[i.action==="featured-dialog"?(a(),l("button",{key:0,type:"button",class:"flex min-h-[76px] flex-col items-center justify-center gap-1 rounded-xl border border-gray-200 bg-white px-1 py-2 text-center shadow-sm",onClick:g=>e(T)(g,i)},[(a(),v(V(i.icon),{class:"h-6 w-6 text-gray-700","aria-hidden":"true"})),t("span",Mt,o(i.label),1)],8,Tt)):(a(),v(c,{key:1,to:i.to,class:"flex min-h-[76px] flex-col items-center justify-center gap-1 rounded-xl border border-gray-200 bg-white px-1 py-2 text-center shadow-sm",onClick:g=>e(T)(g,i)},{default:S(()=>[(a(),v(V(i.icon),{class:"h-6 w-6 text-gray-700","aria-hidden":"true"})),t("span",Lt,o(i.label),1)]),_:2},1032,["to","onClick"]))],64))),128))]),t("section",Nt,[t("div",Vt,[m(c,{to:e(A)("/my-ads"),class:"rounded-lg px-0.5 py-1 text-base font-bold text-[#1A202C] active:bg-gray-50"},{default:S(()=>[h(o(e(r)("home.business.latestAds")),1)]),_:1},8,["to"]),m(c,{to:e(A)("/my-ads"),class:"inline-flex items-center gap-1 rounded-lg px-1 py-1.5 text-[13px] font-semibold text-[#1A202C]"},{default:S(()=>[t("span",null,o(e(r)("common.seeAll")),1),m(e($e),{class:"h-[22px] w-[22px] shrink-0","aria-hidden":"true"})]),_:1},8,["to"])]),e(u)?.latestAds?.length?(a(),l("div",Ht,[t("div",It,[(a(!0),l(f,null,P(e(u).latestAds,i=>(a(),v(c,{key:String(i.id),to:Y(i),class:"flex w-[clamp(130px,calc((100vw-40px)/2.5),170px)] shrink-0 flex-col overflow-hidden rounded-xl border border-gray-200 bg-white shadow-md"},{default:S(()=>[t("div",Gt,[L(i.image)?(a(),l("img",{key:0,src:L(i.image),alt:"",class:"h-full w-full object-cover"},null,8,zt)):x("",!0)]),t("div",qt,[t("div",Ut,o(ie(i)),1),i.location?(a(),l("div",Xt,[m(e(je),{class:"h-3 w-3 shrink-0 opacity-80","aria-hidden":"true","stroke-width":"2"}),t("span",Kt,o(i.location),1)])):x("",!0),t("div",Ot,[t("span",Qt,o(ne(i.status??"")),1),t("span",Wt,[m(e(E),{class:"h-3 w-3 shrink-0 opacity-80","aria-hidden":"true","stroke-width":"2"}),h(" "+o(se(i.views_count)),1)])])])]),_:2},1032,["to"]))),128))])])):(a(),l("div",Rt,[t("p",Et,o(e(r)("home.business.emptyAds")),1)]))]),m(b,{open:e($),"onUpdate:open":n[2]||(n[2]=i=>ve($)?$.value=i:null)},null,8,["open"])])}}});export{Bs 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.