import{r as t,h as s,H as l}from"./p-7a57366d.js";const i=class{constructor(s){t(this,s),this.loaded=!1,this.search="",this.searchHandler=t=>{this.search=t.target.value}}async componentWillLoad(){this.loaded=!0}render(){if(this.loaded&&this.collection&&this.collection.documents){let t=this.collection.documents.filter(({fields:t})=>-1!=t.title.toLowerCase().indexOf(this.search));return t=[...t,...t,...t],s(l,null,s("h1",null,"Featured Boats"),s("form",null,s("input",{type:"search",placeholder:"Search",value:this.search,onInput:this.searchHandler})),s("ul",null,t.map(({name:t,fields:l})=>s("li",{key:t},s("div",{style:{padding:"0.5rem"}},l.media&&s("img",{onClick:()=>{this.loaded=!1},onLoad:t=>t.target.style.opacity=1,style:{transition:"opacity 0.5s",opacity:"0",backgroundColor:l.media[0].info.colors?l.media[0].info.colors[0].color:"black",display:"block",width:"100%"},sizes:"100vw",src:`https://res.cloudinary.com/boaterbase/image/upload/c_scale,w_auto,dpr_auto,q_auto,fl_lossy,f_auto/c_limit,w_800/${l.media[0].info.public_id}`}),s("h3",null,l.title))))))}return s(l,null)}static get style(){return":host{all:initial;display:block;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}:focus{outline:none;-webkit-box-shadow:0 0 0 2px #4682b4;box-shadow:0 0 0 2px #4682b4}form{display:block;margin:1rem}input[type=search]{display:block;width:100%;border-radius:2rem;font-size:1rem;padding:.5rem 1rem;margin:0;border:none;background-color:#eee}h1{margin:1rem}ul{margin:1rem;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-bottom:50rem}li,ul{list-style-type:none;padding:0}li{margin:0;min-width:300px;width:calc(100%/3)}li img{display:block;width:100%;height:180px;-o-object-fit:cover;object-fit:cover;border-radius:.25rem;-webkit-box-shadow:0 0 1rem rgba(0,10,20,.25);box-shadow:0 0 1rem rgba(0,10,20,.25)}li h3{font-size:1rem}"}};export{i as bb_collection};