1import{N as X,O as Y,a7 as J,v as R,r as H,o as v,c as f,a as t,b as r,u as c,T as C,G as p,_ as K,M as Q,W as Z,C as ee,h as $,a8 as D,S as T,w as B,p as te,x as oe,z as w,$ as ae,t as N}from"./index-BfHiCeG7.js";import{a as F}from"./index-BdyL-Z9M.js";const le={class:"flex flex-col gap-6 p-1"},ne={class:"flex flex-col gap-2"},se={class:"flex flex-col gap-2"},ie={class:"flex flex-col gap-2"},re={class:"flex justify-end gap-2 mt-4"},de={__name:"ProjectAboutForm",setup(U){const S=X(),u=Y(),V=F(),l=J("dialogRef"),m=p(!1),b=p(!1),e=p({content:"",bgImage:null,logo:null}),d=p(!1);R(()=>{const a=l?.value?.data;a&&(e.value.content=a.content||"",e.value.bgImage=a.background||null,e.value.logo=a.logo||null)});const k=()=>l.value.close(),L=()=>{S.require({message:"Are you sure you want to save these changes?",header:"Confirmation",icon:"pi pi-exclamation-triangle",acceptClass:"p-button-primary",acceptLabel:"Yes, Save it",rejectLabel:"Cancel",accept:()=>{h()}})};async function h(){try{if(!e.value.content.trim()){u.add({severity:"warn",summary:"Validation Error",detail:"Content cannot be empty.",life:3e3});return}d.value=!0;const a=new FormData;a.append("content",e.value.content),m.value?a.append("bg_image_deleted","1"):e.value.bgImage instanceof File&&a.append("bg_image",e.value.bgImage),b.value?a.append("logo_deleted","1"):e.value.logo instanceof File&&a.append("logo",e.value.logo),await V.create_project_land_about(a),u.add({severity:"success",summary:"Success",detail:"Page details updated successfully",life:3e3}),setTimeout(()=>{l.value.close()},500)}catch{u.add({severity:"error",summary:"Error",detail:"Failed to update details",life:3e3})}finally{d.value=!1}}return(a,n)=>{const P=H("SingleImageUpload"),j=H("Editor");return v(),f("div",le,[t("div",ne,[r(P,{modelValue:e.value.bgImage,"onUpdate:modelValue":n[0]||(n[0]=s=>e.value.bgImage=s),label:"Background Image",chooseLabel:"Select Image",recommend:"1920x1080 (Max 5MB)",onRemoved:n[1]||(n[1]=s=>m.value=s)},null,8,["modelValue"])]),t("div",se,[r(P,{modelValue:e.value.logo,"onUpdate:modelValue":n[2]||(n[2]=s=>e.value.logo=s),label:"Logo",recommend:"512x512 (Max 5MB)",chooseLabel:"Select Logo",onRemoved:n[3]||(n[3]=s=>b.value=s)},null,8,["modelValue"])]),t("div",ie,[r(j,{modelValue:e.value.content,"onUpdate:modelValue":n[4]||(n[4]=s=>e.value.content=s),label:"Content"},null,8,["modelValue"])]),t("div",re,[r(c(C),{label:"Cancel",severity:"secondary",text:"",onClick:k,disabled:d.value},null,8,["disabled"]),r(c(C),{label:"Save Changes",onClick:L,class:"bg-blue-900",loading:d.value,disabled:d.value},null,8,["loading","disabled"])])])}}},ce={class:"min-h-screen font-sans bg-gray-50 w-screen absolute left-0 top-16 lg:top-24"},ue={class:"relative pb-10 overflow-hidden"},me={class:"relative w-full h-56 md:h-[350px] overflow-hidden shadow-sm bg-slate-200 group"},ve={class:"relative px-2 py-4 md:px-12 md:py-6"},pe={key:0,class:"absolute z-20 top-6 right-6"},ge={class:"flex flex-col items-center text-center"},fe={class:"w-56 md:w-[300px]"},be={key:1,class:"h-[600px] overflow-y-auto"},he={key:2},xe={class:"flex items-center justify-between pt-4 border-t border-slate-100"},_e={class:"flex flex-col"},ye={class:"text-[10px] font-bold text-slate-400 uppercase tracking-widest"},we={class:"flex items-center gap-3"},Ce={__name:"ProjectLandIndex",setup(U){const S=Q(),u=F(),V=Z(),l=p(1),m=p([]),b=p(null),e=p(!1),d=w(()=>u.projectLandAboutProfile?.data),k=w(()=>u.projectLandAboutProfile?.attachments?.background),L=w(()=>u.projectLandAboutProfile?.attachments?.logo),h=async()=>{await oe();const E=d.value?.content;if(!E){m.value=[];return}const o=document.createElement("div");o.className="rte-content",o.style.cssText=`visibility: hidden; position: absolute; left: -9999px; top: 0; width: ${b.value?.offsetWidth||800}px; line-height: 1.7; font-size: 1rem;`,document.body.appendChild(o);const I=document.createElement("div");I.innerHTML=E;const x=[];Array.from(I.children).forEach(g=>{(g.textContent.trim()||g.querySelector("img, iframe"))&&x.push(g)});const _=[];let i="";const M=450;for(let g=0;g<x.length;g++){const A=x[g],y=A.outerHTML;o.innerHTML=i+y;const q=o.offsetHeight,G=/^H[1-6]$/.test(A.tagName);o.innerHTML=i;const O=o.offsetHeight,W=M-O;if(G&&W<80&&i!==""){_.push(i),i=y;continue}q<=M?i+=y:i!==""?(_.push(i),i=y):(_.push(y),i="")}i&&_.push(i),m.value=_,document.body.removeChild(o)},a=w(()=>m.value.length||1),n=w(()=>m.value[l.value-1]||""),P=()=>{l.value<a.value&&l.value++},j=()=>{l.value>1&&l.value--},s=async()=>{e.value=!0,await u.fetch_project_land_about(),h(),e.value=!1};ee(()=>d.value,()=>{l.value=1,h()},{deep:!0}),R(()=>{s(),window.addEventListener("resize",h)});const z=()=>{V.open(de,{props:{header:"Edit Content",style:{width:"50vw"},modal:!0},data:{content:d.value?.content??"",background:k.value,logo:L.value},onClose:()=>{s(),l.value=1}})};return(E,o)=>{const I=H("EditorViewer");return v(),f("div",ce,[t("main",ue,[t("div",me,[e.value?T("",!0):(v(),$(c(D),{key:0,src:k.value?.url??"/media/background/about-default-bg.webp","image-class":"w-full h-56 md:h-[350px] object-cover transition-transform duration-1000 ease-out group-hover:scale-110"},null,8,["src"])),o[1]||(o[1]=t("div",{class:"absolute inset-0 bg-gradient-to-t from-black/70 via-trans
1parent to-transparent opacity-80"},null,-1))]),r(c(te),{class:"relative z-10 w-[92%] md:max-w-7xl mx-auto -mt-10 md:-mt-32 shadow-2xl !rounded-3xl border-none"},{content:B(()=>[t("div",ve,[c(S).hasAccess(["ADMINISTRATOR"])?(v(),f("div",pe,[r(c(C),{icon:"pi pi-ellipsis-v",severity:"secondary",rounded:"",variant:"text",onClick:z})])):T("",!0),t("div",ge,[t("div",fe,[e.value?T("",!0):(v(),$(c(D),{key:0,src:L.value?.url??"/media/logo/LIPAD-logo.png",alt:"Logo","image-class":"object-contain w-full h-auto"},null,8,["src"]))]),o[2]||(o[2]=t("div",{class:"w-12 h-1 my-3 bg-orange-500 md:w-24"},null,-1)),o[3]||(o[3]=t("p",{class:"text-sm font-bold tracking-[0.4em] text-blue-800 uppercase md:text-xl"},"Project Land",-1))]),m.value.length>0?(v(),f("div",be,[t("div",{class:"relative h-full",ref_key:"pageContainer",ref:b},[r(ae,{name:"page-flip",mode:"out-in"},{default:B(()=>[(v(),f("div",{key:l.value,class:"rte-content h-full"},[r(I,{modelValue:n.value,"onUpdate:modelValue":o[0]||(o[0]=x=>n.value=x)},null,8,["modelValue"])]))]),_:1})],512)])):(v(),f("div",he,[...o[4]||(o[4]=[t("div",{class:"flex flex-col items-center justify-center h-full min-h-[300px] text-center p-8 border-2 border-dashed border-slate-200 rounded-3xl bg-slate-50/50"},[t("i",{class:"text-5xl pi pi-file-off text-slate-300 mb-4"}),t("h3",{class:"text-xl font-bold text-slate-700"},"No Content Found")],-1)])])),t("div",xe,[t("div",_e,[t("div",ye," Page "+N(l.value)+" / "+N(a.value),1)]),t("div",we,[r(c(C),{icon:"pi pi-chevron-left",severity:"secondary",rounded:"",variant:"outlined",onClick:j,disabled:l.value===1},null,8,["disabled"]),r(c(C),{icon:"pi pi-chevron-right",severity:"secondary",rounded:"",variant:"outlined",onClick:P,disabled:l.value===a.value},null,8,["disabled"])])])])]),_:1})])])}}},Pe=K(Ce,[["__scopeId","data-v-6ed15215"]]);export{Pe 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.