PageSourceSearch

https://marketize.biz/_nuxt/BBwqRG7H.js

js marketize.biz collected 2026-10-02 00:28:40 UTC 12,236 bytes, 1 lines download raw bytes

1import{_ as xe,a as he,m as we,A as ke}from"./CYrnlpoz.js";import{_ as Se,a as Ce,b as Pe}from"./CpOO9XDW.js";import{_ as De}from"./BXr6lbg6.js";import{_ as Te}from"./CjaUwb4J.js";import{l as Ve,G as Ae,a1 as Ee,m as Ue,s as A,o as Re,$ as Q,O as Be,aq as Le,k as ze,u as t,c as u,d as Fe,J as E,U as F,a as s,e as g,F as j,g as X,t as y,i as b,h as $,P as U,K as je,f as Z,A as $e,r as l,y as Me,R as Ne,b as d,j as M}from"./B27EFU-J.js";import{u as Oe}from"./BJ3l38cg.js";import{u as qe}from"./Czha0XdH.js";import{A as Ge}from"./F3FE1duN.js";import"./x5jxXiIz.js";import"./DhyOElFd.js";import"./De8aetVT.js";import"./BJ5gao2u.js";import"./CKvQIMSw.js";import"./JRhLYjp3.js";import"./DlAUqK2U.js";import"./DxAVfdwP.js";import"./OkQ_Mtf2.js";import"./CLPvPQO4.js";import"./COrX18TV.js";import"./CPoY0LKQ.js";import"./BTzF9C5N.js";import"./D5mlmW7I.js";import"./Dy4OL4CS.js";import"./Bvm_ey-5.js";import"./DRL6Jpr1.js";import"./CIf0AwPq.js";import"./xjtS4iZV.js";import"./Da_OUvnV.js";import"./DUBf56xq.js";const He={key:0,class:"h-full flex items-center justify-center"},Ie={class:"h-full relative"},Je={class:"h-full flex flex-col"},Ke={class:"max-w-4xl w-full mx-auto px-4 pt-5 pb-4"},We={class:"border border-gray-200 rounded-xl overflow-hidden"},Ye={class:"sticky top-0 z-10 bg-white"},Qe={class:"space-y-5 p-4 sm:p-6"},Xe={id:"field-category"},Ze={class:"grid grid-cols-2 sm:grid-cols-4 gap-4"},et=["onClick"],tt={class:"self-start"},st=["src","alt"],ot={class:"text-sm font-medium text-gray-900"},rt={key:0,class:"text-xs text-red-500 mt-2"},at={class:"border-b border-t border-gray-100 pb-4 pt-4"},it={class:"grid grid-cols-1 md:grid-cols-3 gap-4"},lt={id:"field-title"},nt={class:"flex items-center justify-between mt-1"},ct={key:0,class:"text-xs text-red-500"},dt={class:"text-xs text-gray-400"},ut={id:"field-description"},pt={key:0,class:"text-xs text-red-500 mt-1"},vt={id:"field-artworks",class:"border-t border-gray-100 pt-4"},mt={class:"mt-4"},ft={key:0,class:"text-xs text-red-500 mt-2"},gt={key:0},bt={key:1},yt={class:"flex-shrink-0 bg-white py-3"},_t={class:"max-w-3xl w-full mx-auto px-4 flex items-center justify-between"},xt=["disabled"],ht={key:0,class:"h-4 w-4 animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},ee="Your changes will not be saved. Are you sure you want to leave?",Zt={__name:"edit",setup(wt){const{$toast:k}=Ve(),N=Oe(),te=Ae(),se=qe(),O=Ee(),q=Ue().params.slug,G=l(!0),R=l(!1),n=l(0),H=l(null);A(n,()=>{H.value?.scrollTo({top:0})});const B=l([]),L=l([]),D=l([]),I=l([]),v=l(""),f=l(""),_=l(""),x=l(1),m=l([]),S=l(null),T=l(!1),J=l(!0),oe=M(()=>S.value?.previews??[]),h=l({basic:{enabled:!1,type:1},standard:{enabled:!1,type:2},premium:{enabled:!1,type:3}}),z=l(null),V=[{title:"Location",subtitle:"Service areas"},{title:"Details",subtitle:"Select service type"},{title:"Pricing",subtitle:"Package information"},{title:"Confirmation",subtitle:"Overview"}],re=[{id:1,title:"Print",description:"Professional printing services for marketing materials"},{id:2,title:"Distribute",description:"Targeted distribution to reach ideal customers"},{id:3,title:"Print & Distribute",description:"Complete solution combining printing and distribution"}],ae=["print_quality","paper_size","paper_weight","color","distribute_type","validation","letter_box","distribution_hours","distribution_amount","duration"],r=Ne({category:"",title:"",description:"",artworks:""}),ie={1:"basic",2:"standard",3:"premium"},C=M(()=>n.value===V.length-1),le=M(()=>D.value),ne=a=>{D.value=a},ce=()=>D.value.map(we).filter(Boolean),de=()=>{n.value>0&&n.value--},ue=["category","title","description","artworks"],K=async()=>{await Me();const a=ue.find(c=>r[c]);if(!a)return;const e=document.getElementById(`field-${a}`);e?.scrollIntoView({behavior:"smooth",block:"center"}),e?.querySelector("input, textarea")?.focus({preventScroll:!0})},W=()=>{if(!T.value){if(n.value===0&&(L.value=ce()),n.value===1&&!ve()){K();return}if(n.value===2&&!z.value?.validate()){z.value?.scrollToFirstError();return}n.value<V.length-1&&n.value++}},pe=a=>(a||"").replace(/<[^>]*>/g,"").trim(),ve=()=>{r.category=_.value?"":"Please select a service category.",r.title=v.value.trim()?"":"Title is required.",r.description=pe(f.value)?"":"Service description is required.";const a=m.value.length||S.value?.fileCount||0;return r.artworks=a?"":"Please upload at least one cover image.",!Object.values(r).some(Boolean)};A(v,()=>{r.title=""}),A(f,()=>{r.description=""}),A(m,()=>{r.artworks=""},{deep:!0});const w=l(!1),me=async()=>
1{if(!S.value)return!0;T.value=!0;try{return await S.value.uploadAll()?m.value.length?!0:(r.artworks="Please upload at least one cover image.",!1):(k.show({title:"Upload failed",message:"Some cover images could not be uploaded. Please try again.",variant:"error"}),!1)}finally{T.value=!1}},fe=async()=>{if(!w.value){w.value=!0;try{if(!await me()){n.value=1,K();return}const a=Object.values(h.value).filter(c=>c.enabled).map(c=>{const{enabled:P,...i}=c;return ae.forEach(p=>{i[p]!==void 0&&i[p]!==""&&(i[p]=parseInt(i[p]))}),i.distribute_type===5?delete i.letter_box:(delete i.distribution_hours,(i.letter_box===""||i.letter_box===void 0||i.letter_box===null)&&delete i.letter_box),i}),e={slug:q,title:v.value,category:_.value,type:x.value,description:f.value,keywords:[],images:m.value.map(c=>c.id),is_active:J.value,packages:a,coverages:L.value};await N.updateService(e),R.value=!0,k.show({title:"Success",message:"Service updated successfully.",variant:"success"}),O.push("/dashboard/services")}catch(a){const e=a.response?._data;e&&typeof e=="object"?Object.values(e).flat().forEach(c=>{k.show({title:"Error",message:c,variant:"error"})}):k.show({title:"Error",message:"Failed to update service.",variant:"error"})}finally{w.value=!1}}},Y=a=>{R.value||(a.preventDefault(),a.returnValue=ee)};return Re(async()=>{if(window.addEventListener("beforeunload",Y),te.userRole==="client"){Q("/dashboard");return}try{const[a,e]=await Promise.all([se.fetchCatagories(),N.fetchMyServiceDetails(q)]);B.value=a.results,v.value=e.title||"",f.value=e.description||"",_.value=e.category?.id||"",x.value=e.type||1,J.value=e.is_active!==!1;const c=e.coverages||[];L.value=c,D.value=c,I.value=c,m.value=[...e.images||[]].sort((i,p)=>(i.order_no??0)-(p.order_no??0));const P={basic:{enabled:!1,type:1},standard:{enabled:!1,type:2},premium:{enabled:!1,type:3}};for(const i of e.packages||[]){const p=ie[i.type];p&&(P[p]={...i,enabled:!0})}h.value=P}catch{k.show({title:"Error",message:"Failed to load service.",variant:"error"}),O.push("/dashboard/services")}finally{G.value=!1}}),Be(()=>window.removeEventListener("beforeunload",Y)),Le(()=>{if(!R.value)return window.confirm(ee)}),ze({title:"Edit Service"}),(a,e)=>{const c=xe,P=he,i=Pe,p=De,ge=Te,be=Se,ye=Ce;return t(G)?(d(),u("div",He,[...e[6]||(e[6]=[Fe('<div class="flex flex-col items-center gap-4 text-gray-500"><svg class="h-8 w-8 animate-spin text-red-500" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg><span class="text-sm">Loading service…</span></div>',1)])])):(d(),u(j,{key:1},[E(s("div",Ie,[g(c,{"initial-center":[51.47,-2.5879],"initial-zoom":12,steps:V,"current-step":t(n),"show-filters":!1,hoverInfo:!1,"preselected-areas":t(I),title:"Edit Service",onAreaChange:ne,onCancel:e[0]||(e[0]=o=>("navigateTo"in a?a.navigateTo:t(Q))("/dashboard/services")),onContinue:W},null,8,["current-step","preselected-areas"])],512),[[F,t(n)===0]]),E(s("div",Je,[s("div",{ref_key:"stepContentRef",ref:H,class:"flex-1 overflow-y-auto"},[s("div",Ke,[s("div",We,[s("div",Ye,[g(P,{title:"Edit Service",steps:V,"current-step":t(n)},null,8,["current-step"])]),e[13]||(e[13]=s("div",{class:"border-t border-gray-200"},null,-1)),s("div",null,[E(s("div",null,[s("div",Qe,[s("div",Xe,[e[7]||(e[7]=s("h2",{class:"block text-sm font-medium text-gray-900 mb-1"}," Service Category ",-1)),e[8]||(e[8]=s("p",{class:"text-sm text-gray-500 mb-2"}," Select which service you want to offer ",-1)),s("div",Ze,[(d(!0),u(j,null,X(t(B),o=>(d(),u("button",{key:o.id,onClick:_e=>{_.value=o.id,t(r).category=""},class:$(["flex flex-col items-start gap-3 p-5 rounded-xl border transition-all cursor-pointer text-left",t(_)===o.id?"border-red-500 bg-red-50/30":"border-gray-100 hover:border-gray-200 bg-white"])},[s("div",tt,[s("img",{src:o.cover_photo||"/images/SVG.svg",alt:o.title,class:"w-10 h-10 rounded-xl"},null,8,st)]),s("span",ot,y(o.title),1)],10,et))),128))]),t(r).category?(d(),u("p",rt,y(t(r).category),1)):b("",!0)]),s("div",at,[e[9]||(e[9]=s("label",{class:"block text-sm font-medium text-gray-900 mb-4"},"Service Type",-1)),s("div",it,[(d(),u(j,null,X(re,o=>
1g(i,{key:o.id,title:o.title,description:o.description,"is-selected":t(x)===o.id,onSelect:_e=>x.value=o.id},null,8,["title","description","is-selected","onSelect"])),64))])]),s("div",lt,[e[10]||(e[10]=s("label",{class:"block text-sm font-medium text-gray-900 mb-2"},"Title",-1)),E(s("input",{"onUpdate:modelValue":e[1]||(e[1]=o=>U(v)?v.value=o:null),type:"text",placeholder:"Write an engaging title that encapsulates your service",maxlength:"120",class:$(["w-full px-4 py-3 border rounded-xl focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-transparent",t(r).title?"border-red-500":"border-gray-200"])},null,2),[[je,t(v)]]),s("div",nt,[t(r).title?(d(),u("p",ct,y(t(r).title),1)):b("",!0),s("p",dt,y(t(v).length)+"/120 characters ",1)])]),s("div",ut,[e[11]||(e[11]=s("label",{class:"block text-sm font-medium text-gray-900 mb-2"},"Service Description",-1)),g(p,{modelValue:t(f),"onUpdate:modelValue":e[2]||(e[2]=o=>U(f)?f.value=o:null),placeholder:"Write service details, its main draws and advantages",class:$(t(r).description?"ring-1 ring-red-500 rounded-xl":"")},null,8,["modelValue","class"]),t(r).description?(d(),u("p",pt,y(t(r).description),1)):b("",!0)]),s("div",vt,[e[12]||(e[12]=s("label",{class:"block text-sm font-medium text-gray-900 mb-2"},"Upload Cover Images",-1)),s("div",mt,[g(ge,{ref_key:"artworkUploadRef",ref:S,modelValue:t(m),"onUpdate:modelValue":e[3]||(e[3]=o=>U(m)?m.value=o:null),label:"",maxSize:"10 * 1024 * 1024",accept:"image/jpeg, image/png, image/jpg",hint:"PNG, JPG, JPEG up to 10 MB",endpoint:"/api/v1/common/public/medias/bulk-create/","defer-upload":""},null,8,["modelValue"])]),t(r).artworks?(d(),u("p",ft,y(t(r).artworks),1)):b("",!0)])])],512),[[F,t(n)===1]]),t(n)===2?(d(),u("div",gt,[g(be,{ref_key:"pricingPackagesRef",ref:z,modelValue:t(h),"onUpdate:modelValue":e[4]||(e[4]=o=>
1U(h)?h.value=o:null),serviceType:t(x)},null,8,["modelValue","serviceType"])])):b("",!0),t(n)===3?(d(),u("div",bt,[g(ye,{title:t(v),description:t(f),"category-id":t(_),categories:t(B),artworks:t(m),previews:t(oe),"service-type":t(x),packages:t(h),location:t(le)},null,8,["title","description","category-id","categories","artworks","previews","service-type","packages","location"])])):b("",!0)])])])],512),s("div",yt,[s("div",_t,[s("button",{class:"flex items-center gap-2 px-5 py-2.5 text-sm font-medium rounded-full border border-gray-200 text-gray-700 hover:bg-gray-50 transition-colors cursor-pointer",onClick:de},[g(t(Ge),{size:16}),e[14]||(e[14]=Z(" Previous ",-1))]),s("button",{class:"flex items-center gap-2 px-5 py-2.5 text-sm font-medium rounded-full bg-red-500 text-white hover:bg-red-600 transition-colors button-text cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",disabled:t(C)&&t(w),onClick:e[5]||(e[5]=o=>t(C)?fe():W())},[t(C)&&t(w)?(d(),u("svg",ht,[...e[15]||(e[15]=[s("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),s("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)])])):b("",!0),Z(" "+y(t(C)?t(w)?t(T)?"Uploading images…":"Saving…":"Save Changes":"Continue")+" ",1),t(C)?b("",!0):(d(),$e(t(ke),{key:1,size:16}))],8,xt)])])],512),[[F,t(n)!==0]])],64))}}};export{Zt 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.