import{d as R,c as f,r as z,b as U,a5 as o,e as i,f as s,g as u,$ as k,t as v,p as r,aq as Z,C as E,a3 as K,F as V,A as Q,Z as W,E as g,m as X,ar as A,B as Y,a7 as ee}from"./CQ5rtXCu.js";import{S as te,a as oe}from"./CdB5IfUT.js";import{A as ae}from"./DSPQClUN.js";import{A as le}from"./pYNsn7iZ.js";import{u as ie}from"./DDWwRoXA.js";import{u as ne}from"./DPbk-n-_.js";import{_ as se}from"./2y1ch4eJ.js";import{m as re}from"./DBCQJO2L.js";import"./CvGTXoDv.js";import"./BfCosJFp.js";const ue={class:"mx-auto w-[95%] max-w-[1400px] px-[15px] max-[600px]:w-full"},ce={key:0,class:"mb-[30px] text-center leading-[30px]"},pe={class:"border-[5px] border-white shadow-[0_0_5px_#ccc] transition-[border-color] duration-[400ms] hover:border-b-[var(--theme-primary-color,#d2070a)]"},fe=["aria-label","onClick"],me=["src","alt"],de={key:1,class:"py-[10px] text-center text-[14px] leading-[26px] text-[#777]"},xe=["title","onClick"],be={key:2,class:"mt-[30px] h-[50px] text-center"},ve=["href","title","tabindex"],ge=["aria-label"],he={key:0,class:"pointer-events-none flex h-full w-full items-center justify-center px-[50px] py-[60px] max-[600px]:px-[15px]"},ye={class:"pointer-events-auto max-h-full max-w-full"},we=["src","alt"],ke={key:0,class:"mt-[10px] text-center text-[16px]"},_e=["aria-label"],Ce=["aria-label"],Oe=R({__name:"Mb76InstallationGalleryLayout",props:{content:{default:()=>[]},editable:{type:Boolean,default:!1},generatorPreview:{type:Boolean,default:!1},activeKey:{default:null},onContentClick:{},textStyle:{},className:{},footerData:{}},emits:["handle-item-click","on-page-change"],setup(_,{emit:L}){const m=_,B=L,{pick:F,text:n,href:T,bind:h,select:C,resolveTextStyle:q}=ie(m,{title:{value:"设备安装"},title01:{value:"为社会承担责任 为客户创造价值"},button:{value:"查看更多"}}),I=[["139","设备安装中","83958de3f7380952034ff7dca9af3315.jpg"],["138","设备安装中","01e1bd28c4f1c30267dfb707d71ef227.jpg"],["137","设备安装中","e47bc40ba987a43ff24359f3b5800e5c.jpg"],["135","设备生产中","e52febb81333fe486bbb5c60f7035931.jpg"],["136","设备生产中","660a2e30f180bddc79b2e2895ad62c7b.jpg"],["134","设备运输中","c17f89e18e68db64033e70a995fc11b5.jpg"]].map(([t,e,a])=>({id:t,name:e,images:re[a]})),S=f(()=>F("list"));function G(t){if(Array.isArray(t))return String(t.find(Boolean)??"").trim();if(typeof t!="string")return"";try{const e=JSON.parse(t);if(Array.isArray(e))return String(e.find(Boolean)??"").trim()}catch{}return t.split(";").map(e=>e.trim()).find(Boolean)??""}const c=f(()=>{const t=S.value,e=t?Number(t.dataSource)===3?t.customData?.data:t.data:m.generatorPreview?I:[],a=Array.isArray(e)?e.filter(l=>l&&typeof l=="object"):[];return(a.length?a:m.generatorPreview?I:[]).map((l,O)=>({key:String(l.id??O),title:String(l.nameDisplay??l.name_display??l.name??l.title??"").trim(),image:G(l.images),raw:l,alt:String(l.nameDisplay||l.name_display||l.name||l.title||t?.name||n("title")||O+1)})).filter(l=>l.title||l.image)}),d=ne(S,t=>B("on-page-change",t)),N=f(()=>T("button")||(m.generatorPreview?"http://mb76.template.0537ys.com/case.html":void 0)),D=f(()=>{const t=m.footerData?.componentConfig;return(Array.isArray(t)?t[0]:t)||{}}),x=z(),b=z(-1),p=f(()=>c.value[b.value]),$=f(()=>c.value.flatMap((t,e)=>t.image?[e]:[]));let y;async function H(t,e){C("list",e)||(b.value=t,await ee(),!(!x.value||x.value.open)&&(y=document.body.style.overflow,document.body.style.overflow="hidden",x.value.showModal()))}function P(){y!==void 0&&(document.body.style.overflow=y),y=void 0}function j(){x.value?.close(),b.value=-1,P()}function w(t){const e=$.value,a=e.indexOf(b.value);e.length&&(b.value=e[(a+t+e.length)%e.length]??-1)}function J(t,e){e.stopPropagation(),C("list",e)||B("handle-item-click",t)}return U(P),(t,e)=>o(n)("title")||o(n)("title01")||c.value.length||o(n)("button")?(i(),s("section",{key:0,class:Y(["bg-[#f6f6f6] py-[50px] max-[765px]:py-[30px]",_.className])},[u("div",ue,[o(n)("title")||o(n)("title01")?(i(),s("div",ce,[o(n)("title")?(i(),s("h2",k({key:0},o(h)("title"),{class:"relative inline-block text-[24px] font-bold text-[#333] before:absolute before:top-1/2 before:right-[-40px] before:h-[3px] before:w-[30px] before:bg-[var(--theme-primary-color,#d2070a)] after:absolute after:top-1/2 after:left-[-40px] after:h-[3px] after:w-[30px] after:bg-[var(--theme-primary-color,#d2070a)]"}),v(o(n)("title")),17)):r("",!0),o(n)("title01")?(i(),s("p",k({key:1},o(h)("title01"),{class:"text-[16px] text-[#666]"}),v(o(n)("title01")),17)):r("",!0)])):r("",!0),c.value.length?(i(),s("div",Z(k({key:1},o(h)("list"))),[E(o(oe),{class:"swiper-ssr min-[769px]:[--spv:4] min-[769px]:[--gap:20px]",modules:[o(ae),o(le)],"slides-per-view":1,"space-between":0,breakpoints:{769:{slidesPerView:4,spaceBetween:20}},"allow-touch-move":!_.editable,"watch-overflow":!0,loop:c.value.length>1,autoplay:c.value.length>1?{delay:3e3,disableOnInteraction:!1,pauseOnMouseEnter:!0}:!1},{default:K(()=>[(i(!0),s(V,null,Q(c.value,(a,M)=>(i(),W(o(te),{key:a.key,class:"p-[5px]"},{default:K(()=>[u("article",pe,[a.image?(i(),s("button",{key:0,type:"button","aria-label":a.alt,class:"block w-full cursor-pointer overflow-hidden focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-[var(--theme-primary-color,#d2070a)]",onClick:g(l=>H(M,l),["stop"])},[u("img",{src:a.image,alt:a.alt,width:"800",height:"453",loading:"lazy",class:"h-auto w-full object-contain"},null,8,me)],8,fe)):r("",!0),a.title?(i(),s("div",de,[u("button",{type:"button",title:a.title,style:X(o(q)(S.value)),class:"block w-full cursor-pointer overflow-hidden text-[16px] text-ellipsis whitespace-pre text-[#333] focus-visible:outline-2 focus-visible:outline-[var(--theme-primary-color,#d2070a)]",onClick:l=>J(a.raw,l)},v(a.title),13,xe)])):r("",!0)])]),_:2},1024))),128))]),_:1},8,["modules","allow-touch-move","loop","autoplay"])],16)):r("",!0),E(se,{show:o(d).showPagination.value,"current-page":o(d).currentPage.value,"total-pages":o(d).totalPages.value,"visible-pages":o(d).visiblePages.value,"class-name":"mt-[30px] flex justify-center",onPageClick:o(d).handlePageClick},null,8,["show","current-page","total-pages","visible-pages","onPageClick"]),o(n)("button")?(i(),s("div",be,[u("a",k(o(h)("button"),{href:N.value,title:o(n)("button"),tabindex:N.value?void 0:0,class:"relative top-[20px] inline-block rounded-[5px] bg-[var(--theme-primary-color,#d2070a)] px-[50px] text-[14px] leading-[40px] text-[var(--theme-primary-contrast,#fff)] shadow-[0_0_20px_#dca2a2] transition-[top] duration-[400ms] hover:top-[10px] focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-[var(--theme-primary-color,#d2070a)] max-[765px]:top-0 max-[765px]:hover:top-[-10px]",onKeydown:e[0]||(e[0]=A(a=>o(C)("button",a),["enter"]))}),v(o(n)("button")),17,ve)])):r("",!0)]),u("dialog",{ref_key:"dialog",ref:x,"aria-label":p.value?.alt,class:"fixed inset-0 m-0 h-full max-h-none w-full max-w-none border-0 bg-black/80 p-0 text-white backdrop:bg-transparent",onClick:g(j,["self"]),onCancel:g(j,["prevent"]),onClose:P,onKeydown:[e[3]||(e[3]=A(g(a=>w(-1),["prevent"]),["left"])),e[4]||(e[4]=A(g(a=>w(1),["prevent"]),["right"]))]},[p.value?(i(),s("div",he,[u("figure",ye,[(i(),s("img",{key:p.value.key,src:p.value.image,alt:p.value.alt,loading:"eager",class:"block max-h-[calc(100dvh-120px)] max-w-full object-contain"},null,8,we)),p.value.title?(i(),s("figcaption",ke,v(p.value.title),1)):r("",!0)])])):r("",!0),u("button",{type:"button","aria-label":"Escape",class:"absolute top-[10px] right-[10px] flex h-[40px] w-[40px] cursor-pointer items-center justify-center rounded bg-black/50 text-[34px] text-white/80 hover:text-white focus-visible:outline-2 focus-visible:outline-white",onClick:j},"×"),$.value.length>1?(i(),s(V,{key:1},[u("button",{type:"button","aria-label":String(D.value.previous_page||"←"),class:"absolute top-1/2 left-[2%] flex h-[60px] w-[44px] -translate-y-1/2 cursor-pointer items-center justify-center rounded bg-black/50 text-[40px] text-white/80 hover:text-white focus-visible:outline-2 focus-visible:outline-white",onClick:e[1]||(e[1]=a=>w(-1))},"‹",8,_e),u("button",{type:"button","aria-label":String(D.value.next_page||"→"),class:"absolute top-1/2 right-[2%] flex h-[60px] w-[44px] -translate-y-1/2 cursor-pointer items-center justify-center rounded bg-black/50 text-[40px] text-white/80 hover:text-white focus-visible:outline-2 focus-visible:outline-white",onClick:e[2]||(e[2]=a=>w(1))},"›",8,Ce)],64)):r("",!0)],40,ge)],2)):r("",!0)}});export{Oe as default};
