1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1467],{91467:function(e,t,n){"use strict";n.d(t,{Z:function(){return k}});var i,o=n(29815),l=n(85893),u=n(41609),a=n.n(u),r=n(67294),c=n(14924),s=n(91681),d=n(93967),p=n.n(d),m=n(97023),v=n.n(m),f=function(e){var t,n=e.onChange,i=void 0===n?function(){}:n,o=e.onKeyDown,u=e.onFocus,a=e.placeholder,d=e.onSearchButtonClick,m=e.value,f=void 0===m?"":m,h=e.inputRef,S=e.isButtonEnable,x=void 0!==S&&S,_=e.enableUniqueSize,g=void 0!==_&&_,b=e.smallSizeInput,I=void 0!==b&&b,y=e.displaySuggestions,j=void 0!==y&&y,R=e.roundStyle,N=void 0===R?{borderRadius:"14px"}:R,z=e.startIcon,w=(0,r.useState)(""),C=w[0],k=w[1],Z="small",D="medium",E=g||window.innerWidth<768,W=function(e){return(e=e.toString()).length>33?Z:e.length>22?D:"large"},F=function(e){var t=e.target.value;if(i(t),E)return null;k(W(t))},L=p()(v().inputFontSize,(t={},(0,c.Z)(t,v().inputMediumSearch,C===D),(0,c.Z)(t,v().inputSmallSearch,C===Z),(0,c.Z)(t,v().inputWithButton,x),(0,c.Z)(t,v().inputSearchUniqueSize,g),(0,c.Z)(t,v().smallSize,I),(0,c.Z)(t,v().inputWithStartIcon,z),t));(0,r.useLayoutEffect)(function(){if(E)return function(){};k(W(f))},[f,E]);var U=x&&(0,l.jsx)("button",{type:"submit",onClick:d,className:"".concat(v().searchIcon," ").concat(I&&v().smallSize," tid-searchBtn"),style:{borderRadius:"14px"},children:(0,l.jsx)("div",{className:"flex items-center justify-center rounded-full bg-primary ".concat(I?"h-9 w-9":"h-45px w-45px"),children:(0,l.jsx)(s.W1,{size:I?24:32,fill:"text-white"})})});return(0,l.jsxs)("div",{className:"".concat(v().container," tid-autoCompleteInput"),style:j?{borderRadius:"14px 14px 0 0"}:N,children:[z&&(0,l.jsx)("div",{className:v().startIcon,children:z}),U,(0,l.jsx)("input",{type:"text",className:"".concat(L," ").concat(v().inputSearch," tid-inputSearch"),onChange:F,onFocus:void 0===u?function(){}:u,onKeyDown:void 0===o?function(){}:o,placeholder:a,ref:h,value:f,style:j?{borderRadius:"14px 14px 0 0"}:N})]})},h=n(19386),S=n.n(h),x=n(46653),_=n(31132),g=n(5305),b=function(e,t){var n=t&&e.split("-")[0]===(null==t?void 0:t.split("-")[0]);return(0,_.Z)((0,g.Z)(e,"yyyy-MM-dd",new Date),"dd MMM"+(n?"":" yyyy"))},I=function(e){var t,n,i,o,u,a,r=e.item,d=e.onSelectItem,m=e.onDeleteRecentItem,v=e.isHighlightItem,f=e.search,h=p()(S().button,(t={},(0,c.Z)(t,S().buttonActive,v),(0,c.Z)(t,S().buttonRecent,r.isRecent),t));return(0,l.jsxs)("li",{className:S().container+(r.isRecent?" flex items-start mt-4":""),children:[(0,l.jsxs)("button",{type:"button",value:r.value,className:h+" tid-acItem",onClick:function(){return d(r)},children:[(0,l.jsx)("span",{children:r.isRecent?(0,l.jsx)(s.T3,{size:24,fill:"text-primary",className:"absolute -z-10"}):(0,l.jsx)(s._t,{size:24,fill:"text-primary",className:"absolute -z-10"})}),(0,l.jsx)("span",{className:S().detail,children:(0,l.jsx)("span",{className:"break-words font-JostRegular font-normal text-14 tracking-base inline-block text-dark",children:r.isRecent?(i=(null===(n=r.rooms)||void 0===n?void 0:n.length)&&(0,x.H)(r.rooms,!0),(0,l.jsxs)("span",{children:[(0,l.jsx)("b",{children:r.value}),(0,l.jsx)("br",{}),(0,l.jsxs)("span",{className:"text-10 sm:text-12",children:[!!r.startDate&&b(r.startDate,r.endDate),!!r.endDate&&" - "+b(r.endDate),!!i&&" | "+i]})]})):(o=r.value,a=RegExp(f,"gi"),o.replace(a,function(e){return"*b*".concat(e,"*b*")}).split("*b*").map(function(e,t){return t%2!=0?(0,l.jsx)("b",{children:e},t):e}))})})]}),!!r.isRecent&&!!m&&(0,l.jsx)("button",{type:"button",onClick:function(e){e.preventDefault(),e.stopPropagation(),m(r.id)},className:"transition-colors duration-200 pt-1 pl-2 pb-2 tid-acItemDelete text-grey hover:text-dark",children:(0,l.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"fill-current",children:(0,l.jsx)("path",{d:"M.176 1.028a.602.602 0 1 1 .852-.852L5 4.15 8.972.176a.602.602 0 1 1 .852.852L5.85 5l3.973 3.972a.602.602 0 1 1-.852.852L5 5.85 1.028 9.824a.602.602 0 1 1-.852-.852L4.15 5 .176 1.028Z"})})})]})},y=n(2317),j=n(69185),R=n.n(j),N=function(e){var t=e.onDeleteRecentItem,n=e.onClearRecentSearch,i=e.suggestions,o=void 0===i?[]:i,u=e.onSelectItem,a=void 0===u?function(){}:u,s=e.currentFocus,d=void 0===s?-1:s,m=e.enableUniqueSize,v=e.search,f=void 0===v?"":v,h=e.afterRecentSearchesContent,S=e.roundStyle,x=(0,r.useRef)(null),_=function(e){var t,n;null==x||null===(t=x.current)||void 0===t||null===(n=t.parentNode)||void 0===n||n.scrollTo({top:e,behavior:"smooth"})},g=p()(R().container,(0,c.Z)({},R().containerFullSize,void 0!==m&&m));(0,r.useLayoutEffect)(function(){var e,t;if(d<0||d>o.length||!x)return function(){};_(null===(t=null==x?void 0:null===(e=x.current)||void 0===e?void 0:e.children[d])||void 0===t?void 0:t.offsetTop)},[d]);var b=o.some(function(e){var t;return null===(t=e.items)||void 0===t?void 0:t.some(function(e){return e.isRecent})}),j=S||{borderRadius:o.length>0?"0 0 14px 14px":"14px"};return(0,l.jsx)("div",{className:g+" autocompleteSuggestionsContainer",style:j,children:(0,l.jsxs)("div",{className:R().scrollWrapper,children:[o.length>0&&o.map(function(e){var n;return(null==e?void 0:null===(n=e.items)||void 0===n?void 0:n.length)>0&&(0,l.jsxs)("div",{children:[o.length>1&&e.items.some(function(e){return e.isRecent})&&(0,l.jsx)("div",{className:"py-4 relative",children:(0,l.jsx)("div",{className:"w-full h-0 "+R().recentSearchesLine})}),(0,l.jsx)(y.Z,{textType:"link2",text:null==e?void 0:e.title,className:R().title}),(0,l.jsx)("ul",{ref:x,children:e.items.map(function(n,i){var o;return(0,l.jsx)(I,{item:n,onSelectItem:a,isHighlightItem:(null==e?void 0:null===(o=e.items)||void 0===o?void 0:o[d])===n,search:f,onDeleteRecentItem:t},i)})})]},null==e?void 0:e.title)}),b&&n&&(0,l.jsx)("button",{type:"button",className:"font-JostRegular font-normal text-12 tracking-base leading-17.7 underline hover:no-underline pl-1.5 cursor-pointer text-primary mt-4",onClick:function(){return n()},children:"Clear recent searches"}),h&&(0,l.jsxs)(l.Fragment,{children:[b&&(0,l.jsx)("div",{className:"py-4 relative",children:(0,l.jsx)("div",{className:"w-full h-0 "+R().recentSearchesLine})}),(0,l.jsx)("div",{className:b?"":"mt-4",children:h})]})]})})},z=r.memo(N),w=n(40183),C=n.n(w),k=function(e){var t=e.data,n=void 0===t?[]:t,i=e.notFilteredData,u=void 0===i?[]:i,c=e.didYouMean,s=void 0===c?[]:c,d=e.placeholder,p=e.value,m=e.onChange,v=void 0===m?function(){}:m,h=e.onSearchButtonClick,S=e.onDeleteRecentItem,x=e.onClearRecentSearch,_=e.isButtonEnable,g=e.enableUniqueSize,b=void 0!==g&&g,I=e.label,j=void 0===I?"":I,R=e.smallSizeInput,N=e.roundStyle,w=void 0===N?{borderRadius:"0 0 14px 14px"}:N,k=e.startIcon,Z=e.afterRecentSearchesContent,D=(0,r.useState)(!1),E=D[0],W=D[1],F=(0,r.useState)(p||""),L=F[0],U=F[1],B=(0,r.useState)(-1),M=B[0],q=B[1],J=(0,r.useRef)(null),O=(0,r.useRef)(null),T=(0,r.useState)([]),P=T[0],A=T[1],H=(0,r.useState)(JSON.parse(JSON.stringify(n))),K=H[0],G=H[1];(0,r.useEffect)(function(){return G(JSON.parse(JSON.stringify(n)))},[n]);var Q=function(){return W(!0)},Y=function(){return W(!1)};(0,r.useEffect)(function(){p&&U(p)}
1,[p]),(0,r.useEffect)(function(){document.activeElement!==O.current||a()(s.map(function(e){return e.items})[0])&&a()(u.map(function(e){return e.items})[0])||Q()},[u,s]),(0,r.useEffect)(function(){q(-1);var e=K.map(function(e){var t=e.items.filter(function(t,n){var i=e.items[n].value.substring(0,L.length);return(null==i?void 0:i.toUpperCase())!==(null==L?void 0:L.toUpperCase())?null:t});return e.items=t,e});a()(e.map(function(e){return e.items})[0])&&a()(s.map(function(e){return e.items})[0])&&a()(u.map(function(e){return e.items})[0])&&Y(),A(e)},[n,L]);var V=function(e){Q(),U(e),v(e),G(JSON.parse(JSON.stringify(n)))},X=(0,r.useCallback)(function(e){U(null==e?void 0:e.value),v(e),Y(),G(JSON.parse(JSON.stringify(n)))},[]),$=function(){u.length>0&&Q()},ee=function(e){var t=e.keyCode;40===t&&E&&q(function(e){return P&&e<(null==P?void 0:P.length)-1?e+1:0}),P&&38===t&&q(function(e){return e>0?e-1:(null==P?void 0:P.length)-1}),27===t&&Y(),9!==t||a()(P&&P[0])||(e.preventDefault(),U(P?P[0].items[0].value:""),Y(),v(P&&P[0].items[0])),13===t&&M>=0&&(U(P?P[M].items[0].value:""),v(P&&P[M]),Y()),13===t&&L.length>0&&-1===M&&Y()},et=function(){return v(L)},en=function(){if(E){var e,t;O.current.selectionStart=null==O?void 0:null===(e=O.current)||void 0===e?void 0:e.value.length,O.current.selectionEnd=null==O?void 0:null===(t=O.current)||void 0===t?void 0:t.value.length}},ei=function(e){var t,n,i=e.target;(null==J?void 0:null===(t=J.current)||void 0===t?void 0:null===(n=t.contains)||void 0===n?void 0:n.call(t,i))||Y()};(0,r.useEffect)(function(){return en(),window.addEventListener("mousedown",ei),function(){window.removeEventListener("mousedown",ei)}},[ei,E]);var eo=E&&(0,l.jsx)(z,{suggestions:(0,o.Z)(s).concat((0,o.Z)(P),(0,o.Z)(u)),onSelectItem:X,currentFocus:M,enableUniqueSize:b,search:L,onDeleteRecentItem:function(e){var t;null==S||S(e),null===(t=O.current)||void 0===t||t.focus()},onClearRecentSearch:x,afterRecentSearchesContent:Z,roundStyle:w});return(0,l.jsxs)("div",{className:C().container,ref:J,style:w,children:[!a()(j)&&(0,l.jsx)(y.Z,{className:C().label,textType:"link2",text:j,block:!0}),(0,l.jsx)(f,{onSearchButtonClick:h,placeholder:void 0===d?"":d,onChange:V,onKeyDown:ee,onSearch:et,onFocus:$,value:L,inputRef:O,isButtonEnable:void 0===_||_,enableUniqueSize:b,smallSizeInput:void 0!==R&&R,displaySuggestions:E,startIcon:k}),eo]})}},40183:function(e){e.exports={container:"autocomplete_container__o7sai",label:"autocomplete_label__r5iPY"}},97023:function(e){e.exports={container:"autocompleteInput_container__Sx48y",startIcon:"autocompleteInput_startIcon__2a1GG",searchIcon:"autocompleteInput_searchIcon__gKo9t",inputSearch:"autocompleteInput_inputSearch__Z4Ts8",inputFontSize:"autocompleteInput_inputFontSize__93Il6",inputWithButton:"autocompleteInput_inputWithButton__9z2hv",inputWithStartIcon:"autocompleteInput_inputWithStartIcon__TraeS",inputMediumSearch:"autocompleteInput_inputMediumSearch__jLc55",inputSmallSearch:"autocompleteInput_inputSmallSearch__MpXUH",inputSearchUniqueSize:"autocompleteInput_inputSearchUniqueSize__M8mpZ",autocompletePrefix:"autocompleteInput_autocompletePrefix__iB282",autocompletePrefixUniqueSize:"autocompleteInput_autocompletePrefixUniqueSize__jxuYz",smallSize:"autocompleteInput_smallSize__W2t6W"}},19386:function(e){e.exports={container:"autocompleteItem_container__cIfwj",button:"autocompleteItem_button__u6Wxf",buttonActive:"autocompleteItem_buttonActive__Wh59i",buttonRecent:"autocompleteItem_buttonRecent__uxVRF",detail:"autocompleteItem_detail__FQAGi"}},69185:function(e){e.exports={container:"autocompleteSuggestions_container__QrLlv",scrollWrapper:"autocompleteSuggestions_scrollWrapper__tW2Rk",containerFullSize:"autocompleteSuggestions_containerFullSize__LQxW7",recentSearchesLine:"autocompleteSuggestions_recentSearchesLine__oO42i",title:"autocompleteSuggestions_title__rkh8_"}}}]);
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.