1import{r as M,j as e}from"./index-BCpPkyqe.js";import{r as U,d as v}from"./dayjs.min-CNBi1RcP.js";import{S as _,a as C,b as I,c as S,e as y}from"./sheet-CH1dfY2j.js";import{D as O,a as D,b as Y,c as F}from"./dropdown-menu-CBAmF_6x.js";import{F as T}from"./form-field-BYkWeKMz.js";import{u as L}from"./use-locale-B187lbU4.js";import{u as A}from"./use-translate-CU5bsLgX.js";import{u as z,a as B}from"./pax-selector-C8VGWSB5.js";import{c as s}from"./utils-Bd_-_kb0.js";import{u as H}from"./use-is-mobile-BDf3ps6V.js";import{C as E}from"./calendar-CzZXblzX.js";import{X as q}from"./dialog-CUHbjmBA.js";import{Z as P}from"./zap-BFfKiHpy.js";import{F as R}from"./flame-B8pbvX96.js";import{I as V}from"./info-bzQD-3bM.js";var j={exports:{}},Z=j.exports,w;function $(){return w||(w=1,(function(i,n){(function(r,t){i.exports=t(U())})(Z,(function(r){function t(d){return d&&typeof d=="object"&&"default"in d?d:{default:d}}var c=t(r),h={name:"it",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"qualche secondo",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(d){return d+"º"}};return c.default.locale(h,null,!0),h}))})(j)),j.exports}$();const G=8,N=i=>{const n=v().startOf("day"),r=i.startOf("day").diff(n,"day");return r===0?{label:"Fino a -40%",icon:e.jsx(P,{className:"w-2.5 h-2.5",fill:"white"}),className:"bg-red-500 text-white ring-red-600/30"}:r===1?{label:"Fino a -30%",icon:e.jsx(R,{className:"w-2.5 h-2.5",fill:"black"}),className:"bg-yellow-500 text-black ring-yellow-600/30"}:r>=2?{label:"Fino a -20%",icon:null,className:"bg-[#1B2A41] text-white ring-white/10"}:null};function J(i){const n=v();return[...Array(G).keys()].map(r=>{const t=n.add(r,"day"),c=t.locale(i).format("dddd D MMMM");return{date:t,label:c.charAt(0).toUpperCase()+c.slice(1)}})}function xe({className:i}){const n=A(),r=L(),{searchProps:t,setSearchProps:c}=z(),h=H(),d=B(),[X,x]=M.useState(!1),f=l=>{c(a=>({...a,checkIn:l,checkOut:void 0}))},u=t.checkIn?t.checkIn.locale(r).format("ddd D MMM").replace(/\./g,""):"",m=J(r),p=s("flex items-center shrink-0 w-fit shadow-sm transition-all","gap-0.5 px-2 py-1.5","text-[9px] font-bold whitespace-nowrap","rounded-full ring-1"),g=e.jsxs("div",{className:s("flex items-center gap-3 border-0 rounded-2xl min-h-[46px] px-4 group cursor-pointer w-full transition-all duration-300",t.checkIn?"bg-gray-100":"bg-transparent hover:bg-gray-50 "),children:[e.jsx("div",{className:s("flex shrink-0 items-center justify-center text-secondary-bg transition-colors duration-300"),children:e.jsx(E,{size:20,className:"opacity-60"})}),e.jsxs("div",{className:"flex flex-col justify-center flex-1 leading-tight text-left overflow-hidden",children:[e.jsx("span",{className:s("text-[10px] font-medium transition-all duration-200 ease-in-out",u?"opacity-100 h-3":"opacity-0 h-0 overflow-hidden"),children:n("search.checkIn")}),e.jsx(T,{withoutLabel:!0,label:n("search.checkIn"),className:s("h-auto p-0 border-0 bg-transparent text-sm shadow-none outline-none ring-0","focus:ring-0 focus:border-0 focus-visible:ring-0 focus-visible:outline-none","hover:bg-transparent cursor-pointer w-full capitalize truncate",u?"font-bold text-gray-900":"font-medium text-gray-400"),name:"from",value:u,onChange:()=>{},placeholder:n("search.checkIn")})]})]});return h||d?e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"hidden",value:t.checkIn?.format("YYYY-MM-DD")??"",name:"checkIn"}),e.jsxs(_,{onOpenChange:x,children:[e.jsx(C,{asChild:!0,children:e.jsx("div",{className:s("w-full",i),children:g})}),e.jsxs(I,{side:"bottom",className:"h-auto max-h-[90vh] rounded-t-[32px] p-0 overflow-hidden flex flex-col [&>button]:hidden",children:[e.jsxs("div",{className:"pt-3 px-5 ",children:[e.jsx("div",{className:"w-10 h-1 bg-gray-400 rounded-full mx-auto mb-3"}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(S,{className:"text-base font-bold text-gray-900",children:n("search.checkIn")}),e.jsx(y,{className:"p-1.5 rounded-full bg-gray-100 text-gray-400 active:scale-95 transition-all",children:e.jsx(q,{size:18})})]})]}),e.jsx("div",{className:"overflow-y-auto px-2 pb-6 ",children:m.map(l=>{const a=N(l.date),o=t.checkIn?.isSame(l.date,"day");return e.jsx(y,{asChild:!0,children:e.jsxs("div",{onClick:()=>f(l.date),className:s("flex items-center justify-between px-4 py-3 cursor-pointer rounded-xl transition-colors",o?"bg-[#2678CC]/10":"active:bg-[#2678CC]/5"),children:[e.jsx("span",{className:s("text-sm font-semibold capitalize",o?"text-[#1B2A41]":"text-gray-800"),children:l.label}),a&&e.jsxs("div",{className:s(p,a.className),children:[a.icon,e.jsx("span",{children:a.label})]})]})},l.date.toISOString())})})]})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"hidden",value:t.checkIn?.format("YYYY-MM-DD")??"",name:"checkIn"}),e.jsxs(O,{onOpenChange:x,children:[e.jsx(D,{className:s("text-left w-full cursor-pointer outline-none",i),children:g}),e.jsx(Y,{align:"start",className:"w-80 p-1.5 rounded-2xl shadow-xl border-gray-100",avoidCollisions:!1,children:m.map(l=>{const a=N(l.date),o=t.checkIn?.isSame(l.date,"day");return e.jsxs(F,{onClick:()=>f(l.date),className:s("flex items-center justify-between py-1.5 px-3 cursor-pointer rounded-lg outline-none transition-all","focus:bg-[#2678CC]/5",o&&"bg-[#2678CC]/10"),children:[e.jsx("span",{className:s("text-sm font-semibold capitalize",o?"text-[#1B2A41]":"text-gray-700"),children:l.label}),a&&e.jsxs("div",{className:s(p,a.className),children:[a.icon,e.jsx("span",{children:a.label})]})]},l.date.toISOString())})})]})]})}const K=7,k=(i,n)=>{if(!n)return null;const r=v().startOf("day"),c=n.startOf("day").diff(r,"day");return c===0?{label:"Fino a -40%",icon:e.jsx(P,{className:"w-2.5 h-2.5",fill:"white"}),className:"bg-red-500 text-white ring-red-600/30"}:c===1?{label:"Fino a -30%",icon:e.jsx(R,{className:"w-2.5 h-2.5",fill:"black"}),className:"bg-yellow-500 text-black ring-yellow-600/30"}:{label:"Fino a -20%",icon:null,className:"bg-[#1B2A41] text-white ring-white/10"}};function Q(i,n){return[...Array(K).keys()].map(r=>{const t=i.add(r+1,"day"),c=t.locale(n).format("dddd D MMMM");return{date:t,label:c.charAt(0).toUpperCase()+c.slice(1)}})}function fe({className:i}){const n=A(),r=L(),{searchProps:t,setSearchProps:c}=z(),h=H(),d=B(),[X,x]=M.useState(!1),f=a=>{c(o=>({...o,checkOut:a}))},u=t.checkOut?t.checkOut.locale(r).format("ddd D MMM").replace(/\./g,""):"",m=t.checkIn?Q(t.checkIn,r):[],p=s("flex items-center shrink-0 w-fit shadow-sm transition-all","gap-0.5 px-2 py-1.5","text-[9px] font-bold whitespace-nowrap","rounded-full ring-1"),g=e.jsxs("div",{className:s("flex items-center gap-3 border-0 rounded-2xl min-h-[46px] px-4 group cursor-pointer w-full transition-all duration-300",t.checkOut?"bg-gray-100":"bg-transparent hover:bg-gray-50"),children:[e.jsx("div",{className:s("flex shrink-0 items-center justify-center text-secondary-bg transition-colors duration-300"),children:e.jsx(E,{size:20,className:"opacity-60"})}),e.jsxs("div",{className:"flex flex-col justify-center flex-1 leading-tight text-left overflow-hidden",children:[e.jsx("span",{className:s("text-[10px] font-medium transition-all duration-200 ease-in-out",u?"opacity-100 h-3":"opacity-0 h-0 overflow-hidden"),children:n("search.checkOut")}),e.jsx(T,{withoutLabel:!0,label:n("search.checkOut"),className:s("h-auto p-0 border-0 bg-transparent text-sm shadow-none outline-none ring-0","focus:ring-0 focus:border-0 focus-visible:ring-0 focus-visible:outline-none","hover:bg-transparent cursor-pointer w-full capitalize truncate",u?"font-bold text-gray-900":"font-medium text-gray-400"),name:"to",value:u,onChange:()=>{},placeholder:n("search.checkOut")})]})]}),l=()=>e.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-center animate-in fade-in zoom-in duration-300",children:[e.jsx("div",{className:"w-12 h-12 bg-blue-50 rounded-full flex items-center justify-center mb-3",children:e.jsx(V,{className:"text-[#2678CC]",size:24})}),e.jsx("p",{className:"text-xs text-gray-500 max-w-[200px]",children:n("search.checkCompleteMemo")})]});return h||d?e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"hidden",value:t.checkOut?.format("YYYY-MM-DD")??"",name:"checkOut"}),e.jsxs(_,{onOpenChange:x,children:[e.jsx(C,{asChild:!0,children:e.jsx("div",{className:s("w-full",i),children:g})}),e.jsxs(I,{side:"bottom",className:"h-auto max-h-[90vh] rounded-t-[32px] p-0 overflow-hidden flex flex-col [&>button]:hidden",children:[e.jsxs("div",{className:"pt-3 px-5",children:[e.jsx("div",{className:"w-10 h-1 bg-gray-400 rounded-full mx-auto mb-3"}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(S,{className:"text-base font-bold text-gray-900",children:n("search.checkOut")}),e.jsx(y,{className:"p-1.5 rounded-full bg-gray-100 text-gray-400 active:scale-95 transition-all",children:e.jsx(q,{size:18})})]})]}),e.jsx("div",{className:"overflow-y-auto px-2 pb-6",children:m.length>0?m.map(a=>{const o=k(a.date,t.checkIn),b=t.checkOut?.isSame(a.date,"day");return e.jsx(y,{asChild:!0,children:e.jsxs("div",{onClick:()=>f(a.date),className:s("flex items-center justify-between px-4 py-3 cursor-pointer rounded-xl transition-colors",b?"bg-[#2678CC]/10":"active:bg-[#2678CC]/5"),children:[e.jsx("span",{className:s("text-sm font-semibold capitalize",b?"text-[#1B2A41]":"text-gray-800"),children:a.label}),o&&e.jsxs("div",{className:s(p,o.className),children:[o.icon,e.jsx("span",{children:o.label})]})]})},a.date.toISOString())}):e.jsx(l,{})})]})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"hidden",value:t.checkOut?.format("YYYY-MM-DD")??"",name:"checkOut"}),e.jsxs(O,{onOpenChange:x,children:[e.jsx(D,{className:s("text-left w-full cursor-pointer outline-none",i),children:g}),e.jsx(Y,{align:"start",side:"bottom",sideOffset:5,avoidCollisions:!1,className:"w-80 p-1.5 rounded-2xl shadow-xl border-gray-100 bg-white",children:m.length>0?m.map(a=>{const o=k(a.date,t.checkIn),b=t.checkOut?.isSame(a.date,"day");return e.jsxs(F,{onClick:()=>f(a.date),className:s("flex items-center justify-between py-1.5 px-3 cursor-pointer rounded-lg outline-none transition-all","focus:bg-[#2678CC]/5",b&&"bg-[#2678CC]/10"),children:[e.jsx("span",{className:s("text-sm font-semibold capitalize",b?"text-[#1B2A41]":"text-gray-700"),children:a.label}),o&&e.jsxs("div",{className:s(p,o.className),children:[o.icon,e.jsx("span",{children:o.label})]})]},a.date.toISOString())}):e.jsx(l,{})})]})]})}export{xe as C,fe as a};
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.