1import{h as _,e as b,u as e,M as Q,c as H,C as x,S as K,R as V,D as I}from"./index.web.BvDlogKR.js";import{d as X}from"./preact.CLum3pgv.js";function D({c:r,value:s,onPick:d,S:n}){var u;return e("div",{style:{marginBottom:"16px"},children:[e("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"6px"},children:[e("span",{style:{fontSize:"13px",fontWeight:"500"},children:r.label}),e("span",{style:{fontSize:"15px",fontWeight:"700",color:n.accent},children:s||"â"})]}),s>0&&((u=I[r.key])==null?void 0:u[s])&&e("div",{style:{fontSize:"11px",color:n.muted,fontStyle:"italic",marginBottom:"6px"},children:I[r.key][s]}),e("div",{style:{display:"flex",gap:"4px"},children:[1,2,3,4,5,6,7,8,9].map(p=>e("button",{onClick:()=>d(p),style:{flex:1,padding:"8px 0",background:s===p?n.accent:n.dark,color:s===p?"#fff":n.muted,border:`1px solid ${s===p?n.accent:n.border}`,borderRadius:"4px",fontSize:"13px",fontWeight:"600",cursor:"pointer"},children:p},p))})]})}function ee(){var z,O;const{S:r,sBtn:s,sInput:d,sLabel:n,view:u,setView:p,setDirty:L,dirty:N,currentReview:i,setCurrentReview:W,update:a,updateScore:v,toggleChip:S,saveCurrentReview:A,handlePhoto:k,removePhoto:F,addFriend:C,removeFriend:$,updateFriendScore:P,friendName:f,setFriendName:q,friendsList:w,addTimestampedNote:M,fileInputRef:R,galleryInputRef:B,trips:E,reviews:U}=_(),j=(()=>{const t=new Map;for(const l of U||[]){const o=((l==null?void 0:l.restaurant)||"").trim();if(!o)continue;const c=o.toLowerCase();t.has(c)||t.set(c,o)}return[...t.values()].sort((l,o)=>l.localeCompare(o))})(),[G,m]=X(!1),T=(()=>{const t=(i.restaurant||"").trim().toLowerCase();if(!t)return[];const l=j.filter(o=>o.toLowerCase().includes(t));return l.length===1&&l[0].toLowerCase()===t?[]:(l.sort((o,c)=>{const g=o.toLowerCase().startsWith(t)?0:1,h=c.toLowerCase().startsWith(t)?0:1;return g-h||o.localeCompare(c)}),l.slice(0,6))})(),y=b(i.scores);return e("div",{className:"bbq-container-form",children:[e("button",{onClick:()=>{N&&!window.confirm("You have unsaved changes. Leave anyway?")||(p("home"),W(null),L(!1))},style:{background:"none",border:"none",color:r.accent,fontSize:"14px",cursor:"pointer",marginBottom:"12px"},children:"Back"}),e("h2",{style:{fontFamily:"'Oswald', sans-serif",fontSize:"20px",letterSpacing:"2px",marginBottom:"16px"},children:u==="new"?"New Review":"Edit Review"}),e("div",{style:{marginBottom:"20px"},children:[e("div",{className:"bbq-form-fields",children:[e("div",{style:{marginBottom:"10px",position:"relative"},children:[e("label",{style:n(),children:"RESTAURANT"}),e("input",{type:"text",value:i.restaurant,onChange:t=>{a("restaurant",t.target.value),m(!0)},onFocus:()=>m(!0),onBlur:()=>setTimeout(()=>m(!1),150),autoComplete:"off",placeholder:"Name",style:d()}),G&&T.length>0&&e("div",{style:{position:"absolute",top:"100%",left:0,right:0,zIndex:30,marginTop:"2px",background:r.card,border:`1px solid ${r.border}`,borderRadius:"6px",overflow:"hidden",boxShadow:"0 6px 16px rgba(0,0,0,0.35)"},children:T.map((t,l)=>e("div",{onMouseDown:o=>{o.preventDefault(),a("restaurant",t),m(!1)},style:{padding:"10px 12px",fontSize:"14px",color:r.text,cursor:"pointer",borderTop:l===0?"none":`1px solid ${r.border}`},children:t},t))})]}),e("div",{style:{marginBottom:"10px"},children:[e("label",{style:n(),children:"DATE"}),e("input",{type:"date",value:i.date,onChange:t=>a("date",t.target.value),style:d()})]}),e("div",{style:{marginBottom:"10px"},children:[e("label",{style:n(),children:"LOCATION"}),e("input",{type:"text",value:i.location,onChange:t=>a("location",t.target.value),placeholder:"City, State",style:d()})]}),e("div",{style:{marginBottom:"10px"},children:[e("label",{style:n(),children:"TRIP"}),e("input",{type:"text",value:i.trip||"",onChange:t=>a("trip",t.target.value),placeholder:"e.g. San Antonio 2026",style:d(),list:"trip-suggestions"}),E.length>0&&e("datalist",{id:"trip-suggestions",children:E.map(t=>e("option",{value:t},t))})]}),e("div",{style:{display:"flex",gap:"8px",marginBottom:"10px"},children:[e("div",{style:{flex:2},children:[e("label",{style:n(),children:"PRICE ($)"}),e("input",{type:"number",inputMode:"decimal",value:i.price||"",onChange:t=>a("price",t.target.value),placeholder:"Total",style:d()})]}),e("div",{style:{flex:1},children:[e("label",{style:n(),children:"SPLIT"}),e("div",{style:{display:"flex",alignItems:"center"},children:[e("button",{onClick:()=>
1a("priceSplit",String(Math.max(1,Number(i.priceSplit||1)-1))),style:{width:"40px",height:"42px",background:r.dark,border:`1px solid ${r.border}`,borderRadius:"6px 0 0 6px",color:r.text,fontSize:"20px",fontWeight:"700",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:"-"}),e("div",{style:{height:"42px",minWidth:"36px",padding:"0 8px",background:r.card,border:`1px solid ${r.border}`,borderLeft:"none",borderRight:"none",color:r.text,fontSize:"16px",fontWeight:"600",display:"flex",alignItems:"center",justifyContent:"center"},children:i.priceSplit||"1"}),e("button",{onClick:()=>a("priceSplit",String(Number(i.priceSplit||1)+1)),style:{width:"40px",height:"42px",background:r.dark,border:`1px solid ${r.border}`,borderRadius:"0 6px 6px 0",color:r.text,fontSize:"20px",fontWeight:"700",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:"+"})]})]}),i.price>0&&i.priceSplit>1&&e("div",{style:{flex:1,display:"flex",alignItems:"flex-end",paddingBottom:"10px"},children:e("span",{style:{fontSize:"13px",color:r.accent,fontWeight:"600"},children:["$",(Number(i.price)/Number(i.priceSplit)).toFixed(2),"/ea"]})})]})]}),e("div",{style:{marginBottom:"10px"},children:[e("label",{style:n(),children:["PHOTOS (",(i.photos||[]).length,"/3)"]}),(i.photos||[]).length>0&&e("div",{style:{display:"flex",gap:"8px",overflowX:"auto",marginBottom:"8px",padding:"4px 0"},children:(i.photos||[]).map((t,l)=>e("div",{style:{position:"relative",flexShrink:0},children:[e("img",{src:t,alt:`Photo ${l+1}`,style:{width:"100px",height:"100px",borderRadius:"6px",objectFit:"cover"}}),e("button",{onClick:()=>F(l),style:{position:"absolute",top:"4px",right:"4px",background:"rgba(0,0,0,0.7)",color:"#fff",border:"none",borderRadius:"50%",width:"22px",height:"22px",cursor:"pointer",fontSize:"12px",display:"flex",alignItems:"center",justifyContent:"center"},children:"â"})]},l))}),(i.photos||[]).length<3&&e("div",{style:{display:"flex",gap:"8px"},children:[e("button",{onClick:()=>{var t;return(t=R.current)==null?void 0:t.click()},style:{...s(!1,!1),flex:1},children:"Camera"}),e("button",{onClick:()=>{var t;return(t=B.current)==null?void 0:t.click()},style:{...s(!1,!1),flex:1},children:"Gallery"})]}),e("input",{ref:R,type:"file",accept:"image/*",capture:"environment",onChange:k,style:{display:"none"}}),e("input",{ref:B,type:"file",accept:"image/*",onChange:k,style:{display:"none"}})]}),e("div",{style:{marginBottom:"10px"},children:[e("label",{style:n(),children:"GOOGLE REVIEW URL"}),e("input",{type:"url",value:i.googleReviewUrl||"",onChange:t=>a("googleReviewUrl",t.target.value),placeholder:"https://...",style:d()})]})]}),e("div",{style:{marginBottom:"16px"},children:[e("label",{style:n(),children:"ORDER STYLE"}),e("input",{type:"text",value:i.orderStyle||"",onChange:t=>a("orderStyle",t.target.value),placeholder:"Plate, by the pound, sandwich, comboâ¦",style:d()})]}),e("div",{style:{marginBottom:"16px"},children:[e("label",{style:n(),children:"MEATS ORDERED"}),e("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px",marginBottom:"6px"},children:Q.map(t=>e("button",{onClick:()=>S("meats",t),style:s((i.meats||[]).includes(t),!0),children:t},t))}),e("input",{type:"text",value:i.meatOther||"",onChange:t=>a("meatOther",t.target.value),placeholder:"Other meat...",style:{...d(),fontSize:"12px"}})]}),e("div",{style:{marginBottom:"16px"},children:[e("label",{style:n(),children:"SIDES ORDERED"}),e("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px",marginBottom:"6px"},children:H.map(t=>e("button",{onClick:()=>S("sides",t),style:s((i.sides||[]).includes(t),!0),children:t},t))}),e("input",{type:"text",value:i.sideOther||"",onChange:t=>a("sideOther",t.target.value),placeholder:"Other side...",style:{...d(),fontSize:"12px"}})]}),e("div",{style:{display:"flex",gap:"8px",marginBottom:"20px"},children:[e("div",{style:{flex:1},children:[e("label",{style:n(),children:"DESSERT"}),e("input",{type:"text",value:i.dessert||"",onChange:t=>a("dessert",t.target.value),placeholder:"What'd you have?",style:d()})]}),e("div",{style:{flex:1},children:[e("label",{style:n(),children:"DRINKS"}),e("input",{type:"text",value:i.drinks||"",onChange:t=>a("drinks",t.target.value),placeholder:"Sweet tea, beerâ¦",style:d()})]})]}),e("div",{style:{marginBottom:"20px"},children:[e("label",{style:n(),children:"FRIENDS AT THIS MEAL"}),(i.friends||[]).length>0&&e("div",{style:{display:"flex",gap:"6px",flexWrap:"wrap",marginBottom:"8px"},children:(i.friends||[]).map(t=>e("div",{style:{display:"flex",alignItems:"center",gap:"4px",padding:"4px 10px",background:r.dark,borderRadius:"12px",border:`1px solid ${r.border}`,fontSize:"12px"},children:[e("span",{children:t.name}),e("button",{onClick:()=>$(t.name),style:{background:"none",border:"none",color:"#f87171",cursor:"pointer",fontSize:"14px",padding:"0 2px"},children:"â"})]},t.name))}),e("div",{style:{display:"flex",gap:"6px"},children:[e("input",{type:"text",value:f,onChange:t=>q(t.target.value),onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),C())},placeholder:"Add a friend...",style:{...d(),flex:1},list:"friend-suggestions"}),e("button",{onClick:C,disabled:!f.trim(),style:{...s(!!f.trim(),!0),whiteSpace:"nowrap"},children:"+ Add"})]}),w.length>0&&e("datalist",{id:"friend-suggestions",children:w.filter(t=>!(i.friends||[]).find(l=>
1l.name===t)).map(t=>e("option",{value:t},t))})]}),e("div",{className:"bbq-form-tracks",children:[e("div",{style:{marginBottom:"16px"},children:[e("div",{style:{fontFamily:"'Oswald', sans-serif",fontSize:"14px",letterSpacing:"2px",color:r.accent,marginBottom:"12px"},children:"BBQ Quality Track"}),x.bbq.map(t=>e(D,{c:t,S:r,value:i.scores[t.key],onPick:l=>v(t.key,l)},t.key))]}),e("div",{style:{marginBottom:"16px"},children:[e("div",{style:{fontFamily:"'Oswald', sans-serif",fontSize:"14px",letterSpacing:"2px",color:r.accent,marginBottom:"12px"},children:"Family Experience Track"}),x.family.map(t=>e(D,{c:t,S:r,value:i.scores[t.key],onPick:l=>v(t.key,l)},t.key))]})]}),(i.friends||[]).length>0&&e("div",{style:{marginBottom:"16px"},children:[e("div",{style:{fontFamily:"'Oswald', sans-serif",fontSize:"14px",letterSpacing:"2px",color:r.accent,marginBottom:"12px"},children:"Friend Scores"}),e("div",{style:{fontSize:"11px",color:r.muted,marginBottom:"10px"},children:"Tap a category number to set each friend's score"}),(i.friends||[]).map(t=>e("div",{style:{background:r.dark,borderRadius:"8px",padding:"12px",marginBottom:"8px",border:`1px solid ${r.border}`},children:[e("div",{style:{fontWeight:"600",fontSize:"14px",marginBottom:"10px",color:r.accent},children:t.name}),[...x.bbq,...x.family].map(l=>e("div",{style:{marginBottom:"8px"},children:[e("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"4px"},children:[e("span",{style:{fontSize:"11px",color:r.muted},children:l.label}),e("span",{style:{fontSize:"13px",fontWeight:"700",color:r.accent},children:t.scores[l.key]||"â"})]}),e("div",{style:{display:"flex",gap:"3px"},children:[1,2,3,4,5,6,7,8,9].map(o=>e("button",{onClick:()=>P(t.name,l.key,o),style:{flex:1,padding:"5px 0",background:t.scores[l.key]===o?r.accent:r.card,color:t.scores[l.key]===o?"#fff":r.muted,border:`1px solid ${t.scores[l.key]===o?r.accent:r.border}`,borderRadius:"3px",fontSize:"11px",fontWeight:"600",cursor:"pointer"},children:o},o))})]},l.key)),(()=>{const l=b(t.scores);return l.bbqAvg>0?e("div",{style:{textAlign:"center",padding:"8px 0",borderTop:`1px solid ${r.border}`,marginTop:"4px"},children:[e("span",{style:{color:"#fbbf24",fontSize:"13px"},children:["â
".repeat(l.stars),"â".repeat(5-l.stars)]}),e("span",{style:{marginLeft:"8px",fontWeight:"700",color:r.accent},children:l.composite.toFixed(2)})]}):null})()]},t.name))]}),e("div",{style:{background:r.dark,borderRadius:"8px",padding:"14px",marginBottom:"16px",textAlign:"center",border:`1px solid ${r.border}`},children:[e("div",{style:{color:"#fbbf24",fontSize:"18px"},children:["â
".repeat(y.stars),"â".repeat(5-y.stars)]}),e("div",{style:{fontSize:"24px",fontWeight:"700",color:r.accent,fontFamily:"'Oswald', sans-serif"},children:y.composite.toFixed(2)}),e("div",{style:{fontSize:"11px",color:r.muted},children:["BBQ ",y.bbqAvg.toFixed(2)," + Bonus ",y.bonus.toFixed(2)]}),(i.friends||[]).length>0&&(()=>{const t=[{name:"You",scores:i.scores},...i.friends||[]],l={};[...x.bbq,...x.family].forEach(c=>{const g=t.map(h=>h.scores[c.key]).filter(h=>h>0);l[c.key]=g.length?g.reduce((h,Y)=>h+Y,0)/g.length:0});const o=b(l);return e("div",{style:{marginTop:"8px",paddingTop:"8px",borderTop:`1px solid ${r.border}`},children:e("div",{style:{fontSize:"11px",color:r.muted},children:["Group Avg: ",o.composite.toFixed(2)," (",o.stars,"â
",")"]})})})()]}),e("div",{className:"bbq-form-selects",children:[e("div",{style:{marginBottom:"16px"},children:[e("label",{style:n(),children:"SAUCE DEPENDENCY"}),e("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:K.map(t=>e("button",{onClick:()=>a("sauceDep",t),style:s(i.sauceDep===t,!0),children:t},t))})]}),e("div",{style:{marginBottom:"16px"},children:[e("label",{style:n(),children:"WOULD WE RETURN?"}),e("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:V.map(t=>e("button",{onClick:()=>a("wouldReturn",t),style:s(i.wouldReturn===t,!0),children:t},t))})]})]}),e("div",{style:{marginBottom:"20px"},children:[e("label",{style:n(),children:"NOTES"}),(i.notesLog||[]).length>0&&e("div",{style:{marginBottom:"8px",background:r.dark,borderRadius:"6px",padding:"10px"},children:i.notesLog.map((t,l)=>e("div",{style:{fontSize:"12px",color:r.text,padding:"3px 0",borderBottom:l<i.notesLog.length-1?`1px solid ${r.border}`:"none"},children:t},l))}),e("div",{style:{display:"flex",gap:"6px"},children:[e("textarea",{value:i.notes||"",onChange:t=>a("notes",t.target.value),placeholder:"Add a note...",rows:2,style:{...d(),resize:"vertical",flex:1}}),e("button",{onClick:M,disabled:!((z=i.notes)!=null&&z.trim()),style:{...s(!!((O=i.notes)!=null&&O.trim()),!0),alignSelf:"flex-end",whiteSpace:"nowrap"},children:"+ Add"})]})]}),e("button",{onClick:A,disabled:!i.restaurant.trim(),style:{width:"100%",padding:"14px",fontFamily:"'Oswald', sans-serif",fontSize:"16px",fontWeight:"700",letterSpacing:"1px",borderRadius:"8px",border:"none",cursor:"pointer",background:i.restaurant.trim()?r.accent:"#333",color:i.restaurant.trim()?"#fff":"#666"},children:"Save"})]})}
1export{ee 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.